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 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef __FW_CFG_LIB__
12 #define __FW_CFG_LIB__
14 #include <IndustryStandard/QemuFwCfg.h>
17 Returns a boolean indicating if the firmware configuration interface
20 This function may change fw_cfg state.
22 @retval TRUE The interface is available
23 @retval FALSE The interface is not available
28 QemuFwCfgIsAvailable (
34 Selects a firmware configuration item for reading.
36 Following this call, any data read from this item will start from
37 the beginning of the configuration item's data.
39 @param[in] QemuFwCfgItem - Firmware Configuration item to read
45 IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem
50 Reads firmware configuration bytes into a buffer
52 If called multiple times, then the data read will
53 continue at the offset of the firmware configuration
54 item where the previous read ended.
56 @param[in] Size - Size in bytes to read
57 @param[in] Buffer - Buffer to store data into
64 IN VOID
*Buffer OPTIONAL
69 Writes firmware configuration bytes from a buffer
71 If called multiple times, then the data written will
72 continue at the offset of the firmware configuration
73 item where the previous write ended.
75 @param[in] Size - Size in bytes to write
76 @param[in] Buffer - Buffer to read data from
88 Skip bytes in the firmware configuration item.
90 Increase the offset of the firmware configuration item without transferring
91 bytes between the item and a caller-provided buffer. Subsequent read, write
92 or skip operations will commence at the increased offset.
94 @param[in] Size Number of bytes to skip.
104 Reads a UINT8 firmware configuration value
106 @return Value of Firmware Configuration item read
117 Reads a UINT16 firmware configuration value
119 @return Value of Firmware Configuration item read
130 Reads a UINT32 firmware configuration value
132 @return Value of Firmware Configuration item read
143 Reads a UINT64 firmware configuration value
145 @return Value of Firmware Configuration item read
156 Find the configuration item corresponding to the firmware configuration file.
158 @param[in] Name - Name of file to look up.
159 @param[out] Item - Configuration item corresponding to the file, to be passed
160 to QemuFwCfgSelectItem ().
161 @param[out] Size - Number of bytes in the file.
163 @return RETURN_SUCCESS If file is found.
164 RETURN_NOT_FOUND If file is not found.
165 RETURN_UNSUPPORTED If firmware configuration is unavailable.
171 IN CONST CHAR8
*Name
,
172 OUT FIRMWARE_CONFIG_ITEM
*Item
,