38#define RAW_FIFO_MAX_NUMBER 255
39#define FIFO_MAX_NUMBER 128
44 UINT8 Data[RAW_FIFO_MAX_NUMBER + 1];
50 UINT16 Data[FIFO_MAX_NUMBER + 1];
64#define KEYBOARD_TIMER_INTERVAL 200000
66#define TERMINAL_DEV_SIGNATURE SIGNATURE_32 ('t', 'm', 'n', 'l')
68#define TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('t', 'm', 'e', 'n')
80 TerminalTypeVt100Plus,
99 UINTN SerialInTimeOut;
109 UINT16 TtyEscapeStr[3];
119 BOOLEAN OutputEscChar;
125#define INPUT_STATE_DEFAULT 0x00
126#define INPUT_STATE_ESC 0x01
127#define INPUT_STATE_CSI 0x02
128#define INPUT_STATE_LEFTOPENBRACKET 0x04
129#define INPUT_STATE_O 0x08
130#define INPUT_STATE_2 0x10
131#define INPUT_STATE_LEFTOPENBRACKET_TTY 0x20
132#define INPUT_STATE_1 0x40
133#define INPUT_STATE_LEFTOPENBRACKET_2ND 0x80
135#define RESET_STATE_DEFAULT 0x00
136#define RESET_STATE_ESC_R 0x01
137#define RESET_STATE_ESC_R_ESC_R 0x02
139#define TERMINAL_CON_IN_DEV_FROM_THIS(a) CR (a, TERMINAL_DEV, SimpleInput, TERMINAL_DEV_SIGNATURE)
140#define TERMINAL_CON_OUT_DEV_FROM_THIS(a) CR (a, TERMINAL_DEV, SimpleTextOutput, TERMINAL_DEV_SIGNATURE)
141#define TERMINAL_CON_IN_EX_DEV_FROM_THIS(a) CR (a, TERMINAL_DEV, SimpleInputEx, TERMINAL_DEV_SIGNATURE)
149#define LEFTOPENBRACKET 0x5b
159#define BRIGHT_CONTROL_OFFSET 2
160#define FOREGROUND_CONTROL_OFFSET 6
161#define BACKGROUND_CONTROL_OFFSET 11
163#define COLUMN_OFFSET 5
164#define FW_BACK_OFFSET 2
212 IN BOOLEAN ExtendedVerification
291 IN BOOLEAN ExtendedVerification
369 OUT VOID **NotifyHandle
389 IN VOID *NotificationHandle
426 IN BOOLEAN ExtendedVerification
724 OUT CHAR16 **DriverName
802 OUT CHAR16 **ControllerName
835 IN CHAR16 *VariableName,
848 IN CHAR16 *VariableName,
1319 OUT UINT8 *ValidBytes
1335 OUT UINT8 *ValidBytes
1356 IN UINT8 ValidBytes,
1357 OUT CHAR16 *UnicodeChar
1379 OUT CHAR8 *PcAnsi OPTIONAL,
1380 OUT CHAR8 *Ascii OPTIONAL
VOID EFIAPI Input(IN CHAR16 *Prompt OPTIONAL, OUT CHAR16 *InStr, IN UINTN StrLen)
UINT8 EFI_KEY_TOGGLE_STATE
EFI_STATUS(EFIAPI * EFI_KEY_NOTIFY_FUNCTION)(IN EFI_KEY_DATA *KeyData)
BOOLEAN IsHotPlugDevice(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_STATUS AnsiTestString(IN TERMINAL_DEV *TerminalDevice, IN CHAR16 *WString)
VOID AnsiRawDataToUnicode(IN TERMINAL_DEV *TerminalDevice)
EFI_STATUS EFIAPI TerminalConInReadKeyStrokeEx(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, OUT EFI_KEY_DATA *KeyData)
BOOLEAN TerminalIsValidAscii(IN CHAR16 Ascii)
VOID EFIAPI TerminalConInTimerHandler(IN EFI_EVENT Event, IN VOID *Context)
VOID TerminalRemoveConsoleDevVariable(IN CHAR16 *VariableName, IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath)
EFI_STATUS SetTerminalDevicePath(IN TERMINAL_TYPE TerminalType, IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **TerminalDevicePath)
EFI_STATUS EFIAPI TerminalConOutReset(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS EFIAPI TerminalConOutSetAttribute(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN Attribute)
VOID EFIAPI KeyNotifyProcessHandler(IN EFI_EVENT Event, IN VOID *Context)
BOOLEAN IsRawFiFoFull(TERMINAL_DEV *TerminalDevice)
EFI_STATUS EFIAPI TerminalConInReset(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS EFIAPI TerminalConOutTestString(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN CHAR16 *WString)
EFI_STATUS VTUTF8TestString(IN TERMINAL_DEV *TerminalDevice, IN CHAR16 *WString)
EFI_STATUS EFIAPI TerminalConInResetEx(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
BOOLEAN IsEfiKeyFiFoFull(TERMINAL_DEV *TerminalDevice)
EFI_STATUS EFIAPI TerminalConOutSetMode(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber)
VOID EFIAPI TerminalConInWaitForKey(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS GetOneKeyFromSerial(EFI_SERIAL_IO_PROTOCOL *SerialIo, UINT8 *Input)
BOOLEAN RawFiFoInsertOneKey(TERMINAL_DEV *TerminalDevice, UINT8 Input)
BOOLEAN EfiKeyFiFoForNotifyRemoveOneKey(EFI_KEY_FIFO *EfiKeyFiFo, EFI_INPUT_KEY *Output)
EFI_STATUS EFIAPI TerminalComponentNameGetControllerName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
BOOLEAN EfiKeyFiFoInsertOneKey(TERMINAL_DEV *TerminalDevice, EFI_INPUT_KEY *Key)
EFI_STATUS EFIAPI TerminalDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
VOID UnicodeToUtf8(IN CHAR16 Unicode, OUT UTF8_CHAR *Utf8Char, OUT UINT8 *ValidBytes)
EFI_STATUS EFIAPI TerminalConOutClearScreen(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This)
EFI_STATUS EFIAPI TerminalComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
EFI_STATUS EFIAPI InitializeTerminal(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI TerminalConInUnregisterKeyNotify(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN VOID *NotificationHandle)
BOOLEAN IsEfiKeyFiFoForNotifyFull(EFI_KEY_FIFO *EfiKeyFiFo)
BOOLEAN TerminalIsValidEfiCntlChar(IN CHAR16 CharC)
EFI_STATUS TerminalConInCheckForKey(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This)
BOOLEAN EfiKeyFiFoForNotifyInsertOneKey(EFI_KEY_FIFO *EfiKeyFiFo, EFI_INPUT_KEY *Input)
BOOLEAN IsUnicodeFiFoEmpty(TERMINAL_DEV *TerminalDevice)
VOID UnicodeToEfiKey(IN TERMINAL_DEV *TerminalDevice)
EFI_STATUS EFIAPI TerminalDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS TerminalFreeNotifyList(IN OUT LIST_ENTRY *ListHead)
BOOLEAN IsEfiKeyFiFoForNotifyEmpty(IN EFI_KEY_FIFO *EfiKeyFiFo)
EFI_STATUS EFIAPI TerminalConOutSetCursorPosition(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN Column, IN UINTN Row)
VOID Utf8ToUnicode(IN UTF8_CHAR Utf8Char, IN UINT8 ValidBytes, OUT CHAR16 *UnicodeChar)
BOOLEAN RawFiFoRemoveOneKey(TERMINAL_DEV *TerminalDevice, UINT8 *Output)
EFI_STATUS EFIAPI TerminalConInRegisterKeyNotify(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_DATA *KeyData, IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, OUT VOID **NotifyHandle)
VOID UnicodeFiFoRemoveOneKey(TERMINAL_DEV *TerminalDevice, UINT16 *Output)
VOID TerminalUpdateConsoleDevVariable(IN CHAR16 *VariableName, IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath)
BOOLEAN IsUnicodeFiFoFull(TERMINAL_DEV *TerminalDevice)
VOID GetOneValidUtf8Char(IN TERMINAL_DEV *Utf8Device, OUT UTF8_CHAR *Utf8Char, OUT UINT8 *ValidBytes)
EFI_STATUS EFIAPI TerminalConInReadKeyStroke(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, OUT EFI_INPUT_KEY *Key)
EFI_STATUS EFIAPI TerminalDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
VOID VTUTF8RawDataToUnicode(IN TERMINAL_DEV *VtUtf8Device)
BOOLEAN IsEfiKeyFiFoEmpty(TERMINAL_DEV *TerminalDevice)
BOOLEAN UnicodeFiFoInsertOneKey(TERMINAL_DEV *TerminalDevice, UINT16 Input)
EFI_STATUS EFIAPI TerminalConInSetState(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_TOGGLE_STATE *KeyToggleState)
EFI_STATUS EFIAPI TerminalConOutOutputString(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN CHAR16 *WString)
EFI_STATUS EFIAPI TerminalConOutEnableCursor(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN BOOLEAN Visible)
BOOLEAN IsRawFiFoEmpty(TERMINAL_DEV *TerminalDevice)
EFI_STATUS EFIAPI TerminalConOutQueryMode(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber, OUT UINTN *Columns, OUT UINTN *Rows)
BOOLEAN TerminalIsValidTextGraphics(IN CHAR16 Graphic, OUT CHAR8 *PcAnsi OPTIONAL, OUT CHAR8 *Ascii OPTIONAL)
VOID EFIAPI TerminalConInWaitForKeyEx(IN EFI_EVENT Event, IN VOID *Context)
BOOLEAN IsKeyRegistered(IN EFI_KEY_DATA *RegsiteredData, IN EFI_KEY_DATA *InputData)
BOOLEAN EfiKeyFiFoRemoveOneKey(TERMINAL_DEV *TerminalDevice, EFI_INPUT_KEY *Output)
VOID TranslateRawDataToEfiKey(IN TERMINAL_DEV *TerminalDevice)