From 3b76284883df833170f741c9fb4037579635b7f2 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 9 Feb 2023 10:01:45 +0100 Subject: ArmPkg/ArmMmuLib ARM: Split off XN page descriptor bit from type field With large page support out of the picture, we can treat bits 1 and 0 of the page descriptor as individual valid and XN bits, instead of treating XN as a page type. Doing so aligns the handling of the attribute with the section descriptor layout, as well as the XN handling on AArch64, and this is beneficial for maintainability. Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmPkg/Include/Chipset/ArmV7Mmu.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'ArmPkg/Include') diff --git a/ArmPkg/Include/Chipset/ArmV7Mmu.h b/ArmPkg/Include/Chipset/ArmV7Mmu.h index 7501ebfdf9..6a2584ceb3 100644 --- a/ArmPkg/Include/Chipset/ArmV7Mmu.h +++ b/ArmPkg/Include/Chipset/ArmV7Mmu.h @@ -54,11 +54,9 @@ #define TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE(Desc) (((Desc) & 3UL) == TT_DESCRIPTOR_SECTION_TYPE_PAGE_TABLE) // Translation table descriptor types -#define TT_DESCRIPTOR_PAGE_TYPE_MASK (3UL << 0) -#define TT_DESCRIPTOR_PAGE_TYPE_FAULT (0UL << 0) -#define TT_DESCRIPTOR_PAGE_TYPE_PAGE (2UL << 0) -#define TT_DESCRIPTOR_PAGE_TYPE_PAGE_XN (3UL << 0) -#define TT_DESCRIPTOR_PAGE_TYPE_LARGEPAGE (1UL << 0) +#define TT_DESCRIPTOR_PAGE_TYPE_MASK (1UL << 1) +#define TT_DESCRIPTOR_PAGE_TYPE_FAULT (0UL << 1) +#define TT_DESCRIPTOR_PAGE_TYPE_PAGE (1UL << 1) // Section descriptor definitions #define TT_DESCRIPTOR_SECTION_SIZE (0x00100000) -- cgit v1.2.3