VirtualBox

source: vbox/trunk/src/VBox/VMM/PGMGstDefs.h@ 24442

Last change on this file since 24442 was 17215, checked in by vboxsync, 16 years ago

Split up the definitions and the guest code. Otherwise we'll end up using e.g. wrong masks in Bth code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1/* $Id: PGMGstDefs.h 17215 2009-02-27 16:33:19Z vboxsync $ */
2/** @file
3 * VBox - Page Manager, Guest Paging Template - All context code.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22
23/*******************************************************************************
24* Defined Constants And Macros *
25*******************************************************************************/
26#undef GSTPT
27#undef PGSTPT
28#undef GSTPTE
29#undef PGSTPTE
30#undef GSTPD
31#undef PGSTPD
32#undef GSTPDE
33#undef PGSTPDE
34#undef GST_BIG_PAGE_SIZE
35#undef GST_BIG_PAGE_OFFSET_MASK
36#undef GST_PDE_PG_MASK
37#undef GST_PDE_BIG_PG_MASK
38#undef GST_PD_SHIFT
39#undef GST_PD_MASK
40#undef GST_PTE_PG_MASK
41#undef GST_PT_SHIFT
42#undef GST_PT_MASK
43#undef GST_TOTAL_PD_ENTRIES
44#undef GST_CR3_PAGE_MASK
45#undef GST_PDPE_ENTRIES
46#undef GST_PDPT_SHIFT
47#undef GST_PDPT_MASK
48#undef GST_PDPE_PG_MASK
49#undef GST_GET_PDE_BIG_PG_GCPHYS
50
51#if PGM_GST_TYPE == PGM_TYPE_REAL \
52 || PGM_GST_TYPE == PGM_TYPE_PROT
53
54# if PGM_SHW_TYPE == PGM_TYPE_EPT
55# define GSTPT X86PTPAE
56# define PGSTPT PX86PTPAE
57# define GSTPTE X86PTEPAE
58# define PGSTPTE PX86PTEPAE
59# define GSTPD X86PDPAE
60# define PGSTPD PX86PDPAE
61# define GSTPDE X86PDEPAE
62# define PGSTPDE PX86PDEPAE
63# define GST_PTE_PG_MASK X86_PTE_PAE_PG_MASK
64# else
65# define GSTPT SHWPT
66# define PGSTPT PSHWPT
67# define GSTPTE SHWPTE
68# define PGSTPTE PSHWPTE
69# define GSTPD SHWPD
70# define PGSTPD PSHWPD
71# define GSTPDE SHWPDE
72# define PGSTPDE PSHWPDE
73# define GST_PTE_PG_MASK SHW_PTE_PG_MASK
74# endif
75#elif PGM_GST_TYPE == PGM_TYPE_32BIT
76# define GSTPT X86PT
77# define PGSTPT PX86PT
78# define GSTPTE X86PTE
79# define PGSTPTE PX86PTE
80# define GSTPD X86PD
81# define PGSTPD PX86PD
82# define GSTPDE X86PDE
83# define PGSTPDE PX86PDE
84# define GST_BIG_PAGE_SIZE X86_PAGE_4M_SIZE
85# define GST_BIG_PAGE_OFFSET_MASK X86_PAGE_4M_OFFSET_MASK
86# define GST_PDE_PG_MASK X86_PDE_PG_MASK
87# define GST_PDE_BIG_PG_MASK X86_PDE4M_PG_MASK
88# define GST_GET_PDE_BIG_PG_GCPHYS(PdeGst) pgmGstGet4MBPhysPage(&pVM->pgm.s, PdeGst)
89# define GST_PD_SHIFT X86_PD_SHIFT
90# define GST_PD_MASK X86_PD_MASK
91# define GST_TOTAL_PD_ENTRIES X86_PG_ENTRIES
92# define GST_PTE_PG_MASK X86_PTE_PG_MASK
93# define GST_PT_SHIFT X86_PT_SHIFT
94# define GST_PT_MASK X86_PT_MASK
95# define GST_CR3_PAGE_MASK X86_CR3_PAGE_MASK
96
97#elif PGM_GST_TYPE == PGM_TYPE_PAE \
98 || PGM_GST_TYPE == PGM_TYPE_AMD64
99# define GSTPT X86PTPAE
100# define PGSTPT PX86PTPAE
101# define GSTPTE X86PTEPAE
102# define PGSTPTE PX86PTEPAE
103# define GSTPD X86PDPAE
104# define PGSTPD PX86PDPAE
105# define GSTPDE X86PDEPAE
106# define PGSTPDE PX86PDEPAE
107# define GST_BIG_PAGE_SIZE X86_PAGE_2M_SIZE
108# define GST_BIG_PAGE_OFFSET_MASK X86_PAGE_2M_OFFSET_MASK
109# define GST_PDE_PG_MASK X86_PDE_PAE_PG_MASK_FULL
110# define GST_PDE_BIG_PG_MASK X86_PDE2M_PAE_PG_MASK
111# define GST_GET_PDE_BIG_PG_GCPHYS(PdeGst) (PdeGst.u & GST_PDE_BIG_PG_MASK)
112# define GST_PD_SHIFT X86_PD_PAE_SHIFT
113# define GST_PD_MASK X86_PD_PAE_MASK
114# if PGM_GST_TYPE == PGM_TYPE_PAE
115# define GST_TOTAL_PD_ENTRIES (X86_PG_PAE_ENTRIES * X86_PG_PAE_PDPE_ENTRIES)
116# define GST_PDPE_ENTRIES X86_PG_PAE_PDPE_ENTRIES
117# define GST_PDPE_PG_MASK X86_PDPE_PG_MASK_FULL
118# define GST_PDPT_SHIFT X86_PDPT_SHIFT
119# define GST_PDPT_MASK X86_PDPT_MASK_PAE
120# define GST_PTE_PG_MASK X86_PTE_PAE_PG_MASK
121# define GST_CR3_PAGE_MASK X86_CR3_PAE_PAGE_MASK
122# else
123# define GST_TOTAL_PD_ENTRIES (X86_PG_AMD64_ENTRIES * X86_PG_AMD64_PDPE_ENTRIES)
124# define GST_PDPE_ENTRIES X86_PG_AMD64_PDPE_ENTRIES
125# define GST_PDPT_SHIFT X86_PDPT_SHIFT
126# define GST_PDPE_PG_MASK X86_PDPE_PG_MASK_FULL
127# define GST_PDPT_MASK X86_PDPT_MASK_AMD64
128# define GST_PTE_PG_MASK X86_PTE_PAE_PG_MASK_FULL
129# define GST_CR3_PAGE_MASK X86_CR3_AMD64_PAGE_MASK
130# endif
131# define GST_PT_SHIFT X86_PT_PAE_SHIFT
132# define GST_PT_MASK X86_PT_PAE_MASK
133#endif
134
135
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette