fix(rmm): handle errors for granule (un)delegate calls
This patch renames 'asc_mark_secure()' to
'rmm_el3_ifc_gtsi_delegate()'
and 'asc_mark_nonsecure()' to
'rmm_el3_ifc_gtsi_undelegate()'.
SMC_ASC_MARK_SECURE and SMC_ASC_MARK_NONSECURE
macro definitions are renamed to
SMC_RMM_GTSI_DELEGATE and SMC_RMM_GTSI_UNDELEGATE
and moved from smc.h to include/rmm_el3_ifc.h.
The patch also modifies return values of the above functions
from 'void' to 'unsigned long' and adds support for error
handling.
Folder 'lib/asc' is removed and inlined definitions of these
functions are placed in lib\rmm_el3_ifc\include\rmm_el3_ifc.h.
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: Ifbe71341952b0721ad9141e319602939258d1054
diff --git a/lib/smc/include/smc.h b/lib/smc/include/smc.h
index 5ec2ac4..33aad7b 100644
--- a/lib/smc/include/smc.h
+++ b/lib/smc/include/smc.h
@@ -133,10 +133,6 @@
/* 0x18F */
#define SMC_RMM_REQ_COMPLETE SMC64_STD_FID(RMI, U(0x3F))
- /* 0x1B0 - 0x1B3 */
-#define SMC_ASC_MARK_SECURE SMC64_STD_FID(RMM_EL3, U(0))
-#define SMC_ASC_MARK_NONSECURE SMC64_STD_FID(RMM_EL3, U(1))
-
/* ARM ARCH call FIDs */
#define SMCCC_VERSION SMC32_ARCH_FID(U(0))
#define SMCCC_ARCH_FEATURES SMC32_ARCH_FID(U(1))
@@ -158,12 +154,12 @@
((SMCCC_VERSION_MAJOR << U(16)) | SMCCC_VERSION_MINOR)
/* SMCCC return codes */
-#define SMC_SUCCESS 0
-#define SMC_NOT_SUPPORTED (-1)
-#define SMC_NOT_REQUIRED (-2)
-#define SMC_INVALID_PARAMETER (-3)
+#define SMC_SUCCESS UL(0)
+#define SMC_NOT_SUPPORTED UL(-1)
+#define SMC_NOT_REQUIRED UL(-2)
+#define SMC_INVALID_PARAMETER UL(-3)
-#define SMC_UNKNOWN (-1)
+#define SMC_UNKNOWN UL(-1)
#ifndef __ASSEMBLER__
unsigned long monitor_call(unsigned long id,