Commit 2214c0e7 authored by Helge Deller's avatar Helge Deller
Browse files

parisc: Move thread_info into task struct



This implements the CONFIG_THREAD_INFO_IN_TASK option.

With this change:
- before thread_info was part of the stack and located at the beginning of the stack
- now the thread_info struct is moved and located inside the task_struct structure
- the stack is allocated and handled like the major other platforms
- drop the cpu field of thread_info and use instead the one in task_struct

Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarSven Schnelle <svens@stackframe.org>
parent bc294838
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
    |       nds32: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ config PARISC
	select HAVE_UNSTABLE_SCHED_CLOCK if SMP
	select LEGACY_TIMER_TICK
	select CPU_NO_EFFICIENT_FFS
	select THREAD_INFO_IN_TASK
	select NEED_DMA_MAP_STATE
	select NEED_SG_DMA_LENGTH
	select HAVE_ARCH_KGDB
+19 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_PARISC_CURRENT_H
#define _ASM_PARISC_CURRENT_H

#include <asm/special_insns.h>

#ifndef __ASSEMBLY__
struct task_struct;

static __always_inline struct task_struct *get_current(void)
{
	return (struct task_struct *) mfctl(30);
}

#define current get_current()

#endif /* __ASSEMBLY__ */

#endif /* _ASM_PARISC_CURRENT_H */
+0 −2
Original line number Diff line number Diff line
@@ -102,8 +102,6 @@ DECLARE_PER_CPU(struct cpuinfo_parisc, cpu_data);

#define CPU_HVERSION ((boot_cpu_data.hversion >> 4) & 0x0FFF)

#define ARCH_MIN_TASKALIGN	FRAME_ALIGN

struct thread_struct {
	struct pt_regs regs;
	unsigned long  task_size;
+17 −2
Original line number Diff line number Diff line
@@ -34,8 +34,23 @@ extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);

#endif /* !ASSEMBLY */

#define raw_smp_processor_id()	(current_thread_info()->cpu)

/*
 * 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
#include <asm/asm-offsets.h>
#define raw_smp_processor_id()		(*(unsigned int *)((void *)current + TASK_CPU))
#endif
#else /* CONFIG_SMP */

static inline void smp_send_all_nop(void) { return; }
Loading