diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-09-21 12:51:27 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-21 12:51:42 +0200 |
commit | ae82bfd61ca7e57cc2d914add9ab0873e260f2f5 (patch) | |
tree | a7f862ad8b0ae4f2e8953e6aa613eb702b484ecf /arch/sh/kernel/process_64.c | |
parent | cd74c86bdf705f824d494a2bbda393d1d562b40a (diff) | |
parent | ebc79c4f8da0f92efa968e0328f32334a2ce80cf (diff) | |
download | op-kernel-dev-ae82bfd61ca7e57cc2d914add9ab0873e260f2f5.zip op-kernel-dev-ae82bfd61ca7e57cc2d914add9ab0873e260f2f5.tar.gz |
Merge branch 'linus' into perfcounters/rename
Merge reason: pull in all the latest code before doing the rename.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/sh/kernel/process_64.c')
-rw-r--r-- | arch/sh/kernel/process_64.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c index 24de742..1192398 100644 --- a/arch/sh/kernel/process_64.c +++ b/arch/sh/kernel/process_64.c @@ -425,7 +425,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, struct task_struct *p, struct pt_regs *regs) { struct pt_regs *childregs; - unsigned long long se; /* Sign extension */ #ifdef CONFIG_SH_FPU if(last_task_used_math == current) { @@ -441,11 +440,19 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, *childregs = *regs; + /* + * Sign extend the edited stack. + * Note that thread.pc and thread.pc will stay + * 32-bit wide and context switch must take care + * of NEFF sign extension. + */ if (user_mode(regs)) { - childregs->regs[15] = usp; + childregs->regs[15] = neff_sign_extend(usp); p->thread.uregs = childregs; } else { - childregs->regs[15] = (unsigned long)task_stack_page(p) + THREAD_SIZE; + childregs->regs[15] = + neff_sign_extend((unsigned long)task_stack_page(p) + + THREAD_SIZE); } childregs->regs[9] = 0; /* Set return value for child */ @@ -454,17 +461,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, p->thread.sp = (unsigned long) childregs; p->thread.pc = (unsigned long) ret_from_fork; - /* - * Sign extend the edited stack. - * Note that thread.pc and thread.pc will stay - * 32-bit wide and context switch must take care - * of NEFF sign extension. - */ - - se = childregs->regs[15]; - se = (se & NEFF_SIGN) ? (se | NEFF_MASK) : se; - childregs->regs[15] = se; - return 0; } |