MdeModulePkg TerminalDxe: Execute key notify func at TPL_CALLBACK
Current implementation executes key notify function in TimerHandler at TPL_NOTIFY. The code change is to make key notify function executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY. The code will signal KeyNotify process event if the key pressed matches any key registered and insert the KeyData to the EFI Key queue for notify, then the KeyNotify process handler will invoke key notify functions at TPL_CALLBACK. Cc: Ruiyu Ni <Ruiyu.ni@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
This commit is contained in:
@@ -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.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user