1*f334afcfSToomas Soome /** @file
2*f334afcfSToomas Soome   Load File protocol as defined in the UEFI 2.0 specification.
3*f334afcfSToomas Soome 
4*f334afcfSToomas Soome   The load file protocol exists to supports the addition of new boot devices,
5*f334afcfSToomas Soome   and to support booting from devices that do not map well to file system.
6*f334afcfSToomas Soome   Network boot is done via a LoadFile protocol.
7*f334afcfSToomas Soome 
8*f334afcfSToomas Soome   UEFI 2.0 can boot from any device that produces a LoadFile protocol.
9*f334afcfSToomas Soome 
10*f334afcfSToomas Soome Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
11*f334afcfSToomas Soome SPDX-License-Identifier: BSD-2-Clause-Patent
12*f334afcfSToomas Soome 
13*f334afcfSToomas Soome **/
14*f334afcfSToomas Soome 
15*f334afcfSToomas Soome #ifndef __EFI_LOAD_FILE_PROTOCOL_H__
16*f334afcfSToomas Soome #define __EFI_LOAD_FILE_PROTOCOL_H__
17*f334afcfSToomas Soome 
18*f334afcfSToomas Soome #define EFI_LOAD_FILE_PROTOCOL_GUID \
19*f334afcfSToomas Soome   { \
20*f334afcfSToomas Soome     0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \
21*f334afcfSToomas Soome   }
22*f334afcfSToomas Soome 
23*f334afcfSToomas Soome ///
24*f334afcfSToomas Soome /// Protocol Guid defined by EFI1.1.
25*f334afcfSToomas Soome ///
26*f334afcfSToomas Soome #define LOAD_FILE_PROTOCOL  EFI_LOAD_FILE_PROTOCOL_GUID
27*f334afcfSToomas Soome 
28*f334afcfSToomas Soome typedef struct _EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL;
29*f334afcfSToomas Soome 
30*f334afcfSToomas Soome ///
31*f334afcfSToomas Soome /// Backward-compatible with EFI1.1
32*f334afcfSToomas Soome ///
33*f334afcfSToomas Soome typedef EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_INTERFACE;
34*f334afcfSToomas Soome 
35*f334afcfSToomas Soome /**
36*f334afcfSToomas Soome   Causes the driver to load a specified file.
37*f334afcfSToomas Soome 
38*f334afcfSToomas Soome   @param  This       Protocol instance pointer.
39*f334afcfSToomas Soome   @param  FilePath   The device specific path of the file to load.
40*f334afcfSToomas Soome   @param  BootPolicy If TRUE, indicates that the request originates from the
41*f334afcfSToomas Soome                      boot manager is attempting to load FilePath as a boot
42*f334afcfSToomas Soome                      selection. If FALSE, then FilePath must match as exact file
43*f334afcfSToomas Soome                      to be loaded.
44*f334afcfSToomas Soome   @param  BufferSize On input the size of Buffer in bytes. On output with a return
45*f334afcfSToomas Soome                      code of EFI_SUCCESS, the amount of data transferred to
46*f334afcfSToomas Soome                      Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,
47*f334afcfSToomas Soome                      the size of Buffer required to retrieve the requested file.
48*f334afcfSToomas Soome   @param  Buffer     The memory buffer to transfer the file to. IF Buffer is NULL,
49*f334afcfSToomas Soome                      then the size of the requested file is returned in
50*f334afcfSToomas Soome                      BufferSize.
51*f334afcfSToomas Soome 
52*f334afcfSToomas Soome   @retval EFI_SUCCESS           The file was loaded.
53*f334afcfSToomas Soome   @retval EFI_UNSUPPORTED       The device does not support the provided BootPolicy
54*f334afcfSToomas Soome   @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or
55*f334afcfSToomas Soome                                 BufferSize is NULL.
56*f334afcfSToomas Soome   @retval EFI_NO_MEDIA          No medium was present to load the file.
57*f334afcfSToomas Soome   @retval EFI_DEVICE_ERROR      The file was not loaded due to a device error.
58*f334afcfSToomas Soome   @retval EFI_NO_RESPONSE       The remote system did not respond.
59*f334afcfSToomas Soome   @retval EFI_NOT_FOUND         The file was not found.
60*f334afcfSToomas Soome   @retval EFI_ABORTED           The file load process was manually cancelled.
61*f334afcfSToomas Soome   @retval EFI_WARN_FILE_SYSTEM  The resulting Buffer contains UEFI-compliant file system.
62*f334afcfSToomas Soome **/
63*f334afcfSToomas Soome typedef
64*f334afcfSToomas Soome EFI_STATUS
65*f334afcfSToomas Soome (EFIAPI *EFI_LOAD_FILE)(
66*f334afcfSToomas Soome   IN EFI_LOAD_FILE_PROTOCOL           *This,
67*f334afcfSToomas Soome   IN EFI_DEVICE_PATH_PROTOCOL         *FilePath,
68*f334afcfSToomas Soome   IN BOOLEAN                          BootPolicy,
69*f334afcfSToomas Soome   IN OUT UINTN                        *BufferSize,
70*f334afcfSToomas Soome   IN VOID                             *Buffer OPTIONAL
71*f334afcfSToomas Soome   );
72*f334afcfSToomas Soome 
73*f334afcfSToomas Soome ///
74*f334afcfSToomas Soome /// The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
75*f334afcfSToomas Soome ///
76*f334afcfSToomas Soome struct _EFI_LOAD_FILE_PROTOCOL {
77*f334afcfSToomas Soome   EFI_LOAD_FILE    LoadFile;
78*f334afcfSToomas Soome };
79*f334afcfSToomas Soome 
80*f334afcfSToomas Soome extern EFI_GUID  gEfiLoadFileProtocolGuid;
81*f334afcfSToomas Soome 
82*f334afcfSToomas Soome #endif
83