aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2022-06-13 15:04:39 +0200
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2022-06-13 15:04:39 +0200
commitfb242e3ab407f43f61c73fdc7ffbce9afd850e6c (patch)
tree02f4547c35f12f56788ab28396be0058d36e12fe
parentff8794ab52b5d2d26b23bce4a3b89045afa984e1 (diff)
parent2c7258ec53a95f4d2d025e6482939e8f975ddfc4 (diff)
downloadtf-a-tests-fb242e3ab407f43f61c73fdc7ffbce9afd850e6c.tar.gz
Merge "fix(rme/fid): refactor RMI fid macros"
-rw-r--r--include/runtime_services/realm_payload/realm_payload_test.h49
1 files changed, 15 insertions, 34 deletions
diff --git a/include/runtime_services/realm_payload/realm_payload_test.h b/include/runtime_services/realm_payload/realm_payload_test.h
index 9b6e20e94..048dda173 100644
--- a/include/runtime_services/realm_payload/realm_payload_test.h
+++ b/include/runtime_services/realm_payload/realm_payload_test.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -10,39 +10,20 @@
#define RMI_FNUM_MIN_VALUE U(0x150)
#define RMI_FNUM_MAX_VALUE U(0x18F)
-/* Get RMI fastcall std FID from function number */
-#define RMI_FID(smc_cc, func_num) \
- ((SMC_TYPE_FAST << FUNCID_TYPE_SHIFT) | \
- ((smc_cc) << FUNCID_CC_SHIFT) | \
- (OEN_STD_START << FUNCID_OEN_SHIFT) | \
- ((func_num) << FUNCID_NUM_SHIFT))
-
-/*
- * SMC_RMM_INIT_COMPLETE is the only function in the RMI that originates from
- * the Realm world and is handled by the RMMD. The remaining functions are
- * always invoked by the Normal world, forwarded by RMMD and handled by the
- * RMM
- */
-#define RMI_FNUM_VERSION_REQ U(0x150)
-#define RMI_FNUM_GRANULE_DELEGATE U(0x151)
-#define RMI_FNUM_GRANULE_UNDELEGATE U(0x152)
-#define RMI_FNUM_REALM_CREATE U(0x158)
-#define RMI_FNUM_REALM_DESTROY U(0x159)
-
-/********************************************************************************/
-
+/* Get RMI fastcall std FID from offset */
+#define SMC64_RMI_FID(_offset) \
+ ((SMC_TYPE_FAST << FUNCID_TYPE_SHIFT) | \
+ (SMC_64 << FUNCID_CC_SHIFT) | \
+ (OEN_STD_START << FUNCID_OEN_SHIFT) | \
+ (((RMI_FNUM_MIN_VALUE + (_offset)) & FUNCID_NUM_MASK) \
+ << FUNCID_NUM_SHIFT))
/* RMI SMC64 FIDs handled by the RMMD */
-#define RMI_RMM_REQ_VERSION RMI_FID(SMC_64, RMI_FNUM_VERSION_REQ)
-
-#define SMC_RMM_GRANULE_DELEGATE RMI_FID(SMC_64, \
- RMI_FNUM_GRANULE_DELEGATE)
-#define SMC_RMM_GRANULE_UNDELEGATE RMI_FID(SMC_64, \
- RMI_FNUM_GRANULE_UNDELEGATE)
-#define SMC_RMM_REALM_CREATE RMI_FID(SMC_64, \
- RMI_FNUM_REALM_CREATE)
-#define SMC_RMM_REALM_DESTROY RMI_FID(SMC_64, \
- RMI_FNUM_REALM_DESTROY)
+#define RMI_RMM_REQ_VERSION SMC64_RMI_FID(U(0))
+#define SMC_RMM_GRANULE_DELEGATE SMC64_RMI_FID(U(1))
+#define SMC_RMM_GRANULE_UNDELEGATE SMC64_RMI_FID(U(2))
+#define SMC_RMM_REALM_CREATE SMC64_RMI_FID(U(8))
+#define SMC_RMM_REALM_DESTROY SMC64_RMI_FID(U(9))
#define RMI_ABI_VERSION_GET_MAJOR(_version) ((_version) >> 16)
#define RMI_ABI_VERSION_GET_MINOR(_version) ((_version) & 0xFFFF)
@@ -55,9 +36,9 @@
#define B_UNDELEGATED 1
#define NUM_CPU_DED_SPM PLATFORM_CORE_COUNT / 2
-/*
+/*
* The error code 513 is the packed version of the
- * rmm error {RMM_STATUS_ERROR_INPUT,2}
+ * rmm error {RMM_STATUS_ERROR_INPUT,2}
* happened when Granule(params_ptr).pas != NS
*/
#define RMM_STATUS_ERROR_INPUT 513UL