summaryrefslogtreecommitdiff
path: root/services/spd/tspd/tspd_common.c
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2014-05-04 18:23:26 +0100
committerAchin Gupta <achin.gupta@arm.com>2014-05-22 17:45:59 +0100
commit3ee8a16402522d6d2959e27520f75c79b1218a2b (patch)
tree76c3d460fb5284ef6632c0606f1ee2b23dd3662e /services/spd/tspd/tspd_common.c
parentdbad1bacba0a7adfd3c7c559f0fd0805087aeddd (diff)
Rework 'state' field usage in per-cpu TSP context
This patch lays the foundation for using the per-cpu 'state' field in the 'tsp_context' structure for other flags apart from the power state of the TSP. It allocates 2 bits for the power state, introduces the necessary macros to manipulate the power state in the 'state' field and accordingly reworks all use of the TSP_STATE_* states. It also allocates a flag bit to determine if the TSP is handling a standard SMC. If this flag is set then the TSP was interrupted due to non-secure or EL3 interupt depending upon the chosen routing model. Macros to get, set and clear this flag have been added as well. This flag will be used by subsequent patches. Change-Id: Ic6ee80bd5895812c83b35189cf2c3be70a9024a6
Diffstat (limited to 'services/spd/tspd/tspd_common.c')
-rw-r--r--services/spd/tspd/tspd_common.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/services/spd/tspd/tspd_common.c b/services/spd/tspd/tspd_common.c
index d3fe5dd..2d0b08b 100644
--- a/services/spd/tspd/tspd_common.c
+++ b/services/spd/tspd/tspd_common.c
@@ -85,7 +85,14 @@ int32_t tspd_init_secure_context(uint64_t entrypoint,
write_ctx_reg(el1_state, CTX_SCTLR_EL1, sctlr);
/* Set this context as ready to be initialised i.e OFF */
- tsp_ctx->state = TSP_STATE_OFF;
+ set_tsp_pstate(tsp_ctx->state, TSP_PSTATE_OFF);
+
+ /*
+ * This context has not been used yet. It will become valid
+ * when the TSP is interrupted and wants the TSPD to preserve
+ * the context.
+ */
+ clr_std_smc_active_flag(tsp_ctx->state);
/* Associate this context with the cpu specified */
tsp_ctx->mpidr = mpidr;