VirtualBox

source: vbox/trunk/include/VBox/x86.mac@ 33806

最後變更 在這個檔案從33806是 32036,由 vboxsync 提交於 14 年 前

Removed X86_PTE_PAE_PG_MASK, renamed X86_PTE_PAE_PG_MASK_FULL to X86_PTE_PAE_PG_MASK.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 26.4 KB
 
1%ifndef ___VBox_x86_h
2%define ___VBox_x86_h
3%ifdef RT_OS_SOLARIS
4%endif
5%define X86_EFL_CF RT_BIT(0)
6%define X86_EFL_PF RT_BIT(2)
7%define X86_EFL_AF RT_BIT(4)
8%define X86_EFL_ZF RT_BIT(6)
9%define X86_EFL_SF RT_BIT(7)
10%define X86_EFL_TF RT_BIT(8)
11%define X86_EFL_IF RT_BIT(9)
12%define X86_EFL_DF RT_BIT(10)
13%define X86_EFL_OF RT_BIT(11)
14%define X86_EFL_IOPL (RT_BIT(12) | RT_BIT(13))
15%define X86_EFL_NT RT_BIT(14)
16%define X86_EFL_RF RT_BIT(16)
17%define X86_EFL_VM RT_BIT(17)
18%define X86_EFL_AC RT_BIT(18)
19%define X86_EFL_VIF RT_BIT(19)
20%define X86_EFL_VIP RT_BIT(20)
21%define X86_EFL_ID RT_BIT(21)
22%define X86_EFL_IOPL_SHIFT 12
23%define X86_EFL_GET_IOPL(efl) (((efl) >> X86_EFL_IOPL_SHIFT) & 3)
24%define X86_EFL_POPF_BITS (X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_TF | X86_EFL_IF | X86_EFL_DF | X86_EFL_OF | X86_EFL_IOPL | X86_EFL_NT | X86_EFL_AC | X86_EFL_ID)
25%define X86_CPUID_VENDOR_INTEL_EBX 0x756e6547
26%define X86_CPUID_VENDOR_INTEL_ECX 0x6c65746e
27%define X86_CPUID_VENDOR_INTEL_EDX 0x49656e69
28%define X86_CPUID_VENDOR_AMD_EBX 0x68747541
29%define X86_CPUID_VENDOR_AMD_ECX 0x444d4163
30%define X86_CPUID_VENDOR_AMD_EDX 0x69746e65
31%define X86_CPUID_FEATURE_ECX_SSE3 RT_BIT(0)
32%define X86_CPUID_FEATURE_ECX_PCLMUL RT_BIT(1)
33%define X86_CPUID_FEATURE_ECX_DTES64 RT_BIT(2)
34%define X86_CPUID_FEATURE_ECX_MONITOR RT_BIT(3)
35%define X86_CPUID_FEATURE_ECX_CPLDS RT_BIT(4)
36%define X86_CPUID_FEATURE_ECX_VMX RT_BIT(5)
37%define X86_CPUID_FEATURE_ECX_SMX RT_BIT(6)
38%define X86_CPUID_FEATURE_ECX_EST RT_BIT(7)
39%define X86_CPUID_FEATURE_ECX_TM2 RT_BIT(8)
40%define X86_CPUID_FEATURE_ECX_SSSE3 RT_BIT(9)
41%define X86_CPUID_FEATURE_ECX_CNTXID RT_BIT(10)
42%define X86_CPUID_FEATURE_ECX_FMA RT_BIT(12)
43%define X86_CPUID_FEATURE_ECX_CX16 RT_BIT(13)
44%define X86_CPUID_FEATURE_ECX_TPRUPDATE RT_BIT(14)
45%define X86_CPUID_FEATURE_ECX_PDCM RT_BIT(15)
46%define X86_CPUID_FEATURE_ECX_DCA RT_BIT(18)
47%define X86_CPUID_FEATURE_ECX_SSE4_1 RT_BIT(19)
48%define X86_CPUID_FEATURE_ECX_SSE4_2 RT_BIT(20)
49%define X86_CPUID_FEATURE_ECX_X2APIC RT_BIT(21)
50%define X86_CPUID_FEATURE_ECX_MOVBE RT_BIT(22)
51%define X86_CPUID_FEATURE_ECX_POPCNT RT_BIT(23)
52%define X86_CPUID_FEATURE_ECX_AES RT_BIT(25)
53%define X86_CPUID_FEATURE_ECX_XSAVE RT_BIT(26)
54%define X86_CPUID_FEATURE_ECX_OSXSAVE RT_BIT(27)
55%define X86_CPUID_FEATURE_ECX_AVX RT_BIT(28)
56%define X86_CPUID_FEATURE_EDX_FPU RT_BIT(0)
57%define X86_CPUID_FEATURE_EDX_VME RT_BIT(1)
58%define X86_CPUID_FEATURE_EDX_DE RT_BIT(2)
59%define X86_CPUID_FEATURE_EDX_PSE RT_BIT(3)
60%define X86_CPUID_FEATURE_EDX_TSC RT_BIT(4)
61%define X86_CPUID_FEATURE_EDX_MSR RT_BIT(5)
62%define X86_CPUID_FEATURE_EDX_PAE RT_BIT(6)
63%define X86_CPUID_FEATURE_EDX_MCE RT_BIT(7)
64%define X86_CPUID_FEATURE_EDX_CX8 RT_BIT(8)
65%define X86_CPUID_FEATURE_EDX_APIC RT_BIT(9)
66%define X86_CPUID_FEATURE_EDX_SEP RT_BIT(11)
67%define X86_CPUID_FEATURE_EDX_MTRR RT_BIT(12)
68%define X86_CPUID_FEATURE_EDX_PGE RT_BIT(13)
69%define X86_CPUID_FEATURE_EDX_MCA RT_BIT(14)
70%define X86_CPUID_FEATURE_EDX_CMOV RT_BIT(15)
71%define X86_CPUID_FEATURE_EDX_PAT RT_BIT(16)
72%define X86_CPUID_FEATURE_EDX_PSE36 RT_BIT(17)
73%define X86_CPUID_FEATURE_EDX_PSN RT_BIT(18)
74%define X86_CPUID_FEATURE_EDX_CLFSH RT_BIT(19)
75%define X86_CPUID_FEATURE_EDX_DS RT_BIT(21)
76%define X86_CPUID_FEATURE_EDX_ACPI RT_BIT(22)
77%define X86_CPUID_FEATURE_EDX_MMX RT_BIT(23)
78%define X86_CPUID_FEATURE_EDX_FXSR RT_BIT(24)
79%define X86_CPUID_FEATURE_EDX_SSE RT_BIT(25)
80%define X86_CPUID_FEATURE_EDX_SSE2 RT_BIT(26)
81%define X86_CPUID_FEATURE_EDX_SS RT_BIT(27)
82%define X86_CPUID_FEATURE_EDX_HTT RT_BIT(28)
83%define X86_CPUID_FEATURE_EDX_TM RT_BIT(29)
84%define X86_CPUID_FEATURE_EDX_PBE RT_BIT(31)
85%define X86_CPUID_MWAIT_ECX_EXT RT_BIT(0)
86%define X86_CPUID_MWAIT_ECX_BREAKIRQIF0 RT_BIT(1)
87%define X86_CPUID_AMD_FEATURE_EDX_FPU RT_BIT(0)
88%define X86_CPUID_AMD_FEATURE_EDX_VME RT_BIT(1)
89%define X86_CPUID_AMD_FEATURE_EDX_DE RT_BIT(2)
90%define X86_CPUID_AMD_FEATURE_EDX_PSE RT_BIT(3)
91%define X86_CPUID_AMD_FEATURE_EDX_TSC RT_BIT(4)
92%define X86_CPUID_AMD_FEATURE_EDX_MSR RT_BIT(5)
93%define X86_CPUID_AMD_FEATURE_EDX_PAE RT_BIT(6)
94%define X86_CPUID_AMD_FEATURE_EDX_MCE RT_BIT(7)
95%define X86_CPUID_AMD_FEATURE_EDX_CX8 RT_BIT(8)
96%define X86_CPUID_AMD_FEATURE_EDX_APIC RT_BIT(9)
97%define X86_CPUID_AMD_FEATURE_EDX_SEP RT_BIT(11)
98%define X86_CPUID_AMD_FEATURE_EDX_MTRR RT_BIT(12)
99%define X86_CPUID_AMD_FEATURE_EDX_PGE RT_BIT(13)
100%define X86_CPUID_AMD_FEATURE_EDX_MCA RT_BIT(14)
101%define X86_CPUID_AMD_FEATURE_EDX_CMOV RT_BIT(15)
102%define X86_CPUID_AMD_FEATURE_EDX_PAT RT_BIT(16)
103%define X86_CPUID_AMD_FEATURE_EDX_PSE36 RT_BIT(17)
104%define X86_CPUID_AMD_FEATURE_EDX_NX RT_BIT(20)
105%define X86_CPUID_AMD_FEATURE_EDX_AXMMX RT_BIT(22)
106%define X86_CPUID_AMD_FEATURE_EDX_MMX RT_BIT(23)
107%define X86_CPUID_AMD_FEATURE_EDX_FXSR RT_BIT(24)
108%define X86_CPUID_AMD_FEATURE_EDX_FFXSR RT_BIT(25)
109%define X86_CPUID_AMD_FEATURE_EDX_PAGE1GB RT_BIT(26)
110%define X86_CPUID_AMD_FEATURE_EDX_RDTSCP RT_BIT(27)
111%define X86_CPUID_AMD_FEATURE_EDX_LONG_MODE RT_BIT(29)
112%define X86_CPUID_AMD_FEATURE_EDX_3DNOW_EX RT_BIT(30)
113%define X86_CPUID_AMD_FEATURE_EDX_3DNOW RT_BIT(31)
114%define X86_CPUID_AMD_FEATURE_ECX_LAHF_SAHF RT_BIT(0)
115%define X86_CPUID_AMD_FEATURE_ECX_CMPL RT_BIT(1)
116%define X86_CPUID_AMD_FEATURE_ECX_SVM RT_BIT(2)
117%define X86_CPUID_AMD_FEATURE_ECX_EXT_APIC RT_BIT(3)
118%define X86_CPUID_AMD_FEATURE_ECX_CR8L RT_BIT(4)
119%define X86_CPUID_AMD_FEATURE_ECX_ABM RT_BIT(5)
120%define X86_CPUID_AMD_FEATURE_ECX_SSE4A RT_BIT(6)
121%define X86_CPUID_AMD_FEATURE_ECX_MISALNSSE RT_BIT(7)
122%define X86_CPUID_AMD_FEATURE_ECX_3DNOWPRF RT_BIT(8)
123%define X86_CPUID_AMD_FEATURE_ECX_OSVW RT_BIT(9)
124%define X86_CPUID_AMD_FEATURE_ECX_IBS RT_BIT(10)
125%define X86_CPUID_AMD_FEATURE_ECX_SSE5 RT_BIT(11)
126%define X86_CPUID_AMD_FEATURE_ECX_SKINIT RT_BIT(12)
127%define X86_CPUID_AMD_FEATURE_ECX_WDT RT_BIT(13)
128%define X86_CPUID_AMD_ADVPOWER_EDX_TS RT_BIT(0)
129%define X86_CPUID_AMD_ADVPOWER_EDX_FID RT_BIT(1)
130%define X86_CPUID_AMD_ADVPOWER_EDX_VID RT_BIT(2)
131%define X86_CPUID_AMD_ADVPOWER_EDX_TTP RT_BIT(3)
132%define X86_CPUID_AMD_ADVPOWER_EDX_TM RT_BIT(4)
133%define X86_CPUID_AMD_ADVPOWER_EDX_STC RT_BIT(5)
134%define X86_CPUID_AMD_ADVPOWER_EDX_MC RT_BIT(6)
135%define X86_CPUID_AMD_ADVPOWER_EDX_HWPSTATE RT_BIT(7)
136%define X86_CPUID_AMD_ADVPOWER_EDX_TSCINVAR RT_BIT(8)
137%define X86_CR0_PE RT_BIT(0)
138%define X86_CR0_PROTECTION_ENABLE RT_BIT(0)
139%define X86_CR0_MP RT_BIT(1)
140%define X86_CR0_MONITOR_COPROCESSOR RT_BIT(1)
141%define X86_CR0_EM RT_BIT(2)
142%define X86_CR0_EMULATE_FPU RT_BIT(2)
143%define X86_CR0_TS RT_BIT(3)
144%define X86_CR0_TASK_SWITCH RT_BIT(3)
145%define X86_CR0_ET RT_BIT(4)
146%define X86_CR0_EXTENSION_TYPE RT_BIT(4)
147%define X86_CR0_NE RT_BIT(5)
148%define X86_CR0_NUMERIC_ERROR RT_BIT(5)
149%define X86_CR0_WP RT_BIT(16)
150%define X86_CR0_WRITE_PROTECT RT_BIT(16)
151%define X86_CR0_AM RT_BIT(18)
152%define X86_CR0_ALIGMENT_MASK RT_BIT(18)
153%define X86_CR0_NW RT_BIT(29)
154%define X86_CR0_NOT_WRITE_THROUGH RT_BIT(29)
155%define X86_CR0_CD RT_BIT(30)
156%define X86_CR0_CACHE_DISABLE RT_BIT(30)
157%define X86_CR0_PG RT_BIT(31)
158%define X86_CR0_PAGING RT_BIT(31)
159%define X86_CR3_PWT RT_BIT(3)
160%define X86_CR3_PCD RT_BIT(4)
161%define X86_CR3_PAGE_MASK (0xfffff000)
162%define X86_CR3_PAE_PAGE_MASK (0xffffffe0)
163%define X86_CR3_AMD64_PAGE_MASK 0x000ffffffffff000
164%define X86_CR4_VME RT_BIT(0)
165%define X86_CR4_PVI RT_BIT(1)
166%define X86_CR4_TSD RT_BIT(2)
167%define X86_CR4_DE RT_BIT(3)
168%define X86_CR4_PSE RT_BIT(4)
169%define X86_CR4_PAE RT_BIT(5)
170%define X86_CR4_MCE RT_BIT(6)
171%define X86_CR4_PGE RT_BIT(7)
172%define X86_CR4_PCE RT_BIT(8)
173%define X86_CR4_OSFSXR RT_BIT(9)
174%define X86_CR4_OSXMMEEXCPT RT_BIT(10)
175%define X86_CR4_VMXE RT_BIT(13)
176%define X86_DR6_B0 RT_BIT(0)
177%define X86_DR6_B1 RT_BIT(1)
178%define X86_DR6_B2 RT_BIT(2)
179%define X86_DR6_B3 RT_BIT(3)
180%define X86_DR6_BD RT_BIT(13)
181%define X86_DR6_BS RT_BIT(14)
182%define X86_DR6_BT RT_BIT(15)
183%define X86_DR6_INIT_VAL 0xFFFF0FF0
184%define X86_DR7_L0 RT_BIT(0)
185%define X86_DR7_G0 RT_BIT(1)
186%define X86_DR7_L1 RT_BIT(2)
187%define X86_DR7_G1 RT_BIT(3)
188%define X86_DR7_L2 RT_BIT(4)
189%define X86_DR7_G2 RT_BIT(5)
190%define X86_DR7_L3 RT_BIT(6)
191%define X86_DR7_G3 RT_BIT(7)
192%define X86_DR7_LE RT_BIT(8)
193%define X86_DR7_GE RT_BIT(9)
194%define X86_DR7_GD RT_BIT(13)
195%define X86_DR7_RW0_MASK (3 << 16)
196%define X86_DR7_LEN0_MASK (3 << 18)
197%define X86_DR7_RW1_MASK (3 << 20)
198%define X86_DR7_LEN1_MASK (3 << 22)
199%define X86_DR7_RW2_MASK (3 << 24)
200%define X86_DR7_LEN2_MASK (3 << 26)
201%define X86_DR7_RW3_MASK (3 << 28)
202%define X86_DR7_LEN3_MASK (3 << 30)
203%define X86_DR7_MB1_MASK (RT_BIT(10))
204%define X86_DR7_L(iBp) ( 1 << (iBp * 2) )
205%define X86_DR7_G(iBp) ( 1 << (iBp * 2 + 1) )
206%define X86_DR7_RW_EO 0
207%define X86_DR7_RW_WO 1
208%define X86_DR7_RW_IO 2
209%define X86_DR7_RW_RW 3
210%define X86_DR7_RW(iBp, fRw) ( (fRw) << ((iBp) * 4 + 16) )
211%define X86_DR7_LEN_BYTE 0
212%define X86_DR7_LEN_WORD 1
213%define X86_DR7_LEN_QWORD 2
214%define X86_DR7_LEN_DWORD 3
215%define X86_DR7_LEN(iBp, cb) ( (cb) << ((iBp) * 4 + 18) )
216%define X86_DR7_GET_LEN(uDR7, iBp) ( ( (uDR7) >> ((iBp) * 4 + 18) ) & 0x3)
217%define X86_DR7_ENABLED_MASK (RT_BIT(0) | RT_BIT(1) | RT_BIT(2) | RT_BIT(3) | RT_BIT(4) | RT_BIT(5) | RT_BIT(6) | RT_BIT(7))
218%define X86_DR7_IO_ENABLED_MASK (X86_DR7_RW(0, X86_DR7_RW_IO) | X86_DR7_RW(1, X86_DR7_RW_IO) | X86_DR7_RW(2, X86_DR7_RW_IO) | X86_DR7_RW(3, X86_DR7_RW_IO))
219%define X86_DR7_INIT_VAL 0x400
220%define MSR_IA32_TSC 0x10
221%define MSR_IA32_PLATFORM_ID 0x17
222%ifndef MSR_IA32_APICBASE
223%define MSR_IA32_APICBASE 0x1b
224%endif
225%define MSR_IA32_FEATURE_CONTROL 0x3A
226%define MSR_IA32_FEATURE_CONTROL_LOCK RT_BIT(0)
227%define MSR_IA32_FEATURE_CONTROL_VMXON RT_BIT(2)
228%define MSR_IA32_BIOS_UPDT_TRIG 0x79
229%define MSR_IA32_BIOS_SIGN_ID 0x8B
230%define MSR_IA32_PMC0 0xC1
231%define MSR_IA32_PMC1 0xC2
232%define MSR_IA32_PMC2 0xC3
233%define MSR_IA32_PMC3 0xC4
234%define MSR_IA32_PLATFORM_INFO 0xCE
235%define MSR_IA32_FSB_CLOCK_STS 0xCD
236%define MSR_IA32_MTRR_CAP 0xFE
237%ifndef MSR_IA32_SYSENTER_CS
238%define MSR_IA32_SYSENTER_CS 0x174
239%define MSR_IA32_SYSENTER_ESP 0x175
240%define MSR_IA32_SYSENTER_EIP 0x176
241%endif
242%define MSR_IA32_MCP_CAP 0x179
243%define MSR_IA32_MCP_STATUS 0x17A
244%define MSR_IA32_MCP_CTRL 0x17B
245%define MSR_IA32_DEBUGCTL 0x1D9
246%define MSR_IA32_CR_PAT 0x277
247%define MSR_IA32_PERFEVTSEL0 0x186
248%define MSR_IA32_PERFEVTSEL1 0x187
249%define MSR_IA32_FLEX_RATIO 0x194
250%define MSR_IA32_PERF_STATUS 0x198
251%define MSR_IA32_PERF_CTL 0x199
252%define MSR_IA32_THERM_STATUS 0x19c
253%define MSR_IA32_MISC_ENABLE 0x1A0
254%define MSR_IA32_MTRR_DEF_TYPE 0x2FF
255%define MSR_IA32_MC0_CTL 0x400
256%define MSR_IA32_MC0_STATUS 0x401
257%define MSR_IA32_VMX_BASIC_INFO 0x480
258%define MSR_IA32_VMX_PINBASED_CTLS 0x481
259%define MSR_IA32_VMX_PROCBASED_CTLS 0x482
260%define MSR_IA32_VMX_EXIT_CTLS 0x483
261%define MSR_IA32_VMX_ENTRY_CTLS 0x484
262%define MSR_IA32_VMX_MISC 0x485
263%define MSR_IA32_VMX_CR0_FIXED0 0x486
264%define MSR_IA32_VMX_CR0_FIXED1 0x487
265%define MSR_IA32_VMX_CR4_FIXED0 0x488
266%define MSR_IA32_VMX_CR4_FIXED1 0x489
267%define MSR_IA32_VMX_VMCS_ENUM 0x48A
268%define MSR_IA32_VMX_PROCBASED_CTLS2 0x48B
269%define MSR_IA32_VMX_EPT_CAPS 0x48C
270%define MSR_IA32_DS_AREA 0x600
271%define MSR_IA32_APIC_START 0x800
272%define MSR_IA32_APIC_END 0x900
273%define MSR_K6_EFER 0xc0000080
274%define MSR_K6_EFER_SCE RT_BIT(0)
275%define MSR_K6_EFER_LME RT_BIT(8)
276%define MSR_K6_EFER_LMA RT_BIT(10)
277%define MSR_K6_EFER_NXE RT_BIT(11)
278%define MSR_K6_EFER_SVME RT_BIT(12)
279%define MSR_K6_EFER_LMSLE RT_BIT(13)
280%define MSR_K6_EFER_FFXSR RT_BIT(14)
281%define MSR_K6_STAR 0xc0000081
282%define MSR_K6_STAR_SYSRET_CS_SS_SHIFT 48
283%define MSR_K6_STAR_SYSCALL_CS_SS_SHIFT 32
284%define MSR_K6_STAR_SEL_MASK 0xffff
285%define MSR_K6_STAR_SYSCALL_EIP_MASK 0xffffffff
286%define MSR_K6_WHCR 0xc0000082
287%define MSR_K6_UWCCR 0xc0000085
288%define MSR_K6_PSOR 0xc0000087
289%define MSR_K6_PFIR 0xc0000088
290%define MSR_K7_EVNTSEL0 0xc0010000
291%define MSR_K7_EVNTSEL1 0xc0010001
292%define MSR_K7_EVNTSEL2 0xc0010002
293%define MSR_K7_EVNTSEL3 0xc0010003
294%define MSR_K7_PERFCTR0 0xc0010004
295%define MSR_K7_PERFCTR1 0xc0010005
296%define MSR_K7_PERFCTR2 0xc0010006
297%define MSR_K7_PERFCTR3 0xc0010007
298%define MSR_K8_HWCR 0xc0010015
299%define MSR_K8_LSTAR 0xc0000082
300%define MSR_K8_CSTAR 0xc0000083
301%define MSR_K8_SF_MASK 0xc0000084
302%define MSR_K8_FS_BASE 0xc0000100
303%define MSR_K8_GS_BASE 0xc0000101
304%define MSR_K8_KERNEL_GS_BASE 0xc0000102
305%define MSR_K8_TSC_AUX 0xc0000103
306%define MSR_K8_SYSCFG 0xc0010010
307%define MSR_K8_HWCR 0xc0010015
308%define MSR_K8_IORRBASE0 0xc0010016
309%define MSR_K8_IORRMASK0 0xc0010017
310%define MSR_K8_IORRBASE1 0xc0010018
311%define MSR_K8_IORRMASK1 0xc0010019
312%define MSR_K8_TOP_MEM1 0xc001001a
313%define MSR_K8_TOP_MEM2 0xc001001d
314%define MSR_K8_VM_CR 0xc0010114
315%define MSR_K8_VM_CR_SVM_DISABLE RT_BIT(4)
316%define MSR_K8_IGNNE 0xc0010115
317%define MSR_K8_SMM_CTL 0xc0010116
318%define MSR_K8_VM_HSAVE_PA 0xc0010117
319%define X86_PG_ENTRIES 1024
320%define X86_PG_PAE_ENTRIES 512
321%define X86_PG_PAE_PDPE_ENTRIES 4
322%define X86_PG_AMD64_ENTRIES X86_PG_PAE_ENTRIES
323%define X86_PG_AMD64_PDPE_ENTRIES X86_PG_AMD64_ENTRIES
324%define X86_PAGE_4K_SIZE _4K
325%define X86_PAGE_4K_SHIFT 12
326%define X86_PAGE_4K_OFFSET_MASK 0xfff
327%define X86_PAGE_4K_BASE_MASK 0xfffffffffffff000
328%define X86_PAGE_4K_BASE_MASK_32 0xfffff000
329%define X86_PAGE_2M_SIZE _2M
330%define X86_PAGE_2M_SHIFT 21
331%define X86_PAGE_2M_OFFSET_MASK 0x001fffff
332%define X86_PAGE_2M_BASE_MASK 0xffffffffffe00000
333%define X86_PAGE_2M_BASE_MASK_32 0xffe00000
334%define X86_PAGE_4M_SIZE _4M
335%define X86_PAGE_4M_SHIFT 22
336%define X86_PAGE_4M_OFFSET_MASK 0x003fffff
337%define X86_PAGE_4M_BASE_MASK 0xffffffffffc00000
338%define X86_PAGE_4M_BASE_MASK_32 0xffc00000
339%define X86_PTE_BIT_P 0
340%define X86_PTE_BIT_RW 1
341%define X86_PTE_BIT_US 2
342%define X86_PTE_BIT_PWT 3
343%define X86_PTE_BIT_PCD 4
344%define X86_PTE_BIT_A 5
345%define X86_PTE_BIT_D 6
346%define X86_PTE_BIT_PAT 7
347%define X86_PTE_BIT_G 8
348%define X86_PTE_P RT_BIT(0)
349%define X86_PTE_RW RT_BIT(1)
350%define X86_PTE_US RT_BIT(2)
351%define X86_PTE_PWT RT_BIT(3)
352%define X86_PTE_PCD RT_BIT(4)
353%define X86_PTE_A RT_BIT(5)
354%define X86_PTE_D RT_BIT(6)
355%define X86_PTE_PAT RT_BIT(7)
356%define X86_PTE_G RT_BIT(8)
357%define X86_PTE_AVL_MASK (RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
358%define X86_PTE_PG_MASK ( 0xfffff000 )
359%define X86_PTE_PAE_PG_MASK ( 0x000ffffffffff000 )
360%define X86_PTE_PAE_NX RT_BIT_64(63)
361%define X86_PTE_PAE_MBZ_MASK_NX 0x7ff0000000000000
362%define X86_PTE_PAE_MBZ_MASK_NO_NX 0xfff0000000000000
363%define X86_PTE_LM_MBZ_MASK_NX 0x0000000000000000
364%define X86_PTE_LM_MBZ_MASK_NO_NX 0x8000000000000000
365%define X86_PT_SHIFT 12
366%define X86_PT_MASK 0x3ff
367%define X86_PT_PAE_SHIFT 12
368%define X86_PT_PAE_MASK 0x1ff
369%define X86_PDE_P RT_BIT(0)
370%define X86_PDE_RW RT_BIT(1)
371%define X86_PDE_US RT_BIT(2)
372%define X86_PDE_PWT RT_BIT(3)
373%define X86_PDE_PCD RT_BIT(4)
374%define X86_PDE_A RT_BIT(5)
375%define X86_PDE_PS RT_BIT(7)
376%define X86_PDE_AVL_MASK (RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
377%define X86_PDE_PG_MASK ( 0xfffff000 )
378%define X86_PDE_PAE_PG_MASK ( 0x000ffffffffff000 )
379%define X86_PDE_PAE_NX RT_BIT_64(63)
380%define X86_PDE_PAE_MBZ_MASK_NX 0x7ff0000000000080
381%define X86_PDE_PAE_MBZ_MASK_NO_NX 0xfff0000000000080
382%define X86_PDE_LM_MBZ_MASK_NX 0x0000000000000080
383%define X86_PDE_LM_MBZ_MASK_NO_NX 0x8000000000000080
384%define X86_PDE4M_P RT_BIT(0)
385%define X86_PDE4M_RW RT_BIT(1)
386%define X86_PDE4M_US RT_BIT(2)
387%define X86_PDE4M_PWT RT_BIT(3)
388%define X86_PDE4M_PCD RT_BIT(4)
389%define X86_PDE4M_A RT_BIT(5)
390%define X86_PDE4M_D RT_BIT(6)
391%define X86_PDE4M_PS RT_BIT(7)
392%define X86_PDE4M_G RT_BIT(8)
393%define X86_PDE4M_AVL (RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
394%define X86_PDE4M_PAT RT_BIT(12)
395%define X86_PDE4M_PAT_SHIFT (12 - 7)
396%define X86_PDE4M_PG_MASK ( 0xffc00000 )
397%define X86_PDE4M_PG_HIGH_MASK ( 0x001fe000 )
398%define X86_PDE4M_PG_HIGH_SHIFT 19
399%define X86_PDE4M_MBZ_MASK RT_BIT_32(21)
400%define X86_PDE2M_PAE_PG_MASK 0x000fffffffe00000
401%define X86_PDE2M_PAE_NX RT_BIT_64(63)
402%define X86_PDE2M_PAE_MBZ_MASK_NX 0x7ff00000001fe000
403%define X86_PDE2M_PAE_MBZ_MASK_NO_NX 0xfff00000001fe000
404%define X86_PDE2M_LM_MBZ_MASK_NX 0x00000000001fe000
405%define X86_PDE2M_LM_MBZ_MASK_NO_NX 0x80000000001fe000
406%define X86_PD_SHIFT 22
407%define X86_PD_MASK 0x3ff
408%define X86_PD_PAE_SHIFT 21
409%define X86_PD_PAE_MASK 0x1ff
410%define X86_PDPE_P RT_BIT(0)
411%define X86_PDPE_RW RT_BIT(1)
412%define X86_PDPE_US RT_BIT(2)
413%define X86_PDPE_PWT RT_BIT(3)
414%define X86_PDPE_PCD RT_BIT(4)
415%define X86_PDPE_A RT_BIT(5)
416%define X86_PDPE_LM_PS RT_BIT(7)
417%define X86_PDPE_AVL_MASK (RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
418%define X86_PDPE_PG_MASK 0x000ffffffffff000
419%define X86_PDPE_PAE_MBZ_MASK 0xfff00000000001e6
420%define X86_PDPE_LM_NX RT_BIT_64(63)
421%define X86_PDPE_LM_MBZ_MASK_NX 0x0000000000000180
422%define X86_PDPE_LM_MBZ_MASK_NO_NX 0x8000000000000180
423%define X86_PDPE1G_LM_MBZ_MASK_NX 0x000000003fffe000
424%define X86_PDPE1G_LM_MBZ_MASK_NO_NX 0x800000003fffe000
425%define X86_PDPT_SHIFT 30
426%define X86_PDPT_MASK_PAE 0x3
427%define X86_PDPT_MASK_AMD64 0x1ff
428%define X86_PML4E_P RT_BIT(0)
429%define X86_PML4E_RW RT_BIT(1)
430%define X86_PML4E_US RT_BIT(2)
431%define X86_PML4E_PWT RT_BIT(3)
432%define X86_PML4E_PCD RT_BIT(4)
433%define X86_PML4E_A RT_BIT(5)
434%define X86_PML4E_AVL_MASK (RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
435%define X86_PML4E_PG_MASK ( 0x000ffffffffff000 )
436%define X86_PML4E_MBZ_MASK_NX 0x0000000000000080
437%define X86_PML4E_MBZ_MASK_NO_NX 0x8000000000000080
438%define X86_PML4E_NX RT_BIT_64(63)
439%define X86_PML4_SHIFT 39
440%define X86_PML4_MASK 0x1ff
441%if HC_ARCH_BITS == 64
442%else
443%endif
444%if HC_ARCH_BITS == 64
445%else
446%endif
447%if HC_ARCH_BITS == 64
448%else
449%endif
450%define X86_SEL_TYPE_CODE 8
451%define X86_SEL_TYPE_MEMORY RT_BIT(4)
452%define X86_SEL_TYPE_ACCESSED 1
453%define X86_SEL_TYPE_DOWN 4
454%define X86_SEL_TYPE_CONF 4
455%define X86_SEL_TYPE_WRITE 2
456%define X86_SEL_TYPE_READ 2
457%define X86_SEL_TYPE_RO 0
458%define X86_SEL_TYPE_RO_ACC (0 | X86_SEL_TYPE_ACCESSED)
459%define X86_SEL_TYPE_RW 2
460%define X86_SEL_TYPE_RW_ACC (2 | X86_SEL_TYPE_ACCESSED)
461%define X86_SEL_TYPE_RO_DOWN 4
462%define X86_SEL_TYPE_RO_DOWN_ACC (4 | X86_SEL_TYPE_ACCESSED)
463%define X86_SEL_TYPE_RW_DOWN 6
464%define X86_SEL_TYPE_RW_DOWN_ACC (6 | X86_SEL_TYPE_ACCESSED)
465%define X86_SEL_TYPE_EO (0 | X86_SEL_TYPE_CODE)
466%define X86_SEL_TYPE_EO_ACC (0 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
467%define X86_SEL_TYPE_ER (2 | X86_SEL_TYPE_CODE)
468%define X86_SEL_TYPE_ER_ACC (2 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
469%define X86_SEL_TYPE_EO_CONF (4 | X86_SEL_TYPE_CODE)
470%define X86_SEL_TYPE_EO_CONF_ACC (4 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
471%define X86_SEL_TYPE_ER_CONF (6 | X86_SEL_TYPE_CODE)
472%define X86_SEL_TYPE_ER_CONF_ACC (6 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
473%define X86_SEL_TYPE_SYS_UNDEFINED 0
474%define X86_SEL_TYPE_SYS_286_TSS_AVAIL 1
475%define X86_SEL_TYPE_SYS_LDT 2
476%define X86_SEL_TYPE_SYS_286_TSS_BUSY 3
477%define X86_SEL_TYPE_SYS_286_CALL_GATE 4
478%define X86_SEL_TYPE_SYS_TASK_GATE 5
479%define X86_SEL_TYPE_SYS_286_INT_GATE 6
480%define X86_SEL_TYPE_SYS_286_TRAP_GATE 7
481%define X86_SEL_TYPE_SYS_UNDEFINED2 8
482%define X86_SEL_TYPE_SYS_386_TSS_AVAIL 9
483%define X86_SEL_TYPE_SYS_UNDEFINED3 0xA
484%define X86_SEL_TYPE_SYS_386_TSS_BUSY 0xB
485%define X86_SEL_TYPE_SYS_386_CALL_GATE 0xC
486%define X86_SEL_TYPE_SYS_UNDEFINED4 0xD
487%define X86_SEL_TYPE_SYS_386_INT_GATE 0xE
488%define X86_SEL_TYPE_SYS_386_TRAP_GATE 0xF
489%define AMD64_SEL_TYPE_SYS_LDT 2
490%define AMD64_SEL_TYPE_SYS_TSS_AVAIL 9
491%define AMD64_SEL_TYPE_SYS_TSS_BUSY 0xB
492%define AMD64_SEL_TYPE_SYS_CALL_GATE 0xC
493%define AMD64_SEL_TYPE_SYS_INT_GATE 0xE
494%define AMD64_SEL_TYPE_SYS_TRAP_GATE 0xF
495%define X86_DESC_TYPE_MASK (RT_BIT(8) | RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
496%define X86_DESC_S RT_BIT(12)
497%define X86_DESC_DPL (RT_BIT(13) | RT_BIT(14))
498%define X86_DESC_P RT_BIT(15)
499%define X86_DESC_AVL RT_BIT(20)
500%define X86_DESC_DB RT_BIT(22)
501%define X86_DESC_G RT_BIT(23)
502%define X86_SEL_SHIFT 3
503%define X86_SEL_MASK 0xfff8
504%define X86_SEL_LDT 0x0004
505%define X86_SEL_RPL 0x0003
506%define X86_TRAP_ERR_EXTERNAL 1
507%define X86_TRAP_ERR_IDT 2
508%define X86_TRAP_ERR_TI 4
509%define X86_TRAP_ERR_SEL_MASK 0xfff8
510%define X86_TRAP_ERR_SEL_SHIFT 3
511%define X86_TRAP_PF_P RT_BIT(0)
512%define X86_TRAP_PF_RW RT_BIT(1)
513%define X86_TRAP_PF_US RT_BIT(2)
514%define X86_TRAP_PF_RSVD RT_BIT(3)
515%define X86_TRAP_PF_ID RT_BIT(4)
516%endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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