Changeset 31178 in vbox for trunk/src/VBox/VMM/PGMInternal.h
- Timestamp:
- Jul 28, 2010 5:21:13 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r31170 r31178 228 228 * 229 229 * @returns VBox status code. 230 * @param pVM The VM handle. 231 * @param pVCpu The current CPU. 232 * @param HCPhys The HC physical address to map to a virtual one. 233 * @param ppv Where to store the virtual address. No need to cast 234 * this. 235 * 236 * @remark In RC this uses PGMDynMapHCPage(), so it will consume of the small 237 * page window employeed by that function. Be careful. 238 * @remark There is no need to assert on the result. 239 */ 240 #ifdef IN_RC 241 # define PGM_HCPHYS_2_PTR(pVM, pVCpu, HCPhys, ppv) \ 242 PGMDynMapHCPage(pVM, HCPhys, (void **)(ppv)) 243 #elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 244 # define PGM_HCPHYS_2_PTR(pVM, pVCpu, HCPhys, ppv) \ 245 pgmR0DynMapHCPageInlined(pVCpu, HCPhys, (void **)(ppv)) 246 #else 247 # define PGM_HCPHYS_2_PTR(pVM, pVCpu, HCPhys, ppv) \ 248 MMPagePhys2PageEx(pVM, HCPhys, (void **)(ppv)) 249 #endif 250 251 /** @def PGM_GCPHYS_2_PTR_V2 252 * Maps a GC physical page address to a virtual address. 253 * 254 * @returns VBox status code. 230 255 * @param pVM The VM handle. 231 * @param HCPhys The HC physical address to map to a virtual one. 256 * @param pVCpu The current CPU. 257 * @param GCPhys The GC physical address to map to a virtual one. 232 258 * @param ppv Where to store the virtual address. No need to cast this. 233 259 * 234 * @remark In GC this uses PGMGCDynMap HCPage(), so it will consume of the260 * @remark In GC this uses PGMGCDynMapGCPage(), so it will consume of the 235 261 * small page window employeed by that function. Be careful. 236 262 * @remark There is no need to assert on the result. 237 263 */ 238 264 #ifdef IN_RC 239 # define PGM_ HCPHYS_2_PTR(pVM, HCPhys, ppv) \240 PGMDynMap HCPage(pVM, HCPhys, (void **)(ppv))265 # define PGM_GCPHYS_2_PTR_V2(pVM, pVCpu, GCPhys, ppv) \ 266 PGMDynMapGCPage(pVM, GCPhys, (void **)(ppv)) 241 267 #elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 242 # define PGM_ HCPHYS_2_PTR(pVM, HCPhys, ppv) \243 pgmR0DynMap HCPageInlined(VMMGetCpu(pVM), HCPhys, (void **)(ppv))268 # define PGM_GCPHYS_2_PTR_V2(pVM, pVCpu, GCPhys, ppv) \ 269 pgmR0DynMapGCPageV2Inlined(pVM, pVCpu, GCPhys, (void **)(ppv)) 244 270 #else 245 # define PGM_ HCPHYS_2_PTR(pVM, HCPhys, ppv) \246 MMPagePhys2PageEx(pVM, HCPhys, (void **)(ppv))271 # define PGM_GCPHYS_2_PTR_V2(pVM, pVCpu, GCPhys, ppv) \ 272 PGMPhysGCPhys2R3Ptr(pVM, GCPhys, 1 /* one page only */, (PRTR3PTR)(ppv)) /** @todo this isn't asserting, use PGMRamGCPhys2HCPtr! */ 247 273 #endif 248 274 … … 259 285 * @remark There is no need to assert on the result. 260 286 */ 261 #ifdef IN_RC 262 # define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) \ 263 PGMDynMapGCPage(pVM, GCPhys, (void **)(ppv)) 264 #elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 265 # define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) \ 266 pgmR0DynMapGCPageInlined(VMMGetCpu(pVM), GCPhys, (void **)(ppv)) 267 #else 268 # define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) \ 269 PGMPhysGCPhys2R3Ptr(pVM, GCPhys, 1 /* one page only */, (PRTR3PTR)(ppv)) /** @todo this isn't asserting, use PGMRamGCPhys2HCPtr! */ 270 #endif 287 #define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) PGM_GCPHYS_2_PTR_V2(pVM, VMMGetCpu(pVM), GCPhys, ppv) 271 288 272 289 /** @def PGM_GCPHYS_2_PTR_BY_VMCPU … … 282 299 * @remark There is no need to assert on the result. 283 300 */ 284 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 285 # define PGM_GCPHYS_2_PTR_BY_VMCPU(pVCpu, GCPhys, ppv) \ 286 pgmR0DynMapGCPageInlined(pVCpu, GCPhys, (void **)(ppv)) 287 #else 288 # define PGM_GCPHYS_2_PTR_BY_VMCPU(pVCpu, GCPhys, ppv) \ 289 PGM_GCPHYS_2_PTR((pVCpu)->CTX_SUFF(pVM), GCPhys, ppv) 290 #endif 301 #define PGM_GCPHYS_2_PTR_BY_VMCPU(pVCpu, GCPhys, ppv) PGM_GCPHYS_2_PTR_V2((pVCpu)->CTX_SUFF(pVM), pVCpu, GCPhys, ppv) 291 302 292 303 /** @def PGM_GCPHYS_2_PTR_EX … … 2168 2179 */ 2169 2180 #if defined(IN_RC) 2170 # define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage) pgmPoolMapPage Inlined((pVM), (pPage))2181 # define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage) pgmPoolMapPageV2Inlined((pVM), (pVCpu), (pPage)) 2171 2182 #elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 2172 # define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage) pgmPoolMapPage Inlined((pVM), (pPage))2183 # define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage) pgmPoolMapPageV2Inlined((pVM), (pVCpu), (pPage)) 2173 2184 #else 2174 2185 # define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage) PGMPOOL_PAGE_2_PTR((pVM), (pPage))
Note:
See TracChangeset
for help on using the changeset viewer.