mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
Merge pull request #110 from soby-mathew:sm/support_normal_irq_in_tsp-v4 into for-v0.4
This commit is contained in:
commit
05b6edfe26
1 changed files with 25 additions and 28 deletions
|
@ -504,35 +504,36 @@ uint64_t tspd_smc_handler(uint32_t smc_fid,
|
||||||
* Standard SMC call.
|
* Standard SMC call.
|
||||||
*/
|
*/
|
||||||
case TSP_FID_RESUME:
|
case TSP_FID_RESUME:
|
||||||
/* RESUME should be invoked only by normal world */
|
/* RESUME should be invoked only by normal world */
|
||||||
if (!ns) {
|
if (!ns) {
|
||||||
assert(0);
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a resume request from the non-secure client.
|
* This is a resume request from the non-secure client.
|
||||||
* save the non-secure state and send the request to
|
* save the non-secure state and send the request to
|
||||||
* the secure payload.
|
* the secure payload.
|
||||||
*/
|
*/
|
||||||
assert(handle == cm_get_context(mpidr, NON_SECURE));
|
assert(handle == cm_get_context(mpidr, NON_SECURE));
|
||||||
|
|
||||||
/* Check if we are already preempted before resume */
|
/* Check if we are already preempted before resume */
|
||||||
if (!get_std_smc_active_flag(tsp_ctx->state))
|
if (!get_std_smc_active_flag(tsp_ctx->state))
|
||||||
SMC_RET1(handle, SMC_UNK);
|
SMC_RET1(handle, SMC_UNK);
|
||||||
|
|
||||||
cm_el1_sysregs_context_save(NON_SECURE);
|
cm_el1_sysregs_context_save(NON_SECURE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We are done stashing the non-secure context. Ask the
|
* We are done stashing the non-secure context. Ask the
|
||||||
* secure payload to do the work now.
|
* secure payload to do the work now.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* We just need to return to the preempted point in
|
/* We just need to return to the preempted point in
|
||||||
* TSP and the execution will resume as normal.
|
* TSP and the execution will resume as normal.
|
||||||
*/
|
*/
|
||||||
cm_el1_sysregs_context_restore(SECURE);
|
cm_el1_sysregs_context_restore(SECURE);
|
||||||
cm_set_next_eret_context(SECURE);
|
cm_set_next_eret_context(SECURE);
|
||||||
|
SMC_RET0(&tsp_ctx->cpu_ctx);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a request from the secure payload for more arguments
|
* This is a request from the secure payload for more arguments
|
||||||
|
@ -544,10 +545,6 @@ uint64_t tspd_smc_handler(uint32_t smc_fid,
|
||||||
if (ns)
|
if (ns)
|
||||||
SMC_RET1(handle, SMC_UNK);
|
SMC_RET1(handle, SMC_UNK);
|
||||||
|
|
||||||
/* Get a reference to the non-secure context */
|
|
||||||
ns_cpu_context = cm_get_context(mpidr, NON_SECURE);
|
|
||||||
assert(ns_cpu_context);
|
|
||||||
|
|
||||||
get_tsp_args(tsp_ctx, x1, x2);
|
get_tsp_args(tsp_ctx, x1, x2);
|
||||||
SMC_RET2(handle, x1, x2);
|
SMC_RET2(handle, x1, x2);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue