}\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
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
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
\r
ConsoleIn->IsSupportPartialKey = FALSE;\r
//\r
- // For reseting keyboard is not mandatory before booting OS and sometimes keyboard responses very slow,\r
+ // For resetting keyboard is not mandatory before booting OS and sometimes keyboard responses very slow,\r
// and to support KB hot plug, we need to let the InitKB succeed no matter whether there is a KB device connected\r
- // to system. So we only do the real reseting for keyboard when user asks and there is a real KB connected t system,\r
+ // to system. So we only do the real resetting for keyboard when user asks and there is a real KB connected t system,\r
// and normally during booting an OS, it's skipped.\r
//\r
if (ExtendedVerification && CheckKeyboardConnect (ConsoleIn)) {\r