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