]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg: Add RPMC Index to the RpmcLib
authorNishant Mistry <devel@edk2.groups.io>
Thu, 12 Nov 2020 02:49:09 +0000 (02:49 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 19 Nov 2020 08:18:03 +0000 (08:18 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594

The re-design requires multiple RPMC counter usages.
The consumer will be capable of selecting amongst multiple counters.

Signed-off-by: Nishant C Mistry <nishant.c.mistry@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
SecurityPkg/Include/Library/RpmcLib.h
SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c

index 5882bfae2f2475d24874ea97f64da5c0d93f57cf..3c15bce1ce85f1950e03ec3b8a4bc602524e8d22 100644 (file)
@@ -14,6 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 /**\r
   Requests the monotonic counter from the designated RPMC counter.\r
 \r
+  @param[in]    CounterIndex            The RPMC index\r
   @param[out]   CounterValue            A pointer to a buffer to store the RPMC value.\r
 \r
   @retval       EFI_SUCCESS             The operation completed successfully.\r
@@ -23,12 +24,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 EFI_STATUS\r
 EFIAPI\r
 RequestMonotonicCounter (\r
+  IN  UINT8   CounterIndex,\r
   OUT UINT32  *CounterValue\r
   );\r
 \r
 /**\r
   Increments the monotonic counter in the SPI flash device by 1.\r
 \r
+  @param[in]    CounterIndex            The RPMC index\r
+\r
   @retval       EFI_SUCCESS             The operation completed successfully.\r
   @retval       EFI_DEVICE_ERROR        A device error occurred while attempting to update the counter.\r
   @retval       EFI_UNSUPPORTED         The operation is un-supported.\r
@@ -36,7 +40,7 @@ RequestMonotonicCounter (
 EFI_STATUS\r
 EFIAPI\r
 IncrementMonotonicCounter (\r
-  VOID\r
+  IN  UINT8   CounterIndex\r
   );\r
 \r
 #endif\r
index e1dd09eb10a0075682babd78b86e13bd873cd363..697e493a7cea8e7802babe7c50fa6e3ceebd3007 100644 (file)
@@ -12,6 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 /**\r
   Requests the monotonic counter from the designated RPMC counter.\r
 \r
+  @param[in]    CounterIndex            The RPMC index\r
   @param[out]   CounterValue            A pointer to a buffer to store the RPMC value.\r
 \r
   @retval       EFI_SUCCESS             The operation completed successfully.\r
@@ -21,6 +22,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 EFI_STATUS\r
 EFIAPI\r
 RequestMonotonicCounter (\r
+  IN  UINT8   CounterIndex,\r
   OUT UINT32  *CounterValue\r
   )\r
 {\r
@@ -31,6 +33,8 @@ RequestMonotonicCounter (
 /**\r
   Increments the monotonic counter in the SPI flash device by 1.\r
 \r
+  @param[in]    CounterIndex            The RPMC index\r
+\r
   @retval       EFI_SUCCESS             The operation completed successfully.\r
   @retval       EFI_DEVICE_ERROR        A device error occurred while attempting to update the counter.\r
   @retval       EFI_UNSUPPORTED         The operation is un-supported.\r
@@ -38,7 +42,7 @@ RequestMonotonicCounter (
 EFI_STATUS\r
 EFIAPI\r
 IncrementMonotonicCounter (\r
-  VOID\r
+  IN  UINT8   CounterIndex\r
   )\r
 {\r
   ASSERT (FALSE);\r