PGMBth.h revision 4a0a575bd689b8b9e341365709a345ccaa58d543
/* $Id$ */
/** @file
* VBox - Page Manager / Monitor, Shadow+Guest Paging Template.
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
/*******************************************************************************
* Internal Functions *
*******************************************************************************/
PGM_BTH_DECL(int, SyncPage)(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError);
PGM_BTH_DECL(int, VerifyAccessSyncPage)(PVM pVM, RTGCUINTPTR Addr, unsigned fPage, unsigned uError);
PGM_BTH_DECL(unsigned, AssertCR3)(PVM pVM, uint64_t cr3, uint64_t cr4, RTGCUINTPTR GCPtr = 0, RTGCUINTPTR cb = ~(RTGCUINTPTR)0);
/**
* Initializes the both bit of the paging mode data.
*
* @returns VBox status code.
* @param pVM The VM handle.
* @param fResolveGCAndR0 Indicate whether or not GC and Ring-0 symbols can be resolved now.
* This is used early in the init process to avoid trouble with PDM
* not being initialized yet.
*/
{
/* Ring 3 */
#ifdef VBOX_STRICT
#endif
if (fResolveGCAndR0)
{
int rc;
#if PGM_SHW_TYPE != PGM_TYPE_AMD64 && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT /* No AMD64 for traditional virtualization, only VT-x and AMD-V. */
/* GC */
rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_GC_STR(Trap0eHandler), &pModeData->pfnGCBthTrap0eHandler);
rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_GC_STR(InvalidatePage), &pModeData->pfnGCBthInvalidatePage);
rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_GC_STR(PrefetchPage), &pModeData->pfnGCBthPrefetchPage);
rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_GC_STR(VerifyAccessSyncPage), &pModeData->pfnGCBthVerifyAccessSyncPage);
# ifdef VBOX_STRICT
# endif
#endif /* Not AMD64 shadow paging. */
/* Ring 0 */
rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_BTH_NAME_R0_STR(Trap0eHandler), &pModeData->pfnR0BthTrap0eHandler);
rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_BTH_NAME_R0_STR(InvalidatePage), &pModeData->pfnR0BthInvalidatePage);
rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_BTH_NAME_R0_STR(PrefetchPage), &pModeData->pfnR0BthPrefetchPage);
rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_BTH_NAME_R0_STR(VerifyAccessSyncPage), &pModeData->pfnR0BthVerifyAccessSyncPage);
#ifdef VBOX_STRICT
#endif
}
return VINF_SUCCESS;
}
/**
* Enters the shadow+guest mode.
*
* @returns VBox status code.
* @param pVM VM handle.
* @param GCPhysCR3 The physical address from the CR3 register.
*/
{
/* nothing special to do here - InitData does the job. */
return VINF_SUCCESS;
}
/**
* Relocate any GC pointers related to shadow mode paging.
*
* @returns VBox status code.
* @param pVM The VM handle.
* @param offDelta The reloation offset.
*/
{
/* nothing special to do here - InitData does the job. */
return VINF_SUCCESS;
}