]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/Library/QemuFwCfgLib.h
OvmfPkg/create-release.py: Read License.txt files
[mirror_edk2.git] / OvmfPkg / Include / Library / QemuFwCfgLib.h
CommitLineData
f1ec65ba 1/** @file\r
2 QEMU/KVM Firmware Configuration access\r
3\r
29874a8c 4 Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r
f1ec65ba 5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __FW_CFG_LIB__\r
16#define __FW_CFG_LIB__\r
17\r
18typedef enum {\r
19 QemuFwCfgItemSignature = 0x0000,\r
20 QemuFwCfgItemInterfaceVersion = 0x0001,\r
21 QemuFwCfgItemSystemUuid = 0x0002,\r
22 QemuFwCfgItemRamSize = 0x0003,\r
23 QemuFwCfgItemGraphicsEnabled = 0x0004,\r
24 QemuFwCfgItemSmpCpuCount = 0x0005,\r
25 QemuFwCfgItemMachineId = 0x0006,\r
26 QemuFwCfgItemKernelAddress = 0x0007,\r
27 QemuFwCfgItemKernelSize = 0x0008,\r
28 QemuFwCfgItemKernelCommandLine = 0x0009,\r
29 QemuFwCfgItemInitrdAddress = 0x000a,\r
30 QemuFwCfgItemInitrdSize = 0x000b,\r
31 QemuFwCfgItemBootDevice = 0x000c,\r
32 QemuFwCfgItemNumaData = 0x000d,\r
33 QemuFwCfgItemBootMenu = 0x000e,\r
34 QemuFwCfgItemMaximumCpuCount = 0x000f,\r
35 QemuFwCfgItemKernelEntry = 0x0010,\r
36 QemuFwCfgItemKernelData = 0x0011,\r
37 QemuFwCfgItemInitrdData = 0x0012,\r
38 QemuFwCfgItemCommandLineAddress = 0x0013,\r
39 QemuFwCfgItemCommandLineSize = 0x0014,\r
40 QemuFwCfgItemCommandLineData = 0x0015,\r
41 QemuFwCfgItemKernelSetupAddress = 0x0016,\r
42 QemuFwCfgItemKernelSetupSize = 0x0017,\r
43 QemuFwCfgItemKernelSetupData = 0x0018,\r
0ac9bc9b 44 QemuFwCfgItemFileDir = 0x0019,\r
f1ec65ba 45\r
46 QemuFwCfgItemX86AcpiTables = 0x8000,\r
47 QemuFwCfgItemX86SmbiosTables = 0x8001,\r
48 QemuFwCfgItemX86Irq0Override = 0x8002,\r
49 QemuFwCfgItemX86E820Table = 0x8003,\r
50 QemuFwCfgItemX86HpetData = 0x8004,\r
51\r
52} FIRMWARE_CONFIG_ITEM;\r
53\r
54\r
55/**\r
56 Returns a boolean indicating if the firmware configuration interface\r
57 is available or not.\r
58\r
59 @retval TRUE The interface is available\r
60 @retval FALSE The interface is not available\r
61\r
62**/\r
63BOOLEAN\r
64EFIAPI\r
65QemuFwCfgIsAvailable (\r
66 VOID\r
67 );\r
68\r
69\r
70/**\r
71 Selects a firmware configuration item for reading.\r
72\r
73 Following this call, any data read from this item will start from\r
74 the beginning of the configuration item's data.\r
75\r
76 @param[in] QemuFwCfgItem - Firmware Configuration item to read\r
77\r
78**/\r
79VOID\r
80EFIAPI\r
81QemuFwCfgSelectItem (\r
82 IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem\r
83 );\r
84\r
85\r
86/**\r
87 Reads firmware configuration bytes into a buffer\r
88\r
89 If called multiple times, then the data read will\r
90 continue at the offset of the firmware configuration\r
91 item where the previous read ended.\r
92\r
93 @param[in] Size - Size in bytes to read\r
94 @param[in] Buffer - Buffer to store data into\r
95\r
96**/\r
97VOID\r
98EFIAPI\r
99QemuFwCfgReadBytes (\r
100 IN UINTN Size,\r
101 IN VOID *Buffer OPTIONAL\r
102 );\r
103\r
104\r
29874a8c 105/**\r
106 Writes firmware configuration bytes from a buffer\r
107\r
108 If called multiple times, then the data written will\r
109 continue at the offset of the firmware configuration\r
110 item where the previous write ended.\r
111\r
112 @param[in] Size - Size in bytes to write\r
113 @param[in] Buffer - Buffer to read data from\r
114\r
115**/\r
116VOID\r
117EFIAPI\r
118QemuFwCfgWriteBytes (\r
119 IN UINTN Size,\r
120 IN VOID *Buffer\r
121 );\r
122\r
123\r
f1ec65ba 124/**\r
125 Reads a UINT8 firmware configuration value\r
126\r
127 @return Value of Firmware Configuration item read\r
128\r
129**/\r
130UINT8\r
131EFIAPI\r
132QemuFwCfgRead8 (\r
133 VOID\r
134 );\r
135\r
136\r
137/**\r
138 Reads a UINT16 firmware configuration value\r
139\r
140 @return Value of Firmware Configuration item read\r
141\r
142**/\r
143UINT16\r
144EFIAPI\r
145QemuFwCfgRead16 (\r
146 VOID\r
147 );\r
148\r
149\r
150/**\r
151 Reads a UINT32 firmware configuration value\r
152\r
153 @return Value of Firmware Configuration item read\r
154\r
155**/\r
156UINT32\r
157EFIAPI\r
158QemuFwCfgRead32 (\r
159 VOID\r
160 );\r
161\r
162\r
163/**\r
164 Reads a UINT64 firmware configuration value\r
165\r
166 @return Value of Firmware Configuration item read\r
167\r
168**/\r
169UINT64\r
170EFIAPI\r
171QemuFwCfgRead64 (\r
172 VOID\r
173 );\r
174\r
175\r
0ac9bc9b 176/**\r
177 Find the configuration item corresponding to the firmware configuration file.\r
178\r
179 @param[in] Name - Name of file to look up.\r
180 @param[out] Item - Configuration item corresponding to the file, to be passed\r
181 to QemuFwCfgSelectItem ().\r
182 @param[out] Size - Number of bytes in the file.\r
183\r
184 @return RETURN_SUCCESS If file is found.\r
185 RETURN_NOT_FOUND If file is not found.\r
186 RETURN_UNSUPPORTED If firmware configuration is unavailable.\r
187\r
188**/\r
189RETURN_STATUS\r
190EFIAPI\r
191QemuFwCfgFindFile (\r
192 IN CONST CHAR8 *Name,\r
193 OUT FIRMWARE_CONFIG_ITEM *Item,\r
194 OUT UINTN *Size\r
195 );\r
f1ec65ba 196#endif\r
197\r