#define VGA_CLREQ_ARGS guest_RAX
#define VGA_CLREQ_RET guest_RDX
-/* ---------------------------------------------------------------------
- Architecture-specific part of a ThreadState
- ------------------------------------------------------------------ */
-
-// Architecture-specific part of a ThreadState
-// XXX: eventually this should be made abstract, ie. the fields not visible
-// to the core...
-typedef
- struct {
- /* --- BEGIN vex-mandated guest state --- */
-
- /* Saved machine context. */
- VexGuestAMD64State vex;
-
- /* Saved shadow context. */
- VexGuestAMD64State vex_shadow;
-
- /* Spill area. */
- UChar vex_spill[LibVEX_N_SPILL_BYTES];
-
- /* --- END vex-mandated guest state --- */
- }
- ThreadArchState;
-
-typedef VexGuestAMD64State VexGuestArchState;
-
/* ---------------------------------------------------------------------
Miscellaneous constants
------------------------------------------------------------------ */
#include "libvex.h"
#include "libvex_guest_arm.h"
-
/* ---------------------------------------------------------------------
Basic properties
------------------------------------------------------------------ */
#define VGA_CLREQ_ARGS guest_R0
#define VGA_CLREQ_RET guest_R0
-// Get stack pointer and frame pointer
-#define VGA_GET_REAL_STACK_PTR(esp) do { \
- I_die_here; \
-} while (0)
-
-#define VGA_GET_REAL_FRAME_PTR(ebp) do { \
- I_die_here; \
-} while (0)
-
-/* ---------------------------------------------------------------------
- Architecture-specific part of a ThreadState
- ------------------------------------------------------------------ */
-
-// Architecture-specific part of a ThreadState
-// XXX: eventually this should be made abstract, ie. the fields not visible
-// to the core... ??
-typedef struct {
- /* Saved machine context. */
- VexGuestARMState vex;
-
- /* Saved shadow context. */
- VexGuestARMState vex_shadow;
-
- /* Spill area. */
- UChar vex_spill[LibVEX_N_SPILL_BYTES];
-}
-ThreadArchState;
-
-typedef VexGuestARMState VexGuestArchState;
-
/* ---------------------------------------------------------------------
Miscellaneous constants
------------------------------------------------------------------ */
}
VgSchedReturnCode;
+
+#if defined(VGA_x86)
+ typedef VexGuestX86State VexGuestArchState;
+#elif defined(VGA_x86)
+ typedef VexGuestAMD64State VexGuestArchState;
+#elif defined(VGA_arm)
+ typedef VexGuestARMState VexGuestArchState;
+#else
+# error Unknown architecture
+#endif
+
+
+typedef
+ struct {
+ /* --- BEGIN vex-mandated guest state --- */
+
+ /* Saved machine context. */
+ VexGuestArchState vex;
+
+ /* Saved shadow context. */
+ VexGuestArchState vex_shadow;
+
+ /* Spill area. */
+ UChar vex_spill[LibVEX_N_SPILL_BYTES];
+
+ /* --- END vex-mandated guest state --- */
+ }
+ ThreadArchState;
+
+
struct _ThreadState {
/* ThreadId == 0 (and hence vg_threads[0]) is NEVER USED.
The thread identity is simply the index in vg_threads[].
//extern const Char VG_(helper_breakpoint)[];
-/* ---------------------------------------------------------------------
- Architecture-specific part of a ThreadState
- ------------------------------------------------------------------ */
-
-typedef
- struct {
- /* --- BEGIN vex-mandated guest state --- */
-
- /* Saved machine context. */
- VexGuestX86State vex;
-
- /* Saved shadow context. */
- VexGuestX86State vex_shadow;
-
- /* Spill area. */
- UChar vex_spill[LibVEX_N_SPILL_BYTES];
-
- /* --- END vex-mandated guest state --- */
- }
- ThreadArchState;
-
-typedef VexGuestX86State VexGuestArchState;
-
/* ---------------------------------------------------------------------
Miscellaneous constants
------------------------------------------------------------------ */