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