diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-07 08:42:15 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-07 08:42:15 +0000 |
commit | 406ddad31b58d7a47927c3fa132657705816b65f (patch) | |
tree | 3244ae7262fc859bba9473b177346dc6d524eca1 /IntelFrameworkModulePkg | |
parent | 7ef76906acc51310890dd677201d9807a7fec63d (diff) | |
download | edk2-platforms-406ddad31b58d7a47927c3fa132657705816b65f.tar.xz |
1. Update the CRC32 in the EFI System Table header in BdsConsole.c
2. Removed duplicated installation for Simple Text Output protocol on ErrHandle.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8031 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r-- | IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c index 30a6c3e6ed..6f3addb2f2 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c @@ -60,8 +60,12 @@ IsNvNeed ( On OUT, new console hanlde in system table.
@param ProtocolInterface On IN, console protocol on console handle in System Table to be checked.
On OUT, new console protocol on new console hanlde in system table.
+
+ @retval TRUE System Table has been updated.
+ @retval FALSE System Table hasn't been updated.
+
**/
-VOID
+BOOLEAN
UpdateSystemTableConsole (
IN CHAR16 *VarName,
IN EFI_GUID *ConsoleGuid,
@@ -93,7 +97,7 @@ UpdateSystemTableConsole ( // If ConsoleHandle is valid and console protocol on this handle also
// also matched, just return.
//
- return;
+ return FALSE;
}
}
@@ -109,7 +113,7 @@ UpdateSystemTableConsole ( //
// If there is no any console device, just return.
//
- return ;
+ return FALSE;
}
FullDevicePath = VarConsole;
@@ -147,7 +151,7 @@ UpdateSystemTableConsole ( //
*ConsoleHandle = NewHandle;
*ProtocolInterface = Interface;
- return ;
+ return TRUE;
}
}
@@ -156,7 +160,7 @@ UpdateSystemTableConsole ( //
// No any available console devcie found.
//
- ASSERT (FALSE);
+ return FALSE;
}
/**
@@ -485,6 +489,7 @@ BdsLibConnectAllDefaultConsoles ( )
{
EFI_STATUS Status;
+ BOOLEAN SystemTableUpdated;
//
// Connect all default console variables
@@ -517,12 +522,31 @@ BdsLibConnectAllDefaultConsoles ( //
BdsLibConnectConsoleVariable (L"ErrOut");
+ SystemTableUpdated = FALSE;
//
// Fill console handles in System Table if no console device assignd.
//
- UpdateSystemTableConsole (L"ConIn", &gEfiSimpleTextInProtocolGuid, &gST->ConsoleInHandle, (VOID **) &gST->ConIn);
- UpdateSystemTableConsole (L"ConOut", &gEfiSimpleTextOutProtocolGuid, &gST->ConsoleOutHandle, (VOID **) &gST->ConOut);
- UpdateSystemTableConsole (L"ErrOut", &gEfiSimpleTextOutProtocolGuid, &gST->StandardErrorHandle, (VOID **) &gST->StdErr);
+ if (UpdateSystemTableConsole (L"ConIn", &gEfiSimpleTextInProtocolGuid, &gST->ConsoleInHandle, (VOID **) &gST->ConIn)) {
+ SystemTableUpdated = TRUE;
+ }
+ if (UpdateSystemTableConsole (L"ConOut", &gEfiSimpleTextOutProtocolGuid, &gST->ConsoleOutHandle, (VOID **) &gST->ConOut)) {
+ SystemTableUpdated = TRUE;
+ }
+ if (UpdateSystemTableConsole (L"ErrOut", &gEfiSimpleTextOutProtocolGuid, &gST->StandardErrorHandle, (VOID **) &gST->StdErr)) {
+ SystemTableUpdated = TRUE;
+ }
+
+ if (SystemTableUpdated) {
+ //
+ // Update the CRC32 in the EFI System Table header
+ //
+ gST->Hdr.CRC32 = 0;
+ gBS->CalculateCrc32 (
+ (UINT8 *) &gST->Hdr,
+ gST->Hdr.HeaderSize,
+ &gST->Hdr.CRC32
+ );
+ }
return EFI_SUCCESS;
|