20#define SYS_CODE64_SEL 0x38
36 UINT32 DefaultSize : 1;
37 UINT32 Granularity : 1;
44 IA32_IDT_GATE_DESCRIPTOR Ia32IdtEntry;
58 UINT64 UserSupervisor : 1;
59 UINT64 WriteThrough : 1;
60 UINT64 CacheDisabled : 1;
63 UINT64 MustBeZero : 2;
65 UINT64 PageTableBaseAddress : 40;
66 UINT64 AvabilableHigh : 11;
79 UINT64 UserSupervisor : 1;
80 UINT64 WriteThrough : 1;
81 UINT64 CacheDisabled : 1;
87 UINT64 PageTableBaseAddress : 40;
88 UINT64 AvabilableHigh : 11;
100 UINT64 ReadWrite : 1;
101 UINT64 UserSupervisor : 1;
102 UINT64 WriteThrough : 1;
103 UINT64 CacheDisabled : 1;
108 UINT64 Available : 3;
110 UINT64 MustBeZero : 8;
111 UINT64 PageTableBaseAddress : 31;
112 UINT64 AvabilableHigh : 11;
124 UINT64 ReadWrite : 1;
125 UINT64 UserSupervisor : 1;
126 UINT64 WriteThrough : 1;
127 UINT64 CacheDisabled : 1;
132 UINT64 Available : 3;
134 UINT64 MustBeZero : 17;
135 UINT64 PageTableBaseAddress : 22;
136 UINT64 AvabilableHigh : 11;
146#define IA32_PG_P BIT0
147#define IA32_PG_RW BIT1
148#define IA32_PG_PS BIT7
150#define PAGING_PAE_INDEX_MASK 0x1FF
152#define PAGING_4K_ADDRESS_MASK_64 0x000FFFFFFFFFF000ull
153#define PAGING_2M_ADDRESS_MASK_64 0x000FFFFFFFE00000ull
154#define PAGING_1G_ADDRESS_MASK_64 0x000FFFFFC0000000ull
156#define PAGING_L1_ADDRESS_SHIFT 12
157#define PAGING_L2_ADDRESS_SHIFT 21
158#define PAGING_L3_ADDRESS_SHIFT 30
159#define PAGING_L4_ADDRESS_SHIFT 39
161#define PAGING_PML4E_NUMBER 4
163#define PAGE_TABLE_POOL_ALIGNMENT BASE_2MB
164#define PAGE_TABLE_POOL_UNIT_SIZE SIZE_2MB
165#define PAGE_TABLE_POOL_UNIT_PAGES EFI_SIZE_TO_PAGES (PAGE_TABLE_POOL_UNIT_SIZE)
166#define PAGE_TABLE_POOL_ALIGN_MASK \
167 (~(EFI_PHYSICAL_ADDRESS)(PAGE_TABLE_POOL_ALIGNMENT - 1))
VOID EFIAPI FreePages(IN VOID *Buffer, IN UINTN Pages)
UINTN CreateIdentityMappingPageTables(IN EFI_PHYSICAL_ADDRESS StackBase, IN UINTN StackSize)
VOID ClearFirst4KPage(IN VOID *HobStart)
BOOLEAN IsNullDetectionEnabled(VOID)
UINT64 EFI_PHYSICAL_ADDRESS