]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/DxePiLib.h
Update prototype of DxeLoadCore().
[mirror_edk2.git] / MdePkg / Include / Library / DxePiLib.h
CommitLineData
1c280088 1/** @file\r
2 MDE PI library functions and macros\r
3\r
4 Copyright (c) 2007, Intel Corporation \r
5 All rights reserved. This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. The full text of the license may be found at \r
8 http://opensource.org/licenses/bsd-license.php \r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
13**/\r
14\r
15#ifndef __PI_LIB_H__\r
16#define __PI_LIB_H__\r
17\r
18#include <Pi/PiFirmwareFile.h>\r
19\r
b0d803fe 20\r
21/**\r
ff197efb 22 Locates a requested firmware section within a file and returns it to a buffer allocated by this function. \r
23\r
24 PiLibGetSectionFromAnyFv () is used to read a specific section from a file within a firmware volume. The function\r
25 will search the first file with the specified name in all firmware volumes in the system. The search order for firmware \r
26 volumes in the system is determistic but abitrary if no new firmware volume is added into the system between \r
27 each calls of this function. \r
28\r
29 After the specific file is located, the function searches the specifc firmware section with type SectionType in this file. \r
30 The details of this search order is defined in description of EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection () \r
31 found in PI Specification.\r
32\r
33 If SectionType is EFI_SECTION_TE, EFI_SECTION_TE is used as section type to start the search. If EFI_SECTION_TE section \r
34 is not found, EFI_SECTION_PE32 will be used to try the search again. If no EFI_SECTION_PE32 section is found, EFI_NOT_FOUND \r
35 is returned.\r
36\r
37 The data and size is returned by Buffer and Size. The caller is responsible to free the Buffer allocated \r
38 by this function. This function can only be called at TPL_NOTIFY and below.\r
39\r
40 If NameGuid is NULL, then ASSERT();\r
41 If Buffer is NULL, then ASSERT();\r
42 If Size is NULL, then ASSERT().\r
43\r
44 @param NameGuid Pointer to an EFI_GUID, which indicates the file name from which the requested \r
45 section will be read. Type EFI_GUID is defined in \r
46 InstallProtocolInterface() in the UEFI 2.0 specification. \r
47 @param SectionType Indicates the section type to return. SectionType in conjunction with \r
48 SectionInstance indicates which section to return. Type \r
49 EFI_SECTION_TYPE is defined in EFI_COMMON_SECTION_HEADER.\r
50 @param SectionInstance Indicates which instance of sections with a type of SectionType to return. \r
51 SectionType in conjunction with SectionInstance indicates which section to \r
52 return. SectionInstance is zero based.\r
53 @param Buffer Pointer to a pointer to a buffer in which the section contents are returned, not \r
54 including the section header. Caller is responsible to free this memory.\r
55 @param Size Pointer to a caller-allocated UINTN. It indicates the size of the memory represented by \r
56 *Buffer.\r
57\r
58 @retval EFI_SUCCESS The image is found and data and size is returned.\r
59 @retval EFI_NOT_FOUND The image specified by NameGuid and SectionType can't be found.\r
60 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the output data buffer or complete the operations.\r
61 @retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.\r
62 @retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.\r
63\r
f80b0830 64**/\r
b0d803fe 65EFI_STATUS\r
66EFIAPI\r
166152e8 67PiLibGetSectionFromAnyFv (\r
b0d803fe 68 IN CONST EFI_GUID *NameGuid,\r
69 IN EFI_SECTION_TYPE SectionType,\r
ff197efb 70 IN UINTN SectionInstance,\r
b0d803fe 71 OUT VOID **Buffer,\r
72 OUT UINTN *Size\r
73 )\r
74;\r
75\r
76/**\r
ff197efb 77 Locates a requested firmware section within a file and returns it to a buffer allocated by this function. \r
78\r
79 PiLibGetSectionFromCurrentFv () is used to read a specific section from a file within the same firmware volume from which\r
80 the running image is loaded. If the specific file is found, the function searches the specifc firmware section with type SectionType. \r
81 The details of this search order is defined in description of EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection () \r
82 found in PI Specification.\r
83\r
84 If SectionType is EFI_SECTION_TE, EFI_SECTION_TE is used as section type to start the search. If EFI_SECTION_TE section \r
85 is not found, EFI_SECTION_PE32 will be used to try the search again. If no EFI_SECTION_PE32 section is found, EFI_NOT_FOUND \r
86 is returned.\r
87\r
88 The data and size is returned by Buffer and Size. The caller is responsible to free the Buffer allocated \r
89 by this function. This function can be only called at TPL_NOTIFY and below.\r
90\r
91 If NameGuid is NULL, then ASSERT();\r
92 If Buffer is NULL, then ASSERT();\r
93 If Size is NULL, then ASSERT().\r
94\r
95 @param NameGuid Pointer to an EFI_GUID, which indicates the file name from which the requested \r
96 section will be read. Type EFI_GUID is defined in \r
97 InstallProtocolInterface() in the UEFI 2.0 specification. \r
98 @param SectionType Indicates the section type to return. SectionType in conjunction with \r
99 SectionInstance indicates which section to return. Type \r
100 EFI_SECTION_TYPE is defined in EFI_COMMON_SECTION_HEADER.\r
101 @param SectionInstance Indicates which instance of sections with a type of SectionType to return. \r
102 SectionType in conjunction with SectionInstance indicates which section to \r
103 return. SectionInstance is zero based.\r
104 @param Buffer Pointer to a pointer to a buffer in which the section contents are returned, not \r
105 including the section header. Caller is responsible to free this memory.\r
106 @param Size Pointer to a caller-allocated UINTN. It indicates the size of the memory represented by \r
107 *Buffer.\r
108\r
109\r
110 @retval EFI_SUCCESS The image is found and data and size is returned.\r
111 @retval EFI_UNSUPPORTED FvHandle does not support EFI_FIRMWARE_VOLUME2_PROTOCOL.\r
112 @retval EFI_NOT_FOUND The image specified by NameGuid and SectionType can't be found.\r
113 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the output data buffer or complete the operations.\r
114 @retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.\r
115 @retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.\r
b0d803fe 116 \r
f80b0830 117**/\r
b0d803fe 118EFI_STATUS\r
119EFIAPI\r
166152e8 120PiLibGetSectionFromCurrentFv (\r
b0d803fe 121 IN CONST EFI_GUID *NameGuid,\r
122 IN EFI_SECTION_TYPE SectionType,\r
ff197efb 123 IN UINTN SectionInstance,\r
b0d803fe 124 OUT VOID **Buffer,\r
125 OUT UINTN *Size\r
126 )\r
127;\r
128\r
129\r
130/**\r
ff197efb 131 Locates a requested firmware section within a file and returns it to a buffer allocated by this function. \r
132\r
133 PiLibGetSectionFromCurrentFfs () searches the specifc firmware section with type SectionType in the same firmware file from\r
134 which the running image is loaded. The details of this search order is defined in description of \r
135 EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection () found in PI Specification.\r
136\r
137 If SectionType is EFI_SECTION_TE, EFI_SECTION_TE is used as section type to start the search. If EFI_SECTION_TE section \r
138 is not found, EFI_SECTION_PE32 will be used to try the search again. If no EFI_SECTION_PE32 section is found, EFI_NOT_FOUND \r
139 is returned.\r
140\r
141\r
142 The data and size is returned by Buffer and Size. The caller is responsible to free the Buffer allocated \r
143 by this function. This function can only be called at TPL_NOTIFY and below.\r
144\r
145 If Buffer is NULL, then ASSERT();\r
146 If Size is NULL, then ASSERT().\r
147\r
148 @param SectionType Indicates the section type to return. SectionType in conjunction with \r
149 SectionInstance indicates which section to return. Type \r
150 EFI_SECTION_TYPE is defined in EFI_COMMON_SECTION_HEADER.\r
151 @param SectionInstance Indicates which instance of sections with a type of SectionType to return. \r
152 SectionType in conjunction with SectionInstance indicates which section to \r
153 return. SectionInstance is zero based.\r
154 @param Buffer Pointer to a pointer to a buffer in which the section contents are returned, not \r
155 including the section header. Caller is responsible to free this memory.\r
156 @param Size Pointer to a caller-allocated UINTN. It indicates the size of the memory represented by \r
157 *Buffer.\r
158\r
159 @retval EFI_SUCCESS The image is found and data and size is returned.\r
160 @retval EFI_NOT_FOUND The image specified by NameGuid and SectionType can't be found.\r
161 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the output data buffer or complete the operations.\r
162 @retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.\r
163 @retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.\r
b0d803fe 164 \r
f80b0830 165**/\r
b0d803fe 166EFI_STATUS\r
167EFIAPI\r
166152e8 168PiLibGetSectionFromCurrentFfs (\r
b0d803fe 169 IN EFI_SECTION_TYPE SectionType,\r
ff197efb 170 IN UINTN SectionInstance,\r
b0d803fe 171 OUT VOID **Buffer,\r
172 OUT UINTN *Size\r
173 )\r
174;\r
1c280088 175\r
176#endif\r
177\r