pgm.h revision 172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync/* $Id$ */
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync/** @file
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync * PGM - Internal VMM header file.
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync */
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync/*
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync * Copyright (C) 2006-2010 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
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync#include <VBox/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,
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;
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsyncAssertCompile(PGMPAGETYPE_END <= 7);
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);
affe32a95c4c38d5631aefc2a1ed322997767116vboxsyncVMMDECL(int) PGMPhysGCPhys2R3Ptr(PVM pVM, RTGCPHYS GCPhys, RTUINT cbRange, PRTR3PTR pR3Ptr);
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync#ifdef VBOX_STRICT
affe32a95c4c38d5631aefc2a1ed322997767116vboxsyncVMMDECL(RTR3PTR) PGMPhysGCPhys2R3PtrAssert(PVM pVM, RTGCPHYS GCPhys, RTUINT cbRange);
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync#endif
95820aefec27d94d104409e59beac272aa90dff3vboxsyncVMMR3DECL(void) PGMR3ResetNoMorePhysWritesFlag(PVM pVM);
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync/** @} */
affe32a95c4c38d5631aefc2a1ed322997767116vboxsync#endif
172a5e92ef4c9d32cf6c85c57a2d084b746ba5e9vboxsync