aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-cris/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-cris/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-cris/thread_info.h')
-rw-r--r--include/asm-cris/thread_info.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/include/asm-cris/thread_info.h b/include/asm-cris/thread_info.h
new file mode 100644
index 000000000000..53193feb0826
--- /dev/null
+++ b/include/asm-cris/thread_info.h
@@ -0,0 +1,101 @@
1/* thread_info.h: CRIS low-level thread information
2 *
3 * Copyright (C) 2002 David Howells (dhowells@redhat.com)
4 * - Incorporating suggestions made by Linus Torvalds and Dave Miller
5 *
6 * CRIS port by Axis Communications
7 */
8
9#ifndef _ASM_THREAD_INFO_H
10#define _ASM_THREAD_INFO_H
11
12#ifdef __KERNEL__
13
14#ifndef __ASSEMBLY__
15#include <asm/types.h>
16#include <asm/processor.h>
17#include <asm/arch/thread_info.h>
18#include <asm/segment.h>
19#endif
20
21
22/*
23 * low level task data that entry.S needs immediate access to
24 * - this struct should fit entirely inside of one cache line
25 * - this struct shares the supervisor stack pages
26 * - if the contents of this structure are changed, the assembly constants must also be changed
27 */
28#ifndef __ASSEMBLY__
29struct thread_info {
30 struct task_struct *task; /* main task structure */
31 struct exec_domain *exec_domain; /* execution domain */
32 unsigned long flags; /* low level flags */
33 __u32 cpu; /* current CPU */
34 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */
35
36 mm_segment_t addr_limit; /* thread address space:
37 0-0xBFFFFFFF for user-thead
38 0-0xFFFFFFFF for kernel-thread
39 */
40 struct restart_block restart_block;
41 __u8 supervisor_stack[0];
42};
43
44#endif
45
46#define PREEMPT_ACTIVE 0x4000000
47
48/*
49 * macros/functions for gaining access to the thread information structure
50 *
51 * preempt_count needs to be 1 initially, until the scheduler is functional.
52 */
53#ifndef __ASSEMBLY__
54#define INIT_THREAD_INFO(tsk) \
55{ \
56 .task = &tsk, \
57 .exec_domain = &default_exec_domain, \
58 .flags = 0, \
59 .cpu = 0, \
60 .preempt_count = 1, \
61 .addr_limit = KERNEL_DS, \
62 .restart_block = { \
63 .fn = do_no_restart_syscall, \
64 }, \
65}
66
67#define init_thread_info (init_thread_union.thread_info)
68
69/* thread information allocation */
70#define alloc_thread_info(tsk) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
71#define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
72#define get_thread_info(ti) get_task_struct((ti)->task)
73#define put_thread_info(ti) put_task_struct((ti)->task)
74
75#endif /* !__ASSEMBLY__ */
76
77/*
78 * thread information flags
79 * - these are process state flags that various assembly files may need to access
80 * - pending work-to-be-done flags are in LSW
81 * - other flags in MSW
82 */
83#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
84#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
85#define TIF_SIGPENDING 2 /* signal pending */
86#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
87#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
88#define TIF_MEMDIE 17
89
90#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
91#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
92#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
93#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
94#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
95
96#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
97#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
98
99#endif /* __KERNEL__ */
100
101#endif /* _ASM_THREAD_INFO_H */