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