Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _ASM_M68K_THREAD_INFO_H |
| 2 | #define _ASM_M68K_THREAD_INFO_H |
| 3 | |
Heiko Carstens | 0ee000e | 2009-08-31 14:43:35 +0200 | [diff] [blame] | 4 | #ifndef ASM_OFFSETS_C |
| 5 | #include <asm/asm-offsets.h> |
| 6 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | #include <asm/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #include <asm/page.h> |
| 9 | |
Tim Abbott | 5cdef24 | 2009-09-16 12:44:25 -0400 | [diff] [blame] | 10 | #ifndef __ASSEMBLY__ |
| 11 | #include <asm/current.h> |
| 12 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | struct thread_info { |
| 14 | struct task_struct *task; /* main task structure */ |
Roman Zippel | 3b66a1e | 2005-11-13 16:06:59 -0800 | [diff] [blame] | 15 | unsigned long flags; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | struct exec_domain *exec_domain; /* execution domain */ |
Jesper Juhl | dcd497f | 2005-06-23 00:09:07 -0700 | [diff] [blame] | 17 | int preempt_count; /* 0 => preemptable, <0 => BUG */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | __u32 cpu; /* should always be 0 on m68k */ |
Maxim Kuvyrkov | 9674cdc | 2009-12-07 00:24:27 -0800 | [diff] [blame] | 19 | unsigned long tp_value; /* thread pointer */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | struct restart_block restart_block; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | }; |
Tim Abbott | 5cdef24 | 2009-09-16 12:44:25 -0400 | [diff] [blame] | 22 | #endif /* __ASSEMBLY__ */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
| 24 | #define PREEMPT_ACTIVE 0x4000000 |
| 25 | |
| 26 | #define INIT_THREAD_INFO(tsk) \ |
| 27 | { \ |
| 28 | .task = &tsk, \ |
| 29 | .exec_domain = &default_exec_domain, \ |
Peter Zijlstra | c99e6ef | 2009-07-10 14:57:56 +0200 | [diff] [blame] | 30 | .preempt_count = INIT_PREEMPT_COUNT, \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | .restart_block = { \ |
| 32 | .fn = do_no_restart_syscall, \ |
| 33 | }, \ |
| 34 | } |
| 35 | |
| 36 | /* THREAD_SIZE should be 8k, so handle differently for 4k and 8k machines */ |
FUJITA Tomonori | b69c49b | 2008-07-25 01:45:40 -0700 | [diff] [blame] | 37 | #define THREAD_SIZE_ORDER (13 - PAGE_SHIFT) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
Al Viro | abd0375 | 2005-11-13 16:06:58 -0800 | [diff] [blame] | 39 | #define init_thread_info (init_task.thread.info) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #define init_stack (init_thread_union.stack) |
| 41 | |
Heiko Carstens | 0ee000e | 2009-08-31 14:43:35 +0200 | [diff] [blame] | 42 | #ifdef ASM_OFFSETS_C |
| 43 | #define task_thread_info(tsk) ((struct thread_info *) NULL) |
| 44 | #else |
| 45 | #define task_thread_info(tsk) ((struct thread_info *)((char *)tsk+TASK_TINFO)) |
| 46 | #endif |
| 47 | |
Roman Zippel | f7e4217 | 2007-05-09 02:35:17 -0700 | [diff] [blame] | 48 | #define task_stack_page(tsk) ((tsk)->stack) |
Al Viro | abd0375 | 2005-11-13 16:06:58 -0800 | [diff] [blame] | 49 | #define current_thread_info() task_thread_info(current) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
| 51 | #define __HAVE_THREAD_FUNCTIONS |
| 52 | |
Al Viro | abd0375 | 2005-11-13 16:06:58 -0800 | [diff] [blame] | 53 | #define setup_thread_stack(p, org) ({ \ |
Roman Zippel | f7e4217 | 2007-05-09 02:35:17 -0700 | [diff] [blame] | 54 | *(struct task_struct **)(p)->stack = (p); \ |
Al Viro | abd0375 | 2005-11-13 16:06:58 -0800 | [diff] [blame] | 55 | task_thread_info(p)->task = (p); \ |
| 56 | }) |
| 57 | |
Roman Zippel | f7e4217 | 2007-05-09 02:35:17 -0700 | [diff] [blame] | 58 | #define end_of_stack(p) ((unsigned long *)(p)->stack + 1) |
Al Viro | abd0375 | 2005-11-13 16:06:58 -0800 | [diff] [blame] | 59 | |
Roman Zippel | 3b66a1e | 2005-11-13 16:06:59 -0800 | [diff] [blame] | 60 | /* entry.S relies on these definitions! |
| 61 | * bits 0-7 are tested at every exception exit |
| 62 | * bits 8-15 are also tested at syscall exit |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | */ |
Roman Zippel | 3b66a1e | 2005-11-13 16:06:59 -0800 | [diff] [blame] | 64 | #define TIF_SIGPENDING 6 /* signal pending */ |
| 65 | #define TIF_NEED_RESCHED 7 /* rescheduling necessary */ |
| 66 | #define TIF_DELAYED_TRACE 14 /* single step a syscall */ |
| 67 | #define TIF_SYSCALL_TRACE 15 /* syscall trace active */ |
| 68 | #define TIF_MEMDIE 16 |
Matt Helsley | 83224b0 | 2008-10-18 20:27:18 -0700 | [diff] [blame] | 69 | #define TIF_FREEZE 17 /* thread is freezing for suspend */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
| 71 | #endif /* _ASM_M68K_THREAD_INFO_H */ |