TianoCore EDK2 master
Loading...
Searching...
No Matches
PeiTpmMeasurementLib.c
Go to the documentation of this file.
1
9#include <PiPei.h>
10
14#include <Library/DebugLib.h>
15#include <Library/HobLib.h>
17
18#include <Ppi/Tcg.h>
20
37EFIAPI
39 IN UINT32 PcrIndex,
40 IN UINT32 EventType,
41 IN VOID *EventLog,
42 IN UINT32 LogLen,
43 IN VOID *HashData,
44 IN UINT64 HashDataLen
45 )
46{
47 EFI_STATUS Status;
48 EDKII_TCG_PPI *TcgPpi;
49 TCG_PCR_EVENT_HDR TcgEventHdr;
50
51 Status = PeiServicesLocatePpi (
52 &gEdkiiTcgPpiGuid,
53 0,
54 NULL,
55 (VOID **)&TcgPpi
56 );
57 if (EFI_ERROR (Status)) {
58 return Status;
59 }
60
61 TcgEventHdr.PCRIndex = PcrIndex;
62 TcgEventHdr.EventType = EventType;
63 TcgEventHdr.EventSize = LogLen;
64
65 Status = TcgPpi->HashLogExtendEvent (
66 TcgPpi,
67 0,
68 HashData,
69 (UINTN)HashDataLen,
70 &TcgEventHdr,
71 EventLog
72 );
73 return Status;
74}
UINT64 UINTN
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
EFI_STATUS EFIAPI TpmMeasureAndLogData(IN UINT32 PcrIndex, IN UINT32 EventType, IN VOID *EventLog, IN UINT32 LogLen, IN VOID *HashData, IN UINT64 HashDataLen)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29