aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/cputhreads.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/cputhreads.h')
-rw-r--r--arch/powerpc/include/asm/cputhreads.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/cputhreads.h b/arch/powerpc/include/asm/cputhreads.h
index fb11b0c459b8..a8e18447c62b 100644
--- a/arch/powerpc/include/asm/cputhreads.h
+++ b/arch/powerpc/include/asm/cputhreads.h
@@ -5,6 +5,15 @@
5 5
6/* 6/*
7 * Mapping of threads to cores 7 * Mapping of threads to cores
8 *
9 * Note: This implementation is limited to a power of 2 number of
10 * threads per core and the same number for each core in the system
11 * (though it would work if some processors had less threads as long
12 * as the CPU numbers are still allocated, just not brought offline).
13 *
14 * However, the API allows for a different implementation in the future
15 * if needed, as long as you only use the functions and not the variables
16 * directly.
8 */ 17 */
9 18
10#ifdef CONFIG_SMP 19#ifdef CONFIG_SMP
@@ -67,5 +76,12 @@ static inline int cpu_first_thread_in_core(int cpu)
67 return cpu & ~(threads_per_core - 1); 76 return cpu & ~(threads_per_core - 1);
68} 77}
69 78
79static inline int cpu_last_thread_in_core(int cpu)
80{
81 return cpu | (threads_per_core - 1);
82}
83
84
85
70#endif /* _ASM_POWERPC_CPUTHREADS_H */ 86#endif /* _ASM_POWERPC_CPUTHREADS_H */
71 87