diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-08-18 03:09:07 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-08-18 03:09:07 +0000 |
commit | 2ca268a71b555ca90fbea391b398c92bdf069c2a (patch) | |
tree | c1f7a1f94a85152acb065c0290bf77cc8942a00f | |
parent | 82a12113eb5986a659796adb2ff2875dae0db452 (diff) | |
download | uClibc-alpine-2ca268a71b555ca90fbea391b398c92bdf069c2a.tar.bz2 uClibc-alpine-2ca268a71b555ca90fbea391b398c92bdf069c2a.tar.xz |
Merge from trunk.
44 files changed, 646 insertions, 337 deletions
diff --git a/libc/sysdeps/linux/alpha/bits/fcntl.h b/libc/sysdeps/linux/alpha/bits/fcntl.h index c4a9b77e2..0f32cec87 100644 --- a/libc/sysdeps/linux/alpha/bits/fcntl.h +++ b/libc/sysdeps/linux/alpha/bits/fcntl.h @@ -1,5 +1,5 @@ /* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995-1999, 2000, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1995-2000, 2004, 2005, 2006 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 @@ -173,6 +173,12 @@ struct flock64 # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif +/* Linux-specific operations for posix_fadvise. */ +#ifdef __USE_GNU +# define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range. */ +# define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range. */ +#endif + __BEGIN_DECLS /* Provide kernel hint to read ahead. */ diff --git a/libc/sysdeps/linux/arm/bits/fcntl.h b/libc/sysdeps/linux/arm/bits/fcntl.h index 1cc59a9e5..536851525 100644 --- a/libc/sysdeps/linux/arm/bits/fcntl.h +++ b/libc/sysdeps/linux/arm/bits/fcntl.h @@ -1,5 +1,5 @@ /* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995-1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000, 2004, 2006 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 @@ # define O_DIRECTORY 040000 /* Must be a directory. */ # define O_NOFOLLOW 0100000 /* Do not follow links. */ # define O_DIRECT 0200000 /* Direct disk access. */ -# define O_STREAMING 04000000/* streaming access */ +# define O_NOATIME 01000000 /* Do not set atime. */ #endif #ifdef __USE_LARGEFILE64 @@ -80,7 +80,7 @@ #define F_SETLK64 13 /* Set record locking info (non-blocking). */ #define F_SETLKW64 14 /* Set record locking info (blocking). */ -#if defined __USE_BSD || defined __USE_XOPEN2K +#if defined __USE_BSD || defined __USE_UNIX98 # define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */ # define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */ #endif @@ -179,3 +179,17 @@ struct flock64 # define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif + +/* Linux-specific operations for posix_fadvise. */ +#ifdef __USE_GNU +# define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range. */ +# define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range. */ +#endif + +__BEGIN_DECLS + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + +__END_DECLS diff --git a/libc/sysdeps/linux/arm/bits/kernel_stat.h b/libc/sysdeps/linux/arm/bits/kernel_stat.h index fce8a4209..b58b28e30 100644 --- a/libc/sysdeps/linux/arm/bits/kernel_stat.h +++ b/libc/sysdeps/linux/arm/bits/kernel_stat.h @@ -68,6 +68,10 @@ struct kernel_stat64 { unsigned long st_ctime; unsigned long st_ctime_nsec; unsigned long long st_ino; +#ifndef __ARM_EABI__ } __attribute__((packed)); +#else +}; +#endif #endif /* _BITS_STAT_STRUCT_H */ diff --git a/libc/sysdeps/linux/arm/bits/mman.h b/libc/sysdeps/linux/arm/bits/mman.h index 596bd316c..7430f15b3 100644 --- a/libc/sysdeps/linux/arm/bits/mman.h +++ b/libc/sysdeps/linux/arm/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for POSIX memory map interface. Linux/ARM version. - Copyright (C) 1997, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 2000, 2003, 2005 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 @@ -34,6 +34,10 @@ #define PROT_WRITE 0x2 /* Page can be written. */ #define PROT_EXEC 0x4 /* Page can be executed. */ #define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ /* Sharing types (must choose one and only one of these). */ #define MAP_SHARED 0x01 /* Share changes. */ @@ -52,11 +56,13 @@ /* These are Linux-specific. */ #ifdef __USE_MISC -# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */ -# define MAP_DENYWRITE 0x0800 /* ETXTBSY */ -# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */ -# define MAP_LOCKED 0x2000 /* Lock the mapping. */ -# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */ +# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ +# define MAP_DENYWRITE 0x00800 /* ETXTBSY */ +# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ +# define MAP_LOCKED 0x02000 /* Lock the mapping. */ +# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ +# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ +# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ #endif /* Flags to `msync'. */ diff --git a/libc/sysdeps/linux/bfin/__longjmp.S b/libc/sysdeps/linux/bfin/__longjmp.S index 8648b2d7d..bb40c852c 100644 --- a/libc/sysdeps/linux/bfin/__longjmp.S +++ b/libc/sysdeps/linux/bfin/__longjmp.S @@ -1,18 +1,11 @@ -/* - * longjmp for the Blackfin project +/* longjmp for the Blackfin project * - * Copyright (C) 2004, + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * Copyright (C) 2004 Metrowerks * Based on code from Analog Devices. * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License. See the file COPYING.LIB in the main - * directory of this archive for more details. - * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ -#include <features.h> -#define _SETJMP_H -#define _ASM -#include <bits/setjmp.h> .text .global ___longjmp; @@ -110,3 +103,5 @@ ___longjmp: finished: RTS; .size ___longjmp,.-___longjmp + +libc_hidden_def(__longjmp) diff --git a/libc/sysdeps/linux/bfin/bits/mman.h b/libc/sysdeps/linux/bfin/bits/mman.h index d57eeb587..c75ff4b0d 100644 --- a/libc/sysdeps/linux/bfin/bits/mman.h +++ b/libc/sysdeps/linux/bfin/bits/mman.h @@ -72,16 +72,15 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 -# define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ #ifdef __USE_BSD -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_NORMAL 0x0 /* No further special treatment. */ +# define MADV_RANDOM 0x1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 0x2 /* Expect sequential page references. */ +# define MADV_WILLNEED 0x3 /* Will need these pages. */ +# define MADV_DONTNEED 0x4 /* Don't need these pages. */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/libc/sysdeps/linux/bfin/brk.c b/libc/sysdeps/linux/bfin/brk.c index 1df3ae517..5735321bb 100644 --- a/libc/sysdeps/linux/bfin/brk.c +++ b/libc/sysdeps/linux/bfin/brk.c @@ -4,17 +4,14 @@ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ +#include <errno.h> #include <unistd.h> #include <sys/syscall.h> -#include <errno.h> libc_hidden_proto(brk) /* This must be initialized data because commons can't have aliases. */ -extern void * __curbrk; -libc_hidden_proto(__curbrk) void * __curbrk = 0; -libc_hidden_data_def(__curbrk) int brk (void *addr) { diff --git a/libc/sysdeps/linux/bfin/bsd-_setjmp.S b/libc/sysdeps/linux/bfin/bsd-_setjmp.S index 6f17a6025..e2338d6cc 100644 --- a/libc/sysdeps/linux/bfin/bsd-_setjmp.S +++ b/libc/sysdeps/linux/bfin/bsd-_setjmp.S @@ -1,17 +1,17 @@ - -/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */ -/* This file is released under the LGPL, any version you like */ - -#define _ASM -#define _SETJMP_H -#include <bits/setjmp.h> +/* __setjmp for the Blackfin project + * + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * Copyright (C) 2002, David McCullough <davidm@snapgear.com> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ .text -.global _setjmp; -.type _setjmp,STT_FUNC; +.global __setjmp; +.type __setjmp,STT_FUNC; .align 4; -_setjmp: +__setjmp: [--SP] = P0; // Save P0 P0 = R0; R0 = [SP++]; @@ -90,8 +90,7 @@ _setjmp: R0 = RETS; [P0 + 0x9C] = R0; - R0 = [P0 + 0x20]; R0 = 0; RTS; -.size _setjmp,.-_setjmp +.size __setjmp,.-__setjmp diff --git a/libc/sysdeps/linux/bfin/bsdsetjmp.c b/libc/sysdeps/linux/bfin/bsdsetjmp.c index 87de78a4c..0a57d3440 100644 --- a/libc/sysdeps/linux/bfin/bsdsetjmp.c +++ b/libc/sysdeps/linux/bfin/bsdsetjmp.c @@ -1,100 +1,103 @@ -/* - * setjmp for the Blackfin project +/* setjmp for the Blackfin project * - * Copyright (C) 2003, Metrowerks + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * Copyright (C) 2003 Metrowerks * Based on code from Analog Devices. * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License. See the file COPYING.LIB in the main - * directory of this archive for more details. - * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ + #include <setjmp.h> -int setjmp(jmp_buf env){ - __asm__ __volatile__("[--SP] = p0;\n\t" - "p0 = r0;\n\t" - "r0 = [SP++];\n\t" - - "[p0++] = r0;\n\t" /* GP address registers */ - "[p0++] = p1;\n\t" - "[p0++] = p2;\n\t" - "[p0++] = p3;\n\t" - "[p0++] = p4;\n\t" - "[p0++] = p5;\n\t" - - "[p0++] = FP;\n\t" /* frame pointer */ - "[p0++] = SP;\n\t" /* stack pointer */ - - "[p0++] = p0;\n\t" /* data regs */ - "[p0++] = r1;\n\t" - "[p0++] = r2;\n\t" - "[p0++] = r3;\n\t" - "[p0++] = r4;\n\t" - "[p0++] = r5;\n\t" - "[p0++] = r6;\n\t" - "[p0++] = r7;\n\t" - - "r0 = ASTAT;\n\t" - "[p0++] = r0;\n\t" - - "r0 = LC0;\n\t" /* loop counters */ - "[p0++] = r0;\n\t" - "r0 = LC1;\n\t" - "[p0++] = r0;\n\t" - - "r0 = A0.w;\n\t" - "[p0++] = r0;\n\t" - "r0.l = A0.x;\n\t" - "[p0++] = r0;\n\t" - "r0 = A1.w;\n\t" - "[p0++] = r0;\n\t" - "r0.l = A1.x;\n\t" - "[p0++] = r0;\n\t" - - /* Dag regs */ - "r0 = i0;\n\t" /* index registers */ - "[p0++] = r0;\n\t" - "r0 = i1;\n\t" - "[p0++] = r0;\n\t" - "r0 = i2;\n\t" - "[p0++] = r0;\n\t" - "r0 = i3;\n\t" - "[p0++] = r0;\n\t" - - "r0 = m0;\n\t" /* modifier registers */ - "[p0++] = r0;\n\t" - "r0 = m1;\n\t" - "[p0++] = r0;\n\t" - "r0 = m2;\n\t" - "[p0++] = r0;\n\t" - "r0 = m3;\n\t" - "[p0++] = r0;\n\t" - - "r0 = l0;\n\t" /* length registers */ - "[p0++] = r0;\n\t" - "r0 = l1;\n\t" - "[p0++] = r0;\n\t" - "r0 = l2;\n\t" - "[p0++] = r0;\n\t" - "r0 = l3;\n\t" - "[p0++] = r0;\n\t" - - "r0 = b0;\n\t" /* base registers */ - "[p0++] = r0;\n\t" - "r0 = b1;\n\t" - "[p0++] = r0;\n\t" - "r0 = b2;\n\t" - "[p0++] = r0;\n\t" - "r0 = b3;\n\t" - "[p0++] = r0;\n\t" - - "r0 = RETS;\n\t" /* store return address */ - "[p0++] = r0;\n\t" - - "r0 = 0;\n\t" - : - : - ); -return 0; +#undef setjmp + +int setjmp(jmp_buf env) +{ + __asm__ __volatile__( + "[--SP] = p0;\n\t" + "p0 = r0;\n\t" + "r0 = [SP++];\n\t" + + "[p0++] = r0;\n\t" /* GP address registers */ + "[p0++] = p1;\n\t" + "[p0++] = p2;\n\t" + "[p0++] = p3;\n\t" + "[p0++] = p4;\n\t" + "[p0++] = p5;\n\t" + + "[p0++] = FP;\n\t" /* frame pointer */ + "[p0++] = SP;\n\t" /* stack pointer */ + + "[p0++] = p0;\n\t" /* data regs */ + "[p0++] = r1;\n\t" + "[p0++] = r2;\n\t" + "[p0++] = r3;\n\t" + "[p0++] = r4;\n\t" + "[p0++] = r5;\n\t" + "[p0++] = r6;\n\t" + "[p0++] = r7;\n\t" + + "r0 = ASTAT;\n\t" + "[p0++] = r0;\n\t" + + "r0 = LC0;\n\t" /* loop counters */ + "[p0++] = r0;\n\t" + "r0 = LC1;\n\t" + "[p0++] = r0;\n\t" + + "r0 = A0.w;\n\t" + "[p0++] = r0;\n\t" + "r0.l = A0.x;\n\t" + "[p0++] = r0;\n\t" + "r0 = A1.w;\n\t" + "[p0++] = r0;\n\t" + "r0.l = A1.x;\n\t" + "[p0++] = r0;\n\t" + + /* Dag regs */ + "r0 = i0;\n\t" /* index registers */ + "[p0++] = r0;\n\t" + "r0 = i1;\n\t" + "[p0++] = r0;\n\t" + "r0 = i2;\n\t" + "[p0++] = r0;\n\t" + "r0 = i3;\n\t" + "[p0++] = r0;\n\t" + + "r0 = m0;\n\t" /* modifier registers */ + "[p0++] = r0;\n\t" + "r0 = m1;\n\t" + "[p0++] = r0;\n\t" + "r0 = m2;\n\t" + "[p0++] = r0;\n\t" + "r0 = m3;\n\t" + "[p0++] = r0;\n\t" + + "r0 = l0;\n\t" /* length registers */ + "[p0++] = r0;\n\t" + "r0 = l1;\n\t" + "[p0++] = r0;\n\t" + "r0 = l2;\n\t" + "[p0++] = r0;\n\t" + "r0 = l3;\n\t" + "[p0++] = r0;\n\t" + + "r0 = b0;\n\t" /* base registers */ + "[p0++] = r0;\n\t" + "r0 = b1;\n\t" + "[p0++] = r0;\n\t" + "r0 = b2;\n\t" + "[p0++] = r0;\n\t" + "r0 = b3;\n\t" + "[p0++] = r0;\n\t" + + "r0 = RETS;\n\t" /* store return address */ + "[p0++] = r0;\n\t" + + "r0 = 0;\n\t" + : + : + ); + + return 0; } diff --git a/libc/sysdeps/linux/bfin/clone.c b/libc/sysdeps/linux/bfin/clone.c index f326f00a0..0ba1d5a4a 100644 --- a/libc/sysdeps/linux/bfin/clone.c +++ b/libc/sysdeps/linux/bfin/clone.c @@ -6,15 +6,18 @@ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ -#include <asm/unistd.h> +#include <sched.h> +#include <errno.h> +#include <sys/syscall.h> int -clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg) +clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg, ...) { register long rval = -1; if (fn && child_stack) { +#ifdef __BFIN_FDPIC__ __asm__ __volatile__ ( "r1 = %2;" "r0 = %3;" @@ -22,16 +25,43 @@ clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg) "excpt 0;" /*Call sys_clone*/ "%0 = r0;" "cc = r0 == 0;" - "if !cc jump xxx;" /* if (rval != 0) skip to parent */ + "if !cc jump .Lxxx;" /* if (rval != 0) skip to parent */ "r0 = %4;" "p0 = %5;" + "fp = 0;" + "p1 = [p0];" + "p3 = [p0 + 4];" + "call (p1);" /* Call cloned function */ + "p0 = %6;" + "excpt 0;" /* Call sys_exit */ + ".Lxxx: nop;" + : "=d" (rval) + : "i" (__NR_clone), "a" (child_stack), "a" (flags), "a" (arg), "a" (fn), "i" (__NR_exit) + : "CC", "R0", "R1", "P0"); +#else + __asm__ __volatile__ ( + "r1 = %2;" + "r0 = %3;" + "P0 = %1;" + "excpt 0;" /*Call sys_clone*/ + "%0 = r0;" + "cc = r0 == 0;" + "if !cc jump .Lxxx;" /* if (rval != 0) skip to parent */ + "r0 = %4;" + "p0 = %5;" + "fp = 0;" "call (p0);" /* Call cloned function */ "p0 = %6;" "excpt 0;" /* Call sys_exit */ - "xxx: nop;" + ".Lxxx: nop;" : "=d" (rval) : "i" (__NR_clone), "a" (child_stack), "a" (flags), "a" (arg), "a" (fn), "i" (__NR_exit) : "CC", "R0", "R1", "P0"); +#endif + + } else { + __set_errno(EINVAL); } + return rval; } diff --git a/libc/sysdeps/linux/bfin/crt1.S b/libc/sysdeps/linux/bfin/crt1.S index 7b6a99de0..ead8dbfbe 100644 --- a/libc/sysdeps/linux/bfin/crt1.S +++ b/libc/sysdeps/linux/bfin/crt1.S @@ -1,9 +1,22 @@ -/* Initial C runtime code for Blackfin - * - * Copyright (C) 2004-2006 Erik Andersen <andersen@uclibc.org> - * - * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - */ +/* Copyright (C) 1991, 1992 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 +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + /* When we enter this piece of code, the user stack looks like this: * argc argument counter (integer) @@ -12,11 +25,11 @@ * NULL * env[0...N] environment variables (pointers) * NULL - + * When we are done here, we want * R0=argc * R1=*argv[0] -* R2=*envp[0] +* R2=*envp[0] */ #include <features.h> @@ -28,47 +41,86 @@ .global ___uClibc_main; .type ___uClibc_main,STT_FUNC; -#if defined(__UCLIBC_CTOR_DTOR__) -.type __init,%function -.type __fini,%function -#else -.weak __init -.weak __fini -#endif - -/* - When we enter, our stack looks like: - [ SP ] - [argc][argv]... +/* Stick in a dummy reference to main(), so that if an application + * is linking when the main() function is in a static library (.a) + * we can be sure that main() actually gets linked in */ - Call ___uClibc_main(argc, argv, __init, __fini) - R0 R1 R2 stack - - Before we call main, we want: - [ SP ] - [fini][argc][argv] -*/ +.type _main,STT_FUNC; __start: -/* clear the frame pointer */ - FP = 0; +#ifdef __BFIN_FDPIC__ + /* P0 contains a pointer to the program's load map. */ + call .Lcall; +.Lcall: + R4 = RETS; + SP += -12; + R0.L = .Lcall; + R0.H = .Lcall; + R1.L = __ROFIXUP_LIST__; + R1.H = __ROFIXUP_LIST__; + R2.L = __ROFIXUP_END__; + R2.H = __ROFIXUP_END__; + R1 = R1 - R0; + R1 = R1 + R4; + R2 = R2 - R0; + R2 = R2 + R4; + R0 = P0; + CALL ___self_reloc; + SP += 12; + P3 = R0; +#endif -/* Load register R0 (argc) from the stack to its final resting place */ +/* clear the frame pointer and the L registers. */ + FP = 0; + L0 = 0; + L1 = 0; + L2 = 0; + L3 = 0; + +/* Load register R1 (argc) from the stack to its final resting place */ P0 = SP; - R0 = [P0++]; + R1 = [P0++]; -/* Copy argv pointer into R1 */ - R1 = P0; +/* Copy argv pointer into R2 -- which its final resting place */ + R2 = P0; -/* Load __init into R2 */ - R2 = __init; +/* Skip to the end of argv and put a pointer to the environment in + [SP + 12] */ + R3 = R1; + R3 <<= 2; + R3 += 4; + R3 = R2 + R3; -/* Load __fini onto the stack */ - P0 = __fini; - [SP--] = P0; + SP += -24; + [SP + 12] = R3; /* Ok, now run uClibc's main() -- shouldn't return */ - sp += -8; +#if defined L_crt1 && defined __UCLIBC_CTOR_DTOR__ +#ifdef __BFIN_FDPIC__ + R3 = [P3 + __init@FUNCDESC_GOT17M4]; +#else + R3.H = __init; + R3.L = __init; +#endif + [SP+16] = R3; +#ifdef __BFIN_FDPIC__ + R3 = [P3 + __fini@FUNCDESC_GOT17M4]; +#else + R3.H = __fini; + R3.L = __fini; +#endif + [SP+20] = R3; +#else /* no ctor/dtor handling */ + R3 = 0; + [SP + 16] = R3; + [SP + 20] = R3; +#endif + +#ifdef __BFIN_FDPIC__ + R0 = [P3 + _main@FUNCDESC_GOT17M4]; +#else + R0.H = _main; + R0.L = _main; +#endif jump.l ___uClibc_main; -.size __start,.-__start diff --git a/libc/sysdeps/linux/bfin/crti.S b/libc/sysdeps/linux/bfin/crti.S index 56b268a28..7c10392d8 100644 --- a/libc/sysdeps/linux/bfin/crti.S +++ b/libc/sysdeps/linux/bfin/crti.S @@ -1,17 +1,62 @@ - .section .init - .section .fini +/* Specialized code needed to support construction and destruction of + file-scope objects in C++ and Java code, and to support exception handling. + Copyright (C) 1999 Free Software Foundation, Inc. + Contributed by Charles-Antoine Gauthier (charles.gauthier@iit.nrc.ca). -.text; -.align 2 -.global __init; -.type __init, STT_FUNC; -__init: - LINK 0; - SP += -12; +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ -.align 2 -.global __fini; -.type __fini, STT_FUNC; +/* As a special exception, if you link this library with files + compiled with GCC to produce an executable, this does not cause + the resulting executable to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +/* + * This file just supplies function prologues for the .init and .fini + * sections. It is linked in before crtbegin.o. + */ + + .file "crti.o" + .ident "GNU C crti.o" + + .section .init + .globl __init + .type __init,@function +__init: +#if defined __ID_SHARED_LIB__ + [--SP] = P5; +#elif defined __BFIN_FDPIC__ + [--SP] = P3; +#endif + LINK 12; +#if defined __ID_SHARED_LIB__ + P5 = [P5 + _current_shared_library_p5_offset_] +#endif + .section .fini + .globl __fini + .type __fini,@function __fini: - LINK 0; - SP += -12; +#if defined __ID_SHARED_LIB__ + [--SP] = P5; +#elif defined __BFIN_FDPIC__ + [--SP] = P3; +#endif + LINK 12; +#if defined __ID_SHARED_LIB__ + P5 = [P5 + _current_shared_library_p5_offset_] +#endif diff --git a/libc/sysdeps/linux/bfin/crtn.S b/libc/sysdeps/linux/bfin/crtn.S index 11ba9420d..add0b7162 100644 --- a/libc/sysdeps/linux/bfin/crtn.S +++ b/libc/sysdeps/linux/bfin/crtn.S @@ -1,18 +1,53 @@ - .section .init - .section .fini +/* Specialized code needed to support construction and destruction of + file-scope objects in C++ and Java code, and to support exception handling. + Copyright (C) 1999 Free Software Foundation, Inc. + Contributed by Charles-Antoine Gauthier (charles.gauthier@iit.nrc.ca). + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ -.text; -.align 2 -.global __init; -.type __init, STT_FUNC; - SP += 12; - UNLINK; +/* As a special exception, if you link this library with files + compiled with GCC to produce an executable, this does not cause + the resulting executable to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +/* + * This file supplies function epilogues for the .init and .fini sections. + * It is linked in after all other files. + */ + + .file "crtn.o" + .ident "GNU C crtn.o" + + .section .init + unlink; +#if defined __ID_SHARED_LIB__ + P5 = [SP++]; +#elif defined __BFIN_FDPIC__ + P3 = [SP++]; +#endif rts; - .size __init, .-__init -.align 2 -.global __fini; -.type __fini, STT_FUNC; - SP += 12; - UNLINK; + + .section .fini + unlink; +#if defined __ID_SHARED_LIB__ + P5 = [SP++]; +#elif defined __BFIN_FDPIC__ + P3 = [SP++]; +#endif rts; - .size __fini, .-__fini diff --git a/libc/sysdeps/linux/bfin/setjmp.S b/libc/sysdeps/linux/bfin/setjmp.S index 7194a1508..1b304f84d 100644 --- a/libc/sysdeps/linux/bfin/setjmp.S +++ b/libc/sysdeps/linux/bfin/setjmp.S @@ -1,17 +1,11 @@ - -/* Cetjmp for the Blackfin project +/* setjmp for the Blackfin project * - * Copyright (C) 2003, Metrowerks + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * Copyright (C) 2003 Metrowerks * Based on code from Analog Devices. * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License. See the file COPYING.LIB in the main - * directory of this archive for more details. - * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ -#define _ASM -#define _SETJMP_H -#include <bits/setjmp.h> .text .global ___sigsetjmp; @@ -98,10 +92,5 @@ ___sigsetjmp: [P0 + 0x9C] = R0; R0 = [P0 + 0x20]; - CC = R1 == 1; - IF CC JUMP finished; - CALL ___sigjmp_save; -finished: - R0 = 0; - RTS; -.size ___sigsetjmp,.-___sigsetjmp + JUMP.L ___sigjmp_save; +.size ___sigsetjmp, .-___sigsetjmp diff --git a/libc/sysdeps/linux/bfin/vfork.S b/libc/sysdeps/linux/bfin/vfork.S index 014e5cfae..4e9aa844e 100644 --- a/libc/sysdeps/linux/bfin/vfork.S +++ b/libc/sysdeps/linux/bfin/vfork.S @@ -4,8 +4,7 @@ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ -#include <features.h> -#include <asm/unistd.h> +#include <sys/syscall.h> .text .global ___vfork diff --git a/libc/sysdeps/linux/common/modify_ldt.c b/libc/sysdeps/linux/common/modify_ldt.c index 9ebb68b3c..ff7fba4ce 100644 --- a/libc/sysdeps/linux/common/modify_ldt.c +++ b/libc/sysdeps/linux/common/modify_ldt.c @@ -7,9 +7,14 @@ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ +/* Nobody really uses this ... */ +#if 0 + #include "syscalls.h" -int modify_ldt (int func, void *ptr, unsigned long bytecount); #ifdef __NR_modify_ldt +int modify_ldt (int func, void *ptr, unsigned long bytecount); _syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount); #endif + +#endif diff --git a/libc/sysdeps/linux/cris/bits/fcntl.h b/libc/sysdeps/linux/cris/bits/fcntl.h index 7cce16904..36799aa50 100644 --- a/libc/sysdeps/linux/cris/bits/fcntl.h +++ b/libc/sysdeps/linux/cris/bits/fcntl.h @@ -1,5 +1,6 @@ /* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 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 @@ -45,7 +46,7 @@ # define O_DIRECT 040000 /* Direct disk access. */ # define O_DIRECTORY 0200000 /* Must be a directory. */ # define O_NOFOLLOW 0400000 /* Do not follow links. */ -# define O_STREAMING 04000000/* streaming access */ +# define O_NOATIME 01000000 /* Do not set atime. */ #endif /* For now Linux has synchronisity options for data and read operations. @@ -79,7 +80,7 @@ #define F_SETLK64 13 /* Set record locking info (non-blocking). */ #define F_SETLKW64 14 /* Set record locking info (blocking). */ -#if defined __USE_BSD || defined __USE_XOPEN2K +#if defined __USE_BSD || defined __USE_UNIX98 # define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */ # define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */ #endif @@ -178,3 +179,11 @@ struct flock64 # define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif + +__BEGIN_DECLS + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + +__END_DECLS diff --git a/libc/sysdeps/linux/cris/bits/mman.h b/libc/sysdeps/linux/cris/bits/mman.h index b1f22a1c4..ec9d2a558 100644 --- a/libc/sysdeps/linux/cris/bits/mman.h +++ b/libc/sysdeps/linux/cris/bits/mman.h @@ -1,5 +1,5 @@ -/* Definitions for POSIX memory map interface. Linux/cris version. - Copyright (C) 1997, 2000 Free Software Foundation, Inc. +/* Definitions for POSIX memory map interface. Linux/CRIS version. + Copyright (C) 1997, 2000, 2001, 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 @@ -34,6 +34,10 @@ #define PROT_WRITE 0x2 /* Page can be written. */ #define PROT_EXEC 0x4 /* Page can be executed. */ #define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ /* Sharing types (must choose one and only one of these). */ #define MAP_SHARED 0x01 /* Share changes. */ diff --git a/libc/sysdeps/linux/hppa/bits/mman.h b/libc/sysdeps/linux/hppa/bits/mman.h index 9c287274f..0b23bd322 100644 --- a/libc/sysdeps/linux/hppa/bits/mman.h +++ b/libc/sysdeps/linux/hppa/bits/mman.h @@ -82,3 +82,5 @@ # define MREMAP_MAYMOVE 1 # define MREMAP_FIXED 2 #endif + + diff --git a/libc/sysdeps/linux/hppa/bits/syscalls.h b/libc/sysdeps/linux/hppa/bits/syscalls.h index d173aa389..cb80138f5 100644 --- a/libc/sysdeps/linux/hppa/bits/syscalls.h +++ b/libc/sysdeps/linux/hppa/bits/syscalls.h @@ -22,10 +22,6 @@ * and save/restore r19 across the syscall. */ #define PIC -#ifndef ASM_LINE_SEP -# define ASM_LINE_SEP ; -#endif - /* Definition taken from glibc 2.3.3 * sysdeps/unix/sysv/linux/hppa/sysdep.h */ diff --git a/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h b/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h index bf048d3b8..5eea002c7 100644 --- a/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h +++ b/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h @@ -38,4 +38,7 @@ /* define if target supports IEEE signed zero floats */ #define __UCLIBC_HAVE_SIGNED_ZERO__ +/* the default ; is a comment on hppa */ +#define __UCLIBC_ASM_LINE_SEP__ ! + #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */ diff --git a/libc/sysdeps/linux/i386/bits/fcntl.h b/libc/sysdeps/linux/i386/bits/fcntl.h index 7cce16904..8c9159f0f 100644 --- a/libc/sysdeps/linux/i386/bits/fcntl.h +++ b/libc/sysdeps/linux/i386/bits/fcntl.h @@ -1,5 +1,6 @@ /* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006 + 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 +46,7 @@ # define O_DIRECT 040000 /* Direct disk access. */ # define O_DIRECTORY 0200000 /* Must be a directory. */ # define O_NOFOLLOW 0400000 /* Do not follow links. */ -# define O_STREAMING 04000000/* streaming access */ +# define O_NOATIME 01000000 /* Do not set atime. */ #endif /* For now Linux has synchronisity options for data and read operations. @@ -79,7 +80,7 @@ #define F_SETLK64 13 /* Set record locking info (non-blocking). */ #define F_SETLKW64 14 /* Set record locking info (blocking). */ -#if defined __USE_BSD || defined __USE_XOPEN2K +#if defined __USE_BSD || defined __USE_UNIX98 # define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */ # define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */ #endif @@ -178,3 +179,17 @@ struct flock64 # define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif + +/* Linux-specific operations for posix_fadvise. */ +#ifdef __USE_GNU +# define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range. */ +# define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range. */ +#endif + +__BEGIN_DECLS + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + +__END_DECLS diff --git a/libc/sysdeps/linux/i386/bits/mathinline.h b/libc/sysdeps/linux/i386/bits/mathinline.h index d39a122ca..489032624 100644 --- a/libc/sysdeps/linux/i386/bits/mathinline.h +++ b/libc/sysdeps/linux/i386/bits/mathinline.h @@ -125,19 +125,19 @@ # if __GNUC_PREREQ (2, 8) /* Test for negative number. Used in the signbit() macro. */ __MATH_INLINE int -__signbitf (float __x) __THROW +__NTH (__signbitf (float __x)) { __extension__ union { float __f; int __i; } __u = { __f: __x }; return __u.__i < 0; } __MATH_INLINE int -__signbit (double __x) __THROW +__NTH (__signbit (double __x)) { __extension__ union { double __d; int __i[2]; } __u = { __d: __x }; return __u.__i[1] < 0; } __MATH_INLINE int -__signbitl (long double __x) __THROW +__NTH (__signbitl (long double __x)) { __extension__ union { long double __l; int __i[3]; } __u = { __l: __x }; return (__u.__i[2] & 0x8000) != 0; @@ -203,7 +203,7 @@ __signbitl (long double __x) __THROW __inline_mathop_declNP_ (float_type, func, op, params) #define __inline_mathop_declNP_(float_type, func, op, params...) \ - __MATH_INLINE float_type func (float_type __x) __THROW \ + __MATH_INLINE float_type __NTH (func (float_type __x)) \ { \ register float_type __result; \ __asm __volatile__ (op : "=t" (__result) : params); \ @@ -256,7 +256,7 @@ __signbitl (long double __x) __THROW __inline_mathcodeNP_(float_type, func, arg, code) #define __inline_mathcodeNP_(float_type, func, arg, code) \ - __MATH_INLINE float_type func (float_type arg) __THROW \ + __MATH_INLINE float_type __NTH (func (float_type arg)) \ { \ code; \ } @@ -267,7 +267,7 @@ __signbitl (long double __x) __THROW __inline_mathcodeNP2_ (float_type, func, arg1, arg2, code) #define __inline_mathcodeNP2_(float_type, func, arg1, arg2, code) \ - __MATH_INLINE float_type func (float_type arg1, float_type arg2) __THROW \ + __MATH_INLINE float_type __NTH (func (float_type arg1, float_type arg2)) \ { \ code; \ } @@ -277,8 +277,8 @@ __signbitl (long double __x) __THROW __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code) #define __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code) \ - __MATH_INLINE float_type func (float_type arg1, float_type arg2, \ - float_type arg3) __THROW \ + __MATH_INLINE float_type __NTH (func (float_type arg1, float_type arg2, \ + float_type arg3)) \ { \ code; \ } @@ -341,19 +341,19 @@ __inline_mathcode (__pow2, __x, \ *__cosx = __cosr __MATH_INLINE void -__sincos (double __x, double *__sinx, double *__cosx) __THROW +__NTH (__sincos (double __x, double *__sinx, double *__cosx)) { __sincos_code; } __MATH_INLINE void -__sincosf (float __x, float *__sinx, float *__cosx) __THROW +__NTH (__sincosf (float __x, float *__sinx, float *__cosx)) { __sincos_code; } __MATH_INLINE void -__sincosl (long double __x, long double *__sinx, long double *__cosx) __THROW +__NTH (__sincosl (long double __x, long double *__sinx, long double *__cosx)) { __sincos_code; } @@ -519,7 +519,7 @@ __inline_mathcodeNP (ceil, __x, \ return __value __MATH_INLINE double -ldexp (double __x, int __y) __THROW +__NTH (ldexp (double __x, int __y)) { __ldexp_code; } @@ -581,13 +581,13 @@ __inline_mathop_declNP (log2, "fld1; fxch; fyl2x", "0" (__x) : "st(1)") #endif /* __FAST_MATH__ */ __MATH_INLINE float -ldexpf (float __x, int __y) __THROW +__NTH (ldexpf (float __x, int __y)) { __ldexp_code; } __MATH_INLINE long double -ldexpl (long double __x, int __y) __THROW +__NTH (ldexpl (long double __x, int __y)) { __ldexp_code; } @@ -605,17 +605,17 @@ __inline_mathopNP (rint, "frndint") : "=m" (__lrintres) : "t" (__x) : "st"); \ return __lrintres __MATH_INLINE long int -lrintf (float __x) __THROW +__NTH (lrintf (float __x)) { __lrint_code; } __MATH_INLINE long int -lrint (double __x) __THROW +__NTH (lrint (double __x)) { __lrint_code; } __MATH_INLINE long int -lrintl (long double __x) __THROW +__NTH (lrintl (long double __x)) { __lrint_code; } @@ -628,17 +628,17 @@ lrintl (long double __x) __THROW : "=m" (__llrintres) : "t" (__x) : "st"); \ return __llrintres __MATH_INLINE long long int -llrintf (float __x) __THROW +__NTH (llrintf (float __x)) { __llrint_code; } __MATH_INLINE long long int -llrint (double __x) __THROW +__NTH (llrint (double __x)) { __llrint_code; } __MATH_INLINE long long int -llrintl (long double __x) __THROW +__NTH (llrintl (long double __x)) { __llrint_code; } @@ -663,7 +663,7 @@ __inline_mathcodeNP2 (drem, __x, __y, \ /* This function is used in the `isfinite' macro. */ __MATH_INLINE int -__finite (double __x) __THROW +__NTH (__finite (double __x)) { return (__extension__ (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1] diff --git a/libc/sysdeps/linux/i386/bits/mman.h b/libc/sysdeps/linux/i386/bits/mman.h index f7a855aba..f198fa4b9 100644 --- a/libc/sysdeps/linux/i386/bits/mman.h +++ b/libc/sysdeps/linux/i386/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for POSIX memory map interface. Linux/i386 version. - Copyright (C) 1997, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 2000, 2003, 2005, 2006 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 @@ -34,6 +34,10 @@ #define PROT_WRITE 0x2 /* Page can be written. */ #define PROT_EXEC 0x4 /* Page can be executed. */ #define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ /* Sharing types (must choose one and only one of these). */ #define MAP_SHARED 0x01 /* Share changes. */ @@ -52,11 +56,13 @@ /* These are Linux-specific. */ #ifdef __USE_MISC -# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */ -# define MAP_DENYWRITE 0x0800 /* ETXTBSY */ -# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */ -# define MAP_LOCKED 0x2000 /* Lock the mapping. */ -# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */ +# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ +# define MAP_DENYWRITE 0x00800 /* ETXTBSY */ +# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ +# define MAP_LOCKED 0x02000 /* Lock the mapping. */ +# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ +# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ +# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ #endif /* Flags to `msync'. */ @@ -82,6 +88,9 @@ # define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define MADV_WILLNEED 3 /* Will need these pages. */ # define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 5 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/libc/sysdeps/linux/i386/bits/syscalls.h b/libc/sysdeps/linux/i386/bits/syscalls.h index 857491f06..58475e3af 100644 --- a/libc/sysdeps/linux/i386/bits/syscalls.h +++ b/libc/sysdeps/linux/i386/bits/syscalls.h @@ -12,7 +12,7 @@ #include <bits/sysnum.h> /* - Some of the sneaky macros in the code were taken from + Some of the sneaky macros in the code were taken from glibc-2.2.5/sysdeps/unix/sysv/linux/i386/sysdep.h */ @@ -131,7 +131,7 @@ return (type) (INLINE_SYSCALL(name, 3, arg1, arg2, arg3)); \ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ { \ return (type) (INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4)); \ -} +} #undef _syscall5 #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ diff --git a/libc/sysdeps/linux/ia64/__longjmp.S b/libc/sysdeps/linux/ia64/__longjmp.S index 90f70e8e0..04c51e75e 100644 --- a/libc/sysdeps/linux/ia64/__longjmp.S +++ b/libc/sysdeps/linux/ia64/__longjmp.S @@ -158,3 +158,5 @@ LEAF(__longjmp) mov pr=r24,-1 ret END(__longjmp) + +libc_hidden_def(__longjmp) diff --git a/libc/sysdeps/linux/ia64/bits/fcntl.h b/libc/sysdeps/linux/ia64/bits/fcntl.h index d330954d4..94e534d97 100644 --- a/libc/sysdeps/linux/ia64/bits/fcntl.h +++ b/libc/sysdeps/linux/ia64/bits/fcntl.h @@ -1,5 +1,5 @@ /* O_*, F_*, FD_* bit values for Linux/IA64. - Copyright (C) 1999, 2000, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2004, 2006 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 @@ -174,6 +174,12 @@ struct flock64 # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif +/* Linux-specific operations for posix_fadvise. */ +#ifdef __USE_GNU +# define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range. */ +# define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range. */ +#endif + __BEGIN_DECLS /* Provide kernel hint to read ahead. */ diff --git a/libc/sysdeps/linux/ia64/clone2.S b/libc/sysdeps/linux/ia64/clone2.S index af621662c..7f067dff8 100644 --- a/libc/sysdeps/linux/ia64/clone2.S +++ b/libc/sysdeps/linux/ia64/clone2.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2003, 2004, 2006 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 @@ -33,10 +33,12 @@ ENTRY(__clone2) .prologue alloc r2=ar.pfs,8,1,6,0 cmp.eq p6,p0=0,in0 + cmp.eq p7,p0=0,in1 mov r8=EINVAL mov out0=in3 /* Flags are first syscall argument. */ mov out1=in1 /* Stack address. */ -(p6) br.cond.spnt.many __syscall_error +(p6) br.cond.spnt.many __syscall_error /* no NULL function pointers */ +(p7) br.cond.spnt.many __syscall_error /* no NULL stack pointers */ ;; mov out2=in2 /* Stack size. */ mov out3=in5 /* Parent TID Pointer */ diff --git a/libc/sysdeps/linux/ia64/fork.S b/libc/sysdeps/linux/ia64/fork.S index 96d047f3f..c657453f2 100644 --- a/libc/sysdeps/linux/ia64/fork.S +++ b/libc/sysdeps/linux/ia64/fork.S @@ -39,3 +39,4 @@ PSEUDO_END(__libc_fork) weak_alias (__libc_fork, __fork) libc_hidden_def (__fork) weak_alias (__libc_fork, fork) +libc_hidden_weak (fork) diff --git a/libc/sysdeps/linux/m68k/bits/byteswap.h b/libc/sysdeps/linux/m68k/bits/byteswap.h index 549d4452e..f5ec91682 100644 --- a/libc/sysdeps/linux/m68k/bits/byteswap.h +++ b/libc/sysdeps/linux/m68k/bits/byteswap.h @@ -35,7 +35,7 @@ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) -#if defined __GNUC__ && __GNUC__ >= 2 +#if defined __GNUC__ && __GNUC__ >= 2 && !defined __mcoldfire__ # define __bswap_32(x) \ __extension__ \ ({ unsigned int __bswap_32_v; \ diff --git a/libc/sysdeps/linux/m68k/bits/mathinline.h b/libc/sysdeps/linux/m68k/bits/mathinline.h index dec89d830..81aab8881 100644 --- a/libc/sysdeps/linux/m68k/bits/mathinline.h +++ b/libc/sysdeps/linux/m68k/bits/mathinline.h @@ -109,7 +109,7 @@ #endif #define __inline_mathop1(float_type,func, op) \ - __m81_defun (float_type, func, (float_type __mathop_x)) __THROW \ + __m81_defun (float_type, func, (float_type __mathop_x)) \ { \ float_type __result; \ __asm("f" __STRING(op) "%.x %1, %0" : "=f" (__result) : "f" (__mathop_x));\ @@ -167,7 +167,7 @@ __inline_mathop(trunc, intrz) #define __inline_functions(float_type, s) \ __m81_inline float_type \ -__m81_u(__CONCAT(__frexp,s))(float_type __value, int *__expptr) __THROW \ +__m81_u(__CONCAT(__frexp,s))(float_type __value, int *__expptr) \ { \ float_type __mantissa, __exponent; \ int __iexponent; \ @@ -188,7 +188,7 @@ __m81_u(__CONCAT(__frexp,s))(float_type __value, int *__expptr) __THROW \ return __mantissa; \ } \ \ -__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) __THROW \ +__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \ { \ float_type __result; \ unsigned long int __ctrl_reg; \ @@ -204,7 +204,7 @@ __m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) __THROW \ return __result; \ } \ \ -__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) __THROW \ +__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \ { \ float_type __result; \ unsigned long int __ctrl_reg; \ @@ -230,7 +230,7 @@ __inline_functions(long double,l) #ifdef __USE_MISC # define __inline_functions(float_type, s) \ -__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) __THROW \ +__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \ { \ /* There is no branch-condition for infinity, \ so we must extract and examine the condition codes manually. */ \ @@ -240,7 +240,7 @@ __m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) __THROW \ return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \ } \ \ -__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) __THROW \ +__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \ { \ /* There is no branch-condition for infinity, so we must extract and \ examine the condition codes manually. */ \ @@ -251,7 +251,7 @@ __m81_defun (int, __CONCAT(__finite,s), (float_type __value)) __THROW \ } \ \ __m81_defun (float_type, __CONCAT(__scalbn,s), \ - (float_type __x, int __n)) __THROW \ + (float_type __x, int __n)) \ { \ float_type __result; \ __asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x)); \ @@ -268,7 +268,7 @@ __inline_functions(long double,l) #if defined __USE_MISC || defined __USE_XOPEN # define __inline_functions(float_type, s) \ -__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) __THROW \ +__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \ { \ char __result; \ __asm("ftst%.x %1\n" \ @@ -288,7 +288,7 @@ __inline_functions(long double,l) #ifdef __USE_ISOC99 # define __inline_functions(float_type, s) \ -__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) __THROW \ +__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \ { \ /* There is no branch-condition for the sign bit, so we must extract \ and examine the condition codes manually. */ \ @@ -299,12 +299,12 @@ __m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) __THROW \ } \ \ __m81_defun (float_type, __CONCAT(__scalbln,s), \ - (float_type __x, long int __n)) __THROW \ + (float_type __x, long int __n)) \ { \ return __CONCAT(__scalbn,s) (__x, __n); \ } \ \ -__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) __THROW \ +__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) \ { \ float_type __result; \ unsigned long int __ctrl_reg; \ @@ -318,7 +318,7 @@ __m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) __THROW \ return __result; \ } \ \ -__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) __THROW \ +__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) \ { \ long int __result; \ __asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x)); \ @@ -327,7 +327,7 @@ __m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) __THROW \ \ __m81_inline float_type \ __m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \ - float_type __z) __THROW \ + float_type __z) \ { \ return (__x * __y) + __z; \ } @@ -344,7 +344,7 @@ __inline_functions (long double,l) # define __inline_functions(float_type, s) \ __m81_inline void \ __m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \ - float_type *__cosx) __THROW \ + float_type *__cosx) \ { \ __asm ("fsincos%.x %2,%1:%0" \ : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \ @@ -365,13 +365,13 @@ __inline_functions (long double,l) NAME, to make token pasting work correctly with -traditional. */ # define __inline_forward_c(rettype, name, args1, args2) \ extern __inline rettype __attribute__((__const__)) \ -name args1 __THROW \ +name args1 \ { \ return __CONCAT(__,name) args2; \ } # define __inline_forward(rettype, name, args1, args2) \ -extern __inline rettype name args1 __THROW \ +extern __inline rettype name args1 \ { \ return __CONCAT(__,name) args2; \ } diff --git a/libc/sysdeps/linux/m68k/bits/mman.h b/libc/sysdeps/linux/m68k/bits/mman.h index 6e7bdc99d..fbec1a03f 100644 --- a/libc/sysdeps/linux/m68k/bits/mman.h +++ b/libc/sysdeps/linux/m68k/bits/mman.h @@ -88,6 +88,8 @@ # define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define MADV_WILLNEED 3 /* Will need these pages. */ # define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/libc/sysdeps/linux/m68k/bits/syscalls.h b/libc/sysdeps/linux/m68k/bits/syscalls.h index 284112e31..3e3303897 100644 --- a/libc/sysdeps/linux/m68k/bits/syscalls.h +++ b/libc/sysdeps/linux/m68k/bits/syscalls.h @@ -67,7 +67,7 @@ type name(void) \ "movel %%d0, %0" \ : "=g" (__res) \ : "i" (__NR_##name) \ - : "cc", "%d0"); \ + : "memory", "cc", "%d0"); \ __syscall_return(type, __res); \ } @@ -83,7 +83,7 @@ type name(atype a) \ : "=g" (__res) \ : "i" (__NR_##name), \ "g" ((long)a) \ - : "cc", "%d0", "%d1"); \ + : "memory", "cc", "%d0", "%d1"); \ __syscall_return(type, __res); \ } @@ -101,7 +101,7 @@ type name(atype a, btype b) \ : "i" (__NR_##name), \ "a" ((long)a), \ "g" ((long)b) \ - : "cc", "%d0", "%d1", "%d2"); \ + : "memory", "cc", "%d0", "%d1", "%d2"); \ __syscall_return(type, __res); \ } @@ -121,7 +121,7 @@ type name(atype a, btype b, ctype c) \ "a" ((long)a), \ "a" ((long)b), \ "g" ((long)c) \ - : "cc", "%d0", "%d1", "%d2", "%d3"); \ + : "memory", "cc", "%d0", "%d1", "%d2", "%d3"); \ __syscall_return(type, __res); \ } @@ -143,7 +143,7 @@ type name(atype a, btype b, ctype c, dtype d) \ "a" ((long)b), \ "a" ((long)c), \ "g" ((long)d) \ - : "cc", "%d0", "%d1", "%d2", "%d3", \ + : "memory", "cc", "%d0", "%d1", "%d2", "%d3", \ "%d4"); \ __syscall_return(type, __res); \ } @@ -168,7 +168,7 @@ type name(atype a, btype b, ctype c, dtype d, etype e) \ "a" ((long)c), \ "a" ((long)d), \ "g" ((long)e) \ - : "cc", "%d0", "%d1", "%d2", "%d3", \ + : "memory", "cc", "%d0", "%d1", "%d2", "%d3", \ "%d4", "%d5"); \ __syscall_return(type, __res); \ } @@ -195,7 +195,7 @@ type name(atype a, btype b, ctype c, dtype d, etype e, ftype f) \ "a" ((long)d), \ "g" ((long)e), \ "g" ((long)f) \ - : "cc", "%d0", "%d1", "%d2", "%d3", \ + : "memory", "cc", "%d0", "%d1", "%d2", "%d3", \ "%d4", "%d5", "%a0"); \ __syscall_return(type, __res); \ } diff --git a/libc/sysdeps/linux/m68k/syscall.c b/libc/sysdeps/linux/m68k/syscall.c index f35702a48..5b13ea695 100644 --- a/libc/sysdeps/linux/m68k/syscall.c +++ b/libc/sysdeps/linux/m68k/syscall.c @@ -41,6 +41,7 @@ long syscall(long sysnum, long a, long b, long c, long d, long e, long f) : "g" (sysnum), "g" ((long)a), "g" ((long)b), "g" ((long)c), "g" ((long)d), "g" ((long)e), "g" ((long)f) - : "cc", "%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%a0"); + : "memory", "cc", "%d0", "%d1", "%d2", "%d3", + "%d4", "%d5", "%a0"); __syscall_return(long,__res); } diff --git a/libc/sysdeps/linux/powerpc/bits/fcntl.h b/libc/sysdeps/linux/powerpc/bits/fcntl.h index 19649c01c..4e8b61a39 100644 --- a/libc/sysdeps/linux/powerpc/bits/fcntl.h +++ b/libc/sysdeps/linux/powerpc/bits/fcntl.h @@ -1,5 +1,5 @@ /* O_*, F_*, FD_* bit values for Linux/PowerPC. - Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004 + Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -180,6 +180,12 @@ struct flock64 # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif +/* Linux-specific operations for posix_fadvise. */ +#ifdef __USE_GNU +# define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range. */ +# define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range. */ +#endif + __BEGIN_DECLS /* Provide kernel hint to read ahead. */ diff --git a/libc/sysdeps/linux/powerpc/bits/mathinline.h b/libc/sysdeps/linux/powerpc/bits/mathinline.h index 2fc9146f4..76f68c1a1 100644 --- a/libc/sysdeps/linux/powerpc/bits/mathinline.h +++ b/libc/sysdeps/linux/powerpc/bits/mathinline.h @@ -60,7 +60,7 @@ #ifdef __USE_ISOC99 __MATH_INLINE long int lrint (double __x) __THROW; __MATH_INLINE long int -lrint (double __x) __THROW +__NTH (lrint (double __x)) { union { double __d; @@ -72,7 +72,7 @@ lrint (double __x) __THROW __MATH_INLINE long int lrintf (float __x) __THROW; __MATH_INLINE long int -lrintf (float __x) __THROW +__NTH (lrintf (float __x)) { union { double __d; @@ -84,14 +84,14 @@ lrintf (float __x) __THROW __MATH_INLINE double fdim (double __x, double __y) __THROW; __MATH_INLINE double -fdim (double __x, double __y) __THROW +__NTH (fdim (double __x, double __y)) { return __x < __y ? 0 : __x - __y; } __MATH_INLINE float fdimf (float __x, float __y) __THROW; __MATH_INLINE float -fdimf (float __x, float __y) __THROW +__NTH (fdimf (float __x, float __y)) { return __x < __y ? 0 : __x - __y; } diff --git a/libc/sysdeps/linux/sh/bits/fcntl.h b/libc/sysdeps/linux/sh/bits/fcntl.h index 69a20966d..8c9159f0f 100644 --- a/libc/sysdeps/linux/sh/bits/fcntl.h +++ b/libc/sysdeps/linux/sh/bits/fcntl.h @@ -1,5 +1,6 @@ /* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006 + 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 @@ -42,18 +43,18 @@ #define O_ASYNC 020000 #ifdef __USE_GNU -# define O_DIRECT 040000 /* Direct disk access. */ -# define O_DIRECTORY 0200000 /* Must be a directory. */ -# define O_NOFOLLOW 0400000 /* Do not follow links. */ -# define O_STREAMING 04000000/* streaming access */ +# define O_DIRECT 040000 /* Direct disk access. */ +# define O_DIRECTORY 0200000 /* Must be a directory. */ +# define O_NOFOLLOW 0400000 /* Do not follow links. */ +# define O_NOATIME 01000000 /* Do not set atime. */ #endif /* For now Linux has synchronisity options for data and read operations. We define the symbols here but let them do the same as O_SYNC since - this is a superset. */ + this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 # define O_DSYNC O_SYNC /* Synchronize data. */ -# define O_RSYNC O_SYNC /* Synchronize read operations. */ +# define O_RSYNC O_SYNC /* Synchronize read operations. */ #endif #ifdef __USE_LARGEFILE64 @@ -69,17 +70,17 @@ #ifndef __USE_FILE_OFFSET64 # define F_GETLK 5 /* Get record locking info. */ # define F_SETLK 6 /* Set record locking info (non-blocking). */ -# define F_SETLKW 7 /* Set record locking info (blocking). */ +# define F_SETLKW 7 /* Set record locking info (blocking). */ #else -# define F_GETLK F_GETLK64 /* Get record locking info. */ +# define F_GETLK F_GETLK64 /* Get record locking info. */ # define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ # define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ #endif #define F_GETLK64 12 /* Get record locking info. */ #define F_SETLK64 13 /* Set record locking info (non-blocking). */ -#define F_SETLKW64 14 /* Set record locking info (blocking). */ +#define F_SETLKW64 14 /* Set record locking info (blocking). */ -#if defined __USE_BSD || defined __USE_XOPEN2K +#if defined __USE_BSD || defined __USE_UNIX98 # define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */ # define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */ #endif @@ -89,20 +90,26 @@ # define F_GETSIG 11 /* Get number of signal to be sent. */ #endif +#ifdef __USE_GNU +# define F_SETLEASE 1024 /* Set a lease. */ +# define F_GETLEASE 1025 /* Enquire what lease is active. */ +# define F_NOTIFY 1026 /* Request notfications on a directory. */ +#endif + /* For F_[GET|SET]FL. */ #define FD_CLOEXEC 1 /* actually anything with low bit set goes */ /* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ #define F_RDLCK 0 /* Read lock. */ -#define F_WRLCK 1 /* Write lock. */ -#define F_UNLCK 2 /* Remove lock. */ +#define F_WRLCK 1 /* Write lock. */ +#define F_UNLCK 2 /* Remove lock. */ /* For old implementation of bsd flock(). */ #define F_EXLCK 4 /* or 3 */ #define F_SHLCK 8 /* or 4 */ #ifdef __USE_BSD -/* Operations for bsd flock(), also used by the kernel implementation. */ +/* Operations for bsd flock(), also used by the kernel implementation. */ # define LOCK_SH 1 /* shared lock */ # define LOCK_EX 2 /* exclusive lock */ # define LOCK_NB 4 /* or'd with one of the above to prevent @@ -110,9 +117,27 @@ # define LOCK_UN 8 /* remove lock */ #endif +#ifdef __USE_GNU +# define LOCK_MAND 32 /* This is a mandatory flock: */ +# define LOCK_READ 64 /* ... which allows concurrent read operations. */ +# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ +# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ +#endif + +#ifdef __USE_GNU +/* Types of directory notifications that may be requested with F_NOTIFY. */ +# define DN_ACCESS 0x00000001 /* File accessed. */ +# define DN_MODIFY 0x00000002 /* File modified. */ +# define DN_CREATE 0x00000004 /* File created. */ +# define DN_DELETE 0x00000008 /* File removed. */ +# define DN_RENAME 0x00000010 /* File renamed. */ +# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ +# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ +#endif + struct flock { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ #ifndef __USE_FILE_OFFSET64 __off_t l_start; /* Offset where the lock begins. */ @@ -127,7 +152,7 @@ struct flock #ifdef __USE_LARGEFILE64 struct flock64 { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ @@ -149,8 +174,22 @@ struct flock64 #ifdef __USE_XOPEN2K # define POSIX_FADV_NORMAL 0 /* No further special treatment. */ # define POSIX_FADV_RANDOM 1 /* Expect random page references. */ -# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ # define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif + +/* Linux-specific operations for posix_fadvise. */ +#ifdef __USE_GNU +# define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range. */ +# define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range. */ +#endif + +__BEGIN_DECLS + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + +__END_DECLS diff --git a/libc/sysdeps/linux/sh/bits/mman.h b/libc/sysdeps/linux/sh/bits/mman.h index 65eb86581..3c10334a4 100644 --- a/libc/sysdeps/linux/sh/bits/mman.h +++ b/libc/sysdeps/linux/sh/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for POSIX memory map interface. Linux/SH version. - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2000,2003,2005,2006 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 @@ -34,6 +34,10 @@ #define PROT_WRITE 0x2 /* Page can be written. */ #define PROT_EXEC 0x4 /* Page can be executed. */ #define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ /* Sharing types (must choose one and only one of these). */ #define MAP_SHARED 0x01 /* Share changes. */ @@ -57,6 +61,8 @@ # define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */ # define MAP_LOCKED 0x2000 /* Lock the mapping. */ # define MAP_NORESERVE 0x4000 /* Don't check for reservations. */ +# define MAP_POPULATE 0x8000 /* Populate (prefault) pagetables. */ +# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ #endif /* Flags to `msync'. */ @@ -82,6 +88,9 @@ # define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define MADV_WILLNEED 3 /* Will need these pages. */ # define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 5 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/libc/sysdeps/linux/sparc/bits/fcntl.h b/libc/sysdeps/linux/sparc/bits/fcntl.h index 5dc8bf32f..b7f46e403 100644 --- a/libc/sysdeps/linux/sparc/bits/fcntl.h +++ b/libc/sysdeps/linux/sparc/bits/fcntl.h @@ -1,5 +1,5 @@ /* O_*, F_*, FD_* bit values for Linux/SPARC. - Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004 + Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -199,6 +199,12 @@ struct flock64 # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif +/* Linux-specific operations for posix_fadvise. */ +#ifdef __USE_GNU +# define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range. */ +# define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range. */ +#endif + __BEGIN_DECLS /* Provide kernel hint to read ahead. */ diff --git a/libc/sysdeps/linux/sparc/bits/mathinline.h b/libc/sysdeps/linux/sparc/bits/mathinline.h index 92ecd5e83..f4bb278ed 100644 --- a/libc/sysdeps/linux/sparc/bits/mathinline.h +++ b/libc/sysdeps/linux/sparc/bits/mathinline.h @@ -106,7 +106,7 @@ /* Test for negative number. Used in the signbit() macro. */ __MATH_INLINE int -__signbitf (float __x) __THROW +__NTH (__signbitf (float __x)) { __extension__ union { float __f; int __i; } __u = { __f: __x }; return __u.__i < 0; @@ -115,14 +115,14 @@ __signbitf (float __x) __THROW # if __WORDSIZE == 32 __MATH_INLINE int -__signbit (double __x) __THROW +__NTH (__signbit (double __x)) { __extension__ union { double __d; int __i[2]; } __u = { __d: __x }; return __u.__i[0] < 0; } __MATH_INLINE int -__signbitl (long double __x) __THROW +__NTH (__signbitl (long double __x)) { return __signbit ((double)__x); } @@ -130,14 +130,14 @@ __signbitl (long double __x) __THROW # else /* sparc64 */ __MATH_INLINE int -__signbit (double __x) __THROW +__NTH (__signbit (double __x)) { __extension__ union { double __d; long int __i; } __u = { __d: __x }; return __u.__i < 0; } __MATH_INLINE int -__signbitl (long double __x) __THROW +__NTH (__signbitl (long double __x)) { __extension__ union { long double __l; long int __i[2]; } __u = { __l: __x }; return __u.__i[0] < 0; @@ -150,7 +150,7 @@ __signbitl (long double __x) __THROW # ifndef __NO_MATH_INLINES __MATH_INLINE double -sqrt (double __x) __THROW +__NTH (sqrt (double __x)) { register double __r; __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x)); @@ -158,7 +158,7 @@ sqrt (double __x) __THROW } __MATH_INLINE float -sqrtf (float __x) __THROW +__NTH (sqrtf (float __x)) { register float __r; __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x)); @@ -167,7 +167,7 @@ sqrtf (float __x) __THROW # if __WORDSIZE == 64 __MATH_INLINE long double -sqrtl (long double __x) __THROW +__NTH (sqrtl (long double __x)) { long double __r; extern void _Qp_sqrt (long double *, __const__ long double *); @@ -213,16 +213,16 @@ __ieee754_sqrtl (long double __x) # ifndef __NO_MATH_INLINES -__MATH_INLINE double fdim (double __x, double __y); +__MATH_INLINE double __NTH (fdim (double __x, double __y)); __MATH_INLINE double -fdim (double __x, double __y) +__NTH (fdim (double __x, double __y)) { return __x < __y ? 0 : __x - __y; } -__MATH_INLINE float fdimf (float __x, float __y); +__MATH_INLINE float __NTH (fdimf (float __x, float __y)); __MATH_INLINE float -fdimf (float __x, float __y) +__NTH (fdimf (float __x, float __y)) { return __x < __y ? 0 : __x - __y; } diff --git a/libc/sysdeps/linux/sparc/bits/mman.h b/libc/sysdeps/linux/sparc/bits/mman.h index 26425876f..8de270f93 100644 --- a/libc/sysdeps/linux/sparc/bits/mman.h +++ b/libc/sysdeps/linux/sparc/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for POSIX memory map interface. Linux/SPARC version. - Copyright (C) 1997, 1999, 2000, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2000,2003,2005,2006 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 @@ -90,6 +90,10 @@ # define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define MADV_WILLNEED 3 /* Will need these pages. */ # define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_FREE 5 /* Content can be freed (Solaris). */ +# define MADV_REMOVE 6 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/libc/sysdeps/linux/sparc/bits/poll.h b/libc/sysdeps/linux/sparc/bits/poll.h index f7a739315..53b94bc50 100644 --- a/libc/sysdeps/linux/sparc/bits/poll.h +++ b/libc/sysdeps/linux/sparc/bits/poll.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2001, 2006 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 @@ -35,6 +35,13 @@ # define POLLWRBAND 0x100 /* Priority data may be written. */ #endif +#ifdef __USE_GNU +/* These are extensions for Linux. */ +# define POLLMSG 0x200 +# define POLLREMOVE 0x400 +# define POLLRDHUP 0x800 +#endif + /* Event types always implicitly polled for. These bits need not be set in `events', but they will appear in `revents' to indicate the status of the file descriptor. */ diff --git a/libc/sysdeps/linux/x86_64/bits/fcntl.h b/libc/sysdeps/linux/x86_64/bits/fcntl.h index 9198c70bd..712007c36 100644 --- a/libc/sysdeps/linux/x86_64/bits/fcntl.h +++ b/libc/sysdeps/linux/x86_64/bits/fcntl.h @@ -1,5 +1,5 @@ /* O_*, F_*, FD_* bit values for Linux/x86-64. - Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004, 2006 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 @@ -194,6 +194,12 @@ struct flock64 # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif +/* Linux-specific operations for posix_fadvise. */ +#ifdef __USE_GNU +# define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range. */ +# define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range. */ +#endif + __BEGIN_DECLS /* Provide kernel hint to read ahead. */ diff --git a/libc/sysdeps/linux/x86_64/bits/mman.h b/libc/sysdeps/linux/x86_64/bits/mman.h index b1a8b93d3..880390055 100644 --- a/libc/sysdeps/linux/x86_64/bits/mman.h +++ b/libc/sysdeps/linux/x86_64/bits/mman.h @@ -90,6 +90,8 @@ # define MADV_WILLNEED 3 /* Will need these pages. */ # define MADV_DONTNEED 4 /* Don't need these pages. */ # define MADV_REMOVE 5 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ #endif /* The POSIX people had to invent similar names for the same things. */ |