4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 extern VOID
*gHobList
;
22 Returns the pointer to the HOB list.
24 @return The pointer to the HOB list.
37 This function searches the first instance of a HOB type from the starting HOB pointer.
38 If there does not exist such HOB type from the starting HOB pointer, it will return NULL.
40 @param Type The HOB type to return.
41 @param HobStart The starting HOB pointer to search from.
43 @return The next instance of a HOB type from the starting HOB.
50 IN CONST VOID
*HobStart
53 EFI_PEI_HOB_POINTERS Hob
;
55 ASSERT (HobStart
!= NULL
);
57 Hob
.Raw
= (UINT8
*) HobStart
;
59 // Parse the HOB list, stop if end of list or matching type found.
61 while (!END_OF_HOB_LIST (Hob
)) {
62 if (Hob
.Header
->HobType
== Type
) {
65 Hob
.Raw
= GET_NEXT_HOB (Hob
);
71 This function searches the first instance of a HOB type among the whole HOB list.
72 If there does not exist such HOB type in the HOB list, it will return NULL.
74 @param Type The HOB type to return.
76 @return The next instance of a HOB type from the starting HOB.
87 HobList
= GetHobList ();
88 return GetNextHob (Type
, HobList
);
92 This function searches the first instance of a HOB from the starting HOB pointer.
93 Such HOB should satisfy two conditions:
94 its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
95 If there does not exist such HOB from the starting HOB pointer, it will return NULL.
97 @param Guid The GUID to match with in the HOB list.
98 @param HobStart A pointer to a Guid.
100 @return The next instance of the matched GUID HOB from the starting HOB.
106 IN CONST EFI_GUID
*Guid
,
107 IN CONST VOID
*HobStart
110 EFI_PEI_HOB_POINTERS GuidHob
;
112 GuidHob
.Raw
= (UINT8
*) HobStart
;
113 while ((GuidHob
.Raw
= GetNextHob (EFI_HOB_TYPE_GUID_EXTENSION
, GuidHob
.Raw
)) != NULL
) {
114 if (CompareGuid (Guid
, &GuidHob
.Guid
->Name
)) {
117 GuidHob
.Raw
= GET_NEXT_HOB (GuidHob
);
123 This function searches the first instance of a HOB among the whole HOB list.
124 Such HOB should satisfy two conditions:
125 its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
126 If there does not exist such HOB from the starting HOB pointer, it will return NULL.
128 @param Guid The GUID to match with in the HOB list.
130 @return The first instance of the matched GUID HOB among the whole HOB list.
136 IN CONST EFI_GUID
*Guid
141 HobList
= GetHobList ();
142 return GetNextGuidHob (Guid
, HobList
);
146 This function builds a HOB for a loaded PE32 module.
148 @param ModuleName The GUID File Name of the module.
149 @param MemoryAllocationModule The 64 bit physical address of the module.
150 @param ModuleLength The length of the module in bytes.
151 @param EntryPoint The 64 bit physical address of the module\92s entry point.
157 IN CONST EFI_GUID
*ModuleName
,
158 IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule
,
159 IN UINT64 ModuleLength
,
160 IN EFI_PHYSICAL_ADDRESS EntryPoint
164 // PEI HOB is read only for DXE phase
170 Builds a HOB that describes a chunk of system memory.
172 @param ResourceType The type of resource described by this HOB.
173 @param ResourceAttribute The resource attributes of the memory described by this HOB.
174 @param PhysicalStart The 64 bit physical address of memory described by this HOB.
175 @param NumberOfBytes The length of the memory described by this HOB in bytes.
180 BuildResourceDescriptorHob (
181 IN EFI_RESOURCE_TYPE ResourceType
,
182 IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute
,
183 IN EFI_PHYSICAL_ADDRESS PhysicalStart
,
184 IN UINT64 NumberOfBytes
188 // PEI HOB is read only for DXE phase
194 This function builds a customized HOB tagged with a GUID for identification
195 and returns the start address of GUID HOB data so that caller can fill the customized data.
197 @param Guid The GUID to tag the customized HOB.
198 @param DataLength The size of the data payload for the GUID HOB.
200 @return The start address of GUID HOB data.
206 IN CONST EFI_GUID
*Guid
,
211 // PEI HOB is read only for DXE phase
218 This function builds a customized HOB tagged with a GUID for identification,
219 copies the input data to the HOB data field, and returns the start address of GUID HOB data.
221 @param Guid The GUID to tag the customized HOB.
222 @param Data The data to be copied into the data field of the GUID HOB.
223 @param DataLength The size of the data payload for the GUID HOB.
225 @return The start address of GUID HOB data.
231 IN CONST EFI_GUID
*Guid
,
237 // PEI HOB is read only for DXE phase
244 Builds a Firmware Volume HOB.
246 @param BaseAddress The base address of the Firmware Volume.
247 @param Length The size of the Firmware Volume in bytes.
253 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
258 // PEI HOB is read only for DXE phase
264 Builds a Capsule Volume HOB.
266 @param BaseAddress The base address of the Capsule Volume.
267 @param Length The size of the Capsule Volume in bytes.
273 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
278 // PEI HOB is read only for DXE phase
284 Builds a HOB for the CPU.
286 @param SizeOfMemorySpace The maximum physical memory addressability of the processor.
287 @param SizeOfIoSpace The maximum physical I/O addressability of the processor.
293 IN UINT8 SizeOfMemorySpace
,
294 IN UINT8 SizeOfIoSpace
298 // PEI HOB is read only for DXE phase
304 Builds a HOB for the Stack.
306 @param BaseAddress The 64 bit physical address of the Stack.
307 @param Length The length of the stack in bytes.
313 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
318 // PEI HOB is read only for DXE phase
324 Builds a HOB for the BSP store.
326 @param BaseAddress The 64 bit physical address of the BSP.
327 @param Length The length of the BSP store in bytes.
328 @param MemoryType Type of memory allocated by this HOB.
334 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
336 IN EFI_MEMORY_TYPE MemoryType
340 // PEI HOB is read only for DXE phase
346 Builds a HOB for the memory allocation.
348 @param BaseAddress The 64 bit physical address of the memory.
349 @param Length The length of the memory allocation in bytes.
350 @param MemoryType Type of memory allocated by this HOB.
355 BuildMemoryAllocationHob (
356 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
358 IN EFI_MEMORY_TYPE MemoryType
362 // PEI HOB is read only for DXE phase