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