Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
David Howells | 527dcdc | 2012-03-28 18:30:02 +0100 | [diff] [blame] | 8 | #include <asm/special_insns.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | |
| 10 | struct thread_info { |
| 11 | struct task_struct *task; /* main task structure */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | unsigned long flags; /* thread_info flags (see TIF_*) */ |
| 13 | mm_segment_t addr_limit; /* user-level address space limit */ |
| 14 | __u32 cpu; /* current CPU */ |
Jesper Juhl | dcd497f | 2005-06-23 00:09:07 -0700 | [diff] [blame] | 15 | int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | }; |
| 17 | |
| 18 | #define INIT_THREAD_INFO(tsk) \ |
| 19 | { \ |
| 20 | .task = &tsk, \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | .flags = 0, \ |
| 22 | .cpu = 0, \ |
| 23 | .addr_limit = KERNEL_DS, \ |
Peter Zijlstra | c99e6ef | 2009-07-10 14:57:56 +0200 | [diff] [blame] | 24 | .preempt_count = INIT_PREEMPT_COUNT, \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | #define init_thread_info (init_thread_union.thread_info) |
| 28 | #define init_stack (init_thread_union.stack) |
| 29 | |
Tim Abbott | f32ed39 | 2009-09-27 17:25:08 -0400 | [diff] [blame] | 30 | /* how to get the thread information struct from C */ |
| 31 | #define current_thread_info() ((struct thread_info *)mfctl(30)) |
| 32 | |
| 33 | #endif /* !__ASSEMBLY */ |
| 34 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | /* thread information allocation */ |
| 36 | |
Helge Deller | 9372450 | 2013-05-07 19:28:52 +0000 | [diff] [blame] | 37 | #define THREAD_SIZE_ORDER 2 /* PA-RISC requires at least 16k stack */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | /* Be sure to hunt all references to this down when you change the size of |
| 39 | * the kernel stack */ |
FUJITA Tomonori | b69c49b | 2008-07-25 01:45:40 -0700 | [diff] [blame] | 40 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) |
| 41 | #define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | /* |
| 44 | * thread information flags |
| 45 | */ |
| 46 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ |
Stephane Eranian | a583f1b | 2007-07-31 00:38:00 -0700 | [diff] [blame] | 47 | #define TIF_SIGPENDING 1 /* signal pending */ |
| 48 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ |
| 49 | #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
| 50 | #define TIF_32BIT 4 /* 32 bit binary */ |
Andreas Dilger | 0ddc932 | 2010-05-14 11:13:27 +0200 | [diff] [blame] | 51 | #define TIF_MEMDIE 5 /* is terminating due to OOM killer */ |
Helge Deller | 527973c | 2013-10-15 19:25:46 +0200 | [diff] [blame] | 52 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ |
David Howells | d0420c8 | 2009-09-02 09:14:16 +0100 | [diff] [blame] | 53 | #define TIF_NOTIFY_RESUME 8 /* callback before returning to user */ |
Kyle McMartin | ecd3d4b | 2009-09-27 23:03:02 -0400 | [diff] [blame] | 54 | #define TIF_SINGLESTEP 9 /* single stepping? */ |
| 55 | #define TIF_BLOCKSTEP 10 /* branch stepping? */ |
Helge Deller | c90f069 | 2014-08-27 14:39:56 +0200 | [diff] [blame] | 56 | #define TIF_SECCOMP 11 /* secure computing */ |
Helge Deller | fc79168 | 2016-04-13 22:44:54 +0200 | [diff] [blame] | 57 | #define TIF_SYSCALL_TRACEPOINT 12 /* syscall tracepoint instrumentation */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | |
| 59 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
| 61 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
| 62 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) |
| 63 | #define _TIF_32BIT (1 << TIF_32BIT) |
Helge Deller | 527973c | 2013-10-15 19:25:46 +0200 | [diff] [blame] | 64 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
David Howells | d0420c8 | 2009-09-02 09:14:16 +0100 | [diff] [blame] | 65 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
Kyle McMartin | ecd3d4b | 2009-09-27 23:03:02 -0400 | [diff] [blame] | 66 | #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) |
| 67 | #define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP) |
Helge Deller | c90f069 | 2014-08-27 14:39:56 +0200 | [diff] [blame] | 68 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) |
Helge Deller | fc79168 | 2016-04-13 22:44:54 +0200 | [diff] [blame] | 69 | #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
David Howells | d0420c8 | 2009-09-02 09:14:16 +0100 | [diff] [blame] | 71 | #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \ |
Al Viro | 6fd84c0 | 2012-05-23 15:28:58 -0400 | [diff] [blame] | 72 | _TIF_NEED_RESCHED) |
Al Viro | 64482bd | 2012-05-20 11:59:03 -0400 | [diff] [blame] | 73 | #define _TIF_SYSCALL_TRACE_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \ |
Helge Deller | c90f069 | 2014-08-27 14:39:56 +0200 | [diff] [blame] | 74 | _TIF_BLOCKSTEP | _TIF_SYSCALL_AUDIT | \ |
Helge Deller | fc79168 | 2016-04-13 22:44:54 +0200 | [diff] [blame] | 75 | _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | |
Helge Deller | 9dabf60 | 2014-01-31 22:19:52 +0100 | [diff] [blame] | 77 | #ifdef CONFIG_64BIT |
| 78 | # ifdef CONFIG_COMPAT |
| 79 | # define is_32bit_task() (test_thread_flag(TIF_32BIT)) |
| 80 | # else |
| 81 | # define is_32bit_task() (0) |
| 82 | # endif |
| 83 | #else |
| 84 | # define is_32bit_task() (1) |
| 85 | #endif |
| 86 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | #endif /* __KERNEL__ */ |
| 88 | |
| 89 | #endif /* _ASM_PARISC_THREAD_INFO_H */ |