\r
UINT16 *mBootNext = NULL;\r
\r
+///\r
+/// The read-only variables defined in UEFI Spec.\r
+///\r
+CHAR16 *mReadOnlyVariables[] = {\r
+ L"PlatformLangCodes",\r
+ L"LangCodes",\r
+ L"BootOptionSupport",\r
+ L"HwErrRecSupport",\r
+ L"OsIndicationsSupported"\r
+ };\r
+\r
/**\r
\r
Install Boot Device Selection Protocol\r
CHAR16 *FirmwareVendor;\r
EFI_STATUS Status;\r
UINT16 BootTimeOut;\r
+ UINTN Index;\r
+ EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock;\r
\r
//\r
// Insert the performance probe\r
//\r
BdsFormalizeEfiGlobalVariable();\r
\r
+ //\r
+ // Mark the read-only variables if the Variable Lock protocol exists\r
+ //\r
+ Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock);\r
+ DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable Lock protocol - %r\n", Status));\r
+ if (!EFI_ERROR (Status)) {\r
+ for (Index = 0; Index < sizeof (mReadOnlyVariables) / sizeof (mReadOnlyVariables[0]); Index++) {\r
+ Status = VariableLock->RequestToLock (VariableLock, mReadOnlyVariables[Index], &gEfiGlobalVariableGuid);\r
+ ASSERT_EFI_ERROR (Status);\r
+ }\r
+ }\r
+\r
//\r
// Report Status Code to indicate connecting drivers will happen\r
//\r
(EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS)\r
);\r
\r
- //\r
- // Do the platform init, can be customized by OEM/IBV\r
- //\r
- PERF_START (NULL, "PlatformBds", "BDS", 0);\r
- PlatformBdsInit ();\r
-\r
InitializeHwErrRecSupport();\r
\r
//\r
InitializeLanguage (TRUE);\r
InitializeFrontPage (TRUE);\r
\r
+ //\r
+ // Do the platform init, can be customized by OEM/IBV\r
+ //\r
+ PERF_START (NULL, "PlatformBds", "BDS", 0);\r
+ PlatformBdsInit ();\r
+\r
//\r
// Set up the device list based on EFI 1.1 variables\r
// process Driver#### and Load the driver's in the\r