X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FBus%2FIsa%2FPs2KeyboardDxe%2FPs2KbdCtrller.c;h=f92521046f5b51ac64f7065f53fdfc41eb424622;hp=4f064f76513a95bf12f7abd0158243c6884f580e;hb=3652f9902fc07c0d26bd1ce0492870b8de979809;hpb=4aa68cbc97e06d93a82189ade1317104f95535c1 diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c index 4f064f7651..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 @@ -1649,9 +1657,9 @@ InitKeyboard ( ConsoleIn->IsSupportPartialKey = FALSE; // - // For reseting keyboard is not mandatory before booting OS and sometimes keyboard responses very slow, + // For resetting keyboard is not mandatory before booting OS and sometimes keyboard responses very slow, // and to support KB hot plug, we need to let the InitKB succeed no matter whether there is a KB device connected - // to system. So we only do the real reseting for keyboard when user asks and there is a real KB connected t system, + // to system. So we only do the real resetting for keyboard when user asks and there is a real KB connected t system, // and normally during booting an OS, it's skipped. // if (ExtendedVerification && CheckKeyboardConnect (ConsoleIn)) {