Merge tag 'gpio-v3.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[linux-2.6.git] / arch / cris / include / asm / thread_info.h
blob55dede18c032e37195cdb5c17ccebfddebc505a8
1 /* thread_info.h: CRIS low-level thread information
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 */
9 #ifndef _ASM_THREAD_INFO_H
10 #define _ASM_THREAD_INFO_H
12 #ifdef __KERNEL__
14 #ifndef __ASSEMBLY__
15 #include <asm/types.h>
16 #include <asm/processor.h>
17 #include <arch/thread_info.h>
18 #include <asm/segment.h>
19 #endif
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
28 #ifndef __ASSEMBLY__
29 struct 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 int preempt_count; /* 0 => preemptable, <0 => BUG */
35 __u32 tls; /* TLS for this thread */
37 mm_segment_t addr_limit; /* thread address space:
38 0-0xBFFFFFFF for user-thead
39 0-0xFFFFFFFF for kernel-thread
41 struct restart_block restart_block;
42 __u8 supervisor_stack[0];
45 #endif
48 * macros/functions for gaining access to the thread information structure
50 #ifndef __ASSEMBLY__
51 #define INIT_THREAD_INFO(tsk) \
52 { \
53 .task = &tsk, \
54 .exec_domain = &default_exec_domain, \
55 .flags = 0, \
56 .cpu = 0, \
57 .preempt_count = INIT_PREEMPT_COUNT, \
58 .addr_limit = KERNEL_DS, \
59 .restart_block = { \
60 .fn = do_no_restart_syscall, \
61 }, \
64 #define init_thread_info (init_thread_union.thread_info)
66 #endif /* !__ASSEMBLY__ */
69 * thread information flags
70 * - these are process state flags that various assembly files may need to access
71 * - pending work-to-be-done flags are in LSW
72 * - other flags in MSW
74 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
75 #define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
76 #define TIF_SIGPENDING 2 /* signal pending */
77 #define TIF_NEED_RESCHED 3 /* rescheduling necessary */
78 #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
79 #define TIF_MEMDIE 17 /* is terminating due to OOM killer */
81 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
82 #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
83 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
84 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
86 #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
87 #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
89 #endif /* __KERNEL__ */
91 #endif /* _ASM_THREAD_INFO_H */