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