blob: 67266c683453e34c05e4edf9bf5e1df2f2197a4d [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
Heiko Carstens0ee000e2009-08-31 14:43:35 +02004#ifndef ASM_OFFSETS_C
5#include <asm/asm-offsets.h>
6#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#include <asm/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#include <asm/page.h>
9
Tim Abbott5cdef242009-09-16 12:44:25 -040010#ifndef __ASSEMBLY__
11#include <asm/current.h>
12
Linus Torvalds1da177e2005-04-16 15:20:36 -070013struct thread_info {
14 struct task_struct *task; /* main task structure */
Roman Zippel3b66a1e2005-11-13 16:06:59 -080015 unsigned long flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 struct exec_domain *exec_domain; /* execution domain */
Jesper Juhldcd497f2005-06-23 00:09:07 -070017 int preempt_count; /* 0 => preemptable, <0 => BUG */
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 __u32 cpu; /* should always be 0 on m68k */
Maxim Kuvyrkov9674cdc2009-12-07 00:24:27 -080019 unsigned long tp_value; /* thread pointer */
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 struct restart_block restart_block;
Linus Torvalds1da177e2005-04-16 15:20:36 -070021};
Tim Abbott5cdef242009-09-16 12:44:25 -040022#endif /* __ASSEMBLY__ */
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
24#define PREEMPT_ACTIVE 0x4000000
25
26#define INIT_THREAD_INFO(tsk) \
27{ \
28 .task = &tsk, \
29 .exec_domain = &default_exec_domain, \
Peter Zijlstrac99e6ef2009-07-10 14:57:56 +020030 .preempt_count = INIT_PREEMPT_COUNT, \
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 .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 Tomonorib69c49b2008-07-25 01:45:40 -070037#define THREAD_SIZE_ORDER (13 - PAGE_SHIFT)
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
Al Viroabd03752005-11-13 16:06:58 -080039#define init_thread_info (init_task.thread.info)
Linus Torvalds1da177e2005-04-16 15:20:36 -070040#define init_stack (init_thread_union.stack)
41
Heiko Carstens0ee000e2009-08-31 14:43:35 +020042#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 Zippelf7e42172007-05-09 02:35:17 -070048#define task_stack_page(tsk) ((tsk)->stack)
Al Viroabd03752005-11-13 16:06:58 -080049#define current_thread_info() task_thread_info(current)
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51#define __HAVE_THREAD_FUNCTIONS
52
Al Viroabd03752005-11-13 16:06:58 -080053#define setup_thread_stack(p, org) ({ \
Roman Zippelf7e42172007-05-09 02:35:17 -070054 *(struct task_struct **)(p)->stack = (p); \
Al Viroabd03752005-11-13 16:06:58 -080055 task_thread_info(p)->task = (p); \
56})
57
Roman Zippelf7e42172007-05-09 02:35:17 -070058#define end_of_stack(p) ((unsigned long *)(p)->stack + 1)
Al Viroabd03752005-11-13 16:06:58 -080059
Roman Zippel3b66a1e2005-11-13 16:06:59 -080060/* 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 Torvalds1da177e2005-04-16 15:20:36 -070063 */
Roman Zippel3b66a1e2005-11-13 16:06:59 -080064#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 Helsley83224b02008-10-18 20:27:18 -070069#define TIF_FREEZE 17 /* thread is freezing for suspend */
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
71#endif /* _ASM_M68K_THREAD_INFO_H */