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