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 (
33 Selects a firmware configuration item for reading.
35 Following this call, any data read from this item will start from
36 the beginning of the configuration item's data.
38 @param[in] QemuFwCfgItem - Firmware Configuration item to read
44 IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem
48 Reads firmware configuration bytes into a buffer
50 If called multiple times, then the data read will
51 continue at the offset of the firmware configuration
52 item where the previous read ended.
54 @param[in] Size - Size in bytes to read
55 @param[in] Buffer - Buffer to store data into
62 IN VOID
*Buffer OPTIONAL
66 Writes firmware configuration bytes from a buffer
68 If called multiple times, then the data written will
69 continue at the offset of the firmware configuration
70 item where the previous write ended.
72 @param[in] Size - Size in bytes to write
73 @param[in] Buffer - Buffer to read data from
84 Skip bytes in the firmware configuration item.
86 Increase the offset of the firmware configuration item without transferring
87 bytes between the item and a caller-provided buffer. Subsequent read, write
88 or skip operations will commence at the increased offset.
90 @param[in] Size Number of bytes to skip.
99 Reads a UINT8 firmware configuration value
101 @return Value of Firmware Configuration item read
111 Reads a UINT16 firmware configuration value
113 @return Value of Firmware Configuration item read
123 Reads a UINT32 firmware configuration value
125 @return Value of Firmware Configuration item read
135 Reads a UINT64 firmware configuration value
137 @return Value of Firmware Configuration item read
147 Find the configuration item corresponding to the firmware configuration file.
149 @param[in] Name - Name of file to look up.
150 @param[out] Item - Configuration item corresponding to the file, to be passed
151 to QemuFwCfgSelectItem ().
152 @param[out] Size - Number of bytes in the file.
154 @return RETURN_SUCCESS If file is found.
155 RETURN_NOT_FOUND If file is not found.
156 RETURN_UNSUPPORTED If firmware configuration is unavailable.
162 IN CONST CHAR8
*Name
,
163 OUT FIRMWARE_CONFIG_ITEM
*Item
,