]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
MdeModulePkg/DxeCore: Fix coding style issues
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Misc / MemoryProtection.c
index 172d6679857a36ddc34547c4afabe7c9a48b85ca..7689c794a8ad22601965303e4dfce255e3923c09 100644 (file)
@@ -344,12 +344,12 @@ IsMemoryProtectionSectionAligned (
   switch (MemoryType) {\r
   case EfiRuntimeServicesCode:\r
   case EfiACPIMemoryNVS:\r
-    PageAlignment = EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT;\r
+    PageAlignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;\r
     break;\r
   case EfiRuntimeServicesData:\r
   case EfiACPIReclaimMemory:\r
     ASSERT (FALSE);\r
-    PageAlignment = EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT;\r
+    PageAlignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;\r
     break;\r
   case EfiBootServicesCode:\r
   case EfiLoaderCode:\r
@@ -657,6 +657,8 @@ UnprotectUefiImage (
 /**\r
   Return the EFI memory permission attribute associated with memory\r
   type 'MemoryType' under the configured DXE memory protection policy.\r
+\r
+  @param MemoryType       Memory type.\r
 **/\r
 STATIC\r
 UINT64\r
@@ -788,7 +790,7 @@ MergeMemoryMapForProtectionPolicy (
 \r
 /**\r
   Remove exec permissions from all regions whose type is identified by\r
-  PcdDxeNxMemoryProtectionPolicy\r
+  PcdDxeNxMemoryProtectionPolicy.\r
 **/\r
 STATIC\r
 VOID\r
@@ -851,7 +853,7 @@ InitializeDxeNxMemoryProtectionPolicy (
     if (Attributes != 0) {\r
       SetUefiImageMemoryAttributes (\r
         MemoryMapEntry->PhysicalStart,\r
-        EFI_PAGES_TO_SIZE (MemoryMapEntry->NumberOfPages),\r
+        LShiftU64 (MemoryMapEntry->NumberOfPages, EFI_PAGE_SHIFT),\r
         Attributes);\r
     }\r
     MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, DescriptorSize);\r
@@ -1053,7 +1055,7 @@ CoreInitializeMemoryProtection (
 }\r
 \r
 /**\r
-  Returns whether we are currently executing in SMM mode\r
+  Returns whether we are currently executing in SMM mode.\r
 **/\r
 STATIC\r
 BOOLEAN\r