Files
system76-edk2/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables2M.asm
Liu, Zhiguang cc62b85a4a UefiCpuPkg/ResetVector: Rename macros about page table.
This patch only renames macro, with no code logic impacted.
Two purpose to rename macro:
1. Align some macro name in PageTables1G.asm and PageTables2M.asm, so
that these two files can be easily combined later.
2. Some Macro names such as PDP are not accurate, since 4 level page
entry also uses this macro. PAGE_NLE (no leaf entry) is better

Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2023-05-30 05:55:44 +00:00

68 lines
1.7 KiB
NASM

;------------------------------------------------------------------------------
; @file
; Emits Page Tables for 1:1 mapping of the addresses 0 - 0x100000000 (4GB)
;
; Copyright (c) 2008 - 2023, Intel Corporation. All rights reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
;------------------------------------------------------------------------------
BITS 64
%define ALIGN_TOP_TO_4K_FOR_PAGING
;
; Page table big leaf entry attribute:
; PDPTE 1GB entry or PDE 2MB entry
;
%define PAGE_BLE_ATTR (PAGE_SIZE + \
PAGE_ACCESSED + \
PAGE_DIRTY + \
PAGE_READ_WRITE + \
PAGE_PRESENT)
;
; Page table non-leaf entry attribute
;
%define PAGE_NLE_ATTR (PAGE_ACCESSED + \
PAGE_READ_WRITE + \
PAGE_PRESENT)
%define PGTBLS_OFFSET(x) ((x) - TopLevelPageDirectory)
%define PGTBLS_ADDR(x) (ADDR_OF(TopLevelPageDirectory) + (x))
%define PAGE_NLE(offset) (ADDR_OF(TopLevelPageDirectory) + (offset) + \
PAGE_NLE_ATTR)
%define PAGE_PDE_2MB(x) ((x << 21) + PAGE_BLE_ATTR)
TopLevelPageDirectory:
;
; Top level Page Directory Pointers (1 * 512GB entry)
;
DQ PAGE_NLE(0x1000)
;
; Next level Page Directory Pointers (4 * 1GB entries => 4GB)
;
TIMES 0x1000-PGTBLS_OFFSET($) DB 0
DQ PAGE_NLE(0x2000)
DQ PAGE_NLE(0x3000)
DQ PAGE_NLE(0x4000)
DQ PAGE_NLE(0x5000)
;
; Page Table Entries (2048 * 2MB entries => 4GB)
;
TIMES 0x2000-PGTBLS_OFFSET($) DB 0
%assign i 0
%rep 0x800
DQ PAGE_PDE_2MB(i)
%assign i i+1
%endrep
EndOfPageTables: