diff options
author | Alan Modra <amodra@gmail.com> | 2010-08-12 09:19:19 -0700 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2010-08-12 09:19:19 -0700 |
commit | bebff237c522e4e8e23204ca1e5104896389158e (patch) | |
tree | a4edee831e0476277cc372a46fa8281ab0bc229a /sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S | |
parent | 026373745eab50a683536d950cb7e17dc98c4259 (diff) | |
download | glibc-bebff237c522e4e8e23204ca1e5104896389158e.tar glibc-bebff237c522e4e8e23204ca1e5104896389158e.tar.gz glibc-bebff237c522e4e8e23204ca1e5104896389158e.tar.bz2 glibc-bebff237c522e4e8e23204ca1e5104896389158e.zip |
PowerPC64 ABI fixes
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S')
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S | 73 |
1 files changed, 40 insertions, 33 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S index f1a55e64db..d14da54fd7 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S @@ -46,35 +46,32 @@ ENTRY (BP_SYM (__clone)) cror cr0*4+eq,cr1*4+eq,cr0*4+eq beq- cr0,L(badargs) - /* Set up stack frame for parent. */ - stdu r1,-80(r1) - cfi_adjust_cfa_offset (80) - std r29,56(r1) - std r30,64(r1) - std r31,72(r1) - cfi_offset(r29,-56) - cfi_offset(r30,-64) - cfi_offset(r31,-72) + /* Save some regs in parm save area. */ #ifdef RESET_PID - std r28,48(r1) - cfi_offset(r28,-48) + std r29,48(r1) #endif + std r30,56(r1) + std r31,64(r1) +#ifdef RESET_PID + cfi_offset(r29,48) +#endif + cfi_offset(r30,56) + cfi_offset(r31,64) /* Set up stack frame for child. */ clrrdi r4,r4,4 li r0,0 - stdu r0,-48(r4) /* min stack frame is 48 bytes per ABI */ + stdu r0,-112(r4) /* min stack frame is 112 bytes per ABI */ /* Save fn, args, stack across syscall. */ - mr r29,r3 /* Function in r29. */ - mr r30,r4 /* Stack pointer in r30. */ + mr r30,r3 /* Function in r30. */ #ifdef RESET_PID - mr r28,r5 /* Flags in r28. */ + mr r29,r5 /* Flags in r29. */ #endif mr r31,r6 /* Argument in r31. */ - /* 'flags' argument is first parameter to clone syscall. (The other - argument is the stack pointer, already in r4.) */ + /* 'flags' argument is first parameter to clone syscall. + Second is the stack pointer, already in r4. */ mr r3,r5 /* Move the parent_tid, child_tid and tls arguments. */ mr r5,r7 @@ -94,9 +91,9 @@ ENTRY (BP_SYM (__clone)) bne- cr1,L(parent) /* The '-' is to minimise the race. */ #ifdef RESET_PID - andis. r0,r28,CLONE_THREAD>>16 + andis. r0,r29,CLONE_THREAD>>16 bne+ cr0,L(oldpid) - andi. r0,r28,CLONE_VM + andi. r0,r29,CLONE_VM li r3,-1 bne- cr0,L(nomoregetpid) DO_CALL(SYS_ify(getpid)) @@ -108,8 +105,8 @@ L(oldpid): std r2,40(r1) /* Call procedure. */ - ld r0,0(r29) - ld r2,8(r29) + ld r0,0(r30) + ld r2,8(r30) mtctr r0 mr r3,r31 bctrl @@ -119,25 +116,35 @@ L(oldpid): b JUMPTARGET(__GI__exit) #else b JUMPTARGET(_exit) + /* We won't ever get here but provide a nop so that the linker + will insert a toc adjusting stub if necessary. */ + nop #endif +L(badargs): + cfi_startproc + li r3,EINVAL + TAIL_CALL_SYSCALL_ERROR + L(parent): /* Parent. Restore registers & return. */ #ifdef RESET_PID - ld r28,48(r1) + cfi_offset(r29,48) #endif - ld r31,72(r1) - ld r30,64(r1) - ld r29,56(r1) - addi r1,r1,80 - bnslr+ - b JUMPTARGET(__syscall_error) - -L(badargs): - li r3,EINVAL - b JUMPTARGET(__syscall_error) + cfi_offset(r30,56) + cfi_offset(r31,64) +#ifdef RESET_PID + ld r29,48(r1) +#endif + ld r30,56(r1) + ld r31,64(r1) +#ifdef RESET_PID + cfi_restore(r29) +#endif + cfi_restore(r30) + cfi_restore(r31) + PSEUDO_RET - cfi_startproc END (BP_SYM (__clone)) weak_alias (BP_SYM (__clone), BP_SYM (clone)) |