summaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-09-04 16:14:20 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-10-04 20:20:45 +0100
commit067173526c3bbc2eaeefcf6b7b2a9d998b9e8042 (patch)
tree4da794388079afaf0f43a5aadb750e097846e538 /arch/arm/include
parent971acb9b420ea1662dd3c48184c4315f87643be5 (diff)
ARM: Provide common header for hard_smp_processor_id()
Provide a common header to read the SMP CPU number from the MPIDR. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/smp_mpidr.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/include/asm/smp_mpidr.h b/arch/arm/include/asm/smp_mpidr.h
new file mode 100644
index 00000000000..7da7105e83e
--- /dev/null
+++ b/arch/arm/include/asm/smp_mpidr.h
@@ -0,0 +1,12 @@
+#ifndef ASMARM_SMP_MIDR_H
+#define ASMARM_SMP_MIDR_H
+
+#define hard_smp_processor_id() \
+ ({ \
+ unsigned int cpunum; \
+ __asm__("mrc p15, 0, %0, c0, c0, 5\n" \
+ : "=r" (cpunum)); \
+ cpunum &= 0x0F; \
+ })
+
+#endif