[PATCH] arm: task_stack_page()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Al Viro and committed by Linus Torvalds 32d39a93 55205823

+5 -5
+1 -1
arch/arm/kernel/process.c
··· 460 return 0; 461 462 stack_start = (unsigned long)end_of_stack(p); 463 - stack_end = ((unsigned long)p->thread_info) + THREAD_SIZE; 464 465 fp = thread_saved_fp(p); 466 do {
··· 460 return 0; 461 462 stack_start = (unsigned long)end_of_stack(p); 463 + stack_end = (unsigned long)task_stack_page(p) + THREAD_SIZE; 464 465 fp = thread_saved_fp(p); 466 do {
+2 -2
arch/arm/kernel/smp.c
··· 114 * We need to tell the secondary core where to find 115 * its stack and the page tables. 116 */ 117 - secondary_data.stack = (void *)idle->thread_info + THREAD_START_SP; 118 secondary_data.pgdir = virt_to_phys(pgd); 119 wmb(); 120 ··· 245 __asm__("mov sp, %0\n" 246 " b secondary_start_kernel" 247 : 248 - : "r" ((void *)current->thread_info + THREAD_SIZE - 8)); 249 } 250 #endif /* CONFIG_HOTPLUG_CPU */ 251
··· 114 * We need to tell the secondary core where to find 115 * its stack and the page tables. 116 */ 117 + secondary_data.stack = task_stack_page(idle) + THREAD_START_SP; 118 secondary_data.pgdir = virt_to_phys(pgd); 119 wmb(); 120 ··· 245 __asm__("mov sp, %0\n" 246 " b secondary_start_kernel" 247 : 248 + : "r" (task_stack_page(current) + THREAD_SIZE - 8)); 249 } 250 #endif /* CONFIG_HOTPLUG_CPU */ 251
+1 -1
arch/arm/kernel/traps.c
··· 210 211 if (!user_mode(regs) || in_interrupt()) { 212 dump_mem("Stack: ", regs->ARM_sp, 213 - THREAD_SIZE + (unsigned long)tsk->thread_info); 214 dump_backtrace(regs, tsk); 215 dump_instr(regs); 216 }
··· 210 211 if (!user_mode(regs) || in_interrupt()) { 212 dump_mem("Stack: ", regs->ARM_sp, 213 + THREAD_SIZE + (unsigned long)task_stack_page(tsk)); 214 dump_backtrace(regs, tsk); 215 dump_instr(regs); 216 }
+1 -1
include/asm-arm/processor.h
··· 86 extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); 87 88 #define task_pt_regs(p) \ 89 - ((struct pt_regs *)(THREAD_START_SP + (void *)(p)->thread_info) - 1) 90 91 #define KSTK_EIP(tsk) task_pt_regs(tsk)->ARM_pc 92 #define KSTK_ESP(tsk) task_pt_regs(tsk)->ARM_sp
··· 86 extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); 87 88 #define task_pt_regs(p) \ 89 + ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) 90 91 #define KSTK_EIP(tsk) task_pt_regs(tsk)->ARM_pc 92 #define KSTK_ESP(tsk) task_pt_regs(tsk)->ARM_sp