1
2 #ifndef _ALPHA_THREAD_INFO_H
3 #define _ALPHA_THREAD_INFO_H
4
5 #ifdef __KERNEL__
6
7 #ifndef __ASSEMBLY__
8 #include <asm/processor.h>
9 #include <asm/types.h>
10 #include <asm/hwrpb.h>
11 #include <asm/sysinfo.h>
12 #endif
13
14 #ifndef __ASSEMBLY__
15 struct thread_info {
16 struct pcb_struct pcb;
17
18 struct task_struct *task;
19 unsigned int flags;
20 unsigned int ieee_state;
21
22 mm_segment_t addr_limit;
23 unsigned cpu;
24 int preempt_count;
25 unsigned int status;
26
27 int bpt_nsaved;
28 unsigned long bpt_addr[2];
29 unsigned int bpt_insn[2];
30 };
31
32
33
34
35 #define INIT_THREAD_INFO(tsk) \
36 { \
37 .task = &tsk, \
38 .addr_limit = KERNEL_DS, \
39 .preempt_count = INIT_PREEMPT_COUNT, \
40 }
41
42
43 register struct thread_info *__current_thread_info __asm__("$8");
44 #define current_thread_info() __current_thread_info
45
46 #endif
47
48
49 #define THREAD_SIZE_ORDER 1
50 #define THREAD_SIZE (2*PAGE_SIZE)
51
52
53
54
55
56
57
58
59
60 #define TIF_SYSCALL_TRACE 0
61 #define TIF_NOTIFY_RESUME 1
62 #define TIF_SIGPENDING 2
63 #define TIF_NEED_RESCHED 3
64 #define TIF_SYSCALL_AUDIT 4
65 #define TIF_DIE_IF_KERNEL 9
66 #define TIF_MEMDIE 13
67 #define TIF_POLLING_NRFLAG 14
68
69 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
70 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
71 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
72 #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
73 #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
74 #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
75
76
77 #define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
78 _TIF_NOTIFY_RESUME)
79
80
81 #define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \
82 | _TIF_SYSCALL_TRACE)
83
84 #define TS_UAC_NOPRINT 0x0001
85 #define TS_UAC_NOFIX 0x0002
86 #define TS_UAC_SIGBUS 0x0004
87
88 #define SET_UNALIGN_CTL(task,value) ({ \
89 __u32 status = task_thread_info(task)->status & ~UAC_BITMASK; \
90 if (value & PR_UNALIGN_NOPRINT) \
91 status |= TS_UAC_NOPRINT; \
92 if (value & PR_UNALIGN_SIGBUS) \
93 status |= TS_UAC_SIGBUS; \
94 if (value & 4) \
95 status |= TS_UAC_NOFIX; \
96 task_thread_info(task)->status = status; \
97 0; })
98
99 #define GET_UNALIGN_CTL(task,value) ({ \
100 __u32 status = task_thread_info(task)->status & ~UAC_BITMASK; \
101 __u32 res = 0; \
102 if (status & TS_UAC_NOPRINT) \
103 res |= PR_UNALIGN_NOPRINT; \
104 if (status & TS_UAC_SIGBUS) \
105 res |= PR_UNALIGN_SIGBUS; \
106 if (status & TS_UAC_NOFIX) \
107 res |= 4; \
108 put_user(res, (int __user *)(value)); \
109 })
110
111 #endif
112 #endif