Changeset 161 in vbox
- Timestamp:
- Jan 18, 2007 6:25:45 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdm.h
r1 r161 5404 5404 * call PDMR3QueryDevice(). */ 5405 5405 PDMIBASE IBase; 5406 #if HC_ARCH_BITS == 32 5406 5407 /* padding to make achInstanceData aligned at 16 byte boundrary. */ 5407 uint32_t au32Padding[HC_ARCH_BITS == 32 ? 2 : 1]; 5408 uint32_t au32Padding[HC_ARCH_BITS == 32 ? 2 : 0]; 5409 #endif 5408 5410 /** Device instance data. The size of this area is defined 5409 5411 * in the PDMDEVREG::cbInstanceData field. */ -
trunk/include/VBox/vm.h
r119 r161 317 317 318 318 319 /* padding to make gnuc put the StatQemuToGC where msc does. */ 319 320 #if HC_ARCH_BITS == 32 320 /* padding to make gnuc put the StatQemuToGC where msc does. */321 321 uint32_t padding0; 322 322 #endif … … 347 347 348 348 /* padding - the unions must be aligned on 32 bytes boundraries. */ 349 #if HC_ARCH_BITS == 32 350 char padding[16]; 351 #endif 349 uint32_t padding[HC_ARCH_BITS == 32 ? 4 : 6]; 352 350 353 351 /** CPUM part. */ … … 357 355 struct CPUM s; 358 356 #endif 359 char padding[ 3424]; /* multiple of 32 */357 char padding[HC_ARCH_BITS == 32 ? 3424 : 3552]; /* multiple of 32 */ 360 358 } cpum; 361 359 … … 483 481 struct DBGF s; 484 482 #endif 485 char padding[ 1888]; /* multiple of 32 */483 char padding[HC_ARCH_BITS == 32 ? 1888 : 1920]; /* multiple of 32 */ 486 484 } dbgf; 487 485 -
trunk/src/VBox/VMM/EMInternal.h
r49 r161 255 255 /** Padding used in the other rings. 256 256 * This must be larger than jmp_buf on any supported platform. */ 257 char achPaddingFatalLongJump[ 176];257 char achPaddingFatalLongJump[HC_ARCH_BITS == 32 ? 176 : 208]; 258 258 #ifdef IN_RING3 259 259 /** Long buffer jump for fatal VM errors. -
trunk/src/VBox/VMM/MMInternal.h
r23 r161 589 589 /** Set if PGM has been initialized and we can safely call PGMR3Map(). */ 590 590 bool fPGMInitialized; 591 #if GC_ARCH_BITS == 64 591 #if GC_ARCH_BITS == 64 || HC_ARCH_BITS == 64 592 592 uint32_t u32Padding1; /**< alignment padding. */ 593 593 #endif -
trunk/src/VBox/VMM/PDMInternal.h
r23 r161 254 254 /** @copydoc PDMPICREG::pfnGetInterruptHC */ 255 255 DECLGCCALLBACKMEMBER(int, pfnGetInterruptGC,(PPDMDEVINS pDevIns)); 256 #if GC_ARCH_BITS == 32 257 RTGCPTR GCPtrPadding; /**< Alignment padding. */ 258 #endif 256 259 } PDMPIC; 257 260 -
trunk/src/VBox/VMM/PGMInternal.h
r28 r161 449 449 #endif 450 450 /** Array of cached physical addresses for the monitored ranged. */ 451 PGMPHYS2VIRTHANDLER aPhysToVirt[1];451 PGMPHYS2VIRTHANDLER aPhysToVirt[HC_ARCH_BITS == 32 ? 1 : 2]; 452 452 } PGMVIRTHANDLER; 453 453 /** Pointer to a virtual page access handler structure. */ … … 1243 1243 DECLGCCALLBACKMEMBER(int, pfnGCShwSetPDEByIndex,(PVM pVM, uint32_t iPD, X86PDEPAE Pde)); 1244 1244 DECLGCCALLBACKMEMBER(int, pfnGCShwModifyPDEByIndex,(PVM pVM, uint32_t iPD, uint64_t fFlags, uint64_t fMask)); 1245 #if GC_ARCH_BITS == 32 && HC_ARCH_BITS == 64 1246 RTGCPTR alignment0; /**< structure size alignment. */ 1247 #endif 1245 1248 1246 1249 DECLR0CALLBACKMEMBER(int, pfnR0ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); … … 1313 1316 DECLGCCALLBACKMEMBER(int, pfnGCBthVerifyAccessSyncPage,(PVM pVM, RTGCUINTPTR GCPtrPage, unsigned fFlags, unsigned uError)); 1314 1317 DECLGCCALLBACKMEMBER(unsigned, pfnGCBthAssertCR3,(PVM pVM, uint32_t cr3, uint32_t cr4, RTGCUINTPTR GCPtr, RTGCUINTPTR cb)); 1318 #if GC_ARCH_BITS == 32 && HC_ARCH_BITS == 64 1319 RTGCPTR alignment2; /**< structure size alignment. */ 1320 #endif 1315 1321 /** @} */ 1316 1322 -
trunk/src/VBox/VMM/REMInternal.h
r119 r161 116 116 { 117 117 RTHCUINTPTR pChunk1; 118 RTHCUINTPTR pChunk2; 118 119 RTGCPHYS GCPhys1; 119 RTHCUINTPTR pChunk2;120 120 RTGCPHYS GCPhys2; 121 121 } REMCHUNKINFO, *PREMCHUNKINFO; … … 129 129 typedef struct REMPHYSREGISTRATION 130 130 { 131 RTHCUINTPTR HCVirt; 131 132 RTGCPHYS GCPhys; 132 RTHCUINTPTR HCVirt;133 133 RTUINT cb; 134 134 } REMPHYSREGISTRATION, *PREMPHYSREGISTRATION; … … 177 177 * These instructions are replayed when entering REM. */ 178 178 RTGCPTR aGCPtrInvalidatedPages[48]; 179 180 179 /** The number of recorded handler notifications. */ 181 180 RTUINT volatile cHandlerNotifications; 181 RTUINT padding0; /**< Padding. */ 182 182 /** Array of recorded handler noticications. 183 183 * These are replayed when entering REM. */ … … 185 185 186 186 /** Pointer to an array of hc virt to gc phys records. */ 187 PREMCHUNKINFOpaHCVirtToGCPhys;187 HCPTRTYPE(PREMCHUNKINFO) paHCVirtToGCPhys; 188 188 /** Pointer to a GC Phys to HC Virt lookup table. */ 189 RTHCUINTPTR *paGCPhysToHCVirt; 190 191 /** Number of external RAM and ROM registrations (excluding guest RAM) */ 189 HCPTRTYPE(PRTHCUINTPTR) paGCPhysToHCVirt; 190 191 /** Array of external RAM and ROM registrations (excluding guest RAM). */ 192 REMPHYSREGISTRATION aPhysReg[REM_MAX_PHYS_REGISTRATIONS]; 193 /** Number of external RAM and ROM registrations (excluding guest RAM). */ 192 194 RTUINT cPhysRegistrations; 193 REMPHYSREGISTRATION aPhysReg[REM_MAX_PHYS_REGISTRATIONS];194 195 195 196 /** MMIO memory type. … … 213 214 214 215 /** Padding for MS / GC alignment difference. */ 215 //uint32_t u32Padding;216 uint32_t u32Padding; 216 217 /** Time spent in QEMU. */ 217 218 STAMPROFILEADV StatsInQEMU; … … 223 224 STAMPROFILE StatsStateBack; 224 225 226 #if HC_ARCH_BITS != 32 225 227 /** Padding the CPUX86State structure to 32 byte. */ 226 uint8_t abPadding[8]; 228 uint32_t abPadding[HC_ARCH_BITS == 32 ? 0 : 6]; 229 #endif 227 230 228 231 #define REM_ENV_SIZE (HC_ARCH_BITS == 32 ? 0x6440 : 0xb4a0) -
trunk/src/VBox/VMM/SELMInternal.h
r98 r161 131 131 /** Indicates whether the TSS stack selector & base address need to be refreshed. */ 132 132 bool fSyncTSSRing0Stack; 133 /** alignment . */ 134 RTUINT uPadding2; 133 135 134 136 /** SELMR3UpdateFromCPUM() profiling. */ -
trunk/src/VBox/VMM/TMInternal.h
r23 r161 183 183 /** Pointer to the VM the timer belongs to - GC Ptr. */ 184 184 PVMGC pVMGC; 185 #if HC_ARCH_BITS == 64 && GC_ARCH_BITS == 32 186 RTGCPTR padding0; /**< pad structure to multiple of 8 bytes. */ 187 #endif 185 188 } TMTIMER; 186 189 -
trunk/src/VBox/VMM/VMM.cpp
r23 r161 388 388 { 389 389 /* Set HC and GC stack pointers to top of stack. */ 390 pVM->vmm.s.CallHostR0JmpBuf.pvSavedStack = pVM->vmm.s.pbHCStack;390 pVM->vmm.s.CallHostR0JmpBuf.pvSavedStack = (RTR0PTR)pVM->vmm.s.pbHCStack; 391 391 pVM->vmm.s.pbGCStack = MMHyperHC2GC(pVM, pVM->vmm.s.pbHCStack); 392 392 pVM->vmm.s.pbGCStackBottom = pVM->vmm.s.pbGCStack + VMM_STACK_SIZE; -
trunk/src/VBox/VMM/VMMInternal.h
r140 r161 109 109 uint32_t esp; 110 110 uint32_t eip; 111 uint32_t u32Padding; 111 112 #endif 112 113 #if HC_ARCH_BITS == 64 … … 132 133 /** Pointer to the buffer used to save the stack. 133 134 * This is assumed to be 8KB. */ 134 void *pvSavedStack;135 RTR0PTR pvSavedStack; 135 136 /** Esp we we match against esp on resume to make sure the stack wasn't relocated. */ 136 137 RTHCUINTREG SpCheck; … … 234 235 /** The EMT yield timer interval (milliseconds). */ 235 236 uint32_t cYieldEveryMillies; 237 #if HC_ARCH_BITS == 32 238 uint32_t u32Padding0; /**< Alignment padding. */ 239 #endif 236 240 237 241 /** @name CallHost … … 247 251 /** @} */ 248 252 249 /* on VC these members are qword aligned! */250 //uint32_t u32Padding[1];251 253 /** Number of VMMR0_DO_RUN_GC calls. */ 252 254 STAMCOUNTER StatRunGC; -
trunk/src/VBox/VMM/VMMInternal.mac
r140 r161 31 31 .esp resd 1 32 32 .eip resd 1 33 .u32Padding resd 1 33 34 34 35 ; additional state and stack info. -
trunk/src/VBox/VMM/testcase/Makefile
r1 r161 46 46 # 47 47 ifeq ($(BUILD_TARGET),$(BUILD_PLATFORM)) 48 ifeq ($(filter-out x86. amd64 x86.x86, $(BUILD_TARGET_ARCH).$(BUILD_PLATFORM_ARCH)),)48 ifeq ($(filter-out x86.x86 x86.amd64, $(BUILD_TARGET_ARCH).$(BUILD_PLATFORM_ARCH)),) 49 49 OTHERS += \ 50 50 $(PATH_TARGET)/tstAsmStructs.run \ -
trunk/src/VBox/VMM/testcase/tstHelp.h
r23 r161 120 120 } while (0) 121 121 122 /** 123 * Checks that a internal struct padding is big enough. 124 */ 125 #define CHECK_PADDING3(strct, member, pad_member) \ 126 do \ 127 { \ 128 strct *p; \ 129 if (sizeof(p->member) > sizeof(p->pad_member)) \ 130 { \ 131 printf("padding of %s::%s is too small, padding=%d struct=%d\n", #strct, #member, \ 132 (int)sizeof(p->pad_member), (int)sizeof(p->member)); \ 133 rc++; \ 134 } \ 135 } while (0) 136 137 122 138 #endif -
trunk/src/VBox/VMM/testcase/tstVMMR0CallHost-1.cpp
r23 r161 94 94 RTR3Init(false); 95 95 RTPrintf("tstVMMR0CallHost-1: Testing...\n"); 96 g_Jmp.pvSavedStack = &g_Stack[0];96 g_Jmp.pvSavedStack = (RTR0PTR)&g_Stack[0]; 97 97 98 98 /* -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r23 r161 357 357 358 358 GEN_CHECK_SIZE(REM); 359 GEN_CHECK_OFF(REM, pCtx); 360 GEN_CHECK_OFF(REM, cCanExecuteRaw); 361 GEN_CHECK_OFF(REM, aGCPtrInvalidatedPages); 362 GEN_CHECK_OFF(REM, cHandlerNotifications); 363 GEN_CHECK_OFF(REM, aHandlerNotifications); 364 GEN_CHECK_OFF(REM, paHCVirtToGCPhys); 365 GEN_CHECK_OFF(REM, cPhysRegistrations); 366 GEN_CHECK_OFF(REM, aPhysReg); 367 GEN_CHECK_OFF(REM, rc); 368 GEN_CHECK_OFF(REM, StatsInQEMU); 369 GEN_CHECK_OFF(REM, Env); 359 370 360 371 GEN_CHECK_SIZE(SELM); … … 469 480 GEN_CHECK_OFF(VMM, cYieldResumeMillies); 470 481 GEN_CHECK_OFF(VMM, cYieldEveryMillies); 482 GEN_CHECK_OFF(VMM, enmCallHostOperation); 483 GEN_CHECK_OFF(VMM, rcCallHost); 484 GEN_CHECK_OFF(VMM, u64CallHostArg); 485 GEN_CHECK_OFF(VMM, CallHostR0JmpBuf); 486 GEN_CHECK_OFF(VMM, CallHostR0JmpBuf.SpCheck); 487 GEN_CHECK_OFF(VMM, CallHostR0JmpBuf.SpResume); 471 488 GEN_CHECK_OFF(VMM, StatRunGC); 489 GEN_CHECK_OFF(VMM, StatGCRetPGMLock); 472 490 473 491 GEN_CHECK_SIZE(RTPINGPONG); -
trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
r23 r161 88 88 do \ 89 89 { \ 90 printf("%s::%s offset %d \n", #strct, #member, RT_OFFSETOF(strct, member)); \90 printf("%s::%s offset %d sizeof %d\n", #strct, #member, (int)RT_OFFSETOF(strct, member), (int)RT_SIZEOFMEMB(strct, member)); \ 91 91 } while (0) 92 92 … … 151 151 CHECK_MEMBER_ALIGNMENT(VM, cpum.s.Hyper, 32); 152 152 CHECK_MEMBER_ALIGNMENT(VM, vmm.s.CritSectVMLock, 8); 153 CHECK_MEMBER_ALIGNMENT(VM, vmm.s.CallHostR0JmpBuf, 8); 153 154 CHECK_MEMBER_ALIGNMENT(VM, vmm.s.StatRunGC, 8); 154 155 CHECK_MEMBER_ALIGNMENT(VM, StatTotalQemuToGC, 8); … … 189 190 CHECK_MEMBER_ALIGNMENT(PGMPOOLPAGE, GCPhys, sizeof(RTGCPHYS)); 190 191 192 /* misc */ 193 CHECK_PADDING3(EM, u.FatalLongJump, u.achPaddingFatalLongJump); 194 CHECK_PADDING3(REMHANDLERNOTIFICATION, u.PhysicalRegister, u.padding); 195 CHECK_PADDING3(REMHANDLERNOTIFICATION, u.PhysicalDeregister, u.padding); 196 CHECK_PADDING3(REMHANDLERNOTIFICATION, u.PhysicalModify, u.padding); 197 CHECK_SIZE_ALIGNMENT(VMMR0JMPBUF, 8); 191 198 #if 0 192 199 PRINT_OFFSET(VM, fForcedActions); … … 194 201 PRINT_OFFSET(VM, StatGCToQemu); 195 202 #endif 203 196 204 197 205 /*
Note:
See TracChangeset
for help on using the changeset viewer.