iPXE
LoadedImage.h
Go to the documentation of this file.
00001 /** @file
00002   UEFI 2.0 Loaded image protocol definition.
00003 
00004   Every EFI driver and application is passed an image handle when it is loaded.
00005   This image handle will contain a Loaded Image Protocol.
00006 
00007   Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
00008   This program and the accompanying materials
00009   are licensed and made available under the terms and conditions of the BSD License
00010   which accompanies this distribution.  The full text of the license may be found at
00011   http://opensource.org/licenses/bsd-license.php
00012 
00013   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00014   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00015 
00016 **/
00017 
00018 #ifndef __LOADED_IMAGE_PROTOCOL_H__
00019 #define __LOADED_IMAGE_PROTOCOL_H__
00020 
00021 FILE_LICENCE ( BSD3 );
00022 
00023 #define EFI_LOADED_IMAGE_PROTOCOL_GUID \
00024   { \
00025     0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \
00026   }
00027 
00028 #define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \
00029   { \
00030     0xbc62157e, 0x3e33, 0x4fec, {0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } \
00031   }
00032 
00033 ///
00034 /// Protocol GUID defined in EFI1.1.
00035 ///
00036 #define LOADED_IMAGE_PROTOCOL   EFI_LOADED_IMAGE_PROTOCOL_GUID
00037 
00038 ///
00039 /// EFI_SYSTEM_TABLE & EFI_IMAGE_UNLOAD are defined in EfiApi.h
00040 ///
00041 #define EFI_LOADED_IMAGE_PROTOCOL_REVISION  0x1000
00042 
00043 ///
00044 /// Revision defined in EFI1.1.
00045 ///
00046 #define EFI_LOADED_IMAGE_INFORMATION_REVISION    EFI_LOADED_IMAGE_PROTOCOL_REVISION
00047 
00048 ///
00049 /// Can be used on any image handle to obtain information about the loaded image.
00050 ///
00051 typedef struct {
00052   UINT32            Revision;       ///< Defines the revision of the EFI_LOADED_IMAGE_PROTOCOL structure.
00053                                     ///< All future revisions will be backward compatible to the current revision.
00054   EFI_HANDLE        ParentHandle;   ///< Parent image's image handle. NULL if the image is loaded directly from
00055                                     ///< the firmware's boot manager.
00056   EFI_SYSTEM_TABLE  *SystemTable;   ///< the image's EFI system table pointer.
00057 
00058   //
00059   // Source location of image
00060   //
00061   EFI_HANDLE        DeviceHandle;   ///< The device handle that the EFI Image was loaded from.
00062   EFI_DEVICE_PATH_PROTOCOL  *FilePath;  ///< A pointer to the file path portion specific to DeviceHandle
00063                                         ///< that the EFI Image was loaded from.
00064   VOID              *Reserved;      ///< Reserved. DO NOT USE.
00065 
00066   //
00067   // Images load options
00068   //
00069   UINT32            LoadOptionsSize;///< The size in bytes of LoadOptions.
00070   VOID              *LoadOptions;   ///< A pointer to the image's binary load options.
00071 
00072   //
00073   // Location of where image was loaded
00074   //
00075   VOID              *ImageBase;     ///< The base address at which the image was loaded.
00076   UINT64            ImageSize;      ///< The size in bytes of the loaded image.
00077   EFI_MEMORY_TYPE   ImageCodeType;  ///< The memory type that the code sections were loaded as.
00078   EFI_MEMORY_TYPE   ImageDataType;  ///< The memory type that the data sections were loaded as.
00079   EFI_IMAGE_UNLOAD  Unload;
00080 } EFI_LOADED_IMAGE_PROTOCOL;
00081 
00082 //
00083 // For backward-compatible with EFI1.1.
00084 //
00085 typedef EFI_LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE;
00086 
00087 extern EFI_GUID gEfiLoadedImageProtocolGuid;
00088 extern EFI_GUID gEfiLoadedImageDevicePathProtocolGuid;
00089 
00090 #endif