]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
MdeModulePkg: Update comments in SimpleTextInEx according to UEFI 2.7
[mirror_edk2.git] / MdeModulePkg / Bus / Isa / Ps2KeyboardDxe / Ps2KbdCtrller.c
index eeb7de34abc8f3e233b8b82cf926562036541887..f92521046f5b51ac64f7065f53fdfc41eb424622 100644 (file)
@@ -1420,7 +1420,7 @@ KeyGetchar (
   }\r
 \r
   //\r
-  // Invoke notification functions if exist\r
+  // Signal KeyNotify process event if this key pressed matches any key registered.\r
   //\r
   for (Link = GetFirstNode (&ConsoleIn->NotifyList); !IsNull (&ConsoleIn->NotifyList, Link); Link = GetNextNode (&ConsoleIn->NotifyList, Link)) {\r
     CurrentNotify = CR (\r
@@ -1430,7 +1430,13 @@ KeyGetchar (
                       KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE\r
                       );\r
     if (IsKeyRegistered (&CurrentNotify->KeyData, &KeyData)) {\r
-      CurrentNotify->KeyNotificationFn (&KeyData);\r
+      //\r
+      // The key notification function needs to run at TPL_CALLBACK\r
+      // while current TPL is TPL_NOTIFY. It will be invoked in\r
+      // KeyNotifyProcessHandler() which runs at TPL_CALLBACK.\r
+      //\r
+      PushEfikeyBufTail (&ConsoleIn->EfiKeyQueueForNotify, &KeyData);\r
+      gBS->SignalEvent (ConsoleIn->KeyNotifyProcessEvent);\r
     }\r
   }\r
 \r
@@ -1629,6 +1635,8 @@ InitKeyboard (
   ConsoleIn->ScancodeQueue.Tail = 0;\r
   ConsoleIn->EfiKeyQueue.Head   = 0;\r
   ConsoleIn->EfiKeyQueue.Tail   = 0;\r
+  ConsoleIn->EfiKeyQueueForNotify.Head = 0;\r
+  ConsoleIn->EfiKeyQueueForNotify.Tail = 0;\r
 \r
   //\r
   // Reset the status indicators\r