diff options
author | cognet <cognet@FreeBSD.org> | 2009-02-12 23:23:30 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2009-02-12 23:23:30 +0000 |
commit | a4557d874cea19c85b904233ff0bc7ec8fc632ee (patch) | |
tree | 12b428cc8123665fb6db4a1437aa7d2d1f139c8c /sys/arm/arm/swtch.S | |
parent | fd95932030a1e694173ce5b6c7d417ad5938b302 (diff) | |
download | FreeBSD-src-a4557d874cea19c85b904233ff0bc7ec8fc632ee.zip FreeBSD-src-a4557d874cea19c85b904233ff0bc7ec8fc632ee.tar.gz |
To prevent various race conditions in the RAS code, store and restore the
values in ARM_RAS_START and ARM_RAS_END at context switch time.
MFC after: 1 week
Diffstat (limited to 'sys/arm/arm/swtch.S')
-rw-r--r-- | sys/arm/arm/swtch.S | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/arm/arm/swtch.S b/sys/arm/arm/swtch.S index 8f0f9b2..e164196 100644 --- a/sys/arm/arm/swtch.S +++ b/sys/arm/arm/swtch.S @@ -205,8 +205,12 @@ ENTRY(cpu_throw) /* Set the new tp */ ldr r6, [r5, #(TD_MD + MD_TP)] - ldr r5, =ARM_TP_ADDRESS - strt r6, [r5] + ldr r4, =ARM_TP_ADDRESS + str r6, [r4] + ldr r6, [r5, #(TD_MD + MD_RAS_START)] + str r6, [r4, #4] /* ARM_RAS_START */ + ldr r6, [r5, #(TD_MD + MD_RAS_END)] + str r6, [r4, #4] /* ARM_RAS_END */ /* Hook in a new pcb */ ldr r6, .Lcurpcb @@ -265,12 +269,20 @@ ENTRY(cpu_switch) */ /* Store the old tp */ ldr r3, =ARM_TP_ADDRESS - ldrt r9, [r3] + ldr r9, [r3] str r9, [r0, #(TD_MD + MD_TP)] + ldr r9, [r3, #4] + str r9, [r0, #(TD_MD + MD_RAS_START)] + ldr r9, [r3, #8] + str r9, [r0, #(TD_MD + MD_RAS_END)] /* Set the new tp */ ldr r9, [r1, #(TD_MD + MD_TP)] - strt r9, [r3] + str r9, [r3] + ldr r9, [r1, #(TD_MD + MD_RAS_START)] + str r9, [r3, #4] + ldr r9, [r1, #(TD_MD + MD_RAS_END)] + str r9, [r3, #8] /* Get the user structure for the new process in r9 */ ldr r9, [r1, #(TD_PCB)] |