summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/powerpc/powerpc64
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-08-12 09:19:19 -0700
committerUlrich Drepper <drepper@redhat.com>2010-08-12 09:19:19 -0700
commitbebff237c522e4e8e23204ca1e5104896389158e (patch)
treea4edee831e0476277cc372a46fa8281ab0bc229a /sysdeps/unix/sysv/linux/powerpc/powerpc64
parent026373745eab50a683536d950cb7e17dc98c4259 (diff)
downloadglibc-bebff237c522e4e8e23204ca1e5104896389158e.tar.gz
PowerPC64 ABI fixes
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/powerpc64')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S73
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S39
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S2
5 files changed, 67 insertions, 55 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
index f2ac00d4c7..ef574c14fc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
@@ -32,19 +32,16 @@ ENTRY (BP_SYM (__brk))
CALL_MCOUNT 1
DISCARD_BOUNDS (r3) /* the bounds are meaningless, so toss 'em. */
- stdu r1,-64(r1)
- cfi_adjust_cfa_offset (64)
std r3,48(r1)
DO_CALL(SYS_ify(brk))
- ld r6,48(r1)
+ ld r6,48(r1)
ld r5,.LC__curbrk@toc(r2)
std r3,0(r5)
cmpld r6,r3
- addi r1,r1,64
li r3,0
blelr+
li r3,ENOMEM
- b JUMPTARGET(__syscall_error)
+ TAIL_CALL_SYSCALL_ERROR
END (BP_SYM (__brk))
weak_alias (BP_SYM (__brk), BP_SYM (brk))
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))
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
index 4a82802d96..18baa39d6a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
@@ -154,6 +154,7 @@ L(BADSTATUS):
b JUMPTARGET(__GI_exit);
#else
b JUMPTARGET(exit);
+ nop
#endif
/* The address of the exit code is in the link register. Store the lr
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
index 15d8e84c1f..a0ae11594a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
@@ -39,8 +39,6 @@
#define NARGS 3
#endif
-#define stackblock 80 /* offset to socket parm area. */
-
#ifndef __socket
# ifndef NO_WEAK_ALIAS
# define __socket P(__,socket)
@@ -49,11 +47,14 @@
# endif
#endif
+#define FRAMESIZE 128
+#define stackblock FRAMESIZE+48 /* offset to parm save area. */
+
.text
ENTRY(__socket)
CALL_MCOUNT NARGS
- stdu r1,-144(r1)
- cfi_adjust_cfa_offset(144)
+ stdu r1,-FRAMESIZE(r1)
+ cfi_adjust_cfa_offset(FRAMESIZE)
#if NARGS >= 1
std r3,stackblock(r1)
#endif
@@ -87,33 +88,39 @@ ENTRY(__socket)
bne- .Lsocket_cancel
#endif
- li r3,P(SOCKOP_,socket)
+ li r3,P(SOCKOP_,socket)
addi r4,r1,stackblock
DO_CALL(SYS_ify(socketcall))
- addi r1,r1,144
+ addi r1,r1,FRAMESIZE
+ cfi_adjust_cfa_offset(-FRAMESIZE)
PSEUDO_RET
#if defined NEED_CANCELLATION && defined CENABLE
.Lsocket_cancel:
+ cfi_adjust_cfa_offset(FRAMESIZE)
mflr r9
- std r9,144+16(r1)
+ std r9,FRAMESIZE+16(r1)
cfi_offset (lr, 16)
CENABLE
- std r3,72(r1)
- li r3,P(SOCKOP_,socket)
+ std r3,120(r1)
+ li r3,P(SOCKOP_,socket)
addi r4,r1,stackblock
DO_CALL(SYS_ify(socketcall))
mfcr r0
- std r3,64(r1)
- std r0,8(r1)
- ld r3,72(r1)
+ std r3,112(r1)
+ std r0,FRAMESIZE+8(r1)
+ cfi_offset (cr, 8)
+ ld r3,120(r1)
CDISABLE
- ld r4,144+16(r1)
- ld r0,8(r1)
- ld r3,64(r1)
+ ld r4,FRAMESIZE+16(r1)
+ ld r0,FRAMESIZE+8(r1)
+ ld r3,112(r1)
mtlr r4
mtcr r0
- addi r1,r1,144
+ addi r1,r1,FRAMESIZE
+ cfi_adjust_cfa_offset(-FRAMESIZE)
+ cfi_restore(lr)
+ cfi_restore(cr)
PSEUDO_RET
#endif
PSEUDO_END (__socket)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
index 2f5df38cf8..14d0c2bf10 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
@@ -39,7 +39,7 @@ ENTRY (__vfork)
bnslr+
/* Check if vfork syscall is known at all. */
cmpdi r3,ENOSYS
- bne JUMPTARGET(__syscall_error)
+ bne .Local_syscall_error
# endif
#endif