diff options
Diffstat (limited to 'include/asm-powerpc/thread_info.h')
-rw-r--r-- | include/asm-powerpc/thread_info.h | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h index d030f5ce39ad..9665a26a253a 100644 --- a/include/asm-powerpc/thread_info.h +++ b/include/asm-powerpc/thread_info.h | |||
@@ -66,20 +66,12 @@ struct thread_info { | |||
66 | 66 | ||
67 | #if THREAD_SHIFT >= PAGE_SHIFT | 67 | #if THREAD_SHIFT >= PAGE_SHIFT |
68 | 68 | ||
69 | #define THREAD_ORDER (THREAD_SHIFT - PAGE_SHIFT) | 69 | #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT) |
70 | |||
71 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
72 | #define alloc_thread_info(tsk) \ | ||
73 | ((struct thread_info *)__get_free_pages(GFP_KERNEL | \ | ||
74 | __GFP_ZERO, THREAD_ORDER)) | ||
75 | #else | ||
76 | #define alloc_thread_info(tsk) \ | ||
77 | ((struct thread_info *)__get_free_pages(GFP_KERNEL, THREAD_ORDER)) | ||
78 | #endif | ||
79 | #define free_thread_info(ti) free_pages((unsigned long)ti, THREAD_ORDER) | ||
80 | 70 | ||
81 | #else /* THREAD_SHIFT < PAGE_SHIFT */ | 71 | #else /* THREAD_SHIFT < PAGE_SHIFT */ |
82 | 72 | ||
73 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
74 | |||
83 | extern struct thread_info *alloc_thread_info(struct task_struct *tsk); | 75 | extern struct thread_info *alloc_thread_info(struct task_struct *tsk); |
84 | extern void free_thread_info(struct thread_info *ti); | 76 | extern void free_thread_info(struct thread_info *ti); |
85 | 77 | ||
@@ -116,7 +108,7 @@ static inline struct thread_info *current_thread_info(void) | |||
116 | #define TIF_SECCOMP 10 /* secure computing */ | 108 | #define TIF_SECCOMP 10 /* secure computing */ |
117 | #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ | 109 | #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ |
118 | #define TIF_NOERROR 12 /* Force successful syscall return */ | 110 | #define TIF_NOERROR 12 /* Force successful syscall return */ |
119 | #define TIF_RESTORE_SIGMASK 13 /* Restore signal mask in do_signal */ | 111 | #define TIF_NOTIFY_RESUME 13 /* callback before returning to user */ |
120 | #define TIF_FREEZE 14 /* Freezing for suspend */ | 112 | #define TIF_FREEZE 14 /* Freezing for suspend */ |
121 | #define TIF_RUNLATCH 15 /* Is the runlatch enabled? */ | 113 | #define TIF_RUNLATCH 15 /* Is the runlatch enabled? */ |
122 | #define TIF_ABI_PENDING 16 /* 32/64 bit switch needed */ | 114 | #define TIF_ABI_PENDING 16 /* 32/64 bit switch needed */ |
@@ -134,21 +126,35 @@ static inline struct thread_info *current_thread_info(void) | |||
134 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 126 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) |
135 | #define _TIF_RESTOREALL (1<<TIF_RESTOREALL) | 127 | #define _TIF_RESTOREALL (1<<TIF_RESTOREALL) |
136 | #define _TIF_NOERROR (1<<TIF_NOERROR) | 128 | #define _TIF_NOERROR (1<<TIF_NOERROR) |
137 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 129 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
138 | #define _TIF_FREEZE (1<<TIF_FREEZE) | 130 | #define _TIF_FREEZE (1<<TIF_FREEZE) |
139 | #define _TIF_RUNLATCH (1<<TIF_RUNLATCH) | 131 | #define _TIF_RUNLATCH (1<<TIF_RUNLATCH) |
140 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) | 132 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) |
141 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) | 133 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) |
142 | 134 | ||
143 | #define _TIF_USER_WORK_MASK ( _TIF_SIGPENDING | \ | 135 | #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ |
144 | _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK) | 136 | _TIF_NOTIFY_RESUME) |
145 | #define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR) | 137 | #define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR) |
146 | 138 | ||
147 | /* Bits in local_flags */ | 139 | /* Bits in local_flags */ |
148 | /* Don't move TLF_NAPPING without adjusting the code in entry_32.S */ | 140 | /* Don't move TLF_NAPPING without adjusting the code in entry_32.S */ |
149 | #define TLF_NAPPING 0 /* idle thread enabled NAP mode */ | 141 | #define TLF_NAPPING 0 /* idle thread enabled NAP mode */ |
142 | #define TLF_SLEEPING 1 /* suspend code enabled SLEEP mode */ | ||
143 | #define TLF_RESTORE_SIGMASK 2 /* Restore signal mask in do_signal */ | ||
150 | 144 | ||
151 | #define _TLF_NAPPING (1 << TLF_NAPPING) | 145 | #define _TLF_NAPPING (1 << TLF_NAPPING) |
146 | #define _TLF_SLEEPING (1 << TLF_SLEEPING) | ||
147 | #define _TLF_RESTORE_SIGMASK (1 << TLF_RESTORE_SIGMASK) | ||
148 | |||
149 | #ifndef __ASSEMBLY__ | ||
150 | #define HAVE_SET_RESTORE_SIGMASK 1 | ||
151 | static inline void set_restore_sigmask(void) | ||
152 | { | ||
153 | struct thread_info *ti = current_thread_info(); | ||
154 | ti->local_flags |= _TLF_RESTORE_SIGMASK; | ||
155 | set_bit(TIF_SIGPENDING, &ti->flags); | ||
156 | } | ||
157 | #endif /* !__ASSEMBLY__ */ | ||
152 | 158 | ||
153 | #endif /* __KERNEL__ */ | 159 | #endif /* __KERNEL__ */ |
154 | 160 | ||