21#define DPREFIX "sp800155evts: "
42 Status = (*PeiServices)->CreateHob (
44 EFI_HOB_TYPE_GUID_EXTENSION,
48 if (EFI_ERROR (Status)) {
49 DEBUG ((DEBUG_ERROR, DPREFIX
"GUID HOB creation failed, skipping\n"));
54 CopyGuid (&GuidHob->
Name, &gTcg800155PlatformIdEventHobGuid);
55 EvtDest = (UINT8 *)GET_GUID_HOB_DATA (Hob);
56 CopyMem (EvtDest, Evt, EvtSize);
58 SetMem (EvtDest + EvtSize, GET_GUID_HOB_DATA_SIZE (Hob) - EvtSize, 0);
75 FIRMWARE_CONFIG_ITEM FdtItem;
80 if (EFI_ERROR (Status)) {
85 DEBUG ((DEBUG_ERROR, DPREFIX
"Eventdata too large for HOB, skipping\n"));
90 Status = (*PeiServices)->AllocatePages (
96 if (EFI_ERROR (Status)) {
100 Evt = (UINT8 *)(
UINTN)Pages;
105 Status = (*PeiServices)->FreePages (PeiServices, Pages, NumPages);
118 for (Index = 0; ; Index++) {
119 AsciiSPrint (Path,
sizeof (Path),
"opt/org.tianocode/sp800155evt/%d", Index);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
UINTN EFIAPI AsciiSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString,...)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
RETURN_STATUS EFIAPI QemuFwCfgFindFile(IN CONST CHAR8 *Name, OUT FIRMWARE_CONFIG_ITEM *Item, OUT UINTN *Size)
VOID EFIAPI QemuFwCfgReadBytes(IN UINTN Size, IN VOID *Buffer OPTIONAL)
VOID EFIAPI QemuFwCfgSelectItem(IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem)
UINT64 EFI_PHYSICAL_ADDRESS
#define EFI_SIZE_TO_PAGES(Size)