summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Library
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2014-03-17 08:24:07 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2014-03-17 08:24:07 +0000
commite609aef97a174455a79f339b15f83713b99e3b03 (patch)
treefc20b44fe429e2b6a1d870c754c8b3d2ace7abdd /IntelFrameworkModulePkg/Library
parent4345d16427c4b88e2c4183b38eefb7015bc36bcf (diff)
downloadedk2-platforms-e609aef97a174455a79f339b15f83713b99e3b03.tar.xz
Do not reset system when the MemoryTypeInformation variable cannot be written.
Remove the RT attribute for the MemoryTypeInformation variable because it’s not necessary. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15333 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Library')
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
index 971188bd0a..cafbe71e25 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
@@ -1,7 +1,7 @@
/** @file
Misc BDS library function
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, 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
@@ -1422,19 +1422,23 @@ BdsSetMemoryTypeInformationVariable (
Status = gRT->SetVariable (
EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
&gEfiMemoryTypeInformationGuid,
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
VariableSize,
PreviousMemoryTypeInformation
);
- //
- // If the Memory Type Information settings have been modified, then reset the platform
- // so the new Memory Type Information setting will be used to guarantee that an S4
- // entry/resume cycle will not fail.
- //
- if (MemoryTypeInformationModified && PcdGetBool (PcdResetOnMemoryTypeInformationChange)) {
- DEBUG ((EFI_D_INFO, "Memory Type Information settings change. Warm Reset!!!\n"));
- gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
+ if (!EFI_ERROR (Status)) {
+ //
+ // If the Memory Type Information settings have been modified, then reset the platform
+ // so the new Memory Type Information setting will be used to guarantee that an S4
+ // entry/resume cycle will not fail.
+ //
+ if (MemoryTypeInformationModified && PcdGetBool (PcdResetOnMemoryTypeInformationChange)) {
+ DEBUG ((EFI_D_INFO, "Memory Type Information settings change. Warm Reset!!!\n"));
+ gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
+ }
+ } else {
+ DEBUG ((EFI_D_ERROR, "Memory Type Information settings cannot be saved. OS S4 may fail!\n"));
}
}
}