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