TianoCore EDK2 master
Loading...
Searching...
No Matches
StandaloneMmHobLib.c
Go to the documentation of this file.
1
12#include <PiMm.h>
13
14#include <Library/HobLib.h>
15#include <Library/DebugLib.h>
18
19//
20// Cache copy of HobList pointer.
21//
23
38EFIAPI
40 IN EFI_HANDLE ImageHandle,
41 IN EFI_MM_SYSTEM_TABLE *MmSystemTable
42 )
43{
44 UINTN Index;
45
46 for (Index = 0; Index < gMmst->NumberOfTableEntries; Index++) {
47 if (CompareGuid (&gEfiHobListGuid, &gMmst->MmConfigurationTable[Index].VendorGuid)) {
49 break;
50 }
51 }
52
53 return EFI_SUCCESS;
54}
55
65VOID *
66EFIAPI
68 VOID
69 )
70{
71 UINTN Index;
72
73 if (gHobList == NULL) {
74 for (Index = 0; Index < gMmst->NumberOfTableEntries; Index++) {
75 if (CompareGuid (&gEfiHobListGuid, &gMmst->MmConfigurationTable[Index].VendorGuid)) {
77 break;
78 }
79 }
80 }
81
82 ASSERT (gHobList != NULL);
83 return gHobList;
84}
85
103VOID *
104EFIAPI
106 IN UINT16 Type,
107 IN CONST VOID *HobStart
108 )
109{
111
112 ASSERT (HobStart != NULL);
113
114 Hob.Raw = (UINT8 *)HobStart;
115 //
116 // Parse the HOB list until end of list or matching type is found.
117 //
118 while (!END_OF_HOB_LIST (Hob)) {
119 if (Hob.Header->HobType == Type) {
120 return Hob.Raw;
121 }
122
123 Hob.Raw = GET_NEXT_HOB (Hob);
124 }
125
126 return NULL;
127}
128
142VOID *
143EFIAPI
145 IN UINT16 Type
146 )
147{
148 VOID *HobList;
149
150 HobList = GetHobList ();
151 return GetNextHob (Type, HobList);
152}
153
176VOID *
177EFIAPI
179 IN CONST EFI_GUID *Guid,
180 IN CONST VOID *HobStart
181 )
182{
183 EFI_PEI_HOB_POINTERS GuidHob;
184
185 GuidHob.Raw = (UINT8 *)HobStart;
186 while ((GuidHob.Raw = GetNextHob (EFI_HOB_TYPE_GUID_EXTENSION, GuidHob.Raw)) != NULL) {
187 if (CompareGuid (Guid, &GuidHob.Guid->Name)) {
188 break;
189 }
190
191 GuidHob.Raw = GET_NEXT_HOB (GuidHob);
192 }
193
194 return GuidHob.Raw;
195}
196
215VOID *
216EFIAPI
218 IN CONST EFI_GUID *Guid
219 )
220{
221 VOID *HobList;
222
223 HobList = GetHobList ();
224 return GetNextGuidHob (Guid, HobList);
225}
226
241EFIAPI
243 VOID
244 )
245{
246 EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;
247
248 HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *)GetHobList ();
249
250 return HandOffHob->BootMode;
251}
252
269VOID
270EFIAPI
272 IN CONST EFI_GUID *ModuleName,
273 IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,
274 IN UINT64 ModuleLength,
275 IN EFI_PHYSICAL_ADDRESS EntryPoint
276 )
277{
278 //
279 // HOB is read only for Standalone MM drivers
280 //
281 ASSERT (FALSE);
282}
283
299VOID
300EFIAPI
302 IN EFI_RESOURCE_TYPE ResourceType,
303 IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
304 IN EFI_PHYSICAL_ADDRESS PhysicalStart,
305 IN UINT64 NumberOfBytes
306 )
307{
308 //
309 // HOB is read only for Standalone MM drivers
310 //
311 ASSERT (FALSE);
312}
313
333VOID *
334EFIAPI
336 IN CONST EFI_GUID *Guid,
337 IN UINTN DataLength
338 )
339{
340 //
341 // HOB is read only for Standalone MM drivers
342 //
343 ASSERT (FALSE);
344 return NULL;
345}
346
368VOID *
369EFIAPI
371 IN CONST EFI_GUID *Guid,
372 IN VOID *Data,
373 IN UINTN DataLength
374 )
375{
376 //
377 // HOB is read only for Standalone MM drivers
378 //
379 ASSERT (FALSE);
380 return NULL;
381}
382
396VOID
397EFIAPI
399 IN EFI_PHYSICAL_ADDRESS BaseAddress,
400 IN UINT64 Length
401 )
402{
403 //
404 // HOB is read only for Standalone MM drivers
405 //
406 ASSERT (FALSE);
407}
408
424VOID
425EFIAPI
427 IN EFI_PHYSICAL_ADDRESS BaseAddress,
428 IN UINT64 Length,
429 IN CONST EFI_GUID *FvName,
430 IN CONST EFI_GUID *FileName
431 )
432{
433 //
434 // HOB is read only for Standalone MM drivers
435 //
436 ASSERT (FALSE);
437}
438
452VOID
453EFIAPI
455 IN UINT8 SizeOfMemorySpace,
456 IN UINT8 SizeOfIoSpace
457 )
458{
459 //
460 // HOB is read only for Standalone MM drivers
461 //
462 ASSERT (FALSE);
463}
464
479VOID
480EFIAPI
482 IN EFI_PHYSICAL_ADDRESS BaseAddress,
483 IN UINT64 Length,
484 IN EFI_MEMORY_TYPE MemoryType
485 )
486{
487 //
488 // HOB is read only for Standalone MM drivers
489 //
490 ASSERT (FALSE);
491}
492
506VOID
507EFIAPI
509 IN EFI_RESOURCE_TYPE ResourceType,
510 IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
511 IN EFI_PHYSICAL_ADDRESS PhysicalStart,
512 IN UINT64 NumberOfBytes,
513 IN EFI_GUID *OwnerGUID
514 )
515{
516 ASSERT (FALSE);
517}
518
530VOID
531EFIAPI
533 IN EFI_PHYSICAL_ADDRESS BaseAddress,
534 IN UINT64 Length
535 )
536{
537 ASSERT (FALSE);
538}
539
551VOID
552EFIAPI
554 IN EFI_PHYSICAL_ADDRESS BaseAddress,
555 IN UINT64 Length,
556 IN EFI_MEMORY_TYPE MemoryType
557 )
558{
559 ASSERT (FALSE);
560}
561
572VOID
573EFIAPI
575 IN EFI_PHYSICAL_ADDRESS BaseAddress,
576 IN UINT64 Length
577 )
578{
579 ASSERT (FALSE);
580}
UINT64 UINTN
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
Definition: MemLibGuid.c:73
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define STATIC
Definition: Base.h:264
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
UINT32 EFI_BOOT_MODE
Definition: PiBootMode.h:18
UINT32 EFI_RESOURCE_TYPE
Definition: PiHob.h:223
UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE
Definition: PiHob.h:241
VOID EFIAPI BuildFv2Hob(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN CONST EFI_GUID *FvName, IN CONST EFI_GUID *FileName)
EFI_STATUS EFIAPI HobLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_MM_SYSTEM_TABLE *MmSystemTable)
VOID *EFIAPI GetFirstHob(IN UINT16 Type)
STATIC VOID * gHobList
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI BuildGuidDataHob(IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN DataLength)
VOID EFIAPI BuildModuleHob(IN CONST EFI_GUID *ModuleName, IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule, IN UINT64 ModuleLength, IN EFI_PHYSICAL_ADDRESS EntryPoint)
VOID EFIAPI BuildCpuHob(IN UINT8 SizeOfMemorySpace, IN UINT8 SizeOfIoSpace)
VOID EFIAPI BuildResourceDescriptorHob(IN EFI_RESOURCE_TYPE ResourceType, IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute, IN EFI_PHYSICAL_ADDRESS PhysicalStart, IN UINT64 NumberOfBytes)
VOID EFIAPI BuildFvHob(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
VOID *EFIAPI BuildGuidHob(IN CONST EFI_GUID *Guid, IN UINTN DataLength)
VOID EFIAPI BuildBspStoreHob(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN EFI_MEMORY_TYPE MemoryType)
VOID EFIAPI BuildMemoryAllocationHob(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN EFI_MEMORY_TYPE MemoryType)
VOID *EFIAPI GetNextHob(IN UINT16 Type, IN CONST VOID *HobStart)
VOID EFIAPI BuildCvHob(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
VOID *EFIAPI GetNextGuidHob(IN CONST EFI_GUID *Guid, IN CONST VOID *HobStart)
VOID *EFIAPI GetHobList(VOID)
VOID EFIAPI BuildStackHob(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
EFI_BOOT_MODE EFIAPI GetBootModeHob(VOID)
VOID EFIAPI BuildResourceDescriptorWithOwnerHob(IN EFI_RESOURCE_TYPE ResourceType, IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute, IN EFI_PHYSICAL_ADDRESS PhysicalStart, IN UINT64 NumberOfBytes, IN EFI_GUID *OwnerGUID)
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_MEMORY_TYPE
EFI_CONFIGURATION_TABLE * MmConfigurationTable
Definition: PiMmCis.h:322
UINTN NumberOfTableEntries
Definition: PiMmCis.h:317
EFI_GUID Name
Definition: PiHob.h:347
EFI_BOOT_MODE BootMode
Definition: PiHob.h:74
Definition: Base.h:213