iPXE
LoadFile2.h
Go to the documentation of this file.
00001 /** @file
00002   Load File protocol as defined in the UEFI 2.0 specification.
00003 
00004   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 - 2008, Intel Corporation. All rights reserved.<BR>
00011   This program and the accompanying materials
00012   are licensed and made available under the terms and conditions of the BSD License
00013   which accompanies this distribution.  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_FILE2_PROTOCOL_H__
00022 #define __EFI_LOAD_FILE2_PROTOCOL_H__
00023 
00024 FILE_LICENCE ( BSD3 );
00025 
00026 #define EFI_LOAD_FILE2_PROTOCOL_GUID \
00027   { \
00028     0x4006c0c1, 0xfcb3, 0x403e, {0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d } \
00029   }
00030 
00031 ///
00032 /// Protocol Guid defined by UEFI2.1.
00033 ///
00034 #define LOAD_FILE2_PROTOCOL EFI_LOAD_FILE2_PROTOCOL_GUID
00035 
00036 typedef struct _EFI_LOAD_FILE2_PROTOCOL EFI_LOAD_FILE2_PROTOCOL;
00037 
00038 
00039 /**
00040   Causes the driver to load a specified file.
00041 
00042   @param  This       Protocol instance pointer.
00043   @param  FilePath   The device specific path of the file to load.
00044   @param  BootPolicy Should always be FALSE.
00045   @param  BufferSize On input the size of Buffer in bytes. On output with a return
00046                      code of EFI_SUCCESS, the amount of data transferred to
00047                      Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,
00048                      the size of Buffer required to retrieve the requested file.
00049   @param  Buffer     The memory buffer to transfer the file to. IF Buffer is NULL,
00050                      then no the size of the requested file is returned in
00051                      BufferSize.
00052 
00053   @retval EFI_SUCCESS           The file was loaded.
00054   @retval EFI_UNSUPPORTED       BootPolicy is TRUE.
00055   @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or
00056                                 BufferSize is NULL.
00057   @retval EFI_NO_MEDIA          No medium was present to load the file.
00058   @retval EFI_DEVICE_ERROR      The file was not loaded due to a device error.
00059   @retval EFI_NO_RESPONSE       The remote system did not respond.
00060   @retval EFI_NOT_FOUND         The file was not found
00061   @retval EFI_ABORTED           The file load process was manually canceled.
00062   @retval EFI_BUFFER_TOO_SMALL  The BufferSize is too small to read the current
00063                                 directory entry. BufferSize has been updated with
00064                                 the size needed to complete the request.
00065 
00066 
00067 **/
00068 typedef
00069 EFI_STATUS
00070 (EFIAPI *EFI_LOAD_FILE2)(
00071   IN EFI_LOAD_FILE2_PROTOCOL           *This,
00072   IN EFI_DEVICE_PATH_PROTOCOL         *FilePath,
00073   IN BOOLEAN                          BootPolicy,
00074   IN OUT UINTN                        *BufferSize,
00075   IN VOID                             *Buffer OPTIONAL
00076   );
00077 
00078 ///
00079 /// The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
00080 ///
00081 struct _EFI_LOAD_FILE2_PROTOCOL {
00082   EFI_LOAD_FILE2 LoadFile;
00083 };
00084 
00085 extern EFI_GUID gEfiLoadFile2ProtocolGuid;
00086 
00087 #endif