summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/arm/rtems/asm.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-13 15:18:58 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-18 07:30:31 +0100
commit04bd2617269880afaafa8f0647aaeda50b50698c (patch)
tree6557663e60ceafbd1c36b82598e0e382efaf4217 /cpukit/score/cpu/arm/rtems/asm.h
parentFix untar mkdir when the directory exists. (diff)
downloadrtems-04bd2617269880afaafa8f0647aaeda50b50698c.tar.bz2
arm: Use TPIDRPRW for current per-CPU control
Use the previously unused TPIDRPRW register to get the per-CPU control of the current processor. This avoids instructions in GET_SELF_CPU_CONTROL which are not available in Thumb mode.
Diffstat (limited to 'cpukit/score/cpu/arm/rtems/asm.h')
-rw-r--r--cpukit/score/cpu/arm/rtems/asm.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/cpukit/score/cpu/arm/rtems/asm.h b/cpukit/score/cpu/arm/rtems/asm.h
index d22514d60a..ec5ddc94ac 100644
--- a/cpukit/score/cpu/arm/rtems/asm.h
+++ b/cpukit/score/cpu/arm/rtems/asm.h
@@ -187,14 +187,12 @@
#endif /* __thumb__ */
.endm
-.macro GET_SELF_CPU_CONTROL REG, TMP
- ldr \REG, =_Per_CPU_Information
+.macro GET_SELF_CPU_CONTROL REG
#ifdef RTEMS_SMP
- /* Use ARMv7 Multiprocessor Affinity Register (MPIDR) */
- mrc p15, 0, \TMP, c0, c0, 5
-
- and \TMP, \TMP, #0xff
- add \REG, \REG, \TMP, asl #PER_CPU_CONTROL_SIZE_LOG2
+ /* Use PL1 only Thread ID Register (TPIDRPRW) */
+ mrc p15, 0, \REG, c13, c0, 4
+#else
+ ldr \REG, =_Per_CPU_Information
#endif
.endm