PGMGstDefs.h revision e64031e20c39650a7bc902a3e1aba613b9415dee
/* $Id$ */
/** @file
* VBox - Page Manager, Guest Paging Template - All context code.
*/
/*
* Copyright (C) 2006-2007 Oracle Corporation
*
* 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.
*/
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
#if PGM_GST_TYPE == PGM_TYPE_REAL \
|| PGM_GST_TYPE == PGM_TYPE_PROT
# if PGM_SHW_TYPE == PGM_TYPE_EPT
# define PGSTPTE PX86PTEPAE
# define PGSTPDE PX86PDEPAE
# define GST_PTE_PG_MASK X86_PTE_PAE_PG_MASK
# else
# define GST_PTE_PG_MASK SHW_PTE_PG_MASK
# endif
# define GST_BIG_PAGE_SIZE X86_PAGE_4M_SIZE
# define GST_PDE_PG_MASK X86_PDE_PG_MASK
# define GST_PDE_BIG_PG_MASK X86_PDE4M_PG_MASK
# define GST_PD_SHIFT X86_PD_SHIFT
# define GST_PD_MASK X86_PD_MASK
# define GST_TOTAL_PD_ENTRIES X86_PG_ENTRIES
# define GST_PTE_PG_MASK X86_PTE_PG_MASK
# define GST_PT_SHIFT X86_PT_SHIFT
# define GST_PT_MASK X86_PT_MASK
# define GST_CR3_PAGE_MASK X86_CR3_PAGE_MASK
|| PGM_GST_TYPE == PGM_TYPE_AMD64
# define PGSTPTE PX86PTEPAE
# define PGSTPDE PX86PDEPAE
# define GST_BIG_PAGE_SIZE X86_PAGE_2M_SIZE
# define GST_PDE_PG_MASK X86_PDE_PAE_PG_MASK_FULL
# define GST_PDE_BIG_PG_MASK X86_PDE2M_PAE_PG_MASK
# define GST_PD_SHIFT X86_PD_PAE_SHIFT
# define GST_PD_MASK X86_PD_PAE_MASK
# if PGM_GST_TYPE == PGM_TYPE_PAE
# define GST_PDPE_ENTRIES X86_PG_PAE_PDPE_ENTRIES
# define GST_PDPE_PG_MASK X86_PDPE_PG_MASK_FULL
# define GST_PDPT_SHIFT X86_PDPT_SHIFT
# define GST_PDPT_MASK X86_PDPT_MASK_PAE
# define GST_PTE_PG_MASK X86_PTE_PAE_PG_MASK
# define GST_CR3_PAGE_MASK X86_CR3_PAE_PAGE_MASK
# else
# define GST_PDPT_SHIFT X86_PDPT_SHIFT
# define GST_PDPE_PG_MASK X86_PDPE_PG_MASK_FULL
# define GST_PDPT_MASK X86_PDPT_MASK_AMD64
# define GST_PTE_PG_MASK X86_PTE_PAE_PG_MASK_FULL
# define GST_CR3_PAGE_MASK X86_CR3_AMD64_PAGE_MASK
# endif
# define GST_PT_SHIFT X86_PT_PAE_SHIFT
# define GST_PT_MASK X86_PT_PAE_MASK
#endif