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