blob: 9532ca3c45cbea08906689234ad6a3e0f6224515 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASM_M68K_THREAD_INFO_H
2#define _ASM_M68K_THREAD_INFO_H
3
4#include <asm/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#include <asm/page.h>
6
7struct thread_info {
8 struct task_struct *task; /* main task structure */
Roman Zippel3b66a1e2005-11-13 16:06:59 -08009 unsigned long flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 struct exec_domain *exec_domain; /* execution domain */
Jesper Juhldcd497f2005-06-23 00:09:07 -070011 int preempt_count; /* 0 => preemptable, <0 => BUG */
Linus Torvalds1da177e2005-04-16 15:20:36 -070012 __u32 cpu; /* should always be 0 on m68k */
13 struct restart_block restart_block;
Linus Torvalds1da177e2005-04-16 15:20:36 -070014};
15
16#define PREEMPT_ACTIVE 0x4000000
17
18#define INIT_THREAD_INFO(tsk) \
19{ \
20 .task = &tsk, \
21 .exec_domain = &default_exec_domain, \
22 .restart_block = { \
23 .fn = do_no_restart_syscall, \
24 }, \
25}
26
27/* THREAD_SIZE should be 8k, so handle differently for 4k and 8k machines */
28#if PAGE_SHIFT == 13 /* 8k machines */
29#define alloc_thread_info(tsk) ((struct thread_info *)__get_free_pages(GFP_KERNEL,0))
30#define free_thread_info(ti) free_pages((unsigned long)(ti),0)
31#else /* otherwise assume 4k pages */
32#define alloc_thread_info(tsk) ((struct thread_info *)__get_free_pages(GFP_KERNEL,1))
33#define free_thread_info(ti) free_pages((unsigned long)(ti),1)
34#endif /* PAGE_SHIFT == 13 */
35
Al Viroabd03752005-11-13 16:06:58 -080036#define init_thread_info (init_task.thread.info)
Linus Torvalds1da177e2005-04-16 15:20:36 -070037#define init_stack (init_thread_union.stack)
38
Al Viroabd03752005-11-13 16:06:58 -080039#define task_thread_info(tsk) (&(tsk)->thread.info)
40#define current_thread_info() task_thread_info(current)
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42#define __HAVE_THREAD_FUNCTIONS
43
Al Viroabd03752005-11-13 16:06:58 -080044#define setup_thread_stack(p, org) ({ \
45 *(struct task_struct **)(p)->thread_info = (p); \
46 task_thread_info(p)->task = (p); \
47})
48
49#define end_of_stack(p) ((unsigned long *)(p)->thread_info + 1)
50
Roman Zippel3b66a1e2005-11-13 16:06:59 -080051/* entry.S relies on these definitions!
52 * bits 0-7 are tested at every exception exit
53 * bits 8-15 are also tested at syscall exit
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 */
Roman Zippel3b66a1e2005-11-13 16:06:59 -080055#define TIF_SIGPENDING 6 /* signal pending */
56#define TIF_NEED_RESCHED 7 /* rescheduling necessary */
57#define TIF_DELAYED_TRACE 14 /* single step a syscall */
58#define TIF_SYSCALL_TRACE 15 /* syscall trace active */
59#define TIF_MEMDIE 16
Linus Torvalds1da177e2005-04-16 15:20:36 -070060
61#endif /* _ASM_M68K_THREAD_INFO_H */