This source file includes following definitions.
- current_thread_info
1
2
3
4
5
6
7
8
9 #ifndef __UNICORE_THREAD_INFO_H__
10 #define __UNICORE_THREAD_INFO_H__
11
12 #ifdef __KERNEL__
13
14 #include <linux/compiler.h>
15 #include <asm/fpstate.h>
16
17 #define THREAD_SIZE_ORDER 1
18 #define THREAD_SIZE 8192
19 #define THREAD_START_SP (THREAD_SIZE - 8)
20
21 #ifndef __ASSEMBLY__
22
23 struct task_struct;
24
25 #include <asm/types.h>
26
27 typedef struct {
28 unsigned long seg;
29 } mm_segment_t;
30
31 struct cpu_context_save {
32 __u32 r4;
33 __u32 r5;
34 __u32 r6;
35 __u32 r7;
36 __u32 r8;
37 __u32 r9;
38 __u32 r10;
39 __u32 r11;
40 __u32 r12;
41 __u32 r13;
42 __u32 r14;
43 __u32 r15;
44 __u32 r16;
45 __u32 r17;
46 __u32 r18;
47 __u32 r19;
48 __u32 r20;
49 __u32 r21;
50 __u32 r22;
51 __u32 r23;
52 __u32 r24;
53 __u32 r25;
54 __u32 r26;
55 __u32 fp;
56 __u32 sp;
57 __u32 pc;
58 };
59
60
61
62
63
64 struct thread_info {
65 unsigned long flags;
66 int preempt_count;
67
68 mm_segment_t addr_limit;
69 struct task_struct *task;
70 __u32 cpu;
71 struct cpu_context_save cpu_context;
72 __u32 syscall;
73 __u8 used_cp[16];
74 #ifdef CONFIG_UNICORE_FPU_F64
75 struct fp_state fpstate __attribute__((aligned(8)));
76 #endif
77 };
78
79 #define INIT_THREAD_INFO(tsk) \
80 { \
81 .task = &tsk, \
82 .flags = 0, \
83 .preempt_count = INIT_PREEMPT_COUNT, \
84 .addr_limit = KERNEL_DS, \
85 }
86
87
88
89
90 static inline struct thread_info *current_thread_info(void) __attribute_const__;
91
92 static inline struct thread_info *current_thread_info(void)
93 {
94 register unsigned long sp asm ("sp");
95 return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
96 }
97
98 #define thread_saved_pc(tsk) \
99 ((unsigned long)(task_thread_info(tsk)->cpu_context.pc))
100 #define thread_saved_sp(tsk) \
101 ((unsigned long)(task_thread_info(tsk)->cpu_context.sp))
102 #define thread_saved_fp(tsk) \
103 ((unsigned long)(task_thread_info(tsk)->cpu_context.fp))
104
105 #endif
106
107
108
109
110
111
112
113
114 #define TIF_SIGPENDING 0
115 #define TIF_NEED_RESCHED 1
116 #define TIF_NOTIFY_RESUME 2
117 #define TIF_SYSCALL_TRACE 8
118 #define TIF_MEMDIE 18
119 #define TIF_RESTORE_SIGMASK 20
120
121 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
122 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
123 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
124 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
125
126
127
128
129 #define _TIF_WORK_MASK \
130 (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_NOTIFY_RESUME)
131
132 #endif
133 #endif