aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh64/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-sh64/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-sh64/thread_info.h')
-rw-r--r--include/asm-sh64/thread_info.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/include/asm-sh64/thread_info.h b/include/asm-sh64/thread_info.h
new file mode 100644
index 000000000000..e65f394da472
--- /dev/null
+++ b/include/asm-sh64/thread_info.h
@@ -0,0 +1,87 @@
1#ifndef __ASM_SH64_THREAD_INFO_H
2#define __ASM_SH64_THREAD_INFO_H
3
4/*
5 * SuperH 5 version
6 * Copyright (C) 2003 Paul Mundt
7 */
8
9#ifdef __KERNEL__
10
11#ifndef __ASSEMBLY__
12#include <asm/registers.h>
13
14/*
15 * low level task data that entry.S needs immediate access to
16 * - this struct should fit entirely inside of one cache line
17 * - this struct shares the supervisor stack pages
18 * - if the contents of this structure are changed, the assembly constants must also be changed
19 */
20struct thread_info {
21 struct task_struct *task; /* main task structure */
22 struct exec_domain *exec_domain; /* execution domain */
23 unsigned long flags; /* low level flags */
24 /* Put the 4 32-bit fields together to make asm offsetting easier. */
25 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */
26 __u16 cpu;
27
28 mm_segment_t addr_limit;
29 struct restart_block restart_block;
30
31 __u8 supervisor_stack[0];
32};
33
34/*
35 * macros/functions for gaining access to the thread information structure
36 */
37#define INIT_THREAD_INFO(tsk) \
38{ \
39 .task = &tsk, \
40 .exec_domain = &default_exec_domain, \
41 .flags = 0, \
42 .cpu = 0, \
43 .preempt_count = 1, \
44 .addr_limit = KERNEL_DS, \
45 .restart_block = { \
46 .fn = do_no_restart_syscall, \
47 }, \
48}
49
50#define init_thread_info (init_thread_union.thread_info)
51#define init_stack (init_thread_union.stack)
52
53/* how to get the thread information struct from C */
54static inline struct thread_info *current_thread_info(void)
55{
56 struct thread_info *ti;
57
58 __asm__ __volatile__ ("getcon " __KCR0 ", %0\n\t" : "=r" (ti));
59
60 return ti;
61}
62
63/* thread information allocation */
64
65
66
67#define alloc_thread_info(ti) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
68#define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
69#define get_thread_info(ti) get_task_struct((ti)->task)
70#define put_thread_info(ti) put_task_struct((ti)->task)
71
72#endif /* __ASSEMBLY__ */
73
74#define THREAD_SIZE 8192
75
76#define PREEMPT_ACTIVE 0x4000000
77
78/* thread information flags */
79#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
80#define TIF_SIGPENDING 2 /* signal pending */
81#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
82#define TIF_MEMDIE 4
83
84
85#endif /* __KERNEL__ */
86
87#endif /* __ASM_SH64_THREAD_INFO_H */