diff options
author | Soby Mathew <soby.mathew@arm.com> | 2016-05-05 12:49:09 +0100 |
---|---|---|
committer | Soby Mathew <soby.mathew@arm.com> | 2016-08-10 12:35:46 +0100 |
commit | 1ae0a49a37b0c0e9f54a488f41b2d24eadae16ea (patch) | |
tree | e00fd21b5cafe8206dbbdfde89ea37c7c480e0d7 /include/lib | |
parent | bc202b44939eabf061d78e03fdced3112325ef92 (diff) |
AArch32: Add API to invoke runtime service handler
This patch adds an API in runtime service framework to
invoke the registered handler corresponding to the SMC function
identifier. This is helpful for AArch32 because the number of
arguments required by the handler is more than registers
available as per AArch32 program calling conventions and
requires the use of stack. Hence this new API will do the
necessary argument setup and invoke the appropriate
handler. Although this API is primarily intended for AArch32,
it can be used for AArch64 as well.
Change-Id: Iefa15947fe5a1df55b0859886e677446a0fd7241
Diffstat (limited to 'include/lib')
-rw-r--r-- | include/lib/aarch64/smcc_helpers.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/lib/aarch64/smcc_helpers.h b/include/lib/aarch64/smcc_helpers.h index 617a5bce..6e633839 100644 --- a/include/lib/aarch64/smcc_helpers.h +++ b/include/lib/aarch64/smcc_helpers.h @@ -82,5 +82,17 @@ ((const uint32_t *) &(_uuid))[2], \ ((const uint32_t *) &(_uuid))[3]) +/* + * Helper macro to retrieve the SMC parameters from cpu_context_t. + */ +#define get_smc_params_from_ctx(_hdl, _x1, _x2, _x3, _x4) \ + do { \ + const gp_regs_t *regs = get_gpregs_ctx(_hdl); \ + _x1 = read_ctx_reg(regs, CTX_GPREG_X1); \ + _x2 = read_ctx_reg(regs, CTX_GPREG_X2); \ + _x3 = read_ctx_reg(regs, CTX_GPREG_X3); \ + _x4 = read_ctx_reg(regs, CTX_GPREG_X4); \ + } while (0) + #endif /*__ASSEMBLY__*/ #endif /* __SMCC_HELPERS_H__ */ |