]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Change remaining use of Addr64 in the VEX API to Addr. The reduces
authorFlorian Krohm <florian@eich-krohm.de>
Sun, 4 Jan 2015 17:20:19 +0000 (17:20 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sun, 4 Jan 2015 17:20:19 +0000 (17:20 +0000)
the size of VexGuestExtent to 20 bytes on a 32-bit platform.
Change prototypes of x86g_dirtyhelper_loadF80le and
x86g_dirtyhelper_storeF80le to give the address in the parameter
list type Addr. Likewise for amd64g_dirtyhelper_loadF80le and
amd64g_dirtyhelper_storeF80le.
Update switchback.c - but not tested.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3056

VEX/priv/guest_amd64_defs.h
VEX/priv/guest_amd64_helpers.c
VEX/priv/guest_generic_bb_to_IR.c
VEX/priv/guest_x86_defs.h
VEX/priv/guest_x86_helpers.c
VEX/pub/libvex.h
VEX/switchback/switchback.c

index a2956484fa2a80218c80dc688ccf4229066ff547..8ccce6f75e4bdee9d23f261194541c51ca071aa8 100644 (file)
@@ -159,9 +159,9 @@ extern ULong amd64g_calculate_pdep  ( ULong, ULong );
 
 /* --- DIRTY HELPERS --- */
 
-extern ULong amd64g_dirtyhelper_loadF80le  ( ULong/*addr*/ );
+extern ULong amd64g_dirtyhelper_loadF80le  ( Addr/*addr*/ );
 
-extern void  amd64g_dirtyhelper_storeF80le ( ULong/*addr*/, ULong/*data*/ );
+extern void  amd64g_dirtyhelper_storeF80le ( Addr/*addr*/, ULong/*data*/ );
 
 extern void  amd64g_dirtyhelper_CPUID_baseline ( VexGuestAMD64State* st );
 extern void  amd64g_dirtyhelper_CPUID_sse3_and_cx16 ( VexGuestAMD64State* st );
index 15dc8bcb11f312bf67e6d2563bfd0b5a2a8bd841..779f75b3265eeeb5bdae0967eebd00cec8ac1020 100644 (file)
@@ -2051,18 +2051,18 @@ void amd64g_dirtyhelper_FINIT ( VexGuestAMD64State* gst )
 
 /* CALLED FROM GENERATED CODE */
 /* DIRTY HELPER (reads guest memory) */
-ULong amd64g_dirtyhelper_loadF80le ( ULong addrU )
+ULong amd64g_dirtyhelper_loadF80le ( Addr addrU )
 {
    ULong f64;
-   convert_f80le_to_f64le ( (UChar*)ULong_to_Ptr(addrU), (UChar*)&f64 );
+   convert_f80le_to_f64le ( (UChar*)addrU, (UChar*)&f64 );
    return f64;
 }
 
 /* CALLED FROM GENERATED CODE */
 /* DIRTY HELPER (writes guest memory) */
-void amd64g_dirtyhelper_storeF80le ( ULong addrU, ULong f64 )
+void amd64g_dirtyhelper_storeF80le ( Addr addrU, ULong f64 )
 {
-   convert_f64le_to_f80le( (UChar*)&f64, (UChar*)ULong_to_Ptr(addrU) );
+   convert_f64le_to_f80le( (UChar*)&f64, (UChar*)addrU );
 }
 
 
index f74c15ca089ca627eb1c5dcd4dbdd1a582d28dc6..426434642327366d999170d8cfc2298236b042c7 100644 (file)
@@ -514,7 +514,7 @@ IRSB* bb_to_IR (
       that do.
    */
    {
-      Addr64   base2check;
+      Addr     base2check;
       UInt     len2check;
       HWord    expectedhW;
       IRTemp   tistart_tmp, tilen_tmp;
index 47ce896c57a0ada2a13010d420343f4460a0f0d8..3dc34c8bc3f1531dc17185e7db62c41bcbf3fcdc 100644 (file)
@@ -139,9 +139,9 @@ extern ULong x86g_calculate_mmx_psadbw   ( ULong, ULong );
 
 /* --- DIRTY HELPERS --- */
 
-extern ULong x86g_dirtyhelper_loadF80le  ( UInt );
+extern ULong x86g_dirtyhelper_loadF80le  ( Addr );
 
-extern void  x86g_dirtyhelper_storeF80le ( UInt, ULong );
+extern void  x86g_dirtyhelper_storeF80le ( Addr, ULong );
 
 extern void  x86g_dirtyhelper_CPUID_sse0 ( VexGuestX86State* );
 extern void  x86g_dirtyhelper_CPUID_mmxext ( VexGuestX86State* );
index 1272fcec2ef884f00490e47c74b567b41125b37e..ef5e09e720f44e2c63490f943c2e74bb6a9e3f1f 100644 (file)
@@ -1437,18 +1437,18 @@ UInt x86g_calculate_FXAM ( UInt tag, ULong dbl )
 
 /* CALLED FROM GENERATED CODE */
 /* DIRTY HELPER (reads guest memory) */
-ULong x86g_dirtyhelper_loadF80le ( UInt addrU )
+ULong x86g_dirtyhelper_loadF80le ( Addr addrU )
 {
    ULong f64;
-   convert_f80le_to_f64le ( (UChar*)ULong_to_Ptr(addrU), (UChar*)&f64 );
+   convert_f80le_to_f64le ( (UChar*)addrU, (UChar*)&f64 );
    return f64;
 }
 
 /* CALLED FROM GENERATED CODE */
 /* DIRTY HELPER (writes guest memory) */
-void x86g_dirtyhelper_storeF80le ( UInt addrU, ULong f64 )
+void x86g_dirtyhelper_storeF80le ( Addr addrU, ULong f64 )
 {
-   convert_f64le_to_f80le( (UChar*)&f64, (UChar*)ULong_to_Ptr(addrU) );
+   convert_f64le_to_f80le( (UChar*)&f64, (UChar*)addrU );
 }
 
 
index bde9656821977130951578df130feeffb329c6ce..442ca8fb0de2f68ec24d0ad5ebf830f76be953ea 100644 (file)
@@ -366,7 +366,7 @@ typedef
          (function call) ?  Is supplied with the guest address of the
          target of the call since that may be significant.  If NULL,
          is assumed equivalent to a fn which always returns False. */
-      Bool (*guest_ppc_zap_RZ_at_bl)(Addr64);
+      Bool (*guest_ppc_zap_RZ_at_bl)(Addr);
 
       /* PPC32/PPC64 HOSTS only: does '&f' give us a pointer to a
          function descriptor on the host, or to the function code
@@ -569,12 +569,13 @@ typedef
    scheme of describing a chunk of guest code merely by its start
    address and length is inadequate.
 
-   Hopefully this struct is only 32 bytes long.  Space is important as
-   clients will have to store one of these for each translation made.
+   This struct uses 20 bytes on a 32-bit archtecture and 32 bytes on a
+   64-bit architecture.  Space is important as clients will have to store
+   one of these for each translation made.
 */
 typedef
    struct {
-      Addr64 base[3];
+      Addr   base[3];
       UShort len[3];
       UShort n_used;
    }
index deecc540459915eae236add20933d713eea7812d..f3603d189a152c51e75f5813f9deae43e90706bd 100644 (file)
@@ -414,8 +414,8 @@ void switchback ( void )
 
    UInt* p = (UInt*)(&copy[off_nopstart]);
 
-   Addr64 addr_of_nop = (Addr64)p;
-   Addr64 where_to_go = gst.guest_PC;
+   Addr addr_of_nop = (Addr)p;
+   Addr where_to_go = gst.guest_PC;
    Long   diff = ((Long)where_to_go) - ((Long)addr_of_nop);
 
    if (0) {
@@ -519,12 +519,12 @@ HWord run_translation ( HWord translation )
    return trc;
 }
 
-HWord find_translation ( Addr64 guest_addr )
+HWord find_translation ( Addr guest_addr )
 {
    Int i;
    HWord __res;
    if (0)
-      printf("find translation %p ... ", ULong_to_Ptr(guest_addr));
+     printf("find translation %p ... ", (void *)(guest_addr));
    for (i = 0; i < trans_table_used; i++)
      if (trans_table[i].base[0] == guest_addr)
         break;
@@ -552,7 +552,7 @@ HWord find_translation ( Addr64 guest_addr )
 
 #define N_TRANSBUF 5000
 static UChar transbuf[N_TRANSBUF];
-void make_translation ( Addr64 guest_addr, Bool verbose )
+void make_translation ( Addr guest_addr, Bool verbose )
 {
    VexTranslateArgs   vta;
    VexTranslateResult tres;
@@ -573,7 +573,7 @@ void make_translation ( Addr64 guest_addr, Bool verbose )
 
    assert(trans_table_used < N_TRANS_TABLE);
    if (0)
-      printf("make translation %p\n", ULong_to_Ptr(guest_addr));
+     printf("make translation %p\n", (void *)guest_addr);
 
    LibVEX_default_VexArchInfo(&vex_archinfo);
    //vex_archinfo.subarch = VexSubArch;
@@ -584,7 +584,7 @@ void make_translation ( Addr64 guest_addr, Bool verbose )
    vta.archinfo_guest   = vex_archinfo;
    vta.arch_host        = VexArch;
    vta.archinfo_host    = vex_archinfo;
-   vta.guest_bytes      = (UChar*)ULong_to_Ptr(guest_addr);
+   vta.guest_bytes      = (UChar*)guest_addr;
    vta.guest_bytes_addr = guest_addr;
    vta.chase_into_ok    = chase_into_ok;
 //   vta.guest_extents    = &vge;
@@ -631,7 +631,7 @@ void make_translation ( Addr64 guest_addr, Bool verbose )
 
 
 __attribute__((unused))
-static Bool overlap ( Addr64 start, UInt len, VexGuestExtents* vge )
+static Bool overlap ( Addr start, UInt len, VexGuestExtents* vge )
 {
    Int i;
    for (i = 0; i < vge->n_used; i++) {
@@ -670,8 +670,8 @@ void log_bytes ( HChar* bytes, Int nbytes )
    serviceFn(0)). */
 static void run_simulator ( void )
 {
-   static Addr64 last_guest = 0;
-   Addr64 next_guest;
+   static Addr last_guest = 0;
+   Addr  next_guest;
    HWord next_host;
    while (1) {
       next_guest = gst.GuestPC;
@@ -679,7 +679,7 @@ static void run_simulator ( void )
       if (0)
          printf("\nnext_guest: 0x%x\n", (UInt)next_guest);
 
-      if (next_guest == Ptr_to_ULong(&serviceFn)) {
+      if (next_guest == (Addr)&serviceFn) {
 
          /* "do" the function call to serviceFn */
 #        if defined(__i386__)