iPXE
LoadFile2.h
Go to the documentation of this file.
1 /** @file
2  Load File protocol as defined in the UEFI 2.0 specification.
3 
4  Load file protocol exists to supports the addition of new boot devices,
5  and to support booting from devices that do not map well to file system.
6  Network boot is done via a LoadFile protocol.
7 
8  UEFI 2.0 can boot from any device that produces a LoadFile protocol.
9 
10  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
11  SPDX-License-Identifier: BSD-2-Clause-Patent
12 
13 **/
14 
15 #ifndef __EFI_LOAD_FILE2_PROTOCOL_H__
16 #define __EFI_LOAD_FILE2_PROTOCOL_H__
17 
18 FILE_LICENCE ( BSD2_PATENT );
19 FILE_SECBOOT ( PERMITTED );
20 
21 #define EFI_LOAD_FILE2_PROTOCOL_GUID \
22  { \
23  0x4006c0c1, 0xfcb3, 0x403e, {0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d } \
24  }
25 
26 ///
27 /// Protocol Guid defined by UEFI2.1.
28 ///
29 #define LOAD_FILE2_PROTOCOL EFI_LOAD_FILE2_PROTOCOL_GUID
30 
32 
33 /**
34  Causes the driver to load a specified file.
35 
36  @param This Protocol instance pointer.
37  @param FilePath The device specific path of the file to load.
38  @param BootPolicy Should always be FALSE.
39  @param BufferSize On input the size of Buffer in bytes. On output with a return
40  code of EFI_SUCCESS, the amount of data transferred to
41  Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,
42  the size of Buffer required to retrieve the requested file.
43  @param Buffer The memory buffer to transfer the file to. IF Buffer is NULL,
44  then no the size of the requested file is returned in
45  BufferSize.
46 
47  @retval EFI_SUCCESS The file was loaded.
48  @retval EFI_UNSUPPORTED BootPolicy is TRUE.
49  @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or
50  BufferSize is NULL.
51  @retval EFI_NO_MEDIA No medium was present to load the file.
52  @retval EFI_DEVICE_ERROR The file was not loaded due to a device error.
53  @retval EFI_NO_RESPONSE The remote system did not respond.
54  @retval EFI_NOT_FOUND The file was not found
55  @retval EFI_ABORTED The file load process was manually canceled.
56  @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current
57  directory entry. BufferSize has been updated with
58  the size needed to complete the request.
59 
60 
61 **/
62 typedef
66  IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
67  IN BOOLEAN BootPolicy,
70  );
71 
72 ///
73 /// The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
74 ///
77 };
78 
80 
81 #endif
#define OPTIONAL
Passing the datum to the function is optional, and a NULL is passed if the value is not supplied.
Definition: Base.h:293
128 bit buffer containing a unique identifier value.
Definition: Base.h:216
unsigned char BOOLEAN
EFI_GUID gEfiLoadFile2ProtocolGuid
FILE_LICENCE(BSD2_PATENT)
UINT16_t BufferSize
Buffer size.
Definition: pxe_api.h:64
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition: DevicePath.h:46
EFI_LOAD_FILE2 LoadFile
Definition: LoadFile2.h:76
#define OUT
Definition: mlx_utils.h:29
#define EFIAPI
SEGOFF16_t Buffer
Buffer address.
Definition: pxe_api.h:65
UINT64 UINTN
Unsigned value of native width.
#define VOID
Undeclared type.
Definition: Base.h:272
#define IN
Definition: mlx_utils.h:28
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:32
FILE_SECBOOT(PERMITTED)
EFI_STATUS(EFIAPI * EFI_LOAD_FILE2)(IN EFI_LOAD_FILE2_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN BOOLEAN BootPolicy, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL)
Causes the driver to load a specified file.
Definition: LoadFile2.h:64
The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
Definition: LoadFile2.h:75