2 Get TPM 2.0 physical presence information.
4 This library will get TPM 2.0 physical presence information.
6 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #include <Guid/Tcg2PhysicalPresenceData.h>
20 #include <Ppi/ReadOnlyVariable2.h>
22 #include <Library/DebugLib.h>
23 #include <Library/PeiServicesLib.h>
24 #include <Library/PeiServicesTablePointerLib.h>
25 #include <Library/Tcg2PhysicalPresenceLib.h>
28 Return TPM2 ManagementFlags set by PP interface.
30 @retval ManagementFlags TPM2 Management Flags.
34 Tcg2PhysicalPresenceLibGetManagementFlags (
39 EFI_PEI_READ_ONLY_VARIABLE2_PPI
*VariablePpi
;
40 EFI_TCG2_PHYSICAL_PRESENCE_FLAGS PpiFlags
;
43 Status
= PeiServicesLocatePpi (&gEfiPeiReadOnlyVariable2PpiGuid
, 0, NULL
, (VOID
**) &VariablePpi
);
44 ASSERT_EFI_ERROR (Status
);
46 DataSize
= sizeof (EFI_TCG2_PHYSICAL_PRESENCE_FLAGS
);
47 Status
= VariablePpi
->GetVariable (
49 TCG2_PHYSICAL_PRESENCE_FLAGS_VARIABLE
,
50 &gEfiTcg2PhysicalPresenceGuid
,
55 if (EFI_ERROR (Status
)) {
56 PpiFlags
.PPFlags
= TCG2_BIOS_TPM_MANAGEMENT_FLAG_DEFAULT
;
58 return PpiFlags
.PPFlags
;