X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FConsole%2FTerminalDxe%2FTerminal.c;h=a209bf3cacf8e729432c9677af42f5030ee5de94;hb=47b612db902fcdd133dc69b5db8d304f7498bd10;hp=5adaa9745f3e164d496b91a4817bf8fa5aade9ed;hpb=31ae446b1a039a55d0336f2201d77d1032533413;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index 5adaa9745f..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[] = { @@ -678,7 +680,7 @@ TerminalDriverBindingStart ( // if (FirstEnter) { // - // First enther the start funciton + // First enther the start function // FirstEnter = FALSE; // @@ -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 @@ -806,7 +812,7 @@ TerminalDriverBindingStart ( Status = TerminalDevice->SerialIo->SetAttributes ( TerminalDevice->SerialIo, Mode->BaudRate, - 0, // the device's default FIFO depth + Mode->ReceiveFifoDepth, (UINT32) SerialInTimeOut, (EFI_PARITY_TYPE) (Mode->Parity), (UINT8) Mode->DataBits, @@ -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) {