]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgNull.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / OvmfPkg / Library / QemuFwCfgLib / QemuFwCfgNull.c
1 /** @file
2
3 Null implementation of the fw_cfg library.
4
5 Copyright (C) 2020, Rebecca Cran <rebecca@bsdio.com>
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 Selects a firmware configuration item for reading.
37
38 Following this call, any data read from this item will start from
39 the beginning of the configuration item's data.
40
41 @param[in] QemuFwCfgItem - Firmware Configuration item to read
42
43 **/
44 VOID
45 EFIAPI
46 QemuFwCfgSelectItem (
47 IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem
48 )
49 {
50 ASSERT (FALSE);
51 }
52
53 /**
54 Reads firmware configuration bytes into a buffer
55
56 If called multiple times, then the data read will
57 continue at the offset of the firmware configuration
58 item where the previous read ended.
59
60 @param[in] Size - Size in bytes to read
61 @param[in] Buffer - Buffer to store data into
62
63 **/
64 VOID
65 EFIAPI
66 QemuFwCfgReadBytes (
67 IN UINTN Size,
68 IN VOID *Buffer OPTIONAL
69 )
70 {
71 ASSERT (FALSE);
72 }
73
74 /**
75 Writes firmware configuration bytes from a buffer
76
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.
80
81 @param[in] Size - Size in bytes to write
82 @param[in] Buffer - Buffer to read data from
83
84 **/
85 VOID
86 EFIAPI
87 QemuFwCfgWriteBytes (
88 IN UINTN Size,
89 IN VOID *Buffer
90 )
91 {
92 ASSERT (FALSE);
93 }
94
95 /**
96 Skip bytes in the firmware configuration item.
97
98 Increase the offset of the firmware configuration item without transferring
99 bytes between the item and a caller-provided buffer. Subsequent read, write
100 or skip operations will commence at the increased offset.
101
102 @param[in] Size Number of bytes to skip.
103 **/
104 VOID
105 EFIAPI
106 QemuFwCfgSkipBytes (
107 IN UINTN Size
108 )
109 {
110 ASSERT (FALSE);
111 }
112
113 /**
114 Reads a UINT8 firmware configuration value
115
116 @return Value of Firmware Configuration item read
117
118 **/
119 UINT8
120 EFIAPI
121 QemuFwCfgRead8 (
122 VOID
123 )
124 {
125 ASSERT (FALSE);
126 return 0;
127 }
128
129 /**
130 Reads a UINT16 firmware configuration value
131
132 @return Value of Firmware Configuration item read
133
134 **/
135 UINT16
136 EFIAPI
137 QemuFwCfgRead16 (
138 VOID
139 )
140 {
141 ASSERT (FALSE);
142 return 0;
143 }
144
145 /**
146 Reads a UINT32 firmware configuration value
147
148 @return Value of Firmware Configuration item read
149
150 **/
151 UINT32
152 EFIAPI
153 QemuFwCfgRead32 (
154 VOID
155 )
156 {
157 ASSERT (FALSE);
158 return 0;
159 }
160
161 /**
162 Reads a UINT64 firmware configuration value
163
164 @return Value of Firmware Configuration item read
165
166 **/
167 UINT64
168 EFIAPI
169 QemuFwCfgRead64 (
170 VOID
171 )
172 {
173 ASSERT (FALSE);
174 return 0;
175 }
176
177 /**
178 Find the configuration item corresponding to the firmware configuration file.
179
180 @param[in] Name - Name of file to look up.
181 @param[out] Item - Configuration item corresponding to the file, to be passed
182 to QemuFwCfgSelectItem ().
183 @param[out] Size - Number of bytes in the file.
184
185 @return RETURN_SUCCESS If file is found.
186 RETURN_NOT_FOUND If file is not found.
187 RETURN_UNSUPPORTED If firmware configuration is unavailable.
188
189 **/
190 RETURN_STATUS
191 EFIAPI
192 QemuFwCfgFindFile (
193 IN CONST CHAR8 *Name,
194 OUT FIRMWARE_CONFIG_ITEM *Item,
195 OUT UINTN *Size
196 )
197 {
198 return RETURN_UNSUPPORTED;
199 }