0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __ASM_SMP_PLAT_H
0009 #define __ASM_SMP_PLAT_H
0010
0011 #include <linux/cpumask.h>
0012
0013 #include <asm/smp.h>
0014 #include <asm/types.h>
0015
0016 struct mpidr_hash {
0017 u64 mask;
0018 u32 shift_aff[4];
0019 u32 bits;
0020 };
0021
0022 extern struct mpidr_hash mpidr_hash;
0023
0024 static inline u32 mpidr_hash_size(void)
0025 {
0026 return 1 << mpidr_hash.bits;
0027 }
0028
0029
0030
0031
0032
0033
0034
0035 static inline int get_logical_index(u64 mpidr)
0036 {
0037 int cpu;
0038 for (cpu = 0; cpu < nr_cpu_ids; cpu++)
0039 if (cpu_logical_map(cpu) == mpidr)
0040 return cpu;
0041 return -EINVAL;
0042 }
0043
0044 #endif