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