Commit | Line | Data |
---|---|---|
20752cb8 HW |
1 | /** @file\r |
2 | The header file of RamDiskDxe driver.\r | |
3 | \r | |
38c9fbdc | 4 | Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>\r |
9c463f6f | 5 | Copyright (c) Microsoft Corporation.<BR>\r |
9d510e61 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
20752cb8 HW |
7 | \r |
8 | **/\r | |
9 | \r | |
10 | #ifndef _RAM_DISK_IMPL_H_\r | |
11 | #define _RAM_DISK_IMPL_H_\r | |
12 | \r | |
13 | #include <Uefi.h>\r | |
14 | #include <Library/BaseLib.h>\r | |
15 | #include <Library/BaseMemoryLib.h>\r | |
16 | #include <Library/DebugLib.h>\r | |
17 | #include <Library/UefiLib.h>\r | |
18 | #include <Library/UefiDriverEntryPoint.h>\r | |
19 | #include <Library/UefiBootServicesTableLib.h>\r | |
20 | #include <Library/UefiHiiServicesLib.h>\r | |
21 | #include <Library/MemoryAllocationLib.h>\r | |
22 | #include <Library/HiiLib.h>\r | |
23 | #include <Library/FileExplorerLib.h>\r | |
24 | #include <Library/DevicePathLib.h>\r | |
25 | #include <Library/PrintLib.h>\r | |
07a3fecd HW |
26 | #include <Library/PcdLib.h>\r |
27 | #include <Library/DxeServicesLib.h>\r | |
20752cb8 HW |
28 | #include <Protocol/RamDisk.h>\r |
29 | #include <Protocol/BlockIo.h>\r | |
216fefa3 | 30 | #include <Protocol/BlockIo2.h>\r |
20752cb8 HW |
31 | #include <Protocol/HiiConfigAccess.h>\r |
32 | #include <Protocol/SimpleFileSystem.h>\r | |
07a3fecd HW |
33 | #include <Protocol/AcpiTable.h>\r |
34 | #include <Protocol/AcpiSystemDescriptionTable.h>\r | |
20752cb8 HW |
35 | #include <Guid/MdeModuleHii.h>\r |
36 | #include <Guid/RamDiskHii.h>\r | |
37 | #include <Guid/FileInfo.h>\r | |
07a3fecd | 38 | #include <IndustryStandard/Acpi61.h>\r |
20752cb8 HW |
39 | \r |
40 | #include "RamDiskNVData.h"\r | |
41 | \r | |
42 | ///\r | |
43 | /// RAM disk general definitions and declarations\r | |
44 | ///\r | |
45 | \r | |
46 | //\r | |
38c9fbdc | 47 | // Default block size for RAM disk\r |
20752cb8 | 48 | //\r |
1436aea4 | 49 | #define RAM_DISK_DEFAULT_BLOCK_SIZE 512\r |
20752cb8 | 50 | \r |
20752cb8 HW |
51 | //\r |
52 | // RamDiskDxe driver maintains a list of registered RAM disks.\r | |
53 | //\r | |
1436aea4 | 54 | extern LIST_ENTRY RegisteredRamDisks;\r |
20752cb8 | 55 | \r |
07a3fecd HW |
56 | //\r |
57 | // Pointers to the EFI_ACPI_TABLE_PROTOCOL and EFI_ACPI_SDT_PROTOCOL.\r | |
58 | //\r | |
1436aea4 MK |
59 | extern EFI_ACPI_TABLE_PROTOCOL *mAcpiTableProtocol;\r |
60 | extern EFI_ACPI_SDT_PROTOCOL *mAcpiSdtProtocol;\r | |
07a3fecd | 61 | \r |
20752cb8 HW |
62 | //\r |
63 | // RAM Disk create method.\r | |
64 | //\r | |
65 | typedef enum _RAM_DISK_CREATE_METHOD {\r | |
1436aea4 | 66 | RamDiskCreateOthers = 0,\r |
20752cb8 HW |
67 | RamDiskCreateHii\r |
68 | } RAM_DISK_CREATE_METHOD;\r | |
69 | \r | |
70 | //\r | |
71 | // RamDiskDxe driver maintains a list of registered RAM disks.\r | |
72 | // The struct contains the list entry and the information of each RAM\r | |
73 | // disk\r | |
74 | //\r | |
75 | typedef struct {\r | |
1436aea4 | 76 | UINTN Signature;\r |
20752cb8 | 77 | \r |
1436aea4 | 78 | EFI_HANDLE Handle;\r |
20752cb8 | 79 | \r |
1436aea4 MK |
80 | EFI_BLOCK_IO_PROTOCOL BlockIo;\r |
81 | EFI_BLOCK_IO2_PROTOCOL BlockIo2;\r | |
82 | EFI_BLOCK_IO_MEDIA Media;\r | |
83 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
20752cb8 | 84 | \r |
1436aea4 MK |
85 | UINT64 StartingAddr;\r |
86 | UINT64 Size;\r | |
87 | EFI_GUID TypeGuid;\r | |
88 | UINT16 InstanceNumber;\r | |
89 | RAM_DISK_CREATE_METHOD CreateMethod;\r | |
90 | BOOLEAN InNfit;\r | |
91 | EFI_QUESTION_ID CheckBoxId;\r | |
92 | BOOLEAN CheckBoxChecked;\r | |
20752cb8 | 93 | \r |
1436aea4 | 94 | LIST_ENTRY ThisInstance;\r |
20752cb8 HW |
95 | } RAM_DISK_PRIVATE_DATA;\r |
96 | \r | |
1436aea4 MK |
97 | #define RAM_DISK_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('R', 'D', 'S', 'K')\r |
98 | #define RAM_DISK_PRIVATE_FROM_BLKIO(a) CR (a, RAM_DISK_PRIVATE_DATA, BlockIo, RAM_DISK_PRIVATE_DATA_SIGNATURE)\r | |
99 | #define RAM_DISK_PRIVATE_FROM_BLKIO2(a) CR (a, RAM_DISK_PRIVATE_DATA, BlockIo2, RAM_DISK_PRIVATE_DATA_SIGNATURE)\r | |
100 | #define RAM_DISK_PRIVATE_FROM_THIS(a) CR (a, RAM_DISK_PRIVATE_DATA, ThisInstance, RAM_DISK_PRIVATE_DATA_SIGNATURE)\r | |
20752cb8 HW |
101 | \r |
102 | ///\r | |
103 | /// RAM disk HII-related definitions and declarations\r | |
104 | ///\r | |
105 | \r | |
106 | //\r | |
107 | // Tool generated IFR binary data and String package data\r | |
108 | //\r | |
1436aea4 MK |
109 | extern UINT8 RamDiskHiiBin[];\r |
110 | extern UINT8 RamDiskDxeStrings[];\r | |
20752cb8 HW |
111 | \r |
112 | typedef struct {\r | |
1436aea4 MK |
113 | VENDOR_DEVICE_PATH VendorDevicePath;\r |
114 | EFI_DEVICE_PATH_PROTOCOL End;\r | |
20752cb8 HW |
115 | } HII_VENDOR_DEVICE_PATH;\r |
116 | \r | |
117 | typedef struct {\r | |
1436aea4 | 118 | UINTN Signature;\r |
20752cb8 | 119 | \r |
1436aea4 | 120 | RAM_DISK_CONFIGURATION ConfigStore;\r |
5cf8a917 | 121 | \r |
1436aea4 MK |
122 | EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r |
123 | EFI_HANDLE DriverHandle;\r | |
124 | EFI_HII_HANDLE HiiHandle;\r | |
20752cb8 HW |
125 | } RAM_DISK_CONFIG_PRIVATE_DATA;\r |
126 | \r | |
1436aea4 | 127 | extern RAM_DISK_CONFIG_PRIVATE_DATA mRamDiskConfigPrivateDataTemplate;\r |
20752cb8 | 128 | \r |
1436aea4 MK |
129 | #define RAM_DISK_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('R', 'C', 'F', 'G')\r |
130 | #define RAM_DISK_CONFIG_PRIVATE_FROM_THIS(a) CR (a, RAM_DISK_CONFIG_PRIVATE_DATA, ConfigAccess, RAM_DISK_CONFIG_PRIVATE_DATA_SIGNATURE)\r | |
20752cb8 | 131 | \r |
20752cb8 HW |
132 | /**\r |
133 | Register a RAM disk with specified address, size and type.\r | |
134 | \r | |
135 | @param[in] RamDiskBase The base address of registered RAM disk.\r | |
136 | @param[in] RamDiskSize The size of registered RAM disk.\r | |
137 | @param[in] RamDiskType The type of registered RAM disk. The GUID can be\r | |
138 | any of the values defined in section 9.3.6.9, or a\r | |
139 | vendor defined GUID.\r | |
140 | @param[in] ParentDevicePath\r | |
141 | Pointer to the parent device path. If there is no\r | |
142 | parent device path then ParentDevicePath is NULL.\r | |
143 | @param[out] DevicePath On return, points to a pointer to the device path\r | |
144 | of the RAM disk device.\r | |
145 | If ParentDevicePath is not NULL, the returned\r | |
146 | DevicePath is created by appending a RAM disk node\r | |
147 | to the parent device path. If ParentDevicePath is\r | |
148 | NULL, the returned DevicePath is a RAM disk device\r | |
149 | path without appending. This function is\r | |
150 | responsible for allocating the buffer DevicePath\r | |
151 | with the boot service AllocatePool().\r | |
152 | \r | |
153 | @retval EFI_SUCCESS The RAM disk is registered successfully.\r | |
154 | @retval EFI_INVALID_PARAMETER DevicePath or RamDiskType is NULL.\r | |
155 | RamDiskSize is 0.\r | |
156 | @retval EFI_ALREADY_STARTED A Device Path Protocol instance to be created\r | |
157 | is already present in the handle database.\r | |
158 | @retval EFI_OUT_OF_RESOURCES The RAM disk register operation fails due to\r | |
159 | resource limitation.\r | |
160 | \r | |
161 | **/\r | |
162 | EFI_STATUS\r | |
163 | EFIAPI\r | |
164 | RamDiskRegister (\r | |
1436aea4 MK |
165 | IN UINT64 RamDiskBase,\r |
166 | IN UINT64 RamDiskSize,\r | |
167 | IN EFI_GUID *RamDiskType,\r | |
168 | IN EFI_DEVICE_PATH *ParentDevicePath OPTIONAL,\r | |
169 | OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath\r | |
20752cb8 HW |
170 | );\r |
171 | \r | |
172 | /**\r | |
173 | Unregister a RAM disk specified by DevicePath.\r | |
174 | \r | |
175 | @param[in] DevicePath A pointer to the device path that describes a RAM\r | |
176 | Disk device.\r | |
177 | \r | |
178 | @retval EFI_SUCCESS The RAM disk is unregistered successfully.\r | |
179 | @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r | |
180 | @retval EFI_UNSUPPORTED The device specified by DevicePath is not a\r | |
181 | valid ramdisk device path and not supported\r | |
182 | by the driver.\r | |
183 | @retval EFI_NOT_FOUND The RAM disk pointed by DevicePath doesn't\r | |
184 | exist.\r | |
185 | \r | |
186 | **/\r | |
187 | EFI_STATUS\r | |
188 | EFIAPI\r | |
189 | RamDiskUnregister (\r | |
1436aea4 | 190 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r |
20752cb8 HW |
191 | );\r |
192 | \r | |
193 | /**\r | |
194 | Initialize the BlockIO protocol of a RAM disk device.\r | |
195 | \r | |
196 | @param[in] PrivateData Points to RAM disk private data.\r | |
197 | \r | |
198 | **/\r | |
199 | VOID\r | |
200 | RamDiskInitBlockIo (\r | |
1436aea4 | 201 | IN RAM_DISK_PRIVATE_DATA *PrivateData\r |
20752cb8 HW |
202 | );\r |
203 | \r | |
204 | /**\r | |
205 | Reset the Block Device.\r | |
206 | \r | |
207 | @param[in] This Indicates a pointer to the calling context.\r | |
208 | @param[in] ExtendedVerification\r | |
209 | Driver may perform diagnostics on reset.\r | |
210 | \r | |
211 | @retval EFI_SUCCESS The device was reset.\r | |
212 | @retval EFI_DEVICE_ERROR The device is not functioning properly and\r | |
213 | could not be reset.\r | |
214 | \r | |
215 | **/\r | |
216 | EFI_STATUS\r | |
217 | EFIAPI\r | |
218 | RamDiskBlkIoReset (\r | |
1436aea4 MK |
219 | IN EFI_BLOCK_IO_PROTOCOL *This,\r |
220 | IN BOOLEAN ExtendedVerification\r | |
20752cb8 HW |
221 | );\r |
222 | \r | |
223 | /**\r | |
224 | Read BufferSize bytes from Lba into Buffer.\r | |
225 | \r | |
226 | @param[in] This Indicates a pointer to the calling context.\r | |
227 | @param[in] MediaId Id of the media, changes every time the media is\r | |
228 | replaced.\r | |
229 | @param[in] Lba The starting Logical Block Address to read from.\r | |
230 | @param[in] BufferSize Size of Buffer, must be a multiple of device block\r | |
231 | size.\r | |
232 | @param[out] Buffer A pointer to the destination buffer for the data.\r | |
233 | The caller is responsible for either having\r | |
234 | implicit or explicit ownership of the buffer.\r | |
235 | \r | |
236 | @retval EFI_SUCCESS The data was read correctly from the device.\r | |
237 | @retval EFI_DEVICE_ERROR The device reported an error while performing\r | |
238 | the read.\r | |
239 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
240 | @retval EFI_MEDIA_CHANGED The MediaId does not matched the current\r | |
241 | device.\r | |
242 | @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block\r | |
243 | size of the device.\r | |
244 | @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not\r | |
245 | valid, or the buffer is not on proper alignment.\r | |
246 | \r | |
247 | **/\r | |
248 | EFI_STATUS\r | |
249 | EFIAPI\r | |
250 | RamDiskBlkIoReadBlocks (\r | |
1436aea4 MK |
251 | IN EFI_BLOCK_IO_PROTOCOL *This,\r |
252 | IN UINT32 MediaId,\r | |
253 | IN EFI_LBA Lba,\r | |
254 | IN UINTN BufferSize,\r | |
255 | OUT VOID *Buffer\r | |
20752cb8 HW |
256 | );\r |
257 | \r | |
258 | /**\r | |
259 | Write BufferSize bytes from Lba into Buffer.\r | |
260 | \r | |
261 | @param[in] This Indicates a pointer to the calling context.\r | |
262 | @param[in] MediaId The media ID that the write request is for.\r | |
263 | @param[in] Lba The starting logical block address to be written.\r | |
264 | The caller is responsible for writing to only\r | |
265 | legitimate locations.\r | |
266 | @param[in] BufferSize Size of Buffer, must be a multiple of device block\r | |
267 | size.\r | |
268 | @param[in] Buffer A pointer to the source buffer for the data.\r | |
269 | \r | |
270 | @retval EFI_SUCCESS The data was written correctly to the device.\r | |
271 | @retval EFI_WRITE_PROTECTED The device can not be written to.\r | |
272 | @retval EFI_DEVICE_ERROR The device reported an error while performing\r | |
273 | the write.\r | |
274 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
275 | @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current\r | |
276 | device.\r | |
277 | @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block\r | |
278 | size of the device.\r | |
279 | @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not\r | |
280 | valid, or the buffer is not on proper alignment.\r | |
281 | \r | |
282 | **/\r | |
283 | EFI_STATUS\r | |
284 | EFIAPI\r | |
285 | RamDiskBlkIoWriteBlocks (\r | |
1436aea4 MK |
286 | IN EFI_BLOCK_IO_PROTOCOL *This,\r |
287 | IN UINT32 MediaId,\r | |
288 | IN EFI_LBA Lba,\r | |
289 | IN UINTN BufferSize,\r | |
290 | IN VOID *Buffer\r | |
20752cb8 HW |
291 | );\r |
292 | \r | |
293 | /**\r | |
294 | Flush the Block Device.\r | |
295 | \r | |
296 | @param[in] This Indicates a pointer to the calling context.\r | |
297 | \r | |
298 | @retval EFI_SUCCESS All outstanding data was written to the device.\r | |
299 | @retval EFI_DEVICE_ERROR The device reported an error while writting\r | |
300 | back the data\r | |
301 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
302 | \r | |
303 | **/\r | |
304 | EFI_STATUS\r | |
305 | EFIAPI\r | |
306 | RamDiskBlkIoFlushBlocks (\r | |
1436aea4 | 307 | IN EFI_BLOCK_IO_PROTOCOL *This\r |
20752cb8 HW |
308 | );\r |
309 | \r | |
216fefa3 HW |
310 | /**\r |
311 | Resets the block device hardware.\r | |
312 | \r | |
313 | @param[in] This The pointer of EFI_BLOCK_IO2_PROTOCOL.\r | |
314 | @param[in] ExtendedVerification The flag about if extend verificate.\r | |
315 | \r | |
316 | @retval EFI_SUCCESS The device was reset.\r | |
317 | @retval EFI_DEVICE_ERROR The block device is not functioning correctly\r | |
318 | and could not be reset.\r | |
319 | \r | |
320 | **/\r | |
321 | EFI_STATUS\r | |
322 | EFIAPI\r | |
323 | RamDiskBlkIo2Reset (\r | |
1436aea4 MK |
324 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r |
325 | IN BOOLEAN ExtendedVerification\r | |
216fefa3 HW |
326 | );\r |
327 | \r | |
328 | /**\r | |
329 | Reads the requested number of blocks from the device.\r | |
330 | \r | |
331 | @param[in] This Indicates a pointer to the calling context.\r | |
332 | @param[in] MediaId The media ID that the read request is for.\r | |
333 | @param[in] Lba The starting logical block address to read\r | |
334 | from on the device.\r | |
335 | @param[in, out] Token A pointer to the token associated with the\r | |
336 | transaction.\r | |
337 | @param[in] BufferSize The size of the Buffer in bytes. This must be\r | |
338 | a multiple of the intrinsic block size of the\r | |
339 | device.\r | |
340 | @param[out] Buffer A pointer to the destination buffer for the\r | |
341 | data. The caller is responsible for either\r | |
342 | having implicit or explicit ownership of the\r | |
343 | buffer.\r | |
344 | \r | |
345 | @retval EFI_SUCCESS The read request was queued if Token->Event\r | |
346 | is not NULL. The data was read correctly from\r | |
347 | the device if the Token->Event is NULL.\r | |
348 | @retval EFI_DEVICE_ERROR The device reported an error while attempting\r | |
349 | to perform the read operation.\r | |
350 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
351 | @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r | |
352 | @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of\r | |
353 | the intrinsic block size of the device.\r | |
354 | @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not\r | |
355 | valid, or the buffer is not on proper\r | |
356 | alignment.\r | |
357 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a\r | |
358 | lack of resources.\r | |
359 | \r | |
360 | **/\r | |
361 | EFI_STATUS\r | |
362 | EFIAPI\r | |
363 | RamDiskBlkIo2ReadBlocksEx (\r | |
1436aea4 MK |
364 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r |
365 | IN UINT32 MediaId,\r | |
366 | IN EFI_LBA Lba,\r | |
367 | IN OUT EFI_BLOCK_IO2_TOKEN *Token,\r | |
368 | IN UINTN BufferSize,\r | |
369 | OUT VOID *Buffer\r | |
216fefa3 HW |
370 | );\r |
371 | \r | |
372 | /**\r | |
373 | Writes a specified number of blocks to the device.\r | |
374 | \r | |
375 | @param[in] This Indicates a pointer to the calling context.\r | |
376 | @param[in] MediaId The media ID that the write request is for.\r | |
377 | @param[in] Lba The starting logical block address to be\r | |
378 | written. The caller is responsible for\r | |
379 | writing to only legitimate locations.\r | |
380 | @param[in, out] Token A pointer to the token associated with the\r | |
381 | transaction.\r | |
382 | @param[in] BufferSize The size in bytes of Buffer. This must be a\r | |
383 | multiple of the intrinsic block size of the\r | |
384 | device.\r | |
385 | @param[in] Buffer A pointer to the source buffer for the data.\r | |
386 | \r | |
387 | @retval EFI_SUCCESS The write request was queued if Event is not\r | |
388 | NULL. The data was written correctly to the\r | |
389 | device if the Event is NULL.\r | |
390 | @retval EFI_WRITE_PROTECTED The device cannot be written to.\r | |
391 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
392 | @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r | |
393 | @retval EFI_DEVICE_ERROR The device reported an error while attempting\r | |
394 | to perform the write operation.\r | |
395 | @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of\r | |
396 | the intrinsic block size of the device.\r | |
397 | @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not\r | |
398 | valid, or the buffer is not on proper\r | |
399 | alignment.\r | |
400 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a\r | |
401 | lack of resources.\r | |
402 | \r | |
403 | **/\r | |
404 | EFI_STATUS\r | |
405 | EFIAPI\r | |
406 | RamDiskBlkIo2WriteBlocksEx (\r | |
1436aea4 MK |
407 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r |
408 | IN UINT32 MediaId,\r | |
409 | IN EFI_LBA Lba,\r | |
410 | IN OUT EFI_BLOCK_IO2_TOKEN *Token,\r | |
411 | IN UINTN BufferSize,\r | |
412 | IN VOID *Buffer\r | |
216fefa3 HW |
413 | );\r |
414 | \r | |
415 | /**\r | |
416 | Flushes all modified data to a physical block device.\r | |
417 | \r | |
418 | @param[in] This Indicates a pointer to the calling context.\r | |
419 | @param[in, out] Token A pointer to the token associated with the\r | |
420 | transaction.\r | |
421 | \r | |
422 | @retval EFI_SUCCESS The flush request was queued if Event is not\r | |
423 | NULL. All outstanding data was written\r | |
424 | correctly to the device if the Event is NULL.\r | |
425 | @retval EFI_DEVICE_ERROR The device reported an error while attempting\r | |
426 | to write data.\r | |
427 | @retval EFI_WRITE_PROTECTED The device cannot be written to.\r | |
428 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
429 | @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r | |
430 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a\r | |
431 | lack of resources.\r | |
432 | \r | |
433 | **/\r | |
434 | EFI_STATUS\r | |
435 | EFIAPI\r | |
436 | RamDiskBlkIo2FlushBlocksEx (\r | |
1436aea4 MK |
437 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r |
438 | IN OUT EFI_BLOCK_IO2_TOKEN *Token\r | |
216fefa3 HW |
439 | );\r |
440 | \r | |
20752cb8 HW |
441 | /**\r |
442 | This function publish the RAM disk configuration Form.\r | |
443 | \r | |
444 | @param[in, out] ConfigPrivateData\r | |
445 | Points to RAM disk configuration private data.\r | |
446 | \r | |
447 | @retval EFI_SUCCESS HII Form is installed successfully.\r | |
448 | @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation.\r | |
449 | @retval Others Other errors as indicated.\r | |
450 | \r | |
451 | **/\r | |
452 | EFI_STATUS\r | |
453 | InstallRamDiskConfigForm (\r | |
1436aea4 | 454 | IN OUT RAM_DISK_CONFIG_PRIVATE_DATA *ConfigPrivateData\r |
20752cb8 HW |
455 | );\r |
456 | \r | |
457 | /**\r | |
458 | This function removes RAM disk configuration Form.\r | |
459 | \r | |
460 | @param[in, out] ConfigPrivateData\r | |
461 | Points to RAM disk configuration private data.\r | |
462 | \r | |
463 | **/\r | |
464 | VOID\r | |
465 | UninstallRamDiskConfigForm (\r | |
1436aea4 | 466 | IN OUT RAM_DISK_CONFIG_PRIVATE_DATA *ConfigPrivateData\r |
20752cb8 HW |
467 | );\r |
468 | \r | |
469 | /**\r | |
470 | Unregister all registered RAM disks.\r | |
471 | \r | |
472 | **/\r | |
473 | VOID\r | |
474 | UnregisterAllRamDisks (\r | |
475 | VOID\r | |
476 | );\r | |
477 | \r | |
478 | /**\r | |
479 | This function allows a caller to extract the current configuration for one\r | |
480 | or more named elements from the target driver.\r | |
481 | \r | |
482 | @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
483 | @param[in] Request A null-terminated Unicode string in\r | |
484 | <ConfigRequest> format.\r | |
485 | @param[out] Progress On return, points to a character in the Request\r | |
486 | string. Points to the string's null terminator if\r | |
487 | request was successful. Points to the most recent\r | |
488 | '&' before the first failing name/value pair (or\r | |
489 | the beginning of the string if the failure is in\r | |
490 | the first name/value pair) if the request was not\r | |
491 | successful.\r | |
492 | @param[out] Results A null-terminated Unicode string in\r | |
493 | <ConfigAltResp> format which has all values filled\r | |
494 | in for the names in the Request string. String to\r | |
495 | be allocated by the called function.\r | |
496 | \r | |
497 | @retval EFI_SUCCESS The Results is filled with the requested\r | |
498 | values.\r | |
499 | @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r | |
500 | @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.\r | |
501 | @retval EFI_NOT_FOUND Routing data doesn't match any storage in\r | |
502 | this driver.\r | |
503 | \r | |
504 | **/\r | |
505 | EFI_STATUS\r | |
506 | EFIAPI\r | |
507 | RamDiskExtractConfig (\r | |
1436aea4 MK |
508 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r |
509 | IN CONST EFI_STRING Request,\r | |
510 | OUT EFI_STRING *Progress,\r | |
511 | OUT EFI_STRING *Results\r | |
20752cb8 HW |
512 | );\r |
513 | \r | |
514 | /**\r | |
515 | This function processes the results of changes in configuration.\r | |
516 | \r | |
517 | @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
518 | @param[in] Configuration A null-terminated Unicode string in <ConfigResp>\r | |
519 | format.\r | |
520 | @param[out] Progress A pointer to a string filled in with the offset of\r | |
521 | the most recent '&' before the first failing\r | |
522 | name/value pair (or the beginning of the string if\r | |
523 | the failure is in the first name/value pair) or\r | |
524 | the terminating NULL if all was successful.\r | |
525 | \r | |
526 | @retval EFI_SUCCESS The Results is processed successfully.\r | |
527 | @retval EFI_INVALID_PARAMETER Configuration is NULL.\r | |
528 | @retval EFI_NOT_FOUND Routing data doesn't match any storage in\r | |
529 | this driver.\r | |
530 | \r | |
531 | **/\r | |
532 | EFI_STATUS\r | |
533 | EFIAPI\r | |
534 | RamDiskRouteConfig (\r | |
1436aea4 MK |
535 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r |
536 | IN CONST EFI_STRING Configuration,\r | |
537 | OUT EFI_STRING *Progress\r | |
20752cb8 HW |
538 | );\r |
539 | \r | |
540 | /**\r | |
541 | This function processes the results of changes in configuration.\r | |
542 | \r | |
543 | @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
544 | @param[in] Action Specifies the type of action taken by the browser.\r | |
545 | @param[in] QuestionId A unique value which is sent to the original\r | |
546 | exporting driver so that it can identify the type\r | |
547 | of data to expect.\r | |
548 | @param[in] Type The type of value for the question.\r | |
549 | @param[in] Value A pointer to the data being sent to the original\r | |
550 | exporting driver.\r | |
551 | @param[out] ActionRequest On return, points to the action requested by the\r | |
552 | callback function.\r | |
553 | \r | |
554 | @retval EFI_SUCCESS The callback successfully handled the action.\r | |
555 | @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the\r | |
556 | variable and its data.\r | |
557 | @retval EFI_DEVICE_ERROR The variable could not be saved.\r | |
558 | @retval EFI_UNSUPPORTED The specified Action is not supported by the\r | |
559 | callback.\r | |
560 | \r | |
561 | **/\r | |
562 | EFI_STATUS\r | |
563 | EFIAPI\r | |
564 | RamDiskCallback (\r | |
1436aea4 MK |
565 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r |
566 | IN EFI_BROWSER_ACTION Action,\r | |
567 | IN EFI_QUESTION_ID QuestionId,\r | |
568 | IN UINT8 Type,\r | |
569 | IN EFI_IFR_TYPE_VALUE *Value,\r | |
570 | OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r | |
20752cb8 HW |
571 | );\r |
572 | \r | |
20752cb8 HW |
573 | /**\r |
574 | This function gets the file information from an open file descriptor,\r | |
575 | and stores it in a buffer allocated from pool.\r | |
576 | \r | |
577 | @param[in] FHand File Handle.\r | |
578 | \r | |
579 | @return A pointer to a buffer with file information or NULL is returned.\r | |
580 | \r | |
581 | **/\r | |
582 | EFI_FILE_INFO *\r | |
583 | FileInfo (\r | |
1436aea4 | 584 | IN EFI_FILE_HANDLE FHand\r |
20752cb8 HW |
585 | );\r |
586 | \r | |
07a3fecd HW |
587 | /**\r |
588 | Publish the RAM disk NVDIMM Firmware Interface Table (NFIT) to the ACPI\r | |
589 | table.\r | |
590 | \r | |
591 | @param[in] PrivateData Points to RAM disk private data.\r | |
592 | \r | |
593 | @retval EFI_SUCCESS The RAM disk NFIT has been published.\r | |
594 | @retval others The RAM disk NFIT has not been published.\r | |
595 | \r | |
596 | **/\r | |
597 | EFI_STATUS\r | |
598 | RamDiskPublishNfit (\r | |
1436aea4 | 599 | IN RAM_DISK_PRIVATE_DATA *PrivateData\r |
07a3fecd HW |
600 | );\r |
601 | \r | |
20752cb8 | 602 | #endif\r |