1
2
3
4
5
6
7
8
9
10
11#ifndef _XTENSA_THREAD_INFO_H
12#define _XTENSA_THREAD_INFO_H
13
14#include <asm/kmem_layout.h>
15
16#define CURRENT_SHIFT KERNEL_STACK_SHIFT
17
18#ifndef __ASSEMBLY__
19# include <asm/processor.h>
20#endif
21
22
23
24
25
26
27
28
29
30#ifndef __ASSEMBLY__
31
32#if XTENSA_HAVE_COPROCESSORS
33
34typedef struct xtregs_coprocessor {
35 xtregs_cp0_t cp0;
36 xtregs_cp1_t cp1;
37 xtregs_cp2_t cp2;
38 xtregs_cp3_t cp3;
39 xtregs_cp4_t cp4;
40 xtregs_cp5_t cp5;
41 xtregs_cp6_t cp6;
42 xtregs_cp7_t cp7;
43} xtregs_coprocessor_t;
44
45#endif
46
47struct thread_info {
48 struct task_struct *task;
49 unsigned long flags;
50 unsigned long status;
51 __u32 cpu;
52 __s32 preempt_count;
53
54 mm_segment_t addr_limit;
55
56 unsigned long cpenable;
57
58
59#if XTENSA_HAVE_COPROCESSORS
60 xtregs_coprocessor_t xtregs_cp;
61#endif
62 xtregs_user_t xtregs_user;
63};
64
65#endif
66
67
68
69
70
71#ifndef __ASSEMBLY__
72
73#define INIT_THREAD_INFO(tsk) \
74{ \
75 .task = &tsk, \
76 .flags = 0, \
77 .cpu = 0, \
78 .preempt_count = INIT_PREEMPT_COUNT, \
79 .addr_limit = KERNEL_DS, \
80}
81
82
83static inline struct thread_info *current_thread_info(void)
84{
85 struct thread_info *ti;
86 __asm__("extui %0, a1, 0, "__stringify(CURRENT_SHIFT)"\n\t"
87 "xor %0, a1, %0" : "=&r" (ti) : );
88 return ti;
89}
90
91#else
92
93
94#define GET_THREAD_INFO(reg,sp) \
95 extui reg, sp, 0, CURRENT_SHIFT; \
96 xor reg, sp, reg
97#endif
98
99
100
101
102
103
104
105
106#define TIF_SYSCALL_TRACE 0
107#define TIF_SIGPENDING 1
108#define TIF_NEED_RESCHED 2
109#define TIF_SINGLESTEP 3
110#define TIF_MEMDIE 5
111#define TIF_RESTORE_SIGMASK 6
112#define TIF_NOTIFY_RESUME 7
113#define TIF_DB_DISABLED 8
114
115#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
116#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
117#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
118#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
119
120#define _TIF_WORK_MASK 0x0000FFFE
121#define _TIF_ALLWORK_MASK 0x0000FFFF
122
123
124
125
126
127
128
129
130#define TS_USEDFPU 0x0001
131
132#define THREAD_SIZE KERNEL_STACK_SIZE
133#define THREAD_SIZE_ORDER (KERNEL_STACK_SHIFT - PAGE_SHIFT)
134
135#endif
136