summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2016-12-16 18:08:18 +0800
committerStar Zeng <star.zeng@intel.com>2016-12-26 18:17:00 +0800
commit35dadd7c54ef12c87672c5eea35a75fa545ce68e (patch)
tree0aaba9ac05cc11eeefe28c421e0bf8bd68acf1d0 /MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
parent47b612db902fcdd133dc69b5db8d304f7498bd10 (diff)
downloadedk2-35dadd7c54ef12c87672c5eea35a75fa545ce68e.tar.gz
edk2-35dadd7c54ef12c87672c5eea35a75fa545ce68e.tar.bz2
edk2-35dadd7c54ef12c87672c5eea35a75fa545ce68e.zip
MdeModulePkg Ps2KbDxe: 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>
Diffstat (limited to 'MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c')
-rw-r--r--MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
index eeb7de34ab..f92521046f 100644
--- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
+++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
@@ -1420,7 +1420,7 @@ KeyGetchar (
}
//
- // Invoke notification functions if exist
+ // Signal KeyNotify process event if this key pressed matches any key registered.
//
for (Link = GetFirstNode (&ConsoleIn->NotifyList); !IsNull (&ConsoleIn->NotifyList, Link); Link = GetNextNode (&ConsoleIn->NotifyList, Link)) {
CurrentNotify = CR (
@@ -1430,7 +1430,13 @@ KeyGetchar (
KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE
);
if (IsKeyRegistered (&CurrentNotify->KeyData, &KeyData)) {
- CurrentNotify->KeyNotificationFn (&KeyData);
+ //
+ // The key notification function needs to run at TPL_CALLBACK
+ // while current TPL is TPL_NOTIFY. It will be invoked in
+ // KeyNotifyProcessHandler() which runs at TPL_CALLBACK.
+ //
+ PushEfikeyBufTail (&ConsoleIn->EfiKeyQueueForNotify, &KeyData);
+ gBS->SignalEvent (ConsoleIn->KeyNotifyProcessEvent);
}
}
@@ -1629,6 +1635,8 @@ InitKeyboard (
ConsoleIn->ScancodeQueue.Tail = 0;
ConsoleIn->EfiKeyQueue.Head = 0;
ConsoleIn->EfiKeyQueue.Tail = 0;
+ ConsoleIn->EfiKeyQueueForNotify.Head = 0;
+ ConsoleIn->EfiKeyQueueForNotify.Tail = 0;
//
// Reset the status indicators