aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-m68k/thread_info.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-m68k/thread_info.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-m68k/thread_info.h')
-rw-r--r--include/asm-m68k/thread_info.h118
1 files changed, 118 insertions, 0 deletions
diff --git a/include/asm-m68k/thread_info.h b/include/asm-m68k/thread_info.h
new file mode 100644
index 000000000000..5f58939c59db
--- /dev/null
+++ b/include/asm-m68k/thread_info.h
@@ -0,0 +1,118 @@
1#ifndef _ASM_M68K_THREAD_INFO_H
2#define _ASM_M68K_THREAD_INFO_H
3
4#include <asm/types.h>
5#include <asm/processor.h>
6#include <asm/page.h>
7
8struct thread_info {
9 struct task_struct *task; /* main task structure */
10 struct exec_domain *exec_domain; /* execution domain */
11 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */
12 __u32 cpu; /* should always be 0 on m68k */
13 struct restart_block restart_block;
14
15 __u8 supervisor_stack[0];
16};
17
18#define PREEMPT_ACTIVE 0x4000000
19
20#define INIT_THREAD_INFO(tsk) \
21{ \
22 .task = &tsk, \
23 .exec_domain = &default_exec_domain, \
24 .restart_block = { \
25 .fn = do_no_restart_syscall, \
26 }, \
27}
28
29/* THREAD_SIZE should be 8k, so handle differently for 4k and 8k machines */
30#if PAGE_SHIFT == 13 /* 8k machines */
31#define alloc_thread_info(tsk) ((struct thread_info *)__get_free_pages(GFP_KERNEL,0))
32#define free_thread_info(ti) free_pages((unsigned long)(ti),0)
33#else /* otherwise assume 4k pages */
34#define alloc_thread_info(tsk) ((struct thread_info *)__get_free_pages(GFP_KERNEL,1))
35#define free_thread_info(ti) free_pages((unsigned long)(ti),1)
36#endif /* PAGE_SHIFT == 13 */
37
38//#define init_thread_info (init_task.thread.info)
39#define init_stack (init_thread_union.stack)
40
41#define current_thread_info() (current->thread_info)
42
43
44#define __HAVE_THREAD_FUNCTIONS
45
46#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
47#define TIF_DELAYED_TRACE 1 /* single step a syscall */
48#define TIF_NOTIFY_RESUME 2 /* resumption notification requested */
49#define TIF_SIGPENDING 3 /* signal pending */
50#define TIF_NEED_RESCHED 4 /* rescheduling necessary */
51#define TIF_MEMDIE 5
52
53extern int thread_flag_fixme(void);
54
55/*
56 * flag set/clear/test wrappers
57 * - pass TIF_xxxx constants to these functions
58 */
59
60#define __set_tsk_thread_flag(tsk, flag, val) ({ \
61 switch (flag) { \
62 case TIF_SIGPENDING: \
63 tsk->thread.work.sigpending = val; \
64 break; \
65 case TIF_NEED_RESCHED: \
66 tsk->thread.work.need_resched = val; \
67 break; \
68 case TIF_SYSCALL_TRACE: \
69 tsk->thread.work.syscall_trace = val; \
70 break; \
71 case TIF_MEMDIE: \
72 tsk->thread.work.memdie = val; \
73 break; \
74 default: \
75 thread_flag_fixme(); \
76 } \
77})
78
79#define __get_tsk_thread_flag(tsk, flag) ({ \
80 int ___res; \
81 switch (flag) { \
82 case TIF_SIGPENDING: \
83 ___res = tsk->thread.work.sigpending; \
84 break; \
85 case TIF_NEED_RESCHED: \
86 ___res = tsk->thread.work.need_resched; \
87 break; \
88 case TIF_SYSCALL_TRACE: \
89 ___res = tsk->thread.work.syscall_trace;\
90 break; \
91 case TIF_MEMDIE: \
92 ___res = tsk->thread.work.memdie;\
93 break; \
94 default: \
95 ___res = thread_flag_fixme(); \
96 } \
97 ___res; \
98})
99
100#define __get_set_tsk_thread_flag(tsk, flag, val) ({ \
101 int __res = __get_tsk_thread_flag(tsk, flag); \
102 __set_tsk_thread_flag(tsk, flag, val); \
103 __res; \
104})
105
106#define set_tsk_thread_flag(tsk, flag) __set_tsk_thread_flag(tsk, flag, ~0)
107#define clear_tsk_thread_flag(tsk, flag) __set_tsk_thread_flag(tsk, flag, 0)
108#define test_and_set_tsk_thread_flag(tsk, flag) __get_set_tsk_thread_flag(tsk, flag, ~0)
109#define test_tsk_thread_flag(tsk, flag) __get_tsk_thread_flag(tsk, flag)
110
111#define set_thread_flag(flag) set_tsk_thread_flag(current, flag)
112#define clear_thread_flag(flag) clear_tsk_thread_flag(current, flag)
113#define test_thread_flag(flag) test_tsk_thread_flag(current, flag)
114
115#define set_need_resched() set_thread_flag(TIF_NEED_RESCHED)
116#define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED)
117
118#endif /* _ASM_M68K_THREAD_INFO_H */