summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2016-12-19 22:21:11 +0800
committerStar Zeng <star.zeng@intel.com>2016-12-26 18:16:59 +0800
commit47b612db902fcdd133dc69b5db8d304f7498bd10 (patch)
tree7f84abce39b6bfb03570bfe1263283c911370a99 /MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
parent4ae46dbacd8b049c66714c3578a88ecc09dcec95 (diff)
downloadedk2-47b612db902fcdd133dc69b5db8d304f7498bd10.zip
edk2-47b612db902fcdd133dc69b5db8d304f7498bd10.tar.gz
edk2-47b612db902fcdd133dc69b5db8d304f7498bd10.tar.bz2
MdeModulePkg TerminalDxe: 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>
Diffstat (limited to 'MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h')
-rw-r--r--MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h80
1 files changed, 79 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
index 3ee3969..e16b89c 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
@@ -1,7 +1,7 @@
/** @file
Header file for Terminal driver.
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -95,6 +95,7 @@ typedef struct {
RAW_DATA_FIFO *RawFiFo;
UNICODE_FIFO *UnicodeFiFo;
EFI_KEY_FIFO *EfiKeyFiFo;
+ EFI_KEY_FIFO *EfiKeyFiFoForNotify;
EFI_UNICODE_STRING_TABLE *ControllerNameTable;
EFI_EVENT TimerEvent;
EFI_EVENT TwoSecondTimeOut;
@@ -113,6 +114,7 @@ typedef struct {
BOOLEAN OutputEscChar;
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleInputEx;
LIST_ENTRY NotifyList;
+ EFI_EVENT KeyNotifyProcessEvent;
} TERMINAL_DEV;
#define INPUT_STATE_DEFAULT 0x00
@@ -944,6 +946,67 @@ IsRawFiFoFull (
/**
Insert one pre-fetched key into the FIFO buffer.
+ @param EfiKeyFiFo Pointer to instance of EFI_KEY_FIFO.
+ @param Input The key will be input.
+
+ @retval TRUE If insert successfully.
+ @retval FALSE If FIFO buffer is full before key insertion,
+ and the key is lost.
+
+**/
+BOOLEAN
+EfiKeyFiFoForNotifyInsertOneKey (
+ EFI_KEY_FIFO *EfiKeyFiFo,
+ EFI_INPUT_KEY *Input
+ );
+
+/**
+ Remove one pre-fetched key out of the FIFO buffer.
+
+ @param EfiKeyFiFo Pointer to instance of EFI_KEY_FIFO.
+ @param Output The key will be removed.
+
+ @retval TRUE If insert successfully.
+ @retval FALSE If FIFO buffer is empty before remove operation.
+
+**/
+BOOLEAN
+EfiKeyFiFoForNotifyRemoveOneKey (
+ EFI_KEY_FIFO *EfiKeyFiFo,
+ EFI_INPUT_KEY *Output
+ );
+
+/**
+ Clarify whether FIFO buffer is empty.
+
+ @param EfiKeyFiFo Pointer to instance of EFI_KEY_FIFO.
+
+ @retval TRUE If FIFO buffer is empty.
+ @retval FALSE If FIFO buffer is not empty.
+
+**/
+BOOLEAN
+IsEfiKeyFiFoForNotifyEmpty (
+ IN EFI_KEY_FIFO *EfiKeyFiFo
+ );
+
+/**
+ Clarify whether FIFO buffer is full.
+
+ @param EfiKeyFiFo Pointer to instance of EFI_KEY_FIFO.
+
+ @retval TRUE If FIFO buffer is full.
+ @retval FALSE If FIFO buffer is not full.
+
+**/
+BOOLEAN
+IsEfiKeyFiFoForNotifyFull (
+ EFI_KEY_FIFO *EfiKeyFiFo
+ );
+
+/**
+ Insert one pre-fetched key into the FIFO buffer.
+
@param TerminalDevice Terminal driver private structure.
@param Key The key will be input.
@@ -1360,4 +1423,19 @@ TerminalConInTimerHandler (
IN EFI_EVENT Event,
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