]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Protocol/LoadPe32Image.h
Code scrube for MdeModule Definitions.
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / LoadPe32Image.h
CommitLineData
504214c4 1/** @file\r
d8a43975 2\r
5f597758
LG
3 Load File protocol provides capability to load and unload EFI image into \r
4 memory and execute it.\r
d8a43975 5\r
6 Load file protocol exists to supports the addition of new boot devices,\r
7 and to support booting from devices that do not map well to file system.\r
8 Network boot is done via a LoadFile protocol.\r
9\r
8a7d75b0 10 UEFI 2.0 can boot from any device that produces a LoadFile protocol.\r
d8a43975 11\r
504214c4
LG
12Copyright (c) 2006 - 2008, Intel Corporation\r
13All rights reserved. This program and the accompanying materials\r
14are licensed and made available under the terms and conditions of the BSD License\r
15which accompanies this distribution. The full text of the license may be found at\r
16http://opensource.org/licenses/bsd-license.php\r
17\r
18THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
19WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
20\r
21**/\r
d8a43975 22\r
23#ifndef __LOAD_PE32_IMAGE_H__\r
24#define __LOAD_PE32_IMAGE_H__\r
25\r
26#define PE32_IMAGE_PROTOCOL_GUID \\r
27 {0x5cb5c776,0x60d5,0x45ee,{0x88,0x3c,0x45,0x27,0x8,0xcd,0x74,0x3f }}\r
28\r
29#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_NONE 0x00\r
30#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION 0x01\r
31#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION 0x02\r
32\r
33typedef struct _EFI_PE32_IMAGE_PROTOCOL EFI_PE32_IMAGE_PROTOCOL;\r
34\r
504214c4
LG
35/**\r
36\r
37 Loads an EFI image into memory and returns a handle to the image with extended parameters.\r
38\r
39 @param This Calling context\r
40 @param ParentImageHandle The caller's image handle.\r
41 @param FilePath The specific file path from which the image is loaded.\r
42 @param SourceBuffer If not NULL, a pointer to the memory location containing a copy of\r
43 the image to be loaded.\r
44 @param SourceSize The size in bytes of SourceBuffer.\r
45 @param DstBuffer The buffer to store the image.\r
46 @param NumberOfPages For input, specifies the space size of the image by caller if not NULL.\r
47 For output, specifies the actual space size needed.\r
48 @param ImageHandle Image handle for output.\r
49 @param EntryPoint Image entry point for output.\r
50 @param Attribute The bit mask of attributes to set for the load PE image.\r
51\r
52 @retval EFI_SUCCESS The image was loaded into memory.\r
53 @retval EFI_NOT_FOUND The FilePath was not found.\r
54 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
55 @retval EFI_UNSUPPORTED The image type is not supported, or the device path cannot be\r
56 parsed to locate the proper protocol for loading the file.\r
57 @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient resources.\r
58**/\r
d8a43975 59typedef\r
60EFI_STATUS\r
61(EFIAPI *LOAD_PE_IMAGE) (\r
62 IN EFI_PE32_IMAGE_PROTOCOL *This,\r
63 IN EFI_HANDLE ParentImageHandle,\r
64 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
65 IN VOID *SourceBuffer OPTIONAL,\r
66 IN UINTN SourceSize,\r
67 IN EFI_PHYSICAL_ADDRESS DstBuffer OPTIONAL,\r
68 OUT UINTN *NumberOfPages OPTIONAL,\r
69 OUT EFI_HANDLE *ImageHandle,\r
70 OUT EFI_PHYSICAL_ADDRESS *EntryPoint OPTIONAL,\r
71 IN UINT32 Attribute\r
72 );\r
73\r
504214c4
LG
74/**\r
75\r
76 Unload the specified image.\r
77\r
78 @param This Indicates the calling context.\r
79 @param ImageHandle The specified image handle.\r
80\r
81 @retval EFI_INVALID_PARAMETER Image handle is NULL.\r
82 @retval EFI_UNSUPPORTED Attempt to unload an unsupported image.\r
83 @retval EFI_SUCCESS Image successfully unloaded.\r
84\r
85--*/\r
d8a43975 86typedef\r
87EFI_STATUS\r
88(EFIAPI *UNLOAD_PE_IMAGE) (\r
89 IN EFI_PE32_IMAGE_PROTOCOL *This,\r
90 IN EFI_HANDLE ImageHandle\r
91 );\r
92\r
93struct _EFI_PE32_IMAGE_PROTOCOL {\r
94 LOAD_PE_IMAGE LoadPeImage;\r
95 UNLOAD_PE_IMAGE UnLoadPeImage;\r
96};\r
97\r
98extern EFI_GUID gEfiLoadPeImageProtocolGuid;\r
99\r
100#endif\r
101\r