]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Library/Tpm12CommandLib/Tpm12GetCapability.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / SecurityPkg / Library / Tpm12CommandLib / Tpm12GetCapability.c
index 29d7a13edb159fe8deecce0253648f09985feead..0c9e2d01f34c37f733a54e51f2a7ac557d21ee17 100644 (file)
@@ -2,13 +2,7 @@
   Implement TPM1.2 Get Capabilities related commands.\r
 \r
 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved. <BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -22,22 +16,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #pragma pack(1)\r
 \r
 typedef struct {\r
-  TPM_RQU_COMMAND_HDR  Hdr;\r
-  UINT32               Capability;\r
-  UINT32               CapabilityFlagSize;\r
-  UINT32               CapabilityFlag;\r
+  TPM_RQU_COMMAND_HDR    Hdr;\r
+  UINT32                 Capability;\r
+  UINT32                 CapabilityFlagSize;\r
+  UINT32                 CapabilityFlag;\r
 } TPM_CMD_GET_CAPABILITY;\r
 \r
 typedef struct {\r
-  TPM_RSP_COMMAND_HDR  Hdr;\r
-  UINT32               ResponseSize;\r
-  TPM_PERMANENT_FLAGS  Flags;\r
+  TPM_RSP_COMMAND_HDR    Hdr;\r
+  UINT32                 ResponseSize;\r
+  TPM_PERMANENT_FLAGS    Flags;\r
 } TPM_RSP_GET_CAPABILITY_PERMANENT_FLAGS;\r
 \r
 typedef struct {\r
-  TPM_RSP_COMMAND_HDR  Hdr;\r
-  UINT32               ResponseSize;\r
-  TPM_STCLEAR_FLAGS    Flags;\r
+  TPM_RSP_COMMAND_HDR    Hdr;\r
+  UINT32                 ResponseSize;\r
+  TPM_STCLEAR_FLAGS      Flags;\r
 } TPM_RSP_GET_CAPABILITY_STCLEAR_FLAGS;\r
 \r
 #pragma pack()\r
@@ -73,8 +67,8 @@ Tpm12GetCapabilityFlagPermanent (
   Command.Capability         = SwapBytes32 (TPM_CAP_FLAG);\r
   Command.CapabilityFlagSize = SwapBytes32 (sizeof (TPM_CAP_FLAG_PERMANENT));\r
   Command.CapabilityFlag     = SwapBytes32 (TPM_CAP_FLAG_PERMANENT);\r
-  Length = sizeof (Response);\r
-  Status = Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
+  Length                     = sizeof (Response);\r
+  Status                     = Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -85,7 +79,7 @@ Tpm12GetCapabilityFlagPermanent (
   }\r
 \r
   ZeroMem (TpmPermanentFlags, sizeof (*TpmPermanentFlags));\r
-  CopyMem (TpmPermanentFlags, &Response.Flags, MIN (sizeof (*TpmPermanentFlags), SwapBytes32(Response.ResponseSize)));\r
+  CopyMem (TpmPermanentFlags, &Response.Flags, MIN (sizeof (*TpmPermanentFlags), SwapBytes32 (Response.ResponseSize)));\r
 \r
   return Status;\r
 }\r
@@ -119,8 +113,8 @@ Tpm12GetCapabilityFlagVolatile (
   Command.Capability         = SwapBytes32 (TPM_CAP_FLAG);\r
   Command.CapabilityFlagSize = SwapBytes32 (sizeof (TPM_CAP_FLAG_VOLATILE));\r
   Command.CapabilityFlag     = SwapBytes32 (TPM_CAP_FLAG_VOLATILE);\r
-  Length = sizeof (Response);\r
-  Status = Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
+  Length                     = sizeof (Response);\r
+  Status                     = Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -131,7 +125,7 @@ Tpm12GetCapabilityFlagVolatile (
   }\r
 \r
   ZeroMem (VolatileFlags, sizeof (*VolatileFlags));\r
-  CopyMem (VolatileFlags, &Response.Flags, MIN (sizeof (*VolatileFlags), SwapBytes32(Response.ResponseSize)));\r
+  CopyMem (VolatileFlags, &Response.Flags, MIN (sizeof (*VolatileFlags), SwapBytes32 (Response.ResponseSize)));\r
 \r
   return Status;\r
 }\r