add descriptive comment for TIF_MEMDIE task flag declaration.
[linux-2.6.git] / arch / score / include / asm / thread_info.h
1 #ifndef _ASM_SCORE_THREAD_INFO_H
2 #define _ASM_SCORE_THREAD_INFO_H
3
4 #ifdef __KERNEL__
5
6 #define KU_MASK 0x08
7 #define KU_USER 0x08
8 #define KU_KERN 0x00
9
10 #include <asm/page.h>
11 #include <linux/const.h>
12
13 /* thread information allocation */
14 #define THREAD_SIZE_ORDER       (1)
15 #define THREAD_SIZE             (PAGE_SIZE << THREAD_SIZE_ORDER)
16 #define THREAD_MASK             (THREAD_SIZE - _AC(1,UL))
17 #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
18
19 #ifndef __ASSEMBLY__
20
21 #include <asm/processor.h>
22
23 /*
24  * low level task data that entry.S needs immediate access to
25  * - this struct should fit entirely inside of one cache line
26  * - this struct shares the supervisor stack pages
27  * - if the contents of this structure are changed, the assembly constants
28  *   must also be changed
29  */
30 struct thread_info {
31         struct task_struct      *task;          /* main task structure */
32         struct exec_domain      *exec_domain;   /* execution domain */
33         unsigned long           flags;          /* low level flags */
34         unsigned long           tp_value;       /* thread pointer */
35         __u32                   cpu;            /* current CPU */
36
37         /* 0 => preemptable, < 0 => BUG */
38         int                     preempt_count;
39
40         /*
41          * thread address space:
42          * 0-0xBFFFFFFF for user-thead
43          * 0-0xFFFFFFFF for kernel-thread
44          */
45         mm_segment_t            addr_limit;
46         struct restart_block    restart_block;
47         struct pt_regs          *regs;
48 };
49
50 /*
51  * macros/functions for gaining access to the thread information structure
52  *
53  * preempt_count needs to be 1 initially, until the scheduler is functional.
54  */
55 #define INIT_THREAD_INFO(tsk)                   \
56 {                                               \
57         .task           = &tsk,                 \
58         .exec_domain    = &default_exec_domain, \
59         .cpu            = 0,                    \
60         .preempt_count  = 1,                    \
61         .addr_limit     = KERNEL_DS,            \
62         .restart_block  = {                     \
63                 .fn = do_no_restart_syscall,    \
64         },                                      \
65 }
66
67 #define init_thread_info        (init_thread_union.thread_info)
68 #define init_stack              (init_thread_union.stack)
69
70 /* How to get the thread information struct from C. */
71 register struct thread_info *__current_thread_info __asm__("r28");
72 #define current_thread_info()   __current_thread_info
73
74 #define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
75 #define free_thread_info(info) kfree(info)
76
77 #endif /* !__ASSEMBLY__ */
78
79 #define PREEMPT_ACTIVE          0x10000000
80
81 /*
82  * thread information flags
83  * - these are process state flags that various assembly files may need to
84  *   access
85  * - pending work-to-be-done flags are in LSW
86  * - other flags in MSW
87  */
88 #define TIF_SYSCALL_TRACE       0       /* syscall trace active */
89 #define TIF_SIGPENDING          1       /* signal pending */
90 #define TIF_NEED_RESCHED        2       /* rescheduling necessary */
91 #define TIF_NOTIFY_RESUME       5       /* callback before returning to user */
92 #define TIF_RESTORE_SIGMASK     9       /* restore signal mask in do_signal() */
93 #define TIF_POLLING_NRFLAG      17      /* true if poll_idle() is polling
94                                                  TIF_NEED_RESCHED */
95 #define TIF_MEMDIE              18      /* is terminating due to OOM killer */
96
97 #define _TIF_SYSCALL_TRACE      (1<<TIF_SYSCALL_TRACE)
98 #define _TIF_SIGPENDING         (1<<TIF_SIGPENDING)
99 #define _TIF_NEED_RESCHED       (1<<TIF_NEED_RESCHED)
100 #define _TIF_NOTIFY_RESUME      (1<<TIF_NOTIFY_RESUME)
101 #define _TIF_RESTORE_SIGMASK    (1<<TIF_RESTORE_SIGMASK)
102 #define _TIF_POLLING_NRFLAG     (1<<TIF_POLLING_NRFLAG)
103
104 #define _TIF_WORK_MASK          (0x0000ffff)
105
106 #endif /* __KERNEL__ */
107
108 #endif /* _ASM_SCORE_THREAD_INFO_H */