diff options
| author | Richard Henderson <rth@redhat.com> | 2003-06-20 16:24:36 +0000 |
|---|---|---|
| committer | Richard Henderson <rth@redhat.com> | 2003-06-20 16:24:36 +0000 |
| commit | c795f356aa16ac1ee7962909c0f0a0b03ca2af11 (patch) | |
| tree | dcf4bec20ecb8cc2136b676f62505d97e36974e8 | |
| parent | c99b6d97a9a1c4737ef076f7dcc7afe0ae2b821a (diff) | |
| download | glibc-c795f356aa16ac1ee7962909c0f0a0b03ca2af11.tar.xz glibc-c795f356aa16ac1ee7962909c0f0a0b03ca2af11.zip | |
* sysdeps/unix/alpha/sysdep.h (INLINE_SYSCALL1): Use __builtin_expect. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_ST_INO_64_BIT) Unset for alpha. (__ASSUME_TIMEVAL64): Set for alpha. * sysdeps/unix/sysv/linux/alpha/Makefile (sysdep_routines): Remove adjtimex, osf_sigprocmask, old_adjtimex. * sysdeps/unix/sysv/linux/alpha/adjtime.c: Use INLINE_SYSCALL, __ASSUME_TIMEVAL64. Reorg tv64 functions to avoid uninit variable. * sysdeps/unix/sysv/linux/alpha/getitimer.S: Use __ASSUME_TIMEVAL64. * sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise. * sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise. * sysdeps/unix/sysv/linux/alpha/select.S: Likewise. * sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise. * sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise. * sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise. * sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise. * sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Streamline PIC code sequence. * sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise. * sysdeps/unix/sysv/linux/alpha/sigaction.c: New file. * sysdeps/unix/sysv/linux/alpha/sigprocmask.c: Use INLINE_SYSCALL. * sysdeps/unix/sysv/linux/alpha/ustat.c: Likewise. * sysdeps/unix/sysv/linux/alpha/xmknod.c: Likewise. * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove osf_sigprocmask, sys_ustat, sys_mknod, adjtimex, old_adjtimex. * sysdeps/unix/sysv/linux/alpha/sysdep.h (INLINE_SYSCALL): Don't defer to __syscall_name; error for rt_sigaction. * sysdeps/unix/sysv/linux/alpha/xstatconv.c: Include kernel_stat.h.
2003-06-20 Richard Henderson <rth@redhat.com>
* sysdeps/unix/alpha/sysdep.h (INLINE_SYSCALL1): Use __builtin_expect.
* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_ST_INO_64_BIT)
Unset for alpha.
(__ASSUME_TIMEVAL64): Set for alpha.
* sysdeps/unix/sysv/linux/alpha/Makefile (sysdep_routines): Remove
adjtimex, osf_sigprocmask, old_adjtimex.
* sysdeps/unix/sysv/linux/alpha/adjtime.c: Use INLINE_SYSCALL,
__ASSUME_TIMEVAL64. Reorg tv64 functions to avoid uninit variable.
* sysdeps/unix/sysv/linux/alpha/getitimer.S: Use __ASSUME_TIMEVAL64.
* sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/select.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Streamline
PIC code sequence.
* sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/sigaction.c: New file.
* sysdeps/unix/sysv/linux/alpha/sigprocmask.c: Use INLINE_SYSCALL.
* sysdeps/unix/sysv/linux/alpha/ustat.c: Likewise.
* sysdeps/unix/sysv/linux/alpha/xmknod.c: Likewise.
* sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove osf_sigprocmask,
sys_ustat, sys_mknod, adjtimex, old_adjtimex.
* sysdeps/unix/sysv/linux/alpha/sysdep.h (INLINE_SYSCALL): Don't
defer to __syscall_name; error for rt_sigaction.
* sysdeps/unix/sysv/linux/alpha/xstatconv.c: Include kernel_stat.h.
22 files changed, 279 insertions, 143 deletions
@@ -1,3 +1,34 @@ +2003-06-20 Richard Henderson <rth@redhat.com> + + * sysdeps/unix/alpha/sysdep.h (INLINE_SYSCALL1): Use __builtin_expect. + * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_ST_INO_64_BIT) + Unset for alpha. + (__ASSUME_TIMEVAL64): Set for alpha. + * sysdeps/unix/sysv/linux/alpha/Makefile (sysdep_routines): Remove + adjtimex, osf_sigprocmask, old_adjtimex. + * sysdeps/unix/sysv/linux/alpha/adjtime.c: Use INLINE_SYSCALL, + __ASSUME_TIMEVAL64. Reorg tv64 functions to avoid uninit variable. + * sysdeps/unix/sysv/linux/alpha/getitimer.S: Use __ASSUME_TIMEVAL64. + * sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/select.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Streamline + PIC code sequence. + * sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/sigaction.c: New file. + * sysdeps/unix/sysv/linux/alpha/sigprocmask.c: Use INLINE_SYSCALL. + * sysdeps/unix/sysv/linux/alpha/ustat.c: Likewise. + * sysdeps/unix/sysv/linux/alpha/xmknod.c: Likewise. + * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove osf_sigprocmask, + sys_ustat, sys_mknod, adjtimex, old_adjtimex. + * sysdeps/unix/sysv/linux/alpha/sysdep.h (INLINE_SYSCALL): Don't + defer to __syscall_name; error for rt_sigaction. + * sysdeps/unix/sysv/linux/alpha/xstatconv.c: Include kernel_stat.h. + 2003-06-18 Ulrich Drepper <drepper@redhat.com> * malloc/malloc.c (public_mALLINFo): Initialize malloc if it diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h index 6e55061515..b9bc1c0a2a 100644 --- a/sysdeps/unix/alpha/sysdep.h +++ b/sysdeps/unix/alpha/sysdep.h @@ -152,7 +152,7 @@ __LABEL(name) \ ({ \ long _sc_ret, _sc_err; \ inline_syscall##nr(name, args); \ - if (_sc_err) \ + if (__builtin_expect (_sc_err, 0)) \ { \ __set_errno (_sc_ret); \ _sc_ret = -1L; \ diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile index 62536ae1ae..6ec49760b4 100644 --- a/sysdeps/unix/sysv/linux/alpha/Makefile +++ b/sysdeps/unix/sysv/linux/alpha/Makefile @@ -6,12 +6,12 @@ ifeq ($(subdir),misc) sysdep_headers += alpha/ptrace.h alpha/regdef.h sys/io.h sysdep_routines += ieee_get_fp_control ieee_set_fp_control \ - ioperm osf_sigprocmask llseek adjtimex + ioperm llseek # Support old timeval32 entry points sysdep_routines += osf_select osf_gettimeofday osf_settimeofday \ osf_getitimer osf_setitimer osf_utimes \ - osf_getrusage osf_wait4 old_adjtimex + osf_getrusage osf_wait4 # Support old ipc control sysdep_routines += oldmsgctl oldsemctl oldshmctl diff --git a/sysdeps/unix/sysv/linux/alpha/adjtime.c b/sysdeps/unix/sysv/linux/alpha/adjtime.c index 34df942257..69f63d4c32 100644 --- a/sysdeps/unix/sysv/linux/alpha/adjtime.c +++ b/sysdeps/unix/sysv/linux/alpha/adjtime.c @@ -17,7 +17,11 @@ 02111-1307 USA. */ #include <shlib-compat.h> +#include <sysdep.h> +#include <sys/time.h> +#include "kernel-features.h" +#if !defined __ASSUME_TIMEVAL64 || SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) struct timeval32 { int tv_sec, tv_usec; @@ -55,7 +59,7 @@ struct timex32 { #define TIMEVAL timeval32 #define TIMEX timex32 #define ADJTIME __adjtime_tv32 -#define ADJTIMEX(x) __adjtimex_tv32 (x) +#define ADJTIMEX(x) INLINE_SYSCALL (old_adjtimex, 1, x) #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) #define LINKAGE #else @@ -63,13 +67,18 @@ struct timex32 { #endif LINKAGE int ADJTIME (const struct TIMEVAL *itv, struct TIMEVAL *otv); -extern int ADJTIMEX (struct TIMEX *); #include <sysdeps/unix/sysv/linux/adjtime.c> #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) +int __adjtimex_tv32 (struct timex32 *tx) { return ADJTIMEX (tx); } +strong_alias (__adjtimex_tv32, __adjtimex_tv32_1); +strong_alias (__adjtimex_tv32, __adjtimex_tv32_2); +compat_symbol (libc, __adjtimex_tv32_1, __adjtimex, GLIBC_2_0); +compat_symbol (libc, __adjtimex_tv32_2, adjtimex, GLIBC_2_0); compat_symbol (libc, __adjtime_tv32, adjtime, GLIBC_2_0); #endif +#endif /* !__ASSUME_TIMEVAL64 || SHLIB_COMPAT */ #undef TIMEVAL #define TIMEVAL timeval @@ -78,34 +87,38 @@ compat_symbol (libc, __adjtime_tv32, adjtime, GLIBC_2_0); #undef ADJTIME #define ADJTIME __adjtime_tv64 #undef ADJTIMEX -#define ADJTIMEX(x) __syscall_adjtimex_tv64 (x) +#define ADJTIMEX(x) INLINE_SYSCALL (adjtimex, 1, x) #undef LINKAGE #define LINKAGE static LINKAGE int ADJTIME (const struct TIMEVAL *itv, struct TIMEVAL *otv); -extern int ADJTIMEX (struct TIMEX *); #include <sysdeps/unix/sysv/linux/adjtime.c> -static int missing_adjtimex = 0; +#include <stdbool.h> + +#if !defined __ASSUME_TIMEVAL64 +static bool missing_adjtimex; int __adjtime (itv, otv) const struct timeval *itv; struct timeval *otv; { + struct timeval32 itv32, otv32; int ret; - if (!missing_adjtimex) + switch (missing_adjtimex) { + case false: ret = __adjtime_tv64 (itv, otv); if (ret && errno == ENOSYS) missing_adjtimex = 1; - } + else + break; - if (missing_adjtimex) - { - struct timeval32 itv32, otv32; + /* FALLTHRU */ + default: itv32.tv_sec = itv->tv_sec; itv32.tv_usec = itv->tv_usec; ret = __adjtime_tv32 (&itv32, &otv32); @@ -114,31 +127,38 @@ __adjtime (itv, otv) otv->tv_sec = otv32.tv_sec; otv->tv_usec = otv32.tv_usec; } + break; } return ret; } +#else +strong_alias (__adjtime_tv64, __adjtime); +#endif versioned_symbol (libc, __adjtime, adjtime, GLIBC_2_1); -extern int __syscall_adjtimex_tv64 (struct timex *tx); - int __adjtimex_tv64 (struct timex *tx) { +#if defined __ASSUME_TIMEVAL64 + return ADJTIMEX (tx); +#else + struct timex32 tx32; int ret; - if (!missing_adjtimex) - { - ret = __syscall_adjtimex_tv64 (tx); - if (ret && errno == ENOSYS) + switch (missing_adjtimex) + { + case false: + ret = ADJTIMEX (tx); + if (ret && errno == ENOSYS) missing_adjtimex = 1; - } + else + break; - if (missing_adjtimex) - { - struct timex32 tx32; + /* FALLTHRU */ + default: tx32.modes = tx->modes; tx32.offset = tx->offset; tx32.freq = tx->freq; @@ -184,9 +204,11 @@ __adjtimex_tv64 (struct timex *tx) tx->errcnt = tx32.errcnt; tx->stbcnt = tx32.stbcnt; } + break; } return ret; +#endif } strong_alias (__adjtimex_tv64, __adjtimex_internal); diff --git a/sysdeps/unix/sysv/linux/alpha/getitimer.S b/sysdeps/unix/sysv/linux/alpha/getitimer.S index 543256272c..c2bc565afc 100644 --- a/sysdeps/unix/sysv/linux/alpha/getitimer.S +++ b/sysdeps/unix/sysv/linux/alpha/getitimer.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1998 Free Software Foundation, Inc. +/* Copyright (C) 1998, 2003 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 @@ -19,7 +19,21 @@ #include <sysdep.h> #define _ERRNO_H 1 #include <bits/errno.h> +#include "kernel-features.h" +.text + +#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING +#define GETITIMER __getitimer_tv64 +#else +#define GETITIMER getitimer +#endif + +#if defined __ASSUME_TIMEVAL64 +PSEUDO(GETITIMER, getitimer, 2) + ret +PSEUDO_END(GETITIMER) +#else /* The problem here is that initially we made struct timeval compatible with OSF/1, using int32. But we defined time_t with uint64, and later found that POSIX requires tv_sec to be time_t. @@ -30,14 +44,6 @@ functions which have RT equivalents. */ .comm __libc_missing_axp_tv64, 4 -.text - -#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING -#define GETITIMER __getitimer_tv64 -#else -#define GETITIMER getitimer -#endif - LEAF(GETITIMER, 16) ldgp gp, 0(pv) subq sp, 16, sp @@ -100,6 +106,7 @@ $error: SYSCALL_ERROR_HANDLER END(GETITIMER) +#endif /* __ASSUME_TIMEVAL64 */ #if defined HAVE_ELF && defined PIC && defined DO_VERSIONING default_symbol_version (__getitimer_tv64, getitimer, GLIBC_2.1) diff --git a/sysdeps/unix/sysv/linux/alpha/getrusage.S b/sysdeps/unix/sysv/linux/alpha/getrusage.S index dd3eced775..2c34e98ce6 100644 --- a/sysdeps/unix/sysv/linux/alpha/getrusage.S +++ b/sysdeps/unix/sysv/linux/alpha/getrusage.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1998 Free Software Foundation, Inc. +/* Copyright (C) 1998, 2003 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 @@ -19,7 +19,21 @@ #include <sysdep.h> #define _ERRNO_H 1 #include <bits/errno.h> +#include "kernel-features.h" +.text + +#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING +#define GETRUSAGE __getrusage_tv64 +#else +#define GETRUSAGE __getrusage +#endif + +#if defined __ASSUME_TIMEVAL64 +PSEUDO(GETRUSAGE, getrusage, 2) + ret +PSEUDO_END(GETRUSAGE) +#else /* The problem here is that initially we made struct timeval compatible with OSF/1, using int32. But we defined time_t with uint64, and later found that POSIX requires tv_sec to be time_t. @@ -30,14 +44,6 @@ functions which have RT equivalents. */ .comm __libc_missing_axp_tv64, 4 -.text - -#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING -#define GETRUSAGE __getrusage_tv64 -#else -#define GETRUSAGE __getrusage -#endif - LEAF(GETRUSAGE, 16) ldgp gp, 0(pv) subq sp, 16, sp @@ -132,6 +138,7 @@ $error: SYSCALL_ERROR_HANDLER END(GETRUSAGE) +#endif /* __ASSUME_TIMEVAL64 */ #if defined HAVE_ELF && defined PIC && defined DO_VERSIONING strong_alias(__getrusage_tv64, ____getrusage_tv64) diff --git a/sysdeps/unix/sysv/linux/alpha/gettimeofday.S b/sysdeps/unix/sysv/linux/alpha/gettimeofday.S index 221a113dcd..1a6f88b03a 100644 --- a/sysdeps/unix/sysv/linux/alpha/gettimeofday.S +++ b/sysdeps/unix/sysv/linux/alpha/gettimeofday.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1998, 2002, 2003 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 @@ -19,6 +19,21 @@ #include <sysdep.h> #define _ERRNO_H 1 #include <bits/errno.h> +#include "kernel-features.h" + +.text + +#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING +#define GETTIMEOFDAY __gettimeofday_tv64 +#else +#define GETTIMEOFDAY __gettimeofday +#endif + +#if defined __ASSUME_TIMEVAL64 +PSEUDO(GETTIMEOFDAY, gettimeofday, 2) + ret +PSEUDO_END(GETTIMEOFDAY) +#else /* The problem here is that initially we made struct timeval compatible with OSF/1, using int32. But we defined time_t with uint64, and later found @@ -30,14 +45,6 @@ functions which have RT equivalents. */ .comm __libc_missing_axp_tv64, 4 -.text - -#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING -#define GETTIMEOFDAY __gettimeofday_tv64 -#else -#define GETTIMEOFDAY __gettimeofday -#endif - LEAF(GETTIMEOFDAY, 16) ldgp gp, 0(pv) subq sp, 16, sp @@ -97,6 +104,7 @@ $error: SYSCALL_ERROR_HANDLER END(GETTIMEOFDAY) +#endif /* __ASSUME_TIMEVAL64 */ #if defined HAVE_ELF && defined PIC && defined DO_VERSIONING default_symbol_version (__gettimeofday_tv64, __gettimeofday, GLIBC_2.1) diff --git a/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S b/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S index 89e08b3dc9..f436a52437 100644 --- a/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S +++ b/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1996, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger <davidm@azstarnet.com>, 1995. @@ -32,9 +32,13 @@ LEAF(__ieee_get_fp_control, 16) jsr AT, (AT), _mcount .set at .prologue 1 -#else +#elif defined PIC lda sp, -16(sp) .prologue 0 +#else + ldgp gp, 0(pv) + lda sp, -16(sp) + .prologue 1 #endif mov sp, a1 @@ -48,10 +52,6 @@ LEAF(__ieee_get_fp_control, 16) ret $error: -#ifndef PROF - br gp, 1f -1: ldgp gp, 0(gp) -#endif lda sp, 16(sp) SYSCALL_ERROR_HANDLER diff --git a/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S b/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S index dc1bbbb962..54762e1d23 100644 --- a/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S +++ b/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1996, 1997, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger <davidm@azstarnet.com>, 1995. @@ -30,9 +30,13 @@ LEAF(__ieee_set_fp_control, 16) jsr AT, (AT), _mcount .set at .prologue 1 -#else +#elif defined PIC lda sp, -16(sp) .prologue 0 +#else + ldgp gp, 0(pv) + lda sp, -16(sp) + .prologue 1 #endif stq a0, 0(sp) @@ -47,10 +51,6 @@ LEAF(__ieee_set_fp_control, 16) ret $error: -#ifndef PROF - br gp, 1f -1: ldgp gp, 0(gp) -#endif lda sp, 16(sp) SYSCALL_ERROR_HANDLER diff --git a/sysdeps/unix/sysv/linux/alpha/select.S b/sysdeps/unix/sysv/linux/alpha/select.S index 9cfd63ff93..4a0594cbe9 100644 --- a/sysdeps/unix/sysv/linux/alpha/select.S +++ b/sysdeps/unix/sysv/linux/alpha/select.S @@ -19,7 +19,21 @@ #include <sysdep-cancel.h> #define _ERRNO_H 1 #include <bits/errno.h> +#include "kernel-features.h" +.text + +#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING +#define SELECT __select_tv64 +#else +#define SELECT __select +#endif + +#if defined __ASSUME_TIMEVAL64 +PSEUDO(SELECT, select, 5) + ret +PSEUDO_END(SELECT) +#else /* Th |
