]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
1. Fixed bugs in DxeNetLib to meet consistence with network module DriverBinding...
[mirror_edk2.git] / MdeModulePkg / Universal / Console / TerminalDxe / Terminal.h
CommitLineData
95276127 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 terminal.h\r
15\r
16Abstract:\r
17\r
18 \r
19Revision History\r
20\r
21--*/\r
22\r
23#ifndef _TERMINAL_H\r
24#define _TERMINAL_H\r
25\r
97a079ed
A
26\r
27#include <PiDxe.h>\r
28#include <Protocol/SimpleTextOut.h>\r
29#include <Protocol/SerialIo.h>\r
30#include <Guid/GlobalVariable.h>\r
31#include <Protocol/DevicePath.h>\r
32#include <Protocol/SimpleTextIn.h>\r
66aa04e4 33#include <Protocol/SimpleTextInEx.h>\r
97a079ed
A
34#include <Guid/HotPlugDevice.h>\r
35#include <Guid/PcAnsi.h>\r
36#include <Library/DebugLib.h>\r
37#include <Library/UefiDriverEntryPoint.h>\r
38#include <Library/UefiLib.h>\r
39#include <Library/ReportStatusCodeLib.h>\r
40#include <Library/BaseMemoryLib.h>\r
41#include <Library/MemoryAllocationLib.h>\r
42#include <Library/UefiBootServicesTableLib.h>\r
43#include <Library/UefiRuntimeServicesTableLib.h>\r
44#include <Library/DevicePathLib.h>\r
45#include <Library/PcdLib.h>\r
66aa04e4 46#include <Library/BaseLib.h>\r
97a079ed 47\r
95276127 48\r
49#define RAW_FIFO_MAX_NUMBER 256\r
50#define FIFO_MAX_NUMBER 128\r
51\r
52typedef struct {\r
53 UINT8 Head;\r
54 UINT8 Tail;\r
55 UINT8 Data[RAW_FIFO_MAX_NUMBER + 1];\r
56} RAW_DATA_FIFO;\r
57\r
58typedef struct {\r
59 UINT8 Head;\r
60 UINT8 Tail;\r
61 UINT16 Data[FIFO_MAX_NUMBER + 1];\r
62} UNICODE_FIFO;\r
63\r
64typedef struct {\r
65 UINT8 Head;\r
66 UINT8 Tail;\r
67 EFI_INPUT_KEY Data[FIFO_MAX_NUMBER + 1];\r
68} EFI_KEY_FIFO;\r
69\r
70#define TERMINAL_DEV_SIGNATURE EFI_SIGNATURE_32 ('t', 'm', 'n', 'l')\r
71\r
66aa04e4 72#define TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE EFI_SIGNATURE_32 ('t', 'm', 'e', 'n')\r
73\r
74typedef struct _TERMINAL_CONSOLE_IN_EX_NOTIFY {\r
75 UINTN Signature;\r
76 EFI_HANDLE NotifyHandle;\r
77 EFI_KEY_DATA KeyData;\r
78 EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;\r
79 LIST_ENTRY NotifyEntry;\r
80} TERMINAL_CONSOLE_IN_EX_NOTIFY;\r
95276127 81typedef struct {\r
82 UINTN Signature;\r
83 EFI_HANDLE Handle;\r
84 UINT8 TerminalType;\r
85 EFI_SERIAL_IO_PROTOCOL *SerialIo;\r
86 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
95276127 87 EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleInput;\r
88 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput;\r
89 EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode;\r
90 UINTN SerialInTimeOut;\r
91 RAW_DATA_FIFO RawFiFo;\r
92 UNICODE_FIFO UnicodeFiFo;\r
93 EFI_KEY_FIFO EfiKeyFiFo;\r
94 EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r
95 EFI_EVENT TwoSecondTimeOut;\r
96 UINT32 InputState;\r
6b88ceec 97 UINT32 ResetState;\r
95276127 98\r
99 //\r
100 // Esc could not be output to the screen by user,\r
101 // but the terminal driver need to output it to\r
102 // the terminal emulation software to send control sequence.\r
103 // This boolean is used by the terminal driver only\r
104 // to indicate whether the Esc could be sent or not.\r
105 //\r
6b88ceec 106 BOOLEAN OutputEscChar;\r
66aa04e4 107 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleInputEx;\r
108 LIST_ENTRY NotifyList;\r
95276127 109} TERMINAL_DEV;\r
110\r
111#define INPUT_STATE_DEFAULT 0x00\r
112#define INPUT_STATE_ESC 0x01\r
113#define INPUT_STATE_CSI 0x02\r
114#define INPUT_STATE_LEFTOPENBRACKET 0x04\r
115#define INPUT_STATE_O 0x08\r
116#define INPUT_STATE_2 0x10\r
117\r
118#define RESET_STATE_DEFAULT 0x00\r
119#define RESET_STATE_ESC_R 0x01\r
120#define RESET_STATE_ESC_R_ESC_r 0x02\r
121\r
122#define TERMINAL_CON_IN_DEV_FROM_THIS(a) CR (a, TERMINAL_DEV, SimpleInput, TERMINAL_DEV_SIGNATURE)\r
123#define TERMINAL_CON_OUT_DEV_FROM_THIS(a) CR (a, TERMINAL_DEV, SimpleTextOutput, TERMINAL_DEV_SIGNATURE)\r
66aa04e4 124#define TERMINAL_CON_IN_EX_DEV_FROM_THIS(a) CR (a, TERMINAL_DEV, SimpleInputEx, TERMINAL_DEV_SIGNATURE)\r
95276127 125\r
126typedef union {\r
127 UINT8 Utf8_1;\r
128 UINT8 Utf8_2[2];\r
129 UINT8 Utf8_3[3];\r
130} UTF8_CHAR;\r
131\r
132#define PcAnsiType 0\r
133#define VT100Type 1\r
134#define VT100PlusType 2\r
135#define VTUTF8Type 3\r
136\r
137#define LEFTOPENBRACKET 0x5b // '['\r
138#define ACAP 0x41\r
139#define BCAP 0x42\r
140#define CCAP 0x43\r
141#define DCAP 0x44\r
142\r
143#define MODE0_COLUMN_COUNT 80\r
144#define MODE0_ROW_COUNT 25\r
145\r
3012ce5c 146#define MODE1_COLUMN_COUNT 100\r
147#define MODE1_ROW_COUNT 31\r
95276127 148#define BACKSPACE 8\r
149#define ESC 27\r
150#define CSI 0x9B\r
151#define DEL 127\r
152#define BRIGHT_CONTROL_OFFSET 2\r
153#define FOREGROUND_CONTROL_OFFSET 6\r
154#define BACKGROUND_CONTROL_OFFSET 11\r
155#define ROW_OFFSET 2\r
156#define COLUMN_OFFSET 5\r
157\r
158typedef struct {\r
159 UINT16 Unicode;\r
160 CHAR8 PcAnsi;\r
161 CHAR8 Ascii;\r
162} UNICODE_TO_CHAR;\r
163\r
95276127 164//\r
165// Global Variables\r
166//\r
5bca971e 167extern EFI_DRIVER_BINDING_PROTOCOL gTerminalDriverBinding;\r
168extern EFI_COMPONENT_NAME_PROTOCOL gTerminalComponentName;\r
169extern EFI_COMPONENT_NAME2_PROTOCOL gTerminalComponentName2;\r
95276127 170\r
66aa04e4 171extern EFI_GUID gSimpleTextInExNotifyGuid;\r
95276127 172//\r
173// Prototypes\r
174//\r
175EFI_STATUS\r
176EFIAPI\r
177InitializeTerminal (\r
178 IN EFI_HANDLE ImageHandle,\r
179 IN EFI_SYSTEM_TABLE *SystemTable\r
180 )\r
181;\r
182\r
183EFI_STATUS\r
184EFIAPI\r
185TerminalConInReset (\r
186 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,\r
187 IN BOOLEAN ExtendedVerification\r
188 )\r
189;\r
190\r
191EFI_STATUS\r
192EFIAPI\r
193TerminalConInReadKeyStroke (\r
194 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,\r
195 OUT EFI_INPUT_KEY *Key\r
196 )\r
197;\r
198\r
66aa04e4 199\r
200BOOLEAN\r
201IsKeyRegistered (\r
202 IN EFI_KEY_DATA *RegsiteredData,\r
203 IN EFI_KEY_DATA *InputData\r
204 )\r
205/*++\r
206\r
207Routine Description:\r
208\r
209Arguments:\r
210\r
211 RegsiteredData - A pointer to a buffer that is filled in with the keystroke \r
212 state data for the key that was registered.\r
213 InputData - A pointer to a buffer that is filled in with the keystroke \r
214 state data for the key that was pressed.\r
215\r
216Returns:\r
217 TRUE - Key be pressed matches a registered key.\r
218 FLASE - Match failed. \r
219 \r
220--*/\r
221;\r
222\r
223VOID\r
224EFIAPI\r
225TerminalConInWaitForKeyEx (\r
226 IN EFI_EVENT Event,\r
227 IN VOID *Context\r
228 )\r
229; \r
230//\r
231// Simple Text Input Ex protocol prototypes\r
232//\r
233\r
234EFI_STATUS\r
235EFIAPI\r
236TerminalConInResetEx (\r
237 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
238 IN BOOLEAN ExtendedVerification\r
239 )\r
240/*++\r
241\r
242 Routine Description:\r
243 Reset the input device and optionaly run diagnostics\r
244\r
245 Arguments:\r
246 This - Protocol instance pointer.\r
247 ExtendedVerification - Driver may perform diagnostics on reset.\r
248\r
249 Returns:\r
250 EFI_SUCCESS - The device was reset.\r
251 EFI_DEVICE_ERROR - The device is not functioning properly and could \r
252 not be reset.\r
253\r
254--*/\r
255;\r
256\r
257EFI_STATUS\r
258EFIAPI\r
259TerminalConInReadKeyStrokeEx (\r
260 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
261 OUT EFI_KEY_DATA *KeyData\r
262 )\r
263/*++\r
264\r
265 Routine Description:\r
266 Reads the next keystroke from the input device. The WaitForKey Event can \r
267 be used to test for existance of a keystroke via WaitForEvent () call.\r
268\r
269 Arguments:\r
270 This - Protocol instance pointer.\r
271 KeyData - A pointer to a buffer that is filled in with the keystroke \r
272 state data for the key that was pressed.\r
273\r
274 Returns:\r
275 EFI_SUCCESS - The keystroke information was returned.\r
276 EFI_NOT_READY - There was no keystroke data availiable.\r
277 EFI_DEVICE_ERROR - The keystroke information was not returned due to \r
278 hardware errors.\r
279 EFI_INVALID_PARAMETER - KeyData is NULL. \r
280\r
281--*/\r
282;\r
283\r
284EFI_STATUS\r
285EFIAPI\r
286TerminalConInSetState (\r
287 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
288 IN EFI_KEY_TOGGLE_STATE *KeyToggleState\r
289 )\r
290/*++\r
291\r
292 Routine Description:\r
293 Set certain state for the input device.\r
294\r
295 Arguments:\r
296 This - Protocol instance pointer.\r
297 KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the \r
298 state for the input device.\r
299 \r
300 Returns: \r
301 EFI_SUCCESS - The device state was set successfully.\r
302 EFI_DEVICE_ERROR - The device is not functioning correctly and could \r
303 not have the setting adjusted.\r
304 EFI_UNSUPPORTED - The device does not have the ability to set its state.\r
305 EFI_INVALID_PARAMETER - KeyToggleState is NULL. \r
306\r
307--*/ \r
308;\r
309\r
310EFI_STATUS\r
311EFIAPI\r
312TerminalConInRegisterKeyNotify (\r
313 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
314 IN EFI_KEY_DATA *KeyData,\r
315 IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,\r
316 OUT EFI_HANDLE *NotifyHandle\r
317 )\r
318/*++\r
319\r
320 Routine Description:\r
321 Register a notification function for a particular keystroke for the input device.\r
322\r
323 Arguments:\r
324 This - Protocol instance pointer.\r
325 KeyData - A pointer to a buffer that is filled in with the keystroke \r
326 information data for the key that was pressed.\r
327 KeyNotificationFunction - Points to the function to be called when the key \r
328 sequence is typed specified by KeyData. \r
329 NotifyHandle - Points to the unique handle assigned to the registered notification. \r
330\r
331 Returns:\r
332 EFI_SUCCESS - The notification function was registered successfully.\r
333 EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.\r
334 EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL. \r
335 \r
336--*/ \r
337;\r
338\r
339EFI_STATUS\r
340EFIAPI\r
341TerminalConInUnregisterKeyNotify (\r
342 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
343 IN EFI_HANDLE NotificationHandle\r
344 )\r
345/*++\r
346\r
347 Routine Description:\r
348 Remove a registered notification function from a particular keystroke.\r
349\r
350 Arguments:\r
351 This - Protocol instance pointer. \r
352 NotificationHandle - The handle of the notification function being unregistered.\r
353\r
354 Returns:\r
355 EFI_SUCCESS - The notification function was unregistered successfully.\r
356 EFI_INVALID_PARAMETER - The NotificationHandle is invalid.\r
357 EFI_NOT_FOUND - Can not find the matching entry in database. \r
358 \r
359--*/ \r
360;\r
361\r
95276127 362VOID\r
363EFIAPI\r
364TerminalConInWaitForKey (\r
365 IN EFI_EVENT Event,\r
366 IN VOID *Context\r
367 )\r
368;\r
369\r
370EFI_STATUS\r
371EFIAPI\r
372TerminalConOutReset (\r
373 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
374 IN BOOLEAN ExtendedVerification\r
375 )\r
376;\r
377\r
378EFI_STATUS\r
379EFIAPI\r
380TerminalConOutOutputString (\r
381 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
382 IN CHAR16 *WString\r
383 )\r
384;\r
385\r
386EFI_STATUS\r
387EFIAPI\r
388TerminalConOutTestString (\r
389 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
390 IN CHAR16 *WString\r
391 )\r
392;\r
393\r
394EFI_STATUS\r
395EFIAPI\r
396TerminalConOutQueryMode (\r
397 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
398 IN UINTN ModeNumber,\r
399 OUT UINTN *Columns,\r
400 OUT UINTN *Rows\r
401 )\r
402;\r
403\r
404EFI_STATUS\r
405EFIAPI\r
406TerminalConOutSetMode (\r
407 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
408 IN UINTN ModeNumber\r
409 )\r
410;\r
411\r
412EFI_STATUS\r
413EFIAPI\r
414TerminalConOutSetAttribute (\r
415 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
416 IN UINTN Attribute\r
417 )\r
418;\r
419\r
420EFI_STATUS\r
421EFIAPI\r
422TerminalConOutClearScreen (\r
423 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This\r
424 )\r
425;\r
426\r
427EFI_STATUS\r
428EFIAPI\r
429TerminalConOutSetCursorPosition (\r
430 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
431 IN UINTN Column,\r
432 IN UINTN Row\r
433 )\r
434;\r
435\r
436EFI_STATUS\r
437EFIAPI\r
438TerminalConOutEnableCursor (\r
439 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
440 IN BOOLEAN Visible\r
441 )\r
442;\r
443\r
444EFI_STATUS\r
445EFIAPI\r
446TerminalDriverBindingSupported (\r
447 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
448 IN EFI_HANDLE Controller,\r
449 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
450 );\r
451\r
452EFI_STATUS\r
453EFIAPI\r
454TerminalDriverBindingStart (\r
455 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
456 IN EFI_HANDLE Controller,\r
457 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
458 );\r
459\r
460EFI_STATUS\r
461EFIAPI\r
462TerminalDriverBindingStop (\r
463 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
464 IN EFI_HANDLE Controller,\r
465 IN UINTN NumberOfChildren,\r
466 IN EFI_HANDLE *ChildHandleBuffer\r
467 );\r
468\r
5bca971e 469/**\r
470 Retrieves a Unicode string that is the user readable name of the driver.\r
471\r
472 This function retrieves the user readable name of a driver in the form of a\r
473 Unicode string. If the driver specified by This has a user readable name in\r
474 the language specified by Language, then a pointer to the driver name is\r
475 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
476 by This does not support the language specified by Language,\r
477 then EFI_UNSUPPORTED is returned.\r
478\r
479 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
480 EFI_COMPONENT_NAME_PROTOCOL instance.\r
481\r
482 @param Language[in] A pointer to a Null-terminated ASCII string\r
483 array indicating the language. This is the\r
484 language of the driver name that the caller is\r
485 requesting, and it must match one of the\r
486 languages specified in SupportedLanguages. The\r
487 number of languages supported by a driver is up\r
488 to the driver writer. Language is specified\r
489 in RFC 3066 or ISO 639-2 language code format.\r
490\r
491 @param DriverName[out] A pointer to the Unicode string to return.\r
492 This Unicode string is the name of the\r
493 driver specified by This in the language\r
494 specified by Language.\r
495\r
496 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
497 This and the language specified by Language was\r
498 returned in DriverName.\r
499\r
500 @retval EFI_INVALID_PARAMETER Language is NULL.\r
501\r
502 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
503\r
504 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
505 the language specified by Language.\r
506\r
507**/\r
95276127 508EFI_STATUS\r
509EFIAPI\r
510TerminalComponentNameGetDriverName (\r
511 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
512 IN CHAR8 *Language,\r
513 OUT CHAR16 **DriverName\r
514 );\r
515\r
5bca971e 516\r
517/**\r
518 Retrieves a Unicode string that is the user readable name of the controller\r
519 that is being managed by a driver.\r
520\r
521 This function retrieves the user readable name of the controller specified by\r
522 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
523 driver specified by This has a user readable name in the language specified by\r
524 Language, then a pointer to the controller name is returned in ControllerName,\r
525 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
526 managing the controller specified by ControllerHandle and ChildHandle,\r
527 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
528 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
529\r
530 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
531 EFI_COMPONENT_NAME_PROTOCOL instance.\r
532\r
533 @param ControllerHandle[in] The handle of a controller that the driver\r
534 specified by This is managing. This handle\r
535 specifies the controller whose name is to be\r
536 returned.\r
537\r
538 @param ChildHandle[in] The handle of the child controller to retrieve\r
539 the name of. This is an optional parameter that\r
540 may be NULL. It will be NULL for device\r
541 drivers. It will also be NULL for a bus drivers\r
542 that wish to retrieve the name of the bus\r
543 controller. It will not be NULL for a bus\r
544 driver that wishes to retrieve the name of a\r
545 child controller.\r
546\r
547 @param Language[in] A pointer to a Null-terminated ASCII string\r
548 array indicating the language. This is the\r
549 language of the driver name that the caller is\r
550 requesting, and it must match one of the\r
551 languages specified in SupportedLanguages. The\r
552 number of languages supported by a driver is up\r
553 to the driver writer. Language is specified in\r
554 RFC 3066 or ISO 639-2 language code format.\r
555\r
556 @param ControllerName[out] A pointer to the Unicode string to return.\r
557 This Unicode string is the name of the\r
558 controller specified by ControllerHandle and\r
559 ChildHandle in the language specified by\r
560 Language from the point of view of the driver\r
561 specified by This.\r
562\r
563 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
564 the language specified by Language for the\r
565 driver specified by This was returned in\r
566 DriverName.\r
567\r
568 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
569\r
570 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
571 EFI_HANDLE.\r
572\r
573 @retval EFI_INVALID_PARAMETER Language is NULL.\r
574\r
575 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
576\r
577 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
578 managing the controller specified by\r
579 ControllerHandle and ChildHandle.\r
580\r
581 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
582 the language specified by Language.\r
583\r
584**/\r
95276127 585EFI_STATUS\r
586EFIAPI\r
587TerminalComponentNameGetControllerName (\r
588 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
589 IN EFI_HANDLE ControllerHandle,\r
590 IN EFI_HANDLE ChildHandle OPTIONAL,\r
591 IN CHAR8 *Language,\r
592 OUT CHAR16 **ControllerName\r
593 );\r
594\r
5bca971e 595\r
95276127 596//\r
597// internal functions\r
598//\r
599EFI_STATUS\r
600TerminalConInCheckForKey (\r
601 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This\r
602 )\r
603;\r
604\r
605VOID\r
606TerminalUpdateConsoleDevVariable (\r
607 IN CHAR16 *VariableName,\r
608 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath\r
609 )\r
610;\r
611\r
612VOID\r
613TerminalRemoveConsoleDevVariable (\r
614 IN CHAR16 *VariableName,\r
615 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath\r
616 )\r
617;\r
618\r
619VOID *\r
620TerminalGetVariableAndSize (\r
621 IN CHAR16 *Name,\r
622 IN EFI_GUID *VendorGuid,\r
623 OUT UINTN *VariableSize\r
624 )\r
625;\r
626\r
627EFI_STATUS\r
628SetTerminalDevicePath (\r
629 IN UINT8 TerminalType,\r
630 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,\r
631 OUT EFI_DEVICE_PATH_PROTOCOL **TerminalDevicePath\r
632 )\r
633;\r
634\r
635VOID\r
636InitializeRawFiFo (\r
637 IN TERMINAL_DEV *TerminalDevice\r
638 )\r
639;\r
640\r
641VOID\r
642InitializeUnicodeFiFo (\r
643 IN TERMINAL_DEV *TerminalDevice\r
644 )\r
645;\r
646\r
647VOID\r
648InitializeEfiKeyFiFo (\r
649 IN TERMINAL_DEV *TerminalDevice\r
650 )\r
651;\r
652\r
653EFI_STATUS\r
654GetOneKeyFromSerial (\r
655 EFI_SERIAL_IO_PROTOCOL *SerialIo,\r
656 UINT8 *Input\r
657 )\r
658;\r
659\r
660BOOLEAN\r
661RawFiFoInsertOneKey (\r
662 TERMINAL_DEV *TerminalDevice,\r
663 UINT8 Input\r
664 )\r
665;\r
666\r
667BOOLEAN\r
668RawFiFoRemoveOneKey (\r
669 TERMINAL_DEV *TerminalDevice,\r
670 UINT8 *Output\r
671 )\r
672;\r
673\r
674BOOLEAN\r
675IsRawFiFoEmpty (\r
676 TERMINAL_DEV *TerminalDevice\r
677 )\r
678;\r
679\r
680BOOLEAN\r
681IsRawFiFoFull (\r
682 TERMINAL_DEV *TerminalDevice\r
683 )\r
684;\r
685\r
686BOOLEAN\r
687EfiKeyFiFoInsertOneKey (\r
688 TERMINAL_DEV *TerminalDevice,\r
689 EFI_INPUT_KEY Key\r
690 )\r
691;\r
692\r
693BOOLEAN\r
694EfiKeyFiFoRemoveOneKey (\r
695 TERMINAL_DEV *TerminalDevice,\r
696 EFI_INPUT_KEY *Output\r
697 )\r
698;\r
699\r
700BOOLEAN\r
701IsEfiKeyFiFoEmpty (\r
702 TERMINAL_DEV *TerminalDevice\r
703 )\r
704;\r
705\r
706BOOLEAN\r
707IsEfiKeyFiFoFull (\r
708 TERMINAL_DEV *TerminalDevice\r
709 )\r
710;\r
711\r
712BOOLEAN\r
713UnicodeFiFoInsertOneKey (\r
714 TERMINAL_DEV *TerminalDevice,\r
715 UINT16 Input\r
716 )\r
717;\r
718\r
719BOOLEAN\r
720UnicodeFiFoRemoveOneKey (\r
721 TERMINAL_DEV *TerminalDevice,\r
722 UINT16 *Output\r
723 )\r
724;\r
725\r
726BOOLEAN\r
727IsUnicodeFiFoEmpty (\r
728 TERMINAL_DEV *TerminalDevice\r
729 )\r
730;\r
731\r
732BOOLEAN\r
733IsUnicodeFiFoFull (\r
734 TERMINAL_DEV *TerminalDevice\r
735 )\r
736;\r
737\r
738UINT8\r
739UnicodeFiFoGetKeyCount (\r
740 TERMINAL_DEV *TerminalDevice\r
741 )\r
742;\r
743\r
744VOID\r
745TranslateRawDataToEfiKey (\r
746 IN TERMINAL_DEV *TerminalDevice\r
747 )\r
748;\r
749\r
750//\r
751// internal functions for PC ANSI\r
752//\r
753VOID\r
754AnsiRawDataToUnicode (\r
755 IN TERMINAL_DEV *PcAnsiDevice\r
756 )\r
757;\r
758\r
759VOID\r
760UnicodeToEfiKey (\r
761 IN TERMINAL_DEV *PcAnsiDevice\r
762 )\r
763;\r
764\r
765EFI_STATUS\r
766AnsiTestString (\r
767 IN TERMINAL_DEV *TerminalDevice,\r
768 IN CHAR16 *WString\r
769 )\r
770;\r
771\r
772//\r
773// internal functions for VT100\r
774//\r
775EFI_STATUS\r
776VT100TestString (\r
777 IN TERMINAL_DEV *VT100Device,\r
778 IN CHAR16 *WString\r
779 )\r
780;\r
781\r
782//\r
783// internal functions for VT100Plus\r
784//\r
785EFI_STATUS\r
786VT100PlusTestString (\r
787 IN TERMINAL_DEV *TerminalDevice,\r
788 IN CHAR16 *WString\r
789 )\r
790;\r
791\r
792//\r
793// internal functions for VTUTF8\r
794//\r
795VOID\r
796VTUTF8RawDataToUnicode (\r
797 IN TERMINAL_DEV *VtUtf8Device\r
798 )\r
799;\r
800\r
801EFI_STATUS\r
802VTUTF8TestString (\r
803 IN TERMINAL_DEV *TerminalDevice,\r
804 IN CHAR16 *WString\r
805 )\r
806;\r
807\r
808VOID\r
809UnicodeToUtf8 (\r
810 IN CHAR16 Unicode,\r
811 OUT UTF8_CHAR *Utf8Char,\r
812 OUT UINT8 *ValidBytes\r
813 )\r
814;\r
815\r
816VOID\r
817GetOneValidUtf8Char (\r
818 IN TERMINAL_DEV *Utf8Device,\r
819 OUT UTF8_CHAR *Utf8Char,\r
820 OUT UINT8 *ValidBytes\r
821 )\r
822;\r
823\r
824VOID\r
825Utf8ToUnicode (\r
826 IN UTF8_CHAR Utf8Char,\r
827 IN UINT8 ValidBytes,\r
828 OUT CHAR16 *UnicodeChar\r
829 )\r
830;\r
831\r
832//\r
833// functions for boxdraw unicode\r
834//\r
835BOOLEAN\r
836TerminalIsValidTextGraphics (\r
837 IN CHAR16 Graphic,\r
838 OUT CHAR8 *PcAnsi, OPTIONAL\r
839 OUT CHAR8 *Ascii OPTIONAL\r
840 )\r
841;\r
842\r
843BOOLEAN\r
844TerminalIsValidAscii (\r
845 IN CHAR16 Ascii\r
846 )\r
847;\r
848\r
849BOOLEAN\r
850TerminalIsValidEfiCntlChar (\r
851 IN CHAR16 CharC\r
852 )\r
853;\r
854\r
855#endif\r