]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Move ThreadArchState into core.h and avoid duplication.
authorNicholas Nethercote <njn@valgrind.org>
Mon, 16 May 2005 21:16:44 +0000 (21:16 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Mon, 16 May 2005 21:16:44 +0000 (21:16 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3747

coregrind/amd64/core_arch.h
coregrind/arm/core_arch.h
coregrind/core.h
coregrind/x86/core_arch.h

index 515d3bf082a4c67ca247d6f3b0be444cf91234d2..193a5ef75a5a09d8a1ed033adf295e164f451075 100644 (file)
 #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
    ------------------------------------------------------------------ */
index 3216187dc6bc5a96bb0e21e84749064e6b8e4dc4..13ad9c81e0695e00b21fa4d768626b86d79094d9 100644 (file)
@@ -36,7 +36,6 @@
 #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
    ------------------------------------------------------------------ */
index 59d7932006ac62709cb374a91cf2cf47196a1b8d..824ac7d6c8360081dcb6ad744d003d85843d9ad2 100644 (file)
@@ -300,6 +300,36 @@ typedef
    }
    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[].
index 68f4faf1bb3226cb08003bbeb24a9d80d8cc49f9..a0816d684a22c48f02f033164fa2bac9c6e25d5b 100644 (file)
 //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
    ------------------------------------------------------------------ */