summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-05 09:53:54 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-05 09:53:54 +0000
commitf2fa830ef0c29e8d35dcb8e6025a0b736e5cdad0 (patch)
tree8f61198dcca711add5da00a78bfd831cef09cc09 /IntelFrameworkModulePkg
parent0d401d4d9cc1a5893a87bb28ef7b0265e6b91008 (diff)
downloadedk2-platforms-f2fa830ef0c29e8d35dcb8e6025a0b736e5cdad0.tar.xz
As variable area is not reliable in recovery path, then we should not produce ReadonlyVariable2&ReadonlyVariable ppi at the point. This way causes other Pei module wanted to access to variable will fail
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7185 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Universal/VariablePei/Variable.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c b/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c
index 33363e67ea..2cda7ff3ad 100644
--- a/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c
+++ b/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c
@@ -47,11 +47,12 @@ EFI_GUID mEfiVariableIndexTableGuid = EFI_VARIABLE_INDEX_TABLE_GUID;
/**
Provide the functionality of the variable services.
- @param FileHandle Handle of the file being invoked.
- @param PeiServices Describes the list of possible PEI Services.
+ @param FileHandle Handle of the file being invoked.
+ @param PeiServices Describes the list of possible PEI Services.
- @return Status - EFI_SUCCESS if the interface could be successfully
- installed
+ @return EFI_SUCCESS If the interface could be successfully installed.
+ @return EFI_UNSUPPORTED If current boot path is in recovery mode, then does not
+ install this interface.
**/
EFI_STATUS
@@ -61,9 +62,21 @@ PeimInitializeVariableServices (
IN CONST EFI_PEI_SERVICES **PeiServices
)
{
+ EFI_BOOT_MODE BootMode;
+ EFI_STATUS Status;
+
//
- // Publish the variable capability to other modules
- //
+ // Check if this is recovery boot path. If no, publish the variable access capability
+ // to other modules. If yes, the content of variable area is not reliable. Therefore,
+ // in this case we should not provide variable service to other pei modules.
+ //
+ Status = (*PeiServices)->GetBootMode (PeiServices, &BootMode);
+ ASSERT_EFI_ERROR (Status);
+
+ if (BootMode == BOOT_IN_RECOVERY_MODE) {
+ return EFI_UNSUPPORTED;
+ }
+
return (**PeiServices).InstallPpi (PeiServices, &mPpiListVariable[0]);
}