]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
Clean up to update the reference of the these macros:
[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 <Uefi.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 SIGNATURE_32 ('t', 'm', 'n', 'l')
63
64 #define TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE 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 /**
170 The user Entry Point for module Terminal. The user code starts with this function.
171
172 @param[in] ImageHandle The firmware allocated handle for the EFI image.
173 @param[in] SystemTable A pointer to the EFI System Table.
174
175 @retval EFI_SUCCESS The entry point is executed successfully.
176 @retval other Some error occurs when executing this entry point.
177
178 **/
179 EFI_STATUS
180 EFIAPI
181 InitializeTerminal (
182 IN EFI_HANDLE ImageHandle,
183 IN EFI_SYSTEM_TABLE *SystemTable
184 );
185
186 /**
187 Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset().
188 This driver only perform dependent serial device reset regardless of
189 the value of ExtendeVerification
190
191 @param This Indicates the calling context.
192 @param ExtendedVerification Skip by this driver.
193
194 @return EFI_SUCCESS The reset operation succeeds.
195 @return EFI_DEVICE_ERROR The dependent serial port reset fails.
196
197 **/
198 EFI_STATUS
199 EFIAPI
200 TerminalConInReset (
201 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
202 IN BOOLEAN ExtendedVerification
203 );
204
205
206 /**
207 Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.ReadKeyStroke().
208
209 @param This Indicates the calling context.
210 @param Key A pointer to a buffer that is filled in with the
211 keystroke information for the key that was sent
212 from terminal.
213
214 @return EFI_SUCCESS The keystroke information is returned successfully.
215 @return EFI_NOT_READY There is no keystroke data available.
216 @return EFI_DEVICE_ERROR The dependent serial device encounters error.
217
218 **/
219 EFI_STATUS
220 EFIAPI
221 TerminalConInReadKeyStroke (
222 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
223 OUT EFI_INPUT_KEY *Key
224 );
225
226 /**
227 Check if the key already has been registered.
228
229 @param RegsiteredData A pointer to a buffer that is filled in with the
230 keystroke state data for the key that was
231 registered.
232 @param InputData A pointer to a buffer that is filled in with the
233 keystroke state data for the key that was
234 pressed.
235
236 @retval TRUE Key be pressed matches a registered key.
237 @retval FLASE Match failed.
238
239 **/
240 BOOLEAN
241 IsKeyRegistered (
242 IN EFI_KEY_DATA *RegsiteredData,
243 IN EFI_KEY_DATA *InputData
244 );
245
246 /**
247 Event notification function for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event
248 Signal the event if there is key available
249
250 @param Event Indicates the event that invoke this function.
251 @param Context Indicates the calling context.
252
253 @return none.
254
255 **/
256 VOID
257 EFIAPI
258 TerminalConInWaitForKeyEx (
259 IN EFI_EVENT Event,
260 IN VOID *Context
261 );
262
263 //
264 // Simple Text Input Ex protocol prototypes
265 //
266
267 /**
268 Reset the input device and optionaly run diagnostics
269
270 @param This Protocol instance pointer.
271 @param ExtendedVerification Driver may perform diagnostics on reset.
272
273 @retval EFI_SUCCESS The device was reset.
274 @retval EFI_DEVICE_ERROR The device is not functioning properly and could
275 not be reset.
276
277 **/
278 EFI_STATUS
279 EFIAPI
280 TerminalConInResetEx (
281 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
282 IN BOOLEAN ExtendedVerification
283 );
284
285 /**
286 Reads the next keystroke from the input device. The WaitForKey Event can
287 be used to test for existance of a keystroke via WaitForEvent () call.
288
289 @param This Protocol instance pointer.
290 @param KeyData A pointer to a buffer that is filled in with the
291 keystroke state data for the key that was
292 pressed.
293
294 @retval EFI_SUCCESS The keystroke information was returned.
295 @retval EFI_NOT_READY There was no keystroke data availiable.
296 @retval EFI_DEVICE_ERROR The keystroke information was not returned due
297 to hardware errors.
298 @retval EFI_INVALID_PARAMETER KeyData is NULL.
299
300 **/
301 EFI_STATUS
302 EFIAPI
303 TerminalConInReadKeyStrokeEx (
304 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
305 OUT EFI_KEY_DATA *KeyData
306 );
307
308 /**
309 Set certain state for the input device.
310
311 @param This Protocol instance pointer.
312 @param KeyToggleState A pointer to the EFI_KEY_TOGGLE_STATE to set the
313 state for the input device.
314
315 @retval EFI_SUCCESS The device state was set successfully.
316 @retval EFI_DEVICE_ERROR The device is not functioning correctly and
317 could not have the setting adjusted.
318 @retval EFI_UNSUPPORTED The device does not have the ability to set its
319 state.
320 @retval EFI_INVALID_PARAMETER KeyToggleState is NULL.
321
322 **/
323 EFI_STATUS
324 EFIAPI
325 TerminalConInSetState (
326 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
327 IN EFI_KEY_TOGGLE_STATE *KeyToggleState
328 );
329
330 /**
331 Register a notification function for a particular keystroke for the input device.
332
333 @param This Protocol instance pointer.
334 @param KeyData A pointer to a buffer that is filled in with the
335 keystroke information data for the key that was
336 pressed.
337 @param KeyNotificationFunction Points to the function to be called when the key
338 sequence is typed specified by KeyData.
339 @param NotifyHandle Points to the unique handle assigned to the
340 registered notification.
341
342 @retval EFI_SUCCESS The notification function was registered
343 successfully.
344 @retval EFI_OUT_OF_RESOURCES Unable to allocate resources for necesssary data
345 structures.
346 @retval EFI_INVALID_PARAMETER KeyData or NotifyHandle is NULL.
347
348 **/
349 EFI_STATUS
350 EFIAPI
351 TerminalConInRegisterKeyNotify (
352 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
353 IN EFI_KEY_DATA *KeyData,
354 IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
355 OUT EFI_HANDLE *NotifyHandle
356 );
357
358 /**
359 Remove a registered notification function from a particular keystroke.
360
361 @param This Protocol instance pointer.
362 @param NotificationHandle The handle of the notification function being
363 unregistered.
364
365 @retval EFI_SUCCESS The notification function was unregistered
366 successfully.
367 @retval EFI_INVALID_PARAMETER The NotificationHandle is invalid.
368 @retval EFI_NOT_FOUND Can not find the matching entry in database.
369
370 **/
371 EFI_STATUS
372 EFIAPI
373 TerminalConInUnregisterKeyNotify (
374 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
375 IN EFI_HANDLE NotificationHandle
376 );
377
378 /**
379 Event notification function for EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey event
380 Signal the event if there is key available
381
382 @param Event Indicates the event that invoke this function.
383 @param Context Indicates the calling context.
384
385 @return None
386
387 **/
388 VOID
389 EFIAPI
390 TerminalConInWaitForKey (
391 IN EFI_EVENT Event,
392 IN VOID *Context
393 );
394
395 /**
396 Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset().
397 If ExtendeVerification is TRUE, then perform dependent serial device reset,
398 and set display mode to mode 0.
399 If ExtendedVerification is FALSE, only set display mode to mode 0.
400
401 @param This Indicates the calling context.
402 @param ExtendedVerification Indicates that the driver may perform a more
403 exhaustive verification operation of the device
404 during reset.
405
406 @return EFI_SUCCESS The reset operation succeeds.
407 @return EFI_DEVICE_ERROR The terminal is not functioning correctly or the serial port reset fails.
408
409 **/
410 EFI_STATUS
411 EFIAPI
412 TerminalConOutReset (
413 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
414 IN BOOLEAN ExtendedVerification
415 );
416
417 /**
418 Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString().
419 The Unicode string will be converted to terminal expressible data stream
420 and send to terminal via serial port.
421
422 @param This Indicates the calling context.
423 @param WString The Null-terminated Unicode string to be displayed
424 on the terminal screen.
425
426 @retval EFI_SUCCESS The string is output successfully.
427 @retval EFI_DEVICE_ERROR The serial port fails to send the string out.
428 @retval EFI_WARN_UNKNOWN_GLYPH Indicates that some of the characters in the Unicode string could not
429 be rendered and are skipped.
430 @retval EFI_UNSUPPORTED If current display mode is out of range.
431
432 **/
433 EFI_STATUS
434 EFIAPI
435 TerminalConOutOutputString (
436 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
437 IN CHAR16 *WString
438 );
439
440 /**
441 Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.TestString().
442 If one of the characters in the *Wstring is
443 neither valid Unicode drawing characters,
444 not ASCII code, then this function will return
445 EFI_UNSUPPORTED.
446
447 @param This Indicates the calling context.
448 @param WString The Null-terminated Unicode string to be tested.
449
450 @return EFI_SUCCESS The terminal is capable of rendering the output string.
451 @return EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be rendered.
452
453 **/
454 EFI_STATUS
455 EFIAPI
456 TerminalConOutTestString (
457 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
458 IN CHAR16 *WString
459 );
460
461 /**
462 Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode().
463 It returns information for an available text mode
464 that the terminal supports.
465 In this driver, we support text mode 80x25 (mode 0),
466 80x50 (mode 1), 100x31 (mode 2).
467
468 @param This Indicates the calling context.
469 @param ModeNumber The mode number to return information on.
470 @param Columns The returned columns of the requested mode.
471 @param Rows The returned rows of the requested mode.
472
473 @return EFI_SUCCESS The requested mode information is returned.
474 @return EFI_UNSUPPORTED The mode number is not valid.
475 @return EFI_DEVICE_ERROR
476
477 **/
478 EFI_STATUS
479 EFIAPI
480 TerminalConOutQueryMode (
481 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
482 IN UINTN ModeNumber,
483 OUT UINTN *Columns,
484 OUT UINTN *Rows
485 );
486
487 /**
488 Implements EFI_SIMPLE_TEXT_OUT.SetMode().
489 Set the terminal to a specified display mode.
490 In this driver, we only support mode 0.
491
492 @param This Indicates the calling context.
493 @param ModeNumber The text mode to set.
494
495 @return EFI_SUCCESS The requested text mode is set.
496 @return EFI_DEVICE_ERROR The requested text mode cannot be set
497 because of serial device error.
498 @return EFI_UNSUPPORTED The text mode number is not valid.
499
500 **/
501 EFI_STATUS
502 EFIAPI
503 TerminalConOutSetMode (
504 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
505 IN UINTN ModeNumber
506 );
507
508 /**
509 Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetAttribute().
510
511 @param This Indicates the calling context.
512 @param Attribute The attribute to set. Only bit0..6 are valid, all other bits
513 are undefined and must be zero.
514
515 @return EFI_SUCCESS The requested attribute is set.
516 @return EFI_DEVICE_ERROR The requested attribute cannot be set due to serial port error.
517 @return EFI_UNSUPPORTED The attribute requested is not defined by EFI spec.
518
519 **/
520 EFI_STATUS
521 EFIAPI
522 TerminalConOutSetAttribute (
523 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
524 IN UINTN Attribute
525 );
526
527 /**
528 Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.ClearScreen().
529 It clears the ANSI terminal's display to the
530 currently selected background color.
531
532 @param This Indicates the calling context.
533
534 @return EFI_SUCCESS The operation completed successfully.
535 @return EFI_DEVICE_ERROR The terminal screen cannot be cleared due to serial port error.
536 @return EFI_UNSUPPORTED The terminal is not in a valid display mode.
537
538 **/
539 EFI_STATUS
540 EFIAPI
541 TerminalConOutClearScreen (
542 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
543 );
544
545 /**
546 Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetCursorPosition().
547
548 @param This Indicates the calling context.
549 @param Column The row to set cursor to.
550 @param Row The column to set cursor to.
551
552 @return EFI_SUCCESS The operation completed successfully.
553 @return EFI_DEVICE_ERROR The request fails due to serial port error.
554 @return EFI_UNSUPPORTED The terminal is not in a valid text mode, or the cursor position
555 is invalid for current mode.
556
557 **/
558 EFI_STATUS
559 EFIAPI
560 TerminalConOutSetCursorPosition (
561 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
562 IN UINTN Column,
563 IN UINTN Row
564 );
565
566 /**
567 Implements SIMPLE_TEXT_OUTPUT.EnableCursor().
568 In this driver, the cursor cannot be hidden.
569
570 @param This Indicates the calling context.
571 @param Visible If TRUE, the cursor is set to be visible,
572 If FALSE, the cursor is set to be invisible.
573
574 @return EFI_SUCCESS The request is valid.
575 @return EFI_UNSUPPORTED The terminal does not support cursor hidden.
576
577 **/
578 EFI_STATUS
579 EFIAPI
580 TerminalConOutEnableCursor (
581 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
582 IN BOOLEAN Visible
583 );
584
585 /**
586 Test to see if this driver supports Controller.
587
588 @param This Protocol instance pointer.
589 @param ControllerHandle Handle of device to test
590 @param RemainingDevicePath Optional parameter use to pick a specific child
591 device to start.
592
593 @retval EFI_SUCCESS This driver supports this device.
594 @retval EFI_ALREADY_STARTED This driver is already running on this device.
595 @retval other This driver does not support this device.
596
597 **/
598 EFI_STATUS
599 EFIAPI
600 TerminalDriverBindingSupported (
601 IN EFI_DRIVER_BINDING_PROTOCOL *This,
602 IN EFI_HANDLE ControllerHandle,
603 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
604 );
605
606 /**
607 Start this driver on Controller by opening a Serial IO protocol,
608 reading Device Path, and creating a child handle with a Simple Text In,
609 Simple Text In Ex and Simple Text Out protocol, and device path protocol.
610 And store Console Device Environment Variables.
611
612 @param This Protocol instance pointer.
613 @param Controller Handle of device to bind driver to
614 @param RemainingDevicePath Optional parameter use to pick a specific child
615 device to start.
616
617 @retval EFI_SUCCESS This driver is added to Controller.
618 @retval EFI_ALREADY_STARTED This driver is already running on Controller.
619 @retval other This driver does not support this device.
620
621 **/
622 EFI_STATUS
623 EFIAPI
624 TerminalDriverBindingStart (
625 IN EFI_DRIVER_BINDING_PROTOCOL *This,
626 IN EFI_HANDLE Controller,
627 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
628 );
629
630
631 /**
632 Stop this driver on Controller by closing Simple Text In, Simple Text
633 In Ex, Simple Text Out protocol, and removing parent device path from
634 Console Device Environment Variables.
635
636 @param This Protocol instance pointer.
637 @param Controller Handle of device to stop driver on
638 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
639 children is zero stop the entire bus driver.
640 @param ChildHandleBuffer List of Child Handles to Stop.
641
642 @retval EFI_SUCCESS This driver is removed Controller.
643 @retval other This driver could not be removed from this device.
644
645 **/
646 EFI_STATUS
647 EFIAPI
648 TerminalDriverBindingStop (
649 IN EFI_DRIVER_BINDING_PROTOCOL *This,
650 IN EFI_HANDLE Controller,
651 IN UINTN NumberOfChildren,
652 IN EFI_HANDLE *ChildHandleBuffer
653 );
654
655 /**
656 Retrieves a Unicode string that is the user readable name of the driver.
657
658 This function retrieves the user readable name of a driver in the form of a
659 Unicode string. If the driver specified by This has a user readable name in
660 the language specified by Language, then a pointer to the driver name is
661 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
662 by This does not support the language specified by Language,
663 then EFI_UNSUPPORTED is returned.
664
665 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
666 EFI_COMPONENT_NAME_PROTOCOL instance.
667
668 @param Language[in] A pointer to a Null-terminated ASCII string
669 array indicating the language. This is the
670 language of the driver name that the caller is
671 requesting, and it must match one of the
672 languages specified in SupportedLanguages. The
673 number of languages supported by a driver is up
674 to the driver writer. Language is specified
675 in RFC 3066 or ISO 639-2 language code format.
676
677 @param DriverName[out] A pointer to the Unicode string to return.
678 This Unicode string is the name of the
679 driver specified by This in the language
680 specified by Language.
681
682 @retval EFI_SUCCESS The Unicode string for the Driver specified by
683 This and the language specified by Language was
684 returned in DriverName.
685
686 @retval EFI_INVALID_PARAMETER Language is NULL.
687
688 @retval EFI_INVALID_PARAMETER DriverName is NULL.
689
690 @retval EFI_UNSUPPORTED The driver specified by This does not support
691 the language specified by Language.
692
693 **/
694 EFI_STATUS
695 EFIAPI
696 TerminalComponentNameGetDriverName (
697 IN EFI_COMPONENT_NAME_PROTOCOL *This,
698 IN CHAR8 *Language,
699 OUT CHAR16 **DriverName
700 );
701
702
703 /**
704 Retrieves a Unicode string that is the user readable name of the controller
705 that is being managed by a driver.
706
707 This function retrieves the user readable name of the controller specified by
708 ControllerHandle and ChildHandle in the form of a Unicode string. If the
709 driver specified by This has a user readable name in the language specified by
710 Language, then a pointer to the controller name is returned in ControllerName,
711 and EFI_SUCCESS is returned. If the driver specified by This is not currently
712 managing the controller specified by ControllerHandle and ChildHandle,
713 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
714 support the language specified by Language, then EFI_UNSUPPORTED is returned.
715
716 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
717 EFI_COMPONENT_NAME_PROTOCOL instance.
718
719 @param ControllerHandle[in] The handle of a controller that the driver
720 specified by This is managing. This handle
721 specifies the controller whose name is to be
722 returned.
723
724 @param ChildHandle[in] The handle of the child controller to retrieve
725 the name of. This is an optional parameter that
726 may be NULL. It will be NULL for device
727 drivers. It will also be NULL for a bus drivers
728 that wish to retrieve the name of the bus
729 controller. It will not be NULL for a bus
730 driver that wishes to retrieve the name of a
731 child controller.
732
733 @param Language[in] A pointer to a Null-terminated ASCII string
734 array indicating the language. This is the
735 language of the driver name that the caller is
736 requesting, and it must match one of the
737 languages specified in SupportedLanguages. The
738 number of languages supported by a driver is up
739 to the driver writer. Language is specified in
740 RFC 3066 or ISO 639-2 language code format.
741
742 @param ControllerName[out] A pointer to the Unicode string to return.
743 This Unicode string is the name of the
744 controller specified by ControllerHandle and
745 ChildHandle in the language specified by
746 Language from the point of view of the driver
747 specified by This.
748
749 @retval EFI_SUCCESS The Unicode string for the user readable name in
750 the language specified by Language for the
751 driver specified by This was returned in
752 DriverName.
753
754 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
755
756 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
757 EFI_HANDLE.
758
759 @retval EFI_INVALID_PARAMETER Language is NULL.
760
761 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
762
763 @retval EFI_UNSUPPORTED The driver specified by This is not currently
764 managing the controller specified by
765 ControllerHandle and ChildHandle.
766
767 @retval EFI_UNSUPPORTED The driver specified by This does not support
768 the language specified by Language.
769
770 **/
771 EFI_STATUS
772 EFIAPI
773 TerminalComponentNameGetControllerName (
774 IN EFI_COMPONENT_NAME_PROTOCOL *This,
775 IN EFI_HANDLE ControllerHandle,
776 IN EFI_HANDLE ChildHandle OPTIONAL,
777 IN CHAR8 *Language,
778 OUT CHAR16 **ControllerName
779 );
780
781
782 //
783 // internal functions
784 //
785
786 /**
787 Check for a pending key in the Efi Key FIFO or Serial device buffer.
788
789 @param This Indicates the calling context.
790
791 @retval EFI_SUCCESS There is key pending.
792 @retval EFI_NOT_READY There is no key pending.
793 @retval EFI_DEVICE_ERROR If Serial IO is not attched to serial device.
794
795 **/
796 EFI_STATUS
797 TerminalConInCheckForKey (
798 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This
799 );
800
801 /**
802 Update terminal device path in Console Device Environment Variables.
803
804 @param VariableName The Console Device Environment Variable.
805 @param ParentDevicePath The terminal devcie path to be updated.
806
807 @return None.
808
809 **/
810 VOID
811 TerminalUpdateConsoleDevVariable (
812 IN CHAR16 *VariableName,
813 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath
814 );
815
816 /**
817 Remove console device variable.
818
819 @param VariableName A pointer to the variable name.
820 @param ParentDevicePath A pointer to the parent device path.
821
822 @return None.
823
824 **/
825 VOID
826 TerminalRemoveConsoleDevVariable (
827 IN CHAR16 *VariableName,
828 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath
829 );
830
831 /**
832 Read the EFI variable (VendorGuid/Name) and return a dynamically allocated
833 buffer, and the size of the buffer. On failure return NULL.
834
835 @param Name String part of EFI variable name
836 @param VendorGuid GUID part of EFI variable name
837 @param VariableSize Returns the size of the EFI variable that was read
838
839 @return Dynamically allocated memory that contains a copy of the EFI variable.
840 Caller is repsoncible freeing the buffer. If variable was not read,
841 NULL regturned.
842
843 **/
844 VOID *
845 TerminalGetVariableAndSize (
846 IN CHAR16 *Name,
847 IN EFI_GUID *VendorGuid,
848 OUT UINTN *VariableSize
849 );
850
851 /**
852 Build termial device path according to terminal type.
853
854 @param TerminalType The terminal type is PC ANSI, VT100, VT100+ or VT-UTF8.
855 @param ParentDevicePath Parent devcie path.
856 @param TerminalDevicePath Returned terminal device path, if building successfully.
857
858 @retval EFI_UNSUPPORTED Terminal does not belong to the supported type.
859 @retval EFI_OUT_OF_RESOURCES Generate terminal device path failed.
860 @retval EFI_SUCCESS Build terminal device path successfully.
861
862 **/
863 EFI_STATUS
864 SetTerminalDevicePath (
865 IN UINT8 TerminalType,
866 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
867 OUT EFI_DEVICE_PATH_PROTOCOL **TerminalDevicePath
868 );
869
870 /**
871 Initialize the Raw Data FIFO.
872
873 @param TerminalDevice The terminal device.
874
875 @return None.
876
877 **/
878 VOID
879 InitializeRawFiFo (
880 IN TERMINAL_DEV *TerminalDevice
881 );
882
883 /**
884 Initialize the Unicode FIFO.
885
886 @param TerminalDevice The terminal device.
887
888 @return None.
889
890 **/
891 VOID
892 InitializeUnicodeFiFo (
893 IN TERMINAL_DEV *TerminalDevice
894 );
895
896 /**
897 Initialize the EFI Key FIFO.
898
899 @param TerminalDevice The terminal device.
900
901 @return None.
902
903 **/
904 VOID
905 InitializeEfiKeyFiFo (
906 IN TERMINAL_DEV *TerminalDevice
907 );
908
909 /**
910 Get one key out of serial buffer.
911
912 @param SerialIo Serial I/O protocl attached to the serial device.
913 @param Input The fetched key.
914
915 @return EFI_NOT_READY If serial buffer is empty.
916 @return EFI_DEVICE_ERROR If reading serial buffer encounter error.
917 @return EFI_SUCCESS If reading serial buffer successfully, put
918 the fetched key to the parameter output.
919
920 **/
921 EFI_STATUS
922 GetOneKeyFromSerial (
923 EFI_SERIAL_IO_PROTOCOL *SerialIo,
924 UINT8 *Input
925 );
926
927 /**
928 Insert one byte raw data into the Raw Data FIFO.
929
930 @param TerminalDevice Terminal driver private structure.
931 @param Input The key will be input.
932
933 @return TRUE If insert successfully.
934 @return FLASE If Raw Data buffer is full before key insertion,
935 and the key is lost.
936
937 **/
938 BOOLEAN
939 RawFiFoInsertOneKey (
940 TERMINAL_DEV *TerminalDevice,
941 UINT8 Input
942 );
943
944 /**
945 Remove one pre-fetched key out of the Raw Data FIFO.
946
947 @param TerminalDevice Terminal driver private structure.
948 @param Output The key will be removed.
949
950 @return TRUE If insert successfully.
951 @return FLASE If Raw Data FIFO buffer is empty before remove operation.
952
953 **/
954 BOOLEAN
955 RawFiFoRemoveOneKey (
956 TERMINAL_DEV *TerminalDevice,
957 UINT8 *Output
958 );
959
960 /**
961 Clarify whether Raw Data FIFO buffer is empty.
962
963 @param TerminalDevice Terminal driver private structure
964
965 @return TRUE If Raw Data FIFO buffer is empty.
966 @return FLASE If Raw Data FIFO buffer is not empty.
967
968 **/
969 BOOLEAN
970 IsRawFiFoEmpty (
971 TERMINAL_DEV *TerminalDevice
972 );
973
974 /**
975 Clarify whether Raw Data FIFO buffer is full.
976
977 @param TerminalDevice Terminal driver private structure
978
979 @return TRUE If Raw Data FIFO buffer is full.
980 @return FLASE If Raw Data FIFO buffer is not full.
981
982 **/
983 BOOLEAN
984 IsRawFiFoFull (
985 TERMINAL_DEV *TerminalDevice
986 );
987
988 /**
989 Insert one pre-fetched key into the FIFO buffer.
990
991 @param TerminalDevice Terminal driver private structure.
992 @param Key The key will be input.
993
994 @return TRUE If insert successfully.
995 @return FLASE If FIFO buffer is full before key insertion,
996 and the key is lost.
997
998 **/
999 BOOLEAN
1000 EfiKeyFiFoInsertOneKey (
1001 TERMINAL_DEV *TerminalDevice,
1002 EFI_INPUT_KEY Key
1003 );
1004
1005 /**
1006 Remove one pre-fetched key out of the FIFO buffer.
1007
1008 @param TerminalDevice Terminal driver private structure.
1009 @param Output The key will be removed.
1010
1011 @return TRUE If insert successfully.
1012 @return FLASE If FIFO buffer is empty before remove operation.
1013
1014 **/
1015 BOOLEAN
1016 EfiKeyFiFoRemoveOneKey (
1017 TERMINAL_DEV *TerminalDevice,
1018 EFI_INPUT_KEY *Output
1019 );
1020
1021 /**
1022 Clarify whether FIFO buffer is empty.
1023
1024 @param TerminalDevice Terminal driver private structure
1025
1026 @return TRUE If FIFO buffer is empty.
1027 @return FLASE If FIFO buffer is not empty.
1028
1029 **/
1030 BOOLEAN
1031 IsEfiKeyFiFoEmpty (
1032 TERMINAL_DEV *TerminalDevice
1033 );
1034
1035 /**
1036 Clarify whether FIFO buffer is full.
1037
1038 @param TerminalDevice Terminal driver private structure
1039
1040 @return TRUE If FIFO buffer is full.
1041 @return FLASE If FIFO buffer is not full.
1042
1043 **/
1044 BOOLEAN
1045 IsEfiKeyFiFoFull (
1046 TERMINAL_DEV *TerminalDevice
1047 );
1048
1049 /**
1050 Insert one pre-fetched key into the Unicode FIFO buffer.
1051
1052 @param TerminalDevice Terminal driver private structure.
1053 @param Input The key will be input.
1054
1055 @return TRUE If insert successfully.
1056 @return FLASE If Unicode FIFO buffer is full before key insertion,
1057 and the key is lost.
1058
1059 **/
1060 BOOLEAN
1061 UnicodeFiFoInsertOneKey (
1062 TERMINAL_DEV *TerminalDevice,
1063 UINT16 Input
1064 );
1065
1066 /**
1067 Remove one pre-fetched key out of the Unicode FIFO buffer.
1068
1069 @param TerminalDevice Terminal driver private structure.
1070 @param Output The key will be removed.
1071
1072 @return TRUE If insert successfully.
1073 @return FLASE If Unicode FIFO buffer is empty before remove operation.
1074
1075 **/
1076 BOOLEAN
1077 UnicodeFiFoRemoveOneKey (
1078 TERMINAL_DEV *TerminalDevice,
1079 UINT16 *Output
1080 );
1081
1082 /**
1083 Clarify whether Unicode FIFO buffer is empty.
1084
1085 @param TerminalDevice Terminal driver private structure
1086
1087 @return TRUE If Unicode FIFO buffer is empty.
1088 @return FLASE If Unicode FIFO buffer is not empty.
1089
1090 **/
1091 BOOLEAN
1092 IsUnicodeFiFoEmpty (
1093 TERMINAL_DEV *TerminalDevice
1094 );
1095
1096 /**
1097 Clarify whether Unicode FIFO buffer is full.
1098
1099 @param TerminalDevice Terminal driver private structure
1100
1101 @return TRUE If Unicode FIFO buffer is full.
1102 @return FLASE If Unicode FIFO buffer is not full.
1103
1104 **/
1105 BOOLEAN
1106 IsUnicodeFiFoFull (
1107 TERMINAL_DEV *TerminalDevice
1108 );
1109
1110 /**
1111 Count Unicode FIFO buffer.
1112
1113 @param TerminalDevice Terminal driver private structure
1114
1115 @return The count in bytes of Unicode FIFO.
1116
1117 **/
1118 UINT8
1119 UnicodeFiFoGetKeyCount (
1120 TERMINAL_DEV *TerminalDevice
1121 );
1122
1123 /**
1124 Translate raw data into Unicode (according to different encode), and
1125 translate Unicode into key information. (according to different standard).
1126
1127 @param TerminalDevice Terminal driver private structure.
1128
1129 @return none.
1130
1131 **/
1132 VOID
1133 TranslateRawDataToEfiKey (
1134 IN TERMINAL_DEV *TerminalDevice
1135 );
1136
1137 //
1138 // internal functions for PC ANSI
1139 //
1140
1141 /**
1142 Translate all raw data in the Raw FIFI into unicode, and insert
1143 them into Unicode FIFO.
1144
1145 @param TerminalDevice The terminal device.
1146
1147 @return None.
1148
1149 **/
1150 VOID
1151 AnsiRawDataToUnicode (
1152 IN TERMINAL_DEV *TerminalDevice
1153 );
1154
1155 /**
1156 Converts a stream of Unicode characters from a terminal input device into EFI Keys that
1157 can be read through the Simple Input Protocol.
1158
1159 The table below shows the keyboard input mappings that this function supports.
1160 If the ESC sequence listed in one of the columns is presented, then it is translated
1161 into the coorespoding EFI Scan Code. If a matching sequence is not found, then the raw
1162 key strokes are converted into EFI Keys.
1163
1164 2 seconds are allowed for an ESC sequence to be completed. If the ESC sequence is not
1165 completed in 2 seconds, then the raw key strokes of the partial ESC sequence are
1166 converted into EFI Keys.
1167 There is one special input sequence that will force the system to reset.
1168 This is ESC R ESC r ESC R.
1169
1170 Symbols used in table below
1171 ===========================
1172 ESC = 0x1B
1173 CSI = 0x9B
1174 DEL = 0x7f
1175 ^ = CTRL
1176 +=========+======+===========+==========+==========+
1177 | | EFI | UEFI 2.0 | | |
1178 | | Scan | | VT100+ | |
1179 | KEY | Code | PC ANSI | VTUTF8 | VT100 |
1180 +=========+======+===========+==========+==========+
1181 | NULL | 0x00 | | | |
1182 | UP | 0x01 | ESC [ A | ESC [ A | ESC [ A |
1183 | DOWN | 0x02 | ESC [ B | ESC [ B | ESC [ B |
1184 | RIGHT | 0x03 | ESC [ C | ESC [ C | ESC [ C |
1185 | LEFT | 0x04 | ESC [ D | ESC [ D | ESC [ D |
1186 | HOME | 0x05 | ESC [ H | ESC h | ESC [ H |
1187 | END | 0x06 | ESC [ F | ESC k | ESC [ K |
1188 | INSERT | 0x07 | ESC [ @ | ESC + | ESC [ @ |
1189 | | | ESC [ L | | ESC [ L |
1190 | DELETE | 0x08 | ESC [ X | ESC - | ESC [ P |
1191 | PG UP | 0x09 | ESC [ I | ESC ? | ESC [ V |
1192 | | | | | ESC [ ? |
1193 | PG DOWN | 0x0A | ESC [ G | ESC / | ESC [ U |
1194 | | | | | ESC [ / |
1195 | F1 | 0x0B | ESC [ M | ESC 1 | ESC O P |
1196 | F2 | 0x0C | ESC [ N | ESC 2 | ESC O Q |
1197 | F3 | 0x0D | ESC [ O | ESC 3 | ESC O w |
1198 | F4 | 0x0E | ESC [ P | ESC 4 | ESC O x |
1199 | F5 | 0x0F | ESC [ Q | ESC 5 | ESC O t |
1200 | F6 | 0x10 | ESC [ R | ESC 6 | ESC O u |
1201 | F7 | 0x11 | ESC [ S | ESC 7 | ESC O q |
1202 | F8 | 0x12 | ESC [ T | ESC 8 | ESC O r |
1203 | F9 | 0x13 | ESC [ U | ESC 9 | ESC O p |
1204 | F10 | 0x14 | ESC [ V | ESC 0 | ESC O M |
1205 | Escape | 0x17 | ESC | ESC | ESC |
1206 | F11 | 0x15 | | ESC ! | |
1207 | F12 | 0x16 | | ESC @ | |
1208 +=========+======+===========+==========+==========+
1209
1210 Special Mappings
1211 ================
1212 ESC R ESC r ESC R = Reset System
1213
1214
1215 @param TerminalDevice The terminal device to use to translate raw input into EFI Keys
1216
1217 @return None.
1218
1219 **/
1220 VOID
1221 UnicodeToEfiKey (
1222 IN TERMINAL_DEV *TerminalDevice
1223 );
1224
1225 /**
1226 Check if input string is valid Ascii string, valid EFI control characters
1227 or valid text graphics.
1228
1229 @param TerminalDevice The terminal device.
1230 @param WString The input string.
1231
1232 @retval EFI_UNSUPPORTED If not all input characters are valid.
1233 @retval EFI_SUCCESS If all input characters are valid.
1234
1235 **/
1236 EFI_STATUS
1237 AnsiTestString (
1238 IN TERMINAL_DEV *TerminalDevice,
1239 IN CHAR16 *WString
1240 );
1241
1242 //
1243 // internal functions for VTUTF8
1244 //
1245
1246 /**
1247 Translate all VT-UTF8 characters in the Raw FIFI into unicode characters,
1248 and insert them into Unicode FIFO.
1249
1250 @param VtUtf8Device The terminal device.
1251
1252 @return None.
1253
1254 **/
1255 VOID
1256 VTUTF8RawDataToUnicode (
1257 IN TERMINAL_DEV *VtUtf8Device
1258 );
1259
1260 /**
1261 Check if input string is valid VT-UTF8 string.
1262
1263 @param TerminalDevice The terminal device.
1264 @param WString The input string.
1265
1266 @retval EFI_SUCCESS If all input characters are valid.
1267
1268 **/
1269 EFI_STATUS
1270 VTUTF8TestString (
1271 IN TERMINAL_DEV *TerminalDevice,
1272 IN CHAR16 *WString
1273 );
1274
1275 /**
1276 Translate one Unicode character into VT-UTF8 characters.
1277
1278 UTF8 Encoding Table
1279 Bits per Character | Unicode Character Range | Unicode Binary Encoding | UTF8 Binary Encoding
1280 0-7 | 0x0000 - 0x007F | 00000000 0xxxxxxx | 0xxxxxxx
1281 8-11 | 0x0080 - 0x07FF | 00000xxx xxxxxxxx | 110xxxxx 10xxxxxx
1282 12-16 | 0x0800 - 0xFFFF | xxxxxxxx xxxxxxxx | 1110xxxx 10xxxxxx 10xxxxxx
1283
1284
1285 @param Unicode Unicode character need translating.
1286 @param Utf8Char Return VT-UTF8 character set.
1287 @param ValidBytes The count of valid VT-UTF8 characters. If
1288 ValidBytes is zero, no valid VT-UTF8 returned.
1289
1290 @return None.
1291
1292 **/
1293 VOID
1294 UnicodeToUtf8 (
1295 IN CHAR16 Unicode,
1296 OUT UTF8_CHAR *Utf8Char,
1297 OUT UINT8 *ValidBytes
1298 );
1299
1300 /**
1301 Get one valid VT-UTF8 characters set from Raw Data FIFO.
1302
1303 @param Utf8Device The terminal device.
1304 @param Utf8Char Returned valid VT-UTF8 characters set.
1305 @param ValidBytes The count of returned VT-VTF8 characters.
1306 If ValidBytes is zero, no valid VT-UTF8 returned.
1307
1308 **/
1309 VOID
1310 GetOneValidUtf8Char (
1311 IN TERMINAL_DEV *Utf8Device,
1312 OUT UTF8_CHAR *Utf8Char,
1313 OUT UINT8 *ValidBytes
1314 );
1315
1316 /**
1317 Translate VT-UTF8 characters into one Unicode character.
1318
1319 UTF8 Encoding Table
1320 Bits per Character | Unicode Character Range | Unicode Binary Encoding | UTF8 Binary Encoding
1321 0-7 | 0x0000 - 0x007F | 00000000 0xxxxxxx | 0xxxxxxx
1322 8-11 | 0x0080 - 0x07FF | 00000xxx xxxxxxxx | 110xxxxx 10xxxxxx
1323 12-16 | 0x0800 - 0xFFFF | xxxxxxxx xxxxxxxx | 1110xxxx 10xxxxxx 10xxxxxx
1324
1325
1326 @param Utf8Char VT-UTF8 character set needs translating.
1327 @param ValidBytes The count of valid VT-UTF8 characters.
1328 @param UnicodeChar Returned unicode character.
1329
1330 @return None.
1331
1332 **/
1333 VOID
1334 Utf8ToUnicode (
1335 IN UTF8_CHAR Utf8Char,
1336 IN UINT8 ValidBytes,
1337 OUT CHAR16 *UnicodeChar
1338 );
1339
1340 //
1341 // functions for boxdraw unicode
1342 //
1343
1344 /**
1345 Detects if a Unicode char is for Box Drawing text graphics.
1346
1347 @param Graphic Unicode char to test.
1348 @param PcAnsi Optional pointer to return PCANSI equivalent of
1349 Graphic.
1350 @param Ascii Optional pointer to return ASCII equivalent of
1351 Graphic.
1352
1353 @return TRUE If Graphic is a supported Unicode Box Drawing character.
1354
1355 **/
1356 BOOLEAN
1357 TerminalIsValidTextGraphics (
1358 IN CHAR16 Graphic,
1359 OUT CHAR8 *PcAnsi, OPTIONAL
1360 OUT CHAR8 *Ascii OPTIONAL
1361 );
1362
1363 /**
1364 Detects if a valid ASCII char.
1365
1366 @param Ascii An ASCII character.
1367
1368 @retval TRUE If it is a valid ASCII character.
1369 @retval FALSE If it is not a valid ASCII character.
1370
1371 **/
1372 BOOLEAN
1373 TerminalIsValidAscii (
1374 IN CHAR16 Ascii
1375 );
1376
1377 /**
1378 Detects if a valid EFI control character.
1379
1380 @param CharC An input EFI Control character.
1381
1382 @retval TRUE If it is a valid EFI control character.
1383 @retval FALSE If it is not a valid EFI control character.
1384
1385 **/
1386 BOOLEAN
1387 TerminalIsValidEfiCntlChar (
1388 IN CHAR16 CharC
1389 );
1390
1391 #endif