// Second Level Descriptors\r
typedef UINT32 ARM_PAGE_TABLE_ENTRY;\r
\r
-EFI_STATUS \r
+EFI_STATUS\r
SectionToGcdAttributes (\r
IN UINT32 SectionAttributes,\r
OUT UINT64 *GcdAttributes\r
\r
// Calculate number of 4KB page table entries to change\r
NumPageEntries = Length / TT_DESCRIPTOR_PAGE_SIZE;\r
- \r
+\r
// Iterate for the number of 4KB pages to change\r
Offset = 0;\r
for(p = 0; p < NumPageEntries; p++) {\r
// Calculate index into first level translation table for page table value\r
- \r
+\r
FirstLevelIdx = TT_DESCRIPTOR_SECTION_BASE_ADDRESS(BaseAddress + Offset) >> TT_DESCRIPTOR_SECTION_BASE_SHIFT;\r
ASSERT (FirstLevelIdx < TRANSLATION_TABLE_SECTION_COUNT);\r
\r
Status = ConvertSectionToPages (FirstLevelIdx << TT_DESCRIPTOR_SECTION_BASE_SHIFT);\r
if (EFI_ERROR(Status)) {\r
// Exit for loop\r
- break; \r
- } \r
- \r
+ break;\r
+ }\r
+\r
// Re-read descriptor\r
Descriptor = FirstLevelTable[FirstLevelIdx];\r
}\r
// Make this virtual address point at a physical page\r
PageTableEntry &= ~VirtualMask;\r
}\r
- \r
+\r
if (CurrentPageTableEntry != PageTableEntry) {\r
Mva = (VOID *)(UINTN)((((UINTN)FirstLevelIdx) << TT_DESCRIPTOR_SECTION_BASE_SHIFT) + (PageTableIndex << TT_DESCRIPTOR_PAGE_BASE_SHIFT));\r
if ((CurrentPageTableEntry & TT_DESCRIPTOR_PAGE_CACHEABLE_MASK) == TT_DESCRIPTOR_PAGE_CACHEABLE_MASK) {\r
WriteBackInvalidateDataCacheRange (Mva, TT_DESCRIPTOR_PAGE_SIZE);\r
}\r
\r
- // Only need to update if we are changing the entry \r
- PageTable[PageTableIndex] = PageTableEntry; \r
+ // Only need to update if we are changing the entry\r
+ PageTable[PageTableIndex] = PageTableEntry;\r
ArmUpdateTranslationTableEntry ((VOID *)&PageTable[PageTableIndex], Mva);\r
}\r
\r
Status = EFI_SUCCESS;\r
Offset += TT_DESCRIPTOR_PAGE_SIZE;\r
- \r
+\r
} // End first level translation table loop\r
\r
return Status;\r
// EntryMask: bitmask of values to change (1 = change this value, 0 = leave alone)\r
// EntryValue: values at bit positions specified by EntryMask\r
\r
- // Make sure we handle a section range that is unmapped \r
+ // Make sure we handle a section range that is unmapped\r
EntryMask = TT_DESCRIPTOR_SECTION_TYPE_MASK;\r
EntryValue = TT_DESCRIPTOR_SECTION_TYPE_SECTION;\r
\r
\r
// calculate number of 1MB first level entries this applies to\r
NumSections = Length / TT_DESCRIPTOR_SECTION_SIZE;\r
- \r
+\r
// iterate through each descriptor\r
for(i=0; i<NumSections; i++) {\r
CurrentDescriptor = FirstLevelTable[FirstLevelIdx + i];\r
Status = UpdatePageEntries ((FirstLevelIdx + i) << TT_DESCRIPTOR_SECTION_BASE_SHIFT, TT_DESCRIPTOR_SECTION_SIZE, Attributes, VirtualMask);\r
} else {\r
// still a section entry\r
- \r
+\r
// mask off appropriate fields\r
Descriptor = CurrentDescriptor & ~EntryMask;\r
\r
WriteBackInvalidateDataCacheRange (Mva, SIZE_1MB);\r
}\r
\r
- // Only need to update if we are changing the descriptor \r
+ // Only need to update if we are changing the descriptor\r
FirstLevelTable[FirstLevelIdx + i] = Descriptor;\r
ArmUpdateTranslationTableEntry ((VOID *)&FirstLevelTable[FirstLevelIdx + i], Mva);\r
}\r
return Status;\r
}\r
\r
-EFI_STATUS \r
+EFI_STATUS\r
ConvertSectionToPages (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress\r
)\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
if(((BaseAddress & 0xFFFFF) == 0) && ((Length & 0xFFFFF) == 0)) {\r
// Is the base and length a multiple of 1 MB?\r
DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(): MMU section 0x%x length 0x%x to %lx\n", (UINTN)BaseAddress, (UINTN)Length, Attributes));\r