]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
Fix the terminal driver to call hotkey callback even no one is calling ReadKeyStroke
[mirror_edk2.git] / MdeModulePkg / Universal / Console / TerminalDxe / Terminal.h
index ac8ddca875058eec7d72d3b6b238c10a0ee9da2b..fd42138a71241edcbf21ae50e17a1821e907911c 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Header file for Terminal driver.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2011, Intel Corporation. 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
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -61,6 +61,8 @@ typedef struct {
   EFI_INPUT_KEY Data[FIFO_MAX_NUMBER + 1];\r
 } EFI_KEY_FIFO;\r
 \r
+#define KEYBOARD_TIMER_INTERVAL         200000  // 0.02s\r
+\r
 #define TERMINAL_DEV_SIGNATURE  SIGNATURE_32 ('t', 'm', 'n', 'l')\r
 \r
 #define TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('t', 'm', 'e', 'n')\r
@@ -86,6 +88,7 @@ typedef struct {
   UNICODE_FIFO                        *UnicodeFiFo;\r
   EFI_KEY_FIFO                        *EfiKeyFiFo;\r
   EFI_UNICODE_STRING_TABLE            *ControllerNameTable;\r
+  EFI_EVENT                           TimerEvent;\r
   EFI_EVENT                           TwoSecondTimeOut;\r
   UINT32                              InputState;\r
   UINT32                              ResetState;\r
@@ -143,6 +146,12 @@ typedef union {
 #define MODE2_COLUMN_COUNT        100\r
 #define MODE2_ROW_COUNT           31\r
 \r
+//\r
+// MODE3 is defined by PcdConOutColumn & PcdConOutRow\r
+//\r
+\r
+#define TERMINAL_MAX_MODE 4\r
+\r
 #define BACKSPACE                 8\r
 #define ESC                       27\r
 #define CSI                       0x9B\r
@@ -836,26 +845,6 @@ TerminalRemoveConsoleDevVariable (
   IN EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath\r
   );\r
 \r
-/**\r
-  Read the EFI variable (VendorGuid/Name) and return a dynamically allocated\r
-  buffer, and the size of the buffer. On failure return NULL.\r
-\r
-  @param  Name                   String part of EFI variable name\r
-  @param  VendorGuid             GUID part of EFI variable name\r
-  @param  VariableSize           Returns the size of the EFI variable that was read\r
-\r
-  @return Dynamically allocated memory that contains a copy of the EFI variable.\r
-          Caller is repsoncible freeing the buffer. If variable was not read,\r
-          NULL regturned.\r
-\r
-**/\r
-VOID *\r
-TerminalGetVariableAndSize (\r
-  IN  CHAR16              *Name,\r
-  IN  EFI_GUID            *VendorGuid,\r
-  OUT UINTN               *VariableSize\r
-  );\r
-\r
 /**\r
   Build termial device path according to terminal type.\r
 \r
@@ -968,7 +957,7 @@ IsRawFiFoFull (
 BOOLEAN\r
 EfiKeyFiFoInsertOneKey (\r
   TERMINAL_DEV      *TerminalDevice,\r
-  EFI_INPUT_KEY     Key\r
+  EFI_INPUT_KEY     *Key\r
   );\r
 \r
 /**\r
@@ -1362,4 +1351,16 @@ IsHotPlugDevice (
   IN  EFI_DEVICE_PATH_PROTOCOL    *DevicePath\r
   );\r
 \r
+/**\r
+  Timer handler to poll the key from serial.\r
+\r
+  @param  Event                    Indicates the event that invoke this function.\r
+  @param  Context                  Indicates the calling context.\r
+**/\r
+VOID\r
+EFIAPI\r
+TerminalConInTimerHandler (\r
+  IN EFI_EVENT            Event,\r
+  IN VOID                 *Context\r
+  );\r
 #endif\r