]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
MdeModulePkg: Add New Memory Attributes
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Misc / MemoryProtection.c
index 92a442f517b23ff006811f152232b5b60b17e727..7d1daf0b19388fb4b807e135ad1ffc6deb1d3d62 100644 (file)
@@ -42,9 +42,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include "DxeMain.h"\r
 #include "Mem/HeapGuard.h"\r
 \r
-#define CACHE_ATTRIBUTE_MASK   (EFI_MEMORY_UC | EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_MEMORY_WB | EFI_MEMORY_UCE | EFI_MEMORY_WP)\r
-#define MEMORY_ATTRIBUTE_MASK  (EFI_MEMORY_RP | EFI_MEMORY_XP | EFI_MEMORY_RO)\r
-\r
 //\r
 // Image type definitions\r
 //\r
@@ -221,7 +218,7 @@ SetUefiImageMemoryAttributes (
   Status = CoreGetMemorySpaceDescriptor(BaseAddress, &Descriptor);\r
   ASSERT_EFI_ERROR(Status);\r
 \r
-  FinalAttributes = (Descriptor.Attributes & CACHE_ATTRIBUTE_MASK) | (Attributes & MEMORY_ATTRIBUTE_MASK);\r
+  FinalAttributes = (Descriptor.Attributes & EFI_CACHE_ATTRIBUTE_MASK) | (Attributes & EFI_MEMORY_ATTRIBUTE_MASK);\r
 \r
   DEBUG ((DEBUG_INFO, "SetUefiImageMemoryAttributes - 0x%016lx - 0x%016lx (0x%016lx)\n", BaseAddress, Length, FinalAttributes));\r
 \r
@@ -924,7 +921,7 @@ InitializeDxeNxMemoryProtectionPolicy (
             (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED)) {\r
 \r
         Attributes = GetPermissionAttributeForMemoryType (EfiConventionalMemory) |\r
-                     (Entry->Attributes & CACHE_ATTRIBUTE_MASK);\r
+                     (Entry->Attributes & EFI_CACHE_ATTRIBUTE_MASK);\r
 \r
         DEBUG ((DEBUG_INFO,\r
           "Untested GCD memory space region: - 0x%016lx - 0x%016lx (0x%016lx)\n",\r