Revision: 18603
http://sourceforge.net/p/edk2/code/18603
Author: ydong10
Date: 2015-10-15 00:56:41 +0000 (Thu, 15 Oct 2015)
Log Message:
-----------
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 <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
trunk/edk2/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
trunk/edk2/MdeModulePkg/Application/UiApp/FrontPage.c
trunk/edk2/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
Modified:
trunk/edk2/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
===================================================================
--- trunk/edk2/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
2015-10-14 09:43:43 UTC (rev 18602)
+++ trunk/edk2/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
2015-10-15 00:56:41 UTC (rev 18603)
@@ -775,8 +775,10 @@
//
// 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,12 +819,15 @@
// 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.
// Reconnect graphics console driver and higher level driver.
Modified: trunk/edk2/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
===================================================================
--- trunk/edk2/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
2015-10-14 09:43:43 UTC (rev 18602)
+++ trunk/edk2/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
2015-10-15 00:56:41 UTC (rev 18603)
@@ -1064,9 +1064,11 @@
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;
}
Modified: trunk/edk2/MdeModulePkg/Application/UiApp/FrontPage.c
===================================================================
--- trunk/edk2/MdeModulePkg/Application/UiApp/FrontPage.c 2015-10-14
09:43:43 UTC (rev 18602)
+++ trunk/edk2/MdeModulePkg/Application/UiApp/FrontPage.c 2015-10-15
00:56:41 UTC (rev 18603)
@@ -989,8 +989,10 @@
//
// 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 @@
// 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);
//
Modified: trunk/edk2/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
2015-10-14 09:43:43 UTC (rev 18602)
+++ trunk/edk2/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
2015-10-15 00:56:41 UTC (rev 18603)
@@ -16,7 +16,7 @@
never removed. Such design ensures sytem function well during none console
device situation.
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2015, 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
@@ -2946,8 +2946,10 @@
Status = TextOut->SetMode (TextOut, BaseMode);
ASSERT(!EFI_ERROR(Status));
- PcdSet32 (PcdConOutColumn, 80);
- PcdSet32 (PcdConOutRow, 25);
+ Status = PcdSet32S (PcdConOutColumn, 80);
+ ASSERT(!EFI_ERROR(Status));
+ Status = PcdSet32S (PcdConOutRow, 25);
+ ASSERT(!EFI_ERROR(Status));
}
return ;
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits