///\r
/// Start Address of Upper Memory Area (UMA) to be set as Read/Write. If\r
/// UmaAddress is a valid address in the shadow RAM, it also indicates that the region\r
- /// from 0xC0000 to (UmaAddress ¨C 1) can be used for Option ROM.\r
+ /// from 0xC0000 to (UmaAddress - 1) can be used for Option ROM.\r
///\r
UINT32 UmaAddress;\r
\r
- 01 = ROM Found.\r
- 02 = ROM is a valid legacy ROM.\r
\r
- @retval EFI_SUCCESS The Legacy Option ROM availible for this device\r
+ @retval EFI_SUCCESS The Legacy Option ROM available for this device\r
@retval EFI_UNSUPPORTED The Legacy Option ROM is not supported.\r
\r
**/\r
EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE BootUnconventionalDevice;\r
};\r
\r
+//\r
+// Legacy BIOS needs to access memory in page 0 (0-4095), which is disabled if\r
+// NULL pointer detection feature is enabled. Following macro can be used to\r
+// enable/disable page 0 before/after accessing it.\r
+//\r
+#define ACCESS_PAGE0_CODE(statements) \\r
+ do { \\r
+ EFI_STATUS Status_; \\r
+ EFI_GCD_MEMORY_SPACE_DESCRIPTOR Desc_; \\r
+ \\r
+ Desc_.Attributes = 0; \\r
+ Status_ = gDS->GetMemorySpaceDescriptor (0, &Desc_); \\r
+ ASSERT_EFI_ERROR (Status_); \\r
+ if ((Desc_.Attributes & EFI_MEMORY_RP) != 0) { \\r
+ Status_ = gDS->SetMemorySpaceAttributes ( \\r
+ 0, \\r
+ EFI_PAGES_TO_SIZE(1), \\r
+ Desc_.Attributes & ~(UINT64)EFI_MEMORY_RP \\r
+ ); \\r
+ ASSERT_EFI_ERROR (Status_); \\r
+ } \\r
+ \\r
+ { \\r
+ statements; \\r
+ } \\r
+ \\r
+ if ((Desc_.Attributes & EFI_MEMORY_RP) != 0) { \\r
+ Status_ = gDS->SetMemorySpaceAttributes ( \\r
+ 0, \\r
+ EFI_PAGES_TO_SIZE(1), \\r
+ Desc_.Attributes \\r
+ ); \\r
+ ASSERT_EFI_ERROR (Status_); \\r
+ } \\r
+ } while (FALSE)\r
+\r
extern EFI_GUID gEfiLegacyBiosProtocolGuid;\r
\r
#endif\r