1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
2003-07-14  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/kernel-features.h: Define
	__ASSUME_TGKILL for Alpha appropriately.
This commit is contained in:
Ulrich Drepper
2003-07-14 21:16:43 +00:00
parent 9291eb491f
commit b1b060c341
5 changed files with 36 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2003-07-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/kernel-features.h: Define
__ASSUME_TGKILL for Alpha appropriately.
2003-07-12 Ulrich Drepper <drepper@redhat.com> 2003-07-12 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/bits/statfs.h (_STATFS_F_FRSIZE): Define. * sysdeps/unix/sysv/linux/bits/statfs.h (_STATFS_F_FRSIZE): Define.

View File

@ -36,7 +36,7 @@ __futimes (int fd, const struct timeval tvp[2])
static const char selffd[] = "/proc/self/fd/"; static const char selffd[] = "/proc/self/fd/";
char fname[sizeof (selffd) + 3 * sizeof (int)]; char fname[sizeof (selffd) + 3 * sizeof (int)];
fname[sizeof (fname) - 1] = '\0'; fname[sizeof (fname) - 1] = '\0';
char *cp = _itoa_word (fd, fname + sizeof (fname) - 1, 10, 0); char *cp = _itoa_word ((unsigned int) fd, fname + sizeof (fname) - 1, 10, 0);
cp = memcpy (cp - sizeof (selffd) + 1, selffd, sizeof (selffd) - 1); cp = memcpy (cp - sizeof (selffd) + 1, selffd, sizeof (selffd) - 1);
#ifdef __NR_utimes #ifdef __NR_utimes

View File

@ -234,6 +234,12 @@
# define __ASSUME_NEW_PRCTL_SYSCALL 1 # define __ASSUME_NEW_PRCTL_SYSCALL 1
#endif #endif
/* Starting with 2.4.21 the PowerPC32 clone syscall works as expected. */
#if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc__ \
&& !defined __powerpc64__
# define __ASSUME_FIXED_CLONE_SYSCALL 1
#endif
/* Starting with 2.4.21 PowerPC64 implements the new rt_sigreturn syscall. /* Starting with 2.4.21 PowerPC64 implements the new rt_sigreturn syscall.
The new rt_sigreturn takes an ucontext pointer allowing rt_sigreturn The new rt_sigreturn takes an ucontext pointer allowing rt_sigreturn
to be used in the set/swapcontext implementation. */ to be used in the set/swapcontext implementation. */
@ -341,8 +347,11 @@
# define __ASSUME_CORRECT_SI_PID 1 # define __ASSUME_CORRECT_SI_PID 1
#endif #endif
/* The tgkill syscall was instroduced for i386 in 2.5.75. */ /* The tgkill syscall was instroduced for i386 in 2.5.75. For Alpha
#if __LINUX_KERNEL_VERSION >= 132427 && defined __i386__ it was introduced in 2.6.0-test1 which unfortunately cannot be
distinguished from 2.6.0. */
#if (__LINUX_KERNEL_VERSION >= 132427 && defined __i386__) \
|| (__LINUX_KERNEL_VERSION >= 132609 && defined __alpha__) \
# define __ASSUME_TGKILL 1 # define __ASSUME_TGKILL 1
#endif #endif

View File

@ -20,6 +20,7 @@
#include <sysdep.h> #include <sysdep.h>
#define _ERRNO_H 1 #define _ERRNO_H 1
#include <bits/errno.h> #include <bits/errno.h>
#include <kernel-features.h>
#include <bp-sym.h> #include <bp-sym.h>
#include <bp-asm.h> #include <bp-asm.h>
@ -44,7 +45,11 @@ ENTRY (BP_SYM (__clone))
/* Set up stack frame for parent. */ /* Set up stack frame for parent. */
stwu r1,-32(r1) stwu r1,-32(r1)
#ifndef __ASSUME_FIXED_CLONE_SYSCALL
stmw r29,16(r1) stmw r29,16(r1)
#else
stmw r30,16(r1)
#endif
/* Set up stack frame for child. */ /* Set up stack frame for child. */
clrrwi r4,r4,4 clrrwi r4,r4,4
@ -52,8 +57,10 @@ ENTRY (BP_SYM (__clone))
stwu r0,-16(r4) stwu r0,-16(r4)
/* Save fn, args, stack across syscall. */ /* Save fn, args, stack across syscall. */
mr r29,r3 /* Function in r29. */ mr r30,r3 /* Function in r30. */
mr r30,r4 /* Stack pointer in r30. */ #ifndef __ASSUME_FIXED_CLONE_SYSCALL
mr r29,r4 /* Stack pointer in r29. */
#endif
mr r31,r6 /* Argument in r31. */ mr r31,r6 /* Argument in r31. */
/* 'flags' argument is first parameter to clone syscall. (The other /* 'flags' argument is first parameter to clone syscall. (The other
@ -73,13 +80,16 @@ ENTRY (BP_SYM (__clone))
crandc cr1*4+eq,cr1*4+eq,cr0*4+so crandc cr1*4+eq,cr1*4+eq,cr0*4+so
bne- cr1,L(parent) /* The '-' is to minimise the race. */ bne- cr1,L(parent) /* The '-' is to minimise the race. */
#ifndef __ASSUME_FIXED_CLONE_SYSCALL
/* On at least mklinux DR3a5, clone() doesn't actually change /* On at least mklinux DR3a5, clone() doesn't actually change
the stack pointer. I'm pretty sure this is a bug, because the stack pointer. I'm pretty sure this is a bug, because
it adds a race condition if a signal is sent to a thread it adds a race condition if a signal is sent to a thread
just after it is created (in the previous three instructions). */ just after it is created (in the previous three instructions). */
mr r1,r30 mr r1,r29
#endif
/* Call procedure. */ /* Call procedure. */
mtctr r29 mtctr r30
mr r3,r31 mr r3,r31
bctrl bctrl
/* Call _exit with result from procedure. */ /* Call _exit with result from procedure. */
@ -87,7 +97,11 @@ ENTRY (BP_SYM (__clone))
L(parent): L(parent):
/* Parent. Restore registers & return. */ /* Parent. Restore registers & return. */
#ifndef __ASSUME_FIXED_CLONE_SYSCALL
lmw r29,16(r1) lmw r29,16(r1)
#else
lmw r30,16(r1)
#endif
addi r1,r1,32 addi r1,r1,32
bnslr+ bnslr+
b JUMPTARGET(__syscall_error) b JUMPTARGET(__syscall_error)

View File

@ -20,6 +20,7 @@
#include <stddef.h> #include <stddef.h>
#include <utime.h> #include <utime.h>
#include <sys/time.h> #include <sys/time.h>
#include <sysdep.h>
#include "kernel-features.h" #include "kernel-features.h"