]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Drivers/CpuDxe/Mmu.c
Added new PeCoffGetEntryPoint lib function to get size of PE/COFF header. This is...
[mirror_edk2.git] / ArmPkg / Drivers / CpuDxe / Mmu.c
index a0977dd1107379edc05915b68f51a879a2fe6cbe..55e049850f6570f0bb03ccea71e673456047cbbe 100644 (file)
@@ -16,10 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "CpuDxe.h"\r
 \r
-//\r
-// For debug switch me back to to EFI_D_PAGE when done\r
-//\r
-#define L_EFI_D_PAGE EFI_D_ERROR\r
 \r
 //\r
 // Translation/page table definitions\r
@@ -353,7 +349,7 @@ SyncCacheConfig (
   EFI_GCD_MEMORY_SPACE_DESCRIPTOR     *MemorySpaceMap;\r
 \r
 \r
-  DEBUG ((L_EFI_D_PAGE, "SyncCacheConfig()\n"));\r
+  DEBUG ((EFI_D_PAGE, "SyncCacheConfig()\n"));\r
 \r
   // This code assumes MMU is enabled and filed with section translations\r
   ASSERT (ArmMmuEnabled ());\r
@@ -483,7 +479,7 @@ UpdatePageEntries (
       // Cause a page fault if these ranges are accessed.\r
       EntryMask   = 0x3;\r
       EntryValue = 0;\r
-      DEBUG ((L_EFI_D_PAGE, "SetMemoryAttributes(): setting page %lx with unsupported attribute %x will page fault on access\n", BaseAddress, Attributes));\r
+      DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(): setting page %lx with unsupported attribute %x will page fault on access\n", BaseAddress, Attributes));\r
       break;\r
 \r
     default:\r
@@ -617,7 +613,7 @@ UpdateSectionEntries (
       // cannot be implemented UEFI definition unclear for ARM\r
       // Cause a page fault if these ranges are accessed.\r
       EntryValue = ARM_DESC_TYPE_FAULT;\r
-      DEBUG ((L_EFI_D_PAGE, "SetMemoryAttributes(): setting section %lx with unsupported attribute %x will page fault on access\n", BaseAddress, Attributes));\r
+      DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(): setting section %lx with unsupported attribute %x will page fault on access\n", BaseAddress, Attributes));\r
       break;\r
 \r
 \r
@@ -680,7 +676,7 @@ ConvertSectionToPages (
   volatile ARM_FIRST_LEVEL_DESCRIPTOR   *FirstLevelTable;\r
   volatile ARM_PAGE_TABLE_ENTRY         *PageTable;\r
 \r
-  DEBUG ((L_EFI_D_PAGE, "Converting section at 0x%x to pages\n", (UINTN)BaseAddress));\r
+  DEBUG ((EFI_D_PAGE, "Converting section at 0x%x to pages\n", (UINTN)BaseAddress));\r
 \r
   // obtain page table base\r
   FirstLevelTable = (ARM_FIRST_LEVEL_DESCRIPTOR *)ArmGetTranslationTableBaseAddress ();\r
@@ -727,10 +723,6 @@ ConvertSectionToPages (
   }\r
 \r
   // flush d-cache so descriptors make it back to uncached memory for subsequent table walks\r
-  // TODO: change to use only PageTable base and length\r
-  // ArmInvalidateDataCache ();\r
-DEBUG ((EFI_D_ERROR, "InvalidateDataCacheRange (%x, %x)\n", (UINTN)PageTableAddr, EFI_PAGE_SIZE));\r
-\r
   InvalidateDataCacheRange ((VOID *)(UINTN)PageTableAddr, EFI_PAGE_SIZE);\r
 \r
   // formulate page table entry, Domain=0, NS=0\r
@@ -756,11 +748,11 @@ SetMemoryAttributes (
   \r
   if(((BaseAddress & 0xFFFFF) == 0) && ((Length & 0xFFFFF) == 0)) {\r
     // is the base and length a multiple of 1 MB?\r
-    DEBUG ((L_EFI_D_PAGE, "SetMemoryAttributes(): MMU section 0x%x length 0x%x to %lx\n", (UINTN)BaseAddress, (UINTN)Length, Attributes));\r
+    DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(): MMU section 0x%x length 0x%x to %lx\n", (UINTN)BaseAddress, (UINTN)Length, Attributes));\r
     Status = UpdateSectionEntries (BaseAddress, Length, Attributes, VirtualMask);\r
   } else {\r
     // base and/or length is not a multiple of 1 MB\r
-    DEBUG ((L_EFI_D_PAGE, "SetMemoryAttributes(): MMU page 0x%x length 0x%x to %lx\n", (UINTN)BaseAddress, (UINTN)Length, Attributes));\r
+    DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(): MMU page 0x%x length 0x%x to %lx\n", (UINTN)BaseAddress, (UINTN)Length, Attributes));\r
     Status = UpdatePageEntries (BaseAddress, Length, Attributes, VirtualMask);\r
   }\r
 \r
@@ -807,10 +799,10 @@ CpuSetMemoryAttributes (
   IN UINT64                    Attributes\r
   )\r
 {\r
-  DEBUG ((L_EFI_D_PAGE, "SetMemoryAttributes(%lx, %lx, %lx)\n", BaseAddress, Length, Attributes));\r
+  DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(%lx, %lx, %lx)\n", BaseAddress, Length, Attributes));\r
   if ( ((BaseAddress & (EFI_PAGE_SIZE-1)) != 0) || ((Length & (EFI_PAGE_SIZE-1)) != 0)){\r
     // minimum granularity is EFI_PAGE_SIZE (4KB on ARM)\r
-    DEBUG ((L_EFI_D_PAGE, "SetMemoryAttributes(%lx, %lx, %lx): minimum ganularity is EFI_PAGE_SIZE\n", BaseAddress, Length, Attributes));\r
+    DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(%lx, %lx, %lx): minimum ganularity is EFI_PAGE_SIZE\n", BaseAddress, Length, Attributes));\r
     return EFI_UNSUPPORTED;\r
   }\r
   \r
@@ -843,7 +835,7 @@ CpuConvertPagesToUncachedVirtualAddress (
       *Attributes = GcdDescriptor.Attributes;\r
     }\r
   }\r
-ASSERT (FALSE);  \r
+\r
   //\r
   // Make this address range page fault if accessed. If it is a DMA buffer than this would \r
   // be the PCI address. Code should always use the CPU address, and we will or in VirtualMask\r