1 #ifndef _ASM_PARISC_THREAD_INFO_H
2 #define _ASM_PARISC_THREAD_INFO_H
3 
4 #ifdef __KERNEL__
5 
6 #ifndef __ASSEMBLY__
7 #include <asm/processor.h>
8 #include <asm/special_insns.h>
9 
10 struct thread_info {
11 	struct task_struct *task;	/* main task structure */
12 	struct exec_domain *exec_domain;/* execution domain */
13 	unsigned long flags;		/* thread_info flags (see TIF_*) */
14 	mm_segment_t addr_limit;	/* user-level address space limit */
15 	__u32 cpu;			/* current CPU */
16 	int preempt_count;		/* 0=premptable, <0=BUG; will also serve as bh-counter */
17 };
18 
19 #define INIT_THREAD_INFO(tsk)			\
20 {						\
21 	.task		= &tsk,			\
22 	.exec_domain	= &default_exec_domain,	\
23 	.flags		= 0,			\
24 	.cpu		= 0,			\
25 	.addr_limit	= KERNEL_DS,		\
26 	.preempt_count	= INIT_PREEMPT_COUNT,	\
27 }
28 
29 #define init_thread_info        (init_thread_union.thread_info)
30 #define init_stack              (init_thread_union.stack)
31 
32 /* how to get the thread information struct from C */
33 #define current_thread_info()	((struct thread_info *)mfctl(30))
34 
35 #endif /* !__ASSEMBLY */
36 
37 /* thread information allocation */
38 
39 #define THREAD_SIZE_ORDER	2 /* PA-RISC requires at least 16k stack */
40 /* Be sure to hunt all references to this down when you change the size of
41  * the kernel stack */
42 #define THREAD_SIZE             (PAGE_SIZE << THREAD_SIZE_ORDER)
43 #define THREAD_SHIFT            (PAGE_SHIFT + THREAD_SIZE_ORDER)
44 
45 /*
46  * thread information flags
47  */
48 #define TIF_SYSCALL_TRACE	0	/* syscall trace active */
49 #define TIF_SIGPENDING		1	/* signal pending */
50 #define TIF_NEED_RESCHED	2	/* rescheduling necessary */
51 #define TIF_POLLING_NRFLAG	3	/* true if poll_idle() is polling TIF_NEED_RESCHED */
52 #define TIF_32BIT               4       /* 32 bit binary */
53 #define TIF_MEMDIE		5	/* is terminating due to OOM killer */
54 #define TIF_RESTORE_SIGMASK	6	/* restore saved signal mask */
55 #define TIF_SYSCALL_AUDIT	7	/* syscall auditing active */
56 #define TIF_NOTIFY_RESUME	8	/* callback before returning to user */
57 #define TIF_SINGLESTEP		9	/* single stepping? */
58 #define TIF_BLOCKSTEP		10	/* branch stepping? */
59 #define TIF_SECCOMP		11	/* secure computing */
60 
61 #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
62 #define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
63 #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
64 #define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)
65 #define _TIF_32BIT		(1 << TIF_32BIT)
66 #define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
67 #define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
68 #define _TIF_SINGLESTEP		(1 << TIF_SINGLESTEP)
69 #define _TIF_BLOCKSTEP		(1 << TIF_BLOCKSTEP)
70 #define _TIF_SECCOMP		(1 << TIF_SECCOMP)
71 
72 #define _TIF_USER_WORK_MASK     (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \
73                                  _TIF_NEED_RESCHED)
74 #define _TIF_SYSCALL_TRACE_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP |	\
75 				 _TIF_BLOCKSTEP | _TIF_SYSCALL_AUDIT | \
76 				 _TIF_SECCOMP)
77 
78 #ifdef CONFIG_64BIT
79 # ifdef CONFIG_COMPAT
80 #  define is_32bit_task()	(test_thread_flag(TIF_32BIT))
81 # else
82 #  define is_32bit_task()	(0)
83 # endif
84 #else
85 # define is_32bit_task()	(1)
86 #endif
87 
88 #endif /* __KERNEL__ */
89 
90 #endif /* _ASM_PARISC_THREAD_INFO_H */
91