blob: 7ecc1039cfedfcb130c83da82fd64ed325b68364 [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>
8
9struct thread_info {
10 struct task_struct *task; /* main task structure */
11 struct exec_domain *exec_domain;/* execution domain */
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 Juhldcd497f2005-06-23 00:09:07 -070015 int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 struct restart_block restart_block;
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, \
Peter Zijlstrac99e6ef2009-07-10 14:57:56 +020026 .preempt_count = INIT_PREEMPT_COUNT, \
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 .restart_block = { \
28 .fn = do_no_restart_syscall \
29 } \
30}
31
32#define init_thread_info (init_thread_union.thread_info)
33#define init_stack (init_thread_union.stack)
34
Tim Abbottf32ed392009-09-27 17:25:08 -040035/* how to get the thread information struct from C */
36#define current_thread_info() ((struct thread_info *)mfctl(30))
37
38#endif /* !__ASSEMBLY */
39
Linus Torvalds1da177e2005-04-16 15:20:36 -070040/* thread information allocation */
41
FUJITA Tomonorib69c49b2008-07-25 01:45:40 -070042#define THREAD_SIZE_ORDER 2
Linus Torvalds1da177e2005-04-16 15:20:36 -070043/* Be sure to hunt all references to this down when you change the size of
44 * the kernel stack */
FUJITA Tomonorib69c49b2008-07-25 01:45:40 -070045#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
46#define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER)
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
Kyle McMartin50a34db2006-03-24 21:24:21 -070048#define PREEMPT_ACTIVE_BIT 28
49#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51/*
52 * thread information flags
53 */
54#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
Stephane Eraniana583f1b2007-07-31 00:38:00 -070055#define TIF_SIGPENDING 1 /* signal pending */
56#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
57#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */
58#define TIF_32BIT 4 /* 32 bit binary */
59#define TIF_MEMDIE 5
60#define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
Matt Helsley83224b02008-10-18 20:27:18 -070061#define TIF_FREEZE 7 /* is freezing for suspend */
David Howellsd0420c82009-09-02 09:14:16 +010062#define TIF_NOTIFY_RESUME 8 /* callback before returning to user */
Kyle McMartinecd3d4b2009-09-27 23:03:02 -040063#define TIF_SINGLESTEP 9 /* single stepping? */
64#define TIF_BLOCKSTEP 10 /* branch stepping? */
Linus Torvalds1da177e2005-04-16 15:20:36 -070065
66#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070067#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
68#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
69#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
70#define _TIF_32BIT (1 << TIF_32BIT)
Kyle McMartin4650f0a2007-01-08 16:28:06 -050071#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
Matt Helsley83224b02008-10-18 20:27:18 -070072#define _TIF_FREEZE (1 << TIF_FREEZE)
David Howellsd0420c82009-09-02 09:14:16 +010073#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
Kyle McMartinecd3d4b2009-09-27 23:03:02 -040074#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
75#define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP)
Linus Torvalds1da177e2005-04-16 15:20:36 -070076
David Howellsd0420c82009-09-02 09:14:16 +010077#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \
Kyle McMartin4650f0a2007-01-08 16:28:06 -050078 _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
Linus Torvalds1da177e2005-04-16 15:20:36 -070079
80#endif /* __KERNEL__ */
81
82#endif /* _ASM_PARISC_THREAD_INFO_H */