TianoCore EDK2 master
Loading...
Searching...
No Matches
PeiTcg2PhysicalPresenceLib.c
Go to the documentation of this file.
1
11#include <PiPei.h>
12
15
16#include <Library/DebugLib.h>
20
26UINT32
27EFIAPI
29 VOID
30 )
31{
32 EFI_STATUS Status;
35 UINTN DataSize;
36
37 Status = PeiServicesLocatePpi (&gEfiPeiReadOnlyVariable2PpiGuid, 0, NULL, (VOID **)&VariablePpi);
38 ASSERT_EFI_ERROR (Status);
39
40 DataSize = sizeof (EFI_TCG2_PHYSICAL_PRESENCE_FLAGS);
41 Status = VariablePpi->GetVariable (
42 VariablePpi,
43 TCG2_PHYSICAL_PRESENCE_FLAGS_VARIABLE,
44 &gEfiTcg2PhysicalPresenceGuid,
45 NULL,
46 &DataSize,
47 &PpiFlags
48 );
49 if (EFI_ERROR (Status)) {
50 PpiFlags.PPFlags = PcdGet32 (PcdTcg2PhysicalPresenceFlags);
51 }
52
53 return PpiFlags.PPFlags;
54}
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 ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define PcdGet32(TokenName)
Definition: PcdLib.h:362
UINT32 EFIAPI Tcg2PhysicalPresenceLibGetManagementFlags(VOID)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29