1 #ifndef _ALPHA_THREAD_INFO_H
2 #define _ALPHA_THREAD_INFO_H
7 #include <asm/processor.h>
14 struct pcb_struct pcb; /* palcode state */
16 struct task_struct *task; /* main task structure */
17 unsigned int flags; /* low level flags */
18 unsigned int ieee_state; /* see fpu.h */
20 struct exec_domain *exec_domain; /* execution domain */
21 mm_segment_t addr_limit; /* thread address space */
22 unsigned cpu; /* current CPU */
23 int preempt_count; /* 0 => preemptable, <0 => BUG */
26 unsigned long bpt_addr[2]; /* breakpoint handling */
27 unsigned int bpt_insn[2];
29 struct restart_block restart_block;
33 * Macros/functions for gaining access to the thread information structure.
35 #define INIT_THREAD_INFO(tsk) \
38 .exec_domain = &default_exec_domain, \
39 .addr_limit = KERNEL_DS, \
41 .fn = do_no_restart_syscall, \
45 #define init_thread_info (init_thread_union.thread_info)
46 #define init_stack (init_thread_union.stack)
48 /* How to get the thread information struct from C. */
49 register struct thread_info *__current_thread_info __asm__("$8");
50 #define current_thread_info() __current_thread_info
52 /* Thread information allocation. */
53 #define THREAD_SIZE_ORDER 1
54 #define THREAD_SIZE (2*PAGE_SIZE)
56 #endif /* __ASSEMBLY__ */
58 #define PREEMPT_ACTIVE 0x40000000
61 * Thread information flags:
62 * - these are process state flags and used from assembly
63 * - pending work-to-be-done flags come first to fit in and immediate operand.
65 * TIF_SYSCALL_TRACE is known to be 0 via blbs.
67 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
68 #define TIF_SIGPENDING 1 /* signal pending */
69 #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
70 #define TIF_POLLING_NRFLAG 3 /* poll_idle is polling NEED_RESCHED */
71 #define TIF_DIE_IF_KERNEL 4 /* dik recursion lock */
72 #define TIF_UAC_NOPRINT 5 /* see sysinfo.h */
73 #define TIF_UAC_NOFIX 6
74 #define TIF_UAC_SIGBUS 7
76 #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */
78 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
79 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
80 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
81 #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
82 #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
84 /* Work to do on interrupt/exception return. */
85 #define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
87 /* Work to do on any return to userspace. */
88 #define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \
91 #define ALPHA_UAC_SHIFT 6
92 #define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \
95 #define SET_UNALIGN_CTL(task,value) ({ \
96 task_thread_info(task)->flags = ((task_thread_info(task)->flags & \
98 | (((value) << ALPHA_UAC_SHIFT) & (1<<TIF_UAC_NOPRINT))\
99 | (((value) << (ALPHA_UAC_SHIFT + 1)) & (1<<TIF_UAC_SIGBUS)) \
100 | (((value) << (ALPHA_UAC_SHIFT - 1)) & (1<<TIF_UAC_NOFIX)));\
103 #define GET_UNALIGN_CTL(task,value) ({ \
104 put_user((task_thread_info(task)->flags & (1 << TIF_UAC_NOPRINT))\
106 | (task_thread_info(task)->flags & (1 << TIF_UAC_SIGBUS))\
107 >> (ALPHA_UAC_SHIFT + 1) \
108 | (task_thread_info(task)->flags & (1 << TIF_UAC_NOFIX))\
109 >> (ALPHA_UAC_SHIFT - 1), \
110 (int __user *)(value)); \
113 #endif /* __KERNEL__ */
114 #endif /* _ALPHA_THREAD_INFO_H */