aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-parisc/thread_info.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-parisc/thread_info.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-parisc/thread_info.h')
-rw-r--r--include/asm-parisc/thread_info.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/include/asm-parisc/thread_info.h b/include/asm-parisc/thread_info.h
new file mode 100644
index 000000000000..fe9b7f8ae4c6
--- /dev/null
+++ b/include/asm-parisc/thread_info.h
@@ -0,0 +1,80 @@
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
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 */
15 __s32 preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
16 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, \
26 .preempt_count = 1, \
27 .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
35/* thread information allocation */
36
37#define THREAD_ORDER 2
38/* Be sure to hunt all references to this down when you change the size of
39 * the kernel stack */
40#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
41#define THREAD_SHIFT (PAGE_SHIFT + THREAD_ORDER)
42
43#define alloc_thread_info(tsk) ((struct thread_info *) \
44 __get_free_pages(GFP_KERNEL, THREAD_ORDER))
45#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER)
46#define get_thread_info(ti) get_task_struct((ti)->task)
47#define put_thread_info(ti) put_task_struct((ti)->task)
48
49
50/* how to get the thread information struct from C */
51#define current_thread_info() ((struct thread_info *)mfctl(30))
52
53#endif /* !__ASSEMBLY */
54
55#define PREEMPT_ACTIVE 0x10000000
56
57/*
58 * thread information flags
59 */
60#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
61#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
62#define TIF_SIGPENDING 2 /* signal pending */
63#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
64#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling TIF_NEED_RESCHED */
65#define TIF_32BIT 5 /* 32 bit binary */
66#define TIF_MEMDIE 6
67
68#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
69#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
70#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
71#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
72#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
73#define _TIF_32BIT (1 << TIF_32BIT)
74
75#define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \
76 _TIF_NEED_RESCHED)
77
78#endif /* __KERNEL__ */
79
80#endif /* _ASM_PARISC_THREAD_INFO_H */