VirtualBox

Changeset 31178 in vbox for trunk/src/VBox/VMM/PGMInternal.h


Ignore:
Timestamp:
Jul 28, 2010 5:21:13 PM (14 years ago)
Author:
vboxsync
Message:

PGM: Some more preparatory cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMInternal.h

    r31170 r31178  
    228228 *
    229229 * @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.
    230255 * @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.
    232258 * @param   ppv     Where to store the virtual address. No need to cast this.
    233259 *
    234  * @remark  In GC this uses PGMGCDynMapHCPage(), so it will consume of the
     260 * @remark  In GC this uses PGMGCDynMapGCPage(), so it will consume of the
    235261 *          small page window employeed by that function. Be careful.
    236262 * @remark  There is no need to assert on the result.
    237263 */
    238264#ifdef IN_RC
    239 # define PGM_HCPHYS_2_PTR(pVM, HCPhys, ppv) \
    240      PGMDynMapHCPage(pVM, HCPhys, (void **)(ppv))
     265# define PGM_GCPHYS_2_PTR_V2(pVM, pVCpu, GCPhys, ppv) \
     266     PGMDynMapGCPage(pVM, GCPhys, (void **)(ppv))
    241267#elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    242 # define PGM_HCPHYS_2_PTR(pVM, HCPhys, ppv) \
    243      pgmR0DynMapHCPageInlined(VMMGetCpu(pVM), HCPhys, (void **)(ppv))
     268# define PGM_GCPHYS_2_PTR_V2(pVM, pVCpu, GCPhys, ppv) \
     269     pgmR0DynMapGCPageV2Inlined(pVM, pVCpu, GCPhys, (void **)(ppv))
    244270#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! */
    247273#endif
    248274
     
    259285 * @remark  There is no need to assert on the result.
    260286 */
    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)
    271288
    272289/** @def PGM_GCPHYS_2_PTR_BY_VMCPU
     
    282299 * @remark  There is no need to assert on the result.
    283300 */
    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)
    291302
    292303/** @def PGM_GCPHYS_2_PTR_EX
     
    21682179 */
    21692180#if defined(IN_RC)
    2170 # define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage)   pgmPoolMapPageInlined((pVM), (pPage))
     2181# define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage)   pgmPoolMapPageV2Inlined((pVM), (pVCpu), (pPage))
    21712182#elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    2172 # define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage)   pgmPoolMapPageInlined((pVM), (pPage))
     2183# define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage)   pgmPoolMapPageV2Inlined((pVM), (pVCpu), (pPage))
    21732184#else
    21742185# 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.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette