2 QEMU/KVM Firmware Configuration access
4 Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
5 Copyright (C) 2013, Red Hat, Inc.
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #ifndef __FW_CFG_LIB__
18 #define __FW_CFG_LIB__
20 #include <IndustryStandard/QemuFwCfg.h>
23 Returns a boolean indicating if the firmware configuration interface
26 This function may change fw_cfg state.
28 @retval TRUE The interface is available
29 @retval FALSE The interface is not available
34 QemuFwCfgIsAvailable (
40 Selects a firmware configuration item for reading.
42 Following this call, any data read from this item will start from
43 the beginning of the configuration item's data.
45 @param[in] QemuFwCfgItem - Firmware Configuration item to read
51 IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem
56 Reads firmware configuration bytes into a buffer
58 If called multiple times, then the data read will
59 continue at the offset of the firmware configuration
60 item where the previous read ended.
62 @param[in] Size - Size in bytes to read
63 @param[in] Buffer - Buffer to store data into
70 IN VOID
*Buffer OPTIONAL
75 Writes firmware configuration bytes from a buffer
77 If called multiple times, then the data written will
78 continue at the offset of the firmware configuration
79 item where the previous write ended.
81 @param[in] Size - Size in bytes to write
82 @param[in] Buffer - Buffer to read data from
94 Skip bytes in the firmware configuration item.
96 Increase the offset of the firmware configuration item without transferring
97 bytes between the item and a caller-provided buffer. Subsequent read, write
98 or skip operations will commence at the increased offset.
100 @param[in] Size Number of bytes to skip.
110 Reads a UINT8 firmware configuration value
112 @return Value of Firmware Configuration item read
123 Reads a UINT16 firmware configuration value
125 @return Value of Firmware Configuration item read
136 Reads a UINT32 firmware configuration value
138 @return Value of Firmware Configuration item read
149 Reads a UINT64 firmware configuration value
151 @return Value of Firmware Configuration item read
162 Find the configuration item corresponding to the firmware configuration file.
164 @param[in] Name - Name of file to look up.
165 @param[out] Item - Configuration item corresponding to the file, to be passed
166 to QemuFwCfgSelectItem ().
167 @param[out] Size - Number of bytes in the file.
169 @return RETURN_SUCCESS If file is found.
170 RETURN_NOT_FOUND If file is not found.
171 RETURN_UNSUPPORTED If firmware configuration is unavailable.
177 IN CONST CHAR8
*Name
,
178 OUT FIRMWARE_CONFIG_ITEM
*Item
,