? fsyscall-libc.diff ? nptl ? nptl_db Index: sysdeps/unix/sysv/linux/dl-osinfo.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/dl-osinfo.h,v retrieving revision 1.13 diff -u -w -r1.13 dl-osinfo.h --- sysdeps/unix/sysv/linux/dl-osinfo.h 1 Dec 2002 22:14:40 -0000 1.13 +++ sysdeps/unix/sysv/linux/dl-osinfo.h 9 Apr 2003 02:10:20 -0000 @@ -53,9 +53,12 @@ int parts; \ char *cp; \ struct utsname uts; \ + int uname_err; \ \ - /* Try the uname syscall */ \ - if (__uname (&uts)) \ + /* use an inline call incase TLS isn't setup and something \ + like fast syscalls are in use */ \ + INTERNAL_SYSCALL(uname,uname_err,1,&uts); \ + if ( uname_err ) \ { \ /* This was not successful. Now try reading the /proc \ filesystem. */ \ Index: sysdeps/unix/sysv/linux/ia64/clone2.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/clone2.S,v retrieving revision 1.7 diff -u -w -r1.7 clone2.S --- sysdeps/unix/sysv/linux/ia64/clone2.S 13 Mar 2003 04:36:59 -0000 1.7 +++ sysdeps/unix/sysv/linux/ia64/clone2.S 9 Apr 2003 02:10:20 -0000 @@ -25,18 +25,16 @@ /* size_t child_stack_size, int flags, void *arg, */ /* pid_t *parent_tid, void *tls, pid_t *child_tid) */ +#define CHILD p8 +#define PARENT p9 + ENTRY(__clone2) - alloc r2=ar.pfs,8,2,6,0 + .prologue + alloc r2=ar.pfs,8,3,6,0 cmp.eq p6,p0=0,in0 mov r8=EINVAL (p6) br.cond.spnt.few __syscall_error ;; - flushrs /* This is necessary, since the child */ - /* will be running with the same */ - /* register backing store for a few */ - /* instructions. We need to ensure */ - /* that it will not read or write the */ - /* backing store. */ mov loc0=in0 /* save fn */ mov loc1=in4 /* save arg */ mov out0=in3 /* Flags are first syscall argument. */ @@ -45,14 +43,30 @@ mov out3=in5 /* Parent TID Pointer */ mov out4=in7 /* Child TID Pointer */ mov out5=in6 /* TLS pointer */ - DO_CALL (SYS_ify (clone2)) - cmp.eq p6,p0=-1,r10 + /* + * clone2() is special: the child cannot execute br.ret right after + * the system call returns, because it starts out executing on an + * empty stack. Because of this, we can't use the new (lightweight) + * syscall convention here. Instead, we just fall back on always + * using "break". + */ + mov r15=SYS_ify (clone2) + /* + * The child will start with an empty stack. To avoid unwinding + * past invalid memory, we'll pretend now that __clone2() is + * the end of the call-chain. This is wrong for the parent, but + * only until it returns from clone2() but it's better than the + * alternative. + */ + mov b7=r0 + .prologue + .altrp b7 + .body + break __BREAK_SYSCALL ;; -(p6) br.cond.spnt.few __syscall_error - -# define CHILD p6 -# define PARENT p7 cmp.eq CHILD,PARENT=0,r8 /* Are we the child? */ + cmp.eq p6,p0=-1,r10 +(p6) br.cond.spnt.few __syscall_error ;; (CHILD) ld8 out1=[loc0],8 /* Retrieve code pointer. */ (CHILD) mov out0=loc1 /* Pass proper argument to fn */ @@ -60,7 +74,6 @@ ;; ld8 gp=[loc0] /* Load function gp. */ mov b6=out1 - ;; br.call.dptk.few rp=b6 /* Call fn(arg) in the child */ ;; mov out0=r8 /* Argument to _exit */ Index: sysdeps/unix/sysv/linux/ia64/sysdep.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/sysdep.h,v retrieving revision 1.14 diff -u -w -r1.14 sysdep.h --- sysdeps/unix/sysv/linux/ia64/sysdep.h 24 Mar 2003 07:54:28 -0000 1.14 +++ sysdeps/unix/sysv/linux/ia64/sysdep.h 9 Apr 2003 02:10:20 -0000 @@ -24,6 +24,8 @@ #include #include +#include + /* For Linux we can use the system call table in the header file /usr/include/asm/unistd.h of the kernel. But these symbols do not follow the SYS_* syntax @@ -89,9 +91,30 @@ cmp.eq p6,p0=-1,r10; \ (p6) br.cond.spnt.few __syscall_error; +#if defined HAVE_TLS_SUPPORT && (!defined NOT_IN_libc || defined IS_IN_libpthread) + +/* Use the lightweight stub only if (a) we have a suitably modern + thread-control block (HAVE_TLS_SUPPORT) and (b) we're not compiling + the runtime loader (which might do syscalls before being fully + relocated). */ + +#define DO_CALL(num) \ + .prologue; \ + adds r2 = SYSINFO_OFFSET, r13;; \ + ld8 r2 = [r2]; \ + .save ar.pfs, r11; \ + mov r11 = ar.pfs;; \ + .body; \ + mov r15 = num; \ + mov b7 = r2; \ + br.call.sptk.many b6 = b7;; \ + .restore sp; \ + mov ar.pfs = r11 +#else #define DO_CALL(num) \ mov r15=num; \ break __BREAK_SYSCALL; +#endif #undef PSEUDO_END #define PSEUDO_END(name) .endp C_SYMBOL_NAME(name); Index: sysdeps/unix/sysv/linux/ia64/vfork.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/vfork.S,v retrieving revision 1.4 diff -u -w -r1.4 vfork.S --- sysdeps/unix/sysv/linux/ia64/vfork.S 31 Dec 2002 20:37:30 -0000 1.4 +++ sysdeps/unix/sysv/linux/ia64/vfork.S 9 Apr 2003 02:10:20 -0000 @@ -34,9 +34,13 @@ mov out0=CLONE_VM+CLONE_VFORK+SIGCHLD mov out1=0 /* Standard sp value. */ ;; +#if 0 DO_CALL (SYS_ify (clone)) +#else + mov r15=SYS_ify(clone) + break __BREAK_SYSCALL +#endif cmp.eq p6,p0=-1,r10 - ;; (p6) br.cond.spnt.few __syscall_error ret PSEUDO_END(__vfork)