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