Only x86 has own release_thread(), introduce a new weak release_thread() function to clean empty definitions in other ARCHs. Link: https://lkml.kernel.org/r/20220819014406.32266-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Acked-by: Guo Ren <guoren@kernel.org> [csky] Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Brian Cain <bcain@quicinc.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au> [powerpc] Acked-by: Stafford Horne <shorne@gmail.com> [openrisc] Acked-by: Catalin Marinas <catalin.marinas@arm.com> [arm64] Acked-by: Huacai Chen <chenhuacai@kernel.org> [LoongArch] Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Christian Borntraeger <borntraeger@linux.ibm.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: Chris Zankel <chris@zankel.net> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Guo Ren <guoren@kernel.org> [csky] Cc: Heiko Carstens <hca@linux.ibm.com> Cc: Helge Deller <deller@gmx.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Jonas Bonn <jonas@southpole.se> Cc: Matt Turner <mattst88@gmail.com> Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Richard Henderson <richard.henderson@linaro.org> Cc: Richard Weinberger <richard@nod.at> Cc: Rich Felker <dalias@libc.org> Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Vineet Gupta <vgupta@kernel.org> Cc: Will Deacon <will@kernel.org> Cc: Xuerui Wang <kernel@xen0n.name> Cc: Yoshinori Sato <ysato@users.osdn.me> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
100 lines
2.6 KiB
C
100 lines
2.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* include/asm/processor.h
|
|
*
|
|
* Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
|
|
*/
|
|
|
|
#ifndef __ASM_SPARC_PROCESSOR_H
|
|
#define __ASM_SPARC_PROCESSOR_H
|
|
|
|
#include <asm/psr.h>
|
|
#include <asm/ptrace.h>
|
|
#include <asm/head.h>
|
|
#include <asm/signal.h>
|
|
#include <asm/page.h>
|
|
|
|
/* Whee, this is STACK_TOP + PAGE_SIZE and the lowest kernel address too...
|
|
* That one page is used to protect kernel from intruders, so that
|
|
* we can make our access_ok test faster
|
|
*/
|
|
#define TASK_SIZE PAGE_OFFSET
|
|
#ifdef __KERNEL__
|
|
#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE)
|
|
#define STACK_TOP_MAX STACK_TOP
|
|
#endif /* __KERNEL__ */
|
|
|
|
struct task_struct;
|
|
|
|
#ifdef __KERNEL__
|
|
struct fpq {
|
|
unsigned long *insn_addr;
|
|
unsigned long insn;
|
|
};
|
|
#endif
|
|
|
|
/* The Sparc processor specific thread struct. */
|
|
struct thread_struct {
|
|
struct pt_regs *kregs;
|
|
unsigned int _pad1;
|
|
|
|
/* Special child fork kpsr/kwim values. */
|
|
unsigned long fork_kpsr __attribute__ ((aligned (8)));
|
|
unsigned long fork_kwim;
|
|
|
|
/* Floating point regs */
|
|
unsigned long float_regs[32] __attribute__ ((aligned (8)));
|
|
unsigned long fsr;
|
|
unsigned long fpqdepth;
|
|
struct fpq fpqueue[16];
|
|
};
|
|
|
|
#define INIT_THREAD { \
|
|
.kregs = (struct pt_regs *)(init_stack+THREAD_SIZE)-1 \
|
|
}
|
|
|
|
/* Do necessary setup to start up a newly executed thread. */
|
|
static inline void start_thread(struct pt_regs * regs, unsigned long pc,
|
|
unsigned long sp)
|
|
{
|
|
register unsigned long zero asm("g1");
|
|
|
|
regs->psr = (regs->psr & (PSR_CWP)) | PSR_S;
|
|
regs->pc = ((pc & (~3)) - 4);
|
|
regs->npc = regs->pc + 4;
|
|
regs->y = 0;
|
|
zero = 0;
|
|
__asm__ __volatile__("std\t%%g0, [%0 + %3 + 0x00]\n\t"
|
|
"std\t%%g0, [%0 + %3 + 0x08]\n\t"
|
|
"std\t%%g0, [%0 + %3 + 0x10]\n\t"
|
|
"std\t%%g0, [%0 + %3 + 0x18]\n\t"
|
|
"std\t%%g0, [%0 + %3 + 0x20]\n\t"
|
|
"std\t%%g0, [%0 + %3 + 0x28]\n\t"
|
|
"std\t%%g0, [%0 + %3 + 0x30]\n\t"
|
|
"st\t%1, [%0 + %3 + 0x38]\n\t"
|
|
"st\t%%g0, [%0 + %3 + 0x3c]"
|
|
: /* no outputs */
|
|
: "r" (regs),
|
|
"r" (sp - sizeof(struct reg_window32)),
|
|
"r" (zero),
|
|
"i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))
|
|
: "memory");
|
|
}
|
|
|
|
unsigned long __get_wchan(struct task_struct *);
|
|
|
|
#define task_pt_regs(tsk) ((tsk)->thread.kregs)
|
|
#define KSTK_EIP(tsk) ((tsk)->thread.kregs->pc)
|
|
#define KSTK_ESP(tsk) ((tsk)->thread.kregs->u_regs[UREG_FP])
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
extern struct task_struct *last_task_used_math;
|
|
int do_mathemu(struct pt_regs *regs, struct task_struct *fpt);
|
|
|
|
#define cpu_relax() barrier()
|
|
|
|
extern void (*sparc_idle)(void);
|
|
|
|
#endif
|
|
|
|
#endif /* __ASM_SPARC_PROCESSOR_H */
|