Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1da177e4 LT |
2 | #ifndef _ASM_PARISC_THREAD_INFO_H |
3 | #define _ASM_PARISC_THREAD_INFO_H | |
4 | ||
5 | #ifdef __KERNEL__ | |
6 | ||
7 | #ifndef __ASSEMBLY__ | |
8 | #include <asm/processor.h> | |
527dcdcc | 9 | #include <asm/special_insns.h> |
1da177e4 LT |
10 | |
11 | struct thread_info { | |
12 | struct task_struct *task; /* main task structure */ | |
1da177e4 LT |
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 */ | |
dcd497f9 | 16 | int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ |
1da177e4 LT |
17 | }; |
18 | ||
19 | #define INIT_THREAD_INFO(tsk) \ | |
20 | { \ | |
21 | .task = &tsk, \ | |
1da177e4 LT |
22 | .flags = 0, \ |
23 | .cpu = 0, \ | |
24 | .addr_limit = KERNEL_DS, \ | |
c99e6efe | 25 | .preempt_count = INIT_PREEMPT_COUNT, \ |
1da177e4 LT |
26 | } |
27 | ||
28 | #define init_thread_info (init_thread_union.thread_info) | |
29 | #define init_stack (init_thread_union.stack) | |
30 | ||
f32ed395 TA |
31 | /* how to get the thread information struct from C */ |
32 | #define current_thread_info() ((struct thread_info *)mfctl(30)) | |
33 | ||
34 | #endif /* !__ASSEMBLY */ | |
35 | ||
1da177e4 LT |
36 | /* thread information allocation */ |
37 | ||
ae3471f6 JDA |
38 | #ifdef CONFIG_IRQSTACKS |
39 | #define THREAD_SIZE_ORDER 2 /* PA-RISC requires at least 16k stack */ | |
40 | #else | |
8f8201df | 41 | #define THREAD_SIZE_ORDER 3 /* PA-RISC requires at least 32k stack */ |
ae3471f6 JDA |
42 | #endif |
43 | ||
1da177e4 LT |
44 | /* Be sure to hunt all references to this down when you change the size of |
45 | * the kernel stack */ | |
b69c49b7 FT |
46 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) |
47 | #define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER) | |
1da177e4 | 48 | |
1da177e4 LT |
49 | /* |
50 | * thread information flags | |
51 | */ | |
52 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ | |
a583f1b5 SE |
53 | #define TIF_SIGPENDING 1 /* signal pending */ |
54 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ | |
55 | #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | |
56 | #define TIF_32BIT 4 /* 32 bit binary */ | |
0ddc9324 | 57 | #define TIF_MEMDIE 5 /* is terminating due to OOM killer */ |
527973c8 | 58 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ |
d0420c83 | 59 | #define TIF_NOTIFY_RESUME 8 /* callback before returning to user */ |
ecd3d4bc KM |
60 | #define TIF_SINGLESTEP 9 /* single stepping? */ |
61 | #define TIF_BLOCKSTEP 10 /* branch stepping? */ | |
c90f0694 | 62 | #define TIF_SECCOMP 11 /* secure computing */ |
fc79168a | 63 | #define TIF_SYSCALL_TRACEPOINT 12 /* syscall tracepoint instrumentation */ |
1da177e4 LT |
64 | |
65 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | |
1da177e4 LT |
66 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
67 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | |
68 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | |
69 | #define _TIF_32BIT (1 << TIF_32BIT) | |
527973c8 | 70 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
d0420c83 | 71 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
ecd3d4bc KM |
72 | #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) |
73 | #define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP) | |
c90f0694 | 74 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) |
fc79168a | 75 | #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) |
1da177e4 | 76 | |
d0420c83 | 77 | #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \ |
6fd84c08 | 78 | _TIF_NEED_RESCHED) |
64482bd8 | 79 | #define _TIF_SYSCALL_TRACE_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \ |
c90f0694 | 80 | _TIF_BLOCKSTEP | _TIF_SYSCALL_AUDIT | \ |
fc79168a | 81 | _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT) |
1da177e4 | 82 | |
9dabf60d HD |
83 | #ifdef CONFIG_64BIT |
84 | # ifdef CONFIG_COMPAT | |
85 | # define is_32bit_task() (test_thread_flag(TIF_32BIT)) | |
86 | # else | |
87 | # define is_32bit_task() (0) | |
88 | # endif | |
89 | #else | |
90 | # define is_32bit_task() (1) | |
91 | #endif | |
92 | ||
1da177e4 LT |
93 | #endif /* __KERNEL__ */ |
94 | ||
95 | #endif /* _ASM_PARISC_THREAD_INFO_H */ |