diff options
Diffstat (limited to 'include/asm-arm/processor.h')
-rw-r--r-- | include/asm-arm/processor.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h index 7d4118e0905..04f4d34c631 100644 --- a/include/asm-arm/processor.h +++ b/include/asm-arm/processor.h @@ -49,6 +49,12 @@ struct thread_struct { #define INIT_THREAD { } +#ifdef CONFIG_MMU +#define nommu_start_thread(regs) do { } while (0) +#else +#define nommu_start_thread(regs) regs->ARM_r10 = current->mm->start_data +#endif + #define start_thread(regs,pc,sp) \ ({ \ unsigned long *stack = (unsigned long *)sp; \ @@ -65,6 +71,7 @@ struct thread_struct { regs->ARM_r2 = stack[2]; /* r2 (envp) */ \ regs->ARM_r1 = stack[1]; /* r1 (argv) */ \ regs->ARM_r0 = stack[0]; /* r0 (argc) */ \ + nommu_start_thread(regs); \ }) /* Forward declaration, a strange C thing */ @@ -85,9 +92,11 @@ unsigned long get_wchan(struct task_struct *p); */ extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); -#define KSTK_REGS(tsk) (((struct pt_regs *)(THREAD_START_SP + (unsigned long)(tsk)->thread_info)) - 1) -#define KSTK_EIP(tsk) KSTK_REGS(tsk)->ARM_pc -#define KSTK_ESP(tsk) KSTK_REGS(tsk)->ARM_sp +#define task_pt_regs(p) \ + ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) + +#define KSTK_EIP(tsk) task_pt_regs(tsk)->ARM_pc +#define KSTK_ESP(tsk) task_pt_regs(tsk)->ARM_sp /* * Prefetching support - only ARMv5. |