2 * ARM specific SMP header, this contains our implementation
5 #ifndef __ASMARM_SMP_PLAT_H
6 #define __ASMARM_SMP_PLAT_H
8 #include <linux/cpumask.h>
11 #include <asm/cputype.h>
14 * Return true if we are running on a SMP platform
16 static inline bool is_smp(void)
20 #elif defined(CONFIG_SMP_ON_UP)
21 extern unsigned int smp_on_up
;
28 /* all SMP configurations have the extended CPUID registers */
29 static inline int tlb_ops_need_broadcast(void)
34 return ((read_cpuid_ext(CPUID_EXT_MMFR3
) >> 12) & 0xf) < 2;
37 #if !defined(CONFIG_SMP) || __LINUX_ARM_ARCH__ >= 7
38 #define cache_ops_need_broadcast() 0
40 static inline int cache_ops_need_broadcast(void)
45 return ((read_cpuid_ext(CPUID_EXT_MMFR3
) >> 12) & 0xf) < 1;
50 * Logical CPU mapping.
52 extern int __cpu_logical_map
[];
53 #define cpu_logical_map(cpu) __cpu_logical_map[cpu]
55 * Retrieve logical cpu index corresponding to a given MPIDR[23:0]
56 * - mpidr: MPIDR[23:0] to be used for the look-up
58 * Returns the cpu logical index or -EINVAL on look-up error
60 static inline int get_logical_index(u32 mpidr
)
63 for (cpu
= 0; cpu
< nr_cpu_ids
; cpu
++)
64 if (cpu_logical_map(cpu
) == mpidr
)