1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef _ASM_C6X_THREAD_INFO_H
14#define _ASM_C6X_THREAD_INFO_H
15
16#ifdef __KERNEL__
17
18#include <asm/page.h>
19
20#ifdef CONFIG_4KSTACKS
21#define THREAD_SIZE 4096
22#define THREAD_SHIFT 12
23#define THREAD_SIZE_ORDER 0
24#else
25#define THREAD_SIZE 8192
26#define THREAD_SHIFT 13
27#define THREAD_SIZE_ORDER 1
28#endif
29
30#define THREAD_START_SP (THREAD_SIZE - 8)
31
32#ifndef __ASSEMBLY__
33
34typedef struct {
35 unsigned long seg;
36} mm_segment_t;
37
38
39
40
41struct thread_info {
42 struct task_struct *task;
43 struct exec_domain *exec_domain;
44 unsigned long flags;
45 int cpu;
46 int preempt_count;
47 mm_segment_t addr_limit;
48 struct restart_block restart_block;
49};
50
51
52
53
54
55
56#define INIT_THREAD_INFO(tsk) \
57{ \
58 .task = &tsk, \
59 .exec_domain = &default_exec_domain, \
60 .flags = 0, \
61 .cpu = 0, \
62 .preempt_count = INIT_PREEMPT_COUNT, \
63 .addr_limit = KERNEL_DS, \
64 .restart_block = { \
65 .fn = do_no_restart_syscall, \
66 }, \
67}
68
69#define init_thread_info (init_thread_union.thread_info)
70#define init_stack (init_thread_union.stack)
71
72
73static inline __attribute__((const))
74struct thread_info *current_thread_info(void)
75{
76 struct thread_info *ti;
77 asm volatile (" clr .s2 B15,0,%1,%0\n"
78 : "=b" (ti)
79 : "Iu5" (THREAD_SHIFT - 1));
80 return ti;
81}
82
83#define get_thread_info(ti) get_task_struct((ti)->task)
84#define put_thread_info(ti) put_task_struct((ti)->task)
85#endif
86
87#define PREEMPT_ACTIVE 0x10000000
88
89
90
91
92
93
94#define TIF_SYSCALL_TRACE 0
95#define TIF_NOTIFY_RESUME 1
96#define TIF_SIGPENDING 2
97#define TIF_NEED_RESCHED 3
98#define TIF_RESTORE_SIGMASK 4
99
100#define TIF_POLLING_NRFLAG 16
101#define TIF_MEMDIE 17
102
103#define TIF_WORK_MASK 0x00007FFE
104#define TIF_ALLWORK_MASK 0x00007FFF
105
106#endif
107
108#endif
109