1*530d68baSNigel Croxon #ifndef _EFI_CON_H 2*530d68baSNigel Croxon #define _EFI_CON_H 3*530d68baSNigel Croxon 4*530d68baSNigel Croxon /*++ 5*530d68baSNigel Croxon 6*530d68baSNigel Croxon Copyright (c) 1998 Intel Corporation 7*530d68baSNigel Croxon 8*530d68baSNigel Croxon Module Name: 9*530d68baSNigel Croxon 10*530d68baSNigel Croxon eficon.h 11*530d68baSNigel Croxon 12*530d68baSNigel Croxon Abstract: 13*530d68baSNigel Croxon 14*530d68baSNigel Croxon EFI console protocols 15*530d68baSNigel Croxon 16*530d68baSNigel Croxon 17*530d68baSNigel Croxon 18*530d68baSNigel Croxon Revision History 19*530d68baSNigel Croxon 20*530d68baSNigel Croxon --*/ 21*530d68baSNigel Croxon 22*530d68baSNigel Croxon // 23*530d68baSNigel Croxon // Text output protocol 24*530d68baSNigel Croxon // 25*530d68baSNigel Croxon 26*530d68baSNigel Croxon #define SIMPLE_TEXT_OUTPUT_PROTOCOL \ 27*530d68baSNigel Croxon { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } 28*530d68baSNigel Croxon 29*530d68baSNigel Croxon INTERFACE_DECL(_SIMPLE_TEXT_OUTPUT_INTERFACE); 30*530d68baSNigel Croxon 31*530d68baSNigel Croxon typedef 32*530d68baSNigel Croxon EFI_STATUS 33*530d68baSNigel Croxon (EFIAPI *EFI_TEXT_RESET) ( 34*530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 35*530d68baSNigel Croxon IN BOOLEAN ExtendedVerification 36*530d68baSNigel Croxon ); 37*530d68baSNigel Croxon 38*530d68baSNigel Croxon typedef 39*530d68baSNigel Croxon EFI_STATUS 40*530d68baSNigel Croxon (EFIAPI *EFI_TEXT_OUTPUT_STRING) ( 41*530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 42*530d68baSNigel Croxon IN CHAR16 *String 43*530d68baSNigel Croxon ); 44*530d68baSNigel Croxon 45*530d68baSNigel Croxon typedef 46*530d68baSNigel Croxon EFI_STATUS 47*530d68baSNigel Croxon (EFIAPI *EFI_TEXT_TEST_STRING) ( 48*530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 49*530d68baSNigel Croxon IN CHAR16 *String 50*530d68baSNigel Croxon ); 51*530d68baSNigel Croxon 52*530d68baSNigel Croxon typedef 53*530d68baSNigel Croxon EFI_STATUS 54*530d68baSNigel Croxon (EFIAPI *EFI_TEXT_QUERY_MODE) ( 55*530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 56*530d68baSNigel Croxon IN UINTN ModeNumber, 57*530d68baSNigel Croxon OUT UINTN *Columns, 58*530d68baSNigel Croxon OUT UINTN *Rows 59*530d68baSNigel Croxon ); 60*530d68baSNigel Croxon 61*530d68baSNigel Croxon typedef 62*530d68baSNigel Croxon EFI_STATUS 63*530d68baSNigel Croxon (EFIAPI *EFI_TEXT_SET_MODE) ( 64*530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 65*530d68baSNigel Croxon IN UINTN ModeNumber 66*530d68baSNigel Croxon ); 67*530d68baSNigel Croxon 68*530d68baSNigel Croxon typedef 69*530d68baSNigel Croxon EFI_STATUS 70*530d68baSNigel Croxon (EFIAPI *EFI_TEXT_SET_ATTRIBUTE) ( 71*530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 72*530d68baSNigel Croxon IN UINTN Attribute 73*530d68baSNigel Croxon ); 74*530d68baSNigel Croxon 75*530d68baSNigel Croxon #define EFI_BLACK 0x00 76*530d68baSNigel Croxon #define EFI_BLUE 0x01 77*530d68baSNigel Croxon #define EFI_GREEN 0x02 78*530d68baSNigel Croxon #define EFI_CYAN (EFI_BLUE | EFI_GREEN) 79*530d68baSNigel Croxon #define EFI_RED 0x04 80*530d68baSNigel Croxon #define EFI_MAGENTA (EFI_BLUE | EFI_RED) 81*530d68baSNigel Croxon #define EFI_BROWN (EFI_GREEN | EFI_RED) 82*530d68baSNigel Croxon #define EFI_LIGHTGRAY (EFI_BLUE | EFI_GREEN | EFI_RED) 83*530d68baSNigel Croxon #define EFI_BRIGHT 0x08 84*530d68baSNigel Croxon #define EFI_DARKGRAY (EFI_BRIGHT) 85*530d68baSNigel Croxon #define EFI_LIGHTBLUE (EFI_BLUE | EFI_BRIGHT) 86*530d68baSNigel Croxon #define EFI_LIGHTGREEN (EFI_GREEN | EFI_BRIGHT) 87*530d68baSNigel Croxon #define EFI_LIGHTCYAN (EFI_CYAN | EFI_BRIGHT) 88*530d68baSNigel Croxon #define EFI_LIGHTRED (EFI_RED | EFI_BRIGHT) 89*530d68baSNigel Croxon #define EFI_LIGHTMAGENTA (EFI_MAGENTA | EFI_BRIGHT) 90*530d68baSNigel Croxon #define EFI_YELLOW (EFI_BROWN | EFI_BRIGHT) 91*530d68baSNigel Croxon #define EFI_WHITE (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT) 92*530d68baSNigel Croxon 93*530d68baSNigel Croxon #define EFI_TEXT_ATTR(f,b) ((f) | ((b) << 4)) 94*530d68baSNigel Croxon 95*530d68baSNigel Croxon #define EFI_BACKGROUND_BLACK 0x00 96*530d68baSNigel Croxon #define EFI_BACKGROUND_BLUE 0x10 97*530d68baSNigel Croxon #define EFI_BACKGROUND_GREEN 0x20 98*530d68baSNigel Croxon #define EFI_BACKGROUND_CYAN (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN) 99*530d68baSNigel Croxon #define EFI_BACKGROUND_RED 0x40 100*530d68baSNigel Croxon #define EFI_BACKGROUND_MAGENTA (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED) 101*530d68baSNigel Croxon #define EFI_BACKGROUND_BROWN (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED) 102*530d68baSNigel Croxon #define EFI_BACKGROUND_LIGHTGRAY (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED) 103*530d68baSNigel Croxon 104*530d68baSNigel Croxon 105*530d68baSNigel Croxon typedef 106*530d68baSNigel Croxon EFI_STATUS 107*530d68baSNigel Croxon (EFIAPI *EFI_TEXT_CLEAR_SCREEN) ( 108*530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This 109*530d68baSNigel Croxon ); 110*530d68baSNigel Croxon 111*530d68baSNigel Croxon typedef 112*530d68baSNigel Croxon EFI_STATUS 113*530d68baSNigel Croxon (EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) ( 114*530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 115*530d68baSNigel Croxon IN UINTN Column, 116*530d68baSNigel Croxon IN UINTN Row 117*530d68baSNigel Croxon ); 118*530d68baSNigel Croxon 119*530d68baSNigel Croxon typedef 120*530d68baSNigel Croxon EFI_STATUS 121*530d68baSNigel Croxon (EFIAPI *EFI_TEXT_ENABLE_CURSOR) ( 122*530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 123*530d68baSNigel Croxon IN BOOLEAN Enable 124*530d68baSNigel Croxon ); 125*530d68baSNigel Croxon 126*530d68baSNigel Croxon typedef struct { 127*530d68baSNigel Croxon INT32 MaxMode; 128*530d68baSNigel Croxon // current settings 129*530d68baSNigel Croxon INT32 Mode; 130*530d68baSNigel Croxon INT32 Attribute; 131*530d68baSNigel Croxon INT32 CursorColumn; 132*530d68baSNigel Croxon INT32 CursorRow; 133*530d68baSNigel Croxon BOOLEAN CursorVisible; 134*530d68baSNigel Croxon } SIMPLE_TEXT_OUTPUT_MODE; 135*530d68baSNigel Croxon 136*530d68baSNigel Croxon typedef struct _SIMPLE_TEXT_OUTPUT_INTERFACE { 137*530d68baSNigel Croxon EFI_TEXT_RESET Reset; 138*530d68baSNigel Croxon 139*530d68baSNigel Croxon EFI_TEXT_OUTPUT_STRING OutputString; 140*530d68baSNigel Croxon EFI_TEXT_TEST_STRING TestString; 141*530d68baSNigel Croxon 142*530d68baSNigel Croxon EFI_TEXT_QUERY_MODE QueryMode; 143*530d68baSNigel Croxon EFI_TEXT_SET_MODE SetMode; 144*530d68baSNigel Croxon EFI_TEXT_SET_ATTRIBUTE SetAttribute; 145*530d68baSNigel Croxon 146*530d68baSNigel Croxon EFI_TEXT_CLEAR_SCREEN ClearScreen; 147*530d68baSNigel Croxon EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition; 148*530d68baSNigel Croxon EFI_TEXT_ENABLE_CURSOR EnableCursor; 149*530d68baSNigel Croxon 150*530d68baSNigel Croxon // Current mode 151*530d68baSNigel Croxon SIMPLE_TEXT_OUTPUT_MODE *Mode; 152*530d68baSNigel Croxon } SIMPLE_TEXT_OUTPUT_INTERFACE; 153*530d68baSNigel Croxon 154*530d68baSNigel Croxon // 155*530d68baSNigel Croxon // Define's for required EFI Unicode Box Draw character 156*530d68baSNigel Croxon // 157*530d68baSNigel Croxon 158*530d68baSNigel Croxon #define BOXDRAW_HORIZONTAL 0x2500 159*530d68baSNigel Croxon #define BOXDRAW_VERTICAL 0x2502 160*530d68baSNigel Croxon #define BOXDRAW_DOWN_RIGHT 0x250c 161*530d68baSNigel Croxon #define BOXDRAW_DOWN_LEFT 0x2510 162*530d68baSNigel Croxon #define BOXDRAW_UP_RIGHT 0x2514 163*530d68baSNigel Croxon #define BOXDRAW_UP_LEFT 0x2518 164*530d68baSNigel Croxon #define BOXDRAW_VERTICAL_RIGHT 0x251c 165*530d68baSNigel Croxon #define BOXDRAW_VERTICAL_LEFT 0x2524 166*530d68baSNigel Croxon #define BOXDRAW_DOWN_HORIZONTAL 0x252c 167*530d68baSNigel Croxon #define BOXDRAW_UP_HORIZONTAL 0x2534 168*530d68baSNigel Croxon #define BOXDRAW_VERTICAL_HORIZONTAL 0x253c 169*530d68baSNigel Croxon 170*530d68baSNigel Croxon #define BOXDRAW_DOUBLE_HORIZONTAL 0x2550 171*530d68baSNigel Croxon #define BOXDRAW_DOUBLE_VERTICAL 0x2551 172*530d68baSNigel Croxon #define BOXDRAW_DOWN_RIGHT_DOUBLE 0x2552 173*530d68baSNigel Croxon #define BOXDRAW_DOWN_DOUBLE_RIGHT 0x2553 174*530d68baSNigel Croxon #define BOXDRAW_DOUBLE_DOWN_RIGHT 0x2554 175*530d68baSNigel Croxon 176*530d68baSNigel Croxon #define BOXDRAW_DOWN_LEFT_DOUBLE 0x2555 177*530d68baSNigel Croxon #define BOXDRAW_DOWN_DOUBLE_LEFT 0x2556 178*530d68baSNigel Croxon #define BOXDRAW_DOUBLE_DOWN_LEFT 0x2557 179*530d68baSNigel Croxon 180*530d68baSNigel Croxon #define BOXDRAW_UP_RIGHT_DOUBLE 0x2558 181*530d68baSNigel Croxon #define BOXDRAW_UP_DOUBLE_RIGHT 0x2559 182*530d68baSNigel Croxon #define BOXDRAW_DOUBLE_UP_RIGHT 0x255a 183*530d68baSNigel Croxon 184*530d68baSNigel Croxon #define BOXDRAW_UP_LEFT_DOUBLE 0x255b 185*530d68baSNigel Croxon #define BOXDRAW_UP_DOUBLE_LEFT 0x255c 186*530d68baSNigel Croxon #define BOXDRAW_DOUBLE_UP_LEFT 0x255d 187*530d68baSNigel Croxon 188*530d68baSNigel Croxon #define BOXDRAW_VERTICAL_RIGHT_DOUBLE 0x255e 189*530d68baSNigel Croxon #define BOXDRAW_VERTICAL_DOUBLE_RIGHT 0x255f 190*530d68baSNigel Croxon #define BOXDRAW_DOUBLE_VERTICAL_RIGHT 0x2560 191*530d68baSNigel Croxon 192*530d68baSNigel Croxon #define BOXDRAW_VERTICAL_LEFT_DOUBLE 0x2561 193*530d68baSNigel Croxon #define BOXDRAW_VERTICAL_DOUBLE_LEFT 0x2562 194*530d68baSNigel Croxon #define BOXDRAW_DOUBLE_VERTICAL_LEFT 0x2563 195*530d68baSNigel Croxon 196*530d68baSNigel Croxon #define BOXDRAW_DOWN_HORIZONTAL_DOUBLE 0x2564 197*530d68baSNigel Croxon #define BOXDRAW_DOWN_DOUBLE_HORIZONTAL 0x2565 198*530d68baSNigel Croxon #define BOXDRAW_DOUBLE_DOWN_HORIZONTAL 0x2566 199*530d68baSNigel Croxon 200*530d68baSNigel Croxon #define BOXDRAW_UP_HORIZONTAL_DOUBLE 0x2567 201*530d68baSNigel Croxon #define BOXDRAW_UP_DOUBLE_HORIZONTAL 0x2568 202*530d68baSNigel Croxon #define BOXDRAW_DOUBLE_UP_HORIZONTAL 0x2569 203*530d68baSNigel Croxon 204*530d68baSNigel Croxon #define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE 0x256a 205*530d68baSNigel Croxon #define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256b 206*530d68baSNigel Croxon #define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256c 207*530d68baSNigel Croxon 208*530d68baSNigel Croxon // 209*530d68baSNigel Croxon // EFI Required Block Elements Code Chart 210*530d68baSNigel Croxon // 211*530d68baSNigel Croxon 212*530d68baSNigel Croxon #define BLOCKELEMENT_FULL_BLOCK 0x2588 213*530d68baSNigel Croxon #define BLOCKELEMENT_LIGHT_SHADE 0x2591 214*530d68baSNigel Croxon // 215*530d68baSNigel Croxon // EFI Required Geometric Shapes Code Chart 216*530d68baSNigel Croxon // 217*530d68baSNigel Croxon 218*530d68baSNigel Croxon #define GEOMETRICSHAPE_UP_TRIANGLE 0x25b2 219*530d68baSNigel Croxon #define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba 220*530d68baSNigel Croxon #define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25bc 221*530d68baSNigel Croxon #define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25c4 222*530d68baSNigel Croxon 223*530d68baSNigel Croxon // 224*530d68baSNigel Croxon // EFI Required Arrow shapes 225*530d68baSNigel Croxon // 226*530d68baSNigel Croxon 227*530d68baSNigel Croxon #define ARROW_UP 0x2191 228*530d68baSNigel Croxon #define ARROW_DOWN 0x2193 229*530d68baSNigel Croxon 230*530d68baSNigel Croxon // 231*530d68baSNigel Croxon // Text input protocol 232*530d68baSNigel Croxon // 233*530d68baSNigel Croxon 234*530d68baSNigel Croxon #define SIMPLE_TEXT_INPUT_PROTOCOL \ 235*530d68baSNigel Croxon { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } 236*530d68baSNigel Croxon 237*530d68baSNigel Croxon INTERFACE_DECL(_SIMPLE_INPUT_INTERFACE); 238*530d68baSNigel Croxon 239*530d68baSNigel Croxon typedef struct { 240*530d68baSNigel Croxon UINT16 ScanCode; 241*530d68baSNigel Croxon CHAR16 UnicodeChar; 242*530d68baSNigel Croxon } EFI_INPUT_KEY; 243*530d68baSNigel Croxon 244*530d68baSNigel Croxon // 245*530d68baSNigel Croxon // Baseline unicode control chars 246*530d68baSNigel Croxon // 247*530d68baSNigel Croxon 248*530d68baSNigel Croxon #define CHAR_NULL 0x0000 249*530d68baSNigel Croxon #define CHAR_BACKSPACE 0x0008 250*530d68baSNigel Croxon #define CHAR_TAB 0x0009 251*530d68baSNigel Croxon #define CHAR_LINEFEED 0x000A 252*530d68baSNigel Croxon #define CHAR_CARRIAGE_RETURN 0x000D 253*530d68baSNigel Croxon 254*530d68baSNigel Croxon // 255*530d68baSNigel Croxon // Scan codes for base line keys 256*530d68baSNigel Croxon // 257*530d68baSNigel Croxon 258*530d68baSNigel Croxon #define SCAN_NULL 0x0000 259*530d68baSNigel Croxon #define SCAN_UP 0x0001 260*530d68baSNigel Croxon #define SCAN_DOWN 0x0002 261*530d68baSNigel Croxon #define SCAN_RIGHT 0x0003 262*530d68baSNigel Croxon #define SCAN_LEFT 0x0004 263*530d68baSNigel Croxon #define SCAN_HOME 0x0005 264*530d68baSNigel Croxon #define SCAN_END 0x0006 265*530d68baSNigel Croxon #define SCAN_INSERT 0x0007 266*530d68baSNigel Croxon #define SCAN_DELETE 0x0008 267*530d68baSNigel Croxon #define SCAN_PAGE_UP 0x0009 268*530d68baSNigel Croxon #define SCAN_PAGE_DOWN 0x000A 269*530d68baSNigel Croxon #define SCAN_F1 0x000B 270*530d68baSNigel Croxon #define SCAN_F2 0x000C 271*530d68baSNigel Croxon #define SCAN_F3 0x000D 272*530d68baSNigel Croxon #define SCAN_F4 0x000E 273*530d68baSNigel Croxon #define SCAN_F5 0x000F 274*530d68baSNigel Croxon #define SCAN_F6 0x0010 275*530d68baSNigel Croxon #define SCAN_F7 0x0011 276*530d68baSNigel Croxon #define SCAN_F8 0x0012 277*530d68baSNigel Croxon #define SCAN_F9 0x0013 278*530d68baSNigel Croxon #define SCAN_F10 0x0014 279*530d68baSNigel Croxon #define SCAN_ESC 0x0017 280*530d68baSNigel Croxon 281*530d68baSNigel Croxon typedef 282*530d68baSNigel Croxon EFI_STATUS 283*530d68baSNigel Croxon (EFIAPI *EFI_INPUT_RESET) ( 284*530d68baSNigel Croxon IN struct _SIMPLE_INPUT_INTERFACE *This, 285*530d68baSNigel Croxon IN BOOLEAN ExtendedVerification 286*530d68baSNigel Croxon ); 287*530d68baSNigel Croxon 288*530d68baSNigel Croxon typedef 289*530d68baSNigel Croxon EFI_STATUS 290*530d68baSNigel Croxon (EFIAPI *EFI_INPUT_READ_KEY) ( 291*530d68baSNigel Croxon IN struct _SIMPLE_INPUT_INTERFACE *This, 292*530d68baSNigel Croxon OUT EFI_INPUT_KEY *Key 293*530d68baSNigel Croxon ); 294*530d68baSNigel Croxon 295*530d68baSNigel Croxon typedef struct _SIMPLE_INPUT_INTERFACE { 296*530d68baSNigel Croxon EFI_INPUT_RESET Reset; 297*530d68baSNigel Croxon EFI_INPUT_READ_KEY ReadKeyStroke; 298*530d68baSNigel Croxon EFI_EVENT WaitForKey; 299*530d68baSNigel Croxon } SIMPLE_INPUT_INTERFACE; 300*530d68baSNigel Croxon 301*530d68baSNigel Croxon #endif 302*530d68baSNigel Croxon 303