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 #define EFI_LOAD_FILE2_PROTOCOL_GUID \
19   { \
20     0x4006c0c1, 0xfcb3, 0x403e, {0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d } \
21   }
22 
23 ///
24 /// Protocol Guid defined by UEFI2.1.
25 ///
26 #define LOAD_FILE2_PROTOCOL  EFI_LOAD_FILE2_PROTOCOL_GUID
27 
28 typedef struct _EFI_LOAD_FILE2_PROTOCOL EFI_LOAD_FILE2_PROTOCOL;
29 
30 /**
31   Causes the driver to load a specified file.
32 
33   @param  This       Protocol instance pointer.
34   @param  FilePath   The device specific path of the file to load.
35   @param  BootPolicy Should always be FALSE.
36   @param  BufferSize On input the size of Buffer in bytes. On output with a return
37                      code of EFI_SUCCESS, the amount of data transferred to
38                      Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,
39                      the size of Buffer required to retrieve the requested file.
40   @param  Buffer     The memory buffer to transfer the file to. IF Buffer is NULL,
41                      then no the size of the requested file is returned in
42                      BufferSize.
43 
44   @retval EFI_SUCCESS           The file was loaded.
45   @retval EFI_UNSUPPORTED       BootPolicy is TRUE.
46   @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or
47                                 BufferSize is NULL.
48   @retval EFI_NO_MEDIA          No medium was present to load the file.
49   @retval EFI_DEVICE_ERROR      The file was not loaded due to a device error.
50   @retval EFI_NO_RESPONSE       The remote system did not respond.
51   @retval EFI_NOT_FOUND         The file was not found
52   @retval EFI_ABORTED           The file load process was manually canceled.
53   @retval EFI_BUFFER_TOO_SMALL  The BufferSize is too small to read the current
54                                 directory entry. BufferSize has been updated with
55                                 the size needed to complete the request.
56 
57 
58 **/
59 typedef
60 EFI_STATUS
61 (EFIAPI *EFI_LOAD_FILE2)(
62   IN EFI_LOAD_FILE2_PROTOCOL           *This,
63   IN EFI_DEVICE_PATH_PROTOCOL         *FilePath,
64   IN BOOLEAN                          BootPolicy,
65   IN OUT UINTN                        *BufferSize,
66   IN VOID                             *Buffer OPTIONAL
67   );
68 
69 ///
70 /// The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
71 ///
72 struct _EFI_LOAD_FILE2_PROTOCOL {
73   EFI_LOAD_FILE2    LoadFile;
74 };
75 
76 extern EFI_GUID  gEfiLoadFile2ProtocolGuid;
77 
78 #endif
79