From cf22c5c9b3a4a6cc81a269d49d2324b5df084d74 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 18 Feb 2009 15:49:44 +0000 Subject: Updated to fedora-glibc-20090218T1534 --- sysdeps/i386/bits/link.h | 4 +- sysdeps/i386/i486/bits/atomic.h | 31 +++++--- sysdeps/ia64/bits/link.h | 4 +- sysdeps/posix/sysconf.c | 31 +++++++- sysdeps/powerpc/bits/link.h | 6 +- sysdeps/s390/bits/link.h | 4 +- sysdeps/sh/bits/link.h | 4 +- sysdeps/sh/sh4/__longjmp.S | 7 +- sysdeps/sh/sh4/dl-trampoline.S | 4 +- sysdeps/sh/sh4/setjmp.S | 4 +- sysdeps/sparc/bits/link.h | 6 +- sysdeps/unix/opendir.c | 40 ++++------ sysdeps/unix/sysv/linux/getsysstats.c | 85 +++++++++++++++----- sysdeps/unix/sysv/linux/i386/bits/environments.h | 24 +++--- sysdeps/unix/sysv/linux/i386/sys/io.h | 90 +++++++++++---------- sysdeps/unix/sysv/linux/lddlibc4.c | 20 ++++- sysdeps/unix/sysv/linux/ldsodefs.h | 22 +++++- .../unix/sysv/linux/powerpc/bits/environments.h | 28 ++++--- sysdeps/unix/sysv/linux/s390/bits/environments.h | 28 ++++--- sysdeps/unix/sysv/linux/sh/sh4/getcontext.S | 6 +- sysdeps/unix/sysv/linux/sh/sh4/register-dump.h | 20 ++--- sysdeps/unix/sysv/linux/sh/sh4/setcontext.S | 6 +- sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S | 12 ++- sysdeps/unix/sysv/linux/sparc/bits/environments.h | 28 ++++--- sysdeps/unix/sysv/linux/sparc/bits/siginfo.h | 4 + sysdeps/unix/sysv/linux/sparc/getsysstats.c | 9 ++- sysdeps/unix/sysv/linux/sparc/sys/eventfd.h | 4 +- sysdeps/unix/sysv/linux/sys/eventfd.h | 4 +- sysdeps/unix/sysv/linux/x86_64/bits/environments.h | 28 ++++--- sysdeps/unix/sysv/linux/x86_64/sys/io.h | 92 +++++++++++----------- sysdeps/x86_64/bits/atomic.h | 36 +++++---- sysdeps/x86_64/bits/link.h | 4 +- 32 files changed, 445 insertions(+), 250 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/i386/bits/link.h b/sysdeps/i386/bits/link.h index 985d040413..4df5f795e3 100644 --- a/sysdeps/i386/bits/link.h +++ b/sysdeps/i386/bits/link.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2005, 2009 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 @@ -55,6 +55,6 @@ extern unsigned int la_i86_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, uintptr_t *__defcook, const La_i86_regs *__inregs, La_i86_retval *__outregs, - const char *symname); + const char *__symname); __END_DECLS diff --git a/sysdeps/i386/i486/bits/atomic.h b/sysdeps/i386/i486/bits/atomic.h index 21eea7112c..4ee6fef692 100644 --- a/sysdeps/i386/i486/bits/atomic.h +++ b/sysdeps/i386/i486/bits/atomic.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -500,24 +500,34 @@ typedef uintmax_t uatomic_max_t; #define atomic_delay() asm ("rep; nop") -#define atomic_and(mem, mask) \ +#define __arch_and_body(lock, mem, mask) \ do { \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "andb %b1, %0" \ + __asm __volatile (lock "andb %b1, %0" \ : "=m" (*mem) \ - : "iq" (mask), "m" (*mem)); \ + : "iq" (mask), "m" (*mem), \ + "i" (offsetof (tcbhead_t, multiple_threads))); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "andw %w1, %0" \ + __asm __volatile (lock "andw %w1, %0" \ : "=m" (*mem) \ - : "ir" (mask), "m" (*mem)); \ + : "ir" (mask), "m" (*mem), \ + "i" (offsetof (tcbhead_t, multiple_threads))); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "andl %1, %0" \ + __asm __volatile (lock "andl %1, %0" \ : "=m" (*mem) \ - : "ir" (mask), "m" (*mem)); \ + : "ir" (mask), "m" (*mem), \ + "i" (offsetof (tcbhead_t, multiple_threads))); \ else \ abort (); \ } while (0) +#define __arch_cprefix \ + "cmpl $0, %%gs:%P3\n\tje 0f\n\tlock\n0:\t" + +#define atomic_and(mem, mask) __arch_and_body (LOCK_PREFIX, mem, mask) + +#define catomic_and(mem, mask) __arch_and_body (__arch_cprefix, mem, mask) + #define __arch_or_body(lock, mem, mask) \ do { \ @@ -542,7 +552,4 @@ typedef uintmax_t uatomic_max_t; #define atomic_or(mem, mask) __arch_or_body (LOCK_PREFIX, mem, mask) -#define __arch_or_cprefix \ - "cmpl $0, %%gs:%P3\n\tje 0f\n\tlock\n0:\t" - -#define catomic_or(mem, mask) __arch_or_body (__arch_or_cprefix, mem, mask) +#define catomic_or(mem, mask) __arch_or_body (__arch_cprefix, mem, mask) diff --git a/sysdeps/ia64/bits/link.h b/sysdeps/ia64/bits/link.h index f751c23fd1..f522ab340b 100644 --- a/sysdeps/ia64/bits/link.h +++ b/sysdeps/ia64/bits/link.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2009 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 @@ -58,6 +58,6 @@ extern unsigned int la_ia64_gnu_pltexit (Elf64_Sym *__sym, unsigned int __ndx, uintptr_t *__defcook, const La_ia64_regs *__inregs, La_ia64_retval *__outregs, - const char *symname); + const char *__symname); __END_DECLS diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c index 0c0d7d1418..f1d1ee4417 100644 --- a/sysdeps/posix/sysconf.c +++ b/sysdeps/posix/sysconf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,1993,1995-1997,1999-2003,2004,2006 +/* Copyright (C) 1991,1993,1995-1997,1999-2003,2004,2006,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -38,7 +38,9 @@ (!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) + || !defined _POSIX_V6_LP64_OFF64 || !defined _POSIX_V6_LPBIG_OFFBIG \ + || !defined _POSIX_V7_ILP32_OFF32 || !defined _POSIX_V7_ILP32_OFFBIG \ + || !defined _POSIX_V7_LP64_OFF64 || !defined _POSIX_V7_LPBIG_OFFBIG) #if NEED_CHECK_SPEC static long int __sysconf_check_spec (const char *spec); #endif @@ -840,6 +842,31 @@ __sysconf (name) return __sysconf_check_spec ("LPBIG_OFFBIG"); #endif + case _SC_V7_ILP32_OFF32: +#ifdef _POSIX_V7_ILP32_OFF32 + return _POSIX_V7_ILP32_OFF32; +#else + return __sysconf_check_spec ("ILP32_OFF32"); +#endif + case _SC_V7_ILP32_OFFBIG: +#ifdef _POSIX_V7_ILP32_OFFBIG + return _POSIX_V7_ILP32_OFFBIG; +#else + return __sysconf_check_spec ("ILP32_OFFBIG"); +#endif + case _SC_V7_LP64_OFF64: +#ifdef _POSIX_V7_LP64_OFF64 + return _POSIX_V7_LP64_OFF64; +#else + return __sysconf_check_spec ("LP64_OFF64"); +#endif + case _SC_V7_LPBIG_OFFBIG: +#ifdef _POSIX_V7_LPBIG_OFFBIG + return _POSIX_V7_LPBIG_OFFBIG; +#else + return __sysconf_check_spec ("LPBIG_OFFBIG"); +#endif + case _SC_XOPEN_LEGACY: return _XOPEN_LEGACY; diff --git a/sysdeps/powerpc/bits/link.h b/sysdeps/powerpc/bits/link.h index 6c6f6042a1..24baba09c4 100644 --- a/sysdeps/powerpc/bits/link.h +++ b/sysdeps/powerpc/bits/link.h @@ -1,5 +1,5 @@ /* Machine-specific declarations for dynamic linker interface. PowerPC version - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2009 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 @@ -60,7 +60,7 @@ extern unsigned int la_ppc32_gnu_pltexit (Elf32_Sym *__sym, uintptr_t *__defcook, const La_ppc32_regs *__inregs, La_ppc32_retval *__outregs, - const char *symname); + const char *__symname); __END_DECLS @@ -104,7 +104,7 @@ extern unsigned int la_ppc64_gnu_pltexit (Elf64_Sym *__sym, uintptr_t *__defcook, const La_ppc64_regs *__inregs, La_ppc64_retval *__outregs, - const char *symname); + const char *__symname); __END_DECLS diff --git a/sysdeps/s390/bits/link.h b/sysdeps/s390/bits/link.h index 70f0043820..bb6f54664c 100644 --- a/sysdeps/s390/bits/link.h +++ b/sysdeps/s390/bits/link.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2009 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 @@ -104,7 +104,7 @@ extern unsigned int la_s390_64_gnu_pltexit (Elf64_Sym *__sym, uintptr_t *__defcook, const La_s390_64_regs *__inregs, La_s390_64_retval *__outregs, - const char *symname); + const char *__symname); __END_DECLS diff --git a/sysdeps/sh/bits/link.h b/sysdeps/sh/bits/link.h index 2826677336..f650aa302e 100644 --- a/sysdeps/sh/bits/link.h +++ b/sysdeps/sh/bits/link.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2009 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 @@ -65,6 +65,6 @@ extern unsigned int la_sh_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, uintptr_t *__defcook, const La_sh_regs *__inregs, La_sh_retval *__outregs, - const char *symname); + const char *__symname); __END_DECLS diff --git a/sysdeps/sh/sh4/__longjmp.S b/sysdeps/sh/sh4/__longjmp.S index 320a7d11f7..2fd137bcba 100644 --- a/sysdeps/sh/sh4/__longjmp.S +++ b/sysdeps/sh/sh4/__longjmp.S @@ -1,5 +1,5 @@ /* longjmp for SH. - Copyright (C) 1999, 2000, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2005, 2006, 2009 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 @@ -52,6 +52,7 @@ ENTRY (__longjmp) mov.l @r4+, r15 lds.l @r4+, pr #endif +#ifdef __SH_FPU_ANY__ ldc.l @r4+, gbr lds.l @r4+, fpscr fmov.s @r4+, fr12 @@ -59,4 +60,8 @@ ENTRY (__longjmp) fmov.s @r4+, fr14 rts fmov.s @r4+, fr15 +#else + rts + ldc.l @r4+, gbr +#endif /* !__SH_FPU_ANY__ */ END (__longjmp) diff --git a/sysdeps/sh/sh4/dl-trampoline.S b/sysdeps/sh/sh4/dl-trampoline.S index f9529851a1..bd9bb7e5bd 100644 --- a/sysdeps/sh/sh4/dl-trampoline.S +++ b/sysdeps/sh/sh4/dl-trampoline.S @@ -1,2 +1,4 @@ -#define HAVE_FPU +#ifdef __SH_FPU_ANY__ +# define HAVE_FPU +#endif #include diff --git a/sysdeps/sh/sh4/setjmp.S b/sysdeps/sh/sh4/setjmp.S index f9a4f0a8ce..03f0b08dcd 100644 --- a/sysdeps/sh/sh4/setjmp.S +++ b/sysdeps/sh/sh4/setjmp.S @@ -1,5 +1,5 @@ /* setjmp for SH4. - Copyright (C) 1999, 2000, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2005, 2006, 2009 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 @@ -23,11 +23,13 @@ ENTRY (__sigsetjmp) /* Save registers */ add #JB_SIZE, r4 +#ifdef __SH_FPU_ANY__ fmov.s fr15, @-r4 fmov.s fr14, @-r4 fmov.s fr13, @-r4 fmov.s fr12, @-r4 sts.l fpscr, @-r4 +#endif /* __SH_FPU_ANY__ */ stc.l gbr, @-r4 #ifdef PTR_MANGLE sts pr, r2 diff --git a/sysdeps/sparc/bits/link.h b/sysdeps/sparc/bits/link.h index 9b8434f56f..e0550e84ac 100644 --- a/sysdeps/sparc/bits/link.h +++ b/sysdeps/sparc/bits/link.h @@ -1,5 +1,5 @@ /* Machine-specific audit interfaces for dynamic linker. SPARC version. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2009 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 @@ -75,7 +75,7 @@ extern unsigned int la_sparc32_gnu_pltexit (Elf32_Sym *__sym, uintptr_t *__defcook, const La_sparc32_regs *__inregs, La_sparc32_retval *__outregs, - const char *symname); + const char *__symname); #else @@ -93,7 +93,7 @@ extern unsigned int la_sparc64_gnu_pltexit (Elf64_Sym *__sym, uintptr_t *__defcook, const La_sparc64_regs *__inregs, La_sparc64_retval *__outregs, - const char *symname); + const char *__symname); #endif diff --git a/sysdeps/unix/opendir.c b/sysdeps/unix/opendir.c index 92029c6547..fbf14f5eec 100644 --- a/sysdeps/unix/opendir.c +++ b/sysdeps/unix/opendir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1996,98,2000-2003,2005,2007 +/* Copyright (C) 1991-1996,98,2000-2003,2005,2007,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -81,6 +81,7 @@ DIR * __opendir (const char *name) { struct stat64 statbuf; + struct stat64 *statp = NULL; if (__builtin_expect (name[0], '\1') == '\0') { @@ -119,16 +120,14 @@ __opendir (const char *name) if (__builtin_expect (fd, 0) < 0) return NULL; - /* Now make sure this really is a directory and nothing changed since - the `stat' call. We do not have to perform the test for the - descriptor being associated with a directory if we know the - O_DIRECTORY flag is honored by the kernel. */ - if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0) - goto lose; #ifdef O_DIRECTORY if (o_directory_works <= 0) #endif { + /* Now make sure this really is a directory and nothing changed since + the `stat' call. */ + if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0) + goto lose; if (__builtin_expect (! S_ISDIR (statbuf.st_mode), 0)) { __set_errno (ENOTDIR); @@ -136,9 +135,10 @@ __opendir (const char *name) close_not_cancel_no_status (fd); return NULL; } + statp = &statbuf; } - return __alloc_dir (fd, true, &statbuf); + return __alloc_dir (fd, true, statp); } weak_alias (__opendir, opendir) @@ -171,29 +171,23 @@ __alloc_dir (int fd, bool close_fd, const struct stat64 *statp) goto lose; } - const size_t default_allocation = (BUFSIZ < sizeof (struct dirent64) - ? sizeof (struct dirent64) : BUFSIZ); - size_t allocation; + const size_t default_allocation = (4 * BUFSIZ < sizeof (struct dirent64) + ? sizeof (struct dirent64) : 4 * BUFSIZ); + const size_t small_allocation = (BUFSIZ < sizeof (struct dirent64) + ? sizeof (struct dirent64) : BUFSIZ); + size_t allocation = default_allocation; #ifdef _STATBUF_ST_BLKSIZE - if (__builtin_expect ((size_t) statp->st_blksize >= sizeof (struct dirent64), - 1)) + if (statp != NULL && default_allocation < statp->st_blksize) allocation = statp->st_blksize; - else #endif - allocation = default_allocation; DIR *dirp = (DIR *) malloc (sizeof (DIR) + allocation); if (dirp == NULL) { -#ifdef _STATBUF_ST_BLKSIZE - if (allocation == statp->st_blksize - && allocation != default_allocation) - { - allocation = default_allocation; - dirp = (DIR *) malloc (sizeof (DIR) + allocation); - } + allocation = small_allocation; + dirp = (DIR *) malloc (sizeof (DIR) + allocation); + if (dirp == NULL) -#endif lose: { if (close_fd) diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c index 6d4c9c06e8..28f52c0463 100644 --- a/sysdeps/unix/sysv/linux/getsysstats.c +++ b/sysdeps/unix/sysv/linux/getsysstats.c @@ -1,5 +1,5 @@ /* Determine various system internal values, Linux version. - Copyright (C) 1996-2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 1996-2003, 2006, 2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -49,10 +49,13 @@ But not all systems have support for the /proc filesystem. If it is not available we simply return 1 since there is no way. */ +#include + + /* Other architectures use different formats for /proc/cpuinfo. This provides a hook for alternative parsers. */ #ifndef GET_NPROCS_PARSER -# define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \ +# define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT) \ do \ { \ (RESULT) = 0; \ @@ -60,45 +63,89 @@ "processor". We don't have to fear extremely long lines since \ the kernel will not generate them. 8192 bytes are really \ enough. */ \ - while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \ - if (strncmp (BUFFER, "processor", 9) == 0) \ + char *l; \ + while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL) \ + if (strncmp (l, "processor", 9) == 0) \ ++(RESULT); \ } \ while (0) #endif +static char * +next_line (int fd, char *const buffer, char **cp, char **re, + char *const buffer_end) +{ + char *res = *cp; + char *nl = memchr (*cp, '\n', *re - *cp); + if (nl == NULL) + { + if (*cp != buffer) + { + if (*re == buffer_end) + { + memmove (buffer, *cp, *re - *cp); + *re = buffer + (*re - *cp); + *cp = buffer; + + ssize_t n = read_not_cancel (fd, *re, buffer_end - *re); + if (n < 0) + return NULL; + + *re += n; + } + + res = *cp; + nl = memchr (*cp, '\n', *re - *cp); + } + + if (nl == NULL) + nl = *re - 1; + } + + *cp = nl + 1; + assert (*cp <= *re); + + return res == *re ? NULL : res; +} + + int __get_nprocs () { /* XXX Here will come a test for the new system call. */ char buffer[8192]; + char *const buffer_end = buffer + sizeof (buffer); + char *cp = buffer_end; + char *re = buffer_end; int result = 1; +#ifdef O_CLOEXEC + const int flags = O_RDONLY | O_CLOEXEC; +#else + const int flags = O_RDONLY; +#endif /* The /proc/stat format is more uniform, use it by default. */ - FILE *fp = fopen ("/proc/stat", "rc"); - if (fp != NULL) + int fd = open_not_cancel_2 ("/proc/stat", flags); + if (fd != -1) { - /* No threads use this stream. */ - __fsetlocking (fp, FSETLOCKING_BYCALLER); - result = 0; - while (fgets_unlocked (buffer, sizeof (buffer), fp) != NULL) - if (strncmp (buffer, "cpu", 3) == 0 && isdigit (buffer[3])) + + char *l; + while ((l = next_line (fd, buffer, &cp, &re, buffer_end)) != NULL) + if (strncmp (l, "cpu", 3) == 0 && isdigit (l[3])) ++result; - fclose (fp); + close_not_cancel_no_status (fd); } else { - fp = fopen ("/proc/cpuinfo", "rc"); - if (fp != NULL) + fd = open_not_cancel_2 ("/proc/cpuinfo", flags); + if (fd != -1) { - /* No threads use this stream. */ - __fsetlocking (fp, FSETLOCKING_BYCALLER); - GET_NPROCS_PARSER (fp, buffer, result); - fclose (fp); + GET_NPROCS_PARSER (fd, buffer, cp, re, buffer_end, result); + close_not_cancel_no_status (fd); } } @@ -141,7 +188,7 @@ __get_nprocs_conf () #ifdef GET_NPROCS_CONF_PARSER /* If we haven't found an appropriate entry return 1. */ - FILE *fp = fopen ("/proc/cpuinfo", "rc"); + FILE *fp = fopen ("/proc/cpuinfo", "rce"); if (fp != NULL) { char buffer[8192]; diff --git a/sysdeps/unix/sysv/linux/i386/bits/environments.h b/sysdeps/unix/sysv/linux/i386/bits/environments.h index 16f7732aad..785dd7e8fa 100644 --- a/sysdeps/unix/sysv/linux/i386/bits/environments.h +++ b/sysdeps/unix/sysv/linux/i386/bits/environments.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2001, 2004, 2009 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 @@ -25,29 +25,35 @@ `-1' means it is never supported. Undefined means it cannot be statically decided. - _POSIX_V6_ILP32_OFF32 32bit int, long, pointers, and off_t type - _POSIX_V6_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type + _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type + _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type - _POSIX_V6_LP64_OFF32 64bit long and pointers and 32bit off_t type - _POSIX_V6_LPBIG_OFFBIG 64bit long and pointers and large off_t type + _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type + _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type - The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and - _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard - and are available only for compatibility. + The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, + _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, + _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were + used in previous versions of the Unix standard and are available + only for compatibility. */ /* By default we have 32-bit wide `int', `long int', pointers and `off_t' and all platforms support LFS. */ +#define _POSIX_V7_ILP32_OFF32 1 +#define _POSIX_V7_ILP32_OFFBIG 1 #define _POSIX_V6_ILP32_OFF32 1 #define _POSIX_V6_ILP32_OFFBIG 1 #define _XBS5_ILP32_OFF32 1 #define _XBS5_ILP32_OFFBIG 1 /* We optionally provide an environment with the above size but an 64-bit - side `off_t'. Therefore we don't define _XBS5_ILP32_OFFBIG. */ + side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ /* Environments with 64-bit wide pointers can be provided, so these macros aren't defined: + # undef _POSIX_V7_LP64_OFF64 + # undef _POSIX_V7_LPBIG_OFFBIG # undef _POSIX_V6_LP64_OFF64 # undef _POSIX_V6_LPBIG_OFFBIG # undef _XBS5_LP64_OFF64 diff --git a/sysdeps/unix/sysv/linux/i386/sys/io.h b/sysdeps/unix/sysv/linux/i386/sys/io.h index 39a7877f7e..128c2caac7 100644 --- a/sysdeps/unix/sysv/linux/i386/sys/io.h +++ b/sysdeps/unix/sysv/linux/i386/sys/io.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1996, 2000, 2009 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 @@ -41,138 +41,142 @@ extern int iopl (int __level) __THROW; #if defined __GNUC__ && __GNUC__ >= 2 static __inline unsigned char -inb (unsigned short int port) +inb (unsigned short int __port) { unsigned char _v; - __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned char -inb_p (unsigned short int port) +inb_p (unsigned short int __port) { unsigned char _v; - __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned short int -inw (unsigned short int port) +inw (unsigned short int __port) { unsigned short _v; - __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned short int -inw_p (unsigned short int port) +inw_p (unsigned short int __port) { unsigned short int _v; - __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned int -inl (unsigned short int port) +inl (unsigned short int __port) { unsigned int _v; - __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned int -inl_p (unsigned short int port) +inl_p (unsigned short int __port) { unsigned int _v; - __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v) + :"Nd" (__port)); return _v; } static __inline void -outb (unsigned char value, unsigned short int port) +outb (unsigned char value, unsigned short int __port) { - __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port)); + __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (__port)); } static __inline void -outb_p (unsigned char value, unsigned short int port) +outb_p (unsigned char value, unsigned short int __port) { __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value), - "Nd" (port)); + "Nd" (__port)); } static __inline void -outw (unsigned short int value, unsigned short int port) +outw (unsigned short int value, unsigned short int __port) { - __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port)); + __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (__port)); } static __inline void -outw_p (unsigned short int value, unsigned short int port) +outw_p (unsigned short int value, unsigned short int __port) { __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (value), - "Nd" (port)); + "Nd" (__port)); } static __inline void -outl (unsigned int value, unsigned short int port) +outl (unsigned int value, unsigned short int __port) { - __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (port)); + __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (__port)); } static __inline void -outl_p (unsigned int value, unsigned short int port) +outl_p (unsigned int value, unsigned short int __port) { __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (value), - "Nd" (port)); + "Nd" (__port)); } static __inline void -insb (unsigned short int port, void *addr, unsigned long int count) +insb (unsigned short int __port, void *__addr, unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; insb":"=D" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; insb":"=D" (__addr), "=c" (__count) + :"d" (__port), "0" (__addr), "1" (__count)); } static __inline void -insw (unsigned short int port, void *addr, unsigned long int count) +insw (unsigned short int __port, void *__addr, unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; insw":"=D" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; insw":"=D" (__addr), "=c" (__count) + :"d" (__port), "0" (__addr), "1" (__count)); } static __inline void -insl (unsigned short int port, void *addr, unsigned long int count) +insl (unsigned short int __port, void *__addr, unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; insl":"=D" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; insl":"=D" (__addr), "=c" (__count) + :"d" (__port), "0" (__addr), "1" (__count)); } static __inline void -outsb (unsigned short int port, const void *addr, unsigned long int count) +outsb (unsigned short int __port, const void *__addr, + unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (__addr), "=c" (__count) + :"d" (__port), "0" (__addr), "1" (__count)); } static __inline void -outsw (unsigned short int port, const void *addr, unsigned long int count) +outsw (unsigned short int __port, const void *__addr, + unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (__addr), "=c" (__count) + :"d" (__port), "0" (__addr), "1" (__count)); } static __inline void -outsl (unsigned short int port, const void *addr, unsigned long int count) +outsl (unsigned short int __port, const void *__addr, + unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (__addr), "=c" (__count) + :"d" (__port), "0" (__addr), "1" (__count)); } #endif /* GNU C */ diff --git a/sysdeps/unix/sysv/linux/lddlibc4.c b/sysdeps/unix/sysv/linux/lddlibc4.c index 7683ec2efd..694d1291cd 100644 --- a/sysdeps/unix/sysv/linux/lddlibc4.c +++ b/sysdeps/unix/sysv/linux/lddlibc4.c @@ -1,5 +1,5 @@ /* Stub for ldd script to print Linux libc4 dependencies. - Copyright (C) 1998, 2005 Free Software Foundation, Inc. + Copyright (C) 1998, 2005, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. @@ -56,6 +56,24 @@ main (int argc, char *argv[]) if (argc != 2) return 1; + if (strcmp (argv[1], "--help") == 0) + { + printf (gettext ("Usage: lddlibc4 FILE\n\n")); + printf (gettext ("For bug reporting instructions, please see:\n\ +.\n")); + return 0; + } + else if (strcmp (argv[1], "--version") == 0) + { + printf ("lddlibc4 (GNU %s) %s\n", PACKAGE, VERSION); + printf (gettext ("\ +Copyright (C) %s Free Software Foundation, Inc.\n\ +This is free software; see the source for copying conditions. There is NO\n\ +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ +"), "2009"); + return 0; + } + filename = argv[1]; /* First see whether this is really an a.out binary. */ diff --git a/sysdeps/unix/sysv/linux/ldsodefs.h b/sysdeps/unix/sysv/linux/ldsodefs.h index 0bdca3c3fd..0965f1496f 100644 --- a/sysdeps/unix/sysv/linux/ldsodefs.h +++ b/sysdeps/unix/sysv/linux/ldsodefs.h @@ -1,5 +1,5 @@ /* Run-time dynamic linker data structures for loaded ELF shared objects. - Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2006, 2009 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 @@ -53,4 +53,24 @@ extern void _dl_non_dynamic_init (void) internal_function; # define HAVE_AUX_PAGESIZE #endif +/* Accept binaries which identify the binary as using Linux extensions. */ +#define VALID_ELF_HEADER(hdr,exp,size) (memcmp (hdr, exp, size) == 0 \ + || memcmp (hdr, expected2, size) == 0) +#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \ + || osabi == ELFOSABI_LINUX) +#define VALID_ELF_ABIVERSION(ver) (ver == 0) +#define MORE_ELF_HEADER_DATA \ + static const unsigned char expected2[EI_PAD] = \ + { \ + [EI_MAG0] = ELFMAG0, \ + [EI_MAG1] = ELFMAG1, \ + [EI_MAG2] = ELFMAG2, \ + [EI_MAG3] = ELFMAG3, \ + [EI_CLASS] = ELFW(CLASS), \ + [EI_DATA] = byteorder, \ + [EI_VERSION] = EV_CURRENT, \ + [EI_OSABI] = ELFOSABI_LINUX, \ + [EI_ABIVERSION] = 0 \ + } + #endif /* ldsodefs.h */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/environments.h b/sysdeps/unix/sysv/linux/powerpc/bits/environments.h index a51a564cbb..c675ecc627 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/environments.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/environments.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2001, 2004, 2009 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 @@ -27,21 +27,25 @@ `-1' means it is never supported. Undefined means it cannot be statically decided. - _POSIX_V6_ILP32_OFF32 32bit int, long, pointers, and off_t type - _POSIX_V6_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type + _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type + _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type - _POSIX_V6_LP64_OFF32 64bit long and pointers and 32bit off_t type - _POSIX_V6_LPBIG_OFFBIG 64bit long and pointers and large off_t type + _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type + _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type - The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and - _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard - and are available only for compatibility. + The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, + _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, + _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were + used in previous versions of the Unix standard and are available + only for compatibility. */ #if __WORDSIZE == 64 /* Environments with 32-bit wide pointers are optionally provided. Therefore following macros aren't defined: + # undef _POSIX_V7_ILP32_OFF32 + # undef _POSIX_V7_ILP32_OFFBIG # undef _POSIX_V6_ILP32_OFF32 # undef _POSIX_V6_ILP32_OFFBIG # undef _XBS5_ILP32_OFF32 @@ -50,10 +54,12 @@ /* We also have no use (for now) for an environment with bigger pointers and offsets. */ +# define _POSIX_V7_LPBIG_OFFBIG -1 # define _POSIX_V6_LPBIG_OFFBIG -1 # define _XBS5_LPBIG_OFFBIG -1 /* By default we have 64-bit wide `long int', pointers and `off_t'. */ +# define _POSIX_V7_LP64_OFF64 1 # define _POSIX_V6_LP64_OFF64 1 # define _XBS5_LP64_OFF64 1 @@ -61,16 +67,20 @@ /* By default we have 32-bit wide `int', `long int', pointers and `off_t' and all platforms support LFS. */ +# define _POSIX_V7_ILP32_OFF32 1 +# define _POSIX_V7_ILP32_OFFBIG 1 # define _POSIX_V6_ILP32_OFF32 1 # define _POSIX_V6_ILP32_OFFBIG 1 # define _XBS5_ILP32_OFF32 1 # define _XBS5_ILP32_OFFBIG 1 /* We optionally provide an environment with the above size but an 64-bit - side `off_t'. Therefore we don't define _XBS5_ILP32_OFFBIG. */ + side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ /* Environments with 64-bit wide pointers can be provided, so these macros aren't defined: + # undef _POSIX_V7_LP64_OFF64 + # undef _POSIX_V7_LPBIG_OFFBIG # undef _POSIX_V6_LP64_OFF64 # undef _POSIX_V6_LPBIG_OFFBIG # undef _XBS5_LP64_OFF64 diff --git a/sysdeps/unix/sysv/linux/s390/bits/environments.h b/sysdeps/unix/sysv/linux/s390/bits/environments.h index 713d21c9a5..29628b2ed4 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/environments.h +++ b/sysdeps/unix/sysv/linux/s390/bits/environments.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2001, 2004, 2009 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 @@ -27,21 +27,25 @@ `-1' means it is never supported. Undefined means it cannot be statically decided. - _POSIX_V6_ILP32_OFF32 32bit int, long, pointers, and off_t type - _POSIX_V6_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type + _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type + _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type - _POSIX_V6_LP64_OFF32 64bit long and pointers and 32bit off_t type - _POSIX_V6_LPBIG_OFFBIG 64bit long and pointers and large off_t type + _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type + _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type - The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and - _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard - and are available only for compatibility. + The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, + _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, + _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were + used in previous versions of the Unix standard and are available + only for compatibility. */ #if __WORDSIZE == 64 /* Environments with 32-bit wide pointers are optionally provided. Therefore following macros aren't defined: + # undef _POSIX_V7_ILP32_OFF32 + # undef _POSIX_V7_ILP32_OFFBIG # undef _POSIX_V6_ILP32_OFF32 # undef _POSIX_V6_ILP32_OFFBIG # undef _XBS5_ILP32_OFF32 @@ -50,10 +54,12 @@ /* We also have no use (for now) for an environment with bigger pointers and offsets. */ +# define _POSIX_V7_LPBIG_OFFBIG -1 # define _POSIX_V6_LPBIG_OFFBIG -1 # define _XBS5_LPBIG_OFFBIG -1 /* By default we have 64-bit wide `long int', pointers and `off_t'. */ +# define _POSIX_V7_LP64_OFF64 1 # define _POSIX_V6_LP64_OFF64 1 # define _XBS5_LP64_OFF64 1 @@ -61,16 +67,20 @@ /* By default we have 32-bit wide `int', `long int', pointers and `off_t' and all platforms support LFS. */ +# define _POSIX_V7_ILP32_OFF32 1 +# define _POSIX_V7_ILP32_OFFBIG 1 # define _POSIX_V6_ILP32_OFF32 1 # define _POSIX_V6_ILP32_OFFBIG 1 # define _XBS5_ILP32_OFF32 1 # define _XBS5_ILP32_OFFBIG 1 /* We optionally provide an environment with the above size but an 64-bit - side `off_t'. Therefore we don't define _XBS5_ILP32_OFFBIG. */ + side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ /* Environments with 64-bit wide pointers can be provided, so these macros aren't defined: + # undef _POSIX_V7_LP64_OFF64 + # undef _POSIX_V7_LPBIG_OFFBIG # undef _POSIX_V6_LP64_OFF64 # undef _POSIX_V6_LPBIG_OFFBIG # undef _XBS5_LP64_OFF64 diff --git a/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S b/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S index 68bc235bcf..3432dca5d1 100644 --- a/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S +++ b/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S @@ -1,5 +1,5 @@ /* Save current context. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2009 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 @@ -61,6 +61,7 @@ ENTRY(__getcontext) mov.l r9, @-r0 mov.l r8, @-r0 +#ifdef __SH_FPU_ANY__ mov r4, r0 /* We need 2 add instruction because oFPUL+4 > 127. */ add #124,r0 @@ -101,6 +102,7 @@ ENTRY(__getcontext) fmov.s fr2, @-r0 fmov.s fr1, @-r0 fmov.s fr0, @-r0 +#endif /* __SH_FPU_ANY__ */ /* sigprocmask (SIG_BLOCK, NULL, &uc->uc_sigmask). */ mov r4, r6 @@ -117,7 +119,7 @@ ENTRY(__getcontext) not r1, r1 // r1=0 means r0 = -1 to -4095 tst r1, r1 // i.e. error in linux bf .Lgetcontext_end -.Lsyscall_error: +.Lsyscall_error: SYSCALL_ERROR_HANDLER .Lgetcontext_end: /* All done, return 0 for success. */ diff --git a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h index d09ad2a373..e3c9c0e639 100644 --- a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h +++ b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h @@ -1,5 +1,5 @@ /* Dump registers. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2009 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 @@ -31,15 +31,15 @@ MACL: XXXXXXXX MACH: XXXXXXXX PC: XXXXXXXX PR: XXXXXXXX GBR: XXXXXXXX SR: XXXXXXXX - FR0: XXXXXXXX FR1: XXXXXXXX FR2: XXXXXXXX FR3: XXXXXXXX - FR4: XXXXXXXX FR5: XXXXXXXX FR6: XXXXXXXX FR7: XXXXXXXX - FR8: XXXXXXXX FR9: XXXXXXXX FR10: XXXXXXXX FR11: XXXXXXXX -FR12: XXXXXXXX FR13: XXXXXXXX FR14: XXXXXXXX FR15: XXXXXXXX + FR0: XXXXXXXX FR1: XXXXXXXX FR2: XXXXXXXX FR3: XXXXXXXX + FR4: XXXXXXXX FR5: XXXXXXXX FR6: XXXXXXXX FR7: XXXXXXXX + FR8: XXXXXXXX FR9: XXXXXXXX FR10: XXXXXXXX FR11: XXXXXXXX +FR12: XXXXXXXX FR13: XXXXXXXX FR14: XXXXXXXX FR15: XXXXXXXX - XR0: XXXXXXXX XR1: XXXXXXXX XR2: XXXXXXXX XR3: XXXXXXXX - XR4: XXXXXXXX XR5: XXXXXXXX XR6: XXXXXXXX XR7: XXXXXXXX - XR8: XXXXXXXX XR9: XXXXXXXX XR10: XXXXXXXX XR11: XXXXXXXX -XR12: XXXXXXXX XR13: XXXXXXXX XR14: XXXXXXXX XR15: XXXXXXXX + XR0: XXXXXXXX XR1: XXXXXXXX XR2: XXXXXXXX XR3: XXXXXXXX + XR4: XXXXXXXX XR5: XXXXXXXX XR6: XXXXXXXX XR7: XXXXXXXX + XR8: XXXXXXXX XR9: XXXXXXXX XR10: XXXXXXXX XR11: XXXXXXXX +XR12: XXXXXXXX XR13: XXXXXXXX XR14: XXXXXXXX XR15: XXXXXXXX FPSCR: XXXXXXXX FPUL: XXXXXXXX @@ -144,6 +144,7 @@ register_dump (int fd, struct sigcontext *ctx) ADD_STRING ("\n"); +#ifdef __SH_FPU_ANY__ if (ctx->sc_ownedfp != NULL) { hexvalue (ctx->sc_fpregs[0], fpregs[0], 8); @@ -253,6 +254,7 @@ register_dump (int fd, struct sigcontext *ctx) ADD_STRING ("\n"); } +#endif /* __SH_FPU_ANY__ */ /* Write the stuff out. */ writev (fd, iov, nr); diff --git a/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S b/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S index 2bc546d1a1..48f6d4c721 100644 --- a/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S +++ b/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S @@ -1,5 +1,5 @@ /* Install given context. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2009 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 @@ -43,13 +43,14 @@ ENTRY(__setcontext) not r1, r1 // r1=0 means r0 = -1 to -4095 tst r1, r1 // i.e. error in linux bf .Lsetcontext_restore -.Lsyscall_error: +.Lsyscall_error: SYSCALL_ERROR_HANDLER .Lpseudo_end: rts nop .Lsetcontext_restore: +#ifdef __SH_FPU_ANY__ mov r8, r0 add #(oFR0),r0 fmov.s @r0+, fr0 @@ -88,6 +89,7 @@ ENTRY(__setcontext) frchg lds.l @r0+, fpscr lds.l @r0+, fpul +#endif /* __SH_FPU_ANY__ */ mov r8, r0 add #(oPC), r0 diff --git a/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S b/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S index 1aeca1b1a7..1f1b69baee 100644 --- a/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S +++ b/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S @@ -1,5 +1,5 @@ /* Save current context and install the given one. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2009 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 @@ -61,6 +61,7 @@ ENTRY(__swapcontext) mov.l r9, @-r0 mov.l r8, @-r0 +#ifdef __SH_FPU_ANY__ mov r4, r0 /* We need 2 add instruction because oFPUL+4 >= 127. */ add #124,r0 @@ -101,6 +102,7 @@ ENTRY(__swapcontext) fmov.s fr2, @-r0 fmov.s fr1, @-r0 fmov.s fr0, @-r0 +#endif /* __SH_FPU_ANY__ */ mov r5, r8 @@ -119,12 +121,13 @@ ENTRY(__swapcontext) not r1, r1 // r1=0 means r0 = -1 to -4095 tst r1, r1 // i.e. error in linux bf .Lswapcontext_restore -.Lsyscall_error: +.Lsyscall_error: SYSCALL_ERROR_HANDLER .Lpseudo_end: rts nop -.Lswapcontext_restore: +.Lswapcontext_restore: +#ifdef __SH_FPU_ANY__ mov r8, r0 add #(oFR0),r0 fmov.s @r0+, fr0 @@ -163,6 +166,7 @@ ENTRY(__swapcontext) frchg lds.l @r0+, fpscr lds.l @r0+, fpul +#endif /* __SH_FPU_ANY__ */ mov r8, r0 add #(oPC), r0 @@ -208,7 +212,7 @@ ENTRY(__swapcontext) mov.l @r15+, r0 jmp @r0 mov.l @r15+, r0 - + PSEUDO_END(__swapcontext) weak_alias (__swapcontext, swapcontext) diff --git a/sysdeps/unix/sysv/linux/sparc/bits/environments.h b/sysdeps/unix/sysv/linux/sparc/bits/environments.h index a51a564cbb..c675ecc627 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/environments.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/environments.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2001, 2004, 2009 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 @@ -27,21 +27,25 @@ `-1' means it is never supported. Undefined means it cannot be statically decided. - _POSIX_V6_ILP32_OFF32 32bit int, long, pointers, and off_t type - _POSIX_V6_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type + _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type + _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type - _POSIX_V6_LP64_OFF32 64bit long and pointers and 32bit off_t type - _POSIX_V6_LPBIG_OFFBIG 64bit long and pointers and large off_t type + _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type + _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type - The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and - _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard - and are available only for compatibility. + The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, + _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, + _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were + used in previous versions of the Unix standard and are available + only for compatibility. */ #if __WORDSIZE == 64 /* Environments with 32-bit wide pointers are optionally provided. Therefore following macros aren't defined: + # undef _POSIX_V7_ILP32_OFF32 + # undef _POSIX_V7_ILP32_OFFBIG # undef _POSIX_V6_ILP32_OFF32 # undef _POSIX_V6_ILP32_OFFBIG # undef _XBS5_ILP32_OFF32 @@ -50,10 +54,12 @@ /* We also have no use (for now) for an environment with bigger pointers and offsets. */ +# define _POSIX_V7_LPBIG_OFFBIG -1 # define _POSIX_V6_LPBIG_OFFBIG -1 # define _XBS5_LPBIG_OFFBIG -1 /* By default we have 64-bit wide `long int', pointers and `off_t'. */ +# define _POSIX_V7_LP64_OFF64 1 # define _POSIX_V6_LP64_OFF64 1 # define _XBS5_LP64_OFF64 1 @@ -61,16 +67,20 @@ /* By default we have 32-bit wide `int', `long int', pointers and `off_t' and all platforms support LFS. */ +# define _POSIX_V7_ILP32_OFF32 1 +# define _POSIX_V7_ILP32_OFFBIG 1 # define _POSIX_V6_ILP32_OFF32 1 # define _POSIX_V6_ILP32_OFFBIG 1 # define _XBS5_ILP32_OFF32 1 # define _XBS5_ILP32_OFFBIG 1 /* We optionally provide an environment with the above size but an 64-bit - side `off_t'. Therefore we don't define _XBS5_ILP32_OFFBIG. */ + side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ /* Environments with 64-bit wide pointers can be provided, so these macros aren't defined: + # undef _POSIX_V7_LP64_OFF64 + # undef _POSIX_V7_LPBIG_OFFBIG # undef _POSIX_V6_LP64_OFF64 # undef _POSIX_V6_LPBIG_OFFBIG # undef _XBS5_LP64_OFF64 diff --git a/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h b/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h index 7ff1971c2a..c0f98f6072 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h @@ -289,6 +289,10 @@ typedef struct sigevent { int _pad[__SIGEV_PAD_SIZE]; + /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the + thread to receive the signal. */ + __pid_t _tid; + struct { void (*_function) (sigval_t); /* Function to start. */ diff --git a/sysdeps/unix/sysv/linux/sparc/getsysstats.c b/sysdeps/unix/sysv/linux/sparc/getsysstats.c index f064b372ff..e96a8e5605 100644 --- a/sysdeps/unix/sysv/linux/sparc/getsysstats.c +++ b/sysdeps/unix/sysv/linux/sparc/getsysstats.c @@ -1,5 +1,5 @@ /* Determine various system internal values, Linux/Sparc version. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab and Jakub Jelinek @@ -21,7 +21,7 @@ /* We need to define a special parser for /proc/cpuinfo. */ -#define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \ +#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT) \ do \ { \ (RESULT) = 0; \ @@ -29,8 +29,9 @@ active cpus. We don't have to fear extremely long lines since \ the kernel will not generate them. 8192 bytes are really \ enough. */ \ - while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \ - if (sscanf (BUFFER, "ncpus active : %d", &(RESULT)) == 1) \ + char *l; \ + while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL) \ + if (sscanf (l, "ncpus active : %d", &(RESULT)) == 1) \ break; \ } \ while (0) diff --git a/sysdeps/unix/sysv/linux/sparc/sys/eventfd.h b/sysdeps/unix/sysv/linux/sparc/sys/eventfd.h index aff4f3592e..c42f2ce59b 100644 --- a/sysdeps/unix/sysv/linux/sparc/sys/eventfd.h +++ b/sysdeps/unix/sysv/linux/sparc/sys/eventfd.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2007, 2008, 2009 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 @@ -45,7 +45,7 @@ extern int eventfd (int __count, int __flags) __THROW; extern int eventfd_read (int __fd, eventfd_t *__value); /* Increment event counter. */ -extern int eventfd_write (int __fd, eventfd_t value); +extern int eventfd_write (int __fd, eventfd_t __value); __END_DECLS diff --git a/sysdeps/unix/sysv/linux/sys/eventfd.h b/sysdeps/unix/sysv/linux/sys/eventfd.h index 205824b669..7c6cf7196d 100644 --- a/sysdeps/unix/sysv/linux/sys/eventfd.h +++ b/sysdeps/unix/sysv/linux/sys/eventfd.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2007, 2008, 2009 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 @@ -45,7 +45,7 @@ extern int eventfd (int __count, int __flags) __THROW; extern int eventfd_read (int __fd, eventfd_t *__value); /* Increment event counter. */ -extern int eventfd_write (int __fd, eventfd_t value); +extern int eventfd_write (int __fd, eventfd_t __value); __END_DECLS diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/environments.h b/sysdeps/unix/sysv/linux/x86_64/bits/environments.h index a51a564cbb..c675ecc627 100644 --- a/sysdeps/unix/sysv/linux/x86_64/bits/environments.h +++ b/sysdeps/unix/sysv/linux/x86_64/bits/environments.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2001, 2004, 2009 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 @@ -27,21 +27,25 @@ `-1' means it is never supported. Undefined means it cannot be statically decided. - _POSIX_V6_ILP32_OFF32 32bit int, long, pointers, and off_t type - _POSIX_V6_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type + _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type + _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type - _POSIX_V6_LP64_OFF32 64bit long and pointers and 32bit off_t type - _POSIX_V6_LPBIG_OFFBIG 64bit long and pointers and large off_t type + _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type + _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type - The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and - _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard - and are available only for compatibility. + The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, + _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, + _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were + used in previous versions of the Unix standard and are available + only for compatibility. */ #if __WORDSIZE == 64 /* Environments with 32-bit wide pointers are optionally provided. Therefore following macros aren't defined: + # undef _POSIX_V7_ILP32_OFF32 + # undef _POSIX_V7_ILP32_OFFBIG # undef _POSIX_V6_ILP32_OFF32 # undef _POSIX_V6_ILP32_OFFBIG # undef _XBS5_ILP32_OFF32 @@ -50,10 +54,12 @@ /* We also have no use (for now) for an environment with bigger pointers and offsets. */ +# define _POSIX_V7_LPBIG_OFFBIG -1 # define _POSIX_V6_LPBIG_OFFBIG -1 # define _XBS5_LPBIG_OFFBIG -1 /* By default we have 64-bit wide `long int', pointers and `off_t'. */ +# define _POSIX_V7_LP64_OFF64 1 # define _POSIX_V6_LP64_OFF64 1 # define _XBS5_LP64_OFF64 1 @@ -61,16 +67,20 @@ /* By default we have 32-bit wide `int', `long int', pointers and `off_t' and all platforms support LFS. */ +# define _POSIX_V7_ILP32_OFF32 1 +# define _POSIX_V7_ILP32_OFFBIG 1 # define _POSIX_V6_ILP32_OFF32 1 # define _POSIX_V6_ILP32_OFFBIG 1 # define _XBS5_ILP32_OFF32 1 # define _XBS5_ILP32_OFFBIG 1 /* We optionally provide an environment with the above size but an 64-bit - side `off_t'. Therefore we don't define _XBS5_ILP32_OFFBIG. */ + side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ /* Environments with 64-bit wide pointers can be provided, so these macros aren't defined: + # undef _POSIX_V7_LP64_OFF64 + # undef _POSIX_V7_LPBIG_OFFBIG # undef _POSIX_V6_LP64_OFF64 # undef _POSIX_V6_LPBIG_OFFBIG # undef _XBS5_LP64_OFF64 diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/io.h b/sysdeps/unix/sysv/linux/x86_64/sys/io.h index 802a0dfb42..4f8537f428 100644 --- a/sysdeps/unix/sysv/linux/x86_64/sys/io.h +++ b/sysdeps/unix/sysv/linux/x86_64/sys/io.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 2000, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1996, 2000, 2002, 2009 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 @@ -41,138 +41,138 @@ extern int iopl (int __level) __THROW; #if defined __GNUC__ && __GNUC__ >= 2 static __inline unsigned char -inb (unsigned short int port) +inb (unsigned short int __port) { unsigned char _v; - __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned char -inb_p (unsigned short int port) +inb_p (unsigned short int __port) { unsigned char _v; - __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned short int -inw (unsigned short int port) +inw (unsigned short int __port) { unsigned short _v; - __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned short int -inw_p (unsigned short int port) +inw_p (unsigned short int __port) { unsigned short int _v; - __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned int -inl (unsigned short int port) +inl (unsigned short int __port) { unsigned int _v; - __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned int -inl_p (unsigned short int port) +inl_p (unsigned short int __port) { unsigned int _v; - __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port)); + __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port)); return _v; } static __inline void -outb (unsigned char value, unsigned short int port) +outb (unsigned char __value, unsigned short int __port) { - __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port)); + __asm__ __volatile__ ("outb %b0,%w1": :"a" (__value), "Nd" (__port)); } static __inline void -outb_p (unsigned char value, unsigned short int port) +outb_p (unsigned char __value, unsigned short int __port) { - __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value), - "Nd" (port)); + __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (__value), + "Nd" (__port)); } static __inline void -outw (unsigned short int value, unsigned short int port) +outw (unsigned short int __value, unsigned short int __port) { - __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port)); + __asm__ __volatile__ ("outw %w0,%w1": :"a" (__value), "Nd" (__port)); } static __inline void -outw_p (unsigned short int value, unsigned short int port) +outw_p (unsigned short int __value, unsigned short int __port) { - __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (value), - "Nd" (port)); + __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (__value), + "Nd" (__port)); } static __inline void -outl (unsigned int value, unsigned short int port) +outl (unsigned int __value, unsigned short int __port) { - __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (port)); + __asm__ __volatile__ ("outl %0,%w1": :"a" (__value), "Nd" (__port)); } static __inline void -outl_p (unsigned int value, unsigned short int port) +outl_p (unsigned int __value, unsigned short int __port) { - __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (value), - "Nd" (port)); + __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (__value), + "Nd" (__port)); } static __inline void -insb (unsigned short int port, void *addr, unsigned long int count) +insb (unsigned short int __port, void *addr, unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; insb":"=D" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; insb":"=D" (addr), "=c" (__count) + :"d" (__port), "0" (addr), "1" (__count)); } static __inline void -insw (unsigned short int port, void *addr, unsigned long int count) +insw (unsigned short int __port, void *addr, unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; insw":"=D" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; insw":"=D" (addr), "=c" (__count) + :"d" (__port), "0" (addr), "1" (__count)); } static __inline void -insl (unsigned short int port, void *addr, unsigned long int count) +insl (unsigned short int __port, void *addr, unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; insl":"=D" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; insl":"=D" (addr), "=c" (__count) + :"d" (__port), "0" (addr), "1" (__count)); } static __inline void -outsb (unsigned short int port, const void *addr, unsigned long int count) +outsb (unsigned short int __port, const void *addr, unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (addr), "=c" (__count) + :"d" (__port), "0" (addr), "1" (__count)); } static __inline void -outsw (unsigned short int port, const void *addr, unsigned long int count) +outsw (unsigned short int __port, const void *addr, unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (addr), "=c" (__count) + :"d" (__port), "0" (addr), "1" (__count)); } static __inline void -outsl (unsigned short int port, const void *addr, unsigned long int count) +outsl (unsigned short int __port, const void *addr, unsigned long int __count) { - __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (addr), - "=c" (count):"d" (port), "0" (addr), "1" (count)); + __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (addr), "=c" (__count) + :"d" (__port), "0" (addr), "1" (__count)); } #endif /* GNU C */ diff --git a/sysdeps/x86_64/bits/atomic.h b/sysdeps/x86_64/bits/atomic.h index 39c6ecba83..7c138eb2f3 100644 --- a/sysdeps/x86_64/bits/atomic.h +++ b/sysdeps/x86_64/bits/atomic.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -437,26 +437,37 @@ typedef uintmax_t uatomic_max_t; #define atomic_delay() asm ("rep; nop") -#define atomic_and(mem, mask) \ +#define __arch_and_body(lock, mem, mask) \ do { \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "andb %b1, %0" \ + __asm __volatile (lock "andb %b1, %0" \ : "=m" (*mem) \ - : "iq" (mask), "m" (*mem)); \ + : "iq" (mask), "m" (*mem), \ + "i" (offsetof (tcbhead_t, multiple_threads))); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "andw %w1, %0" \ + __asm __volatile (lock "andw %w1, %0" \ : "=m" (*mem) \ - : "ir" (mask), "m" (*mem)); \ + : "ir" (mask), "m" (*mem), \ + "i" (offsetof (tcbhead_t, multiple_threads))); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "andl %1, %0" \ + __asm __volatile (lock "andl %1, %0" \ : "=m" (*mem) \ - : "ir" (mask), "m" (*mem)); \ + : "ir" (mask), "m" (*mem), \ + "i" (offsetof (tcbhead_t, multiple_threads))); \ else \ - __asm __volatile (LOCK_PREFIX "andq %q1, %0" \ + __asm __volatile (lock "andq %q1, %0" \ : "=m" (*mem) \ - : "ir" (mask), "m" (*mem)); \ + : "ir" (mask), "m" (*mem), \ + "i" (offsetof (tcbhead_t, multiple_threads))); \ } while (0) +#define __arch_cprefix \ + "cmpl $0, %%fs:%P3\n\tje 0f\n\tlock\n0:\t" + +#define atomic_and(mem, mask) __arch_and_body (LOCK_PREFIX, mem, mask) + +#define catomic_and(mem, mask) __arch_and_body (__arch_cprefix, mem, mask) + #define __arch_or_body(lock, mem, mask) \ do { \ @@ -484,7 +495,4 @@ typedef uintmax_t uatomic_max_t; #define atomic_or(mem, mask) __arch_or_body (LOCK_PREFIX, mem, mask) -#define __arch_or_cprefix \ - "cmpl $0, %%fs:%P3\n\tje 0f\n\tlock\n0:\t" - -#define catomic_or(mem, mask) __arch_or_body (__arch_or_cprefix, mem, mask) +#define catomic_or(mem, mask) __arch_or_body (__arch_cprefix, mem, mask) diff --git a/sysdeps/x86_64/bits/link.h b/sysdeps/x86_64/bits/link.h index 2890c2d88d..5676b78753 100644 --- a/sysdeps/x86_64/bits/link.h +++ b/sysdeps/x86_64/bits/link.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2005, 2009 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 @@ -110,7 +110,7 @@ extern unsigned int la_x86_64_gnu_pltexit (Elf64_Sym *__sym, uintptr_t *__defcook, const La_x86_64_regs *__inregs, La_x86_64_retval *__outregs, - const char *symname); + const char *__symname); __END_DECLS -- cgit v1.2.3