2 QEMU/KVM Firmware Configuration access
4 Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __FW_CFG_LIB__
16 #define __FW_CFG_LIB__
19 QemuFwCfgItemSignature
= 0x0000,
20 QemuFwCfgItemInterfaceVersion
= 0x0001,
21 QemuFwCfgItemSystemUuid
= 0x0002,
22 QemuFwCfgItemRamSize
= 0x0003,
23 QemuFwCfgItemGraphicsEnabled
= 0x0004,
24 QemuFwCfgItemSmpCpuCount
= 0x0005,
25 QemuFwCfgItemMachineId
= 0x0006,
26 QemuFwCfgItemKernelAddress
= 0x0007,
27 QemuFwCfgItemKernelSize
= 0x0008,
28 QemuFwCfgItemKernelCommandLine
= 0x0009,
29 QemuFwCfgItemInitrdAddress
= 0x000a,
30 QemuFwCfgItemInitrdSize
= 0x000b,
31 QemuFwCfgItemBootDevice
= 0x000c,
32 QemuFwCfgItemNumaData
= 0x000d,
33 QemuFwCfgItemBootMenu
= 0x000e,
34 QemuFwCfgItemMaximumCpuCount
= 0x000f,
35 QemuFwCfgItemKernelEntry
= 0x0010,
36 QemuFwCfgItemKernelData
= 0x0011,
37 QemuFwCfgItemInitrdData
= 0x0012,
38 QemuFwCfgItemCommandLineAddress
= 0x0013,
39 QemuFwCfgItemCommandLineSize
= 0x0014,
40 QemuFwCfgItemCommandLineData
= 0x0015,
41 QemuFwCfgItemKernelSetupAddress
= 0x0016,
42 QemuFwCfgItemKernelSetupSize
= 0x0017,
43 QemuFwCfgItemKernelSetupData
= 0x0018,
44 QemuFwCfgItemFileDir
= 0x0019,
46 QemuFwCfgItemX86AcpiTables
= 0x8000,
47 QemuFwCfgItemX86SmbiosTables
= 0x8001,
48 QemuFwCfgItemX86Irq0Override
= 0x8002,
49 QemuFwCfgItemX86E820Table
= 0x8003,
50 QemuFwCfgItemX86HpetData
= 0x8004,
52 } FIRMWARE_CONFIG_ITEM
;
56 Returns a boolean indicating if the firmware configuration interface
59 @retval TRUE The interface is available
60 @retval FALSE The interface is not available
65 QemuFwCfgIsAvailable (
71 Selects a firmware configuration item for reading.
73 Following this call, any data read from this item will start from
74 the beginning of the configuration item's data.
76 @param[in] QemuFwCfgItem - Firmware Configuration item to read
82 IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem
87 Reads firmware configuration bytes into a buffer
89 If called multiple times, then the data read will
90 continue at the offset of the firmware configuration
91 item where the previous read ended.
93 @param[in] Size - Size in bytes to read
94 @param[in] Buffer - Buffer to store data into
101 IN VOID
*Buffer OPTIONAL
106 Writes firmware configuration bytes from a buffer
108 If called multiple times, then the data written will
109 continue at the offset of the firmware configuration
110 item where the previous write ended.
112 @param[in] Size - Size in bytes to write
113 @param[in] Buffer - Buffer to read data from
118 QemuFwCfgWriteBytes (
125 Reads a UINT8 firmware configuration value
127 @return Value of Firmware Configuration item read
138 Reads a UINT16 firmware configuration value
140 @return Value of Firmware Configuration item read
151 Reads a UINT32 firmware configuration value
153 @return Value of Firmware Configuration item read
164 Reads a UINT64 firmware configuration value
166 @return Value of Firmware Configuration item read
177 Find the configuration item corresponding to the firmware configuration file.
179 @param[in] Name - Name of file to look up.
180 @param[out] Item - Configuration item corresponding to the file, to be passed
181 to QemuFwCfgSelectItem ().
182 @param[out] Size - Number of bytes in the file.
184 @return RETURN_SUCCESS If file is found.
185 RETURN_NOT_FOUND If file is not found.
186 RETURN_UNSUPPORTED If firmware configuration is unavailable.
192 IN CONST CHAR8
*Name
,
193 OUT FIRMWARE_CONFIG_ITEM
*Item
,