Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / blackfin / include / asm / thread_info.h
bloba5aeab4e5f2de4d032c7130e6f20c9c153167cdd
1 /*
2 * Copyright 2004-2010 Analog Devices Inc.
4 * Licensed under the GPL-2 or later.
5 */
7 #ifndef _ASM_THREAD_INFO_H
8 #define _ASM_THREAD_INFO_H
10 #include <asm/page.h>
11 #include <asm/entry.h>
12 #include <asm/l1layout.h>
13 #include <linux/compiler.h>
15 #ifdef __KERNEL__
17 /* Thread Align Mask to reach to the top of the stack
18 * for any process
20 #define ALIGN_PAGE_MASK 0xffffe000
23 * Size of kernel stack for each process. This must be a power of 2...
25 #define THREAD_SIZE_ORDER 1
26 #define THREAD_SIZE 8192 /* 2 pages */
27 #define STACK_WARN (THREAD_SIZE/8)
29 #ifndef __ASSEMBLY__
31 typedef unsigned long mm_segment_t;
34 * low level task data.
35 * If you change this, change the TI_* offsets below to match.
38 struct thread_info {
39 struct task_struct *task; /* main task structure */
40 unsigned long flags; /* low level flags */
41 int cpu; /* cpu we're on */
42 int preempt_count; /* 0 => preemptable, <0 => BUG */
43 mm_segment_t addr_limit; /* address limit */
44 #ifndef CONFIG_SMP
45 struct l1_scratch_task_info l1_task_info;
46 #endif
50 * macros/functions for gaining access to the thread information structure
52 #define INIT_THREAD_INFO(tsk) \
53 { \
54 .task = &tsk, \
55 .flags = 0, \
56 .cpu = 0, \
57 .preempt_count = INIT_PREEMPT_COUNT, \
60 /* Given a task stack pointer, you can find its corresponding
61 * thread_info structure just by masking it to the THREAD_SIZE
62 * boundary (currently 8K as you can see above).
64 __attribute_const__
65 static inline struct thread_info *current_thread_info(void)
67 struct thread_info *ti;
68 __asm__("%0 = sp;" : "=da"(ti));
69 return (struct thread_info *)((long)ti & ~((long)THREAD_SIZE-1));
72 #endif /* __ASSEMBLY__ */
75 * thread information flag bit numbers
77 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
78 #define TIF_SIGPENDING 1 /* signal pending */
79 #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
80 #define TIF_MEMDIE 4 /* is terminating due to OOM killer */
81 #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
82 #define TIF_IRQ_SYNC 7 /* sync pipeline stage */
83 #define TIF_NOTIFY_RESUME 8 /* callback before returning to user */
84 #define TIF_SINGLESTEP 9
86 /* as above, but as bit values */
87 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
88 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
89 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
90 #define _TIF_IRQ_SYNC (1<<TIF_IRQ_SYNC)
91 #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
92 #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
94 #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
96 #endif /* __KERNEL__ */
98 #endif /* _ASM_THREAD_INFO_H */