]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
MdeModulePkg TerminalDxe: Execute key notify func at TPL_CALLBACK
[mirror_edk2.git] / MdeModulePkg / Universal / Console / TerminalDxe / Terminal.h
index 3ee396984e6a8a95374aa8e2190d561ddb637425..e16b89c264ce2a203d519c5c70fa5667e26227df 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Header file for Terminal driver.\r
 \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -95,6 +95,7 @@ typedef struct {
   RAW_DATA_FIFO                       *RawFiFo;\r
   UNICODE_FIFO                        *UnicodeFiFo;\r
   EFI_KEY_FIFO                        *EfiKeyFiFo;\r
+  EFI_KEY_FIFO                        *EfiKeyFiFoForNotify;\r
   EFI_UNICODE_STRING_TABLE            *ControllerNameTable;\r
   EFI_EVENT                           TimerEvent;\r
   EFI_EVENT                           TwoSecondTimeOut;\r
@@ -113,6 +114,7 @@ typedef struct {
   BOOLEAN                             OutputEscChar;\r
   EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL   SimpleInputEx;\r
   LIST_ENTRY                          NotifyList;\r
+  EFI_EVENT                           KeyNotifyProcessEvent;\r
 } TERMINAL_DEV;\r
 \r
 #define INPUT_STATE_DEFAULT               0x00\r
@@ -941,6 +943,67 @@ IsRawFiFoFull (
   TERMINAL_DEV  *TerminalDevice\r
   );\r
 \r
+/**\r
+  Insert one pre-fetched key into the FIFO buffer.\r
+\r
+  @param  EfiKeyFiFo            Pointer to instance of EFI_KEY_FIFO.\r
+  @param  Input                 The key will be input.\r
+\r
+  @retval TRUE                  If insert successfully.\r
+  @retval FALSE                 If FIFO buffer is full before key insertion,\r
+                                and the key is lost.\r
+\r
+**/\r
+BOOLEAN\r
+EfiKeyFiFoForNotifyInsertOneKey (\r
+  EFI_KEY_FIFO                  *EfiKeyFiFo,\r
+  EFI_INPUT_KEY                 *Input\r
+  );\r
+\r
+/**\r
+  Remove one pre-fetched key out of the FIFO buffer.\r
+\r
+  @param  EfiKeyFiFo            Pointer to instance of EFI_KEY_FIFO.\r
+  @param  Output                The key will be removed.\r
+\r
+  @retval TRUE                  If insert successfully.\r
+  @retval FALSE                 If FIFO buffer is empty before remove operation.\r
+\r
+**/\r
+BOOLEAN\r
+EfiKeyFiFoForNotifyRemoveOneKey (\r
+  EFI_KEY_FIFO                  *EfiKeyFiFo,\r
+  EFI_INPUT_KEY                 *Output\r
+  );\r
+\r
+/**\r
+  Clarify whether FIFO buffer is empty.\r
+\r
+  @param  EfiKeyFiFo            Pointer to instance of EFI_KEY_FIFO.\r
+\r
+  @retval TRUE                  If FIFO buffer is empty.\r
+  @retval FALSE                 If FIFO buffer is not empty.\r
+\r
+**/\r
+BOOLEAN\r
+IsEfiKeyFiFoForNotifyEmpty (\r
+  IN EFI_KEY_FIFO               *EfiKeyFiFo\r
+  );\r
+\r
+/**\r
+  Clarify whether FIFO buffer is full.\r
+\r
+  @param  EfiKeyFiFo            Pointer to instance of EFI_KEY_FIFO.\r
+\r
+  @retval TRUE                  If FIFO buffer is full.\r
+  @retval FALSE                 If FIFO buffer is not full.\r
+\r
+**/\r
+BOOLEAN\r
+IsEfiKeyFiFoForNotifyFull (\r
+  EFI_KEY_FIFO                  *EfiKeyFiFo\r
+  );\r
+\r
 /**\r
   Insert one pre-fetched key into the FIFO buffer.\r
 \r
@@ -1360,4 +1423,19 @@ TerminalConInTimerHandler (
   IN EFI_EVENT            Event,\r
   IN VOID                 *Context\r
   );\r
+\r
+\r
+/**\r
+  Process key notify.\r
+\r
+  @param  Event                 Indicates the event that invoke this function.\r
+  @param  Context               Indicates the calling context.\r
+**/\r
+VOID\r
+EFIAPI\r
+KeyNotifyProcessHandler (\r
+  IN  EFI_EVENT                 Event,\r
+  IN  VOID                      *Context\r
+  );\r
+\r
 #endif\r