~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/ipxe/src/include/ipxe/efi/Protocol/SimpleTextIn.h

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** @file
 
2
  Simple Text Input protocol from the UEFI 2.0 specification.
 
3
 
 
4
  Abstraction of a very simple input device like a keyboard or serial
 
5
  terminal.
 
6
 
 
7
  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
 
8
  This program and the accompanying materials
 
9
  are licensed and made available under the terms and conditions of the BSD License
 
10
  which accompanies this distribution.  The full text of the license may be found at
 
11
  http://opensource.org/licenses/bsd-license.php
 
12
 
 
13
  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 
14
  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
15
 
 
16
**/
 
17
 
 
18
#ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__
 
19
#define __SIMPLE_TEXT_IN_PROTOCOL_H__
 
20
 
 
21
FILE_LICENCE ( BSD3 );
 
22
 
 
23
#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
 
24
  { \
 
25
    0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
 
26
  }
 
27
 
 
28
typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL  EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
 
29
 
 
30
///
 
31
/// Protocol GUID name defined in EFI1.1.
 
32
///
 
33
#define SIMPLE_INPUT_PROTOCOL   EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
 
34
 
 
35
///
 
36
/// Protocol name in EFI1.1 for backward-compatible.
 
37
///
 
38
typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL  SIMPLE_INPUT_INTERFACE;
 
39
 
 
40
///
 
41
/// The keystroke information for the key that was pressed.
 
42
///
 
43
typedef struct {
 
44
  UINT16  ScanCode;
 
45
  CHAR16  UnicodeChar;
 
46
} EFI_INPUT_KEY;
 
47
 
 
48
//
 
49
// Required unicode control chars
 
50
//
 
51
#define CHAR_NULL             0x0000
 
52
#define CHAR_BACKSPACE        0x0008
 
53
#define CHAR_TAB              0x0009
 
54
#define CHAR_LINEFEED         0x000A
 
55
#define CHAR_CARRIAGE_RETURN  0x000D
 
56
 
 
57
//
 
58
// EFI Scan codes
 
59
//
 
60
#define SCAN_NULL       0x0000
 
61
#define SCAN_UP         0x0001
 
62
#define SCAN_DOWN       0x0002
 
63
#define SCAN_RIGHT      0x0003
 
64
#define SCAN_LEFT       0x0004
 
65
#define SCAN_HOME       0x0005
 
66
#define SCAN_END        0x0006
 
67
#define SCAN_INSERT     0x0007
 
68
#define SCAN_DELETE     0x0008
 
69
#define SCAN_PAGE_UP    0x0009
 
70
#define SCAN_PAGE_DOWN  0x000A
 
71
#define SCAN_F1         0x000B
 
72
#define SCAN_F2         0x000C
 
73
#define SCAN_F3         0x000D
 
74
#define SCAN_F4         0x000E
 
75
#define SCAN_F5         0x000F
 
76
#define SCAN_F6         0x0010
 
77
#define SCAN_F7         0x0011
 
78
#define SCAN_F8         0x0012
 
79
#define SCAN_F9         0x0013
 
80
#define SCAN_F10        0x0014
 
81
#define SCAN_ESC        0x0017
 
82
 
 
83
/**
 
84
  Reset the input device and optionally run diagnostics
 
85
 
 
86
  @param  This                 Protocol instance pointer.
 
87
  @param  ExtendedVerification Driver may perform diagnostics on reset.
 
88
 
 
89
  @retval EFI_SUCCESS          The device was reset.
 
90
  @retval EFI_DEVICE_ERROR     The device is not functioning properly and could not be reset.
 
91
 
 
92
**/
 
93
typedef
 
94
EFI_STATUS
 
95
(EFIAPI *EFI_INPUT_RESET)(
 
96
  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL       *This,
 
97
  IN BOOLEAN                              ExtendedVerification
 
98
  );
 
99
 
 
100
/**
 
101
  Reads the next keystroke from the input device. The WaitForKey Event can
 
102
  be used to test for existence of a keystroke via WaitForEvent () call.
 
103
 
 
104
  @param  This  Protocol instance pointer.
 
105
  @param  Key   A pointer to a buffer that is filled in with the keystroke
 
106
                information for the key that was pressed.
 
107
 
 
108
  @retval EFI_SUCCESS      The keystroke information was returned.
 
109
  @retval EFI_NOT_READY    There was no keystroke data available.
 
110
  @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
 
111
                           hardware errors.
 
112
 
 
113
**/
 
114
typedef
 
115
EFI_STATUS
 
116
(EFIAPI *EFI_INPUT_READ_KEY)(
 
117
  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL       *This,
 
118
  OUT EFI_INPUT_KEY                       *Key
 
119
  );
 
120
 
 
121
///
 
122
/// The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.
 
123
/// It is the minimum required protocol for ConsoleIn.
 
124
///
 
125
struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
 
126
  EFI_INPUT_RESET     Reset;
 
127
  EFI_INPUT_READ_KEY  ReadKeyStroke;
 
128
  ///
 
129
  /// Event to use with WaitForEvent() to wait for a key to be available
 
130
  ///
 
131
  EFI_EVENT           WaitForKey;
 
132
};
 
133
 
 
134
extern EFI_GUID gEfiSimpleTextInProtocolGuid;
 
135
 
 
136
#endif