Changeset 2270 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Apr 20, 2007 12:58:15 PM (18 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/IOM.cpp
r707 r2270 1190 1190 int rc = PGMR3HandlerPhysicalRegister(pVM, PGMPHYSHANDLERTYPE_MMIO, GCPhysStart, GCPhysStart + (cbRange - 1), 1191 1191 /*IOMR3MMIOHandler*/ NULL, pRange, 1192 NULL, "IOMMMIOHandler", pRange,1192 NULL, "IOMMMIOHandler", MMHyperR3ToR0(pVM, pRange), 1193 1193 NULL, "IOMMMIOHandler", MMHyperHC2GC(pVM, pRange), pszDesc); 1194 1194 if (VBOX_SUCCESS(rc)) -
trunk/src/VBox/VMM/IOMInternal.h
r706 r2270 52 52 RTUINT cbSize; 53 53 /** Pointer to user argument. */ 54 RT HCPTR pvUser;54 RTR3PTR pvUser; 55 55 /** Pointer to device instance. */ 56 HCPTRTYPE(PPDMDEVINS) pDevIns;56 R3PTRTYPE(PPDMDEVINS) pDevIns; 57 57 /** Pointer to write callback function. */ 58 HCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback;58 R3PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback; 59 59 /** Pointer to read callback function. */ 60 HCPTRTYPE(PFNIOMMMIOREAD) pfnReadCallback;60 R3PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback; 61 61 /** Pointer to fill (memset) callback function. */ 62 HCPTRTYPE(PFNIOMMMIOFILL) pfnFillCallback;62 R3PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback; 63 63 /** Description / Name. For easing debugging. */ 64 HCPTRTYPE(const char *) pszDesc;64 R3PTRTYPE(const char *) pszDesc; 65 65 } IOMMMIORANGER3; 66 66 /** Pointer to a MMIO range descriptor, R3 version. */ 67 67 typedef struct IOMMMIORANGER3 *PIOMMMIORANGER3; 68 68 69 /** MMIO range descriptor, R0 version. */ 70 typedef IOMMMIORANGER3 IOMMMIORANGER0; 69 /** 70 * MMIO range descriptor, R0 version. 71 */ 72 typedef struct IOMMMIORANGER0 73 { 74 /** Avl node core with GCPhys as Key and GCPhys + cbSize - 1 as KeyLast. */ 75 AVLROGCPHYSNODECORE Core; 76 /** Start physical address. */ 77 RTGCPHYS GCPhys; 78 /** Size of the range. */ 79 RTUINT cbSize; 80 /** Pointer to user argument. */ 81 RTR0PTR pvUser; 82 /** Pointer to device instance. */ 83 R0PTRTYPE(PPDMDEVINS) pDevIns; 84 /** Pointer to write callback function. */ 85 R0PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback; 86 /** Pointer to read callback function. */ 87 R0PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback; 88 /** Pointer to fill (memset) callback function. */ 89 R0PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback; 90 /** Description / Name. For easing debugging. */ 91 R3PTRTYPE(const char *) pszDesc; 92 } IOMMMIORANGER0; 71 93 /** Pointer to a MMIO range descriptor, R0 version. */ 72 typedef PIOMMMIORANGER3PIOMMMIORANGER0;94 typedef struct IOMMMIORANGER0 *PIOMMMIORANGER0; 73 95 74 96 /** … … 159 181 uint16_t cPorts; 160 182 /** Pointer to user argument. */ 161 RT HCPTR pvUser;183 RTR3PTR pvUser; 162 184 /** Pointer to the associated device instance. */ 163 HCPTRTYPE(PPDMDEVINS) pDevIns;185 R3PTRTYPE(PPDMDEVINS) pDevIns; 164 186 /** Pointer to OUT callback function. */ 165 HCPTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback;187 R3PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback; 166 188 /** Pointer to IN callback function. */ 167 HCPTRTYPE(PFNIOMIOPORTIN) pfnInCallback;189 R3PTRTYPE(PFNIOMIOPORTIN) pfnInCallback; 168 190 /** Pointer to string OUT callback function. */ 169 HCPTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback;191 R3PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback; 170 192 /** Pointer to string IN callback function. */ 171 HCPTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback;193 R3PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback; 172 194 /** Description / Name. For easing debugging. */ 173 HCPTRTYPE(const char *) pszDesc;195 R3PTRTYPE(const char *) pszDesc; 174 196 } IOMIOPORTRANGER3; 175 197 /** Pointer to I/O port range descriptor, R3 version. */ 176 198 typedef IOMIOPORTRANGER3 *PIOMIOPORTRANGER3; 177 199 178 /** I/O port range descriptor, R0 version. */ 179 typedef IOMIOPORTRANGER3 IOMIOPORTRANGER0; 200 /** 201 * I/O port range descriptor, R0 version. 202 */ 203 typedef struct IOMIOPORTRANGER0 204 { 205 /** Avl node core with Port as Key and Port + cPorts - 1 as KeyLast. */ 206 AVLROIOPORTNODECORE Core; 207 /** Start I/O port address. */ 208 RTIOPORT Port; 209 /** Size of the range. */ 210 uint16_t cPorts; 211 /** Pointer to user argument. */ 212 RTR0PTR pvUser; 213 /** Pointer to the associated device instance. */ 214 R0PTRTYPE(PPDMDEVINS) pDevIns; 215 /** Pointer to OUT callback function. */ 216 R0PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback; 217 /** Pointer to IN callback function. */ 218 R0PTRTYPE(PFNIOMIOPORTIN) pfnInCallback; 219 /** Pointer to string OUT callback function. */ 220 R0PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback; 221 /** Pointer to string IN callback function. */ 222 R0PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback; 223 /** Description / Name. For easing debugging. */ 224 R3PTRTYPE(const char *) pszDesc; 225 } IOMIOPORTRANGER0; 180 226 /** Pointer to I/O port range descriptor, R0 version. */ 181 typedef PIOMIOPORTRANGER3PIOMIOPORTRANGER0;227 typedef IOMIOPORTRANGER0 *PIOMIOPORTRANGER0; 182 228 183 229 /** -
trunk/src/VBox/VMM/PDM.cpp
r1812 r2270 293 293 { 294 294 pDevIns->pDevHlpGC = pDevHlpGC; 295 pDevIns->pvInstanceDataGC = MMHyperHC2GC(pVM, pDevIns->pvInstanceDataHC); 295 pDevIns->pvInstanceDataGC = MMHyperHC2GC(pVM, pDevIns->pvInstanceDataR3); 296 pDevIns->pvInstanceDataR0 = MMHyperR3ToR0(pVM, pDevIns->pvInstanceDataR3); 296 297 pDevIns->Internal.s.pVMGC = pVM->pVMGC; 297 298 if (pDevIns->Internal.s.pPciBusHC) -
trunk/src/VBox/VMM/PDMDevice.cpp
r1858 r2270 88 88 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegister(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTHCPTR pvUser, PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn, PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, const char *pszDesc); 89 89 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterGC(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTGCPTR pvUser, const char *pszOut, const char *pszIn, const char *pszOutStr, const char *pszInStr, const char *pszDesc); 90 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RT HCPTR pvUser, const char *pszOut, const char *pszIn, const char *pszOutStr, const char *pszInStr, const char *pszDesc);90 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser, const char *pszOut, const char *pszIn, const char *pszOutStr, const char *pszInStr, const char *pszDesc); 91 91 static DECLCALLBACK(int) pdmR3DevHlp_IOPortDeregister(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts); 92 92 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser, … … 96 96 const char *pszWrite, const char *pszRead, const char *pszFill, 97 97 const char *pszDesc); 98 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RT HCPTR pvUser,98 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser, 99 99 const char *pszWrite, const char *pszRead, const char *pszFill, 100 100 const char *pszDesc); … … 252 252 */ 253 253 #ifdef VBOX_STRICT 254 # define PDMDEV_ASSERT_DEVINS(pDevIns) do { Assert(pDevIns); Assert(pDevIns->u32Version == PDM_DEVINS_VERSION); Assert(pDevIns->pvInstanceData HC== (void *)&pDevIns->achInstanceData[0]); } while (0)254 # define PDMDEV_ASSERT_DEVINS(pDevIns) do { Assert(pDevIns); Assert(pDevIns->u32Version == PDM_DEVINS_VERSION); Assert(pDevIns->pvInstanceDataR3 == (void *)&pDevIns->achInstanceData[0]); } while (0) 255 255 #else 256 256 # define PDMDEV_ASSERT_DEVINS(pDevIns) do { } while (0) … … 825 825 pDevIns->pCfgHandle = pConfigNode; 826 826 pDevIns->iInstance = paDevs[i].iInstance; 827 pDevIns->pvInstanceData HC= &pDevIns->achInstanceData[0];827 pDevIns->pvInstanceDataR3 = &pDevIns->achInstanceData[0]; 828 828 pDevIns->pvInstanceDataGC = pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_GC 829 ? MMHyperHC2GC(pVM, pDevIns->pvInstanceDataHC) : 0; 829 ? MMHyperHC2GC(pVM, pDevIns->pvInstanceDataR3) : 0; 830 pDevIns->pvInstanceDataR0 = pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_R0 831 ? MMHyperR3ToR0(pVM, pDevIns->pvInstanceDataR3) : 0; 830 832 831 833 /* … … 1206 1208 1207 1209 /** @copydoc PDMDEVHLP::pfnIOPortRegisterR0 */ 1208 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RT HCPTR pvUser,1210 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser, 1209 1211 const char *pszOut, const char *pszIn, 1210 1212 const char *pszOutStr, const char *pszInStr, const char *pszDesc) … … 1225 1227 && (pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_R0)) 1226 1228 { 1227 PFNIOMIOPORTINpfnR0PtrIn = 0;1229 R0PTRTYPE(PFNIOMIOPORTIN) pfnR0PtrIn = 0; 1228 1230 if (pszIn) 1229 1231 { … … 1231 1233 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszIn)\n", pDevIns->pDevReg->szR0Mod, pszIn)); 1232 1234 } 1233 PFNIOMIOPORTOUTpfnR0PtrOut = 0;1235 R0PTRTYPE(PFNIOMIOPORTOUT) pfnR0PtrOut = 0; 1234 1236 if (pszOut && VBOX_SUCCESS(rc)) 1235 1237 { … … 1237 1239 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOut)\n", pDevIns->pDevReg->szR0Mod, pszOut)); 1238 1240 } 1239 PFNIOMIOPORTINSTRINGpfnR0PtrInStr = 0;1241 R0PTRTYPE(PFNIOMIOPORTINSTRING) pfnR0PtrInStr = 0; 1240 1242 if (pszInStr && VBOX_SUCCESS(rc)) 1241 1243 { … … 1243 1245 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszInStr)\n", pDevIns->pDevReg->szR0Mod, pszInStr)); 1244 1246 } 1245 PFNIOMIOPORTOUTSTRINGpfnR0PtrOutStr = 0;1247 R0PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnR0PtrOutStr = 0; 1246 1248 if (pszOutStr && VBOX_SUCCESS(rc)) 1247 1249 { … … 1349 1351 1350 1352 /** @copydoc PDMDEVHLP::pfnMMIORegisterR0 */ 1351 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RT HCPTR pvUser,1353 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser, 1352 1354 const char *pszWrite, const char *pszRead, const char *pszFill, 1353 1355 const char *pszDesc) … … 1369 1371 && (pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_R0)) 1370 1372 { 1371 PFNIOMMMIOWRITEpfnR0PtrWrite = 0;1373 R0PTRTYPE(PFNIOMMMIOWRITE) pfnR0PtrWrite = 0; 1372 1374 if (pszWrite) 1373 1375 rc = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVMHC, pDevIns->pDevReg->szR0Mod, pszWrite, (void **)&pfnR0PtrWrite); 1374 PFNIOMMMIOREADpfnR0PtrRead = 0;1376 R0PTRTYPE(PFNIOMMMIOREAD) pfnR0PtrRead = 0; 1375 1377 int rc2 = VINF_SUCCESS; 1376 1378 if (pszRead) 1377 1379 rc2 = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVMHC, pDevIns->pDevReg->szR0Mod, pszRead, (void **)&pfnR0PtrRead); 1378 PFNIOMMMIOFILLpfnR0PtrFill = 0;1380 R0PTRTYPE(PFNIOMMMIOFILL) pfnR0PtrFill = 0; 1379 1381 int rc3 = VINF_SUCCESS; 1380 1382 if (pszFill) -
trunk/src/VBox/VMM/PGM.cpp
r1283 r2270 1086 1086 const unsigned iPT = off >> X86_PD_SHIFT; 1087 1087 const unsigned iPG = (off >> X86_PT_SHIFT) & X86_PT_MASK; 1088 pVM->pgm.s.paDynPageMap32BitPTEsGC = pMapping->aPTs[iPT].pPTGC + iPG * sizeof(pMapping->aPTs[0].pPT HC->a[0]);1089 pVM->pgm.s.paDynPageMapPaePTEsGC = pMapping->aPTs[iPT].paPaePTsGC + iPG * sizeof(pMapping->aPTs[0].paPaePTs HC->a[0]);1088 pVM->pgm.s.paDynPageMap32BitPTEsGC = pMapping->aPTs[iPT].pPTGC + iPG * sizeof(pMapping->aPTs[0].pPTR3->a[0]); 1089 pVM->pgm.s.paDynPageMapPaePTEsGC = pMapping->aPTs[iPT].paPaePTsGC + iPG * sizeof(pMapping->aPTs[0].paPaePTsR3->a[0]); 1090 1090 1091 1091 /* init cache */ … … 1159 1159 * (One or more of them have changed, that's why we're here.) 1160 1160 */ 1161 pVM->pgm.s.pMappingsGC = MMHyperHC2GC(pVM, pVM->pgm.s.pMappings HC);1162 for (PPGMMAPPING pCur = pVM->pgm.s.pMappings HC; pCur->pNextHC; pCur = pCur->pNextHC)1163 pCur->pNextGC = MMHyperHC2GC(pVM, pCur->pNext HC);1161 pVM->pgm.s.pMappingsGC = MMHyperHC2GC(pVM, pVM->pgm.s.pMappingsR3); 1162 for (PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; pCur->pNextR3; pCur = pCur->pNextR3) 1163 pCur->pNextGC = MMHyperHC2GC(pVM, pCur->pNextR3); 1164 1164 1165 1165 /* Relocate GC addresses of Page Tables. */ 1166 for (PPGMMAPPING pCur = pVM->pgm.s.pMappings HC; pCur; pCur = pCur->pNextHC)1166 for (PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3) 1167 1167 { 1168 1168 for (RTHCUINT i = 0; i < pCur->cPTs; i++) 1169 1169 { 1170 pCur->aPTs[i].pPTGC = MMHyperHC2GC(pVM, pCur->aPTs[i].pPT HC);1171 pCur->aPTs[i].paPaePTsGC = MMHyperHC2GC(pVM, pCur->aPTs[i].paPaePTs HC);1170 pCur->aPTs[i].pPTGC = MMHyperHC2GC(pVM, pCur->aPTs[i].pPTR3); 1171 pCur->aPTs[i].paPaePTsGC = MMHyperHC2GC(pVM, pCur->aPTs[i].paPaePTsR3); 1172 1172 } 1173 1173 } … … 1349 1349 */ 1350 1350 uint32_t i = 0; 1351 for (PPGMMAPPING pMapping = pPGM->pMappings HC; pMapping; pMapping = pMapping->pNextHC, i++)1351 for (PPGMMAPPING pMapping = pPGM->pMappingsR3; pMapping; pMapping = pMapping->pNextR3, i++) 1352 1352 { 1353 1353 SSMR3PutU32(pSSM, i); … … 1501 1501 /* find matching range. */ 1502 1502 PPGMMAPPING pMapping; 1503 for (pMapping = pPGM->pMappings HC; pMapping; pMapping = pMapping->pNextHC)1503 for (pMapping = pPGM->pMappingsR3; pMapping; pMapping = pMapping->pNextR3) 1504 1504 if ( pMapping->cPTs == cPTs 1505 1505 && !strcmp(pMapping->pszDesc, szDesc)) … … 2577 2577 else 2578 2578 { 2579 for (PPGMMAPPING pMap = pVM->pgm.s.pMappings HC; pMap; pMap = pMap->pNextHC)2579 for (PPGMMAPPING pMap = pVM->pgm.s.pMappingsR3; pMap; pMap = pMap->pNextR3) 2580 2580 { 2581 2581 uint64_t off = u64AddressPT - pMap->GCPtr; … … 2588 2588 fLongMode ? 16 : 8, u64AddressPT, iPDE, 2589 2589 iSub ? pMap->aPTs[iPDE].HCPhysPaePT1 : pMap->aPTs[iPDE].HCPhysPaePT0, HCPhysPT); 2590 pPT = &pMap->aPTs[iPDE].paPaePTs HC[iSub];2590 pPT = &pMap->aPTs[iPDE].paPaePTsR3[iSub]; 2591 2591 } 2592 2592 } … … 2843 2843 else 2844 2844 { 2845 for (PPGMMAPPING pMap = pVM->pgm.s.pMappings HC; pMap; pMap = pMap->pNextHC)2845 for (PPGMMAPPING pMap = pVM->pgm.s.pMappingsR3; pMap; pMap = pMap->pNextR3) 2846 2846 if (u32Address - pMap->GCPtr < pMap->cb) 2847 2847 { … … 2850 2850 pHlp->pfnPrintf(pHlp, "%08x error! Mapping error! PT %d has HCPhysPT=%VHp not %VHp is in the PD.\n", 2851 2851 u32Address, iPDE, pMap->aPTs[iPDE].HCPhysPT, HCPhys); 2852 pPT = pMap->aPTs[iPDE].pPT HC;2852 pPT = pMap->aPTs[iPDE].pPTR3; 2853 2853 } 2854 2854 } … … 3128 3128 if (!pVM) 3129 3129 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n"); 3130 if (!pVM->pgm.s.pMappings HC)3130 if (!pVM->pgm.s.pMappingsR3) 3131 3131 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Sorry, no mappings are registered.\n"); 3132 3132 … … 3142 3142 */ 3143 3143 PPGMMAPPING pCur; 3144 for (pCur = pVM->pgm.s.pMappings HC; pCur; pCur = pCur->pNextHC)3144 for (pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3) 3145 3145 { 3146 3146 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, -
trunk/src/VBox/VMM/PGMHandler.cpp
r1997 r2270 86 86 PGMR3DECL(int) PGMR3HandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS GCPhysLast, 87 87 PFNPGMR3PHYSHANDLER pfnHandlerR3, void *pvUserR3, 88 const char *pszModR0, const char *pszHandlerR0, RT HCPTR pvUserR0,88 const char *pszModR0, const char *pszHandlerR0, RTR0PTR pvUserR0, 89 89 const char *pszModGC, const char *pszHandlerGC, RTGCPTR pvUserGC, const char *pszDesc) 90 90 { -
trunk/src/VBox/VMM/PGMInternal.h
r2089 r2270 304 304 { 305 305 /** Pointer to next entry. */ 306 HCPTRTYPE(struct PGMMAPPING *) pNextHC;306 R3PTRTYPE(struct PGMMAPPING *) pNextR3; 307 307 /** Pointer to next entry. */ 308 308 GCPTRTYPE(struct PGMMAPPING *) pNextGC; 309 /** Pointer to next entry. */ 310 R0PTRTYPE(struct PGMMAPPING *) pNextR0; 309 311 /** Start Virtual address. */ 310 312 RTGCUINTPTR GCPtr; … … 314 316 RTGCUINTPTR cb; 315 317 /** Pointer to relocation callback function. */ 316 HCPTRTYPE(PFNPGMRELOCATE) pfnRelocate;318 R3PTRTYPE(PFNPGMRELOCATE) pfnRelocate; 317 319 /** User argument to the callback. */ 318 HCPTRTYPE(void *) pvUser;320 R3PTRTYPE(void *) pvUser; 319 321 /** Mapping description / name. For easing debugging. */ 320 HCPTRTYPE(const char *) pszDesc;322 R3PTRTYPE(const char *) pszDesc; 321 323 /** Number of page tables. */ 322 324 RTUINT cPTs; … … 337 339 RTHCPHYS HCPhysPaePT1; 338 340 /** The HC virtual address of the 32-bit page table. */ 339 HCPTRTYPE(PVBOXPT) pPTHC;341 R3PTRTYPE(PVBOXPT) pPTR3; 340 342 /** The HC virtual address of the two PAE page table. (i.e 1024 entries instead of 512) */ 341 HCPTRTYPE(PX86PTPAE) paPaePTsHC;343 R3PTRTYPE(PX86PTPAE) paPaePTsR3; 342 344 /** The GC virtual address of the 32-bit page table. */ 343 345 GCPTRTYPE(PVBOXPT) pPTGC; 344 346 /** The GC virtual address of the two PAE page table. */ 345 347 GCPTRTYPE(PX86PTPAE) paPaePTsGC; 348 /** The GC virtual address of the 32-bit page table. */ 349 R0PTRTYPE(PVBOXPT) pPTR0; 350 /** The GC virtual address of the two PAE page table. */ 351 R0PTRTYPE(PX86PTPAE) paPaePTsR0; 346 352 } aPTs[1]; 347 353 } PGMMAPPING; … … 366 372 uint32_t cPages; 367 373 /** Pointer to R3 callback function. */ 368 HCPTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3;374 R3PTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3; 369 375 /** User argument for R3 handlers. */ 370 HCPTRTYPE(void *) pvUserR3;376 R3PTRTYPE(void *) pvUserR3; 371 377 /** Pointer to R0 callback function. */ 372 378 R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0; 373 379 /** User argument for R0 handlers. */ 374 HCPTRTYPE(void *) pvUserR0;380 R0PTRTYPE(void *) pvUserR0; 375 381 /** Pointer to GC callback function. */ 376 382 GCPTRTYPE(PFNPGMGCPHYSHANDLER) pfnHandlerGC; … … 378 384 GCPTRTYPE(void *) pvUserGC; 379 385 /** Description / Name. For easing debugging. */ 380 HCPTRTYPE(const char *) pszDesc;386 R3PTRTYPE(const char *) pszDesc; 381 387 #ifdef VBOX_WITH_STATISTICS 382 388 /** Profiling of this handler. */ … … 517 523 { 518 524 /** HC pointer to physical page */ 519 HCPTRTYPE(uint8_t *) pbHC;525 R3PTRTYPE(uint8_t *) pbHC; 520 526 /** GC Physical address for cache entry */ 521 527 RTGCPHYS GCPhys; … … 787 793 R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnAccessHandlerR0; 788 794 /** Access handler, R3. */ 789 HCPTRTYPE(PFNPGMR3PHYSHANDLER) pfnAccessHandlerR3;795 R3PTRTYPE(PFNPGMR3PHYSHANDLER) pfnAccessHandlerR3; 790 796 /** The access handler description (HC ptr). */ 791 HCPTRTYPE(const char *) pszAccessHandler;797 R3PTRTYPE(const char *) pszAccessHandler; 792 798 #endif /* PGMPOOL_WITH_MONITORING */ 793 799 /** The number of pages currently in use. */ … … 1368 1374 * The list is sorted ascending on address. 1369 1375 */ 1370 HCPTRTYPE(PPGMMAPPING) pMappingsHC; 1376 R3PTRTYPE(PPGMMAPPING) pMappingsR3; 1377 /** Linked list of GC mappings - for R0. 1378 * The list is sorted ascending on address. 1379 */ 1380 R0PTRTYPE(PPGMMAPPING) pMappingsR0; 1371 1381 1372 1382 /** If set no conflict checks are required. (boolean) */ -
trunk/src/VBox/VMM/PGMMap.cpp
r1578 r2270 94 94 */ 95 95 PPGMMAPPING pPrev = NULL; 96 PPGMMAPPING pCur = pVM->pgm.s.pMappings HC;96 PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; 97 97 while (pCur) 98 98 { … … 108 108 break; 109 109 pPrev = pCur; 110 pCur = pCur->pNext HC;110 pCur = pCur->pNextR3; 111 111 } 112 112 … … 164 164 * 32-bit. 165 165 */ 166 pNew->aPTs[i].pPTHC = (PVBOXPT)pbPTs; 167 pNew->aPTs[i].pPTGC = MMHyperHC2GC(pVM, pNew->aPTs[i].pPTHC); 168 pNew->aPTs[i].HCPhysPT = MMR3HyperHCVirt2HCPhys(pVM, pNew->aPTs[i].pPTHC); 166 pNew->aPTs[i].pPTR3 = (PVBOXPT)pbPTs; 167 pNew->aPTs[i].pPTGC = MMHyperR3ToGC(pVM, pNew->aPTs[i].pPTR3); 168 pNew->aPTs[i].pPTR0 = MMHyperR3ToR0(pVM, pNew->aPTs[i].pPTR3); 169 pNew->aPTs[i].HCPhysPT = MMR3HyperHCVirt2HCPhys(pVM, pNew->aPTs[i].pPTR3); 169 170 pbPTs += PAGE_SIZE; 170 171 Log4(("PGMR3MapPT: i=%d: pPTHC=%p pPTGC=%p HCPhysPT=%RHp\n", 171 i, pNew->aPTs[i].pPT HC, pNew->aPTs[i].pPTGC, pNew->aPTs[i].HCPhysPT));172 i, pNew->aPTs[i].pPTR3, pNew->aPTs[i].pPTGC, pNew->aPTs[i].HCPhysPT)); 172 173 173 174 /* … … 176 177 pNew->aPTs[i].HCPhysPaePT0 = MMR3HyperHCVirt2HCPhys(pVM, pbPTs); 177 178 pNew->aPTs[i].HCPhysPaePT1 = MMR3HyperHCVirt2HCPhys(pVM, pbPTs + PAGE_SIZE); 178 pNew->aPTs[i].paPaePTsHC = (PX86PTPAE)pbPTs; 179 pNew->aPTs[i].paPaePTsGC = MMHyperHC2GC(pVM, pbPTs); 179 pNew->aPTs[i].paPaePTsR3 = (PX86PTPAE)pbPTs; 180 pNew->aPTs[i].paPaePTsGC = MMHyperR3ToGC(pVM, pbPTs); 181 pNew->aPTs[i].paPaePTsR0 = MMHyperR3ToR0(pVM, pbPTs); 180 182 pbPTs += PAGE_SIZE * 2; 181 183 Log4(("PGMR3MapPT: i=%d: paPaePTsHC=%p paPaePTsGC=%p HCPhysPaePT0=%RHp HCPhysPaePT1=%RHp\n", 182 i, pNew->aPTs[i].paPaePTs HC, pNew->aPTs[i].paPaePTsGC, pNew->aPTs[i].HCPhysPaePT0, pNew->aPTs[i].HCPhysPaePT1));184 i, pNew->aPTs[i].paPaePTsR3, pNew->aPTs[i].paPaePTsGC, pNew->aPTs[i].HCPhysPaePT0, pNew->aPTs[i].HCPhysPaePT1)); 183 185 } 184 186 pgmR3MapSetPDEs(pVM, pNew, iPageDir); … … 187 189 * Insert the new mapping. 188 190 */ 189 pNew->pNextHC = pCur; 190 pNew->pNextGC = pCur ? MMHyperHC2GC(pVM, pCur) : 0; 191 pNew->pNextR3 = pCur; 192 pNew->pNextGC = pCur ? MMHyperR3ToGC(pVM, pCur) : 0; 193 pNew->pNextR0 = pCur ? MMHyperR3ToR0(pVM, pCur) : 0; 191 194 if (pPrev) 192 195 { 193 pPrev->pNextHC = pNew; 194 pPrev->pNextGC = MMHyperHC2GC(pVM, pNew); 196 pPrev->pNextR3 = pNew; 197 pPrev->pNextGC = MMHyperR3ToGC(pVM, pNew); 198 pPrev->pNextR0 = MMHyperR3ToR0(pVM, pNew); 195 199 } 196 200 else 197 201 { 198 pVM->pgm.s.pMappingsHC = pNew; 199 pVM->pgm.s.pMappingsGC = MMHyperHC2GC(pVM, pNew); 202 pVM->pgm.s.pMappingsR3 = pNew; 203 pVM->pgm.s.pMappingsGC = MMHyperR3ToGC(pVM, pNew); 204 pVM->pgm.s.pMappingsR0 = MMHyperR3ToR0(pVM, pNew); 200 205 } 201 206 … … 220 225 */ 221 226 PPGMMAPPING pPrev = NULL; 222 PPGMMAPPING pCur = pVM->pgm.s.pMappings HC;227 PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; 223 228 while (pCur) 224 229 { … … 230 235 if (pPrev) 231 236 { 232 pPrev->pNext HC = pCur->pNextHC;237 pPrev->pNextR3 = pCur->pNextR3; 233 238 pPrev->pNextGC = pCur->pNextGC; 239 pPrev->pNextR0 = pCur->pNextR0; 234 240 } 235 241 else 236 242 { 237 pVM->pgm.s.pMappings HC = pCur->pNextHC;243 pVM->pgm.s.pMappingsR3 = pCur->pNextR3; 238 244 pVM->pgm.s.pMappingsGC = pCur->pNextGC; 245 pVM->pgm.s.pMappingsR0 = pCur->pNextR0; 239 246 } 240 247 … … 243 250 * and free the page tables and node memory. 244 251 */ 245 MMHyperFree(pVM, pCur->aPTs[0].pPT HC);252 MMHyperFree(pVM, pCur->aPTs[0].pPTR3); 246 253 pgmR3MapClearPDEs(&pVM->pgm.s, pCur, pCur->GCPtr >> PGDIR_SHIFT); 247 254 MMHyperFree(pVM, pCur); … … 257 264 /* next */ 258 265 pPrev = pCur; 259 pCur = pCur->pNext HC;266 pCur = pCur->pNextR3; 260 267 } 261 268 … … 276 283 { 277 284 size_t cb = 0; 278 for (PPGMMAPPING pCur = pVM->pgm.s.pMappings HC; pCur; pCur = pCur->pNextHC)285 for (PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3) 279 286 cb += pCur->cb; 280 287 … … 327 334 { 328 335 /* Check that it's not one or our mappings. */ 329 PPGMMAPPING pCur = pVM->pgm.s.pMappings HC;336 PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; 330 337 while (pCur) 331 338 { 332 339 if (iPDNew + i - (pCur->GCPtr >> PGDIR_SHIFT) < (pCur->cb >> PGDIR_SHIFT)) 333 340 break; 334 pCur = pCur->pNext HC;341 pCur = pCur->pNextR3; 335 342 } 336 343 if (!pCur) … … 347 354 */ 348 355 RTGCPTR GCPtrCur = GCPtrBase; 349 PPGMMAPPING pCur = pVM->pgm.s.pMappings HC;356 PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; 350 357 while (pCur) 351 358 { … … 357 364 /* next */ 358 365 GCPtrCur += pCur->cb; 359 pCur = pCur->pNext HC;366 pCur = pCur->pNextR3; 360 367 } 361 368 if (GCPtrCur > GCPtrBase + cb) … … 370 377 */ 371 378 GCPtrCur = GCPtrBase; 372 pCur = pVM->pgm.s.pMappings HC;379 pCur = pVM->pgm.s.pMappingsR3; 373 380 while (pCur) 374 381 { … … 397 404 */ 398 405 GCPtrCur += pCur->cb; 399 pCur = pCur->pNext HC;406 pCur = pCur->pNextR3; 400 407 } 401 408 … … 798 805 /* Find previous mapping for pMapping, put result into pPrevMap. */ 799 806 PPGMMAPPING pPrevMap = NULL; 800 PPGMMAPPING pCur = pVM->pgm.s.pMappings HC;807 PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; 801 808 while (pCur && pCur != pMapping) 802 809 { 803 810 /* next */ 804 811 pPrevMap = pCur; 805 pCur = pCur->pNext HC;812 pCur = pCur->pNextR3; 806 813 } 807 814 Assert(pCur); … … 810 817 RTGCPTR GCPtrNew = iPDNew << PGDIR_SHIFT; 811 818 PPGMMAPPING pPrev = NULL; 812 pCur = pVM->pgm.s.pMappings HC;819 pCur = pVM->pgm.s.pMappingsR3; 813 820 while (pCur && pCur->GCPtr < GCPtrNew) 814 821 { 815 822 /* next */ 816 823 pPrev = pCur; 817 pCur = pCur->pNext HC;824 pCur = pCur->pNextR3; 818 825 } 819 826 … … 825 832 if (pPrevMap) 826 833 { 827 pPrevMap->pNext HC = pMapping->pNextHC;834 pPrevMap->pNextR3 = pMapping->pNextR3; 828 835 pPrevMap->pNextGC = pMapping->pNextGC; 836 pPrevMap->pNextR0 = pMapping->pNextR0; 829 837 } 830 838 else 831 839 { 832 pVM->pgm.s.pMappings HC = pMapping->pNextHC;840 pVM->pgm.s.pMappingsR3 = pMapping->pNextR3; 833 841 pVM->pgm.s.pMappingsGC = pMapping->pNextGC; 842 pVM->pgm.s.pMappingsR0 = pMapping->pNextR0; 834 843 } 835 844 … … 837 846 * Link 838 847 */ 839 pMapping->pNext HC= pCur;848 pMapping->pNextR3 = pCur; 840 849 if (pPrev) 841 850 { 842 851 pMapping->pNextGC = pPrev->pNextGC; 843 pPrev->pNextHC = pMapping; 844 pPrev->pNextGC = MMHyperHC2GC(pVM, pMapping); 852 pMapping->pNextR0 = pPrev->pNextR0; 853 pPrev->pNextR3 = pMapping; 854 pPrev->pNextGC = MMHyperR3ToGC(pVM, pMapping); 855 pPrev->pNextR0 = MMHyperR3ToR0(pVM, pMapping); 845 856 } 846 857 else 847 858 { 848 859 pMapping->pNextGC = pVM->pgm.s.pMappingsGC; 849 pVM->pgm.s.pMappingsHC = pMapping; 850 pVM->pgm.s.pMappingsGC = MMHyperHC2GC(pVM, pMapping); 860 pMapping->pNextR0 = pVM->pgm.s.pMappingsR0; 861 pVM->pgm.s.pMappingsR3 = pMapping; 862 pVM->pgm.s.pMappingsGC = MMHyperR3ToGC(pVM, pMapping); 863 pVM->pgm.s.pMappingsR0 = MMHyperR3ToR0(pVM, pMapping); 851 864 } 852 865 } … … 957 970 * Iterate mappings. 958 971 */ 959 for (PPGMMAPPING pCur = pVM->pgm.s.pMappings HC; pCur; pCur = pCur->pNextHC)972 for (PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3) 960 973 { 961 974 unsigned iPDE = pCur->GCPtr >> PGDIR_SHIFT; … … 1026 1039 * Find the mapping. 1027 1040 */ 1028 PPGMMAPPING pCur = CTX SUFF(pVM->pgm.s.pMappings);1041 PPGMMAPPING pCur = CTXALLSUFF(pVM->pgm.s.pMappings); 1029 1042 while (pCur) 1030 1043 { … … 1041 1054 unsigned iPT = off >> PGDIR_SHIFT; 1042 1055 unsigned iPTE = (off >> PAGE_SHIFT) & PTE_MASK; 1043 while (cb > 0 && iPTE < ELEMENTS(CTX SUFF(pCur->aPTs[iPT].pPT)->a))1056 while (cb > 0 && iPTE < ELEMENTS(CTXALLSUFF(pCur->aPTs[iPT].pPT)->a)) 1044 1057 { 1045 if (!CTX SUFF(pCur->aPTs[iPT].paPaePTs)[iPTE / 512].a[iPTE % 512].n.u1Present)1058 if (!CTXALLSUFF(pCur->aPTs[iPT].paPaePTs)[iPTE / 512].a[iPTE % 512].n.u1Present) 1046 1059 return VERR_PAGE_NOT_PRESENT; 1047 RTHCPHYS HCPhys = CTX SUFF(pCur->aPTs[iPT].paPaePTs)[iPTE / 512].a[iPTE % 512].u & X86_PTE_PAE_PG_MASK;1060 RTHCPHYS HCPhys = CTXALLSUFF(pCur->aPTs[iPT].paPaePTs)[iPTE / 512].a[iPTE % 512].u & X86_PTE_PAE_PG_MASK; 1048 1061 1049 1062 /* … … 1061 1074 1062 1075 /* next */ 1063 pCur = CTX SUFF(pCur->pNext);1076 pCur = CTXALLSUFF(pCur->pNext); 1064 1077 } 1065 1078 … … 1118 1131 1119 1132 PPGMMAPPING pCur; 1120 for (pCur = pVM->pgm.s.pMappings HC; pCur; pCur = pCur->pNextHC)1133 for (pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3) 1121 1134 RTLogPrintf("%VGv - %VGv %s\n", pCur->GCPtr, pCur->GCPtrLast, pCur->pszDesc); 1122 1135 -
trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
r2230 r2270 435 435 pRange->pfnWriteCallback= pfnWriteCallback; 436 436 pRange->pfnFillCallback = pfnFillCallback; 437 437 #ifdef IN_GC 438 438 pRange->pDevIns = pDevIns; 439 439 pRange->pszDesc = MMHyperGC2HC(pVM, (void *)pszDesc); 440 440 #else 441 441 pRange->pDevIns = MMHyperHC2GC(pVM, pDevIns); 442 442 pRange->pszDesc = pszDesc; 443 443 #endif 444 444 445 445 /* … … 478 478 * @param pszDesc Pointer to description string. This must not be freed. 479 479 */ 480 IOMDECL(int) IOMIOPortRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RT HCPTR pvUser,481 HCPTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, HCPTRTYPE(PFNIOMIOPORTIN) pfnInCallback,482 HCPTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, HCPTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback,480 IOMDECL(int) IOMIOPortRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTR0PTR pvUser, 481 R0PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, R0PTRTYPE(PFNIOMIOPORTIN) pfnInCallback, 482 R0PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, R0PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback, 483 483 const char *pszDesc) 484 484 { … … 548 548 pRange->pfnInStrCallback = pfnInStrCallback; 549 549 #ifdef IN_GC 550 pRange->pDevIns = MMHyperGC2HC(pVM, pDevIns); 551 pRange->pszDesc = MMHyperGC2HC(pVM, (void *)pszDesc); 550 pRange->pDevIns = MMHyperGCToR0(pVM, pDevIns); 551 pRange->pszDesc = MMHyperGCToR3(pVM, (void *)pszDesc); 552 #elif defined(IN_RING3) 553 pRange->pDevIns = MMHyperR3ToR0(pVM, pDevIns); 554 pRange->pszDesc = pszDesc; 552 555 #else 553 556 pRange->pDevIns = pDevIns; 554 pRange->pszDesc = pszDesc;557 pRange->pszDesc = MMHyperR0ToR3(pVM, (RTR0PTR)pszDesc); 555 558 #endif 556 559 … … 590 593 * @param pszDesc Pointer to description string. This must not be freed. 591 594 */ 592 IOMDECL(int) IOMMMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RT HCPTR pvUser,593 HCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, HCPTRTYPE(PFNIOMMMIOREAD) pfnReadCallback,594 HCPTRTYPE(PFNIOMMMIOFILL) pfnFillCallback, const char *pszDesc)595 IOMDECL(int) IOMMMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser, 596 R0PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, R0PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback, 597 R0PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback, const char *pszDesc) 595 598 { 596 599 LogFlow(("IOMMMIORegisterR0: pDevIns=%p GCPhysStart=%#x cbRange=%#x pvUser=%VHv pfnWriteCallback=%#x pfnReadCallback=%#x pfnFillCallback=%#x pszDesc=%s\n", … … 658 661 pRange->pfnFillCallback = pfnFillCallback; 659 662 #ifdef IN_GC 660 pRange->pDevIns = MMHyperGC2HC(pVM, pDevIns); 661 pRange->pszDesc = MMHyperGC2HC(pVM, (void *)pszDesc); 663 pRange->pDevIns = MMHyperGCToR0(pVM, pDevIns); 664 pRange->pszDesc = MMHyperGCToR3(pVM, (void *)pszDesc); 665 #elif defined(IN_RING3) 666 pRange->pDevIns = MMHyperR3ToR0(pVM, pDevIns); 667 pRange->pszDesc = pszDesc; 662 668 #else 663 669 pRange->pDevIns = pDevIns; 664 pRange->pszDesc = pszDesc;670 pRange->pszDesc = MMHyperR0ToR3(pVM, (RTR0PTR)pszDesc); 665 671 #endif 666 672 -
trunk/src/VBox/VMM/VMMAll/MMAll.cpp
r1480 r2270 336 336 if (pLookup) 337 337 return mmHyperLookupCalcR0(pLookup, off); 338 AssertMsgFailed(("R3Ptr=%p is not inside the hypervisor memory area!\n", R3Ptr)); 338 339 return NIL_RTR0PTR; 339 340 } … … 355 356 if (pLookup) 356 357 return mmHyperLookupCalcGC(pVM, pLookup, off); 358 AssertMsgFailed(("R3Ptr=%p is not inside the hypervisor memory area!\n", R3Ptr)); 357 359 return NIL_RTGCPTR; 358 360 } … … 630 632 return MMHyperHC2GC(pVM, (RTHCPTR)Ptr); 631 633 } 634 632 635 #endif /* !IN_GC */ 633 -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r1930 r2270 343 343 PPGMMAPPING pgmGetMapping(PVM pVM, RTGCPTR GCPtr) 344 344 { 345 PPGMMAPPING pMapping = CTX SUFF(pVM->pgm.s.pMappings);345 PPGMMAPPING pMapping = CTXALLSUFF(pVM->pgm.s.pMappings); 346 346 while (pMapping) 347 347 { … … 353 353 return pMapping; 354 354 } 355 pMapping = CTX SUFF(pMapping->pNext);355 pMapping = CTXALLSUFF(pMapping->pNext); 356 356 } 357 357 return NULL; … … 1652 1652 * Check for mapping conflicts. 1653 1653 */ 1654 for (PPGMMAPPING pMapping = CTX SUFF(pVM->pgm.s.pMappings);1654 for (PPGMMAPPING pMapping = CTXALLSUFF(pVM->pgm.s.pMappings); 1655 1655 pMapping; 1656 pMapping = CTX SUFF(pMapping->pNext))1656 pMapping = CTXALLSUFF(pMapping->pNext)) 1657 1657 { 1658 1658 /** @todo This is slow and should be optimized, but since it's just assertions I don't care now. */ -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r2203 r2270 169 169 { 170 170 STAM_PROFILE_START(&pVM->pgm.s.StatMapping, a); 171 PPGMMAPPING pMapping = CTX SUFF(pVM->pgm.s.pMappings);172 for ( ; pMapping; pMapping = CTX SUFF(pMapping->pNext))171 PPGMMAPPING pMapping = CTXALLSUFF(pVM->pgm.s.pMappings); 172 for ( ; pMapping; pMapping = CTXALLSUFF(pMapping->pNext)) 173 173 { 174 174 if ((RTGCUINTPTR)pvFault < (RTGCUINTPTR)pMapping->GCPtr) … … 2613 2613 if (pgmMapAreMappingsEnabled(&pVM->pgm.s)) 2614 2614 { 2615 pMapping = pVM->pgm.s.CTX SUFF(pMappings);2615 pMapping = pVM->pgm.s.CTXALLSUFF(pMappings); 2616 2616 iPdNoMapping = (pMapping) ? pMapping->GCPtr >> PGDIR_SHIFT : ~0U; 2617 2617 } … … 2644 2644 iPD += cPTs - 1; 2645 2645 pPDEDst += cPTs + (PGM_SHW_TYPE != PGM_TYPE_32BIT) * cPTs; 2646 pMapping = pMapping->CTX SUFF(pNext);2646 pMapping = pMapping->CTXALLSUFF(pNext); 2647 2647 iPdNoMapping = pMapping ? pMapping->GCPtr >> PGDIR_SHIFT : ~0U; 2648 2648 continue; … … 2657 2657 * Update iPdNoMapping and pMapping. 2658 2658 */ 2659 pMapping = pVM->pgm.s.pMappings HC;2659 pMapping = pVM->pgm.s.pMappingsR3; 2660 2660 while (pMapping && pMapping->GCPtr < (iPD << PGDIR_SHIFT)) 2661 pMapping = pMapping->pNext HC;2661 pMapping = pMapping->pNextR3; 2662 2662 iPdNoMapping = pMapping ? pMapping->GCPtr >> PGDIR_SHIFT : ~0U; 2663 2663 #else … … 2777 2777 { 2778 2778 /* It's fixed, just skip the mapping. */ 2779 pMapping = pMapping->CTX SUFF(pNext);2779 pMapping = pMapping->CTXALLSUFF(pNext); 2780 2780 iPdNoMapping = pMapping ? pMapping->GCPtr >> PGDIR_SHIFT : ~0U; 2781 2781 } … … 2801 2801 * Update iPdNoMapping and pMapping. 2802 2802 */ 2803 pMapping = pVM->pgm.s.CTX SUFF(pMappings);2803 pMapping = pVM->pgm.s.CTXALLSUFF(pMappings); 2804 2804 while (pMapping && pMapping->GCPtr < (iPD << PGDIR_SHIFT)) 2805 pMapping = pMapping->CTX SUFF(pNext);2805 pMapping = pMapping->CTXALLSUFF(pNext); 2806 2806 iPdNoMapping = pMapping ? pMapping->GCPtr >> PGDIR_SHIFT : ~0U; 2807 2807 break; … … 2814 2814 if (iPdNoMapping == ~0U && pMapping) 2815 2815 { 2816 pMapping = pMapping->CTX SUFF(pNext);2816 pMapping = pMapping->CTXALLSUFF(pNext); 2817 2817 if (pMapping) 2818 2818 iPdNoMapping = pMapping->GCPtr >> PGDIR_SHIFT; -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r1793 r2270 81 81 */ 82 82 PGMDECL(int) PGMHandlerPhysicalRegisterEx(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS GCPhysLast, 83 HCPTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3, RTHCPTR pvUserR3,84 R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0, RT HCPTR pvUserR0,83 R3PTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3, RTR3PTR pvUserR3, 84 R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0, RTR0PTR pvUserR0, 85 85 GCPTRTYPE(PFNPGMGCPHYSHANDLER) pfnHandlerGC, RTGCPTR pvUserGC, 86 HCPTRTYPE(const char *) pszDesc)86 R3PTRTYPE(const char *) pszDesc) 87 87 { 88 88 Log(("PGMHandlerPhysicalRegisterEx: enmType=%d GCPhys=%VGp GCPhysLast=%VGp pfnHandlerR3=%VHv pvUserR3=%VHv pfnHandlerR0=%VHv pvUserR0=%VHv pfnHandlerGC=%VGv pvUserGC=%VGv pszDesc=%s\n", … … 601 601 */ 602 602 PGMDECL(int) PGMHandlerPhysicalChangeCallbacks(PVM pVM, RTGCPHYS GCPhys, 603 HCPTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3, RTHCPTR pvUserR3,604 R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0, RT HCPTR pvUserR0,603 R3PTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3, RTR3PTR pvUserR3, 604 R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0, RTR0PTR pvUserR0, 605 605 GCPTRTYPE(PFNPGMGCPHYSHANDLER) pfnHandlerGC, RTGCPTR pvUserGC, 606 HCPTRTYPE(const char *) pszDesc)606 R3PTRTYPE(const char *) pszDesc) 607 607 { 608 608 /* -
trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp
r23 r2270 64 64 * Find the mapping. 65 65 */ 66 PPGMMAPPING pCur = CTX SUFF(pVM->pgm.s.pMappings);66 PPGMMAPPING pCur = CTXALLSUFF(pVM->pgm.s.pMappings); 67 67 while (pCur) 68 68 { … … 91 91 92 92 /* 32-bit */ 93 CTX SUFF(pCur->aPTs[iPT].pPT)->a[iPageNo].u = (uint32_t)Pte.u; /* ASSUMES HCPhys < 4GB and/or that we're never gonna do 32-bit on a PAE host! */93 CTXALLSUFF(pCur->aPTs[iPT].pPT)->a[iPageNo].u = (uint32_t)Pte.u; /* ASSUMES HCPhys < 4GB and/or that we're never gonna do 32-bit on a PAE host! */ 94 94 95 95 /* pae */ 96 CTX SUFF(pCur->aPTs[iPT].paPaePTs)[iPageNo / 512].a[iPageNo % 512].u = Pte.u;96 CTXALLSUFF(pCur->aPTs[iPT].paPaePTs)[iPageNo / 512].a[iPageNo % 512].u = Pte.u; 97 97 98 98 /* next */ … … 108 108 109 109 /* next */ 110 pCur = CTX SUFF(pCur->pNext);110 pCur = CTXALLSUFF(pCur->pNext); 111 111 } 112 112 … … 169 169 * Find the mapping. 170 170 */ 171 PPGMMAPPING pCur = CTX SUFF(pVM->pgm.s.pMappings);171 PPGMMAPPING pCur = CTXALLSUFF(pVM->pgm.s.pMappings); 172 172 while (pCur) 173 173 { … … 189 189 unsigned iPT = off >> PGDIR_SHIFT; 190 190 unsigned iPTE = (off >> PAGE_SHIFT) & PTE_MASK; 191 while (cb > 0 && iPTE < ELEMENTS(CTX SUFF(pCur->aPTs[iPT].pPT)->a))191 while (cb > 0 && iPTE < ELEMENTS(CTXALLSUFF(pCur->aPTs[iPT].pPT)->a)) 192 192 { 193 193 /* 32-Bit */ 194 CTX SUFF(pCur->aPTs[iPT].pPT)->a[iPTE].u &= fMask | X86_PTE_PG_MASK;195 CTX SUFF(pCur->aPTs[iPT].pPT)->a[iPTE].u |= fFlags & ~X86_PTE_PG_MASK;194 CTXALLSUFF(pCur->aPTs[iPT].pPT)->a[iPTE].u &= fMask | X86_PTE_PG_MASK; 195 CTXALLSUFF(pCur->aPTs[iPT].pPT)->a[iPTE].u |= fFlags & ~X86_PTE_PG_MASK; 196 196 197 197 /* PAE */ 198 CTX SUFF(pCur->aPTs[iPT].paPaePTs)[iPTE / 512].a[iPTE % 512].u &= fMask | X86_PTE_PAE_PG_MASK;199 CTX SUFF(pCur->aPTs[iPT].paPaePTs)[iPTE / 512].a[iPTE % 512].u |= fFlags & ~X86_PTE_PAE_PG_MASK;198 CTXALLSUFF(pCur->aPTs[iPT].paPaePTs)[iPTE / 512].a[iPTE % 512].u &= fMask | X86_PTE_PAE_PG_MASK; 199 CTXALLSUFF(pCur->aPTs[iPT].paPaePTs)[iPTE / 512].a[iPTE % 512].u |= fFlags & ~X86_PTE_PAE_PG_MASK; 200 200 201 201 /* invalidate tls */ … … 212 212 } 213 213 /* next */ 214 pCur = CTX SUFF(pCur->pNext);214 pCur = CTXALLSUFF(pCur->pNext); 215 215 } 216 216 -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r2236 r2270 1205 1205 rc = PGMHandlerPhysicalRegisterEx(pVM, PGMPHYSHANDLERTYPE_PHYSICAL_WRITE, 1206 1206 GCPhysPage, GCPhysPage + (PAGE_SIZE - 1), 1207 pPool->pfnAccessHandlerR3, MMHyper 2HC(pVM, (uintptr_t)pPage),1208 pPool->pfnAccessHandlerR0, MMHyper 2HC(pVM, (uintptr_t)pPage),1209 pPool->pfnAccessHandlerGC, MMHyper 2GC(pVM, (uintptr_t)pPage),1207 pPool->pfnAccessHandlerR3, MMHyperCCToR3(pVM, pPage), 1208 pPool->pfnAccessHandlerR0, MMHyperCCToR0(pVM, pPage), 1209 pPool->pfnAccessHandlerGC, MMHyperCCToGC(pVM, pPage), 1210 1210 pPool->pszAccessHandler); 1211 1211 /** @todo we should probably deal with out-of-memory conditions here, but for now increasing … … 1277 1277 pNewHead->fCR3Mix = pPage->fCR3Mix; 1278 1278 rc = PGMHandlerPhysicalChangeCallbacks(pVM, pPage->GCPhys & ~(RTGCPHYS)(PAGE_SIZE - 1), 1279 pPool->pfnAccessHandlerR3, MMHyper 2HC(pVM, (uintptr_t)pNewHead),1280 pPool->pfnAccessHandlerR0, MMHyper 2HC(pVM, (uintptr_t)pNewHead),1281 pPool->pfnAccessHandlerGC, MMHyper 2GC(pVM, (uintptr_t)pNewHead),1279 pPool->pfnAccessHandlerR3, MMHyperCCToR3(pVM, pNewHead), 1280 pPool->pfnAccessHandlerR0, MMHyperCCToR0(pVM, pNewHead), 1281 pPool->pfnAccessHandlerGC, MMHyperCCToGC(pVM, pNewHead), 1282 1282 pPool->pszAccessHandler); 1283 1283 AssertFatalRCSuccess(rc); … … 3149 3149 PVM pVM = pPool->CTXSUFF(pVM); 3150 3150 int rc = PGMHandlerPhysicalChangeCallbacks(pVM, pPage->GCPhys & ~(RTGCPHYS)(PAGE_SIZE - 1), 3151 pPool->pfnAccessHandlerR3, MMHyper 2HC(pVM, (uintptr_t)pPage),3152 pPool->pfnAccessHandlerR0, MMHyper 2HC(pVM, (uintptr_t)pPage),3153 pPool->pfnAccessHandlerGC, MMHyper 2GC(pVM, (uintptr_t)pPage),3151 pPool->pfnAccessHandlerR3, MMHyperCCToR3(pVM, pPage), 3152 pPool->pfnAccessHandlerR0, MMHyperCCToR0(pVM, pPage), 3153 pPool->pfnAccessHandlerGC, MMHyperCCToGC(pVM, pPage), 3154 3154 pPool->pszAccessHandler); 3155 3155 AssertFatalRCSuccess(rc); -
trunk/src/VBox/VMM/VMMAll/PGMAllShw.h
r1930 r2270 189 189 AssertMsgReturn(pMap, ("GCPtr=%VGv\n", GCPtr), VERR_INTERNAL_ERROR); 190 190 #if PGM_SHW_TYPE == PGM_TYPE_32BIT 191 pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> PGDIR_SHIFT].CTX SUFF(pPT);191 pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> PGDIR_SHIFT].CTXALLSUFF(pPT); 192 192 #else /* PAE and AMD64: */ 193 pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> PGDIR_SHIFT].CTX SUFF(paPaePTs);193 pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> PGDIR_SHIFT].CTXALLSUFF(paPaePTs); 194 194 #endif 195 195 } -
trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
r23 r2270 48 48 # define PDMDEV_ASSERT_DEVINS(pDevIns) do { Assert(VALID_PTR(pDevIns)); \ 49 49 Assert(pDevIns->u32Version == PDM_DEVINS_VERSION); \ 50 Assert(pDevIns->pvInstanceData HC== (void *)&pDevIns->achInstanceData[0]); \50 Assert(pDevIns->pvInstanceDataR0 == (void *)&pDevIns->achInstanceData[0]); \ 51 51 } while (0) 52 52 #else -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r2248 r2270 378 378 GEN_CHECK_OFF(PGM, pTreesHC); 379 379 GEN_CHECK_OFF(PGM, pTreesGC); 380 GEN_CHECK_OFF(PGM, pMappings HC);380 GEN_CHECK_OFF(PGM, pMappingsR3); 381 381 GEN_CHECK_OFF(PGM, pMappingsGC); 382 GEN_CHECK_OFF(PGM, pMappingsR0); 382 383 GEN_CHECK_OFF(PGM, fMappingsFixed); 383 384 GEN_CHECK_OFF(PGM, GCPtrMappingFixed); … … 406 407 GEN_CHECK_OFF(PGM, pgmphyswritecache); 407 408 GEN_CHECK_SIZE(PGMMAPPING); 408 GEN_CHECK_OFF(PGMMAPPING, pNext HC);409 GEN_CHECK_OFF(PGMMAPPING, pNextR3); 409 410 GEN_CHECK_OFF(PGMMAPPING, pNextGC); 411 GEN_CHECK_OFF(PGMMAPPING, pNextR0); 410 412 GEN_CHECK_OFF(PGMMAPPING, GCPtr); 411 413 GEN_CHECK_OFF(PGMMAPPING, GCPtrLast); … … 416 418 GEN_CHECK_OFF(PGMMAPPING, cPTs); 417 419 GEN_CHECK_OFF(PGMMAPPING, aPTs[1].HCPhysPT); 418 GEN_CHECK_OFF(PGMMAPPING, aPTs[1].pPTHC); 420 GEN_CHECK_OFF(PGMMAPPING, aPTs[1].pPTR3); 421 GEN_CHECK_OFF(PGMMAPPING, aPTs[1].pPTR0); 419 422 GEN_CHECK_OFF(PGMMAPPING, aPTs[1].pPTGC); 420 423 GEN_CHECK_OFF(PGMMAPPING, aPTs[1].HCPhysPaePT0); 421 424 GEN_CHECK_OFF(PGMMAPPING, aPTs[1].HCPhysPaePT1); 422 GEN_CHECK_OFF(PGMMAPPING, aPTs[1].paPaePTs HC);425 GEN_CHECK_OFF(PGMMAPPING, aPTs[1].paPaePTsR3); 423 426 GEN_CHECK_OFF(PGMMAPPING, aPTs[1].paPaePTsGC); 427 GEN_CHECK_OFF(PGMMAPPING, aPTs[1].paPaePTsR0); 424 428 GEN_CHECK_SIZE(PGMPHYSHANDLER); 425 429 GEN_CHECK_OFF(PGMPHYSHANDLER, Core);
Note:
See TracChangeset
for help on using the changeset viewer.