MMAllPagePool.cpp revision b543d0a09e23f097eaa63e37d122a30ec088f4bc
/* $Id$ */
/** @file
* MM - Memory Manager - Page Pool.
*
* @remarks This file is NOT built for the raw-mode context.
*/
/*
* 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_MM_POOL
#include "MMInternal.h"
#define USE_INLINE_ASM_BIT_OPS
#ifdef USE_INLINE_ASM_BIT_OPS
#endif
/**
* Converts a pool physical address to a linear address.
* The specified allocation type must match with the address.
*
* @returns Physical address.
* @returns NULL if not found or eType is not matching.
* @param pPool Pointer to the page pool.
* @param HCPhys The address to convert.
* @thread The Emulation Thread.
*/
{
#if 0 /** @todo have to fix the debugger, but until then this is going on my nerves. */
#ifdef IN_RING3
#endif
#endif
/*
* Lookup the virtual address.
*/
PMMPPLOOKUPHCPHYS pLookup = (PMMPPLOOKUPHCPHYS)RTAvlHCPhysGet(&pPool->pLookupPhys, HCPhys & X86_PTE_PAE_PG_MASK);
if (pLookup)
{
}
return NULL;
}
/**
* Convert physical address of a page to a HC virtual address.
* This works for pages allocated by MMR3PageAlloc(), MMR3PageAllocPhys()
* and MMR3PageAllocLow().
*
* @returns VBox status code.
* @param pVM VM handle.
* @param HCPhysPage The physical address of a page.
* @param ppvPage Where to store the address corresponding to HCPhysPage.
* @thread The Emulation Thread.
*/
{
if (!pvPage)
{
if (!pvPage)
{
return VERR_INVALID_POINTER;
}
}
return VINF_SUCCESS;
}
#endif /* !VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 */
#ifdef IN_RING3
/**
* Convert physical address of a page to a HC virtual address.
* This works for pages allocated by MMR3PageAlloc(), MMR3PageAllocPhys()
* and MMR3PageAllocLow().
*
* @returns Pointer to the page at that physical address.
* @param pVM VM handle.
* @param HCPhysPage The physical address of a page.
* @thread The Emulation Thread.
*/
{
if (!pvPage)
{
if (!pvPage)
{
}
}
return pvPage;
}
/**
* Try convert physical address of a page to a HC virtual address.
* This works for pages allocated by MMR3PageAlloc(), MMR3PageAllocPhys()
* and MMR3PageAllocLow().
*
* @returns VBox status code.
* @param pVM VM handle.
* @param HCPhysPage The physical address of a page.
* @param ppvPage Where to store the address corresponding to HCPhysPage.
* @thread The Emulation Thread.
*/
{
if (!pvPage)
{
if (!pvPage)
return VERR_INVALID_POINTER;
}
return VINF_SUCCESS;
}
/**
* Converts a pool address to a physical address.
* The specified allocation type must match with the address.
*
* @returns Physical address.
* @returns NIL_RTHCPHYS if not found or eType is not matching.
* @param pPool Pointer to the page pool.
* @param pv The address to convert.
* @thread The Emulation Thread.
*/
{
#ifdef IN_RING3
#endif
/*
* Lookup the virtual address.
*/
if (pLookup)
{
{
/*
* Convert the virtual address to a physical address.
*/
("pSubPool=%p uReserved=%p\n", pLookup->pSubPool, pLookup->pSubPool->paPhysPages[iPage].uReserved));
}
}
return NIL_RTHCPHYS;
}
/**
* Convert a page in the page pool to a HC physical address.
* This works for pages allocated by MMR3PageAlloc(), MMR3PageAllocPhys()
* and MMR3PageAllocLow().
*
* @returns Physical address for the specified page table.
* @param pVM VM handle.
* @param pvPage Page which physical address we query.
* @thread The Emulation Thread.
*/
{
if (HCPhys == NIL_RTHCPHYS)
{
if (HCPhys == NIL_RTHCPHYS)
{
}
}
return HCPhys;
}
#endif /* IN_RING3 */