Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR>\r
Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR>\r
Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>\r
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
// determine protection attributes\r
switch(SectionAttributes & TT_DESCRIPTOR_SECTION_AP_MASK) {\r
case TT_DESCRIPTOR_SECTION_AP_NO_NO: // no read, no write\r
- //*GcdAttributes |= EFI_MEMORY_WP | EFI_MEMORY_RP;\r
+ //*GcdAttributes |= EFI_MEMORY_RO | EFI_MEMORY_RP;\r
break;\r
\r
case TT_DESCRIPTOR_SECTION_AP_RW_NO:\r
// read only cases map to write-protect\r
case TT_DESCRIPTOR_SECTION_AP_RO_NO:\r
case TT_DESCRIPTOR_SECTION_AP_RO_RO:\r
- *GcdAttributes |= EFI_MEMORY_WP;\r
+ *GcdAttributes |= EFI_MEMORY_RO;\r
break;\r
\r
default:\r
// determine protection attributes\r
switch(PageAttributes & TT_DESCRIPTOR_PAGE_AP_MASK) {\r
case TT_DESCRIPTOR_PAGE_AP_NO_NO: // no read, no write\r
- //*GcdAttributes |= EFI_MEMORY_WP | EFI_MEMORY_RP;\r
+ //*GcdAttributes |= EFI_MEMORY_RO | EFI_MEMORY_RP;\r
break;\r
\r
case TT_DESCRIPTOR_PAGE_AP_RW_NO:\r
// read only cases map to write-protect\r
case TT_DESCRIPTOR_PAGE_AP_RO_NO:\r
case TT_DESCRIPTOR_PAGE_AP_RO_RO:\r
- *GcdAttributes |= EFI_MEMORY_WP;\r
+ *GcdAttributes |= EFI_MEMORY_RO;\r
break;\r
\r
default:\r
ArmAttributes = TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_BACK_ALLOC; // TEX [2:0] = 001, C=1, B=1\r
break;\r
\r
- case EFI_MEMORY_WP:\r
- case EFI_MEMORY_XP:\r
- case EFI_MEMORY_RP:\r
case EFI_MEMORY_UCE:\r
default:\r
- // Cannot be implemented UEFI definition unclear for ARM\r
- // Cause a page fault if these ranges are accessed.\r
ArmAttributes = TT_DESCRIPTOR_SECTION_TYPE_FAULT;\r
- DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(): Unsupported attribute %x will page fault on access\n", EfiAttributes));\r
break;\r
}\r
\r
// Determine protection attributes\r
- if (EfiAttributes & EFI_MEMORY_WP) {\r
+ if (EfiAttributes & EFI_MEMORY_RO) {\r
ArmAttributes |= TT_DESCRIPTOR_SECTION_AP_RO_RO;\r
} else {\r
ArmAttributes |= TT_DESCRIPTOR_SECTION_AP_RW_RW;\r