X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FConsole%2FTerminalDxe%2FTerminal.c;h=a209bf3cacf8e729432c9677af42f5030ee5de94;hp=3f445f02721fce00b7ce82e88904bb2f6bda7336;hb=47b612db902fcdd133dc69b5db8d304f7498bd10;hpb=4ae46dbacd8b049c66714c3578a88ecc09dcec95 diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index 3f445f0272..a209bf3cac 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -2,7 +2,7 @@ Produces Simple Text Input Protocol, Simple Text Input Extended Protocol and Simple Text Output Protocol upon Serial IO Protocol. -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -75,6 +75,7 @@ TERMINAL_DEV mTerminalDevTemplate = { NULL, // RawFifo NULL, // UnicodeFiFo NULL, // EfiKeyFiFo + NULL, // EfiKeyFiFoForNotify NULL, // ControllerNameTable NULL, // TimerEvent @@ -99,7 +100,8 @@ TERMINAL_DEV mTerminalDevTemplate = { { // NotifyList NULL, NULL, - } + }, + NULL // KeyNotifyProcessEvent }; TERMINAL_CONSOLE_MODE_DATA mTerminalConsoleModeData[] = { @@ -791,6 +793,10 @@ TerminalDriverBindingStart ( if (TerminalDevice->EfiKeyFiFo == NULL) { goto Error; } + TerminalDevice->EfiKeyFiFoForNotify = AllocateZeroPool (sizeof (EFI_KEY_FIFO)); + if (TerminalDevice->EfiKeyFiFoForNotify == NULL) { + goto Error; + } // // Set the timeout value of serial buffer for @@ -1000,6 +1006,15 @@ TerminalDriverBindingStart ( ); ASSERT_EFI_ERROR (Status); + Status = gBS->CreateEvent ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + KeyNotifyProcessHandler, + TerminalDevice, + &TerminalDevice->KeyNotifyProcessEvent + ); + ASSERT_EFI_ERROR (Status); + Status = gBS->InstallProtocolInterface ( &TerminalDevice->Handle, &gEfiDevicePathProtocolGuid, @@ -1222,7 +1237,10 @@ Error: if (TerminalDevice->EfiKeyFiFo != NULL) { FreePool (TerminalDevice->EfiKeyFiFo); } - + if (TerminalDevice->EfiKeyFiFoForNotify != NULL) { + FreePool (TerminalDevice->EfiKeyFiFoForNotify); + } + if (TerminalDevice->ControllerNameTable != NULL) { FreeUnicodeStringTable (TerminalDevice->ControllerNameTable); } @@ -1400,6 +1418,7 @@ TerminalDriverBindingStop ( gBS->CloseEvent (TerminalDevice->TwoSecondTimeOut); gBS->CloseEvent (TerminalDevice->SimpleInput.WaitForKey); gBS->CloseEvent (TerminalDevice->SimpleInputEx.WaitForKeyEx); + gBS->CloseEvent (TerminalDevice->KeyNotifyProcessEvent); TerminalFreeNotifyList (&TerminalDevice->NotifyList); FreePool (TerminalDevice->DevicePath); if (TerminalDevice->TerminalConsoleModeData != NULL) {