TianoCore EDK2
master
Loading...
Searching...
No Matches
Tpm12Ownership.c
Go to the documentation of this file.
1
9
#include <
PiPei.h
>
10
#include <
Library/BaseMemoryLib.h
>
11
#include <
Library/BaseLib.h
>
12
#include <
Library/Tpm12DeviceLib.h
>
13
20
EFI_STATUS
21
EFIAPI
22
Tpm12ForceClear
(
23
VOID
24
)
25
{
26
EFI_STATUS
Status;
27
TPM_RQU_COMMAND_HDR
Command;
28
TPM_RSP_COMMAND_HDR
Response;
29
UINT32 Length;
30
31
//
32
// send Tpm command TPM_ORD_ForceClear
33
//
34
Command.tag =
SwapBytes16
(TPM_TAG_RQU_COMMAND);
35
Command.paramSize =
SwapBytes32
(
sizeof
(Command));
36
Command.ordinal =
SwapBytes32
(TPM_ORD_ForceClear);
37
Length =
sizeof
(Response);
38
39
Status =
Tpm12SubmitCommand
(
sizeof
(Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);
40
if
(EFI_ERROR (Status)) {
41
return
Status;
42
}
43
44
switch
(
SwapBytes32
(Response.returnCode)) {
45
case
TPM_SUCCESS:
46
return
EFI_SUCCESS
;
47
default
:
48
return
EFI_DEVICE_ERROR;
49
}
50
}
BaseLib.h
SwapBytes16
UINT16 EFIAPI SwapBytes16(IN UINT16 Value)
Definition:
SwapBytes16.c:25
SwapBytes32
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
Definition:
SwapBytes32.c:25
BaseMemoryLib.h
PiPei.h
Tpm12DeviceLib.h
Tpm12SubmitCommand
EFI_STATUS EFIAPI Tpm12SubmitCommand(IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
Definition:
Tpm12Tis.c:453
Tpm12ForceClear
EFI_STATUS EFIAPI Tpm12ForceClear(VOID)
Definition:
Tpm12Ownership.c:22
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
EFI_SUCCESS
#define EFI_SUCCESS
Definition:
UefiBaseType.h:112
tdTPM_RQU_COMMAND_HDR
Definition:
Tpm12.h:2148
tdTPM_RSP_COMMAND_HDR
Definition:
Tpm12.h:2157
SecurityPkg
Library
Tpm12CommandLib
Tpm12Ownership.c
Generated on Fri Nov 15 2024 18:01:23 for TianoCore EDK2 by
1.9.6