diff options
-rw-r--r-- | include/asm-x86/page_32.h | 8 | ||||
-rw-r--r-- | include/asm-x86/thread_info.h | 37 |
2 files changed, 19 insertions, 26 deletions
diff --git a/include/asm-x86/page_32.h b/include/asm-x86/page_32.h index 424e82f8ae27..50b33ebcf851 100644 --- a/include/asm-x86/page_32.h +++ b/include/asm-x86/page_32.h | |||
@@ -13,6 +13,14 @@ | |||
13 | */ | 13 | */ |
14 | #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL) | 14 | #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL) |
15 | 15 | ||
16 | #ifdef CONFIG_4KSTACKS | ||
17 | #define THREAD_ORDER 0 | ||
18 | #else | ||
19 | #define THREAD_ORDER 1 | ||
20 | #endif | ||
21 | #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) | ||
22 | |||
23 | |||
16 | #ifdef CONFIG_X86_PAE | 24 | #ifdef CONFIG_X86_PAE |
17 | #define __PHYSICAL_MASK_SHIFT 36 | 25 | #define __PHYSICAL_MASK_SHIFT 36 |
18 | #define __VIRTUAL_MASK_SHIFT 32 | 26 | #define __VIRTUAL_MASK_SHIFT 32 |
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 */ |