]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Avoid key notification called more than once
authorDandan Bi <dandan.bi@intel.com>
Sun, 9 Sep 2018 14:34:57 +0000 (22:34 +0800)
committerEric Dong <eric.dong@intel.com>
Fri, 14 Sep 2018 02:18:31 +0000 (10:18 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=996

Issue:
In current code logic, when a key is pressed, it will search
the whole NotifyList to find whether a notification has been
registered with the keystroke. if yes, it will en-queue the
key for notification execution later. And now if different
notification functions have been registered with the same key,
then the key will be en-queued more than once. Then it will
cause the notification executed more than once.

This patch is to enhance the code logic to fix this issue.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c

index 2ee293d64d1dd77286b3ac9b5b6dde78a8428183..53cb6f0b48895deec3cb10552e56edcbcf81a63a 100644 (file)
@@ -1451,6 +1451,7 @@ KeyGetchar (
       //\r
       PushEfikeyBufTail (&ConsoleIn->EfiKeyQueueForNotify, &KeyData);\r
       gBS->SignalEvent (ConsoleIn->KeyNotifyProcessEvent);\r
+      break;\r
     }\r
   }\r
 \r
index b3b5fb9ff4c49136dcd679f28357592054ee1c94..9cb4b5db6b69984dcb9bad9d2a038f783b78115b 100644 (file)
@@ -1695,6 +1695,7 @@ UsbKeyCodeToEfiInputKey (
       //\r
       Enqueue (&UsbKeyboardDevice->EfiKeyQueueForNotify, KeyData, sizeof (*KeyData));\r
       gBS->SignalEvent (UsbKeyboardDevice->KeyNotifyProcessEvent);\r
+      break;\r
     }\r
   }\r
 \r
index 33f9b6e5852a6e2ae2e29c721199388aa3d93646..d681a3039e642a8bf4597881d07fe7be776fa2f6 100644 (file)
@@ -987,6 +987,7 @@ EfiKeyFiFoInsertOneKey (
       //\r
       EfiKeyFiFoForNotifyInsertOneKey (TerminalDevice->EfiKeyFiFoForNotify, Key);\r
       gBS->SignalEvent (TerminalDevice->KeyNotifyProcessEvent);\r
+      break;\r
     }\r
   }\r
   if (IsEfiKeyFiFoFull (TerminalDevice)) {\r