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
18 * low level task data.
19 * If you change this, change the TI_* offsets below to match.
22 struct task_struct
*task
; /* main task structure */
23 struct exec_domain
*exec_domain
; /* execution domain */
24 unsigned long flags
; /* low level flags */
25 int cpu
; /* cpu we're on */
26 int preempt_count
; /* 0 => preemptable, <0 => BUG */
27 struct restart_block restart_block
;
31 * macros/functions for gaining access to the thread information structure
33 #define INIT_THREAD_INFO(tsk) \
36 .exec_domain = &default_exec_domain, \
39 .preempt_count = INIT_PREEMPT_COUNT, \
41 .fn = do_no_restart_syscall, \
45 #define init_thread_info (init_thread_union.thread_info)
46 #define init_stack (init_thread_union.stack)
50 * Size of kernel stack for each process. This must be a power of 2...
52 #define THREAD_SIZE_ORDER 1
53 #define THREAD_SIZE 8192 /* 2 pages */
56 /* how to get the thread information struct from C */
57 static inline struct thread_info
*current_thread_info(void)
59 struct thread_info
*ti
;
64 : "i" (~(THREAD_SIZE
-1))
69 #endif /* __ASSEMBLY__ */
72 * Offsets in thread_info structure, used in assembly code
75 #define TI_EXECDOMAIN 4
78 #define TI_PRE_COUNT 16
80 #define PREEMPT_ACTIVE 0x4000000
83 * thread information flag bit numbers
85 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
86 #define TIF_SIGPENDING 1 /* signal pending */
87 #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
88 #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
91 #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
92 #define TIF_NOTIFY_RESUME 6 /* callback before returning to user */
93 #define TIF_FREEZE 16 /* is freezing for suspend */
95 /* as above, but as bit values */
96 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
97 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
98 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
99 #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
100 #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
101 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
102 #define _TIF_FREEZE (1<<TIF_FREEZE)
104 #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
106 #endif /* __KERNEL__ */
108 #endif /* _ASM_THREAD_INFO_H */