]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/Library/QemuFwCfgLib.h
OvmfPkg QemuFwCfgLib: Fix broken IA32 Microsoft assembler code
[mirror_edk2.git] / OvmfPkg / Include / Library / QemuFwCfgLib.h
CommitLineData
f1ec65ba 1/** @file\r
2 QEMU/KVM Firmware Configuration access\r
3\r
4 Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
105/**\r
106 Reads a UINT8 firmware configuration value\r
107\r
108 @return Value of Firmware Configuration item read\r
109\r
110**/\r
111UINT8\r
112EFIAPI\r
113QemuFwCfgRead8 (\r
114 VOID\r
115 );\r
116\r
117\r
118/**\r
119 Reads a UINT16 firmware configuration value\r
120\r
121 @return Value of Firmware Configuration item read\r
122\r
123**/\r
124UINT16\r
125EFIAPI\r
126QemuFwCfgRead16 (\r
127 VOID\r
128 );\r
129\r
130\r
131/**\r
132 Reads a UINT32 firmware configuration value\r
133\r
134 @return Value of Firmware Configuration item read\r
135\r
136**/\r
137UINT32\r
138EFIAPI\r
139QemuFwCfgRead32 (\r
140 VOID\r
141 );\r
142\r
143\r
144/**\r
145 Reads a UINT64 firmware configuration value\r
146\r
147 @return Value of Firmware Configuration item read\r
148\r
149**/\r
150UINT64\r
151EFIAPI\r
152QemuFwCfgRead64 (\r
153 VOID\r
154 );\r
155\r
156\r
0ac9bc9b 157/**\r
158 Find the configuration item corresponding to the firmware configuration file.\r
159\r
160 @param[in] Name - Name of file to look up.\r
161 @param[out] Item - Configuration item corresponding to the file, to be passed\r
162 to QemuFwCfgSelectItem ().\r
163 @param[out] Size - Number of bytes in the file.\r
164\r
165 @return RETURN_SUCCESS If file is found.\r
166 RETURN_NOT_FOUND If file is not found.\r
167 RETURN_UNSUPPORTED If firmware configuration is unavailable.\r
168\r
169**/\r
170RETURN_STATUS\r
171EFIAPI\r
172QemuFwCfgFindFile (\r
173 IN CONST CHAR8 *Name,\r
174 OUT FIRMWARE_CONFIG_ITEM *Item,\r
175 OUT UINTN *Size\r
176 );\r
f1ec65ba 177#endif\r
178\r