TianoCore EDK2 master
Loading...
Searching...
No Matches
Tpm12Ownership.c
Go to the documentation of this file.
1
9#include <PiPei.h>
11#include <Library/BaseLib.h>
13
21EFIAPI
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}
UINT16 EFIAPI SwapBytes16(IN UINT16 Value)
Definition: SwapBytes16.c:25
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
Definition: SwapBytes32.c:25
EFI_STATUS EFIAPI Tpm12SubmitCommand(IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
Definition: Tpm12Tis.c:453
EFI_STATUS EFIAPI Tpm12ForceClear(VOID)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112