1 /* thread_info.h: h8300 low-level thread information
2 * adapted from the i386 and PPC versions by Yoshinori Sato <ysato@users.sourceforge.jp>
4 * Copyright (C) 2002 David Howells (dhowells@redhat.com)
5 * - Incorporating suggestions made by Linus Torvalds and Dave Miller
8 #ifndef _ASM_THREAD_INFO_H
9 #define _ASM_THREAD_INFO_H
12 #include <asm/segment.h>
17 * Size of kernel stack for each process. This must be a power of 2...
19 #define THREAD_SIZE_ORDER 1
20 #define THREAD_SIZE 8192 /* 2 pages */
25 * low level task data.
26 * If you change this, change the TI_* offsets below to match.
29 struct task_struct
*task
; /* main task structure */
30 unsigned long flags
; /* low level flags */
31 int cpu
; /* cpu we're on */
32 int preempt_count
; /* 0 => preemptable, <0 => BUG */
33 mm_segment_t addr_limit
;
34 struct restart_block restart_block
;
38 * macros/functions for gaining access to the thread information structure
40 #define INIT_THREAD_INFO(tsk) \
45 .preempt_count = INIT_PREEMPT_COUNT, \
46 .addr_limit = KERNEL_DS, \
48 .fn = do_no_restart_syscall, \
52 #define init_thread_info (init_thread_union.thread_info)
53 #define init_stack (init_thread_union.stack)
55 /* how to get the thread information struct from C */
56 static inline struct thread_info
*current_thread_info(void)
58 struct thread_info
*ti
;
60 __asm__("mov.l sp, %0\n\t"
63 : "i" (~(THREAD_SIZE
-1) & 0xffff));
67 #endif /* __ASSEMBLY__ */
70 * thread information flag bit numbers
72 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
73 #define TIF_SIGPENDING 1 /* signal pending */
74 #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
75 #define TIF_SINGLESTEP 3 /* singlestepping active */
76 #define TIF_MEMDIE 4 /* is terminating due to OOM killer */
77 #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
78 #define TIF_NOTIFY_RESUME 6 /* callback before returning to user */
79 #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
80 #define TIF_SYSCALL_TRACEPOINT 8 /* for ftrace syscall instrumentation */
81 #define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling TIF_NEED_RESCHED */
83 /* as above, but as bit values */
84 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
85 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
86 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
87 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
88 #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
89 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
90 #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
91 #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
93 /* work to do in syscall trace */
94 #define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
95 _TIF_SYSCALL_AUDIT | _TIF_SYSCALL_TRACEPOINT)
97 /* work to do on any return to u-space */
98 #define _TIF_ALLWORK_MASK (_TIF_SYSCALL_TRACE | _TIF_SIGPENDING | \
99 _TIF_NEED_RESCHED | _TIF_SYSCALL_AUDIT | \
100 _TIF_SINGLESTEP | _TIF_NOTIFY_RESUME | \
101 _TIF_SYSCALL_TRACEPOINT)
103 /* work to do on interrupt/exception return */
104 #define _TIF_WORK_MASK (_TIF_ALLWORK_MASK & ~(_TIF_SYSCALL_TRACE | \
105 _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP))
107 #endif /* __KERNEL__ */
109 #endif /* _ASM_THREAD_INFO_H */