From 06fb8ffd0771d95b3f8797c30bf8e620eddd1e23 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Mon, 4 Jun 2007 09:36:42 +0000 Subject: MdePkg: 1. Add AcpiTable & ComponentName2 Protocol definitions. 2. Add HardwareErrorVariable GUID definition. EdkModulePkg: 1. Update DxeCore to let InsatllConfigurationTable() signal the event group whenever a table entry is inserted, modified or deleted. 2. Update ConPlatform to let Simple Text In and Out not share a stop function . git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2625 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/ConPlatform/Dxe/ConPlatform.c | 94 +++++++++++++++++----- .../Universal/ConPlatform/Dxe/ConPlatform.h | 11 ++- 2 files changed, 85 insertions(+), 20 deletions(-) (limited to 'EdkModulePkg/Universal/ConPlatform') diff --git a/EdkModulePkg/Universal/ConPlatform/Dxe/ConPlatform.c b/EdkModulePkg/Universal/ConPlatform/Dxe/ConPlatform.c index 15e7693d1d..1972e0c6aa 100644 --- a/EdkModulePkg/Universal/ConPlatform/Dxe/ConPlatform.c +++ b/EdkModulePkg/Universal/ConPlatform/Dxe/ConPlatform.c @@ -22,7 +22,7 @@ Abstract: EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextInDriverBinding = { ConPlatformTextInDriverBindingSupported, ConPlatformTextInDriverBindingStart, - ConPlatformDriverBindingStop, + ConPlatformTextInDriverBindingStop, 0xa, NULL, NULL @@ -31,7 +31,7 @@ EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextInDriverBinding = { EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextOutDriverBinding = { ConPlatformTextOutDriverBindingSupported, ConPlatformTextOutDriverBindingStart, - ConPlatformDriverBindingStop, + ConPlatformTextOutDriverBindingStop, 0xa, NULL, NULL @@ -287,7 +287,6 @@ Returns: EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DevicePath; EFI_SIMPLE_TEXT_OUT_PROTOCOL *TextOut; - BOOLEAN NeedClose; NeedClose = TRUE; @@ -360,6 +359,7 @@ Returns: DevicePath, CHECK ); + if (!EFI_ERROR (Status)) { NeedClose = FALSE; Status = gBS->InstallMultipleProtocolInterfaces ( @@ -403,7 +403,7 @@ Returns: EFI_STATUS EFIAPI -ConPlatformDriverBindingStop ( +ConPlatformTextInDriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, @@ -443,13 +443,81 @@ Returns: ); if (!EFI_ERROR (Status)) { // - // Remove DevicePath from ConInDev, ConOutDev, and StdErrDev + // Remove DevicePath from ConInDev // ConPlatformUpdateDeviceVariable ( VarConsoleInpDev, DevicePath, DELETE ); + } + } + // + // Uninstall the Console Device GUIDs from Controller Handle + // + ConPlatformUnInstallProtocol ( + This, + ControllerHandle, + &gEfiConsoleInDeviceGuid + ); + + // + // Close the Simple Input Protocol + // + gBS->CloseProtocol ( + ControllerHandle, + &gEfiSimpleTextInProtocolGuid, + This->DriverBindingHandle, + ControllerHandle + ); + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +ConPlatformTextOutDriverBindingStop ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer + ) +/*++ + +Routine Description: + +Arguments: + (Standard DriverBinding Protocol Stop() function) + +Returns: + + None + +--*/ +{ + EFI_STATUS Status; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + + // + // hot plug device is not included into the console associated variables, + // so no need to check variable for those hot plug devices. + // + if (!IsHotPlugDevice (This->DriverBindingHandle, ControllerHandle)) { + // + // Get the Device Path Protocol so the environment variables can be updated + // + Status = gBS->OpenProtocol ( + ControllerHandle, + &gEfiDevicePathProtocolGuid, + (VOID **) &DevicePath, + This->DriverBindingHandle, + ControllerHandle, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (!EFI_ERROR (Status)) { + // + // Remove DevicePath from ConOutDev, and StdErrDev + // ConPlatformUpdateDeviceVariable ( VarConsoleOutDev, DevicePath, @@ -465,12 +533,6 @@ Returns: // // Uninstall the Console Device GUIDs from Controller Handle // - ConPlatformUnInstallProtocol ( - This, - ControllerHandle, - &gEfiConsoleInDeviceGuid - ); - ConPlatformUnInstallProtocol ( This, ControllerHandle, @@ -484,15 +546,8 @@ Returns: ); // - // Close the Simple Input and Simple Text Output Protocols + // Close the Simple Text Output Protocol // - gBS->CloseProtocol ( - ControllerHandle, - &gEfiSimpleTextInProtocolGuid, - This->DriverBindingHandle, - ControllerHandle - ); - gBS->CloseProtocol ( ControllerHandle, &gEfiSimpleTextOutProtocolGuid, @@ -503,6 +558,7 @@ Returns: return EFI_SUCCESS; } + VOID ConPlatformUnInstallProtocol ( IN EFI_DRIVER_BINDING_PROTOCOL *This, diff --git a/EdkModulePkg/Universal/ConPlatform/Dxe/ConPlatform.h b/EdkModulePkg/Universal/ConPlatform/Dxe/ConPlatform.h index cedda9e0d1..c14a5ed16e 100644 --- a/EdkModulePkg/Universal/ConPlatform/Dxe/ConPlatform.h +++ b/EdkModulePkg/Universal/ConPlatform/Dxe/ConPlatform.h @@ -75,7 +75,16 @@ ConPlatformTextOutDriverBindingStart ( EFI_STATUS EFIAPI -ConPlatformDriverBindingStop ( +ConPlatformTextInDriverBindingStop ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE Handle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer + ); + +EFI_STATUS +EFIAPI +ConPlatformTextOutDriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Handle, IN UINTN NumberOfChildren, -- cgit v1.2.3