Changeset 102 in vbox
- Timestamp:
- Jan 17, 2007 2:28:45 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 17548
- Location:
- trunk/src/VBox/VMM/PATM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PATM/PATM.cpp
r93 r102 1156 1156 if (enmType == PATM_LOOKUP_BOTHDIR) 1157 1157 { 1158 pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvl PVGet(&pPatch->Guest2PatchAddrTree, (AVLPVKEY)PatchOffset); /** @todo bird: this doesn't look right. check it out later. */1158 pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGet(&pPatch->Guest2PatchAddrTree, pInstrGC); 1159 1159 if (!pGuestToPatchRec) 1160 1160 { 1161 1161 pGuestToPatchRec = (PRECGUESTTOPATCH)(pPatchToGuestRec+1); 1162 pGuestToPatchRec->Core.Key = (AVLPVKEY)pInstrGC;1162 pGuestToPatchRec->Core.Key = pInstrGC; 1163 1163 pGuestToPatchRec->PatchOffset = PatchOffset; 1164 1164 1165 ret = RTAvl PVInsert(&pPatch->Guest2PatchAddrTree, &pGuestToPatchRec->Core);1165 ret = RTAvlGCPtrInsert(&pPatch->Guest2PatchAddrTree, &pGuestToPatchRec->Core); 1166 1166 Assert(ret); 1167 1167 } … … 1181 1181 void patmr3RemoveP2GLookupRecord(PVM pVM, PPATCHINFO pPatch, RTGCPTR pPatchInstrGC) 1182 1182 { 1183 PAVLU32NODECORE pNode;1184 PAVL PVNODECORE pNode2;1185 PRECPATCHTOGUEST pPatchToGuestRec;1186 uint32_t PatchOffset = pPatchInstrGC - pVM->patm.s.pPatchMemGC; /* Offset in memory reserved for PATM. */1183 PAVLU32NODECORE pNode; 1184 PAVLGCPTRNODECORE pNode2; 1185 PRECPATCHTOGUEST pPatchToGuestRec; 1186 uint32_t PatchOffset = pPatchInstrGC - pVM->patm.s.pPatchMemGC; /* Offset in memory reserved for PATM. */ 1187 1187 1188 1188 pPatchToGuestRec = (PRECPATCHTOGUEST)RTAvlU32Get(&pPatch->Patch2GuestAddrTree, PatchOffset); … … 1195 1195 1196 1196 Assert(pGuestToPatchRec->Core.Key); 1197 pNode2 = RTAvl PVRemove(&pPatch->Guest2PatchAddrTree, pGuestToPatchRec->Core.Key);1197 pNode2 = RTAvlGCPtrRemove(&pPatch->Guest2PatchAddrTree, pGuestToPatchRec->Core.Key); 1198 1198 Assert(pNode2); 1199 1199 } … … 4416 4416 4417 4417 /* Get the closest guest instruction (from below) */ 4418 PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvl PVGetBestFit(&pPatch->Guest2PatchAddrTree, (AVLPVKEY)pPage, true);4418 PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGetBestFit(&pPatch->Guest2PatchAddrTree, pPage, true); 4419 4419 Assert(pGuestToPatchRec); 4420 4420 if (pGuestToPatchRec) … … 4432 4432 { 4433 4433 /* Get the closest guest instruction (from above) */ 4434 pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvl PVGetBestFit(&pPatch->Guest2PatchAddrTree, (AVLPVKEY)(pPage-1), false);4434 pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGetBestFit(&pPatch->Guest2PatchAddrTree, pPage-1, false); 4435 4435 4436 4436 if (pGuestToPatchRec) … … 4445 4445 4446 4446 /* Get the closest guest instruction (from above) */ 4447 pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvl PVGetBestFit(&pPatch->Guest2PatchAddrTree, (AVLPVKEY)(pPage+PAGE_SIZE-1), false);4447 pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGetBestFit(&pPatch->Guest2PatchAddrTree, pPage+PAGE_SIZE-1, false); 4448 4448 Assert(pGuestToPatchRec); 4449 4449 if (pGuestToPatchRec) … … 4547 4547 { 4548 4548 /* Get the closest guest instruction (from above) */ 4549 PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvl PVGetBestFit(&pPatch->Guest2PatchAddrTree, (AVLPVKEY)pPage, true);4549 PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGetBestFit(&pPatch->Guest2PatchAddrTree, pPage, true); 4550 4550 if ( pGuestToPatchRec 4551 4551 && PAGE_ADDRESS(pGuestToPatchRec->Core.Key) == PAGE_ADDRESS(pPage) … … 4580 4580 { 4581 4581 /* Get the closest guest instruction (from above) */ 4582 PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvl PVGetBestFit(&pPatch->Guest2PatchAddrTree, (AVLPVKEY)pPage, true);4582 PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGetBestFit(&pPatch->Guest2PatchAddrTree, pPage, true); 4583 4583 if ( pGuestToPatchRec 4584 && PAGE_ADDRESS(pGuestToPatchRec->Core.Key) == PAGE_ADDRESS(pPage) 4584 && PAGE_ADDRESS(pGuestToPatchRec->Core.Key) == PAGE_ADDRESS(pPage) /** @todo bird: PAGE_ADDRESS is for the current context really. check out these. */ 4585 4585 ) 4586 4586 { … … 5431 5431 * 5432 5432 */ 5433 RTGCPTR patmGuestGCPtrToPatchGCPtr(PVM pVM, PPATCHINFO pPatch, GCPTRTYPE(uint8_t*) pInstrGC)5433 RTGCPTR patmGuestGCPtrToPatchGCPtr(PVM pVM, PPATCHINFO pPatch, GCPTRTYPE(uint8_t*) pInstrGC) 5434 5434 { 5435 5435 if (pPatch->Guest2PatchAddrTree) 5436 5436 { 5437 PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvl PVGet(&pPatch->Guest2PatchAddrTree, (AVLPVKEY)pInstrGC);5437 PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGet(&pPatch->Guest2PatchAddrTree, pInstrGC); 5438 5438 if (pGuestToPatchRec) 5439 5439 return pVM->patm.s.pPatchMemGC + pGuestToPatchRec->PatchOffset; -
trunk/src/VBox/VMM/PATM/PATMInternal.h
r93 r102 187 187 { 188 188 /** The key is a GC virtual address. */ 189 AVL PVNODECORECore;189 AVLGCPTRNODECORE Core; 190 190 191 191 /** Patch offset (relative to PATM::pPatchMemGC / PATM::pPatchMemHC). */ 192 uint32_t PatchOffset;192 uint32_t PatchOffset; 193 193 } RECGUESTTOPATCH, *PRECGUESTTOPATCH; 194 194 … … 259 259 */ 260 260 HCPTRTYPE(PAVLU32NODECORE) Patch2GuestAddrTree; 261 HCPTRTYPE(PAVL PVNODECORE) Guest2PatchAddrTree;261 HCPTRTYPE(PAVLGCPTRNODECORE) Guest2PatchAddrTree; 262 262 uint32_t nrPatch2GuestRecs; 263 263
Note:
See TracChangeset
for help on using the changeset viewer.