1 ;------------------------------------------------------------------------------
3 ; Emits Page Tables for 1:1 mapping of the addresses 0 - 0x100000000 (4GB)
5 ; Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
6 ; SPDX-License-Identifier: BSD-2-Clause-Patent
8 ;------------------------------------------------------------------------------
12 %define ALIGN_TOP_TO_4K_FOR_PAGING
14 %define PAGE_PRESENT 0x01
15 %define PAGE_READ_WRITE 0x02
16 %define PAGE_USER_SUPERVISOR 0x04
17 %define PAGE_WRITE_THROUGH 0x08
18 %define PAGE_CACHE_DISABLE 0x010
19 %define PAGE_ACCESSED 0x020
20 %define PAGE_DIRTY 0x040
21 %define PAGE_PAT 0x080
22 %define PAGE_GLOBAL 0x0100
23 %define PAGE_2M_MBO 0x080
24 %define PAGE_2M_PAT 0x01000
26 %define PAGE_2M_PDE_ATTR (PAGE_2M_MBO + \
32 %define PAGE_PDP_ATTR (PAGE_ACCESSED + \
36 %define PGTBLS_OFFSET(x) ((x) - TopLevelPageDirectory)
37 %define PGTBLS_ADDR(x) (ADDR_OF(TopLevelPageDirectory) + (x))
39 %define PDP(offset) (ADDR_OF(TopLevelPageDirectory) + (offset) + \
41 %define PTE_2MB(x) ((x << 21) + PAGE_2M_PDE_ATTR)
43 TopLevelPageDirectory:
46 ; Top level Page Directory Pointers (1 * 512GB entry)
52 ; Next level Page Directory Pointers (4 * 1GB entries => 4GB)
54 TIMES 0x1000-PGTBLS_OFFSET($) DB 0
62 ; Page Table Entries (2048 * 2MB entries => 4GB)
64 TIMES 0x2000-PGTBLS_OFFSET($) DB 0