[Patch v2 11/28] SecurityPkg: Update RPMC APIs with index


Judah Vang
 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594

Update RPMC APIs with index parameter because sometimes
there are more than 1 RPMC counter on the platform.

Cc: Jian J Wang <jian.j.wang@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Nishant C Mistry <nishant.c.mistry@...>
Signed-off-by: Jian J Wang <jian.j.wang@...>
Signed-off-by: Nishant C Mistry <nishant.c.mistry@...>
Signed-off-by: Judah Vang <judah.vang@...>
---
SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c b/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c
index 792e48250e5d..557aeb6abf09 100644
--- a/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c
+++ b/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c
@@ -1,7 +1,7 @@
/** @file
NULL RpmcLib instance for build purpose.

-Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent

**/
@@ -12,6 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
/**
Requests the monotonic counter from the designated RPMC counter.

+ @param[in] CounterIndex The RPMC index
@param[out] CounterValue A pointer to a buffer to store the RPMC value.

@retval EFI_SUCCESS The operation completed successfully.
@@ -21,6 +22,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
EFI_STATUS
EFIAPI
RequestMonotonicCounter (
+ IN UINT8 CounterIndex,
OUT UINT32 *CounterValue
)
{
@@ -31,6 +33,8 @@ RequestMonotonicCounter (
/**
Increments the monotonic counter in the SPI flash device by 1.

+ @param[in] CounterIndex The RPMC index
+
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_DEVICE_ERROR A device error occurred while attempting to update the counter.
@retval EFI_UNSUPPORTED The operation is un-supported.
@@ -38,7 +42,7 @@ RequestMonotonicCounter (
EFI_STATUS
EFIAPI
IncrementMonotonicCounter (
- VOID
+ IN UINT8 CounterIndex
)
{
ASSERT (FALSE);
--
2.35.1.windows.2


Wang, Jian J
 

Reviewed-by: Jian J Wang <jian.j.wang@...>

Regards,
Jian

-----Original Message-----
From: Vang, Judah <judah.vang@...>
Sent: Saturday, April 30, 2022 2:04 AM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Yao, Jiewen <jiewen.yao@...>;
Mistry, Nishant C <nishant.c.mistry@...>
Subject: [Patch v2 11/28] SecurityPkg: Update RPMC APIs with index

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594

Update RPMC APIs with index parameter because sometimes
there are more than 1 RPMC counter on the platform.

Cc: Jian J Wang <jian.j.wang@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Nishant C Mistry <nishant.c.mistry@...>
Signed-off-by: Jian J Wang <jian.j.wang@...>
Signed-off-by: Nishant C Mistry <nishant.c.mistry@...>
Signed-off-by: Judah Vang <judah.vang@...>
---
SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c
b/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c
index 792e48250e5d..557aeb6abf09 100644
--- a/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c
+++ b/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c
@@ -1,7 +1,7 @@
/** @file
NULL RpmcLib instance for build purpose.

-Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent

**/
@@ -12,6 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
/**
Requests the monotonic counter from the designated RPMC counter.

+ @param[in] CounterIndex The RPMC index
@param[out] CounterValue A pointer to a buffer to store the RPMC
value.

@retval EFI_SUCCESS The operation completed successfully.
@@ -21,6 +22,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
EFI_STATUS
EFIAPI
RequestMonotonicCounter (
+ IN UINT8 CounterIndex,
OUT UINT32 *CounterValue
)
{
@@ -31,6 +33,8 @@ RequestMonotonicCounter (
/**
Increments the monotonic counter in the SPI flash device by 1.

+ @param[in] CounterIndex The RPMC index
+
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_DEVICE_ERROR A device error occurred while attempting
to update the counter.
@retval EFI_UNSUPPORTED The operation is un-supported.
@@ -38,7 +42,7 @@ RequestMonotonicCounter (
EFI_STATUS
EFIAPI
IncrementMonotonicCounter (
- VOID
+ IN UINT8 CounterIndex
)
{
ASSERT (FALSE);
--
2.35.1.windows.2