]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix comments and code snippets that were making incorrect claims about
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 14 Feb 2014 08:55:32 +0000 (08:55 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 14 Feb 2014 08:55:32 +0000 (08:55 +0000)
the alignment requirement of the guest state, shadow areas, and register
spill area sizes.
The size of these areas ought to be a multiple of 16 bytes.

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

VEX/priv/guest_arm_helpers.c
VEX/priv/guest_x86_helpers.c
VEX/priv/host_generic_reg_alloc2.c
VEX/pub/libvex.h
VEX/pub/libvex_guest_arm.h
VEX/pub/libvex_guest_arm64.h
VEX/pub/libvex_guest_mips32.h
VEX/pub/libvex_guest_mips64.h
VEX/pub/libvex_guest_ppc32.h
VEX/pub/libvex_guest_s390x.h
VEX/pub/libvex_guest_x86.h

index 72040ea31be416233f401e2615af47d96ebe3214..ddaf3355ebd784c72fc4a5ac2b9f05ccca680d32 100644 (file)
@@ -1030,10 +1030,6 @@ void LibVEX_GuestARM_initialise ( /*OUT*/VexGuestARMState* vex_state )
    vex_state->guest_ITSTATE = 0;
 
    vex_state->padding1 = 0;
-   vex_state->padding2 = 0;
-   vex_state->padding3 = 0;
-   vex_state->padding4 = 0;
-   vex_state->padding5 = 0;
 }
 
 
index d29d2eef913b024cd27ff9d323756c435da0dff5..fe808b0b8f20a168833bc6533e70ead2dc9d5ea5 100644 (file)
@@ -2764,11 +2764,7 @@ void LibVEX_GuestX86_initialise ( /*OUT*/VexGuestX86State* vex_state )
    vex_state->guest_SC_CLASS = 0;
    vex_state->guest_IP_AT_SYSCALL = 0;
 
-   Int i;
-   for (i = 0; i < sizeof(vex_state->padding)
-                   / sizeof(vex_state->padding[0]); i++) {
-      vex_state->padding[i] = 0;
-   }
+   vex_state->padding1 = 0;
 }
 
 
index 2b6d07475c80e4f0632636e3939aa620c87dd2a9..ac853a508d9d8e1379af9d244a82e7bd2dc56141 100644 (file)
@@ -399,9 +399,9 @@ HInstrArray* doRegisterAllocation (
       not at each insn processed. */
    Bool do_sanity_check;
 
-   vassert(0 == (guest_sizeB % 32));
-   vassert(0 == (LibVEX_N_SPILL_BYTES % 32));
-   vassert(0 == (N_SPILL64S % 4));
+   vassert(0 == (guest_sizeB % 16));
+   vassert(0 == (LibVEX_N_SPILL_BYTES % 16));
+   vassert(0 == (N_SPILL64S % 2));
 
    /* The live range numbers are signed shorts, and so limiting the
       number of insns to 15000 comfortably guards against them
index e4daa794464bab12eeaf0c4b9802190cec7eccd5..4cc6156f9990105fc2ca02914ac9b8be065833f5 100644 (file)
@@ -521,7 +521,7 @@ extern void LibVEX_ShowAllocStats ( void );
 typedef
    struct {
       /* Total size of the guest state, in bytes.  Must be
-         8-aligned. */
+         16-aligned. */
       Int total_sizeB;
       /* Whereabouts is the stack pointer? */
       Int offset_SP;
index b4edef72d6aaeeed0bab9de03ecbc305473f0e1d..b7fcea7be85591d2092a97271f7f64501515d6cc 100644 (file)
@@ -193,12 +193,8 @@ typedef
       */
       UInt guest_ITSTATE;
 
-      /* Padding to make it have an 32-aligned size */
+      /* Padding to make it have an 16-aligned size */
       UInt padding1;
-      UInt padding2;
-      UInt padding3;
-      UInt padding4;
-      UInt padding5;
    }
    VexGuestARMState;
 
index de762140accb64b3b6a5dddf1075f14baf88507d..81cac6472cd5ec2caaa70d9b759760be0f0d2229 100644 (file)
@@ -158,7 +158,7 @@ typedef
          does get set when required. */
       UInt  guest_FPSR;
 
-      /* Padding to make it have an 32-aligned size */
+      /* Padding to make it have an 16-aligned size */
       UInt  pad_end_0;
       ULong pad_end_1;
    }
index a49c646d522931342e610027d2252b7de094cd83..95c2a58374d1d850566c0548f91cf1167a00ebdf 100644 (file)
@@ -148,7 +148,7 @@ typedef
         ULong guest_ac2;        /* 344 */
         ULong guest_ac3;        /* 352 */
         
-        UInt padding[6];
+        UInt padding[2];
 } VexGuestMIPS32State;
 /*---------------------------------------------------------------*/
 /*--- Utility functions for MIPS32 guest stuff.               ---*/
index 9d03386b33b02128271294456ceed5055cdf000b..bbf43854dc591160bde016f2c7ec7ff3659ca26e 100644 (file)
@@ -145,7 +145,7 @@ typedef
         ULong host_EvC_FAILADDR; /* 600 */
         UInt host_EvC_COUNTER;   /* 608 */
         UInt guest_COND;         /* 612 */
-        UInt padding[6];
+        UInt padding[2];
 } VexGuestMIPS64State;
 
 /*---------------------------------------------------------------*/
index 669cc15b950ecce96e723bf78d787f52fcd02a73..66789be3c9604e785bf56d026d3c8d1585277f97 100644 (file)
@@ -242,7 +242,7 @@ typedef
       /* 1368 */ ULong guest_TEXASR;    // Transaction EXception And Summary Register
       /* 1376 */ ULong guest_TFIAR;     // Transaction Failure Instruction Address Register
 
-      /* Padding to make it have an 8-aligned size */
+      /* Padding to make it have an 16-aligned size */
       /* 1384 */ UInt  padding2;
 
    }
index d540c3c005ed4c9a7da45a180900d60e86805e95..c074e921d775a050d391dce10537aa087032bc9e 100644 (file)
@@ -148,11 +148,11 @@ typedef struct {
    /*  424 */  ULong host_EvC_FAILADDR;
 
 /*------------------------------------------------------------*/
-/*--- Force alignment to 32 bytes                          ---*/
+/*--- Force alignment to 16 bytes                          ---*/
 /*------------------------------------------------------------*/
-   /*  432 */  UChar padding[16];
+   /*  432 */  UChar padding[0];
 
-   /*  448 */  /* This is the size of the guest state */
+   /*  432 */  /* This is the size of the guest state */
 } VexGuestS390XState;
 
 
index 6c99bc97a2beebcc95c414f31912241c16b84d3a..597143f90deb77cba40a58040fa49354dd1d3298 100644 (file)
@@ -220,8 +220,8 @@ typedef
          been interrupted by a signal. */
       UInt guest_IP_AT_SYSCALL;
 
-      /* Padding to make it have an 32-aligned size */
-      UInt padding[5];
+      /* Padding to make it have an 16-aligned size */
+      UInt padding1;
    }
    VexGuestX86State;