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