diff options
Diffstat (limited to 'arch/powerpc/include/asm/cputhreads.h')
-rw-r--r-- | arch/powerpc/include/asm/cputhreads.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/powerpc/include/asm/cputhreads.h b/arch/powerpc/include/asm/cputhreads.h index a8e18447c62b..f71bb4c118b4 100644 --- a/arch/powerpc/include/asm/cputhreads.h +++ b/arch/powerpc/include/asm/cputhreads.h | |||
@@ -61,22 +61,25 @@ static inline cpumask_t cpu_online_cores_map(void) | |||
61 | return cpu_thread_mask_to_cores(cpu_online_map); | 61 | return cpu_thread_mask_to_cores(cpu_online_map); |
62 | } | 62 | } |
63 | 63 | ||
64 | static inline int cpu_thread_to_core(int cpu) | 64 | #ifdef CONFIG_SMP |
65 | { | 65 | int cpu_core_index_of_thread(int cpu); |
66 | return cpu >> threads_shift; | 66 | int cpu_first_thread_of_core(int core); |
67 | } | 67 | #else |
68 | static inline int cpu_core_index_of_thread(int cpu) { return cpu; } | ||
69 | static inline int cpu_first_thread_of_core(int core) { return core; } | ||
70 | #endif | ||
68 | 71 | ||
69 | static inline int cpu_thread_in_core(int cpu) | 72 | static inline int cpu_thread_in_core(int cpu) |
70 | { | 73 | { |
71 | return cpu & (threads_per_core - 1); | 74 | return cpu & (threads_per_core - 1); |
72 | } | 75 | } |
73 | 76 | ||
74 | static inline int cpu_first_thread_in_core(int cpu) | 77 | static inline int cpu_first_thread_sibling(int cpu) |
75 | { | 78 | { |
76 | return cpu & ~(threads_per_core - 1); | 79 | return cpu & ~(threads_per_core - 1); |
77 | } | 80 | } |
78 | 81 | ||
79 | static inline int cpu_last_thread_in_core(int cpu) | 82 | static inline int cpu_last_thread_sibling(int cpu) |
80 | { | 83 | { |
81 | return cpu | (threads_per_core - 1); | 84 | return cpu | (threads_per_core - 1); |
82 | } | 85 | } |