]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgNull.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / OvmfPkg / Library / QemuFwCfgLib / QemuFwCfgNull.c
CommitLineData
245bdd2c
RC
1/** @file\r
2\r
3 Null implementation of the fw_cfg library.\r
4\r
5 Copyright (C) 2020, Rebecca Cran <rebecca@bsdio.com>\r
6 Copyright (C) 2013, Red Hat, Inc.\r
7 Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r
8 Copyright (c) 2017, Advanced Micro Devices. All rights reserved.<BR>\r
9\r
10 SPDX-License-Identifier: BSD-2-Clause-Patent\r
11**/\r
12\r
13#include <Library/DebugLib.h>\r
14#include <Library/QemuFwCfgLib.h>\r
15\r
16/**\r
17 Returns a boolean indicating if the firmware configuration interface\r
18 is available or not.\r
19\r
20 This function may change fw_cfg state.\r
21\r
22 @retval TRUE The interface is available\r
23 @retval FALSE The interface is not available\r
24\r
25**/\r
26BOOLEAN\r
27EFIAPI\r
28QemuFwCfgIsAvailable (\r
29 VOID\r
30 )\r
31{\r
32 return FALSE;\r
33}\r
34\r
245bdd2c
RC
35/**\r
36 Selects a firmware configuration item for reading.\r
37\r
38 Following this call, any data read from this item will start from\r
39 the beginning of the configuration item's data.\r
40\r
41 @param[in] QemuFwCfgItem - Firmware Configuration item to read\r
42\r
43**/\r
44VOID\r
45EFIAPI\r
46QemuFwCfgSelectItem (\r
ac0a286f 47 IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem\r
245bdd2c
RC
48 )\r
49{\r
50 ASSERT (FALSE);\r
51}\r
52\r
245bdd2c
RC
53/**\r
54 Reads firmware configuration bytes into a buffer\r
55\r
56 If called multiple times, then the data read will\r
57 continue at the offset of the firmware configuration\r
58 item where the previous read ended.\r
59\r
60 @param[in] Size - Size in bytes to read\r
61 @param[in] Buffer - Buffer to store data into\r
62\r
63**/\r
64VOID\r
65EFIAPI\r
66QemuFwCfgReadBytes (\r
ac0a286f
MK
67 IN UINTN Size,\r
68 IN VOID *Buffer OPTIONAL\r
245bdd2c
RC
69 )\r
70{\r
71 ASSERT (FALSE);\r
72}\r
73\r
245bdd2c
RC
74/**\r
75 Writes firmware configuration bytes from a buffer\r
76\r
77 If called multiple times, then the data written will\r
78 continue at the offset of the firmware configuration\r
79 item where the previous write ended.\r
80\r
81 @param[in] Size - Size in bytes to write\r
82 @param[in] Buffer - Buffer to read data from\r
83\r
84**/\r
85VOID\r
86EFIAPI\r
87QemuFwCfgWriteBytes (\r
ac0a286f
MK
88 IN UINTN Size,\r
89 IN VOID *Buffer\r
245bdd2c
RC
90 )\r
91{\r
92 ASSERT (FALSE);\r
93}\r
94\r
245bdd2c
RC
95/**\r
96 Skip bytes in the firmware configuration item.\r
97\r
98 Increase the offset of the firmware configuration item without transferring\r
99 bytes between the item and a caller-provided buffer. Subsequent read, write\r
100 or skip operations will commence at the increased offset.\r
101\r
102 @param[in] Size Number of bytes to skip.\r
103**/\r
104VOID\r
105EFIAPI\r
106QemuFwCfgSkipBytes (\r
ac0a286f 107 IN UINTN Size\r
245bdd2c
RC
108 )\r
109{\r
110 ASSERT (FALSE);\r
111}\r
112\r
245bdd2c
RC
113/**\r
114 Reads a UINT8 firmware configuration value\r
115\r
116 @return Value of Firmware Configuration item read\r
117\r
118**/\r
119UINT8\r
120EFIAPI\r
121QemuFwCfgRead8 (\r
122 VOID\r
123 )\r
124{\r
125 ASSERT (FALSE);\r
126 return 0;\r
127}\r
128\r
245bdd2c
RC
129/**\r
130 Reads a UINT16 firmware configuration value\r
131\r
132 @return Value of Firmware Configuration item read\r
133\r
134**/\r
135UINT16\r
136EFIAPI\r
137QemuFwCfgRead16 (\r
138 VOID\r
139 )\r
140{\r
141 ASSERT (FALSE);\r
142 return 0;\r
143}\r
144\r
245bdd2c
RC
145/**\r
146 Reads a UINT32 firmware configuration value\r
147\r
148 @return Value of Firmware Configuration item read\r
149\r
150**/\r
151UINT32\r
152EFIAPI\r
153QemuFwCfgRead32 (\r
154 VOID\r
155 )\r
156{\r
157 ASSERT (FALSE);\r
158 return 0;\r
159}\r
160\r
245bdd2c
RC
161/**\r
162 Reads a UINT64 firmware configuration value\r
163\r
164 @return Value of Firmware Configuration item read\r
165\r
166**/\r
167UINT64\r
168EFIAPI\r
169QemuFwCfgRead64 (\r
170 VOID\r
171 )\r
172{\r
173 ASSERT (FALSE);\r
174 return 0;\r
175}\r
176\r
245bdd2c
RC
177/**\r
178 Find the configuration item corresponding to the firmware configuration file.\r
179\r
180 @param[in] Name - Name of file to look up.\r
181 @param[out] Item - Configuration item corresponding to the file, to be passed\r
182 to QemuFwCfgSelectItem ().\r
183 @param[out] Size - Number of bytes in the file.\r
184\r
185 @return RETURN_SUCCESS If file is found.\r
186 RETURN_NOT_FOUND If file is not found.\r
187 RETURN_UNSUPPORTED If firmware configuration is unavailable.\r
188\r
189**/\r
190RETURN_STATUS\r
191EFIAPI\r
192QemuFwCfgFindFile (\r
193 IN CONST CHAR8 *Name,\r
194 OUT FIRMWARE_CONFIG_ITEM *Item,\r
195 OUT UINTN *Size\r
196 )\r
197{\r
198 return RETURN_UNSUPPORTED;\r
199}\r