xref: /openbmc/linux/arch/parisc/include/asm/thread_info.h (revision 0760a9157bc93f660256f7014b936c584f3f8fdd)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_PARISC_THREAD_INFO_H
3 #define _ASM_PARISC_THREAD_INFO_H
4 
5 #ifndef __ASSEMBLY__
6 #include <asm/processor.h>
7 #include <asm/special_insns.h>
8 
9 struct thread_info {
10 	unsigned long flags;		/* thread_info flags (see TIF_*) */
11 	int preempt_count;		/* 0=premptable, <0=BUG; will also serve as bh-counter */
12 };
13 
14 #define INIT_THREAD_INFO(tsk)			\
15 {						\
16 	.flags		= 0,			\
17 	.preempt_count	= INIT_PREEMPT_COUNT,	\
18 }
19 
20 #endif /* !__ASSEMBLY */
21 
22 /* thread information allocation */
23 
24 #ifdef CONFIG_IRQSTACKS
25 #define THREAD_SIZE_ORDER	2 /* PA-RISC requires at least 16k stack */
26 #else
27 #define THREAD_SIZE_ORDER	3 /* PA-RISC requires at least 32k stack */
28 #endif
29 
30 /* Be sure to hunt all references to this down when you change the size of
31  * the kernel stack */
32 #define THREAD_SIZE             (PAGE_SIZE << THREAD_SIZE_ORDER)
33 #define THREAD_SHIFT            (PAGE_SHIFT + THREAD_SIZE_ORDER)
34 
35 /*
36  * thread information flags
37  */
38 #define TIF_SYSCALL_TRACE	0	/* syscall trace active */
39 #define TIF_SIGPENDING		1	/* signal pending */
40 #define TIF_NEED_RESCHED	2	/* rescheduling necessary */
41 #define TIF_POLLING_NRFLAG	3	/* true if poll_idle() is polling TIF_NEED_RESCHED */
42 #define TIF_32BIT               4       /* 32 bit binary */
43 #define TIF_MEMDIE		5	/* is terminating due to OOM killer */
44 #define TIF_NOTIFY_SIGNAL	6	/* signal notifications exist */
45 #define TIF_SYSCALL_AUDIT	7	/* syscall auditing active */
46 #define TIF_NOTIFY_RESUME	8	/* callback before returning to user */
47 #define TIF_SINGLESTEP		9	/* single stepping? */
48 #define TIF_BLOCKSTEP		10	/* branch stepping? */
49 #define TIF_SECCOMP		11	/* secure computing */
50 #define TIF_SYSCALL_TRACEPOINT	12	/* syscall tracepoint instrumentation */
51 
52 #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
53 #define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
54 #define _TIF_NOTIFY_SIGNAL	(1 << TIF_NOTIFY_SIGNAL)
55 #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
56 #define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)
57 #define _TIF_32BIT		(1 << TIF_32BIT)
58 #define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
59 #define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
60 #define _TIF_SINGLESTEP		(1 << TIF_SINGLESTEP)
61 #define _TIF_BLOCKSTEP		(1 << TIF_BLOCKSTEP)
62 #define _TIF_SECCOMP		(1 << TIF_SECCOMP)
63 #define _TIF_SYSCALL_TRACEPOINT	(1 << TIF_SYSCALL_TRACEPOINT)
64 
65 #define _TIF_USER_WORK_MASK     (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \
66                                  _TIF_NEED_RESCHED | _TIF_NOTIFY_SIGNAL)
67 #define _TIF_SYSCALL_TRACE_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP |	\
68 				 _TIF_BLOCKSTEP | _TIF_SYSCALL_AUDIT | \
69 				 _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)
70 
71 #ifdef CONFIG_64BIT
72 # ifdef CONFIG_COMPAT
73 #  define is_32bit_task()	(test_thread_flag(TIF_32BIT))
74 # else
75 #  define is_32bit_task()	(0)
76 # endif
77 #else
78 # define is_32bit_task()	(1)
79 #endif
80 
81 #endif /* _ASM_PARISC_THREAD_INFO_H */
82