summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Universal
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2013-05-17 03:49:35 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2013-05-17 03:49:35 +0000
commitff8438477f2dcea28149514de25368ac0b2c02ee (patch)
treebd41d2b98e006420fce4c37c259c06e452bc9de5 /IntelFrameworkModulePkg/Universal
parentefffd9c17e63dde624373b0d374623ffe4770570 (diff)
downloadedk2-platforms-ff8438477f2dcea28149514de25368ac0b2c02ee.tar.xz
Add EDKII_VARIABLE_LOCK_PROTOCOL and the implementation in MdeModulePkg variable drivers.
Add code in BdsDxe driver to call the protocol to mark the read-only variables defined in the UEFI Spec. Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14372 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal')
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h3
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf3
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c37
3 files changed, 35 insertions, 8 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h b/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
index 0929f1d27b..14996f63e6 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
@@ -1,7 +1,7 @@
/** @file
Head file for BDS Architectural Protocol implementation
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -47,6 +47,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/SimpleTextInEx.h>
#include <Protocol/DriverHealth.h>
#include <Protocol/BootLogo.h>
+#include <Protocol/VariableLock.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/PrintLib.h>
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
index a60738e946..2424a8a842 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -14,7 +14,7 @@
# BDSDxe also maintain the UI for "Boot Manager, Boot Maintaince Manager, Device Manager" which
# is used for user to configure boot option or maintain hardware device.
#
-# Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -160,6 +160,7 @@
gEfiDriverHealthProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES
gEfiPciIoProtocolGuid ## PROTOCOL CONSUMES
gEfiBootLogoProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES
+ gEdkiiVariableLockProtocolGuid ## PROTOCOL CONSUMES
[FeaturePcd]
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDeprecate
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
index 6eaec886f2..91c6dc72dd 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -38,6 +38,17 @@ EFI_BDS_ARCH_PROTOCOL gBds = {
UINT16 *mBootNext = NULL;
+///
+/// The read-only variables defined in UEFI Spec.
+///
+CHAR16 *mReadOnlyVariables[] = {
+ L"PlatformLangCodes",
+ L"LangCodes",
+ L"BootOptionSupport",
+ L"HwErrRecSupport",
+ L"OsIndicationsSupported"
+ };
+
/**
Install Boot Device Selection Protocol
@@ -459,6 +470,8 @@ BdsEntry (
CHAR16 *FirmwareVendor;
EFI_STATUS Status;
UINT16 BootTimeOut;
+ UINTN Index;
+ EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock;
//
// Insert the performance probe
@@ -497,6 +510,18 @@ BdsEntry (
BdsFormalizeEfiGlobalVariable();
//
+ // Mark the read-only variables if the Variable Lock protocol exists
+ //
+ Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock);
+ DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable Lock protocol - %r\n", Status));
+ if (!EFI_ERROR (Status)) {
+ for (Index = 0; Index < sizeof (mReadOnlyVariables) / sizeof (mReadOnlyVariables[0]); Index++) {
+ Status = VariableLock->RequestToLock (VariableLock, mReadOnlyVariables[Index], &gEfiGlobalVariableGuid);
+ ASSERT_EFI_ERROR (Status);
+ }
+ }
+
+ //
// Report Status Code to indicate connecting drivers will happen
//
REPORT_STATUS_CODE (
@@ -504,12 +529,6 @@ BdsEntry (
(EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS)
);
- //
- // Do the platform init, can be customized by OEM/IBV
- //
- PERF_START (NULL, "PlatformBds", "BDS", 0);
- PlatformBdsInit ();
-
InitializeHwErrRecSupport();
//
@@ -540,6 +559,12 @@ BdsEntry (
InitializeFrontPage (TRUE);
//
+ // Do the platform init, can be customized by OEM/IBV
+ //
+ PERF_START (NULL, "PlatformBds", "BDS", 0);
+ PlatformBdsInit ();
+
+ //
// Set up the device list based on EFI 1.1 variables
// process Driver#### and Load the driver's in the
// driver option list