]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/LoadedImage.h
Code Scrub for Protocol and Ppi Definition
[mirror_edk2.git] / MdePkg / Include / Protocol / LoadedImage.h
1 /** @file
2 UEFI 2.0 Loaded image protocol definition.
3
4 Every EFI driver and application is passed an image handle when it is loaded.
5 This image handle will contain a Loaded Image Protocol.
6
7 Copyright (c) 2006 - 2008, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 **/
17
18 #ifndef __LOADED_IMAGE_PROTOCOL_H__
19 #define __LOADED_IMAGE_PROTOCOL_H__
20
21 #include <Protocol/DevicePath.h>
22
23 #define EFI_LOADED_IMAGE_PROTOCOL_GUID \
24 { \
25 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \
26 }
27
28 #define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \
29 { \
30 0xbc62157e, 0x3e33, 0x4fec, {0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } \
31 }
32
33 //
34 // Protocol GUID defined in EFI1.1.
35 //
36 #define LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE_PROTOCOL_GUID
37
38 //
39 // EFI_SYSTEM_TABLE & EFI_IMAGE_UNLOAD are defined in EfiApi.h
40 //
41 #define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000
42
43 //
44 // Revision defined in EFI1.1.
45 //
46 #define EFI_LOADED_IMAGE_INFORMATION_REVISION EFI_LOADED_IMAGE_PROTOCOL_REVISION
47
48 /**
49 @par Protocol Description:
50 Can be used on any image handle to obtain information about the loaded image.
51
52 @param Revision
53 Defines the revision of the EFI_LOADED_IMAGE_PROTOCOL structure.
54 All future revisions will be backward compatible to the current revision.
55
56 @param ParentHandle
57 Parent image's image handle. NULL if the image is loaded directly from
58 the firmware's boot manager.
59
60 @param SystemTable
61 The image's EFI system table pointer.
62
63 @param DeviceHandle
64 The device handle that the EFI Image was loaded from.
65
66 @param FilePath
67 A pointer to the file path portion specific to DeviceHandle
68 that the EFI Image was loaded from.
69
70 @param Reserved
71 Reserved. DO NOT USE.
72
73 @param LoadOptionsSize
74 The size in bytes of LoadOptions.
75
76 @param LoadOptions
77 A pointer to the image's binary load options.
78
79 @param ImageBase
80 The base address at which the image was loaded.
81
82 @param ImageSize
83 The size in bytes of the loaded image.
84
85 @param ImageCodeType
86 The memory
87
88 @param ImageDataType
89 The memory
90
91 @param Unload
92 Function that unloads the image.
93
94 **/
95 typedef struct {
96 UINT32 Revision;
97 EFI_HANDLE ParentHandle;
98 EFI_SYSTEM_TABLE *SystemTable;
99
100 //
101 // Source location of image
102 //
103 EFI_HANDLE DeviceHandle;
104 EFI_DEVICE_PATH_PROTOCOL *FilePath;
105 VOID *Reserved;
106
107 //
108 // Images load options
109 //
110 UINT32 LoadOptionsSize;
111 VOID *LoadOptions;
112
113 //
114 // Location of where image was loaded
115 //
116 VOID *ImageBase;
117 UINT64 ImageSize;
118 EFI_MEMORY_TYPE ImageCodeType;
119 EFI_MEMORY_TYPE ImageDataType;
120
121 //
122 // If the driver image supports a dynamic unload request
123 //
124 EFI_IMAGE_UNLOAD Unload;
125
126 } EFI_LOADED_IMAGE_PROTOCOL;
127
128 //
129 // For backward-compatible with EFI1.1.
130 //
131 typedef EFI_LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE;
132
133 extern EFI_GUID gEfiLoadedImageProtocolGuid;
134 extern EFI_GUID gEfiLoadedImageDevicePathProtocolGuid;
135
136 #endif