diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2021-09-14 14:10:34 +0200 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2021-09-30 16:13:11 +0200 |
commit | 336868afbaae2d153fc20268a21747c31e5071b8 (patch) | |
tree | e2869a3eaf9f6590578cc4f55fb031b78e07333c /arch/powerpc/include/asm/smp.h | |
parent | bcf9033e5449bdcaa9bed46467a7141a8049dadb (diff) | |
download | linux-stable-336868afbaae2d153fc20268a21747c31e5071b8.tar.gz linux-stable-336868afbaae2d153fc20268a21747c31e5071b8.tar.bz2 linux-stable-336868afbaae2d153fc20268a21747c31e5071b8.zip |
powerpc: smp: remove hack to obtain offset of task_struct::cpu
Instead of relying on awful hacks to obtain the offset of the cpu field
in struct task_struct, move it back into struct thread_info, which does
not create the same level of circular dependency hell when trying to
include the header file that defines it.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/smp.h')
-rw-r--r-- | arch/powerpc/include/asm/smp.h | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h index 7ef1cd8168a0..007332a4a732 100644 --- a/arch/powerpc/include/asm/smp.h +++ b/arch/powerpc/include/asm/smp.h @@ -87,22 +87,7 @@ int is_cpu_dead(unsigned int cpu); /* 32-bit */ extern int smp_hw_index[]; -/* - * This is particularly ugly: it appears we can't actually get the definition - * of task_struct here, but we need access to the CPU this task is running on. - * Instead of using task_struct we're using _TASK_CPU which is extracted from - * asm-offsets.h by kbuild to get the current processor ID. - * - * This also needs to be safeguarded when building asm-offsets.s because at - * that time _TASK_CPU is not defined yet. It could have been guarded by - * _TASK_CPU itself, but we want the build to fail if _TASK_CPU is missing - * when building something else than asm-offsets.s - */ -#ifdef GENERATING_ASM_OFFSETS -#define raw_smp_processor_id() (0) -#else -#define raw_smp_processor_id() (*(unsigned int *)((void *)current + _TASK_CPU)) -#endif +#define raw_smp_processor_id() (current_thread_info()->cpu) #define hard_smp_processor_id() (smp_hw_index[smp_processor_id()]) static inline int get_hard_smp_processor_id(int cpu) |