diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2011-01-12 00:37:42 -0500 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-12 00:37:42 -0500 |
| commit | 83eb95b852902f952ba594447a796ad8146b9462 (patch) | |
| tree | 33c199aeeae58b69ad8d6d2a33c2d96ba2b98ddf /arch/powerpc/include/asm/cputhreads.h | |
| parent | efb3e34b6176d30c4fe8635fa8e1beb6280cc2cd (diff) | |
| parent | 9bbe7b984096ac45586da2adf26c14069ecb79b2 (diff) | |
Merge branch 'sh/sdio' into sh-latest
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 | } |
