summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2015-10-10 02:53:41 +0000
committerHao Wu <hao.a.wu@intel.com>2016-03-03 14:10:50 +0800
commit919ca401a953137ec882ba05474735fa507ece25 (patch)
tree320d056ad247663168cf225b87b1b39d643519da /MdeModulePkg
parent79d8353e14eb3cee269d9e2dbbfd4b60a1432177 (diff)
downloadedk2-platforms-919ca401a953137ec882ba05474735fa507ece25.tar.xz
MdeModulePkg PiDxeS3BootScriptLib: Use PcdSet64S to instead of PcdSet64
PcdSet## has no error status returned, then the caller has no idea about whether the set operation is successful or not. PcdSet##S were added to return error status and PcdSet## APIs were put in ifndef DISABLE_NEW_DEPRECATED_INTERFACES condition. To adopt PcdSet##S and further code development with DISABLE_NEW_DEPRECATED_INTERFACES defined, we need to Replace PcdSet## usage with PcdSet##S. Normally, DynamicDefault PCD set is expected to be success, but DynamicHii PCD set failure is a legal case. For this case, PcdS3BootScriptTablePrivateDataPtr and PcdS3BootScriptTablePrivateSmmDataPtr are expected to be DynamicDefault, so use PcdSet64S to instead of PcdSet64 and assert when set failure. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18599 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit ca49b6f9bfcf74da90bf500f3f81d702aa4be6cc)
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
index 24c67984ca..e7d2a2492e 100644
--- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
+++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
@@ -454,7 +454,8 @@ S3BootScriptLibInitialize (
}
S3TablePtr = (VOID *) (UINTN) Buffer;
- PcdSet64 (PcdS3BootScriptTablePrivateDataPtr, (UINT64) (UINTN)S3TablePtr);
+ Status = PcdSet64S (PcdS3BootScriptTablePrivateDataPtr, (UINT64) (UINTN)S3TablePtr);
+ ASSERT_EFI_ERROR (Status);
ZeroMem (S3TablePtr, sizeof(SCRIPT_TABLE_PRIVATE_DATA));
//
// Create event to notify the library system enter the SmmLocked phase.
@@ -506,7 +507,8 @@ S3BootScriptLibInitialize (
return RETURN_OUT_OF_RESOURCES;
}
- PcdSet64 (PcdS3BootScriptTablePrivateSmmDataPtr, (UINT64) (UINTN)S3TableSmmPtr);
+ Status = PcdSet64S (PcdS3BootScriptTablePrivateSmmDataPtr, (UINT64) (UINTN)S3TableSmmPtr);
+ ASSERT_EFI_ERROR (Status);
ZeroMem (S3TableSmmPtr, sizeof(SCRIPT_TABLE_PRIVATE_DATA));
//