]>
Commit | Line | Data |
---|---|---|
18b84857 | 1 | /** @file\r |
ca162103 | 2 | \r |
b1f700a8 HT |
3 | Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
ca162103 | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | VirtualMemory.h\r | |
14 | \r | |
15 | Abstract:\r | |
16 | \r | |
17 | Revision History:\r | |
18 | \r | |
18b84857 | 19 | **/\r |
ca162103 | 20 | \r |
21 | #ifndef _VIRTUAL_MEMORY_H_\r | |
22 | #define _VIRTUAL_MEMORY_H_\r | |
23 | \r | |
24 | #pragma pack(1)\r | |
25 | \r | |
26 | //\r | |
27 | // Page Map Level 4 Offset (PML4) and\r | |
28 | // Page Directory Pointer Table (PDPE) entries 4K & 2M\r | |
29 | //\r | |
30 | \r | |
31 | typedef union {\r | |
32 | struct {\r | |
33 | UINT64 Present:1; // 0 = Not present in memory, 1 = Present in memory\r | |
34 | UINT64 ReadWrite:1; // 0 = Read-Only, 1= Read/Write\r | |
35 | UINT64 UserSupervisor:1; // 0 = Supervisor, 1=User\r | |
36 | UINT64 WriteThrough:1; // 0 = Write-Back caching, 1=Write-Through caching\r | |
37 | UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached\r | |
38 | UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)\r | |
39 | UINT64 Reserved:1; // Reserved\r | |
40 | UINT64 MustBeZero:2; // Must Be Zero\r | |
41 | UINT64 Available:3; // Available for use by system software\r | |
42 | UINT64 PageTableBaseAddress:40; // Page Table Base Address\r | |
43 | UINT64 AvabilableHigh:11; // Available for use by system software\r | |
44 | UINT64 Nx:1; // No Execute bit\r | |
45 | } Bits;\r | |
46 | UINT64 Uint64;\r | |
47 | } X64_PAGE_MAP_AND_DIRECTORY_POINTER_2MB_4K;\r | |
48 | \r | |
49 | //\r | |
50 | // Page Directory Entry 4K\r | |
51 | //\r | |
52 | typedef union {\r | |
53 | struct {\r | |
54 | UINT64 Present:1; // 0 = Not present in memory, 1 = Present in memory\r | |
55 | UINT64 ReadWrite:1; // 0 = Read-Only, 1= Read/Write\r | |
56 | UINT64 UserSupervisor:1; // 0 = Supervisor, 1=User\r | |
57 | UINT64 WriteThrough:1; // 0 = Write-Back caching, 1=Write-Through caching\r | |
58 | UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached\r | |
59 | UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)\r | |
60 | UINT64 MustBeZero:3; // Must Be Zero\r | |
61 | UINT64 Available:3; // Available for use by system software\r | |
62 | UINT64 PageTableBaseAddress:40; // Page Table Base Address\r | |
63 | UINT64 AvabilableHigh:11; // Available for use by system software\r | |
64 | UINT64 Nx:1; // No Execute bit\r | |
65 | } Bits;\r | |
66 | UINT64 Uint64;\r | |
67 | } X64_PAGE_DIRECTORY_ENTRY_4K;\r | |
68 | \r | |
69 | //\r | |
70 | // Page Table Entry 4K\r | |
71 | //\r | |
72 | typedef union {\r | |
73 | struct {\r | |
74 | UINT64 Present:1; // 0 = Not present in memory, 1 = Present in memory\r | |
75 | UINT64 ReadWrite:1; // 0 = Read-Only, 1= Read/Write\r | |
76 | UINT64 UserSupervisor:1; // 0 = Supervisor, 1=User\r | |
77 | UINT64 WriteThrough:1; // 0 = Write-Back caching, 1=Write-Through caching\r | |
78 | UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached\r | |
79 | UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)\r | |
80 | UINT64 Dirty:1; // 0 = Not Dirty, 1 = written by processor on access to page\r | |
81 | UINT64 PAT:1; // 0 = Ignore Page Attribute Table \r | |
82 | UINT64 Global:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write\r | |
83 | UINT64 Available:3; // Available for use by system software\r | |
84 | UINT64 PageTableBaseAddress:40; // Page Table Base Address\r | |
85 | UINT64 AvabilableHigh:11; // Available for use by system software\r | |
86 | UINT64 Nx:1; // 0 = Execute Code, 1 = No Code Execution\r | |
87 | } Bits;\r | |
88 | UINT64 Uint64;\r | |
89 | } X64_PAGE_TABLE_ENTRY_4K;\r | |
90 | \r | |
91 | //\r | |
92 | // Page Table Entry 2M\r | |
93 | //\r | |
94 | typedef union {\r | |
95 | struct {\r | |
96 | UINT64 Present:1; // 0 = Not present in memory, 1 = Present in memory\r | |
97 | UINT64 ReadWrite:1; // 0 = Read-Only, 1= Read/Write\r | |
98 | UINT64 UserSupervisor:1; // 0 = Supervisor, 1=User\r | |
99 | UINT64 WriteThrough:1; // 0 = Write-Back caching, 1=Write-Through caching\r | |
100 | UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached\r | |
101 | UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)\r | |
102 | UINT64 Dirty:1; // 0 = Not Dirty, 1 = written by processor on access to page\r | |
103 | UINT64 MustBe1:1; // Must be 1 \r | |
104 | UINT64 Global:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write\r | |
105 | UINT64 Available:3; // Available for use by system software\r | |
106 | UINT64 PAT:1; //\r | |
107 | UINT64 MustBeZero:8; // Must be zero;\r | |
108 | UINT64 PageTableBaseAddress:31; // Page Table Base Address\r | |
109 | UINT64 AvabilableHigh:11; // Available for use by system software\r | |
110 | UINT64 Nx:1; // 0 = Execute Code, 1 = No Code Execution\r | |
111 | } Bits;\r | |
112 | UINT64 Uint64;\r | |
113 | } X64_PAGE_TABLE_ENTRY_2M;\r | |
114 | \r | |
115 | #pragma pack()\r | |
116 | \r | |
117 | #endif \r |