1
2
3
4
5
6
7
8
9#ifndef _ASM_THREAD_INFO_H
10#define _ASM_THREAD_INFO_H
11
12#ifdef __KERNEL__
13
14#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
15
16#ifndef __ASSEMBLY__
17#include <asm/types.h>
18#include <asm/processor.h>
19#include <arch/thread_info.h>
20#include <asm/segment.h>
21#endif
22
23
24
25
26
27
28
29
30#ifndef __ASSEMBLY__
31struct thread_info {
32 struct task_struct *task;
33 struct exec_domain *exec_domain;
34 unsigned long flags;
35 __u32 cpu;
36 int preempt_count;
37 __u32 tls;
38
39 mm_segment_t addr_limit;
40
41
42
43 struct restart_block restart_block;
44 __u8 supervisor_stack[0];
45};
46
47#endif
48
49#define PREEMPT_ACTIVE 0x10000000
50
51
52
53
54#ifndef __ASSEMBLY__
55#define INIT_THREAD_INFO(tsk) \
56{ \
57 .task = &tsk, \
58 .exec_domain = &default_exec_domain, \
59 .flags = 0, \
60 .cpu = 0, \
61 .preempt_count = INIT_PREEMPT_COUNT, \
62 .addr_limit = KERNEL_DS, \
63 .restart_block = { \
64 .fn = do_no_restart_syscall, \
65 }, \
66}
67
68#define init_thread_info (init_thread_union.thread_info)
69
70
71#define alloc_thread_info(tsk) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
72#define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
73
74#endif
75
76
77
78
79
80
81
82#define TIF_SYSCALL_TRACE 0
83#define TIF_NOTIFY_RESUME 1
84#define TIF_SIGPENDING 2
85#define TIF_NEED_RESCHED 3
86#define TIF_RESTORE_SIGMASK 9
87#define TIF_POLLING_NRFLAG 16
88#define TIF_MEMDIE 17
89#define TIF_FREEZE 18
90
91#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
92#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
93#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
94#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
95#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
96#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
97#define _TIF_FREEZE (1<<TIF_FREEZE)
98
99#define _TIF_WORK_MASK 0x0000FFFE
100#define _TIF_ALLWORK_MASK 0x0000FFFF
101
102#endif
103
104#endif
105