diff mbox series

[v2] efi_loader: Rename and correct values for ARM_SMC_MM_*

Message ID 20200717045503.185315-1-ilias.apalodimas@linaro.org
State Accepted
Commit 5d1f79ba438dc372c9bddb729d630abbc6e1068b
Headers show
Series [v2] efi_loader: Rename and correct values for ARM_SMC_MM_* | expand

Commit Message

Ilias Apalodimas July 17, 2020, 4:55 a.m. UTC
Instead of adding the definition for the specific MM SVC used in
StandAloneMM we added the one used in the standard SMC calls.
So change the value from -4 to -5 to match the correct one defined in
EDK2 and rename them to avoid future confusion

Fixes 23a397d2e2fb: ("efi_loader: Add headers for EDK2 StandAloneMM communication")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

---
Changes since v1:
- v1 was efi_loader: Correct value for ARM_SMC_MM_RET_NO_MEMORY
- Renamed all the definitions according to EDK2 
 include/mm_communication.h        | 16 ++++++++--------
 lib/efi_loader/efi_variable_tee.c |  8 ++++----
 2 files changed, 12 insertions(+), 12 deletions(-)

-- 
2.28.0.rc0

Comments

Heinrich Schuchardt July 17, 2020, 10:30 a.m. UTC | #1
On 17.07.20 06:55, Ilias Apalodimas wrote:
> Instead of adding the definition for the specific MM SVC used in

> StandAloneMM we added the one used in the standard SMC calls.

> So change the value from -4 to -5 to match the correct one defined in

> EDK2 and rename them to avoid future confusion

>

> Fixes 23a397d2e2fb: ("efi_loader: Add headers for EDK2 StandAloneMM communication")> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
diff mbox series

Patch

diff --git a/include/mm_communication.h b/include/mm_communication.h
index f9c05bb7f104..e464cbb48e22 100644
--- a/include/mm_communication.h
+++ b/include/mm_communication.h
@@ -52,14 +52,14 @@  struct efi_mm_communicate_header {
 #define MM_COMMUNICATE_HEADER_SIZE \
 	(sizeof(struct efi_mm_communicate_header))
 
-/* Defined in EDK2 ArmPkg/Include/IndustryStandard/ArmStdSmc.h */
-
-/* MM return error codes */
-#define ARM_SMC_MM_RET_SUCCESS              0
-#define ARM_SMC_MM_RET_NOT_SUPPORTED       -1
-#define ARM_SMC_MM_RET_INVALID_PARAMS      -2
-#define ARM_SMC_MM_RET_DENIED              -3
-#define ARM_SMC_MM_RET_NO_MEMORY           -4
+/* Defined in EDK2 ArmPkg/Include/IndustryStandard/ArmMmSvc.h */
+
+/* SPM return error codes */
+#define ARM_SVC_SPM_RET_SUCCESS               0
+#define ARM_SVC_SPM_RET_NOT_SUPPORTED        -1
+#define ARM_SVC_SPM_RET_INVALID_PARAMS       -2
+#define ARM_SVC_SPM_RET_DENIED               -3
+#define ARM_SVC_SPM_RET_NO_MEMORY            -5
 
 /* Defined in EDK2 MdeModulePkg/Include/Guid/SmmVariableCommon.h */
 
diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
index c0423489388a..5f4aae60bf23 100644
--- a/lib/efi_loader/efi_variable_tee.c
+++ b/lib/efi_loader/efi_variable_tee.c
@@ -106,19 +106,19 @@  static efi_status_t optee_mm_communicate(void *comm_buf, ulong dsize)
 	tee_close_session(conn.tee, conn.session);
 
 	switch (param[1].u.value.a) {
-	case ARM_SMC_MM_RET_SUCCESS:
+	case ARM_SVC_SPM_RET_SUCCESS:
 		ret = EFI_SUCCESS;
 		break;
 
-	case ARM_SMC_MM_RET_INVALID_PARAMS:
+	case ARM_SVC_SPM_RET_INVALID_PARAMS:
 		ret = EFI_INVALID_PARAMETER;
 		break;
 
-	case ARM_SMC_MM_RET_DENIED:
+	case ARM_SVC_SPM_RET_DENIED:
 		ret = EFI_ACCESS_DENIED;
 		break;
 
-	case ARM_SMC_MM_RET_NO_MEMORY:
+	case ARM_SVC_SPM_RET_NO_MEMORY:
 		ret = EFI_OUT_OF_RESOURCES;
 		break;