iPXE
LoadFile.h
Go to the documentation of this file.
00001 /** @file
00002   Load File protocol as defined in the UEFI 2.0 specification.
00003 
00004   The load file protocol exists to supports the addition of new boot devices,
00005   and to support booting from devices that do not map well to file system.
00006   Network boot is done via a LoadFile protocol.
00007 
00008   UEFI 2.0 can boot from any device that produces a LoadFile protocol.
00009 
00010 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
00011 This program and the accompanying materials are licensed and made available under
00012 the terms and conditions of the BSD License that accompanies this distribution.
00013 The full text of the license may be found at
00014 http://opensource.org/licenses/bsd-license.php.
00015 
00016 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00017 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00018 
00019 **/
00020 
00021 #ifndef __EFI_LOAD_FILE_PROTOCOL_H__
00022 #define __EFI_LOAD_FILE_PROTOCOL_H__
00023 
00024 FILE_LICENCE ( BSD3 );
00025 
00026 #define EFI_LOAD_FILE_PROTOCOL_GUID \
00027   { \
00028     0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \
00029   }
00030 
00031 ///
00032 /// Protocol Guid defined by EFI1.1.
00033 ///
00034 #define LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL_GUID
00035 
00036 typedef struct _EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL;
00037 
00038 ///
00039 /// Backward-compatible with EFI1.1
00040 ///
00041 typedef EFI_LOAD_FILE_PROTOCOL  EFI_LOAD_FILE_INTERFACE;
00042 
00043 /**
00044   Causes the driver to load a specified file.
00045 
00046   @param  This       Protocol instance pointer.
00047   @param  FilePath   The device specific path of the file to load.
00048   @param  BootPolicy If TRUE, indicates that the request originates from the
00049                      boot manager is attempting to load FilePath as a boot
00050                      selection. If FALSE, then FilePath must match as exact file
00051                      to be loaded.
00052   @param  BufferSize On input the size of Buffer in bytes. On output with a return
00053                      code of EFI_SUCCESS, the amount of data transferred to
00054                      Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,
00055                      the size of Buffer required to retrieve the requested file.
00056   @param  Buffer     The memory buffer to transfer the file to. IF Buffer is NULL,
00057                      then the size of the requested file is returned in
00058                      BufferSize.
00059 
00060   @retval EFI_SUCCESS           The file was loaded.
00061   @retval EFI_UNSUPPORTED       The device does not support the provided BootPolicy
00062   @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or
00063                                 BufferSize is NULL.
00064   @retval EFI_NO_MEDIA          No medium was present to load the file.
00065   @retval EFI_DEVICE_ERROR      The file was not loaded due to a device error.
00066   @retval EFI_NO_RESPONSE       The remote system did not respond.
00067   @retval EFI_NOT_FOUND         The file was not found.
00068   @retval EFI_ABORTED           The file load process was manually cancelled.
00069   @retval EFI_WARN_FILE_SYSTEM  The resulting Buffer contains UEFI-compliant file system.
00070 **/
00071 typedef
00072 EFI_STATUS
00073 (EFIAPI *EFI_LOAD_FILE)(
00074   IN EFI_LOAD_FILE_PROTOCOL           *This,
00075   IN EFI_DEVICE_PATH_PROTOCOL         *FilePath,
00076   IN BOOLEAN                          BootPolicy,
00077   IN OUT UINTN                        *BufferSize,
00078   IN VOID                             *Buffer OPTIONAL
00079   );
00080 
00081 ///
00082 /// The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
00083 ///
00084 struct _EFI_LOAD_FILE_PROTOCOL {
00085   EFI_LOAD_FILE LoadFile;
00086 };
00087 
00088 extern EFI_GUID gEfiLoadFileProtocolGuid;
00089 
00090 #endif