aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2014-09-25 16:53:03 -0400
committerChris Metcalf <cmetcalf@tilera.com>2014-10-06 11:21:29 -0400
commit83d641efd1f6eb699dd846b9e99af7bcff7e063e (patch)
tree23a5d44f49a7a7ba647fc57030900f84a2d5760a /sysdeps
parentd9cd52e64d7b6b0fd56566de87c826cb6fe3677d (diff)
tile: make the prolog of clone() more conformant
With this change we properly set up the frame first, and tear it down last, doing argument checking only when the frame is set up.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/tile/clone.S11
1 files changed, 6 insertions, 5 deletions
diff --git a/sysdeps/unix/sysv/linux/tile/clone.S b/sysdeps/unix/sysv/linux/tile/clone.S
index f48dba523c..0e109f849e 100644
--- a/sysdeps/unix/sysv/linux/tile/clone.S
+++ b/sysdeps/unix/sysv/linux/tile/clone.S
@@ -41,10 +41,6 @@
.text
ENTRY (__clone)
- /* sanity check arguments */
- BEQZ r0, .Linvalid
- BEQZ r1, .Linvalid
-
/* Create a stack frame so we can pass callee-saves to new task. */
{
move r10, sp
@@ -71,6 +67,10 @@ ENTRY (__clone)
ST r11, r32
cfi_offset (r32, FRAME_R32 - FRAME_SIZE)
+ /* sanity check arguments */
+ BEQZ r0, .Linvalid
+ BEQZ r1, .Linvalid
+
/* Make sure child stack is properly aligned, and set up the
top frame so that we can call out of it immediately in the
child. Setting it up here means we fault in the parent if
@@ -120,6 +120,7 @@ ENTRY (__clone)
swint1
BEQZ r0, .Lthread_start /* If in child task. */
+.Ldone:
/* Restore the callee-saved registers and return. */
ADDLI_PTR lr, sp, FRAME_SIZE
{
@@ -149,7 +150,7 @@ ENTRY (__clone)
.Linvalid:
{
movei r1, EINVAL
- j SYSCALL_ERROR_NAME
+ j .Ldone
}
/* This function expects to receive: