From: vanjeff Date: Tue, 10 Mar 2009 03:36:33 +0000 (+0000) Subject: Three GUIDs had been retired, PrimaryConsoleInDeviceGuid, PrimaryConsoleOutDeviceGuid... X-Git-Tag: edk2-stable201903~18408 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=157398c2581b1fdf5f1af8283d8d990284dd4473;hp=dad608335f432ce7a30a7a0d5496546254633bba Three GUIDs had been retired, PrimaryConsoleInDeviceGuid, PrimaryConsoleOutDeviceGuid and PrimaryStandardErrorDeviceGuid. Reconnect, Edit, HexEdit command are updated. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7842 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/edit.efi b/EdkShellBinPkg/Bin/Ia32/Apps/edit.efi index e1e55a6fdc..212a064aa6 100644 Binary files a/EdkShellBinPkg/Bin/Ia32/Apps/edit.efi and b/EdkShellBinPkg/Bin/Ia32/Apps/edit.efi differ diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/hexedit.efi b/EdkShellBinPkg/Bin/Ia32/Apps/hexedit.efi index b348df83e2..4808b9789f 100644 Binary files a/EdkShellBinPkg/Bin/Ia32/Apps/hexedit.efi and b/EdkShellBinPkg/Bin/Ia32/Apps/hexedit.efi differ diff --git a/EdkShellBinPkg/Bin/Ia32/Shell.efi b/EdkShellBinPkg/Bin/Ia32/Shell.efi index a38afc11fe..ccb2b5b449 100644 Binary files a/EdkShellBinPkg/Bin/Ia32/Shell.efi and b/EdkShellBinPkg/Bin/Ia32/Shell.efi differ diff --git a/EdkShellBinPkg/Bin/Ia32/Shell_Full.efi b/EdkShellBinPkg/Bin/Ia32/Shell_Full.efi index fb5ab1eee7..a0806b7ffd 100644 Binary files a/EdkShellBinPkg/Bin/Ia32/Shell_Full.efi and b/EdkShellBinPkg/Bin/Ia32/Shell_Full.efi differ diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/edit.efi b/EdkShellBinPkg/Bin/Ipf/Apps/edit.efi index 9bb4d190ef..fd01a25228 100644 Binary files a/EdkShellBinPkg/Bin/Ipf/Apps/edit.efi and b/EdkShellBinPkg/Bin/Ipf/Apps/edit.efi differ diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/hexedit.efi b/EdkShellBinPkg/Bin/Ipf/Apps/hexedit.efi index 4406a4d65e..6e7e23ad47 100644 Binary files a/EdkShellBinPkg/Bin/Ipf/Apps/hexedit.efi and b/EdkShellBinPkg/Bin/Ipf/Apps/hexedit.efi differ diff --git a/EdkShellBinPkg/Bin/Ipf/Shell.efi b/EdkShellBinPkg/Bin/Ipf/Shell.efi index fc1d751535..c38e3e9f98 100644 Binary files a/EdkShellBinPkg/Bin/Ipf/Shell.efi and b/EdkShellBinPkg/Bin/Ipf/Shell.efi differ diff --git a/EdkShellBinPkg/Bin/Ipf/Shell_Full.efi b/EdkShellBinPkg/Bin/Ipf/Shell_Full.efi index 62c50bb6e8..cda6840187 100644 Binary files a/EdkShellBinPkg/Bin/Ipf/Shell_Full.efi and b/EdkShellBinPkg/Bin/Ipf/Shell_Full.efi differ diff --git a/EdkShellBinPkg/Bin/X64/Apps/edit.efi b/EdkShellBinPkg/Bin/X64/Apps/edit.efi index 9c37f41ea3..b90e30b073 100644 Binary files a/EdkShellBinPkg/Bin/X64/Apps/edit.efi and b/EdkShellBinPkg/Bin/X64/Apps/edit.efi differ diff --git a/EdkShellBinPkg/Bin/X64/Apps/hexedit.efi b/EdkShellBinPkg/Bin/X64/Apps/hexedit.efi index 3fb59af129..7170d6de43 100644 Binary files a/EdkShellBinPkg/Bin/X64/Apps/hexedit.efi and b/EdkShellBinPkg/Bin/X64/Apps/hexedit.efi differ diff --git a/EdkShellBinPkg/Bin/X64/Shell.efi b/EdkShellBinPkg/Bin/X64/Shell.efi index 1174584dee..afbf5b18f4 100644 Binary files a/EdkShellBinPkg/Bin/X64/Shell.efi and b/EdkShellBinPkg/Bin/X64/Shell.efi differ diff --git a/EdkShellBinPkg/Bin/X64/Shell_full.efi b/EdkShellBinPkg/Bin/X64/Shell_full.efi index d525497029..79fbe05c50 100644 Binary files a/EdkShellBinPkg/Bin/X64/Shell_full.efi and b/EdkShellBinPkg/Bin/X64/Shell_full.efi differ diff --git a/EdkShellBinPkg/FullShell/Ia32/Shell_Full.efi b/EdkShellBinPkg/FullShell/Ia32/Shell_Full.efi index fb5ab1eee7..a0806b7ffd 100644 Binary files a/EdkShellBinPkg/FullShell/Ia32/Shell_Full.efi and b/EdkShellBinPkg/FullShell/Ia32/Shell_Full.efi differ diff --git a/EdkShellBinPkg/FullShell/Ipf/Shell_Full.efi b/EdkShellBinPkg/FullShell/Ipf/Shell_Full.efi index 62c50bb6e8..cda6840187 100644 Binary files a/EdkShellBinPkg/FullShell/Ipf/Shell_Full.efi and b/EdkShellBinPkg/FullShell/Ipf/Shell_Full.efi differ diff --git a/EdkShellBinPkg/FullShell/X64/Shell_full.efi b/EdkShellBinPkg/FullShell/X64/Shell_full.efi index d525497029..79fbe05c50 100644 Binary files a/EdkShellBinPkg/FullShell/X64/Shell_full.efi and b/EdkShellBinPkg/FullShell/X64/Shell_full.efi differ diff --git a/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi b/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi index a38afc11fe..ccb2b5b449 100644 Binary files a/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi and b/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi differ diff --git a/EdkShellBinPkg/MinimumShell/Ipf/Shell.efi b/EdkShellBinPkg/MinimumShell/Ipf/Shell.efi index fc1d751535..c38e3e9f98 100644 Binary files a/EdkShellBinPkg/MinimumShell/Ipf/Shell.efi and b/EdkShellBinPkg/MinimumShell/Ipf/Shell.efi differ diff --git a/EdkShellBinPkg/MinimumShell/X64/Shell.efi b/EdkShellBinPkg/MinimumShell/X64/Shell.efi index 1174584dee..afbf5b18f4 100644 Binary files a/EdkShellBinPkg/MinimumShell/X64/Shell.efi and b/EdkShellBinPkg/MinimumShell/X64/Shell.efi differ diff --git a/EdkShellPkg/EdkShellPkg.dsc b/EdkShellPkg/EdkShellPkg.dsc index 3311f5fd1e..dd1ce2f637 100644 --- a/EdkShellPkg/EdkShellPkg.dsc +++ b/EdkShellPkg/EdkShellPkg.dsc @@ -28,7 +28,7 @@ # Change the macro to the directory containing the source code from EDK Shell Project. # This is a workspace relative directory # -DEFINE EDK_SHELL_DIR = Shell +DEFINE EDK_SHELL_DIR = EdkShellPkg/Shell [Libraries] # diff --git a/EdkShellPkg/ReadMe.txt b/EdkShellPkg/ReadMe.txt index d11bb8a552..5dfb125bd7 100644 --- a/EdkShellPkg/ReadMe.txt +++ b/EdkShellPkg/ReadMe.txt @@ -13,6 +13,9 @@ This is EDK style package and the following steps can help to build the package: 3. The ShellHotFix.patch file solves the follow two issues in EDK Shell 1.05 release: a. RFC3066 language compatibility issue in drivers command. b. "CHAR8" compatibility issue in DmpStore, Edit command and shell script execution. + c. Three GUIDs had been retired, PrimaryConsoleInDeviceGuid, PrimaryConsoleOutDeviceGuid and PrimaryStandardErrorDeviceGuid. + Reconnect, Edit, HexEdit command are updated. + This patch will be integrated into the later official release. 4. The EDK II style DSC file is used to validate build EDK Shell source & EDK compatibility package and can generate the binaries in EdkShellBinPkg. diff --git a/EdkShellPkg/ShellHotFix.patch b/EdkShellPkg/ShellHotFix.patch index 46a95d8841..e4aa54bb78 100644 --- a/EdkShellPkg/ShellHotFix.patch +++ b/EdkShellPkg/ShellHotFix.patch @@ -163,6 +163,70 @@ Index: drivers/drivers.c ShellCloseHandleEnumerator (); LibCheckVarFreeVarList (&ChkPck); LibUnInitializeStrings (); +Index: edit/libEditor.c +=================================================================== +--- edit/libEditor.c (revision 30) ++++ edit/libEditor.c (working copy) +@@ -88,8 +88,6 @@ + ) + { + EFI_STATUS Status; +- EFI_HANDLE *HandleBuffer; +- UINTN HandleCount; + + // + // basic initialization +@@ -117,38 +115,22 @@ + ); + + // +- // Find mouse ++ // Find mouse in System Table ConsoleInHandle + // +- HandleBuffer = NULL; +- Status = LibLocateHandle ( +- ByProtocol, +- &gEfiPrimaryConsoleInDeviceGuid, +- NULL, +- &HandleCount, +- &HandleBuffer +- ); ++ Status = BS->HandleProtocol ( ++ In, ++ &gEfiSimplePointerProtocolGuid, ++ &MainEditor.MouseInterface ++ ); + +- if (!EFI_ERROR (Status)) { +- if (HandleCount > 0) { +- Status = BS->HandleProtocol ( +- HandleBuffer[0], +- &gEfiSimplePointerProtocolGuid, +- &MainEditor.MouseInterface +- ); +- +- if (EFI_ERROR (Status)) { +- MainEditor.MouseInterface = NULL; +- } else { +- MainEditor.MouseAccumulatorX = 0; +- MainEditor.MouseAccumulatorY = 0; +- MainEditor.MouseSupported = TRUE; +- } +- } ++ if (EFI_ERROR (Status)) { ++ MainEditor.MouseInterface = NULL; ++ } else { ++ MainEditor.MouseAccumulatorX = 0; ++ MainEditor.MouseAccumulatorY = 0; ++ MainEditor.MouseSupported = TRUE; + } + +- if (HandleBuffer) { +- FreePool (HandleBuffer); +- } + // + // below will call the five components' init function + // Index: edit/libFileBuffer.c =================================================================== --- edit/libFileBuffer.c (revision 30) @@ -184,7 +248,68 @@ Index: edit/libFileBuffer.c + if ((FileSize >= 2) && (*((UINT16 *) Buffer) == EFI_UNICODE_BYTE_ORDER_MARK)) { // // Unicode file's size should be even - // + // +Index: hexedit/libEditor.c +=================================================================== +--- hexedit/libEditor.c (revision 30) ++++ hexedit/libEditor.c (working copy) +@@ -100,8 +100,6 @@ + --*/ + { + EFI_STATUS Status; +- EFI_HANDLE *HandleBuffer; +- UINTN HandleCount; + + // + // basic initialization +@@ -129,36 +127,19 @@ + &(HMainEditor.ScreenSize.Row) + ); + +- HandleBuffer = NULL; +- Status = LibLocateHandle ( +- ByProtocol, +- &gEfiPrimaryConsoleInDeviceGuid, +- NULL, +- &HandleCount, +- &HandleBuffer +- ); +- +- if (!EFI_ERROR (Status)) { +- +- if (HandleCount > 0) { +- Status = BS->HandleProtocol ( +- HandleBuffer[0], +- &gEfiSimplePointerProtocolGuid, +- &HMainEditor.MouseInterface +- ); +- if (EFI_ERROR (Status)) { +- HMainEditor.MouseInterface = NULL; +- } else { +- HMainEditor.MouseAccumulatorX = 0; +- HMainEditor.MouseAccumulatorY = 0; +- HMainEditor.MouseSupported = TRUE; +- } +- } ++ Status = BS->HandleProtocol ( ++ In, ++ &gEfiSimplePointerProtocolGuid, ++ &HMainEditor.MouseInterface ++ ); ++ if (EFI_ERROR (Status)) { ++ HMainEditor.MouseInterface = NULL; ++ } else { ++ HMainEditor.MouseAccumulatorX = 0; ++ HMainEditor.MouseAccumulatorY = 0; ++ HMainEditor.MouseSupported = TRUE; + } + +- if (HandleBuffer != NULL) { +- FreePool (HandleBuffer); +- } + // + // below will call the five components' init function + // Index: Library/EfiShellLib.h =================================================================== --- Library/EfiShellLib.h (revision 30) @@ -374,6 +499,176 @@ Index: shellenv/batch.c } else { *IsAscii = TRUE; } +Index: shellenv/Connect.c +=================================================================== +--- shellenv/Connect.c (revision 30) ++++ shellenv/Connect.c (working copy) +@@ -831,6 +831,16 @@ + return Status; + } + ++ // ++ // Close proxy console before disconnect all devices. ++ // ++ SEnvCloseConsoleProxy ( ++ ST->ConsoleInHandle, ++ &ST->ConIn, ++ ST->ConsoleOutHandle, ++ &ST->ConOut ++ ); ++ + for (Index = 0; Index < AllHandleCount; Index++) { + // + // Check whether the handle is still in handle database +@@ -1004,7 +1014,6 @@ + VOID + SEnvConnectConsole ( + CHAR16 *VariableName, +- EFI_GUID *PrimaryGuid, + EFI_GUID *ConsoleGuid, + EFI_HANDLE *ConsoleHandle, + VOID **ConsoleInterface +@@ -1018,9 +1027,8 @@ + EFI_HANDLE *AllHandleBuffer; + VOID *Interface; + +- *ConsoleHandle = NULL; +- *ConsoleInterface = NULL; + ConsoleIndex = 0; ++ AllHandleBuffer = NULL; + + DevicePath = LibGetVariable (VariableName, &gEfiGlobalVariableGuid); + if (DevicePath != NULL) { +@@ -1028,17 +1036,19 @@ + FreePool (DevicePath); + } + +- AllHandleBuffer = NULL; +- Status = BS->LocateHandleBuffer ( +- ByProtocol, +- PrimaryGuid, +- NULL, +- &AllHandleCount, +- &AllHandleBuffer +- ); +- if (!EFI_ERROR (Status) && AllHandleCount > 0) { +- *ConsoleHandle = AllHandleBuffer[0]; +- } else if (*ConsoleHandle == NULL) { ++ Status = EFI_NOT_FOUND; ++ // ++ // Check ConsoleHandle validation whatever it was updated or not. ++ // ++ if (*ConsoleHandle != NULL) { ++ Status = BS->HandleProtocol ( ++ *ConsoleHandle, ++ ConsoleGuid, ++ &Interface ++ ); ++ } ++ ++ if (EFI_ERROR (Status)) { + AllHandleBuffer = NULL; + Status = BS->LocateHandleBuffer ( + ByProtocol, +@@ -1063,16 +1073,16 @@ + &gEfiDevicePathProtocolGuid, + &Interface + ); +- if (EFI_ERROR (Status)) { ++ if (!EFI_ERROR (Status)) { + ConsoleIndex = Index; + break; + } + } ++ ++ *ConsoleHandle = AllHandleBuffer[ConsoleIndex]; + } + } + +- *ConsoleHandle = AllHandleBuffer[ConsoleIndex]; +- + if (*ConsoleHandle != NULL) { + BS->HandleProtocol ( + *ConsoleHandle, +@@ -1081,7 +1091,7 @@ + ); + } + +- if (AllHandleBuffer) { ++ if (AllHandleBuffer != NULL) { + FreePool (AllHandleBuffer); + } + } +@@ -1189,8 +1199,7 @@ + EFI_STATUS Status; + + // +- // Check current ConIn and ConOut to ensure it is the ConsoleProxy +- // Otherwise, the Console should not be close ++ // Check current ConIn and ConOut to judge it is the ConsoleProxy + // + Status = SEnvCheckConsoleProxy ( + ST->ConsoleInHandle, +@@ -1203,23 +1212,21 @@ + // Indicate the Console is replaced by redirection operation + // It is not safe to connect Console here + // +- if (EFI_ERROR (Status)) { +- return ; ++ if (!EFI_ERROR (Status)) { ++ // ++ // It is proxy console, to prevent the proxy console form being restored to original console, ++ // close it temporary before connect all console ++ // ++ SEnvCloseConsoleProxy ( ++ ST->ConsoleInHandle, ++ &ST->ConIn, ++ ST->ConsoleOutHandle, ++ &ST->ConOut ++ ); + } +- // +- // To prevent the proxy console form being restored to original console, +- // close it temporary before connect all console +- // +- SEnvCloseConsoleProxy ( +- ST->ConsoleInHandle, +- &ST->ConIn, +- ST->ConsoleOutHandle, +- &ST->ConOut +- ); + + SEnvConnectConsole ( + VarErrorOut, +- &gEfiPrimaryStandardErrorDeviceGuid, + &gEfiSimpleTextOutProtocolGuid, + &ST->StandardErrorHandle, + (VOID **) &ST->StdErr +@@ -1227,7 +1234,6 @@ + + SEnvConnectConsole ( + VarConsoleOut, +- &gEfiPrimaryConsoleOutDeviceGuid, + &gEfiSimpleTextOutProtocolGuid, + &ST->ConsoleOutHandle, + (VOID **) &ST->ConOut +@@ -1235,7 +1241,6 @@ + + SEnvConnectConsole ( + VarConsoleIn, +- &gEfiPrimaryConsoleInDeviceGuid, + &gEfiSimpleTextInProtocolGuid, + &ST->ConsoleInHandle, + (VOID **) &ST->ConIn +@@ -1254,6 +1259,8 @@ + SetCrc (&ST->Hdr); + } + ++ ++ + EFI_STATUS + EFIAPI + SEnvCmdReconnect ( Index: SmbiosView/PrintInfo.c =================================================================== --- SmbiosView/PrintInfo.c (revision 30)