diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-04-28 21:52:40 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-05-12 15:28:03 -0400 |
commit | b84200b3a0fafa167185201319940d8df62a8c7b (patch) | |
tree | 2d69b401848d59e3984b4d815586448506a04c3b /include/asm-x86/thread_info.h | |
parent | 00c1bb133cf351fa3904b00a48a9cf535d018de6 (diff) |
x86: thread_info: merge thread_info allocation
Make them similar so that both use THREAD_ORDER and THREAD_FLAGS and have a
THREAD_SIZE definition that is setup in asm/page_xx.h
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/thread_info.h')
-rw-r--r-- | include/asm-x86/thread_info.h | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/include/asm-x86/thread_info.h b/include/asm-x86/thread_info.h index b7cd41308e56..348f0e0faa3b 100644 --- a/include/asm-x86/thread_info.h +++ b/include/asm-x86/thread_info.h | |||
@@ -132,6 +132,7 @@ struct thread_info { | |||
132 | /* work to do on any return to user space */ | 132 | /* work to do on any return to user space */ |
133 | #define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) | 133 | #define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) |
134 | 134 | ||
135 | /* Only used for 64 bit */ | ||
135 | #define _TIF_DO_NOTIFY_MASK \ | 136 | #define _TIF_DO_NOTIFY_MASK \ |
136 | (_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY|_TIF_HRTICK_RESCHED) | 137 | (_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY|_TIF_HRTICK_RESCHED) |
137 | 138 | ||
@@ -143,18 +144,21 @@ struct thread_info { | |||
143 | #define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW | 144 | #define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW |
144 | #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG) | 145 | #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG) |
145 | 146 | ||
146 | |||
147 | #define PREEMPT_ACTIVE 0x10000000 | 147 | #define PREEMPT_ACTIVE 0x10000000 |
148 | 148 | ||
149 | #ifdef CONFIG_X86_32 | 149 | /* thread information allocation */ |
150 | 150 | #ifdef CONFIG_DEBUG_STACK_USAGE | |
151 | #ifdef CONFIG_4KSTACKS | 151 | #define THREAD_FLAGS (GFP_KERNEL | __GFP_ZERO) |
152 | #define THREAD_SIZE (4096) | ||
153 | #else | 152 | #else |
154 | #define THREAD_SIZE (8192) | 153 | #define THREAD_FLAGS GFP_KERNEL |
155 | #endif | 154 | #endif |
156 | 155 | ||
157 | #define STACK_WARN (THREAD_SIZE/8) | 156 | #define alloc_thread_info(tsk) \ |
157 | ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER)) | ||
158 | |||
159 | #ifdef CONFIG_X86_32 | ||
160 | |||
161 | #define STACK_WARN (THREAD_SIZE/8) | ||
158 | /* | 162 | /* |
159 | * macros/functions for gaining access to the thread information structure | 163 | * macros/functions for gaining access to the thread information structure |
160 | * | 164 | * |
@@ -173,15 +177,6 @@ static inline struct thread_info *current_thread_info(void) | |||
173 | (current_stack_pointer & ~(THREAD_SIZE - 1)); | 177 | (current_stack_pointer & ~(THREAD_SIZE - 1)); |
174 | } | 178 | } |
175 | 179 | ||
176 | /* thread information allocation */ | ||
177 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
178 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | ||
179 | __get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(THREAD_SIZE))) | ||
180 | #else | ||
181 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | ||
182 | __get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE))) | ||
183 | #endif | ||
184 | |||
185 | #else /* !__ASSEMBLY__ */ | 180 | #else /* !__ASSEMBLY__ */ |
186 | 181 | ||
187 | /* how to get the thread information struct from ASM */ | 182 | /* how to get the thread information struct from ASM */ |
@@ -219,16 +214,6 @@ static inline struct thread_info *stack_thread_info(void) | |||
219 | return ti; | 214 | return ti; |
220 | } | 215 | } |
221 | 216 | ||
222 | /* thread information allocation */ | ||
223 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
224 | #define THREAD_FLAGS (GFP_KERNEL | __GFP_ZERO) | ||
225 | #else | ||
226 | #define THREAD_FLAGS GFP_KERNEL | ||
227 | #endif | ||
228 | |||
229 | #define alloc_thread_info(tsk) \ | ||
230 | ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER)) | ||
231 | |||
232 | #else /* !__ASSEMBLY__ */ | 217 | #else /* !__ASSEMBLY__ */ |
233 | 218 | ||
234 | /* how to get the thread information struct from ASM */ | 219 | /* how to get the thread information struct from ASM */ |