iPXE
efi_console.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008 Michael Brown <mbrown@fensystems.co.uk>.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301, USA.
18  */
19 
20 FILE_LICENCE ( GPL2_OR_LATER );
21 FILE_SECBOOT ( PERMITTED );
22 
23 #include <stddef.h>
24 #include <string.h>
25 #include <errno.h>
26 #include <assert.h>
27 #include <ipxe/efi/efi.h>
29 #include <ipxe/ansiesc.h>
30 #include <ipxe/utf8.h>
31 #include <ipxe/console.h>
32 #include <ipxe/keymap.h>
33 #include <ipxe/init.h>
34 #include <config/console.h>
35 
36 #define ATTR_BOLD 0x08
37 
38 #define ATTR_FCOL_MASK 0x07
39 #define ATTR_FCOL_BLACK 0x00
40 #define ATTR_FCOL_BLUE 0x01
41 #define ATTR_FCOL_GREEN 0x02
42 #define ATTR_FCOL_CYAN 0x03
43 #define ATTR_FCOL_RED 0x04
44 #define ATTR_FCOL_MAGENTA 0x05
45 #define ATTR_FCOL_YELLOW 0x06
46 #define ATTR_FCOL_WHITE 0x07
47 
48 #define ATTR_BCOL_MASK 0x70
49 #define ATTR_BCOL_BLACK 0x00
50 #define ATTR_BCOL_BLUE 0x10
51 #define ATTR_BCOL_GREEN 0x20
52 #define ATTR_BCOL_CYAN 0x30
53 #define ATTR_BCOL_RED 0x40
54 #define ATTR_BCOL_MAGENTA 0x50
55 #define ATTR_BCOL_YELLOW 0x60
56 #define ATTR_BCOL_WHITE 0x70
57 
58 #define ATTR_DEFAULT ATTR_FCOL_WHITE
59 
60 /* Set default console usage if applicable */
61 #if ! ( defined ( CONSOLE_EFI ) && CONSOLE_EXPLICIT ( CONSOLE_EFI ) )
62 #undef CONSOLE_EFI
63 #define CONSOLE_EFI ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG )
64 #endif
65 
66 /** Current character attribute */
67 static unsigned int efi_attr = ATTR_DEFAULT;
68 
69 /** Console control protocol */
72 
73 /** Extended simple text input protocol, if present */
75 
76 /**
77  * Handle ANSI CUP (cursor position)
78  *
79  * @v ctx ANSI escape sequence context
80  * @v count Parameter count
81  * @v params[0] Row (1 is top)
82  * @v params[1] Column (1 is left)
83  */
85  unsigned int count __unused, int params[] ) {
87  int cx = ( params[1] - 1 );
88  int cy = ( params[0] - 1 );
89 
90  if ( cx < 0 )
91  cx = 0;
92  if ( cy < 0 )
93  cy = 0;
94 
95  conout->SetCursorPosition ( conout, cx, cy );
96 }
97 
98 /**
99  * Handle ANSI ED (erase in page)
100  *
101  * @v ctx ANSI escape sequence context
102  * @v count Parameter count
103  * @v params[0] Region to erase
104  */
106  unsigned int count __unused,
107  int params[] __unused ) {
109 
110  /* We assume that we always clear the whole screen */
111  assert ( params[0] == ANSIESC_ED_ALL );
112 
113  conout->ClearScreen ( conout );
114 }
115 
116 /**
117  * Handle ANSI SGR (set graphics rendition)
118  *
119  * @v ctx ANSI escape sequence context
120  * @v count Parameter count
121  * @v params List of graphic rendition aspects
122  */
124  unsigned int count, int params[] ) {
126  static const uint8_t efi_attr_fcols[10] = {
130  ATTR_FCOL_WHITE, ATTR_FCOL_WHITE /* defaults */
131  };
132  static const uint8_t efi_attr_bcols[10] = {
136  ATTR_BCOL_BLACK, ATTR_BCOL_BLACK /* defaults */
137  };
138  unsigned int i;
139  int aspect;
140 
141  for ( i = 0 ; i < count ; i++ ) {
142  aspect = params[i];
143  if ( aspect == 0 ) {
145  } else if ( aspect == 1 ) {
146  efi_attr |= ATTR_BOLD;
147  } else if ( aspect == 22 ) {
148  efi_attr &= ~ATTR_BOLD;
149  } else if ( ( aspect >= 30 ) && ( aspect <= 39 ) ) {
151  efi_attr |= efi_attr_fcols[ aspect - 30 ];
152  } else if ( ( aspect >= 40 ) && ( aspect <= 49 ) ) {
154  efi_attr |= efi_attr_bcols[ aspect - 40 ];
155  }
156  }
157 
158  conout->SetAttribute ( conout, efi_attr );
159 }
160 
161 /**
162  * Handle ANSI DECTCEM set (show cursor)
163  *
164  * @v ctx ANSI escape sequence context
165  * @v count Parameter count
166  * @v params List of graphic rendition aspects
167  */
169  unsigned int count __unused,
170  int params[] __unused ) {
172 
173  conout->EnableCursor ( conout, TRUE );
174 }
175 
176 /**
177  * Handle ANSI DECTCEM reset (hide cursor)
178  *
179  * @v ctx ANSI escape sequence context
180  * @v count Parameter count
181  * @v params List of graphic rendition aspects
182  */
184  unsigned int count __unused,
185  int params[] __unused ) {
187 
188  conout->EnableCursor ( conout, FALSE );
189 }
190 
191 /** EFI console ANSI escape sequence handlers */
198  { 0, NULL }
199 };
200 
201 /** EFI console ANSI escape sequence context */
204 };
205 
206 /** EFI console UTF-8 accumulator */
208 
209 /**
210  * Print a character to EFI console
211  *
212  * @v character Character to be printed
213  */
214 static void efi_putchar ( int character ) {
216  wchar_t wstr[2];
217 
218  /* Intercept ANSI escape sequences */
220  if ( character < 0 )
221  return;
222 
223  /* Accumulate Unicode characters */
225  if ( character == 0 )
226  return;
227 
228  /* Treat unrepresentable (non-UCS2) characters as invalid */
229  if ( character & ~( ( wchar_t ) -1UL ) )
231 
232  /* Output character */
233  wstr[0] = character;
234  wstr[1] = L'\0';
235  conout->OutputString ( conout, wstr );
236 }
237 
238 /**
239  * Pointer to current ANSI output sequence
240  *
241  * While we are in the middle of returning an ANSI sequence for a
242  * special key, this will point to the next character to return. When
243  * not in the middle of such a sequence, this will point to a NUL
244  * (note: not "will be NULL").
245  */
246 static const char *ansi_input = "";
247 
248 /** Mapping from EFI scan codes to ANSI escape sequences */
249 static const char *ansi_sequences[] = {
250  [SCAN_UP] = "[A",
251  [SCAN_DOWN] = "[B",
252  [SCAN_RIGHT] = "[C",
253  [SCAN_LEFT] = "[D",
254  [SCAN_HOME] = "[H",
255  [SCAN_END] = "[F",
256  [SCAN_INSERT] = "[2~",
257  /* EFI translates an incoming backspace via the serial console
258  * into a SCAN_DELETE. There's not much we can do about this.
259  */
260  [SCAN_DELETE] = "[3~",
261  [SCAN_PAGE_UP] = "[5~",
262  [SCAN_PAGE_DOWN] = "[6~",
263  [SCAN_F5] = "[15~",
264  [SCAN_F6] = "[17~",
265  [SCAN_F7] = "[18~",
266  [SCAN_F8] = "[19~",
267  [SCAN_F9] = "[20~",
268  [SCAN_F10] = "[21~",
269  [SCAN_F11] = "[23~",
270  [SCAN_F12] = "[24~",
271  /* EFI translates some (but not all) incoming escape sequences
272  * via the serial console into equivalent scancodes. When it
273  * doesn't recognise a sequence, it helpfully(!) translates
274  * the initial ESC and passes the remainder through verbatim.
275  * Treating SCAN_ESC as equivalent to an empty escape sequence
276  * works around this bug.
277  */
278  [SCAN_ESC] = "",
279 };
280 
281 /**
282  * Get ANSI escape sequence corresponding to EFI scancode
283  *
284  * @v scancode EFI scancode
285  * @ret ansi_seq ANSI escape sequence, if any, otherwise NULL
286  */
287 static const char * scancode_to_ansi_seq ( unsigned int scancode ) {
288  if ( scancode < ( sizeof ( ansi_sequences ) /
289  sizeof ( ansi_sequences[0] ) ) ) {
290  return ansi_sequences[scancode];
291  }
292  return NULL;
293 }
294 
295 /**
296  * Get character from EFI console
297  *
298  * @ret character Character read from console
299  */
300 static int efi_getchar ( void ) {
303  const char *ansi_seq;
304  unsigned int character;
305  unsigned int shift;
306  unsigned int toggle;
308  EFI_STATUS efirc;
309  int rc;
310 
311  /* If we are mid-sequence, pass out the next byte */
312  if ( *ansi_input )
313  return *(ansi_input++);
314 
315  /* Read key from real EFI console */
316  memset ( &key, 0, sizeof ( key ) );
317  if ( conin_ex ) {
318  if ( ( efirc = conin_ex->ReadKeyStrokeEx ( conin_ex,
319  &key ) ) != 0 ) {
320  rc = -EEFI ( efirc );
321  DBG ( "EFI could not read extended keystroke: %s\n",
322  strerror ( rc ) );
323  return 0;
324  }
325  } else {
326  if ( ( efirc = conin->ReadKeyStroke ( conin,
327  &key.Key ) ) != 0 ) {
328  rc = -EEFI ( efirc );
329  DBG ( "EFI could not read keystroke: %s\n",
330  strerror ( rc ) );
331  return 0;
332  }
333  }
334  DBG2 ( "EFI read key stroke shift %08x toggle %02x unicode %04x "
335  "scancode %04x\n", key.KeyState.KeyShiftState,
336  key.KeyState.KeyToggleState, key.Key.UnicodeChar,
337  key.Key.ScanCode );
338 
339  /* If key has a Unicode representation, remap and return it.
340  * There is unfortunately no way to avoid remapping the
341  * numeric keypad, since EFI destroys the scan code
342  * information that would allow us to differentiate between
343  * main keyboard and numeric keypad.
344  */
345  if ( ( character = key.Key.UnicodeChar ) != 0 ) {
346 
347  /* Apply shift state */
348  shift = key.KeyState.KeyShiftState;
349  if ( shift & EFI_SHIFT_STATE_VALID ) {
350  if ( shift & ( EFI_LEFT_CONTROL_PRESSED |
353  }
354  if ( shift & EFI_RIGHT_ALT_PRESSED ) {
356  }
357  }
358 
359  /* Apply toggle state */
360  toggle = key.KeyState.KeyToggleState;
361  if ( toggle & EFI_TOGGLE_STATE_VALID ) {
362  if ( toggle & EFI_CAPS_LOCK_ACTIVE ) {
364  }
365  }
366 
367  /* Remap and return key */
368  return key_remap ( character );
369  }
370 
371  /* Otherwise, check for a special key that we know about */
372  if ( ( ansi_seq = scancode_to_ansi_seq ( key.Key.ScanCode ) ) ) {
373  /* Start of escape sequence: return ESC (0x1b) */
374  ansi_input = ansi_seq;
375  return 0x1b;
376  }
377 
378  return 0;
379 }
380 
381 /**
382  * Check for character ready to read from EFI console
383  *
384  * @ret True Character available to read
385  * @ret False No character available to read
386  */
387 static int efi_iskey ( void ) {
390  EFI_STATUS efirc;
391 
392  /* If we are mid-sequence, we are always ready */
393  if ( *ansi_input )
394  return 1;
395 
396  /* Check to see if the WaitForKey event has fired */
397  if ( ( efirc = bs->CheckEvent ( conin->WaitForKey ) ) == 0 )
398  return 1;
399 
400  return 0;
401 }
402 
403 /** EFI console driver */
405  .putchar = efi_putchar,
406  .getchar = efi_getchar,
407  .iskey = efi_iskey,
408  .usage = CONSOLE_EFI,
409 };
410 
411 /**
412  * Initialise EFI console
413  *
414  */
415 static void efi_console_init ( void ) {
417  int rc;
418 
419  /* On some older EFI 1.10 implementations, we must use the
420  * (now obsolete) EFI_CONSOLE_CONTROL_PROTOCOL to switch the
421  * console into text mode.
422  */
423  if ( conctrl ) {
424  conctrl->GetMode ( conctrl, &mode, NULL, NULL );
428  }
429  }
430 
431  /* Attempt to open the Simple Text Input Ex protocol on the
432  * console input handle. This is provably unsafe, but is
433  * apparently the expected behaviour for all UEFI
434  * applications. Don't ask.
435  */
438  &efi_conin_ex ) ) == 0 ) {
439  DBG ( "EFI using SimpleTextInputEx\n" );
440  } else {
441  DBG ( "EFI has no SimpleTextInputEx: %s\n", strerror ( rc ) );
442  }
443 }
444 
445 /**
446  * EFI console initialisation function
447  */
448 struct init_fn efi_console_init_fn __init_fn ( INIT_EARLY ) = {
449  .name = "eficonsole",
450  .initialise = efi_console_init,
451 };
#define ATTR_FCOL_MAGENTA
Definition: efi_console.c:44
struct console_driver efi_console __console_driver
EFI console driver.
Definition: efi_console.c:404
static const char * scancode_to_ansi_seq(unsigned int scancode)
Get ANSI escape sequence corresponding to EFI scancode.
Definition: efi_console.c:287
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2099
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
A handler for an escape sequence.
Definition: ansiesc.h:35
Keyboard mappings.
#define EFI_TOGGLE_STATE_VALID
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:175
struct ansiesc_handler * handlers
Array of handlers.
Definition: ansiesc.h:80
EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition
#define SCAN_ESC
Definition: SimpleTextIn.h:75
static EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL * efi_conin_ex
Extended simple text input protocol, if present.
Definition: efi_console.c:74
#define ATTR_BCOL_GREEN
Definition: efi_console.c:51
#define EFI_RIGHT_ALT_PRESSED
EFI_CONSOLE_CONTROL_SCREEN_MODE
Error codes.
The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.
Definition: SimpleTextIn.h:120
#define INIT_EARLY
Early initialisation.
Definition: init.h:30
#define ATTR_FCOL_CYAN
Definition: efi_console.c:42
#define KEYMAP_CTRL
Ctrl key flag.
Definition: keymap.h:56
#define efi_open_unsafe(handle, protocol, interface)
Open protocol for unsafe persistent use.
Definition: efi.h:459
uint16_t mode
Acceleration mode.
Definition: ena.h:26
static unsigned int efi_attr
Current character attribute.
Definition: efi_console.c:67
EFI_HANDLE ConsoleInHandle
The handle for the active console input device.
Definition: UefiSpec.h:2064
FILE_SECBOOT(PERMITTED)
ANSI escape sequence context.
Definition: ansiesc.h:74
struct golan_eq_context ctx
Definition: CIB_PRM.h:28
#define SCAN_LEFT
Definition: SimpleTextIn.h:58
#define CONSOLE_EFI
Definition: efi_console.c:63
#define ATTR_FCOL_GREEN
Definition: efi_console.c:41
#define EFI_RIGHT_CONTROL_PRESSED
#define ATTR_FCOL_MASK
Definition: efi_console.c:38
uint16_t cx
Definition: registers.h:51
static void efi_handle_dectcem_reset(struct ansiesc_context *ctx __unused, unsigned int count __unused, int params[] __unused)
Handle ANSI DECTCEM reset (hide cursor)
Definition: efi_console.c:183
#define SCAN_DOWN
Definition: SimpleTextIn.h:56
EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode
EFI_EVENT WaitForKey
Event to use with WaitForEvent() to wait for a key to be available.
Definition: SimpleTextIn.h:126
static EFI_CONSOLE_CONTROL_PROTOCOL * conctrl
Console control protocol.
Definition: efi_console.c:70
The SIMPLE_TEXT_OUTPUT protocol is used to control text-based output devices.
#define UTF8_INVALID
Invalid character returned when decoding fails.
Definition: utf8.h:55
UTF-8 Unicode encoding.
#define ANSIESC_ED
Erase in page.
Definition: ansiesc.h:107
int ansiesc_process(struct ansiesc_context *ctx, int c)
Process character that may be part of ANSI escape sequence.
Definition: ansiesc.c:75
#define ANSIESC_ED_ALL
Erase whole page.
Definition: ansiesc.h:116
#define ATTR_BOLD
Definition: efi_console.c:36
#define ATTR_BCOL_BLUE
Definition: efi_console.c:50
EFI_TEXT_SET_ATTRIBUTE SetAttribute
#define ANSIESC_CUP
Cursor position.
Definition: ansiesc.h:104
#define SCAN_F12
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface that is associated with ConsoleOutHandle.
Definition: UefiSpec.h:2080
An initialisation function.
Definition: init.h:15
void(* putchar)(int character)
Write a character to the console.
Definition: console.h:69
#define SCAN_HOME
Definition: SimpleTextIn.h:59
static int efi_getchar(void)
Get character from EFI console.
Definition: efi_console.c:300
Assertions.
#define ATTR_BCOL_MAGENTA
Definition: efi_console.c:54
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define SCAN_F6
Definition: SimpleTextIn.h:70
#define KEYMAP_ALTGR
AltGr key flag.
Definition: keymap.h:74
#define SCAN_F10
Definition: SimpleTextIn.h:74
EFI_INPUT_READ_KEY ReadKeyStroke
Definition: SimpleTextIn.h:122
#define __unused
Declare a variable or data structure as unused.
Definition: compiler.h:573
#define ATTR_BCOL_YELLOW
Definition: efi_console.c:55
const char * name
Definition: init.h:16
ANSI escape sequences.
static unsigned int count
Number of entries.
Definition: dwmac.h:225
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is associated with ConsoleInHandle.
Definition: UefiSpec.h:2069
#define ATTR_FCOL_WHITE
Definition: efi_console.c:46
#define ANSIESC_SGR
Select graphic rendition.
Definition: ansiesc.h:119
#define EFI_LEFT_CONTROL_PRESSED
The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL is used on the ConsoleIn device.
#define SCAN_DELETE
Definition: SimpleTextIn.h:62
#define SCAN_F7
Definition: SimpleTextIn.h:71
struct console_driver efi_console
Definition: efi_fbcon.c:53
static struct utf8_accumulator efi_utf8_acc
EFI console UTF-8 accumulator.
Definition: efi_console.c:207
User interaction.
#define ATTR_FCOL_YELLOW
Definition: efi_console.c:45
#define SCAN_PAGE_DOWN
Definition: SimpleTextIn.h:64
unsigned int key_remap(unsigned int character)
Remap a key.
Definition: keymap.c:62
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:79
#define SCAN_F9
Definition: SimpleTextIn.h:73
#define EFI_SHIFT_STATE_VALID
EFI Boot Services Table.
Definition: UefiSpec.h:1931
static void efi_console_init(void)
Initialise EFI console.
Definition: efi_console.c:415
static void efi_handle_dectcem_set(struct ansiesc_context *ctx __unused, unsigned int count __unused, int params[] __unused)
Handle ANSI DECTCEM set (show cursor)
Definition: efi_console.c:168
EFI_TEXT_CLEAR_SCREEN ClearScreen
unsigned char uint8_t
Definition: stdint.h:10
static void efi_handle_sgr(struct ansiesc_context *ctx __unused, unsigned int count, int params[])
Handle ANSI SGR (set graphics rendition)
Definition: efi_console.c:123
#define KEYMAP_CAPSLOCK_REDO
Undo and redo CapsLock key flags.
Definition: keymap.h:71
#define SCAN_UP
Definition: SimpleTextIn.h:55
struct init_fn efi_console_init_fn __init_fn(INIT_EARLY)
EFI console initialisation function.
#define SCAN_F11
EFI_GUID efi_simple_text_input_ex_protocol_guid
Simple text input extension protocol GUID.
Definition: efi_guid.c:353
EFI_TEXT_ENABLE_CURSOR EnableCursor
Console configuration.
#define TRUE
Definition: tlan.h:46
#define ATTR_BCOL_RED
Definition: efi_console.c:53
EFI API.
#define ATTR_BCOL_MASK
Definition: efi_console.c:48
#define ANSIESC_DECTCEM_RESET
Hide cursor.
Definition: ansiesc.h:132
#define SCAN_INSERT
Definition: SimpleTextIn.h:61
#define ANSIESC_DECTCEM_SET
Show cursor.
Definition: ansiesc.h:129
A UTF-8 character accumulator.
Definition: utf8.h:58
FILE_LICENCE(GPL2_OR_LATER)
#define ATTR_FCOL_BLACK
Definition: efi_console.c:39
#define EFI_CAPS_LOCK_ACTIVE
static void efi_putchar(int character)
Print a character to EFI console.
Definition: efi_console.c:214
EFI_CHECK_EVENT CheckEvent
Definition: UefiSpec.h:1960
#define ATTR_FCOL_BLUE
Definition: efi_console.c:40
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:32
#define ATTR_BCOL_WHITE
Definition: efi_console.c:56
#define SCAN_END
Definition: SimpleTextIn.h:60
#define SCAN_RIGHT
Definition: SimpleTextIn.h:57
EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx
unsigned int utf8_accumulate(struct utf8_accumulator *utf8, uint8_t byte)
Accumulate Unicode character from UTF-8 byte sequence.
Definition: utf8.c:44
#define FALSE
Definition: tlan.h:45
static struct ansiesc_handler efi_ansiesc_handlers[]
EFI console ANSI escape sequence handlers.
Definition: efi_console.c:192
static struct ansiesc_context efi_ansiesc_ctx
EFI console ANSI escape sequence context.
Definition: efi_console.c:202
static int efi_iskey(void)
Check for character ready to read from EFI console.
Definition: efi_console.c:387
EFI_REQUEST_PROTOCOL(EFI_CONSOLE_CONTROL_PROTOCOL, &conctrl)
EFI_SYSTEM_TABLE * efi_systab
static const char * ansi_input
Pointer to current ANSI output sequence.
Definition: efi_console.c:246
A console driver.
Definition: console.h:56
unsigned int character
Character in progress.
Definition: utf8.h:60
#define ATTR_BCOL_CYAN
Definition: efi_console.c:52
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode
#define ATTR_DEFAULT
Definition: efi_console.c:58
#define SCAN_PAGE_UP
Definition: SimpleTextIn.h:63
static void efi_handle_ed(struct ansiesc_context *ctx __unused, unsigned int count __unused, int params[] __unused)
Handle ANSI ED (erase in page)
Definition: efi_console.c:105
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322
String functions.
static const char * ansi_sequences[]
Mapping from EFI scan codes to ANSI escape sequences.
Definition: efi_console.c:249
#define SCAN_F5
Definition: SimpleTextIn.h:69
#define ATTR_BCOL_BLACK
Definition: efi_console.c:49
union @391 key
Sense key.
Definition: scsi.h:18
#define ATTR_FCOL_RED
Definition: efi_console.c:43
static void efi_handle_cup(struct ansiesc_context *ctx __unused, unsigned int count __unused, int params[])
Handle ANSI CUP (cursor position)
Definition: efi_console.c:84
#define DBG2(...)
Definition: compiler.h:515
#define SCAN_F8
Definition: SimpleTextIn.h:72
void * memset(void *dest, int character, size_t len) __nonnull