]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Refine code to make it more readable.
authorQiu Shumin <shumin.qiu@intel.com>
Fri, 3 Jul 2015 01:39:06 +0000 (01:39 +0000)
committershenshushi <shenshushi@Edk2>
Fri, 3 Jul 2015 01:39:06 +0000 (01:39 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17818 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
MdeModulePkg/Universal/PropertiesTableAttributesDxe/PropertiesTableAttributesDxe.c

index 01ecca64ab0a4a698fa919882c19d482d96b820a..34867375b157b782499d354364449da32649b53a 100644 (file)
@@ -788,7 +788,7 @@ SetPropertiesTableSectionAlignment (
   if (((SectionAlignment & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) != 0) &&\r
       ((mPropertiesTable.MemoryProtectionAttribute & EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) != 0)) {\r
     DEBUG ((EFI_D_VERBOSE, "SetPropertiesTableSectionAlignment - Clear\n"));\r
-    mPropertiesTable.MemoryProtectionAttribute &= ~EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA;\r
+    mPropertiesTable.MemoryProtectionAttribute &= ~((UINT64)EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA);\r
     gBS->GetMemoryMap = CoreGetMemoryMap;\r
     gBS->Hdr.CRC32 = 0;\r
     gBS->CalculateCrc32 ((UINT8 *)gBS, gBS->Hdr.HeaderSize, &gBS->Hdr.CRC32);\r
index 6e5c4f8fcd1e1b11e3e29e3f45e6d0088488b430..718c56734625c12ff8a08f275ca9b97f1796dbd1 100644 (file)
@@ -130,6 +130,8 @@ UpdateMemoryAttributesDefault (
   if (EFI_ERROR (Status)) {\r
     goto Done;\r
   }\r
+  \r
+  ASSERT (PropertiesTable != NULL);\r
 \r
   DEBUG ((EFI_D_INFO, "MemoryProtectionAttribute - 0x%016lx\n", PropertiesTable->MemoryProtectionAttribute));\r
   if ((PropertiesTable->MemoryProtectionAttribute & EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) == 0) {\r