summaryrefslogtreecommitdiffstats
path: root/sys/arm/arm/swtch.S
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2015-05-23 23:27:00 +0000
committerian <ian@FreeBSD.org>2015-05-23 23:27:00 +0000
commit45e1cf60a142653a0d963cfcc63e4ecd0823a7b5 (patch)
tree18ad62c7bf65bb7cdf943aa6bd8e68f54657dec0 /sys/arm/arm/swtch.S
parent9e0f8345df115d65713e07d4c02059227fddf47f (diff)
downloadFreeBSD-src-45e1cf60a142653a0d963cfcc63e4ecd0823a7b5.zip
FreeBSD-src-45e1cf60a142653a0d963cfcc63e4ecd0823a7b5.tar.gz
MFC r280278, r280402:
Allow to override default kernel virtual address assignment on ARM. Do not save/restore the TLS pointer on context switch for armv6.
Diffstat (limited to 'sys/arm/arm/swtch.S')
-rw-r--r--sys/arm/arm/swtch.S11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/arm/arm/swtch.S b/sys/arm/arm/swtch.S
index e9d6f61..6972c50 100644
--- a/sys/arm/arm/swtch.S
+++ b/sys/arm/arm/swtch.S
@@ -255,7 +255,7 @@ ENTRY(cpu_switch)
mov r4, r0 /* Save the old thread. */
#ifdef ARM_TP_ADDRESS
- /* Store the old tp */
+ /* Store the old tp; userland can change it on armv4. */
ldr r3, =ARM_TP_ADDRESS
ldr r9, [r3]
str r9, [r0, #(TD_MD + MD_TP)]
@@ -272,11 +272,10 @@ ENTRY(cpu_switch)
ldr r9, [r1, #(TD_MD + MD_RAS_END)]
str r9, [r3, #8]
#else
- /* Store the old tp */
- mrc p15, 0, r9, c13, c0, 3
- str r9, [r0, #(TD_MD + MD_TP)]
-
- /* Set the new tp */
+ /*
+ * Set new tp. No need to store the old one first, userland can't
+ * change it directly on armv6.
+ */
ldr r9, [r1, #(TD_MD + MD_TP)]
mcr p15, 0, r9, c13, c0, 3
#endif
OpenPOWER on IntegriCloud