ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-parisc / thread_info.h
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
9 struct thread_info {
10         struct task_struct *task;       /* main task structure */
11         struct exec_domain *exec_domain;/* execution domain */
12         __u32 flags;                    /* thread_info flags (see TIF_*) */
13         __u32 cpu;                      /* current CPU */
14         mm_segment_t addr_limit;        /* user-level address space limit */
15         struct restart_block restart_block;
16         __s32 preempt_count;            /* 0=premptable, <0=BUG; will also serve as bh-counter */
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:  0,                      \
27 }
28
29 #define init_thread_info        (init_thread_union.thread_info)
30 #define init_stack              (init_thread_union.stack)
31
32 /* thread information allocation */
33
34 #define THREAD_ORDER            2
35 /* Be sure to hunt all references to this down when you change the size of
36  * the kernel stack */
37 #define THREAD_SIZE             (PAGE_SIZE << THREAD_ORDER)
38 #define THREAD_SHIFT            (PAGE_SHIFT + THREAD_ORDER)
39
40 #define alloc_thread_info(tsk) ((struct thread_info *) \
41                         __get_free_pages(GFP_KERNEL, THREAD_ORDER))
42 #define free_thread_info(ti)    free_pages((unsigned long) (ti), THREAD_ORDER)
43 #define get_thread_info(ti)     get_task_struct((ti)->task)
44 #define put_thread_info(ti)     put_task_struct((ti)->task)
45
46
47 /* how to get the thread information struct from C */
48 #define current_thread_info()   ((struct thread_info *)mfctl(30))
49
50 #endif /* !__ASSEMBLY */
51
52 #define PREEMPT_ACTIVE          0x4000000
53
54 /*
55  * thread information flags
56  */
57 #define TIF_SYSCALL_TRACE       0       /* syscall trace active */
58 #define TIF_NOTIFY_RESUME       1       /* resumption notification requested */
59 #define TIF_SIGPENDING          2       /* signal pending */
60 #define TIF_NEED_RESCHED        3       /* rescheduling necessary */
61 #define TIF_POLLING_NRFLAG      4       /* true if poll_idle() is polling TIF_NEED_RESCHED */
62 #define TIF_32BIT               5       /* 32 bit binary */
63
64 #define _TIF_SYSCALL_TRACE      (1 << TIF_SYSCALL_TRACE)
65 #define _TIF_NOTIFY_RESUME      (1 << TIF_NOTIFY_RESUME)
66 #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)
70
71 #define _TIF_USER_WORK_MASK     (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \
72                                  _TIF_NEED_RESCHED)
73
74 #endif /* __KERNEL__ */
75
76 #endif /* _ASM_PARISC_THREAD_INFO_H */