This patch adds ARM_SMCCC_IS_OWNER_TRUSTED_APP() and ARM_SMCCC_IS_OWNER_TRUSTED_OS() macros. These can be used to identify if the SMC is targetted at a Trusted OS/App in the secure world.
Signed-off-by: Yuvraj Sakshith yuvraj.kernel@gmail.com --- include/linux/arm-smccc.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index f19be5754090..da2b4565d5b3 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -56,6 +56,14 @@ #define ARM_SMCCC_OWNER_TRUSTED_OS 50 #define ARM_SMCCC_OWNER_TRUSTED_OS_END 63
+#define ARM_SMCCC_IS_OWNER_TRUSTED_APP(smc_val) \ + ((ARM_SMCCC_OWNER_NUM(smc_val) >= ARM_SMCCC_OWNER_TRUSTED_APP) && \ + (ARM_SMCCC_OWNER_NUM(smc_val) <= ARM_SMCCC_OWNER_TRUSTED_APP_END)) + +#define ARM_SMCCC_IS_OWNER_TRUSTED_OS(smc_val) \ + ((ARM_SMCCC_OWNER_NUM(smc_val) >= ARM_SMCCC_OWNER_TRUSTED_OS) && \ + (ARM_SMCCC_OWNER_NUM(smc_val) <= ARM_SMCCC_OWNER_TRUSTED_OS_END)) + #define ARM_SMCCC_FUNC_QUERY_CALL_UID 0xff01
#define ARM_SMCCC_QUIRK_NONE 0