VirtualBox

Changeset 15226 in vbox for trunk/include


Ignore:
Timestamp:
Dec 10, 2008 4:25:34 AM (16 years ago)
Author:
vboxsync
Message:

PGM: Inlined PGMDynMapHCPageOff (get rid of it perhaps?).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pgm.h

    r14969 r15226  
    3737#include <VBox/x86.h>
    3838#include <VBox/hwacc_vmx.h>
     39#if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE)
     40# include <iprt/err.h>
     41# include <VBox/param.h>
     42#endif
    3943
    4044__BEGIN_DECLS
     
    423427#define PGMPHYS_TRANSLATION_FLAG_DEFAULT           0
    424428/** Indicates that for monitored pages with physical handlers
    425  * VERR_PGM_PHYS_PAGE_RESERVED error code should be returned, 
    426  * so address translation routines must fallback to PGM functions for 
     429 * VERR_PGM_PHYS_PAGE_RESERVED error code should be returned,
     430 * so address translation routines must fallback to PGM functions for
    427431 * access memory. */
    428432#define PGMPHYS_TRANSLATION_FLAG_CHECK_PHYS_MONITORED   RT_BIT_32(0)
    429433/** Indicates that for monitored pages with virtual handlers
    430  * VERR_PGM_PHYS_PAGE_RESERVED error code should be returned, 
    431  * so address translation routines must fallback to PGM functions for 
     434 * VERR_PGM_PHYS_PAGE_RESERVED error code should be returned,
     435 * so address translation routines must fallback to PGM functions for
    432436 * access memory. */
    433437#define PGMPHYS_TRANSLATION_FLAG_CHECK_VIRT_MONITORED   RT_BIT_32(1)
     
    458462VMMDECL(int)        PGMDynMapGCPageOff(PVM pVM, RTGCPHYS GCPhys, void **ppv);
    459463VMMDECL(int)        PGMDynMapHCPage(PVM pVM, RTHCPHYS HCPhys, void **ppv);
    460 VMMDECL(int)        PGMDynMapHCPageOff(PVM pVM, RTHCPHYS HCPhys, void **ppv);
    461464VMMDECL(void)       PGMDynMapStartAutoSet(PVMCPU pVCpu);
    462465VMMDECL(void)       PGMDynMapReleaseAutoSet(PVMCPU pVCpu);
    463466VMMDECL(void)       PGMDynMapMigrateAutoSet(PVMCPU pVCpu);
     467
     468/**
     469 * Temporarily maps one host page specified by HC physical address, returning
     470 * pointer within the page.
     471 *
     472 * Be WARNED that the dynamic page mapping area is small, 8 pages, thus the space is
     473 * reused after 8 mappings (or perhaps a few more if you score with the cache).
     474 *
     475 * @returns VBox status.
     476 * @param   pVM         VM handle.
     477 * @param   HCPhys      HC Physical address of the page.
     478 * @param   ppv         Where to store the address corresponding to HCPhys.
     479 */
     480DECLINLINE(int) PGMDynMapHCPageOff(PVM pVM, RTHCPHYS HCPhys, void **ppv)
     481{
     482    int rc = PGMDynMapHCPage(pVM, HCPhys & ~(RTHCPHYS)PAGE_OFFSET_MASK, ppv);
     483    if (RT_SUCCESS(rc))
     484        *ppv = (void *)((uintptr_t)*ppv | (HCPhys & PAGE_OFFSET_MASK));
     485    return rc;
     486}
    464487#endif
    465488
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