Merge tag 'for-linux-6.12-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / arch / m68k / include / asm / thread_info.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
cddafa35
GU
2#ifndef _ASM_M68K_THREAD_INFO_H
3#define _ASM_M68K_THREAD_INFO_H
4
5#include <asm/types.h>
6#include <asm/page.h>
7
8/*
9 * On machines with 4k pages we default to an 8k thread size, though we
10 * allow a 4k with config option. Any other machine page size then
11 * the thread size must match the page size (which is 8k and larger here).
12 */
13#if PAGE_SHIFT < 13
14#ifdef CONFIG_4KSTACKS
70d830e3 15#define THREAD_SIZE_ORDER 0
49148020 16#else
70d830e3 17#define THREAD_SIZE_ORDER 1
49148020 18#endif
cddafa35 19#else
70d830e3 20#define THREAD_SIZE_ORDER 0
cddafa35 21#endif
70d830e3
DL
22
23#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
cddafa35
GU
24
25#ifndef __ASSEMBLY__
26
27struct thread_info {
28 struct task_struct *task; /* main task structure */
29 unsigned long flags;
cddafa35
GU
30 int preempt_count; /* 0 => preemptable, <0 => BUG */
31 __u32 cpu; /* should always be 0 on m68k */
32 unsigned long tp_value; /* thread pointer */
cddafa35
GU
33};
34#endif /* __ASSEMBLY__ */
35
cddafa35
GU
36#define INIT_THREAD_INFO(tsk) \
37{ \
38 .task = &tsk, \
cddafa35 39 .preempt_count = INIT_PREEMPT_COUNT, \
cddafa35
GU
40}
41
cddafa35
GU
42#ifndef __ASSEMBLY__
43/* how to get the thread information struct from C */
44static inline struct thread_info *current_thread_info(void)
45{
46 struct thread_info *ti;
47 __asm__(
48 "move.l %%sp, %0 \n\t"
49 "and.l %1, %0"
50 : "=&d"(ti)
51 : "di" (~(THREAD_SIZE-1))
52 );
53 return ti;
54}
55#endif
56
cddafa35
GU
57/* entry.S relies on these definitions!
58 * bits 0-7 are tested at every exception exit
59 * bits 8-15 are also tested at syscall exit
60 */
e660653c 61#define TIF_NOTIFY_SIGNAL 4
a54f1655 62#define TIF_NOTIFY_RESUME 5 /* callback before returning to user */
cddafa35
GU
63#define TIF_SIGPENDING 6 /* signal pending */
64#define TIF_NEED_RESCHED 7 /* rescheduling necessary */
6baaade1 65#define TIF_SECCOMP 13 /* seccomp syscall filtering active */
cddafa35
GU
66#define TIF_DELAYED_TRACE 14 /* single step a syscall */
67#define TIF_SYSCALL_TRACE 15 /* syscall trace active */
68#define TIF_MEMDIE 16 /* is terminating due to OOM killer */
e68847fe 69#define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal */
cddafa35 70
62148d98
GU
71#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
72#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
73#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
6baaade1 74#define _TIF_SECCOMP (1 << TIF_SECCOMP)
62148d98
GU
75#define _TIF_DELAYED_TRACE (1 << TIF_DELAYED_TRACE)
76#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
77#define _TIF_MEMDIE (1 << TIF_MEMDIE)
78#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
79
cddafa35 80#endif /* _ASM_M68K_THREAD_INFO_H */