diff options
author | davidcunado-arm <david.cunado@arm.com> | 2017-11-01 08:46:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-01 08:46:02 +0000 |
commit | 122af7dd6d4937922317bc949ca9b8c62bcd20aa (patch) | |
tree | bd5f524d2e974b6a574669aa7bd50bd89c61de60 /lib | |
parent | 5b5e6cb74211088d6983d3bfe069e2830ab6b0dc (diff) | |
parent | 17b4c0dd0a12b1c306057b71182e25a69807ff89 (diff) | |
download | platform_external_arm-trusted-firmware-122af7dd6d4937922317bc949ca9b8c62bcd20aa.tar.gz platform_external_arm-trusted-firmware-122af7dd6d4937922317bc949ca9b8c62bcd20aa.tar.bz2 platform_external_arm-trusted-firmware-122af7dd6d4937922317bc949ca9b8c62bcd20aa.zip |
Merge pull request #1150 from dp-arm/dp/events
aarch64: Add PubSub events to capture security state transitions
Diffstat (limited to 'lib')
-rw-r--r-- | lib/el3_runtime/aarch64/context_mgmt.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c index 21e86de05..c8232df96 100644 --- a/lib/el3_runtime/aarch64/context_mgmt.c +++ b/lib/el3_runtime/aarch64/context_mgmt.c @@ -13,6 +13,7 @@ #include <interrupt_mgmt.h> #include <platform.h> #include <platform_def.h> +#include <pubsub_events.h> #include <smcc_helpers.h> #include <string.h> #include <utils.h> @@ -421,9 +422,8 @@ void cm_prepare_el3_exit(uint32_t security_state) } } - el1_sysregs_context_restore(get_sysregs_ctx(ctx)); - - cm_set_next_context(ctx); + cm_el1_sysregs_context_restore(security_state); + cm_set_next_eret_context(security_state); } /******************************************************************************* @@ -440,6 +440,13 @@ void cm_el1_sysregs_context_save(uint32_t security_state) el1_sysregs_context_save(get_sysregs_ctx(ctx)); el1_sysregs_context_save_post_ops(); + +#if IMAGE_BL31 + if (security_state == SECURE) + PUBLISH_EVENT(cm_exited_secure_world); + else + PUBLISH_EVENT(cm_exited_normal_world); +#endif } void cm_el1_sysregs_context_restore(uint32_t security_state) @@ -450,6 +457,13 @@ void cm_el1_sysregs_context_restore(uint32_t security_state) assert(ctx); el1_sysregs_context_restore(get_sysregs_ctx(ctx)); + +#if IMAGE_BL31 + if (security_state == SECURE) + PUBLISH_EVENT(cm_entering_secure_world); + else + PUBLISH_EVENT(cm_entering_normal_world); +#endif } /******************************************************************************* |