MdeModulePkg UsbKbDxe: 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>
This commit is contained in:
Star Zeng
2016-12-16 17:16:22 +08:00
parent cf88579c10
commit 4ae46dbacd
3 changed files with 92 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
/** @file
Header file for USB Keyboard Driver's Data Structures.
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -114,6 +114,7 @@ typedef struct {
USB_SIMPLE_QUEUE UsbKeyQueue;
USB_SIMPLE_QUEUE EfiKeyQueue;
USB_SIMPLE_QUEUE EfiKeyQueueForNotify;
BOOLEAN CtrlOn;
BOOLEAN AltOn;
BOOLEAN ShiftOn;
@@ -149,6 +150,7 @@ typedef struct {
// Notification function list
//
LIST_ENTRY NotifyList;
EFI_EVENT KeyNotifyProcessEvent;
//
// Non-spacing key list
@@ -596,5 +598,18 @@ USBKeyboardTimerHandler (
IN VOID *Context
);
/**
Process key notify.
@param Event Indicates the event that invoke this function.
@param Context Indicates the calling context.
**/
VOID
EFIAPI
KeyNotifyProcessHandler (
IN EFI_EVENT Event,
IN VOID *Context
);
#endif