summaryrefslogtreecommitdiff
path: root/bl31/context_mgmt.c
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2014-02-09 18:24:19 +0000
committerDan Handley <dan.handley@arm.com>2014-02-20 19:06:34 +0000
commit607084ee4c2a7c20832beb8cd1d5cebf02b2cb26 (patch)
treebd4a262134027060c027e81f7aaebf64965d370d /bl31/context_mgmt.c
parent375f538a797a89a5f49aab1be70e86df4511c05a (diff)
Add power management support in the SPD
This patch implements a set of handlers in the SPD which are called by the PSCI runtime service upon receiving a power management operation. These handlers in turn pass control to the Secure Payload image if required before returning control to PSCI. This ensures that the Secure Payload has complete visibility of all power transitions in the system and can prepare accordingly. Change-Id: I2d1dba5629b7cf2d53999d39fe807dfcf3f62fe2
Diffstat (limited to 'bl31/context_mgmt.c')
-rw-r--r--bl31/context_mgmt.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/bl31/context_mgmt.c b/bl31/context_mgmt.c
index 44ef0d9..60c3492 100644
--- a/bl31/context_mgmt.c
+++ b/bl31/context_mgmt.c
@@ -165,6 +165,23 @@ void cm_set_el3_eret_context(uint32_t security_state, uint64_t entrypoint,
}
/*******************************************************************************
+ * This function function populates ELR_EL3 member of 'cpu_context' pertaining
+ * to the given security state with the given entrypoint
+ ******************************************************************************/
+void cm_set_el3_elr(uint32_t security_state, uint64_t entrypoint)
+{
+ cpu_context *ctx;
+ el3_state *state;
+
+ ctx = cm_get_context(read_mpidr(), security_state);
+ assert(ctx);
+
+ /* Populate EL3 state so that ERET jumps to the correct entry */
+ state = get_el3state_ctx(ctx);
+ write_ctx_reg(state, CTX_ELR_EL3, entrypoint);
+}
+
+/*******************************************************************************
* This function is used to program the context that's used for exception
* return. This initializes the SP_EL3 to a pointer to a 'cpu_context' set for
* the required security state