mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
7ef76906ac
commit
406ddad31b
|
@ -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;
|
||||
|
||||
|
|
|
@ -1317,18 +1317,9 @@ ConSplitterStdErrDriverBindingStart (
|
|||
|
||||
if (mStdErr.CurrentNumberOfConsoles == 0) {
|
||||
//
|
||||
// Create virtual device handle for StdErr Splitter
|
||||
// Construct console output devices' private data
|
||||
//
|
||||
Status = ConSplitterTextOutConstructor (&mStdErr);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&mStdErr.VirtualHandle,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
&mStdErr.TextOut,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
@ -1370,14 +1361,14 @@ ConSplitterStdErrDriverBindingStart (
|
|||
//
|
||||
// Create virtual device handle for StdErr Splitter
|
||||
//
|
||||
Status = ConSplitterTextOutConstructor (&mStdErr);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&mStdErr.VirtualHandle,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
&mStdErr.TextOut,
|
||||
NULL
|
||||
);
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&mStdErr.VirtualHandle,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
&mStdErr.TextOut,
|
||||
NULL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
gST->StandardErrorHandle = mStdErr.VirtualHandle;
|
||||
|
@ -1779,8 +1770,8 @@ ConSplitterStdErrDriverBindingStop (
|
|||
**/
|
||||
EFI_STATUS
|
||||
ConSplitterGrowBuffer (
|
||||
IN UINTN SizeOfCount,
|
||||
IN UINTN *Count,
|
||||
IN UINTN SizeOfCount,
|
||||
IN OUT UINTN *Count,
|
||||
IN OUT VOID **Buffer
|
||||
)
|
||||
{
|
||||
|
@ -2968,6 +2959,7 @@ ConSplitterTextOutAddDevice (
|
|||
// If the Text Out List is full, enlarge it by calling ConSplitterGrowBuffer().
|
||||
//
|
||||
while (CurrentNumOfConsoles >= Private->TextOutListCount) {
|
||||
CpuBreakpoint ();
|
||||
Status = ConSplitterGrowBuffer (
|
||||
sizeof (TEXT_OUT_AND_GOP_DATA),
|
||||
&Private->TextOutListCount,
|
||||
|
|
|
@ -1749,8 +1749,8 @@ ConSplitterTextOutEnableCursor (
|
|||
**/
|
||||
EFI_STATUS
|
||||
ConSplitterGrowBuffer (
|
||||
IN UINTN SizeOfCount,
|
||||
IN UINTN *Count,
|
||||
IN UINTN SizeOfCount,
|
||||
IN OUT UINTN *Count,
|
||||
IN OUT VOID **Buffer
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue