refactor(context mgmt): add cm_prepare_el3_exit_ns function

As part of the RFC:,
this patch adds the 'cm_prepare_el3_exit_ns' function. The function is
a wrapper to 'cm_prepare_el3_exit' function for Non-secure state.

When EL2 sysregs context exists (CTX_INCLUDE_EL2_REGS is
enabled) EL1 and EL2 sysreg values are restored from the context
instead of directly updating the registers.

Signed-off-by: Zelalem Aweke <>
Change-Id: I9b071030576bb05500d54090e2a03b3f125d1653
8 files changed