summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Application
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2015-10-15 00:56:41 +0000
committerydong10 <ydong10@Edk2>2015-10-15 00:56:41 +0000
commit377680ae64bd6f702bfac7c98e65f73019b7d285 (patch)
tree8a06470bc3dffc15011376d116368be7880ae04f /MdeModulePkg/Application
parent1e69581335354a7df3bc07b21e495b0b3c5909c0 (diff)
downloadedk2-377680ae64bd6f702bfac7c98e65f73019b7d285.zip
edk2-377680ae64bd6f702bfac7c98e65f73019b7d285.tar.gz
edk2-377680ae64bd6f702bfac7c98e65f73019b7d285.tar.bz2
MdeModulePkg: 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. Cc: Star Zeng <star.zeng@intel.com> 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@18603 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r--MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c19
-rw-r--r--MdeModulePkg/Application/UiApp/BootMaint/Variable.c8
-rw-r--r--MdeModulePkg/Application/UiApp/FrontPage.c18
3 files changed, 29 insertions, 16 deletions
diff --git a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
index c5a35c0..d43c12f 100644
--- a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
+++ b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
@@ -775,8 +775,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;
}
@@ -817,11 +819,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);
//
// Video mode is changed, so restart graphics console driver and higher level driver.
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Variable.c b/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
index 76dbd3a..a8d9cd5 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
@@ -1064,9 +1064,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/MdeModulePkg/Application/UiApp/FrontPage.c b/MdeModulePkg/Application/UiApp/FrontPage.c
index d1b4f5c..245c349 100644
--- a/MdeModulePkg/Application/UiApp/FrontPage.c
+++ b/MdeModulePkg/Application/UiApp/FrontPage.c
@@ -989,8 +989,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;
}
@@ -1031,10 +1033,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);
//