blob: cee13c2e5161f4d3b67ba00e634c7c8b3664a97a [file] [log] [blame]
Greg Ungerercddafa32010-09-13 14:10:45 +10001#ifndef _ASM_M68K_THREAD_INFO_H
2#define _ASM_M68K_THREAD_INFO_H
3
4#include <asm/types.h>
5#include <asm/page.h>
Greg Ungererfeb1ee72011-10-17 17:31:26 +10006#include <asm/segment.h>
Greg Ungerercddafa32010-09-13 14:10:45 +10007
8/*
9 * On machines with 4k pages we default to an 8k thread size, though we
10 * allow a 4k with config option. Any other machine page size then
11 * the thread size must match the page size (which is 8k and larger here).
12 */
13#if PAGE_SHIFT < 13
14#ifdef CONFIG_4KSTACKS
15#define THREAD_SIZE 4096
Sam Ravnborg49148022009-01-16 21:58:10 +100016#else
Greg Ungerercddafa32010-09-13 14:10:45 +100017#define THREAD_SIZE 8192
Sam Ravnborg49148022009-01-16 21:58:10 +100018#endif
Greg Ungerercddafa32010-09-13 14:10:45 +100019#else
20#define THREAD_SIZE PAGE_SIZE
21#endif
22#define THREAD_SIZE_ORDER ((THREAD_SIZE / PAGE_SIZE) - 1)
23
24#ifndef __ASSEMBLY__
25
26struct thread_info {
27 struct task_struct *task; /* main task structure */
28 unsigned long flags;
Greg Ungererfeb1ee72011-10-17 17:31:26 +100029 mm_segment_t addr_limit; /* thread address space */
Greg Ungerercddafa32010-09-13 14:10:45 +100030 int preempt_count; /* 0 => preemptable, <0 => BUG */
31 __u32 cpu; /* should always be 0 on m68k */
32 unsigned long tp_value; /* thread pointer */
Greg Ungerercddafa32010-09-13 14:10:45 +100033};
34#endif /* __ASSEMBLY__ */
35
Greg Ungerercddafa32010-09-13 14:10:45 +100036#define INIT_THREAD_INFO(tsk) \
37{ \
38 .task = &tsk, \
Greg Ungererfeb1ee72011-10-17 17:31:26 +100039 .addr_limit = KERNEL_DS, \
Greg Ungerercddafa32010-09-13 14:10:45 +100040 .preempt_count = INIT_PREEMPT_COUNT, \
Greg Ungerercddafa32010-09-13 14:10:45 +100041}
42
43#define init_stack (init_thread_union.stack)
44
Greg Ungerercddafa32010-09-13 14:10:45 +100045#ifndef __ASSEMBLY__
46/* how to get the thread information struct from C */
47static inline struct thread_info *current_thread_info(void)
48{
49 struct thread_info *ti;
50 __asm__(
51 "move.l %%sp, %0 \n\t"
52 "and.l %1, %0"
53 : "=&d"(ti)
54 : "di" (~(THREAD_SIZE-1))
55 );
56 return ti;
57}
58#endif
59
60#define init_thread_info (init_thread_union.thread_info)
61
Greg Ungerercddafa32010-09-13 14:10:45 +100062/* entry.S relies on these definitions!
63 * bits 0-7 are tested at every exception exit
64 * bits 8-15 are also tested at syscall exit
65 */
Al Viroa54f1652012-04-24 01:46:23 -040066#define TIF_NOTIFY_RESUME 5 /* callback before returning to user */
Greg Ungerercddafa32010-09-13 14:10:45 +100067#define TIF_SIGPENDING 6 /* signal pending */
68#define TIF_NEED_RESCHED 7 /* rescheduling necessary */
69#define TIF_DELAYED_TRACE 14 /* single step a syscall */
70#define TIF_SYSCALL_TRACE 15 /* syscall trace active */
71#define TIF_MEMDIE 16 /* is terminating due to OOM killer */
Al Viroe68847f2010-09-29 23:28:59 -040072#define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal */
Greg Ungerercddafa32010-09-13 14:10:45 +100073
74#endif /* _ASM_M68K_THREAD_INFO_H */