summaryrefslogtreecommitdiffstats
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2015-10-15 00:57:45 +0000
committerydong10 <ydong10@Edk2>2015-10-15 00:57:45 +0000
commit84db9040cc8ba556faec61ad3480c774ca8b984c (patch)
tree123747e1d0ad5004bf534c985ad67198f73559f7 /IntelFrameworkModulePkg
parent291422d78bd810b33e7a49733a84d8ea6f6588f4 (diff)
downloadedk2-84db9040cc8ba556faec61ad3480c774ca8b984c.tar.gz
edk2-84db9040cc8ba556faec61ad3480c774ca8b984c.tar.bz2
edk2-84db9040cc8ba556faec61ad3480c774ca8b984c.zip
IntelFrameworkModulePkg BdsDxe: Use PcdSet##S to replace PcdSet##
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. So for DynamicDefault, we add assert when set failure. For DynamicHii, we add logic to handle it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18605 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c8
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c18
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c5
3 files changed, 21 insertions, 10 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
index 616549e64a..b933dd9699 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
@@ -1370,9 +1370,11 @@ Var_UpdateConMode (
Status = gST->ConOut->QueryMode (gST->ConOut, Mode, &(ModeInfo.Column), &(ModeInfo.Row));
if (!EFI_ERROR(Status)) {
- PcdSet32 (PcdSetupConOutColumn, (UINT32) ModeInfo.Column);
- PcdSet32 (PcdSetupConOutRow, (UINT32) ModeInfo.Row);
+ Status = PcdSet32S (PcdSetupConOutColumn, (UINT32) ModeInfo.Column);
+ if (!EFI_ERROR (Status)){
+ Status = PcdSet32S (PcdSetupConOutRow, (UINT32) ModeInfo.Row);
+ }
}
- return EFI_SUCCESS;
+ return Status;
}
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
index 14a7ae29f4..0a9238c2e7 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
@@ -1395,8 +1395,10 @@ BdsSetConsoleMode (
//
// Update text mode PCD.
//
- PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);
- PcdSet32 (PcdConOutRow, mSetupTextModeRow);
+ Status = PcdSet32S (PcdConOutColumn, mSetupTextModeColumn);
+ ASSERT_EFI_ERROR (Status);
+ Status = PcdSet32S (PcdConOutRow, mSetupTextModeRow);
+ ASSERT_EFI_ERROR (Status);
FreePool (Info);
return EFI_SUCCESS;
}
@@ -1437,10 +1439,14 @@ BdsSetConsoleMode (
// Set PCD to Inform GraphicsConsole to change video resolution.
// Set PCD to Inform Consplitter to change text mode.
//
- PcdSet32 (PcdVideoHorizontalResolution, NewHorizontalResolution);
- PcdSet32 (PcdVideoVerticalResolution, NewVerticalResolution);
- PcdSet32 (PcdConOutColumn, NewColumns);
- PcdSet32 (PcdConOutRow, NewRows);
+ Status = PcdSet32S (PcdVideoHorizontalResolution, NewHorizontalResolution);
+ ASSERT_EFI_ERROR (Status);
+ Status = PcdSet32S (PcdVideoVerticalResolution, NewVerticalResolution);
+ ASSERT_EFI_ERROR (Status);
+ Status = PcdSet32S (PcdConOutColumn, NewColumns);
+ ASSERT_EFI_ERROR (Status);
+ Status = PcdSet32S (PcdConOutRow, NewRows);
+ ASSERT_EFI_ERROR (Status);
//
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c b/IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c
index fedb151a0c..700e3e6626 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c
@@ -426,7 +426,10 @@ Done:
//
IsFirstBoot = PcdGetBool(PcdBootState);
if (IsFirstBoot) {
- PcdSetBool(PcdBootState, FALSE);
+ Status = PcdSetBoolS(PcdBootState, FALSE);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "Set PcdBootState to FALSE failed.\n"));
+ }
}
return ReturnStatus;