diff --git a/arch/arm/core/aarch64/smccc-call.S b/arch/arm/core/aarch64/smccc-call.S index adee180c8c..e3b3be99d0 100644 --- a/arch/arm/core/aarch64/smccc-call.S +++ b/arch/arm/core/aarch64/smccc-call.S @@ -14,12 +14,13 @@ #include #include #include +#include .macro SMCCC instr \instr #0 ldr x4, [sp] - stp x0, x1, [x4] - stp x2, x3, [x4, #16] + stp x0, x1, [x4, __arm_smccc_res_t_a0_a1_OFFSET] + stp x2, x3, [x4, __arm_smccc_res_t_a2_a3_OFFSET] ret .endm diff --git a/arch/arm/core/offsets/offsets_aarch64.c b/arch/arm/core/offsets/offsets_aarch64.c index 13d3e020a5..01acb7adc3 100644 --- a/arch/arm/core/offsets/offsets_aarch64.c +++ b/arch/arm/core/offsets/offsets_aarch64.c @@ -52,4 +52,13 @@ GEN_NAMED_OFFSET_SYM(_esf_t, x0, x0_x1); GEN_ABSOLUTE_SYM(___esf_t_SIZEOF, sizeof(_esf_t)); +#ifdef CONFIG_HAS_ARM_SMCCC + +#include + +GEN_NAMED_OFFSET_SYM(arm_smccc_res_t, a0, a0_a1); +GEN_NAMED_OFFSET_SYM(arm_smccc_res_t, a2, a2_a3); + +#endif /* CONFIG_HAS_ARM_SMCCC */ + #endif /* _ARM_OFFSETS_INC_ */ diff --git a/include/arch/arm/arm-smccc.h b/include/arch/arm/arm-smccc.h index 90b5f42cf7..5a8bd6896a 100644 --- a/include/arch/arm/arm-smccc.h +++ b/include/arch/arm/arm-smccc.h @@ -18,6 +18,8 @@ struct arm_smccc_res { unsigned long a3; }; +typedef struct arm_smccc_res arm_smccc_res_t; + enum arm_smccc_conduit { SMCCC_CONDUIT_NONE, SMCCC_CONDUIT_SMC,