summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-12-08 10:52:16 +0000
committerJakub Jelinek <jakub@redhat.com>2004-12-08 10:52:16 +0000
commitff4eb01a424875d6ff9183c4f4f42d17743fee77 (patch)
tree7e50d614a494a6d9bc1988dcab754a46e600d079 /sysdeps
parent2f533068b94ea0c6be63545b62b2597bc1bffcfc (diff)
Updated to fedora-glibc-20041208T1024
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/posix/sysconf.c9
-rw-r--r--sysdeps/unix/sysv/linux/ia64/clone2.S11
-rw-r--r--sysdeps/unix/sysv/linux/sh/clone.S39
3 files changed, 52 insertions, 7 deletions
diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c
index 9e5d569a81..cdd1fe9636 100644
--- a/sysdeps/posix/sysconf.c
+++ b/sysdeps/posix/sysconf.c
@@ -34,7 +34,14 @@
#include <regex.h>
+#define NEED_CHECK_SPEC \
+ (!defined _XBS5_ILP32_OFF32 || !defined _XBS5_ILP32_OFFBIG \
+ || !defined _XBS5_LP64_OFF64 || !defined _XBS5_LPBIG_OFFBIG \
+ || !defined _POSIX_V6_ILP32_OFF32 || !defined _POSIX_V6_ILP32_OFFBIG \
+ || !defined _POSIX_V6_LP64_OFF64 || !defined _POSIX_V6_LPBIG_OFFBIG)
+#if NEED_CHECK_SPEC
static long int __sysconf_check_spec (const char *spec);
+#endif
/* Get the value of the system variable NAME. */
@@ -1210,6 +1217,7 @@ __sysconf (name)
weak_alias (__sysconf, sysconf)
libc_hidden_def (__sysconf)
+#if NEED_CHECK_SPEC
static long int
__sysconf_check_spec (const char *spec)
{
@@ -1230,3 +1238,4 @@ __sysconf_check_spec (const char *spec)
__set_errno (save_errno);
return ret;
}
+#endif
diff --git a/sysdeps/unix/sysv/linux/ia64/clone2.S b/sysdeps/unix/sysv/linux/ia64/clone2.S
index 136bb5591a..69c9e05044 100644
--- a/sysdeps/unix/sysv/linux/ia64/clone2.S
+++ b/sysdeps/unix/sysv/linux/ia64/clone2.S
@@ -30,7 +30,7 @@
ENTRY(__clone2)
.prologue
- alloc r2=ar.pfs,8,0,6,0
+ alloc r2=ar.pfs,8,1,6,0
cmp.eq p6,p0=0,in0
mov r8=EINVAL
mov out0=in3 /* Flags are first syscall argument. */
@@ -63,8 +63,7 @@ ENTRY(__clone2)
cmp.eq CHILD,PARENT=0,r8 /* Are we the child? */
(p6) br.cond.spnt.many __syscall_error
;;
-(CHILD) ld8 out1=[in0],8 /* Retrieve code pointer. */
-(CHILD) mov out0=in4 /* Pass proper argument to fn */
+(CHILD) mov loc0=gp
(PARENT) ret
;;
#ifdef RESET_PID
@@ -83,11 +82,15 @@ ENTRY(__clone2)
st4 [r10]=r8
;;
#endif
-1: ld8 gp=[in0] /* Load function gp. */
+1: ld8 out1=[in0],8 /* Retrieve code pointer. */
+ mov out0=in4 /* Pass proper argument to fn */
+ ;;
+ ld8 gp=[in0] /* Load function gp. */
mov b6=out1
br.call.dptk.many rp=b6 /* Call fn(arg) in the child */
;;
mov out0=r8 /* Argument to _exit */
+ mov gp=loc0
.globl HIDDEN_JUMPTARGET(_exit)
br.call.dpnt.many rp=HIDDEN_JUMPTARGET(_exit)
/* call _exit with result from fn. */
diff --git a/sysdeps/unix/sysv/linux/sh/clone.S b/sysdeps/unix/sysv/linux/sh/clone.S
index 713b0f9c3b..7941c6b3ad 100644
--- a/sysdeps/unix/sysv/linux/sh/clone.S
+++ b/sysdeps/unix/sysv/linux/sh/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,11 +22,13 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-
+#ifdef RESET_PID
+#include <tcb-offsets.h>
+#endif
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
pid_t *ptid, void *tls, pid_t *ctid); */
- .text
+ .text
ENTRY(__clone)
/* sanity check arguments. */
tst r4, r4
@@ -64,6 +66,31 @@ ENTRY(__clone)
rts
nop
2:
+ /* terminate the stack frame */
+ mov #0, r14
+#ifdef RESET_PID
+ mov r4, r0
+ shlr16 r0
+ tst #1, r0 // CLONE_THREAD = (1 << 16)
+ bf/s 4f
+ mov r4, r0
+ /* new pid */
+ shlr8 r0
+ tst #1, r0 // CLONE_VM = (1 << 8)
+ bf/s 3f
+ mov #-1, r0
+ mov #+SYS_ify(getpid), r3
+ trapa #0x15
+3:
+ stc gbr, r1
+ mov.w .Lpidoff, r2
+ add r1, r2
+ mov.l r0, @r2
+ mov.w .Ltidoff, r2
+ add r1, r2
+ mov.l r0, @r2
+4:
+#endif
/* thread starts */
mov.l @r15, r1
jsr @r1
@@ -94,6 +121,12 @@ ENTRY(__clone)
.long _GLOBAL_OFFSET_TABLE_
.L3:
.long PLTJMP(C_SYMBOL_NAME(_exit))
+#ifdef RESET_PID
+.Lpidoff:
+ .word PID - TLS_PRE_TCB_SIZE
+.Ltidoff:
+ .word TID - TLS_PRE_TCB_SIZE
+#endif
PSEUDO_END (__clone)
weak_alias (__clone, clone)