install simple text output protocol on stderr should in ConsplitterStdErrStart() instead of in ConSplitterEntryPoint().

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8020 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2009-04-03 07:39:16 +00:00
parent b5378fa05e
commit 19c9b0cce3
1 changed files with 44 additions and 13 deletions

View File

@ -379,23 +379,11 @@ ConSplitterDriverEntry(
FeaturePcdGet (PcdConOutUgaSupport));
//
// The driver creates virtual handles for ConIn, ConOut, and StdErr.
// The driver creates virtual handles for ConIn, ConOut.
// The virtual handles will always exist even if no console exist in the
// system. This is need to support hotplug devices like USB.
//
//
// Create virtual device handle for StdErr Splitter
//
Status = ConSplitterTextOutConstructor (&mStdErr);
if (!EFI_ERROR (Status)) {
Status = gBS->InstallMultipleProtocolInterfaces (
&mStdErr.VirtualHandle,
&gEfiSimpleTextOutProtocolGuid,
&mStdErr.TextOut,
NULL
);
}
//
// Create virtual device handle for ConIn Splitter
//
Status = ConSplitterTextInConstructor (&mConIn);
@ -1327,6 +1315,25 @@ ConSplitterStdErrDriverBindingStart (
EFI_STATUS Status;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;
if (mStdErr.CurrentNumberOfConsoles == 0) {
//
// Create virtual device handle for StdErr Splitter
//
Status = ConSplitterTextOutConstructor (&mStdErr);
if (!EFI_ERROR (Status)) {
Status = gBS->InstallMultipleProtocolInterfaces (
&mStdErr.VirtualHandle,
&gEfiSimpleTextOutProtocolGuid,
&mStdErr.TextOut,
NULL
);
}
if (EFI_ERROR (Status)) {
return Status;
}
}
//
// Start ConSplitter on ControllerHandle, and create the virtual
// agrogated console device on first call Start for a StandardError handle.
@ -1360,6 +1367,19 @@ ConSplitterStdErrDriverBindingStart (
}
if (mStdErr.CurrentNumberOfConsoles == 1) {
//
// Create virtual device handle for StdErr Splitter
//
Status = ConSplitterTextOutConstructor (&mStdErr);
if (!EFI_ERROR (Status)) {
Status = gBS->InstallMultipleProtocolInterfaces (
&mStdErr.VirtualHandle,
&gEfiSimpleTextOutProtocolGuid,
&mStdErr.TextOut,
NULL
);
}
gST->StandardErrorHandle = mStdErr.VirtualHandle;
gST->StdErr = &mStdErr.TextOut;
//
@ -1726,6 +1746,16 @@ ConSplitterStdErrDriverBindingStop (
gST->Hdr.HeaderSize,
&gST->Hdr.CRC32
);
//
// Uninstall Simple Text Output protocol from StdErr Handle.
//
gBS->UninstallMultipleProtocolInterfaces (
mStdErr.VirtualHandle,
&gEfiSimpleTextOutProtocolGuid,
&mStdErr.TextOut,
NULL
);
}
return Status;
@ -4145,6 +4175,7 @@ ConSplitterTextOutOutputString (
Private = TEXT_OUT_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
BackSpaceCount = 0;
for (TargetString = WString; *TargetString != L'\0'; TargetString++) {
if (*TargetString == CHAR_BACKSPACE) {
BackSpaceCount++;