affe32a95c4c38d5631aefc2a1ed322997767116vboxsync/* $Id$ */
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync/** @file
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync * PGM - Internal VMM header file.
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync */
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync/*
c58f1213e628a545081c70e26c6b67a841cff880vboxsync * Copyright (C) 2006-2011 Oracle Corporation
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync *
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync * available from http://www.virtualbox.org. This file is free software;
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync * you can redistribute it and/or modify it under the terms of the GNU
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync * General Public License (GPL) as published by the Free Software
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync */
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync#ifndef ___PGM_include_internal_h
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync#define ___PGM_include_internal_h
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsync#include <VBox/vmm/pgm.h>
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync/** @defgroup grp_pgm_int Internals
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync * @ingroup grp_pgm
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync * @internal
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync * @{
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync */
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync/**
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync * Page type.
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync *
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync * @remarks This enum has to fit in a 3-bit field (see PGMPAGE::u3Type).
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync * @remarks This is used in the saved state, so changes to it requires bumping
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync * the saved state version.
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync * @todo So, convert to \#defines!
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync */
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsynctypedef enum PGMPAGETYPE
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync{
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync /** The usual invalid zero entry. */
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync PGMPAGETYPE_INVALID = 0,
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync /** RAM page. (RWX) */
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync PGMPAGETYPE_RAM,
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync /** MMIO2 page. (RWX) */
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync PGMPAGETYPE_MMIO2,
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync /** MMIO2 page aliased over an MMIO page. (RWX)
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync * See PGMHandlerPhysicalPageAlias(). */
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync PGMPAGETYPE_MMIO2_ALIAS_MMIO,
b2fae6494c13147d0f29944b9bf048705a32750avboxsync /** Special page aliased over an MMIO page. (RWX)
b2fae6494c13147d0f29944b9bf048705a32750avboxsync * See PGMHandlerPhysicalPageAliasHC(), but this is generally only used for
b2fae6494c13147d0f29944b9bf048705a32750avboxsync * VT-x's APIC access page at the moment. Treated as MMIO by everyone except
b2fae6494c13147d0f29944b9bf048705a32750avboxsync * the shadow paging code. */
b2fae6494c13147d0f29944b9bf048705a32750avboxsync PGMPAGETYPE_SPECIAL_ALIAS_MMIO,
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync /** Shadowed ROM. (RWX) */
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync PGMPAGETYPE_ROM_SHADOW,
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync /** ROM page. (R-X) */
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync PGMPAGETYPE_ROM,
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync /** MMIO page. (---) */
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync PGMPAGETYPE_MMIO,
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync /** End of valid entries. */
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync PGMPAGETYPE_END
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync} PGMPAGETYPE;
b2fae6494c13147d0f29944b9bf048705a32750avboxsyncAssertCompile(PGMPAGETYPE_END == 8);
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsyncVMMDECL(PGMPAGETYPE) PGMPhysGetPageType(PVM pVM, RTGCPHYS GCPhys);
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync
affe32a95c4c38d5631aefc2a1ed322997767116vboxsyncVMMDECL(int) PGMPhysGCPhys2HCPhys(PVM pVM, RTGCPHYS GCPhys, PRTHCPHYS pHCPhys);
affe32a95c4c38d5631aefc2a1ed322997767116vboxsyncVMMDECL(int) PGMPhysGCPtr2HCPhys(PVMCPU pVCpu, RTGCPTR GCPtr, PRTHCPHYS pHCPhys);
affe32a95c4c38d5631aefc2a1ed322997767116vboxsyncVMMDECL(int) PGMPhysGCPhys2CCPtr(PVM pVM, RTGCPHYS GCPhys, void **ppv, PPGMPAGEMAPLOCK pLock);
affe32a95c4c38d5631aefc2a1ed322997767116vboxsyncVMMDECL(int) PGMPhysGCPhys2CCPtrReadOnly(PVM pVM, RTGCPHYS GCPhys, void const **ppv, PPGMPAGEMAPLOCK pLock);
affe32a95c4c38d5631aefc2a1ed322997767116vboxsyncVMMDECL(int) PGMPhysGCPtr2CCPtr(PVMCPU pVCpu, RTGCPTR GCPtr, void **ppv, PPGMPAGEMAPLOCK pLock);
affe32a95c4c38d5631aefc2a1ed322997767116vboxsyncVMMDECL(int) PGMPhysGCPtr2CCPtrReadOnly(PVMCPU pVCpu, RTGCPTR GCPtr, void const **ppv, PPGMPAGEMAPLOCK pLock);
95820aefec27d94d104409e59beac272aa90dff3vboxsyncVMMR3DECL(void) PGMR3ResetNoMorePhysWritesFlag(PVM pVM);
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync/** @} */
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync#endif
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync