Changeset 49808 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Dec 6, 2013 10:09:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PATMSSM.cpp
r49799 r49808 138 138 } PATMPATCHRECSSM, *PPATMPATCHRECSSM; 139 139 140 /*******************************************************************************141 * Defined Constants And Macros *142 *******************************************************************************/143 #define PATM_SUBTRACT_PTR(a, b) *(uintptr_t *)&(a) = (uintptr_t)(a) - (uintptr_t)(b)144 #define PATM_ADD_PTR(a, b) *(uintptr_t *)&(a) = (uintptr_t)(a) + (uintptr_t)(b)145 140 146 141 /******************************************************************************* … … 555 550 RTRCPTR *pFixup = (RTRCPTR *)rec.pRelocPos; 556 551 552 /* Convert pointer to an offset into patch memory. May not be applicable 553 to all fixup types, thus the UINT32_MAX. */ 557 554 Assert(rec.pRelocPos); 558 /* Convert pointer to an offset into patch memory. */ 559 PATM_SUBTRACT_PTR(rec.pRelocPos, pVM->patm.s.pPatchMemHC); 555 uintptr_t offRelocPos = (uintptr_t)rec.pRelocPos - (uintptr_t)pVM->patm.s.pPatchMemHC; 556 if (offRelocPos > pVM->patm.s.cbPatchMem) 557 offRelocPos = UINT32_MAX; 558 rec.pRelocPos = (uint8_t *)offRelocPos; 560 559 561 560 /* Zero rec.Core.Key since it's unused and may trigger SSM check due to the hack below. */ … … 991 990 offset = (int32_t)(intptr_t)rec.pRelocPos; 992 991 /* Convert to HC pointer again. */ 993 PATM_ADD_PTR(rec.pRelocPos, pVM->patm.s.pPatchMemHC); 992 if ((uintptr_t)rec.pRelocPos < pVM->patm.s.cbPatchMem) 993 rec.pRelocPos = pVM->patm.s.pPatchMemHC + (uintptr_t)rec.pRelocPos; 994 else 995 rec.pRelocPos = NULL; 994 996 pFixup = (RTRCPTR *)rec.pRelocPos; 995 997
Note:
See TracChangeset
for help on using the changeset viewer.