aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-um/thread_info.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-um/thread_info.h')
-rw-r--r--include/asm-um/thread_info.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h
index bffb577bc54e..1feaaf148ef1 100644
--- a/include/asm-um/thread_info.h
+++ b/include/asm-um/thread_info.h
@@ -41,18 +41,17 @@ struct thread_info {
41#define init_thread_info (init_thread_union.thread_info) 41#define init_thread_info (init_thread_union.thread_info)
42#define init_stack (init_thread_union.stack) 42#define init_stack (init_thread_union.stack)
43 43
44#define THREAD_SIZE ((1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE)
44/* how to get the thread information struct from C */ 45/* how to get the thread information struct from C */
45static inline struct thread_info *current_thread_info(void) 46static inline struct thread_info *current_thread_info(void)
46{ 47{
47 struct thread_info *ti; 48 struct thread_info *ti;
48 unsigned long mask = PAGE_SIZE * 49 unsigned long mask = THREAD_SIZE - 1;
49 (1 << CONFIG_KERNEL_STACK_ORDER) - 1; 50 ti = (struct thread_info *) (((unsigned long) &ti) & ~mask);
50 ti = (struct thread_info *) (((unsigned long) &ti) & ~mask);
51 return ti; 51 return ti;
52} 52}
53 53
54/* thread information allocation */ 54/* thread information allocation */
55#define THREAD_SIZE ((1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE)
56#define alloc_thread_info(tsk) \ 55#define alloc_thread_info(tsk) \
57 ((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL)) 56 ((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL))
58#define free_thread_info(ti) kfree(ti) 57#define free_thread_info(ti) kfree(ti)
@@ -62,7 +61,7 @@ static inline struct thread_info *current_thread_info(void)
62 61
63#endif 62#endif
64 63
65#define PREEMPT_ACTIVE 0x4000000 64#define PREEMPT_ACTIVE 0x10000000
66 65
67#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 66#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
68#define TIF_SIGPENDING 1 /* signal pending */ 67#define TIF_SIGPENDING 1 /* signal pending */
@@ -72,12 +71,14 @@ static inline struct thread_info *current_thread_info(void)
72 */ 71 */
73#define TIF_RESTART_BLOCK 4 72#define TIF_RESTART_BLOCK 4
74#define TIF_MEMDIE 5 73#define TIF_MEMDIE 5
74#define TIF_SYSCALL_AUDIT 6
75 75
76#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 76#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
77#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 77#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
78#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 78#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
79#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 79#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
80#define _TIF_RESTART_BLOCK (1 << TIF_RESTART_BLOCK) 80#define _TIF_MEMDIE (1 << TIF_MEMDIE)
81#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
81 82
82#endif 83#endif
83 84