blob: a84611835549c2f9a1b93e999f593a058fcc8add [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#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 Howells527dcdc2012-03-28 18:30:02 +01008#include <asm/special_insns.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
10struct 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 */
Jesper Juhldcd497f2005-06-23 00:09:07 -070016 int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 struct restart_block restart_block;
18};
19
20#define INIT_THREAD_INFO(tsk) \
21{ \
22 .task = &tsk, \
23 .exec_domain = &default_exec_domain, \
24 .flags = 0, \
25 .cpu = 0, \
26 .addr_limit = KERNEL_DS, \
Peter Zijlstrac99e6ef2009-07-10 14:57:56 +020027 .preempt_count = INIT_PREEMPT_COUNT, \
Linus Torvalds1da177e2005-04-16 15:20:36 -070028 .restart_block = { \
29 .fn = do_no_restart_syscall \
30 } \
31}
32
33#define init_thread_info (init_thread_union.thread_info)
34#define init_stack (init_thread_union.stack)
35
Tim Abbottf32ed392009-09-27 17:25:08 -040036/* how to get the thread information struct from C */
37#define current_thread_info() ((struct thread_info *)mfctl(30))
38
39#endif /* !__ASSEMBLY */
40
Linus Torvalds1da177e2005-04-16 15:20:36 -070041/* thread information allocation */
42
Helge Deller93724502013-05-07 19:28:52 +000043#define THREAD_SIZE_ORDER 2 /* PA-RISC requires at least 16k stack */
Linus Torvalds1da177e2005-04-16 15:20:36 -070044/* Be sure to hunt all references to this down when you change the size of
45 * the kernel stack */
FUJITA Tomonorib69c49b2008-07-25 01:45:40 -070046#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
47#define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER)
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
Linus Torvalds1da177e2005-04-16 15:20:36 -070049/*
50 * thread information flags
51 */
52#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
Stephane Eraniana583f1b2007-07-31 00:38:00 -070053#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 */
Andreas Dilger0ddc9322010-05-14 11:13:27 +020057#define TIF_MEMDIE 5 /* is terminating due to OOM killer */
Stephane Eraniana583f1b2007-07-31 00:38:00 -070058#define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
Helge Deller527973c2013-10-15 19:25:46 +020059#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
David Howellsd0420c82009-09-02 09:14:16 +010060#define TIF_NOTIFY_RESUME 8 /* callback before returning to user */
Kyle McMartinecd3d4b2009-09-27 23:03:02 -040061#define TIF_SINGLESTEP 9 /* single stepping? */
62#define TIF_BLOCKSTEP 10 /* branch stepping? */
Helge Dellerc90f0692014-08-27 14:39:56 +020063#define TIF_SECCOMP 11 /* secure computing */
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
65#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070066#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)
Helge Deller527973c2013-10-15 19:25:46 +020070#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
David Howellsd0420c82009-09-02 09:14:16 +010071#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
Kyle McMartinecd3d4b2009-09-27 23:03:02 -040072#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
73#define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP)
Helge Dellerc90f0692014-08-27 14:39:56 +020074#define _TIF_SECCOMP (1 << TIF_SECCOMP)
Linus Torvalds1da177e2005-04-16 15:20:36 -070075
David Howellsd0420c82009-09-02 09:14:16 +010076#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \
Al Viro6fd84c02012-05-23 15:28:58 -040077 _TIF_NEED_RESCHED)
Al Viro64482bd2012-05-20 11:59:03 -040078#define _TIF_SYSCALL_TRACE_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
Helge Dellerc90f0692014-08-27 14:39:56 +020079 _TIF_BLOCKSTEP | _TIF_SYSCALL_AUDIT | \
80 _TIF_SECCOMP)
Linus Torvalds1da177e2005-04-16 15:20:36 -070081
Helge Deller9dabf602014-01-31 22:19:52 +010082#ifdef CONFIG_64BIT
83# ifdef CONFIG_COMPAT
84# define is_32bit_task() (test_thread_flag(TIF_32BIT))
85# else
86# define is_32bit_task() (0)
87# endif
88#else
89# define is_32bit_task() (1)
90#endif
91
Linus Torvalds1da177e2005-04-16 15:20:36 -070092#endif /* __KERNEL__ */
93
94#endif /* _ASM_PARISC_THREAD_INFO_H */