aboutsummaryrefslogtreecommitdiff
path: root/bl31/aarch64
diff options
context:
space:
mode:
authorAndrew Thoelke <andrew.thoelke@arm.com>2014-05-19 12:54:05 +0100
committerAndrew Thoelke <andrew.thoelke@arm.com>2014-05-19 12:54:05 +0100
commitec786cbca93651b06431e1933abb909626949644 (patch)
treedaaf0cbb0ce0fc5e8672bc8f58c8d65d5e572142 /bl31/aarch64
parenta43d431b80541ea436b71f967c5749babf978c7a (diff)
parent2da8d8bfc0877b9c723514133554dfee4c0638f1 (diff)
downloadarm-trusted-firmware-ec786cbca93651b06431e1933abb909626949644.tar.gz
Merge pull request #78 from jeenuv:tf-issues-148
Diffstat (limited to 'bl31/aarch64')
-rw-r--r--bl31/aarch64/context.S14
1 files changed, 12 insertions, 2 deletions
diff --git a/bl31/aarch64/context.S b/bl31/aarch64/context.S
index 45d4a22..d0bca64 100644
--- a/bl31/aarch64/context.S
+++ b/bl31/aarch64/context.S
@@ -172,6 +172,8 @@ func el1_sysregs_context_save
mrs x9, vbar_el1
stp x17, x9, [x0, #CTX_CONTEXTIDR_EL1]
+ /* Save NS timer registers if the build has instructed so */
+#if NS_TIMER_SWITCH
mrs x10, cntp_ctl_el0
mrs x11, cntp_cval_el0
stp x10, x11, [x0, #CTX_CNTP_CTL_EL0]
@@ -181,8 +183,11 @@ func el1_sysregs_context_save
stp x12, x13, [x0, #CTX_CNTV_CTL_EL0]
mrs x14, cntkctl_el1
+ str x14, [x0, #CTX_CNTKCTL_EL1]
+#endif
+
mrs x15, fpexc32_el2
- stp x14, x15, [x0, #CTX_CNTKCTL_EL1]
+ str x15, [x0, #CTX_FP_FPEXC32_EL2]
ret
@@ -253,6 +258,8 @@ func el1_sysregs_context_restore
msr contextidr_el1, x17
msr vbar_el1, x9
+ /* Restore NS timer registers if the build has instructed so */
+#if NS_TIMER_SWITCH
ldp x10, x11, [x0, #CTX_CNTP_CTL_EL0]
msr cntp_ctl_el0, x10
msr cntp_cval_el0, x11
@@ -261,8 +268,11 @@ func el1_sysregs_context_restore
msr cntv_ctl_el0, x12
msr cntv_cval_el0, x13
- ldp x14, x15, [x0, #CTX_CNTKCTL_EL1]
+ ldr x14, [x0, #CTX_CNTKCTL_EL1]
msr cntkctl_el1, x14
+#endif
+
+ ldr x15, [x0, #CTX_FP_FPEXC32_EL2]
msr fpexc32_el2, x15
/* No explict ISB required here as ERET covers it */