aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/smp_mpidr.h
blob: 6a9307d6490034dc58c3d535add65510f1ad3b65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef ASMARM_SMP_MIDR_H
#define ASMARM_SMP_MIDR_H

#define hard_smp_processor_id()						\
	({								\
		unsigned int cpunum;					\
		__asm__("\n"						\
			"1:	mrc p15, 0, %0, c0, c0, 5\n"		\
			"	.pushsection \".alt.smp.init\", \"a\"\n"\
			"	.long	1b\n"				\
			"	mov	%0, #0\n"			\
			"	.popsection"				\
			: "=r" (cpunum));				\
		cpunum &= 0x0F;						\
	})

#endif