- Timestamp:
- Nov 25, 2008 8:41:40 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/mm.h
r14594 r14597 337 337 * @{ */ 338 338 VMMDECL(int) MMR3HyperAllocOnceNoRel(PVM pVM, size_t cb, uint32_t uAlignment, MMTAG enmTag, void **ppv); 339 VMMR3DECL(int) MMR3HyperMapHCPhys(PVM pVM, void *pv HC, RTHCPHYS HCPhys, size_t cb, const char *pszDesc, PRTGCPTR pGCPtr);339 VMMR3DECL(int) MMR3HyperMapHCPhys(PVM pVM, void *pvR3, RTR0PTR pvR0, RTHCPHYS HCPhys, size_t cb, const char *pszDesc, PRTGCPTR pGCPtr); 340 340 VMMR3DECL(int) MMR3HyperMapGCPhys(PVM pVM, RTGCPHYS GCPhys, size_t cb, const char *pszDesc, PRTGCPTR pGCPtr); 341 341 VMMR3DECL(int) MMR3HyperMapMMIO2(PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, const char *pszDesc, PRTRCPTR pRCPtr); -
trunk/src/VBox/VMM/MMHyper.cpp
r14594 r14597 319 319 * 320 320 * @param pVM VM handle. 321 * @param pvR3 Host context address of the memory. Must be page322 * aligned!321 * @param pvR3 Ring-3 address of the memory. Must be page aligned! 322 * @param pvR0 Optional ring-0 address of the memory. 323 323 * @param HCPhys Host context physical address of the memory to be 324 324 * mapped. Must be page aligned! … … 327 327 * @param pGCPtr Where to store the GC address. 328 328 */ 329 VMMR3DECL(int) MMR3HyperMapHCPhys(PVM pVM, void *pvR3, RT HCPHYS HCPhys, size_t cb, const char *pszDesc, PRTGCPTR pGCPtr)330 { 331 LogFlow(("MMR3HyperMapHCPhys: pvR3=%p HCPhys=%RHp cb=%d pszDesc=%p:{%s} pGCPtr=%p\n", pvR3, HCPhys, (int)cb, pszDesc, pszDesc, pGCPtr));329 VMMR3DECL(int) MMR3HyperMapHCPhys(PVM pVM, void *pvR3, RTR0PTR pvR0, RTHCPHYS HCPhys, size_t cb, const char *pszDesc, PRTGCPTR pGCPtr) 330 { 331 LogFlow(("MMR3HyperMapHCPhys: pvR3=%p pvR0=%p HCPhys=%RHp cb=%d pszDesc=%p:{%s} pGCPtr=%p\n", pvR3, pvR0, HCPhys, (int)cb, pszDesc, pszDesc, pGCPtr)); 332 332 333 333 /* … … 335 335 */ 336 336 AssertReturn(RT_ALIGN_P(pvR3, PAGE_SIZE) == pvR3, VERR_INVALID_PARAMETER); 337 AssertReturn(RT_ALIGN_T(pvR0, PAGE_SIZE, RTR0PTR) == pvR0, VERR_INVALID_PARAMETER); 337 338 AssertReturn(RT_ALIGN_T(HCPhys, PAGE_SIZE, RTHCPHYS) == HCPhys, VERR_INVALID_PARAMETER); 338 339 AssertReturn(pszDesc && *pszDesc, VERR_INVALID_PARAMETER); … … 350 351 pLookup->enmType = MMLOOKUPHYPERTYPE_HCPHYS; 351 352 pLookup->u.HCPhys.pvR3 = pvR3; 353 pLookup->u.HCPhys.pvR0 = pvR0; 352 354 pLookup->u.HCPhys.HCPhys = HCPhys; 353 355 … … 1055 1057 { 1056 1058 case MMLOOKUPHYPERTYPE_LOCKED: 1057 pHlp->pfnPrintf(pHlp, "%RGv-%RGv %RHv LOCKED %-*s %s\n",1059 pHlp->pfnPrintf(pHlp, "%RGv-%RGv %RHv %RHv LOCKED %-*s %s\n", 1058 1060 pLookup->off + pVM->mm.s.pvHyperAreaGC, 1059 1061 pLookup->off + pVM->mm.s.pvHyperAreaGC + pLookup->cb, 1060 1062 pLookup->u.Locked.pvR3, 1063 pLookup->u.Locked.pvR0, 1061 1064 sizeof(RTHCPTR) * 2, 1062 1065 pLookup->u.Locked.pLockedMem->eType == MM_LOCKED_TYPE_HYPER_NOFREE ? "nofree" … … 1069 1072 1070 1073 case MMLOOKUPHYPERTYPE_HCPHYS: 1071 pHlp->pfnPrintf(pHlp, "%RGv-%RGv %RHv HCPHYS %RHp %s\n",1074 pHlp->pfnPrintf(pHlp, "%RGv-%RGv %RHv %RHv HCPHYS %RHp %s\n", 1072 1075 pLookup->off + pVM->mm.s.pvHyperAreaGC, 1073 1076 pLookup->off + pVM->mm.s.pvHyperAreaGC + pLookup->cb, 1074 pLookup->u.HCPhys.pvR3, pLookup->u.HCPhys.HCPhys, 1077 pLookup->u.HCPhys.pvR3, 1078 pLookup->u.HCPhys.pvR0, 1079 pLookup->u.HCPhys.HCPhys, 1075 1080 pLookup->pszDesc); 1076 1081 break; … … 1080 1085 pLookup->off + pVM->mm.s.pvHyperAreaGC, 1081 1086 pLookup->off + pVM->mm.s.pvHyperAreaGC + pLookup->cb, 1082 sizeof(RTHCPTR) * 2 , "",1087 sizeof(RTHCPTR) * 2 * 2 + 1, "", 1083 1088 pLookup->u.GCPhys.GCPhys, RT_ABS((int)(sizeof(RTHCPHYS) - sizeof(RTGCPHYS))) * 2, "", 1084 1089 pLookup->pszDesc); … … 1089 1094 pLookup->off + pVM->mm.s.pvHyperAreaGC, 1090 1095 pLookup->off + pVM->mm.s.pvHyperAreaGC + pLookup->cb, 1091 sizeof(RTHCPTR) * 2 , "",1096 sizeof(RTHCPTR) * 2 * 2 + 1, "", 1092 1097 pLookup->u.MMIO2.off, RT_ABS((int)(sizeof(RTHCPHYS) - sizeof(RTGCPHYS))) * 2, "", 1093 1098 pLookup->pszDesc); … … 1098 1103 pLookup->off + pVM->mm.s.pvHyperAreaGC, 1099 1104 pLookup->off + pVM->mm.s.pvHyperAreaGC + pLookup->cb, 1100 sizeof(RTHCPTR) * 2 , "",1105 sizeof(RTHCPTR) * 2 * 2 + 1, "", 1101 1106 sizeof(RTHCPTR) * 2, "", 1102 1107 pLookup->pszDesc); -
trunk/src/VBox/VMM/MMInternal.h
r14589 r14597 636 636 struct 637 637 { 638 /** Host context pointer. */638 /** Host context ring-3 pointer. */ 639 639 R3PTRTYPE(void *) pvR3; 640 /** Host context ring-0 pointer. */ 641 /** @todo #1865: Check if this actually works (doubt it) */ 640 /** Host context ring-0 pointer. Optional. */ 642 641 RTR0PTR pvR0; 643 642 /** Pointer to the locked mem record. */ … … 648 647 struct 649 648 { 650 /** Host context pointer. */649 /** Host context ring-3 pointer. */ 651 650 R3PTRTYPE(void *) pvR3; 652 /** @todo #1865: Add a pvR0 here! */ 653 /** HC physical address corresponding to pvR3. */ 651 /** Host context ring-0 pointer. Optional. */ 652 RTR0PTR pvR0; 653 /** HC physical address corresponding to pvR3/pvR0. */ 654 654 RTHCPHYS HCPhys; 655 655 } HCPhys; -
trunk/src/VBox/VMM/TM.cpp
r13830 r14597 217 217 218 218 RTGCPTR GCPtr; 219 rc = MMR3HyperMapHCPhys(pVM, pVM->tm.s.pvGIPR3, HCPhysGIP, PAGE_SIZE, "GIP", &GCPtr);219 rc = MMR3HyperMapHCPhys(pVM, pVM->tm.s.pvGIPR3, NIL_RTR0PTR, HCPhysGIP, PAGE_SIZE, "GIP", &GCPtr); 220 220 if (RT_FAILURE(rc)) 221 221 { -
trunk/src/VBox/VMM/VMMAll/MMAll.cpp
r13832 r14597 219 219 if (pLookup->u.Locked.pvR0) 220 220 return (RTR0PTR)((RTR0UINTPTR)pLookup->u.Locked.pvR0 + off); 221 /** @todo #1865: accessing ring-3 memory (LOCKED)! */ 221 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE /** @todo make NIL_RTR0PTR default! */ 222 return NIL_RTR0PTR; 223 #else 222 224 return (RTR0PTR)((RTR3UINTPTR)pLookup->u.Locked.pvR3 + off); 225 #endif 226 223 227 case MMLOOKUPHYPERTYPE_HCPHYS: 224 /** @todo #1865: accessing ring-3 memory (HCPHYS)! */ 225 return (RTR0PTR)((RTR3UINTPTR)pLookup->u.HCPhys.pvR3 + off); 228 if (pLookup->u.HCPhys.pvR0) 229 return (RTR0PTR)((RTR0UINTPTR)pLookup->u.HCPhys.pvR0 + off); 230 return NIL_RTR0PTR; 226 231 default: 227 232 AssertMsgFailed(("enmType=%d\n", pLookup->enmType)); -
trunk/src/VBox/VMM/VMMSwitcher.cpp
r14167 r14597 180 180 */ 181 181 RTGCPTR GCPtr; 182 rc = MMR3HyperMapHCPhys(pVM, pVM->vmm.s.pvCoreCodeR3, pVM->vmm.s.HCPhysCoreCode, cbCoreCode, "Core Code", &GCPtr); 182 rc = MMR3HyperMapHCPhys(pVM, pVM->vmm.s.pvCoreCodeR3, pVM->vmm.s.pvCoreCodeR0, pVM->vmm.s.HCPhysCoreCode, 183 cbCoreCode, "Core Code", &GCPtr); 183 184 if (RT_SUCCESS(rc)) 184 185 {
Note:
See TracChangeset
for help on using the changeset viewer.