]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
Add some function/header comments.
[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
7347d5d6 146#define MODE1_COLUMN_COUNT 80\r
147#define MODE1_ROW_COUNT 50\r
148\r
149#define MODE2_COLUMN_COUNT 100\r
150#define MODE2_ROW_COUNT 31\r
151\r
95276127 152#define BACKSPACE 8\r
153#define ESC 27\r
154#define CSI 0x9B\r
155#define DEL 127\r
156#define BRIGHT_CONTROL_OFFSET 2\r
157#define FOREGROUND_CONTROL_OFFSET 6\r
158#define BACKGROUND_CONTROL_OFFSET 11\r
159#define ROW_OFFSET 2\r
160#define COLUMN_OFFSET 5\r
161\r
162typedef struct {\r
163 UINT16 Unicode;\r
164 CHAR8 PcAnsi;\r
165 CHAR8 Ascii;\r
166} UNICODE_TO_CHAR;\r
167\r
95276127 168//\r
169// Global Variables\r
170//\r
5bca971e 171extern EFI_DRIVER_BINDING_PROTOCOL gTerminalDriverBinding;\r
172extern EFI_COMPONENT_NAME_PROTOCOL gTerminalComponentName;\r
173extern EFI_COMPONENT_NAME2_PROTOCOL gTerminalComponentName2;\r
95276127 174\r
66aa04e4 175extern EFI_GUID gSimpleTextInExNotifyGuid;\r
95276127 176//\r
177// Prototypes\r
178//\r
179EFI_STATUS\r
180EFIAPI\r
181InitializeTerminal (\r
182 IN EFI_HANDLE ImageHandle,\r
183 IN EFI_SYSTEM_TABLE *SystemTable\r
184 )\r
185;\r
186\r
187EFI_STATUS\r
188EFIAPI\r
189TerminalConInReset (\r
190 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,\r
191 IN BOOLEAN ExtendedVerification\r
192 )\r
193;\r
194\r
195EFI_STATUS\r
196EFIAPI\r
197TerminalConInReadKeyStroke (\r
198 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,\r
199 OUT EFI_INPUT_KEY *Key\r
200 )\r
201;\r
202\r
66aa04e4 203\r
204BOOLEAN\r
205IsKeyRegistered (\r
206 IN EFI_KEY_DATA *RegsiteredData,\r
207 IN EFI_KEY_DATA *InputData\r
208 )\r
209/*++\r
210\r
211Routine Description:\r
212\r
213Arguments:\r
214\r
215 RegsiteredData - A pointer to a buffer that is filled in with the keystroke \r
216 state data for the key that was registered.\r
217 InputData - A pointer to a buffer that is filled in with the keystroke \r
218 state data for the key that was pressed.\r
219\r
220Returns:\r
221 TRUE - Key be pressed matches a registered key.\r
222 FLASE - Match failed. \r
223 \r
224--*/\r
225;\r
226\r
227VOID\r
228EFIAPI\r
229TerminalConInWaitForKeyEx (\r
230 IN EFI_EVENT Event,\r
231 IN VOID *Context\r
232 )\r
233; \r
234//\r
235// Simple Text Input Ex protocol prototypes\r
236//\r
237\r
238EFI_STATUS\r
239EFIAPI\r
240TerminalConInResetEx (\r
241 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
242 IN BOOLEAN ExtendedVerification\r
243 )\r
244/*++\r
245\r
246 Routine Description:\r
247 Reset the input device and optionaly run diagnostics\r
248\r
249 Arguments:\r
250 This - Protocol instance pointer.\r
251 ExtendedVerification - Driver may perform diagnostics on reset.\r
252\r
253 Returns:\r
254 EFI_SUCCESS - The device was reset.\r
255 EFI_DEVICE_ERROR - The device is not functioning properly and could \r
256 not be reset.\r
257\r
258--*/\r
259;\r
260\r
261EFI_STATUS\r
262EFIAPI\r
263TerminalConInReadKeyStrokeEx (\r
264 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
265 OUT EFI_KEY_DATA *KeyData\r
266 )\r
267/*++\r
268\r
269 Routine Description:\r
270 Reads the next keystroke from the input device. The WaitForKey Event can \r
271 be used to test for existance of a keystroke via WaitForEvent () call.\r
272\r
273 Arguments:\r
274 This - Protocol instance pointer.\r
275 KeyData - A pointer to a buffer that is filled in with the keystroke \r
276 state data for the key that was pressed.\r
277\r
278 Returns:\r
279 EFI_SUCCESS - The keystroke information was returned.\r
280 EFI_NOT_READY - There was no keystroke data availiable.\r
281 EFI_DEVICE_ERROR - The keystroke information was not returned due to \r
282 hardware errors.\r
283 EFI_INVALID_PARAMETER - KeyData is NULL. \r
284\r
285--*/\r
286;\r
287\r
288EFI_STATUS\r
289EFIAPI\r
290TerminalConInSetState (\r
291 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
292 IN EFI_KEY_TOGGLE_STATE *KeyToggleState\r
293 )\r
294/*++\r
295\r
296 Routine Description:\r
297 Set certain state for the input device.\r
298\r
299 Arguments:\r
300 This - Protocol instance pointer.\r
301 KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the \r
302 state for the input device.\r
303 \r
304 Returns: \r
305 EFI_SUCCESS - The device state was set successfully.\r
306 EFI_DEVICE_ERROR - The device is not functioning correctly and could \r
307 not have the setting adjusted.\r
308 EFI_UNSUPPORTED - The device does not have the ability to set its state.\r
309 EFI_INVALID_PARAMETER - KeyToggleState is NULL. \r
310\r
311--*/ \r
312;\r
313\r
314EFI_STATUS\r
315EFIAPI\r
316TerminalConInRegisterKeyNotify (\r
317 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
318 IN EFI_KEY_DATA *KeyData,\r
319 IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,\r
320 OUT EFI_HANDLE *NotifyHandle\r
321 )\r
322/*++\r
323\r
324 Routine Description:\r
325 Register a notification function for a particular keystroke for the input device.\r
326\r
327 Arguments:\r
328 This - Protocol instance pointer.\r
329 KeyData - A pointer to a buffer that is filled in with the keystroke \r
330 information data for the key that was pressed.\r
331 KeyNotificationFunction - Points to the function to be called when the key \r
332 sequence is typed specified by KeyData. \r
333 NotifyHandle - Points to the unique handle assigned to the registered notification. \r
334\r
335 Returns:\r
336 EFI_SUCCESS - The notification function was registered successfully.\r
337 EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.\r
338 EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL. \r
339 \r
340--*/ \r
341;\r
342\r
343EFI_STATUS\r
344EFIAPI\r
345TerminalConInUnregisterKeyNotify (\r
346 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
347 IN EFI_HANDLE NotificationHandle\r
348 )\r
349/*++\r
350\r
351 Routine Description:\r
352 Remove a registered notification function from a particular keystroke.\r
353\r
354 Arguments:\r
355 This - Protocol instance pointer. \r
356 NotificationHandle - The handle of the notification function being unregistered.\r
357\r
358 Returns:\r
359 EFI_SUCCESS - The notification function was unregistered successfully.\r
360 EFI_INVALID_PARAMETER - The NotificationHandle is invalid.\r
361 EFI_NOT_FOUND - Can not find the matching entry in database. \r
362 \r
363--*/ \r
364;\r
365\r
95276127 366VOID\r
367EFIAPI\r
368TerminalConInWaitForKey (\r
369 IN EFI_EVENT Event,\r
370 IN VOID *Context\r
371 )\r
372;\r
373\r
374EFI_STATUS\r
375EFIAPI\r
376TerminalConOutReset (\r
377 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
378 IN BOOLEAN ExtendedVerification\r
379 )\r
380;\r
381\r
382EFI_STATUS\r
383EFIAPI\r
384TerminalConOutOutputString (\r
385 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
386 IN CHAR16 *WString\r
387 )\r
388;\r
389\r
390EFI_STATUS\r
391EFIAPI\r
392TerminalConOutTestString (\r
393 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
394 IN CHAR16 *WString\r
395 )\r
396;\r
397\r
398EFI_STATUS\r
399EFIAPI\r
400TerminalConOutQueryMode (\r
401 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
402 IN UINTN ModeNumber,\r
403 OUT UINTN *Columns,\r
404 OUT UINTN *Rows\r
405 )\r
406;\r
407\r
408EFI_STATUS\r
409EFIAPI\r
410TerminalConOutSetMode (\r
411 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
412 IN UINTN ModeNumber\r
413 )\r
414;\r
415\r
416EFI_STATUS\r
417EFIAPI\r
418TerminalConOutSetAttribute (\r
419 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
420 IN UINTN Attribute\r
421 )\r
422;\r
423\r
424EFI_STATUS\r
425EFIAPI\r
426TerminalConOutClearScreen (\r
427 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This\r
428 )\r
429;\r
430\r
431EFI_STATUS\r
432EFIAPI\r
433TerminalConOutSetCursorPosition (\r
434 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
435 IN UINTN Column,\r
436 IN UINTN Row\r
437 )\r
438;\r
439\r
440EFI_STATUS\r
441EFIAPI\r
442TerminalConOutEnableCursor (\r
443 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
444 IN BOOLEAN Visible\r
445 )\r
446;\r
447\r
448EFI_STATUS\r
449EFIAPI\r
450TerminalDriverBindingSupported (\r
451 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
452 IN EFI_HANDLE Controller,\r
453 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
454 );\r
455\r
456EFI_STATUS\r
457EFIAPI\r
458TerminalDriverBindingStart (\r
459 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
460 IN EFI_HANDLE Controller,\r
461 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
462 );\r
463\r
464EFI_STATUS\r
465EFIAPI\r
466TerminalDriverBindingStop (\r
467 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
468 IN EFI_HANDLE Controller,\r
469 IN UINTN NumberOfChildren,\r
470 IN EFI_HANDLE *ChildHandleBuffer\r
471 );\r
472\r
5bca971e 473/**\r
474 Retrieves a Unicode string that is the user readable name of the driver.\r
475\r
476 This function retrieves the user readable name of a driver in the form of a\r
477 Unicode string. If the driver specified by This has a user readable name in\r
478 the language specified by Language, then a pointer to the driver name is\r
479 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
480 by This does not support the language specified by Language,\r
481 then EFI_UNSUPPORTED is returned.\r
482\r
483 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
484 EFI_COMPONENT_NAME_PROTOCOL instance.\r
485\r
486 @param Language[in] A pointer to a Null-terminated ASCII string\r
487 array indicating the language. This is the\r
488 language of the driver name that the caller is\r
489 requesting, and it must match one of the\r
490 languages specified in SupportedLanguages. The\r
491 number of languages supported by a driver is up\r
492 to the driver writer. Language is specified\r
493 in RFC 3066 or ISO 639-2 language code format.\r
494\r
495 @param DriverName[out] A pointer to the Unicode string to return.\r
496 This Unicode string is the name of the\r
497 driver specified by This in the language\r
498 specified by Language.\r
499\r
500 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
501 This and the language specified by Language was\r
502 returned in DriverName.\r
503\r
504 @retval EFI_INVALID_PARAMETER Language is NULL.\r
505\r
506 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
507\r
508 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
509 the language specified by Language.\r
510\r
511**/\r
95276127 512EFI_STATUS\r
513EFIAPI\r
514TerminalComponentNameGetDriverName (\r
515 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
516 IN CHAR8 *Language,\r
517 OUT CHAR16 **DriverName\r
518 );\r
519\r
5bca971e 520\r
521/**\r
522 Retrieves a Unicode string that is the user readable name of the controller\r
523 that is being managed by a driver.\r
524\r
525 This function retrieves the user readable name of the controller specified by\r
526 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
527 driver specified by This has a user readable name in the language specified by\r
528 Language, then a pointer to the controller name is returned in ControllerName,\r
529 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
530 managing the controller specified by ControllerHandle and ChildHandle,\r
531 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
532 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
533\r
534 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
535 EFI_COMPONENT_NAME_PROTOCOL instance.\r
536\r
537 @param ControllerHandle[in] The handle of a controller that the driver\r
538 specified by This is managing. This handle\r
539 specifies the controller whose name is to be\r
540 returned.\r
541\r
542 @param ChildHandle[in] The handle of the child controller to retrieve\r
543 the name of. This is an optional parameter that\r
544 may be NULL. It will be NULL for device\r
545 drivers. It will also be NULL for a bus drivers\r
546 that wish to retrieve the name of the bus\r
547 controller. It will not be NULL for a bus\r
548 driver that wishes to retrieve the name of a\r
549 child controller.\r
550\r
551 @param Language[in] A pointer to a Null-terminated ASCII string\r
552 array indicating the language. This is the\r
553 language of the driver name that the caller is\r
554 requesting, and it must match one of the\r
555 languages specified in SupportedLanguages. The\r
556 number of languages supported by a driver is up\r
557 to the driver writer. Language is specified in\r
558 RFC 3066 or ISO 639-2 language code format.\r
559\r
560 @param ControllerName[out] A pointer to the Unicode string to return.\r
561 This Unicode string is the name of the\r
562 controller specified by ControllerHandle and\r
563 ChildHandle in the language specified by\r
564 Language from the point of view of the driver\r
565 specified by This.\r
566\r
567 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
568 the language specified by Language for the\r
569 driver specified by This was returned in\r
570 DriverName.\r
571\r
572 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
573\r
574 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
575 EFI_HANDLE.\r
576\r
577 @retval EFI_INVALID_PARAMETER Language is NULL.\r
578\r
579 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
580\r
581 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
582 managing the controller specified by\r
583 ControllerHandle and ChildHandle.\r
584\r
585 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
586 the language specified by Language.\r
587\r
588**/\r
95276127 589EFI_STATUS\r
590EFIAPI\r
591TerminalComponentNameGetControllerName (\r
592 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
593 IN EFI_HANDLE ControllerHandle,\r
594 IN EFI_HANDLE ChildHandle OPTIONAL,\r
595 IN CHAR8 *Language,\r
596 OUT CHAR16 **ControllerName\r
597 );\r
598\r
5bca971e 599\r
95276127 600//\r
601// internal functions\r
602//\r
603EFI_STATUS\r
604TerminalConInCheckForKey (\r
605 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This\r
606 )\r
607;\r
608\r
609VOID\r
610TerminalUpdateConsoleDevVariable (\r
611 IN CHAR16 *VariableName,\r
612 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath\r
613 )\r
614;\r
615\r
616VOID\r
617TerminalRemoveConsoleDevVariable (\r
618 IN CHAR16 *VariableName,\r
619 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath\r
620 )\r
621;\r
622\r
623VOID *\r
624TerminalGetVariableAndSize (\r
625 IN CHAR16 *Name,\r
626 IN EFI_GUID *VendorGuid,\r
627 OUT UINTN *VariableSize\r
628 )\r
629;\r
630\r
631EFI_STATUS\r
632SetTerminalDevicePath (\r
633 IN UINT8 TerminalType,\r
634 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,\r
635 OUT EFI_DEVICE_PATH_PROTOCOL **TerminalDevicePath\r
636 )\r
637;\r
638\r
639VOID\r
640InitializeRawFiFo (\r
641 IN TERMINAL_DEV *TerminalDevice\r
642 )\r
643;\r
644\r
645VOID\r
646InitializeUnicodeFiFo (\r
647 IN TERMINAL_DEV *TerminalDevice\r
648 )\r
649;\r
650\r
651VOID\r
652InitializeEfiKeyFiFo (\r
653 IN TERMINAL_DEV *TerminalDevice\r
654 )\r
655;\r
656\r
657EFI_STATUS\r
658GetOneKeyFromSerial (\r
659 EFI_SERIAL_IO_PROTOCOL *SerialIo,\r
660 UINT8 *Input\r
661 )\r
662;\r
663\r
664BOOLEAN\r
665RawFiFoInsertOneKey (\r
666 TERMINAL_DEV *TerminalDevice,\r
667 UINT8 Input\r
668 )\r
669;\r
670\r
671BOOLEAN\r
672RawFiFoRemoveOneKey (\r
673 TERMINAL_DEV *TerminalDevice,\r
674 UINT8 *Output\r
675 )\r
676;\r
677\r
678BOOLEAN\r
679IsRawFiFoEmpty (\r
680 TERMINAL_DEV *TerminalDevice\r
681 )\r
682;\r
683\r
684BOOLEAN\r
685IsRawFiFoFull (\r
686 TERMINAL_DEV *TerminalDevice\r
687 )\r
688;\r
689\r
690BOOLEAN\r
691EfiKeyFiFoInsertOneKey (\r
692 TERMINAL_DEV *TerminalDevice,\r
693 EFI_INPUT_KEY Key\r
694 )\r
695;\r
696\r
697BOOLEAN\r
698EfiKeyFiFoRemoveOneKey (\r
699 TERMINAL_DEV *TerminalDevice,\r
700 EFI_INPUT_KEY *Output\r
701 )\r
702;\r
703\r
704BOOLEAN\r
705IsEfiKeyFiFoEmpty (\r
706 TERMINAL_DEV *TerminalDevice\r
707 )\r
708;\r
709\r
710BOOLEAN\r
711IsEfiKeyFiFoFull (\r
712 TERMINAL_DEV *TerminalDevice\r
713 )\r
714;\r
715\r
716BOOLEAN\r
717UnicodeFiFoInsertOneKey (\r
718 TERMINAL_DEV *TerminalDevice,\r
719 UINT16 Input\r
720 )\r
721;\r
722\r
723BOOLEAN\r
724UnicodeFiFoRemoveOneKey (\r
725 TERMINAL_DEV *TerminalDevice,\r
726 UINT16 *Output\r
727 )\r
728;\r
729\r
730BOOLEAN\r
731IsUnicodeFiFoEmpty (\r
732 TERMINAL_DEV *TerminalDevice\r
733 )\r
734;\r
735\r
736BOOLEAN\r
737IsUnicodeFiFoFull (\r
738 TERMINAL_DEV *TerminalDevice\r
739 )\r
740;\r
741\r
742UINT8\r
743UnicodeFiFoGetKeyCount (\r
744 TERMINAL_DEV *TerminalDevice\r
745 )\r
746;\r
747\r
748VOID\r
749TranslateRawDataToEfiKey (\r
750 IN TERMINAL_DEV *TerminalDevice\r
751 )\r
752;\r
753\r
754//\r
755// internal functions for PC ANSI\r
756//\r
757VOID\r
758AnsiRawDataToUnicode (\r
759 IN TERMINAL_DEV *PcAnsiDevice\r
760 )\r
761;\r
762\r
763VOID\r
764UnicodeToEfiKey (\r
765 IN TERMINAL_DEV *PcAnsiDevice\r
766 )\r
767;\r
768\r
769EFI_STATUS\r
770AnsiTestString (\r
771 IN TERMINAL_DEV *TerminalDevice,\r
772 IN CHAR16 *WString\r
773 )\r
774;\r
775\r
776//\r
777// internal functions for VT100\r
778//\r
779EFI_STATUS\r
780VT100TestString (\r
781 IN TERMINAL_DEV *VT100Device,\r
782 IN CHAR16 *WString\r
783 )\r
784;\r
785\r
786//\r
787// internal functions for VT100Plus\r
788//\r
789EFI_STATUS\r
790VT100PlusTestString (\r
791 IN TERMINAL_DEV *TerminalDevice,\r
792 IN CHAR16 *WString\r
793 )\r
794;\r
795\r
796//\r
797// internal functions for VTUTF8\r
798//\r
799VOID\r
800VTUTF8RawDataToUnicode (\r
801 IN TERMINAL_DEV *VtUtf8Device\r
802 )\r
803;\r
804\r
805EFI_STATUS\r
806VTUTF8TestString (\r
807 IN TERMINAL_DEV *TerminalDevice,\r
808 IN CHAR16 *WString\r
809 )\r
810;\r
811\r
812VOID\r
813UnicodeToUtf8 (\r
814 IN CHAR16 Unicode,\r
815 OUT UTF8_CHAR *Utf8Char,\r
816 OUT UINT8 *ValidBytes\r
817 )\r
818;\r
819\r
820VOID\r
821GetOneValidUtf8Char (\r
822 IN TERMINAL_DEV *Utf8Device,\r
823 OUT UTF8_CHAR *Utf8Char,\r
824 OUT UINT8 *ValidBytes\r
825 )\r
826;\r
827\r
828VOID\r
829Utf8ToUnicode (\r
830 IN UTF8_CHAR Utf8Char,\r
831 IN UINT8 ValidBytes,\r
832 OUT CHAR16 *UnicodeChar\r
833 )\r
834;\r
835\r
836//\r
837// functions for boxdraw unicode\r
838//\r
839BOOLEAN\r
840TerminalIsValidTextGraphics (\r
841 IN CHAR16 Graphic,\r
842 OUT CHAR8 *PcAnsi, OPTIONAL\r
843 OUT CHAR8 *Ascii OPTIONAL\r
844 )\r
845;\r
846\r
847BOOLEAN\r
848TerminalIsValidAscii (\r
849 IN CHAR16 Ascii\r
850 )\r
851;\r
852\r
853BOOLEAN\r
854TerminalIsValidEfiCntlChar (\r
855 IN CHAR16 CharC\r
856 )\r
857;\r
858\r
859#endif\r