summaryrefslogtreecommitdiffstats
path: root/sys/arm/include/sysarch.h
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2011-10-16 17:59:28 +0000
committercognet <cognet@FreeBSD.org>2011-10-16 17:59:28 +0000
commit3b0e8ca514f0684a2792360344152f202567cffb (patch)
tree8325c273daebf653c55ef86559fc4c9c72150ba3 /sys/arm/include/sysarch.h
parent1767d076f90b5748534ec5da2528deaae9011917 (diff)
downloadFreeBSD-src-3b0e8ca514f0684a2792360344152f202567cffb.zip
FreeBSD-src-3b0e8ca514f0684a2792360344152f202567cffb.tar.gz
Fix 2 bugs :
- A race condition could happen if two threads were using RAS at the same time as the code didn't reset RAS_END, the RAS code could believe we were not in a RAS, when we were in fact. - Using signed value logic to compare addresses wasn't such a good idea. Many thanks to Ian to investigate on these issues. Pointy hat to: cognet PR: arm/161498 Submitted by: Ian Lepore <freebsd At damnhippie DOT dyndns dot org MFC after: 1 week
Diffstat (limited to 'sys/arm/include/sysarch.h')
-rw-r--r--sys/arm/include/sysarch.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arm/include/sysarch.h b/sys/arm/include/sysarch.h
index 12db4df..ba337bd 100644
--- a/sys/arm/include/sysarch.h
+++ b/sys/arm/include/sysarch.h
@@ -42,9 +42,13 @@
* The ARM_TP_ADDRESS points to a special purpose page, which is used as local
* store for the ARM per-thread data and Restartable Atomic Sequences support.
* Put it just above the "high" vectors' page.
- * the cpu_switch() code assumes ARM_RAS_START is ARM_TP_ADDRESS + 4, and
+ * The cpu_switch() code assumes ARM_RAS_START is ARM_TP_ADDRESS + 4, and
* ARM_RAS_END is ARM_TP_ADDRESS + 8, so if that ever changes, be sure to
* update the cpu_switch() (and cpu_throw()) code as well.
+ * In addition, code in arm/include/atomic.h and arm/include/asmacros.h
+ * assumes that ARM_RAS_END is at ARM_RAS_START+4, so be sure to update those
+ * if ARM_RAS_END moves in relation to ARM_RAS_START (look for occurrances
+ * of ldr/str rm,[rn, #4]).
*/
#define ARM_TP_ADDRESS (ARM_VECTORS_HIGH + 0x1000)
#define ARM_RAS_START (ARM_TP_ADDRESS + 4)
OpenPOWER on IntegriCloud