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