diff options
Diffstat (limited to 'libc')
157 files changed, 719 insertions, 895 deletions
diff --git a/libc/sysdeps/linux/README b/libc/sysdeps/linux/README index 4a7e4d2f0..76944f9e9 100644 --- a/libc/sysdeps/linux/README +++ b/libc/sysdeps/linux/README @@ -1,7 +1,7 @@ This directory level abstracts out the Linux Operating System dependent -features of uClibc for suported Linux architectures/CPUs. If you wanted to +features of uClibc for supported Linux architectures/CPUs. If you wanted to port uClibc to some new Linux architecture (arm, mips, etc), this is the place to add that support. -All the common stuff that is not at all dependent on a particular Linux architecture +All stuff that is not at all dependent on a particular Linux architecture goes in the 'common' directory. diff --git a/libc/sysdeps/linux/alpha/bits/atomic.h b/libc/sysdeps/linux/alpha/bits/atomic.h index 5ef091dc0..5ad4c5409 100644 --- a/libc/sysdeps/linux/alpha/bits/atomic.h +++ b/libc/sysdeps/linux/alpha/bits/atomic.h @@ -179,22 +179,22 @@ typedef uintmax_t uatomic_max_t; #define __arch_compare_and_exchange_val_8_int(mem, new, old, mb1, mb2) \ ({ unsigned long __prev; int __cmp; \ __arch_compare_and_exchange_xxx_8_int(mem, new, old, mb1, mb2); \ - (typeof (*mem))__prev; }) + (__typeof (*mem))__prev; }) #define __arch_compare_and_exchange_val_16_int(mem, new, old, mb1, mb2) \ ({ unsigned long __prev; int __cmp; \ __arch_compare_and_exchange_xxx_16_int(mem, new, old, mb1, mb2); \ - (typeof (*mem))__prev; }) + (__typeof (*mem))__prev; }) #define __arch_compare_and_exchange_val_32_int(mem, new, old, mb1, mb2) \ ({ unsigned long __prev; int __cmp; \ __arch_compare_and_exchange_xxx_32_int(mem, new, old, mb1, mb2); \ - (typeof (*mem))__prev; }) + (__typeof (*mem))__prev; }) #define __arch_compare_and_exchange_val_64_int(mem, new, old, mb1, mb2) \ ({ unsigned long __prev; int __cmp; \ __arch_compare_and_exchange_xxx_64_int(mem, new, old, mb1, mb2); \ - (typeof (*mem))__prev; }) + (__typeof (*mem))__prev; }) /* Compare and exchange with "acquire" semantics, ie barrier after. */ diff --git a/libc/sysdeps/linux/alpha/bits/fcntl.h b/libc/sysdeps/linux/alpha/bits/fcntl.h index 5dfd6729f..2a6b9eadc 100644 --- a/libc/sysdeps/linux/alpha/bits/fcntl.h +++ b/libc/sysdeps/linux/alpha/bits/fcntl.h @@ -159,7 +159,6 @@ struct flock64 }; #endif - /* Define some more compatibility macros to be backward compatible with BSD systems which did not managed to hide these kernel macros. */ #ifdef __USE_BSD @@ -181,8 +180,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -193,7 +191,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -206,18 +203,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/alpha/bits/mathdef.h b/libc/sysdeps/linux/alpha/bits/mathdef.h index 3b52ec7d5..cbfaf68e2 100644 --- a/libc/sysdeps/linux/alpha/bits/mathdef.h +++ b/libc/sysdeps/linux/alpha/bits/mathdef.h @@ -78,7 +78,3 @@ typedef double double_t; # endif /* GNUC before 3.4 */ #endif /* COMPLEX_H */ - -#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/libc/sysdeps/linux/alpha/bits/wordsize.h b/libc/sysdeps/linux/alpha/bits/wordsize.h index 22fc64109..029a7dfb2 100644 --- a/libc/sysdeps/linux/alpha/bits/wordsize.h +++ b/libc/sysdeps/linux/alpha/bits/wordsize.h @@ -18,13 +18,13 @@ #define __WORDSIZE 64 -#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL +#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __LONG_DOUBLE_MATH_OPTIONAL /* Signal that we didn't used to have a `long double'. The changes all the `long double' function variants to be redirects to the double functions. */ # define __LONG_DOUBLE_MATH_OPTIONAL 1 # ifndef __LONG_DOUBLE_128__ -# define __NO_LONG_DOUBLE_MATH 1 +# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__ # endif #endif diff --git a/libc/sysdeps/linux/alpha/sigprocmask.c b/libc/sysdeps/linux/alpha/sigprocmask.c index e9ebe091f..f5e3c8d91 100644 --- a/libc/sysdeps/linux/alpha/sigprocmask.c +++ b/libc/sysdeps/linux/alpha/sigprocmask.c @@ -25,9 +25,9 @@ /* When there is kernel support for more than 64 signals, we'll have to switch to a new system call convention here. */ -static __inline__ _syscall2(int, osf_sigprocmask, int, how, unsigned long int, setval); +static __inline__ _syscall2(int, osf_sigprocmask, int, how, unsigned long int, setval) -libc_hidden_proto(sigprocmask) +/* libc_hidden_proto(sigprocmask) */ int sigprocmask (int how, const sigset_t *set, sigset_t *oset) { diff --git a/libc/sysdeps/linux/alpha/sys/io.h b/libc/sysdeps/linux/alpha/sys/io.h index 4334c6392..9cb8d254b 100644 --- a/libc/sysdeps/linux/alpha/sys/io.h +++ b/libc/sysdeps/linux/alpha/sys/io.h @@ -32,6 +32,7 @@ __BEGIN_DECLS E.g., Linux/Alpha for Alpha PCs supports this. */ extern int ioperm (unsigned long int __from, unsigned long int __num, int __turn_on) __THROW; +libc_hidden_proto(ioperm) /* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to access any I/O port is granted. This call requires root diff --git a/libc/sysdeps/linux/arm/aeabi_assert.c b/libc/sysdeps/linux/arm/aeabi_assert.c index e0985b446..53943ac13 100644 --- a/libc/sysdeps/linux/arm/aeabi_assert.c +++ b/libc/sysdeps/linux/arm/aeabi_assert.c @@ -20,7 +20,7 @@ #include <assert.h> #include <stdlib.h> -libc_hidden_proto(__assert) +/* libc_hidden_proto(__assert) */ void __aeabi_assert (const char *assertion, const char *file, diff --git a/libc/sysdeps/linux/arm/aeabi_localeconv.c b/libc/sysdeps/linux/arm/aeabi_localeconv.c index c9e9dd23f..6fa29bbad 100644 --- a/libc/sysdeps/linux/arm/aeabi_localeconv.c +++ b/libc/sysdeps/linux/arm/aeabi_localeconv.c @@ -18,7 +18,7 @@ #include <locale.h> -libc_hidden_proto(localeconv) +/* libc_hidden_proto(localeconv) */ struct lconv * __aeabi_localeconv (void) diff --git a/libc/sysdeps/linux/arm/aeabi_mb_cur_max.c b/libc/sysdeps/linux/arm/aeabi_mb_cur_max.c index 937a7fffb..109feb11d 100644 --- a/libc/sysdeps/linux/arm/aeabi_mb_cur_max.c +++ b/libc/sysdeps/linux/arm/aeabi_mb_cur_max.c @@ -21,7 +21,7 @@ #include <stdlib.h> #ifdef __UCLIBC_HAS_WCHAR__ -libc_hidden_proto(_stdlib_mb_cur_max) +/* libc_hidden_proto(_stdlib_mb_cur_max) */ #endif int diff --git a/libc/sysdeps/linux/arm/bits/fcntl.h b/libc/sysdeps/linux/arm/bits/fcntl.h index f566fe4f8..86cea4b7f 100644 --- a/libc/sysdeps/linux/arm/bits/fcntl.h +++ b/libc/sysdeps/linux/arm/bits/fcntl.h @@ -189,8 +189,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -201,7 +200,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -214,17 +212,15 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/arm/bits/mathdef.h b/libc/sysdeps/linux/arm/bits/mathdef.h index e013e74b7..22722e37a 100644 --- a/libc/sysdeps/linux/arm/bits/mathdef.h +++ b/libc/sysdeps/linux/arm/bits/mathdef.h @@ -34,11 +34,3 @@ typedef double double_t; /* `double' expressions are evaluated as # define FP_ILOGBNAN (2147483647) #endif /* ISO C99 */ - -#ifndef __NO_LONG_DOUBLE_MATH -/* Signal that we do not really have a `long double'. This disables the - declaration of all the `long double' function variants. */ -/* XXX The FPA does support this but the patterns in GCC are currently - turned off. */ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h b/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h index 85c9adb8a..0e33f9cdf 100644 --- a/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h +++ b/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h @@ -12,7 +12,11 @@ #undef __UCLIBC_MMAP_HAS_6_ARGS__ /* does your target use syscall4() for truncate64 ? (32bit arches only) */ +#ifdef __ARM_EABI__ +#define __UCLIBC_TRUNCATE64_HAS_4_ARGS__ +#else #undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__ +#endif /* does your target have a broken create_module() ? */ #define __UCLIBC_BROKEN_CREATE_MODULE__ diff --git a/libc/sysdeps/linux/arm/brk.c b/libc/sysdeps/linux/arm/brk.c index 47179901f..aaa71cc6d 100644 --- a/libc/sysdeps/linux/arm/brk.c +++ b/libc/sysdeps/linux/arm/brk.c @@ -21,7 +21,7 @@ #include <unistd.h> #include <sys/syscall.h> -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ /* This must be initialized data because commons can't have aliases. */ void *__curbrk attribute_hidden = 0; diff --git a/libc/sysdeps/linux/arm/crt1.S b/libc/sysdeps/linux/arm/crt1.S index 082348e39..18e3686fa 100644 --- a/libc/sysdeps/linux/arm/crt1.S +++ b/libc/sysdeps/linux/arm/crt1.S @@ -238,7 +238,11 @@ _start: #ifdef __PIC__ .L_GOT: +#ifdef __thumb__ + .word _GLOBAL_OFFSET_TABLE_-(.L_GOT_OFF+4) +#else /* __thumb2__ */ .word _GLOBAL_OFFSET_TABLE_-(.L_GOT_OFF+8) +#endif .word _fini(GOT) .word _init(GOT) .word main(GOT) diff --git a/libc/sysdeps/linux/arm/ioperm.c b/libc/sysdeps/linux/arm/ioperm.c index 6a020365e..d5e642ca7 100644 --- a/libc/sysdeps/linux/arm/ioperm.c +++ b/libc/sysdeps/linux/arm/ioperm.c @@ -46,18 +46,18 @@ #include <sys/sysctl.h> #include <sys/io.h> -libc_hidden_proto(ioperm) +/* libc_hidden_proto(ioperm) */ -libc_hidden_proto(readlink) -libc_hidden_proto(mmap) -libc_hidden_proto(sscanf) -libc_hidden_proto(fscanf) +/* libc_hidden_proto(readlink) */ +/* libc_hidden_proto(mmap) */ +/* libc_hidden_proto(sscanf) */ +/* libc_hidden_proto(fscanf) */ /* libc_hidden_proto(fprintf) */ -libc_hidden_proto(fgets) -libc_hidden_proto(fopen) +/* libc_hidden_proto(fgets) */ +/* libc_hidden_proto(fopen) */ /* libc_hidden_proto(fclose) */ /* Experimentally off - libc_hidden_proto(strcmp) */ -libc_hidden_proto(open) +/* libc_hidden_proto(open) */ /* libc_hidden_proto(close) */ #include <linux/version.h> diff --git a/libc/sysdeps/linux/arm/iopl.c b/libc/sysdeps/linux/arm/iopl.c index 654a4158f..ecb1cd15d 100644 --- a/libc/sysdeps/linux/arm/iopl.c +++ b/libc/sysdeps/linux/arm/iopl.c @@ -21,7 +21,7 @@ #include <sys/io.h> #include <errno.h> -libc_hidden_proto(ioperm) +/* libc_hidden_proto(ioperm) */ #define MAX_PORT 0x10000 diff --git a/libc/sysdeps/linux/arm/mmap.c b/libc/sysdeps/linux/arm/mmap.c index 47a29f4ae..0a74638ca 100644 --- a/libc/sysdeps/linux/arm/mmap.c +++ b/libc/sysdeps/linux/arm/mmap.c @@ -17,7 +17,7 @@ libc_hidden_proto (mmap) #if defined (__UCLIBC_MMAP_HAS_6_ARGS__) && defined (__NR_mmap) #define __NR__mmap __NR_mmap static __inline__ _syscall6 (__ptr_t, _mmap, __ptr_t, addr, size_t, len, - int, prot, int, flags, int, fd, __off_t, offset); + int, prot, int, flags, int, fd, __off_t, offset) __ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset) { @@ -53,7 +53,7 @@ __ptr_t mmap(__ptr_t addr, size_t len, int prot, } #elif defined (__NR_mmap) # define __NR__mmap __NR_mmap -static __inline__ _syscall1(__ptr_t, _mmap, unsigned long *, buffer); +static __inline__ _syscall1(__ptr_t, _mmap, unsigned long *, buffer) __ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset) { diff --git a/libc/sysdeps/linux/arm/sigaction.c b/libc/sysdeps/linux/arm/sigaction.c index 552ac17bf..9c1160866 100644 --- a/libc/sysdeps/linux/arm/sigaction.c +++ b/libc/sysdeps/linux/arm/sigaction.c @@ -120,7 +120,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa #endif #ifndef LIBC_SIGACTION -libc_hidden_proto(sigaction) +/* libc_hidden_proto(sigaction) */ weak_alias(__libc_sigaction,sigaction) libc_hidden_weak(sigaction) #endif diff --git a/libc/sysdeps/linux/arm/sys/io.h b/libc/sysdeps/linux/arm/sys/io.h index 68639902c..81762beca 100644 --- a/libc/sysdeps/linux/arm/sys/io.h +++ b/libc/sysdeps/linux/arm/sys/io.h @@ -28,6 +28,7 @@ __BEGIN_DECLS permission off for that range. This call requires root privileges. */ extern int ioperm (unsigned long int __from, unsigned long int __num, int __turn_on) __THROW; +libc_hidden_proto(ioperm) /* Set the I/O privilege level to LEVEL. If LEVEL is nonzero, permission to access any I/O port is granted. This call requires diff --git a/libc/sysdeps/linux/avr32/bits/fcntl.h b/libc/sysdeps/linux/avr32/bits/fcntl.h index 3bf4e1ac8..2301e2241 100644 --- a/libc/sysdeps/linux/avr32/bits/fcntl.h +++ b/libc/sysdeps/linux/avr32/bits/fcntl.h @@ -167,7 +167,18 @@ struct flock64 { # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif -#ifdef __USE_GNU + +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ +/* Flags for SYNC_FILE_RANGE. */ +# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages + in the range before performing + the write */ +# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those + dirty pages in the range which are + not presently under writeback */ +# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages + in the range after performing the + write */ /* Flags for splice() and vmsplice() */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying */ @@ -179,6 +190,13 @@ struct flock64 { __BEGIN_DECLS +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; + +/* Selective file content synch'ing */ +extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, + unsigned int __flags); + /* Splice address range into a pipe */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, size_t __count, unsigned int __flags); diff --git a/libc/sysdeps/linux/avr32/brk.c b/libc/sysdeps/linux/avr32/brk.c index a54b49a61..7d34405dc 100644 --- a/libc/sysdeps/linux/avr32/brk.c +++ b/libc/sysdeps/linux/avr32/brk.c @@ -9,7 +9,7 @@ #include <unistd.h> #include <sys/syscall.h> -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ void *__curbrk attribute_hidden = 0; diff --git a/libc/sysdeps/linux/avr32/clone.c b/libc/sysdeps/linux/avr32/clone.c index e43b0f3bf..06e3388b8 100644 --- a/libc/sysdeps/linux/avr32/clone.c +++ b/libc/sysdeps/linux/avr32/clone.c @@ -5,6 +5,7 @@ * Public License. See the file "COPYING.LIB" in the main directory of this * archive for more details. */ +#include <sched.h> #include <errno.h> #include <sys/syscall.h> #include <unistd.h> @@ -14,7 +15,7 @@ * parameters are preserved when returning as the child. If the * compiler stores them in registers (r0-r7), they should be. */ -int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) +int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, ...) { register int (*_fn)(void *arg) = fn; register void *_arg = arg; diff --git a/libc/sysdeps/linux/avr32/mmap.c b/libc/sysdeps/linux/avr32/mmap.c index 2ee025a26..b3d8b98c1 100644 --- a/libc/sysdeps/linux/avr32/mmap.c +++ b/libc/sysdeps/linux/avr32/mmap.c @@ -11,10 +11,10 @@ #include <sys/mman.h> #include <sys/syscall.h> -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ static _syscall6(__ptr_t, mmap2, __ptr_t, addr, size_t, len, int, prot, - int, flags, int, fd, __off_t, pgoff); + int, flags, int, fd, __off_t, pgoff) __ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset) { diff --git a/libc/sysdeps/linux/avr32/sigaction.c b/libc/sysdeps/linux/avr32/sigaction.c index 6b6b3466c..05caec7ee 100644 --- a/libc/sysdeps/linux/avr32/sigaction.c +++ b/libc/sysdeps/linux/avr32/sigaction.c @@ -16,6 +16,8 @@ extern void __default_rt_sa_restorer(void); /* Experimentally off - libc_hidden_proto(memcpy) */ +extern __typeof(sigaction) __libc_sigaction; + /* * If act is not NULL, change the action for sig to *act. * If oact is not NULL, put the old action for sig in *oact. @@ -53,7 +55,7 @@ int __libc_sigaction(int signum, const struct sigaction *act, } #ifndef LIBC_SIGACTION -libc_hidden_proto(sigaction) +/* libc_hidden_proto(sigaction) */ weak_alias(__libc_sigaction, sigaction) libc_hidden_weak(sigaction) #endif diff --git a/libc/sysdeps/linux/bfin/__longjmp.S b/libc/sysdeps/linux/bfin/__longjmp.S index 418d591e2..673cd30e8 100644 --- a/libc/sysdeps/linux/bfin/__longjmp.S +++ b/libc/sysdeps/linux/bfin/__longjmp.S @@ -15,7 +15,7 @@ ___longjmp: P0 = R0; R0 = [P0 + 0x00]; - [--SP] = R0; // Put P0 on the stack + [--SP] = R0; /* Put P0 on the stack */ P1 = [P0 + 0x04]; P2 = [P0 + 0x08]; @@ -24,12 +24,12 @@ ___longjmp: P5 = [P0 + 0x14]; FP = [P0 + 0x18]; - R0 = [SP++]; // Grab P0 from old stack - SP = [P0 + 0x1C]; // Update Stack Pointer - [--SP] = R0; // Put P0 on new stack - [--SP] = R1; // Put VAL arg on new stack + R0 = [SP++]; /* Grab P0 from old stack */ + SP = [P0 + 0x1C]; /* Update Stack Pointer */ + [--SP] = R0; /* Put P0 on new stack */ + [--SP] = R1; /* Put VAL arg on new stack */ - R0 = [P0 + 0x20]; // Data Registers + R0 = [P0 + 0x20]; /* Data Registers */ R1 = [P0 + 0x24]; R2 = [P0 + 0x28]; R3 = [P0 + 0x2C]; @@ -41,12 +41,12 @@ ___longjmp: R0 = [P0 + 0x40]; ASTAT = R0; - R0 = [P0 + 0x44]; // Loop Counters + R0 = [P0 + 0x44]; /* Loop Counters */ LC0 = R0; R0 = [P0 + 0x48]; LC1 = R0; - R0 = [P0 + 0x4C]; // Accumulators + R0 = [P0 + 0x4C]; /* Accumulators */ A0.W = R0; R0 = [P0 + 0x50]; A0.X = R0; @@ -55,7 +55,7 @@ ___longjmp: R0 = [P0 + 0x58]; A1.X = R0; - R0 = [P0 + 0x5C]; // Index Registers + R0 = [P0 + 0x5C]; /* Index Registers */ I0 = R0; R0 = [P0 + 0x60]; I1 = R0; @@ -64,7 +64,7 @@ ___longjmp: R0 = [P0 + 0x68]; I3 = R0; - R0 = [P0 + 0x6C]; // Modifier Registers + R0 = [P0 + 0x6C]; /* Modifier Registers */ M0 = R0; R0 = [P0 + 0x70]; M1 = R0; @@ -73,7 +73,7 @@ ___longjmp: R0 = [P0 + 0x78]; M3 = R0; - R0 = [P0 + 0x7C]; // Length Registers + R0 = [P0 + 0x7C]; /* Length Registers */ L0 = R0; R0 = [P0 + 0x80]; L1 = R0; @@ -82,7 +82,7 @@ ___longjmp: R0 = [P0 + 0x88]; L3 = R0; - R0 = [P0 + 0x8C]; // Base Registers + R0 = [P0 + 0x8C]; /* Base Registers */ B0 = R0; R0 = [P0 + 0x90]; B1 = R0; @@ -91,7 +91,7 @@ ___longjmp: R0 = [P0 + 0x98]; B3 = R0; - R0 = [P0 + 0x9C]; // Return Address (PC) + R0 = [P0 + 0x9C]; /* Return Address (PC) */ RETS = R0; R0 = [SP++]; diff --git a/libc/sysdeps/linux/bfin/bits/elf-fdpic.h b/libc/sysdeps/linux/bfin/bits/elf-fdpic.h index 905648054..b7e87b8e9 100644 --- a/libc/sysdeps/linux/bfin/bits/elf-fdpic.h +++ b/libc/sysdeps/linux/bfin/bits/elf-fdpic.h @@ -64,7 +64,7 @@ struct elf32_fdpic_loadaddr { /* Map a pointer's VMA to its corresponding address according to the load map. */ -inline static void * +static __always_inline void * __reloc_pointer (void *p, const struct elf32_fdpic_loadmap *map) { diff --git a/libc/sysdeps/linux/bfin/bits/fcntl.h b/libc/sysdeps/linux/bfin/bits/fcntl.h index cb86c8a90..52aed58b9 100644 --- a/libc/sysdeps/linux/bfin/bits/fcntl.h +++ b/libc/sysdeps/linux/bfin/bits/fcntl.h @@ -185,8 +185,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -197,7 +196,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -210,18 +208,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/bfin/brk.c b/libc/sysdeps/linux/bfin/brk.c index 64480453e..88b82cf64 100644 --- a/libc/sysdeps/linux/bfin/brk.c +++ b/libc/sysdeps/linux/bfin/brk.c @@ -8,7 +8,7 @@ #include <unistd.h> #include <sys/syscall.h> -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ /* This must be initialized data because commons can't have aliases. */ void * __curbrk attribute_hidden = 0; diff --git a/libc/sysdeps/linux/bfin/bsd-_setjmp.S b/libc/sysdeps/linux/bfin/bsd-_setjmp.S index 8ca2bbec9..61cb53f06 100644 --- a/libc/sysdeps/linux/bfin/bsd-_setjmp.S +++ b/libc/sysdeps/linux/bfin/bsd-_setjmp.S @@ -12,20 +12,20 @@ .align 4; __setjmp: - [--SP] = P0; // Save P0 + [--SP] = P0; /* Save P0 */ P0 = R0; R0 = [SP++]; - [P0 + 0x00] = R0; // Save saved P0 + [P0 + 0x00] = R0; /* Save saved P0 */ [P0 + 0x04] = P1; [P0 + 0x08] = P2; [P0 + 0x0C] = P3; [P0 + 0x10] = P4; [P0 + 0x14] = P5; - [P0 + 0x18] = FP; // Frame Pointer - [P0 + 0x1C] = SP; // Stack Pointer + [P0 + 0x18] = FP; /* Frame Pointer */ + [P0 + 0x1C] = SP; /* Stack Pointer */ - [P0 + 0x20] = P0; // Data Registers + [P0 + 0x20] = P0; /* Data Registers */ [P0 + 0x24] = R1; [P0 + 0x28] = R2; [P0 + 0x2C] = R3; @@ -37,12 +37,12 @@ __setjmp: R0 = ASTAT; [P0 + 0x40] = R0; - R0 = LC0; // Loop Counters + R0 = LC0; /* Loop Counters */ [P0 + 0x44] = R0; R0 = LC1; [P0 + 0x48] = R0; - R0 = A0.W; // Accumulators + R0 = A0.W; /* Accumulators */ [P0 + 0x4C] = R0; R0 = A0.X; [P0 + 0x50] = R0; @@ -51,7 +51,7 @@ __setjmp: R0 = A1.X; [P0 + 0x58] = R0; - R0 = I0; // Index Registers + R0 = I0; /* Index Registers */ [P0 + 0x5C] = R0; R0 = I1; [P0 + 0x60] = R0; @@ -60,7 +60,7 @@ __setjmp: R0 = I3; [P0 + 0x68] = R0; - R0 = M0; // Modifier Registers + R0 = M0; /* Modifier Registers */ [P0 + 0x6C] = R0; R0 = M1; [P0 + 0x70] = R0; @@ -69,7 +69,7 @@ __setjmp: R0 = M3; [P0 + 0x78] = R0; - R0 = L0; // Length Registers + R0 = L0; /* Length Registers */ [P0 + 0x7c] = R0; R0 = L1; [P0 + 0x80] = R0; @@ -78,7 +78,7 @@ __setjmp: R0 = L3; [P0 + 0x88] = R0; - R0 = B0; // Base Registers + R0 = B0; /* Base Registers */ [P0 + 0x8C] = R0; R0 = B1; [P0 + 0x90] = R0; diff --git a/libc/sysdeps/linux/bfin/crtreloc.c b/libc/sysdeps/linux/bfin/crtreloc.c index 5e038256a..408ded2f8 100644 --- a/libc/sysdeps/linux/bfin/crtreloc.c +++ b/libc/sysdeps/linux/bfin/crtreloc.c @@ -41,7 +41,7 @@ union word { /* Compute the runtime address of pointer in the range [p,e), and then map the pointer pointed by it. */ -inline static void *** +static __always_inline void *** reloc_range_indirect (void ***p, void ***e, const struct elf32_fdpic_loadmap *map) { @@ -102,7 +102,7 @@ __self_reloc (const struct elf32_fdpic_loadmap *map, need. */ /* Remap pointers in [p,e). */ -inline static void** +static __always_inline void** reloc_range (void **p, void **e, const struct elf32_fdpic_loadmap *map) { diff --git a/libc/sysdeps/linux/bfin/dma-memcpy.c b/libc/sysdeps/linux/bfin/dma-memcpy.c index 6d7a5b855..274b99e8c 100644 --- a/libc/sysdeps/linux/bfin/dma-memcpy.c +++ b/libc/sysdeps/linux/bfin/dma-memcpy.c @@ -2,5 +2,5 @@ #include <errno.h> #include <sys/syscall.h> -_syscall3 (__ptr_t, dma_memcpy, __ptr_t, dest, __ptr_t, src, size_t, len); +_syscall3 (__ptr_t, dma_memcpy, __ptr_t, dest, __ptr_t, src, size_t, len) diff --git a/libc/sysdeps/linux/bfin/sram-alloc.c b/libc/sysdeps/linux/bfin/sram-alloc.c index f0e8bce65..6b33b2670 100644 --- a/libc/sysdeps/linux/bfin/sram-alloc.c +++ b/libc/sysdeps/linux/bfin/sram-alloc.c @@ -2,5 +2,5 @@ #include <errno.h> #include <sys/syscall.h> -_syscall2 (__ptr_t, sram_alloc, size_t, len, unsigned long, flags); +_syscall2 (__ptr_t, sram_alloc, size_t, len, unsigned long, flags) diff --git a/libc/sysdeps/linux/bfin/sram-free.c b/libc/sysdeps/linux/bfin/sram-free.c index 02bf5d52e..0fba936c8 100644 --- a/libc/sysdeps/linux/bfin/sram-free.c +++ b/libc/sysdeps/linux/bfin/sram-free.c @@ -2,5 +2,5 @@ #include <errno.h> #include <sys/syscall.h> -_syscall1 (__ptr_t, sram_free, __ptr_t, addr); +_syscall1 (__ptr_t, sram_free, __ptr_t, addr) diff --git a/libc/sysdeps/linux/bfin/sys/io.h b/libc/sysdeps/linux/bfin/sys/io.h index 68639902c..81762beca 100644 --- a/libc/sysdeps/linux/bfin/sys/io.h +++ b/libc/sysdeps/linux/bfin/sys/io.h @@ -28,6 +28,7 @@ __BEGIN_DECLS permission off for that range. This call requires root privileges. */ extern int ioperm (unsigned long int __from, unsigned long int __num, int __turn_on) __THROW; +libc_hidden_proto(ioperm) /* Set the I/O privilege level to LEVEL. If LEVEL is nonzero, permission to access any I/O port is granted. This call requires diff --git a/libc/sysdeps/linux/cris/bits/fcntl.h b/libc/sysdeps/linux/cris/bits/fcntl.h index 944159ca6..a2106ef9a 100644 --- a/libc/sysdeps/linux/cris/bits/fcntl.h +++ b/libc/sysdeps/linux/cris/bits/fcntl.h @@ -186,8 +186,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -198,7 +197,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -211,18 +209,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/cris/bits/mathcalls.h b/libc/sysdeps/linux/cris/bits/mathcalls.h deleted file mode 100644 index c1181f737..000000000 --- a/libc/sysdeps/linux/cris/bits/mathcalls.h +++ /dev/null @@ -1,333 +0,0 @@ -/* Prototype declarations for math functions; helper file for <math.h>. - Copyright (C) 1996,1997,1998,1999,2000,2001 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* NOTE: Because of the special way this file is used by <math.h>, this - file must NOT be protected from multiple inclusion as header files - usually are. - - This file provides prototype declarations for the math functions. - Most functions are declared using the macro: - - __MATHCALL (NAME,[_r], (ARGS...)); - - This means there is a function `NAME' returning `double' and a function - `NAMEf' returning `float'. Each place `_Mdouble_' appears in the - prototype, that is actually `double' in the prototype for `NAME' and - `float' in the prototype for `NAMEf'. Reentrant variant functions are - called `NAME_r' and `NAMEf_r'. - - Functions returning other types like `int' are declared using the macro: - - __MATHDECL (TYPE, NAME,[_r], (ARGS...)); - - This is just like __MATHCALL but for a function returning `TYPE' - instead of `_Mdouble_'. In all of these cases, there is still - both a `NAME' and a `NAMEf' that takes `float' arguments. - - Note that there must be no whitespace before the argument passed for - NAME, to make token pasting work with -traditional. */ - -#ifndef _MATH_H - #error "Never include <bits/mathcalls.h> directly; include <math.h> instead." -#endif - - -/* Trigonometric functions. */ - -/* Arc cosine of X. */ -__MATHCALL (acos,, (_Mdouble_ __x)); -/* Arc sine of X. */ -__MATHCALL (asin,, (_Mdouble_ __x)); -/* Arc tangent of X. */ -__MATHCALL (atan,, (_Mdouble_ __x)); -/* Arc tangent of Y/X. */ -__MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x)); - -/* Cosine of X. */ -__MATHCALL (cos,, (_Mdouble_ __x)); -/* Sine of X. */ -__MATHCALL (sin,, (_Mdouble_ __x)); -/* Tangent of X. */ -__MATHCALL (tan,, (_Mdouble_ __x)); - -#ifdef __USE_GNU -/* Cosine and sine of X. */ -__MATHDECL (void,sincos,, - (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx)); -#endif - -/* Hyperbolic functions. */ - -/* Hyperbolic cosine of X. */ -__MATHCALL (cosh,, (_Mdouble_ __x)); -/* Hyperbolic sine of X. */ -__MATHCALL (sinh,, (_Mdouble_ __x)); -/* Hyperbolic tangent of X. */ -__MATHCALL (tanh,, (_Mdouble_ __x)); - -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -/* Hyperbolic arc cosine of X. */ -__MATHCALL (acosh,, (_Mdouble_ __x)); -/* Hyperbolic arc sine of X. */ -__MATHCALL (asinh,, (_Mdouble_ __x)); -/* Hyperbolic arc tangent of X. */ -__MATHCALL (atanh,, (_Mdouble_ __x)); -#endif - -/* Exponential and logarithmic functions. */ - -/* Exponential function of X. */ -__MATHCALL (exp,, (_Mdouble_ __x)); - -#ifdef __USE_GNU -/* A function missing in all standards: compute exponent to base ten. */ -__MATHCALL (exp10,, (_Mdouble_ __x)); -/* Another name occasionally used. */ -__MATHCALL (pow10,, (_Mdouble_ __x)); -#endif - -/* Break VALUE into a normalized fraction and an integral power of 2. */ -__MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent)); - -/* X times (two to the EXP power). */ -__MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent)); - -/* Natural logarithm of X. */ -__MATHCALL (log,, (_Mdouble_ __x)); - -/* Base-ten logarithm of X. */ -__MATHCALL (log10,, (_Mdouble_ __x)); - -/* Break VALUE into integral and fractional parts. */ -__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)); - -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -/* Return exp(X) - 1. */ -__MATHCALL (expm1,, (_Mdouble_ __x)); - -/* Return log(1 + X). */ -__MATHCALL (log1p,, (_Mdouble_ __x)); - -/* Return the base 2 signed integral exponent of X. */ -__MATHCALL (logb,, (_Mdouble_ __x)); -#endif - -#ifdef __USE_ISOC99 -/* Compute base-2 exponential of X. */ -__MATHCALL (exp2,, (_Mdouble_ __x)); - -/* Compute base-2 logarithm of X. */ -__MATHCALL (log2,, (_Mdouble_ __x)); -#endif - - -/* Power functions. */ - -/* Return X to the Y power. */ -__MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y)); - -/* Return the square root of X. */ -__MATHCALL (sqrt,, (_Mdouble_ __x)); - -#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 -/* Return `sqrt(X*X + Y*Y)'. */ -__MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y)); -#endif - -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -/* Return the cube root of X. */ -__MATHCALL (cbrt,, (_Mdouble_ __x)); -#endif - - -/* Nearest integer, absolute value, and remainder functions. */ - -/* Smallest integral value not less than X. */ -__MATHCALL (ceil,, (_Mdouble_ __x)); - -/* Absolute value of X. */ -__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__)); - -/* Largest integer not greater than X. */ -__MATHCALL (floor,, (_Mdouble_ __x)); - -/* Floating-point modulo remainder of X/Y. */ -__MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); - - -/* Return 0 if VALUE is finite or NaN, +1 if it - is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_1 (int,__isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); - -/* Return nonzero if VALUE is finite and not NaN. */ -__MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); - -#ifdef __USE_MISC -/* Return 0 if VALUE is finite or NaN, +1 if it - is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); - -/* Return nonzero if VALUE is finite and not NaN. */ -__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); - -/* Return the remainder of X/Y. */ -__MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); - - -/* Return the fractional part of X after dividing out `ilogb (X)'. */ -__MATHCALL (significand,, (_Mdouble_ __x)); -#endif /* Use misc. */ - -#if defined __USE_MISC || defined __USE_ISOC99 -/* Return X with its signed changed to Y's. */ -__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); -#endif - -#ifdef __USE_ISOC99 -/* Return representation of NaN for double type. */ -__MATHCALLX (nan,, (__const char *__tagb), (__const__)); -#endif - - -/* Return nonzero if VALUE is not a number. */ -__MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); - -#if defined __USE_MISC || defined __USE_XOPEN -/* Return nonzero if VALUE is not a number. */ -__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); - -/* Bessel functions. */ -__MATHCALL (j0,, (_Mdouble_)); -__MATHCALL (j1,, (_Mdouble_)); -__MATHCALL (jn,, (int, _Mdouble_)); -__MATHCALL (y0,, (_Mdouble_)); -__MATHCALL (y1,, (_Mdouble_)); -__MATHCALL (yn,, (int, _Mdouble_)); -#endif - - -#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 -/* Error and gamma functions. */ -__MATHCALL (erf,, (_Mdouble_)); -__MATHCALL (erfc,, (_Mdouble_)); -__MATHCALL (lgamma,, (_Mdouble_)); -#endif - -#ifdef __USE_ISOC99 -__MATHCALL (tgamma,, (_Mdouble_)); -#endif - -#if defined __USE_MISC || defined __USE_XOPEN -/* Obsolete alias for `lgamma'. */ -__MATHCALL (gamma,, (_Mdouble_)); -#endif - -#ifdef __USE_MISC -/* Reentrant version of lgamma. This function uses the global variable - `signgam'. The reentrant version instead takes a pointer and stores - the value through it. */ -__MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp)); -#endif - - -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -/* Return the integer nearest X in the direction of the - prevailing rounding mode. */ -__MATHCALL (rint,, (_Mdouble_ __x)); - -/* Return X + epsilon if X < Y, X - epsilon if X > Y. */ -__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); -# ifdef __USE_ISOC99 -__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); -# endif - -/* Return the remainder of integer divison X / Y with infinite precision. */ -__MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y)); - -# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED -/* Return X times (2 to the Nth power). */ -__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)); -# endif - -# if defined __USE_MISC || defined __USE_ISOC99 -/* Return X times (2 to the Nth power). */ -__MATHCALL (scalbn,, (_Mdouble_ __x, int __n)); -# endif - -/* Return the binary exponent of X, which must be nonzero. */ -__MATHDECL (int,ilogb,, (_Mdouble_ __x)); -#endif - -#ifdef __USE_ISOC99 -/* Return X times (2 to the Nth power). */ -__MATHCALL (scalbln,, (_Mdouble_ __x, long int __n)); - -/* Round X to integral value in floating-point format using current - rounding direction, but do not raise inexact exception. */ -__MATHCALL (nearbyint,, (_Mdouble_ __x)); - -/* Round X to nearest integral value, rounding halfway cases away from - zero. */ -__MATHCALL (round,, (_Mdouble_ __x)); - -/* Round X to the integral value in floating-point format nearest but - not larger in magnitude. */ -__MATHCALLX (trunc,, (_Mdouble_ __x), (__const__)); - -/* Compute remainder of X and Y and put in *QUO a value with sign of x/y - and magnitude congruent `mod 2^n' to the magnitude of the integral - quotient x/y, with n >= 3. */ -__MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)); - - -/* Conversion functions. */ - -/* Round X to nearest integral value according to current rounding - direction. */ -__MATHDECL (long int,lrint,, (_Mdouble_ __x)); -__MATHDECL (long long int,llrint,, (_Mdouble_ __x)); - -/* Round X to nearest integral value, rounding halfway cases away from - zero. */ -__MATHDECL (long int,lround,, (_Mdouble_ __x)); -__MATHDECL (long long int,llround,, (_Mdouble_ __x)); - - -/* Return positive difference between X and Y. */ -__MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y)); - -/* Return maximum numeric value from X and Y. */ -__MATHCALL (fmax,, (_Mdouble_ __x, _Mdouble_ __y)); - -/* Return minimum numeric value from X and Y. */ -__MATHCALL (fmin,, (_Mdouble_ __x, _Mdouble_ __y)); - - -/* Classify given number. */ -__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value)) - __attribute__ ((__const__)); - -/* Test for negative number. */ -__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value)) - __attribute__ ((__const__)); - - -/* Multiply-add function computed as a ternary operation. */ -__MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); -#endif /* Use ISO C99. */ diff --git a/libc/sysdeps/linux/cris/brk.c b/libc/sysdeps/linux/cris/brk.c index ae99e109c..f58773880 100644 --- a/libc/sysdeps/linux/cris/brk.c +++ b/libc/sysdeps/linux/cris/brk.c @@ -12,7 +12,7 @@ extern void * __curbrk attribute_hidden; extern int __init_brk (void) attribute_hidden; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk(void * end_data_seg) { if (__init_brk () == 0) { diff --git a/libc/sysdeps/linux/cris/crti.S b/libc/sysdeps/linux/cris/crti.S index 0740c765d..d9e1397da 100644 --- a/libc/sysdeps/linux/cris/crti.S +++ b/libc/sysdeps/linux/cris/crti.S @@ -10,8 +10,12 @@ _init: move $srp,$r1 subq 4,$sp move.d $r0,[$sp] +#ifdef __arch_v32 + lapc _GLOBAL_OFFSET_TABLE_,$r0 +#else move.d $pc,$r0 sub.d .:GOTOFF,$r0 +#endif .align 1 .section .fini @@ -24,6 +28,10 @@ _fini: move $srp,$r1 subq 4,$sp move.d $r0,[$sp] +#ifdef __arch_v32 + lapc _GLOBAL_OFFSET_TABLE_,$r0 +#else move.d $pc,$r0 sub.d .:GOTOFF,$r0 +#endif .align 1 diff --git a/libc/sysdeps/linux/cris/fork.c b/libc/sysdeps/linux/cris/fork.c index 20b546901..e548e80ec 100644 --- a/libc/sysdeps/linux/cris/fork.c +++ b/libc/sysdeps/linux/cris/fork.c @@ -14,6 +14,6 @@ SYSCALL__ (__libc_fork, 0) R0&-1==R0, and the child gets R0&0==0. */ /* i dunno what the blurb above is useful for. we just return. */ __asm__("ret\n\tnop"); -libc_hidden_proto(fork) +/* libc_hidden_proto(fork) */ weak_alias(__libc_fork,fork) libc_hidden_weak(fork) diff --git a/libc/sysdeps/linux/cris/sbrk.c b/libc/sysdeps/linux/cris/sbrk.c index 830d01dd6..f9b55be7a 100644 --- a/libc/sysdeps/linux/cris/sbrk.c +++ b/libc/sysdeps/linux/cris/sbrk.c @@ -13,7 +13,7 @@ extern void * __curbrk attribute_hidden; extern int __init_brk (void) attribute_hidden; -libc_hidden_proto(sbrk) +/* libc_hidden_proto(sbrk) */ void * sbrk(intptr_t increment) { diff --git a/libc/sysdeps/linux/e1/bits/fcntl.h b/libc/sysdeps/linux/e1/bits/fcntl.h index 97aa632c9..45ca3a107 100644 --- a/libc/sysdeps/linux/e1/bits/fcntl.h +++ b/libc/sysdeps/linux/e1/bits/fcntl.h @@ -182,8 +182,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -194,7 +193,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -207,18 +205,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, @@ -235,4 +231,4 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, #endif __END_DECLS - +#endif /* LINUX_SPECIFIC */ diff --git a/libc/sysdeps/linux/e1/bits/fenvinline.h b/libc/sysdeps/linux/e1/bits/fenvinline.h index a16fc0fb2..255624713 100644 --- a/libc/sysdeps/linux/e1/bits/fenvinline.h +++ b/libc/sysdeps/linux/e1/bits/fenvinline.h @@ -124,7 +124,7 @@ static __inline__ feclearexcept(int __excepts) * excepts. You can test for an exception either after * an FP instruction or within a SIGFPE handler */ -inline int fetestexcept(int __excepts) +__inline__ int fetestexcept(int __excepts) { unsigned int G2, G2en, G2dis; unsigned int enabled_excepts, disabled_excepts; diff --git a/libc/sysdeps/linux/e1/crt1.c b/libc/sysdeps/linux/e1/crt1.c index 1e1c8be8e..dd8ed6a26 100644 --- a/libc/sysdeps/linux/e1/crt1.c +++ b/libc/sysdeps/linux/e1/crt1.c @@ -26,7 +26,7 @@ * is linking when the main() function is in a static library (.a) * we can be sure that main() actually gets linked in */ extern void main(int argc,void *argv,void *envp); -//void (*mainp)(int argc,void *argv,void *envp) = main; +/* void (*mainp)(int argc,void *argv,void *envp) = main; */ void __uClibc_main(int argc,void *argv,void *envp); diff --git a/libc/sysdeps/linux/e1/longjmp.c b/libc/sysdeps/linux/e1/longjmp.c index 9f04e7b5c..bd1b82976 100644 --- a/libc/sysdeps/linux/e1/longjmp.c +++ b/libc/sysdeps/linux/e1/longjmp.c @@ -43,7 +43,7 @@ void longjmp(jmp_buf state, int value ) #undef _state_ } -libc_hidden_proto(sigprocmask) +/* libc_hidden_proto(sigprocmask) */ void siglongjmp(sigjmp_buf state, int value ) { diff --git a/libc/sysdeps/linux/e1/setjmp.c b/libc/sysdeps/linux/e1/setjmp.c index bda18b13a..2d2edec5d 100644 --- a/libc/sysdeps/linux/e1/setjmp.c +++ b/libc/sysdeps/linux/e1/setjmp.c @@ -7,7 +7,7 @@ #include <stdio.h> #include <signal.h> -libc_hidden_proto(sigprocmask) +/* libc_hidden_proto(sigprocmask) */ int setjmp( jmp_buf state) { diff --git a/libc/sysdeps/linux/e1/vfork.c b/libc/sysdeps/linux/e1/vfork.c index 34ae5833c..abcd200e7 100644 --- a/libc/sysdeps/linux/e1/vfork.c +++ b/libc/sysdeps/linux/e1/vfork.c @@ -9,7 +9,7 @@ #include <errno.h> #define __NR___vfork __NR_vfork -attribute_hidden _syscall0(pid_t, __vfork); -libc_hidden_proto(vfork) +attribute_hidden _syscall0(pid_t, __vfork) +/* libc_hidden_proto(vfork) */ weak_alias(__vfork,vfork) libc_hidden_weak(vfork) diff --git a/libc/sysdeps/linux/frv/__init_brk.c b/libc/sysdeps/linux/frv/__init_brk.c index 07cf32022..7e4c8d13f 100644 --- a/libc/sysdeps/linux/frv/__init_brk.c +++ b/libc/sysdeps/linux/frv/__init_brk.c @@ -7,7 +7,7 @@ void * __curbrk attribute_hidden = 0; #define __NR__brk __NR_brk -attribute_hidden _syscall1(void *, _brk, void *, ptr); +attribute_hidden _syscall1(void *, _brk, void *, ptr) extern int __init_brk(void) attribute_hidden; int diff --git a/libc/sysdeps/linux/frv/bits/elf-fdpic.h b/libc/sysdeps/linux/frv/bits/elf-fdpic.h index 905648054..b7e87b8e9 100644 --- a/libc/sysdeps/linux/frv/bits/elf-fdpic.h +++ b/libc/sysdeps/linux/frv/bits/elf-fdpic.h @@ -64,7 +64,7 @@ struct elf32_fdpic_loadaddr { /* Map a pointer's VMA to its corresponding address according to the load map. */ -inline static void * +static __always_inline void * __reloc_pointer (void *p, const struct elf32_fdpic_loadmap *map) { diff --git a/libc/sysdeps/linux/frv/bits/fcntl.h b/libc/sysdeps/linux/frv/bits/fcntl.h index a53830ca8..f0f1b9384 100644 --- a/libc/sysdeps/linux/frv/bits/fcntl.h +++ b/libc/sysdeps/linux/frv/bits/fcntl.h @@ -164,8 +164,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -176,7 +175,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -189,18 +187,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/frv/brk.c b/libc/sysdeps/linux/frv/brk.c index c69c97ad6..cac45bae2 100644 --- a/libc/sysdeps/linux/frv/brk.c +++ b/libc/sysdeps/linux/frv/brk.c @@ -13,7 +13,7 @@ extern void * __curbrk attribute_hidden; extern int __init_brk (void) attribute_hidden; extern void *_brk(void *ptr) attribute_hidden; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk(void * end_data_seg) { if (__init_brk () == 0) diff --git a/libc/sysdeps/linux/frv/crtreloc.c b/libc/sysdeps/linux/frv/crtreloc.c index e025b619f..ba934bc5a 100644 --- a/libc/sysdeps/linux/frv/crtreloc.c +++ b/libc/sysdeps/linux/frv/crtreloc.c @@ -34,7 +34,7 @@ Cambridge, MA 02139, USA. */ /* Compute the runtime address of pointer in the range [p,e), and then map the pointer pointed by it. */ -inline static void *** +static __always_inline void *** reloc_range_indirect (void ***p, void ***e, const struct elf32_fdpic_loadmap *map) { @@ -79,7 +79,7 @@ __self_reloc (const struct elf32_fdpic_loadmap *map, need. */ /* Remap pointers in [p,e). */ -inline static void** +static __always_inline void** reloc_range (void **p, void **e, const struct elf32_fdpic_loadmap *map) { diff --git a/libc/sysdeps/linux/frv/fstat.c b/libc/sysdeps/linux/frv/fstat.c index fc8a25af5..c6aceb62f 100644 --- a/libc/sysdeps/linux/frv/fstat.c +++ b/libc/sysdeps/linux/frv/fstat.c @@ -13,6 +13,6 @@ #include <unistd.h> #include <sys/stat.h> -libc_hidden_proto(fstat) -_syscall2(int, fstat, int, fd, struct stat *, buf); +/* libc_hidden_proto(fstat) */ +_syscall2(int, fstat, int, fd, struct stat *, buf) libc_hidden_def(fstat) diff --git a/libc/sysdeps/linux/frv/fstat64.c b/libc/sysdeps/linux/frv/fstat64.c index dcb9b922c..ee0347288 100644 --- a/libc/sysdeps/linux/frv/fstat64.c +++ b/libc/sysdeps/linux/frv/fstat64.c @@ -14,7 +14,7 @@ #include <sys/stat.h> #ifdef __UCLIBC_HAS_LFS__ -libc_hidden_proto(fstat64) -_syscall2(int, fstat64, int, fd, struct stat64 *, buf); +/* libc_hidden_proto(fstat64) */ +_syscall2(int, fstat64, int, fd, struct stat64 *, buf) libc_hidden_def(fstat64) #endif diff --git a/libc/sysdeps/linux/frv/lstat.c b/libc/sysdeps/linux/frv/lstat.c index 7a0297bfa..ad87db6fc 100644 --- a/libc/sysdeps/linux/frv/lstat.c +++ b/libc/sysdeps/linux/frv/lstat.c @@ -13,6 +13,6 @@ #include <unistd.h> #include <sys/stat.h> -libc_hidden_proto(lstat) -_syscall2(int, lstat, const char *, file_name, struct stat *, buf); +/* libc_hidden_proto(lstat) */ +_syscall2(int, lstat, const char *, file_name, struct stat *, buf) libc_hidden_def(lstat) diff --git a/libc/sysdeps/linux/frv/lstat64.c b/libc/sysdeps/linux/frv/lstat64.c index e95653ed5..d4e139314 100644 --- a/libc/sysdeps/linux/frv/lstat64.c +++ b/libc/sysdeps/linux/frv/lstat64.c @@ -14,7 +14,7 @@ #include <sys/stat.h> #ifdef __UCLIBC_HAS_LFS__ -libc_hidden_proto(lstat64) -_syscall2(int, lstat64, const char *, file_name, struct stat64 *, buf); +/* libc_hidden_proto(lstat64) */ +_syscall2(int, lstat64, const char *, file_name, struct stat64 *, buf) libc_hidden_def(lstat64) #endif diff --git a/libc/sysdeps/linux/frv/mmap.c b/libc/sysdeps/linux/frv/mmap.c index f251babbb..360b102a1 100644 --- a/libc/sysdeps/linux/frv/mmap.c +++ b/libc/sysdeps/linux/frv/mmap.c @@ -29,11 +29,11 @@ #include <sys/syscall.h> #include <sys/mman.h> -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ #define __NR___syscall_mmap2 __NR_mmap2 static __inline__ _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, - size_t, len, int, prot, int, flags, int, fd, off_t, offset); + size_t, len, int, prot, int, flags, int, fd, off_t, offset) /* This is always 12, even on architectures where PAGE_SHIFT != 12. */ # ifndef MMAP2_PAGE_SHIFT diff --git a/libc/sysdeps/linux/frv/sbrk.c b/libc/sysdeps/linux/frv/sbrk.c index a1ff2a148..616b81318 100644 --- a/libc/sysdeps/linux/frv/sbrk.c +++ b/libc/sysdeps/linux/frv/sbrk.c @@ -8,7 +8,7 @@ extern void * __curbrk attribute_hidden; extern int __init_brk (void) attribute_hidden; extern void *_brk(void *ptr) attribute_hidden; -libc_hidden_proto(sbrk) +/* libc_hidden_proto(sbrk) */ void * sbrk(intptr_t increment) { diff --git a/libc/sysdeps/linux/frv/stat.c b/libc/sysdeps/linux/frv/stat.c index 6c3f0b962..611bddf61 100644 --- a/libc/sysdeps/linux/frv/stat.c +++ b/libc/sysdeps/linux/frv/stat.c @@ -13,6 +13,6 @@ #include <unistd.h> #include <sys/stat.h> -libc_hidden_proto(stat) -_syscall2(int, stat, const char *, file_name, struct stat *, buf); +/* libc_hidden_proto(stat) */ +_syscall2(int, stat, const char *, file_name, struct stat *, buf) libc_hidden_def(stat) diff --git a/libc/sysdeps/linux/frv/stat64.c b/libc/sysdeps/linux/frv/stat64.c index 659ad8ae2..45320ecd7 100644 --- a/libc/sysdeps/linux/frv/stat64.c +++ b/libc/sysdeps/linux/frv/stat64.c @@ -14,7 +14,7 @@ #include <sys/stat.h> #ifdef __UCLIBC_HAS_LFS__ -libc_hidden_proto(stat64) -_syscall2(int, stat64, const char *, file_name, struct stat64 *, buf); +/* libc_hidden_proto(stat64) */ +_syscall2(int, stat64, const char *, file_name, struct stat64 *, buf) libc_hidden_def(stat64) #endif diff --git a/libc/sysdeps/linux/h8300/bits/fcntl.h b/libc/sysdeps/linux/h8300/bits/fcntl.h index 97aa632c9..a3da35ae2 100644 --- a/libc/sysdeps/linux/h8300/bits/fcntl.h +++ b/libc/sysdeps/linux/h8300/bits/fcntl.h @@ -182,8 +182,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -194,7 +193,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -207,18 +205,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/h8300/brk.c b/libc/sysdeps/linux/h8300/brk.c index 9eab66060..44c867417 100644 --- a/libc/sysdeps/linux/h8300/brk.c +++ b/libc/sysdeps/linux/h8300/brk.c @@ -12,7 +12,7 @@ /* This must be initialized data because commons can't have aliases. */ void *__curbrk attribute_hidden = 0; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk (void *addr) { void *newbrk; diff --git a/libc/sysdeps/linux/hppa/bits/fcntl.h b/libc/sysdeps/linux/hppa/bits/fcntl.h index ccd1d43de..cc23bf81b 100644 --- a/libc/sysdeps/linux/hppa/bits/fcntl.h +++ b/libc/sysdeps/linux/hppa/bits/fcntl.h @@ -176,8 +176,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -188,7 +187,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -201,18 +199,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/hppa/brk.c b/libc/sysdeps/linux/hppa/brk.c index dab2d57ca..6b9604856 100644 --- a/libc/sysdeps/linux/hppa/brk.c +++ b/libc/sysdeps/linux/hppa/brk.c @@ -24,7 +24,7 @@ /* This must be initialized data because commons can't have aliases. */ void *__curbrk attribute_hidden = 0; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk (void *addr) { diff --git a/libc/sysdeps/linux/hppa/mmap.c b/libc/sysdeps/linux/hppa/mmap.c index baaee6847..9c5077acb 100644 --- a/libc/sysdeps/linux/hppa/mmap.c +++ b/libc/sysdeps/linux/hppa/mmap.c @@ -13,8 +13,8 @@ #include <sys/mman.h> #include <sys/syscall.h> -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ _syscall6(void *, mmap, void *, start, size_t, length, int, prot, - int, flags, int, fd, off_t, offset); + int, flags, int, fd, off_t, offset) libc_hidden_def(mmap) diff --git a/libc/sysdeps/linux/i386/bits/fcntl.h b/libc/sysdeps/linux/i386/bits/fcntl.h index 347d79eaf..7f0b552fd 100644 --- a/libc/sysdeps/linux/i386/bits/fcntl.h +++ b/libc/sysdeps/linux/i386/bits/fcntl.h @@ -189,8 +189,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -201,7 +200,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -214,18 +212,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/i386/bits/mathdef.h b/libc/sysdeps/linux/i386/bits/mathdef.h index a3786fc81..ec42ed5df 100644 --- a/libc/sysdeps/linux/i386/bits/mathdef.h +++ b/libc/sysdeps/linux/i386/bits/mathdef.h @@ -44,7 +44,3 @@ typedef long double double_t; /* `double' expressions are evaluated as # define FP_ILOGBNAN (-2147483647 - 1) #endif /* ISO C99 */ - -#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/libc/sysdeps/linux/i386/brk.c b/libc/sysdeps/linux/i386/brk.c index eda8ad9ce..2be9c1802 100644 --- a/libc/sysdeps/linux/i386/brk.c +++ b/libc/sysdeps/linux/i386/brk.c @@ -24,7 +24,7 @@ /* This must be initialized data because commons can't have aliases. */ void *__curbrk attribute_hidden = 0; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk (void *addr) { void *__unbounded newbrk, *__unbounded scratch; diff --git a/libc/sysdeps/linux/i386/posix_fadvise64.S b/libc/sysdeps/linux/i386/posix_fadvise64.S new file mode 100644 index 000000000..b99b35ee7 --- /dev/null +++ b/libc/sysdeps/linux/i386/posix_fadvise64.S @@ -0,0 +1,100 @@ +/* Copyright (C) 1995-2000,2002,2003,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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define _ERRNO_H 1 +#include <features.h> +#include <bits/errno.h> +#include <sys/syscall.h> + +.text +.global __libc_posix_fadvise64 +.type __libc_posix_fadvise64,%function +__libc_posix_fadvise64: +#if defined __NR_fadvise64_64 + /* Save regs */ + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + + movl $__NR_fadvise64_64, %eax /* Syscall number in %eax. */ + + movl 20(%esp), %ebx + movl 24(%esp), %ecx + movl 28(%esp), %edx + movl 32(%esp), %esi + movl 36(%esp), %edi + movl 40(%esp), %ebp + + /* Do the system call trap. */ + int $0x80 + + /* Restore regs */ + popl %edi + popl %esi + popl %ebx + popl %ebp + + /* Returns 0 on success, else an error code. */ + negl %eax + +#elif defined __NR_fadvise64 + /* Save regs */ + pushl %ebx + pushl %esi + pushl %edi +#if 0 + /* does len overflow long? */ + cmpl $0, 28(%esp) + movl $-EOVERFLOW, %eax + jne overflow +#endif + movl $__NR_fadvise64, %eax /* Syscall number in %eax. */ + + movl 16(%esp), %ebx + movl 20(%esp), %ecx + movl 24(%esp), %edx + movl 28(%esp), %esi + movl 32(%esp), %edi + + /* Do the system call trap. */ + int $0x80 +overflow: + /* Restore regs */ + popl %edi + popl %esi + popl %ebx + + /* Returns 0 on success, else an error code. */ + negl %eax + +#elif defined __UCLIBC_HAS_STUBS__ + movl $-ENOSYS, %eax + jmp __syscall_error +#endif + /* Successful; return the syscall's value. */ + ret + +.size __libc_posix_fadvise64,.-__libc_posix_fadvise64 + +libc_hidden_def(__libc_posix_fadvise64) +#if defined __UCLIBC_HAS_LFS__ && defined __UCLIBC_HAS_ADVANCED_REALTIME__ +weak_alias(__libc_posix_fadvise64,posix_fadvise64) +#endif + diff --git a/libc/sysdeps/linux/i386/sigaction.c b/libc/sysdeps/linux/i386/sigaction.c index e8729647f..32c8f64bc 100644 --- a/libc/sysdeps/linux/i386/sigaction.c +++ b/libc/sysdeps/linux/i386/sigaction.c @@ -99,11 +99,11 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa } __asm__ __volatile__ ("pushl %%ebx\n" - "movl %2, %%ebx\n" + "movl %3, %%ebx\n" "int $0x80\n" "popl %%ebx" - : "=a" (result) - : "0" (__NR_sigaction), "mr" (sig), + : "=a" (result), "=m" (koact) + : "0" (__NR_sigaction), "r" (sig), "m" (kact), "c" (act ? __ptrvalue (&kact) : 0), "d" (oact ? __ptrvalue (&koact) : 0)); @@ -124,7 +124,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa #endif #ifndef LIBC_SIGACTION -libc_hidden_proto(sigaction) +/* libc_hidden_proto(sigaction) */ weak_alias(__libc_sigaction,sigaction) libc_hidden_weak(sigaction) #endif diff --git a/libc/sysdeps/linux/i386/sync_file_range.S b/libc/sysdeps/linux/i386/sync_file_range.S new file mode 100644 index 000000000..6cdaf452a --- /dev/null +++ b/libc/sysdeps/linux/i386/sync_file_range.S @@ -0,0 +1,67 @@ +/* Copyright (C) 2006, 2007 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define _ERRNO_H 1 +#include <features.h> +#include <bits/errno.h> +#include <sys/syscall.h> + +.text +.global sync_file_range +.type sync_file_range,%function +sync_file_range: +#ifdef __NR_sync_file_range + + /* Save regs */ + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + + movl $__NR_sync_file_range, %eax /* Syscall number in %eax. */ + + movl 20(%esp), %ebx + movl 24(%esp), %ecx + movl 28(%esp), %edx + movl 32(%esp), %esi + movl 36(%esp), %edi + movl 40(%esp), %ebp + + /* Do the system call trap. */ + int $0x80 + + /* Restore regs */ + popl %ebp + popl %edi + popl %esi + popl %ebx + + /* If 0 > %eax > -4096 there was an error. */ + cmpl $-4096, %eax + ja __syscall_error +#else + movl $-ENOSYS, %eax + jmp __syscall_error +#endif + /* Successful; return the syscall's value. */ + ret + +.size sync_file_range,.-sync_file_range + +libc_hidden_def(sync_file_range) + diff --git a/libc/sysdeps/linux/i386/sys/io.h b/libc/sysdeps/linux/i386/sys/io.h index 87b99a94a..00205e4cb 100644 --- a/libc/sysdeps/linux/i386/sys/io.h +++ b/libc/sysdeps/linux/i386/sys/io.h @@ -33,6 +33,7 @@ __BEGIN_DECLS E.g., Linux/Alpha for Alpha PCs supports this. */ extern int ioperm (unsigned long int __from, unsigned long int __num, int __turn_on) __THROW; +libc_hidden_proto(ioperm) /* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to access any I/O port is granted. This call requires root diff --git a/libc/sysdeps/linux/i386/sys/perm.h b/libc/sysdeps/linux/i386/sys/perm.h index e389e6679..db67d36e0 100644 --- a/libc/sysdeps/linux/i386/sys/perm.h +++ b/libc/sysdeps/linux/i386/sys/perm.h @@ -26,6 +26,7 @@ __BEGIN_DECLS /* Set port input/output permissions. */ extern int ioperm (unsigned long int __from, unsigned long int __num, int __turn_on) __THROW; +libc_hidden_proto(ioperm) /* Change I/O privilege level. */ diff --git a/libc/sysdeps/linux/i960/bits/fcntl.h b/libc/sysdeps/linux/i960/bits/fcntl.h index 15bfc266f..31e54305e 100644 --- a/libc/sysdeps/linux/i960/bits/fcntl.h +++ b/libc/sysdeps/linux/i960/bits/fcntl.h @@ -182,8 +182,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -194,7 +193,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -207,18 +205,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/ia64/__longjmp.S b/libc/sysdeps/linux/ia64/__longjmp.S index 04c51e75e..85fe93638 100644 --- a/libc/sysdeps/linux/ia64/__longjmp.S +++ b/libc/sysdeps/linux/ia64/__longjmp.S @@ -44,18 +44,18 @@ LEAF(__longjmp) alloc r8=ar.pfs,2,1,0,0 mov r27=ar.rsc - add r2=0x98,in0 // r2 <- &jmpbuf.orig_jmp_buf_addr + add r2=0x98,in0 /* r2 <- &jmpbuf.orig_jmp_buf_addr */ ;; - ld8 r8=[r2],-16 // r8 <- orig_jmp_buf_addr + ld8 r8=[r2],-16 /* r8 <- orig_jmp_buf_addr */ mov r10=ar.bsp - and r11=~0x3,r27 // clear ar.rsc.mode + and r11=~0x3,r27 /* clear ar.rsc.mode */ ;; - flushrs // flush dirty regs to backing store (must be first in insn grp) - ld8 r23=[r2],8 // r23 <- jmpbuf.ar_bsp - sub r8=r8,in0 // r8 <- &orig_jmpbuf - &jmpbuf + flushrs /* flush dirty regs to backing store (must be first in insn grp) */ + ld8 r23=[r2],8 /* r23 <- jmpbuf.ar_bsp */ + sub r8=r8,in0 /* r8 <- &orig_jmpbuf - &jmpbuf */ ;; - ld8 r25=[r2] // r25 <- jmpbuf.ar_unat - extr.u r8=r8,3,6 // r8 <- (&orig_jmpbuf - &jmpbuf)/8 & 0x3f + ld8 r25=[r2] /* r25 <- jmpbuf.ar_unat */ + extr.u r8=r8,3,6 /* r8 <- (&orig_jmpbuf - &jmpbuf)/8 & 0x3f */ ;; cmp.lt pNeg,pPos=r8,r0 mov r2=in0 @@ -65,49 +65,49 @@ LEAF(__longjmp) (pPos) sub r17=64,r8 (pNeg) sub r17=r0,r8 ;; - mov ar.rsc=r11 // put RSE in enforced lazy mode + mov ar.rsc=r11 /* put RSE in enforced lazy mode */ shr.u r8=r25,r16 - add r3=8,in0 // r3 <- &jmpbuf.r1 + add r3=8,in0 /* r3 <- &jmpbuf.r1 */ shl r9=r25,r17 ;; or r25=r8,r9 ;; mov r26=ar.rnat - mov ar.unat=r25 // setup ar.unat (NaT bits for r1, r4-r7, and r12) + mov ar.unat=r25 /* setup ar.unat (NaT bits for r1, r4-r7, and r12) */ ;; - ld8.fill.nta sp=[r2],16 // r12 (sp) - ld8.fill.nta gp=[r3],16 // r1 (gp) - dep r11=-1,r23,3,6 // r11 <- ia64_rse_rnat_addr(jmpbuf.ar_bsp) + ld8.fill.nta sp=[r2],16 /* r12 (sp) */ + ld8.fill.nta gp=[r3],16 /* r1 (gp) */ + dep r11=-1,r23,3,6 /* r11 <- ia64_rse_rnat_addr(jmpbuf.ar_bsp) */ ;; - ld8.nta r16=[r2],16 // caller's unat - ld8.nta r17=[r3],16 // fpsr + ld8.nta r16=[r2],16 /* caller's unat */ + ld8.nta r17=[r3],16 /* fpsr */ ;; - ld8.fill.nta r4=[r2],16 // r4 - ld8.fill.nta r5=[r3],16 // r5 (gp) - cmp.geu p8,p0=r10,r11 // p8 <- (ar.bsp >= jmpbuf.ar_bsp) + ld8.fill.nta r4=[r2],16 /* r4 */ + ld8.fill.nta r5=[r3],16 /* r5 (gp) */ + cmp.geu p8,p0=r10,r11 /* p8 <- (ar.bsp >= jmpbuf.ar_bsp) */ ;; - ld8.fill.nta r6=[r2],16 // r6 - ld8.fill.nta r7=[r3],16 // r7 + ld8.fill.nta r6=[r2],16 /* r6 */ + ld8.fill.nta r7=[r3],16 /* r7 */ ;; - mov ar.unat=r16 // restore caller's unat - mov ar.fpsr=r17 // restore fpsr + mov ar.unat=r16 /* restore caller's unat */ + mov ar.fpsr=r17 /* restore fpsr */ ;; - ld8.nta r16=[r2],16 // b0 - ld8.nta r17=[r3],16 // b1 + ld8.nta r16=[r2],16 /* b0 */ + ld8.nta r17=[r3],16 /* b1 */ ;; -(p8) ld8 r26=[r11] // r26 <- *ia64_rse_rnat_addr(jmpbuf.ar_bsp) - mov ar.bspstore=r23 // restore ar.bspstore +(p8) ld8 r26=[r11] /* r26 <- *ia64_rse_rnat_addr(jmpbuf.ar_bsp) */ + mov ar.bspstore=r23 /* restore ar.bspstore */ ;; - ld8.nta r18=[r2],16 // b2 - ld8.nta r19=[r3],16 // b3 + ld8.nta r18=[r2],16 /* b2 */ + ld8.nta r19=[r3],16 /* b3 */ ;; - ld8.nta r20=[r2],16 // b4 - ld8.nta r21=[r3],16 // b5 + ld8.nta r20=[r2],16 /* b4 */ + ld8.nta r21=[r3],16 /* b5 */ ;; - ld8.nta r11=[r2],16 // ar.pfs - ld8.nta r22=[r3],56 // ar.lc + ld8.nta r11=[r2],16 /* ar.pfs */ + ld8.nta r22=[r3],56 /* ar.lc */ ;; - ld8.nta r24=[r2],32 // pr + ld8.nta r24=[r2],32 /* pr */ mov b0=r16 ;; ldf.fill.nta f2=[r2],32 @@ -149,12 +149,12 @@ LEAF(__longjmp) ldf.fill.nta f31=[r3] (p8) mov r8=1 - mov ar.rnat=r26 // restore ar.rnat + mov ar.rnat=r26 /* restore ar.rnat */ ;; - mov ar.rsc=r27 // restore ar.rsc + mov ar.rsc=r27 /* restore ar.rsc */ (p9) mov r8=in1 - invala // virt. -> phys. regnum mapping may change + invala /* virt. -> phys. regnum mapping may change */ mov pr=r24,-1 ret END(__longjmp) diff --git a/libc/sysdeps/linux/ia64/bits/fcntl.h b/libc/sysdeps/linux/ia64/bits/fcntl.h index 95efa56c6..d134c4b4f 100644 --- a/libc/sysdeps/linux/ia64/bits/fcntl.h +++ b/libc/sysdeps/linux/ia64/bits/fcntl.h @@ -161,7 +161,6 @@ struct flock64 }; #endif - /* Define some more compatibility macros to be backward compatible with BSD systems which did not managed to hide these kernel macros. */ #ifdef __USE_BSD @@ -183,8 +182,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -195,7 +193,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -208,18 +205,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/ia64/bits/mathdef.h b/libc/sysdeps/linux/ia64/bits/mathdef.h index 5da23cc8a..3dc286022 100644 --- a/libc/sysdeps/linux/ia64/bits/mathdef.h +++ b/libc/sysdeps/linux/ia64/bits/mathdef.h @@ -35,7 +35,3 @@ typedef double double_t; /* `double' expressions are evaluated as # define FP_ILOGBNAN 2147483647 #endif /* ISO C99 */ - -#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/libc/sysdeps/linux/ia64/setjmp.S b/libc/sysdeps/linux/ia64/setjmp.S index 11dc0e62e..cf6c75d3d 100644 --- a/libc/sysdeps/linux/ia64/setjmp.S +++ b/libc/sysdeps/linux/ia64/setjmp.S @@ -95,15 +95,15 @@ ENTRY(__sigsetjmp) mov r2=in0 add r3=8,in0 ;; -.mem.offset 8,0; st8.spill.nta [r2]=sp,16 // r12 (sp) -.mem.offset 0,0; st8.spill.nta [r3]=gp,16 // r1 (gp) +.mem.offset 8,0; st8.spill.nta [r2]=sp,16 /* r12 (sp) */ +.mem.offset 0,0; st8.spill.nta [r3]=gp,16 /* r1 (gp) */ ;; - st8.nta [r2]=loc2,16 // save caller's unat - st8.nta [r3]=r17,16 // save fpsr + st8.nta [r2]=loc2,16 /* save caller's unat */ + st8.nta [r3]=r17,16 /* save fpsr */ add r8=0xa0,in0 ;; -.mem.offset 8,0; st8.spill.nta [r2]=r4,16 // r4 -.mem.offset 0,0; st8.spill.nta [r3]=r5,16 // r5 +.mem.offset 8,0; st8.spill.nta [r2]=r4,16 /* r4 */ +.mem.offset 0,0; st8.spill.nta [r3]=r5,16 /* r5 */ add r9=0xb0,in0 ;; stf.spill.nta [r8]=f2,32 @@ -145,39 +145,39 @@ ENTRY(__sigsetjmp) stf.spill.nta [r8]=f30 stf.spill.nta [r9]=f31 -.mem.offset 8,0; st8.spill.nta [r2]=r6,16 // r6 -.mem.offset 0,0; st8.spill.nta [r3]=r7,16 // r7 +.mem.offset 8,0; st8.spill.nta [r2]=r6,16 /* r6 */ +.mem.offset 0,0; st8.spill.nta [r3]=r7,16 /* r7 */ ;; mov r23=ar.bsp mov r25=ar.unat mov out0=in0 - st8.nta [r2]=loc0,16 // b0 - st8.nta [r3]=r17,16 // b1 + st8.nta [r2]=loc0,16 /* b0 */ + st8.nta [r3]=r17,16 /* b1 */ mov out1=in1 ;; - st8.nta [r2]=r18,16 // b2 - st8.nta [r3]=r19,16 // b3 + st8.nta [r2]=r18,16 /* b2 */ + st8.nta [r3]=r19,16 /* b3 */ ;; - st8.nta [r2]=r20,16 // b4 - st8.nta [r3]=r21,16 // b5 + st8.nta [r2]=r20,16 /* b4 */ + st8.nta [r3]=r21,16 /* b5 */ ;; - st8.nta [r2]=loc1,16 // ar.pfs - st8.nta [r3]=r22,16 // ar.lc + st8.nta [r2]=loc1,16 /* ar.pfs */ + st8.nta [r3]=r22,16 /* ar.lc */ ;; - st8.nta [r2]=r24,16 // pr - st8.nta [r3]=r23,16 // ar.bsp + st8.nta [r2]=r24,16 /* pr */ + st8.nta [r3]=r23,16 /* ar.bsp */ ;; - st8.nta [r2]=r25 // ar.unat - st8.nta [r3]=in0 // &__jmp_buf + st8.nta [r2]=r25 /* ar.unat */ + st8.nta [r3]=in0 /* &__jmp_buf */ #if defined NOT_IN_libc && defined IS_IN_rtld /* In ld.so we never save the signal mask. */ ;; #else br.call.dpnt.few rp=__sigjmp_save #endif -.ret0: // force a new bundle ::q - mov.m ar.unat=loc2 // restore caller's unat +.ret0: /* force a new bundle ::q */ + mov.m ar.unat=loc2 /* restore caller's unat */ mov rp=loc0 mov ar.pfs=loc1 mov r8=0 diff --git a/libc/sysdeps/linux/ia64/sys/io.h b/libc/sysdeps/linux/ia64/sys/io.h index 14736ff1c..cdd609190 100644 --- a/libc/sysdeps/linux/ia64/sys/io.h +++ b/libc/sysdeps/linux/ia64/sys/io.h @@ -33,6 +33,7 @@ __BEGIN_DECLS E.g., Linux/Alpha for Alpha PCs supports this. */ extern int ioperm (unsigned long int __from, unsigned long int __num, int __turn_on); +libc_hidden_proto(ioperm) /* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to access any I/O port is granted. This call requires root diff --git a/libc/sysdeps/linux/m68k/bits/fcntl.h b/libc/sysdeps/linux/m68k/bits/fcntl.h index 7c947856a..d36198d7a 100644 --- a/libc/sysdeps/linux/m68k/bits/fcntl.h +++ b/libc/sysdeps/linux/m68k/bits/fcntl.h @@ -185,8 +185,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -197,7 +196,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -210,18 +208,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/m68k/bits/mathdef.h b/libc/sysdeps/linux/m68k/bits/mathdef.h index a69e93089..65cf8d49f 100644 --- a/libc/sysdeps/linux/m68k/bits/mathdef.h +++ b/libc/sysdeps/linux/m68k/bits/mathdef.h @@ -36,7 +36,3 @@ typedef long double double_t; /* `double' expressions are evaluated as # define FP_ILOGBNAN (2147483647) #endif /* ISO C99 */ - -#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/libc/sysdeps/linux/m68k/brk.c b/libc/sysdeps/linux/m68k/brk.c index 7daf1bd76..f04a4ab91 100644 --- a/libc/sysdeps/linux/m68k/brk.c +++ b/libc/sysdeps/linux/m68k/brk.c @@ -9,7 +9,7 @@ #include <sys/syscall.h> #include <errno.h> -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ /* This must be initialized data because commons can't have aliases. */ void * __curbrk = 0; diff --git a/libc/sysdeps/linux/m68k/sys/user.h b/libc/sysdeps/linux/m68k/sys/user.h new file mode 100644 index 000000000..8114a2bd3 --- /dev/null +++ b/libc/sysdeps/linux/m68k/sys/user.h @@ -0,0 +1,90 @@ +#ifndef _M68K_USER_H +#define _M68K_USER_H +/* + This file was taken verbatim from linux-2.6.26.5. + The linux kernel is Copyright (C) Linus Torvalds et al. + and is licensed under the GNU General Public License, version 2. +*/ +/* Core file format: The core file is written in such a way that gdb + can understand it and provide useful information to the user (under + linux we use the 'trad-core' bfd). There are quite a number of + obstacles to being able to view the contents of the floating point + registers, and until these are solved you will not be able to view the + contents of them. Actually, you can read in the core file and look at + the contents of the user struct to find out what the floating point + registers contain. + The actual file contents are as follows: + UPAGE: 1 page consisting of a user struct that tells gdb what is present + in the file. Directly after this is a copy of the task_struct, which + is currently not used by gdb, but it may come in useful at some point. + All of the registers are stored as part of the upage. The upage should + always be only one page. + DATA: The data area is stored. We use current->end_text to + current->brk to pick up all of the user variables, plus any memory + that may have been malloced. No attempt is made to determine if a page + is demand-zero or if a page is totally unused, we just cover the entire + range. All of the addresses are rounded in such a way that an integral + number of pages is written. + STACK: We need the stack information in order to get a meaningful + backtrace. We need to write the data from (esp) to + current->start_stack, so we round each of these off in order to be able + to write an integer number of pages. + The minimum core file size is 3 pages, or 12288 bytes. +*/ + +struct user_m68kfp_struct { + unsigned long fpregs[8*3]; /* fp0-fp7 registers */ + unsigned long fpcntl[3]; /* fp control regs */ +}; + +/* This is the old layout of "struct pt_regs" as of Linux 1.x, and + is still the layout used by user (the new pt_regs doesn't have + all registers). */ +struct user_regs_struct { + long d1,d2,d3,d4,d5,d6,d7; + long a0,a1,a2,a3,a4,a5,a6; + long d0; + long usp; + long orig_d0; + short stkadj; + short sr; + long pc; + short fmtvec; + short __fill; +}; + + +/* When the kernel dumps core, it starts by dumping the user struct - + this will be used by gdb to figure out where the data and stack segments + are within the file, and what virtual addresses to use. */ +struct user{ +/* We start with the registers, to mimic the way that "memory" is returned + from the ptrace(3,...) function. */ + struct user_regs_struct regs; /* Where the registers are actually stored */ +/* ptrace does not yet supply these. Someday.... */ + int u_fpvalid; /* True if math co-processor being used. */ + /* for this mess. Not yet used. */ + struct user_m68kfp_struct m68kfp; /* Math Co-processor registers. */ +/* The rest of this junk is to help gdb figure out what goes where */ + unsigned long int u_tsize; /* Text segment size (pages). */ + unsigned long int u_dsize; /* Data segment size (pages). */ + unsigned long int u_ssize; /* Stack segment size (pages). */ + unsigned long start_code; /* Starting virtual address of text. */ + unsigned long start_stack; /* Starting virtual address of stack area. + This is actually the bottom of the stack, + the top of the stack is always found in the + esp register. */ + long int signal; /* Signal that caused the core dump. */ + int reserved; /* No longer used */ + unsigned long u_ar0; /* Used by gdb to help find the values for */ + /* the registers. */ + struct user_m68kfp_struct* u_fpstate; /* Math Co-processor pointer. */ + unsigned long magic; /* To uniquely identify a core file */ + char u_comm[32]; /* User command that was responsible */ +}; +#define NBPG 4096 +#define UPAGES 1 +#define HOST_TEXT_START_ADDR (u.start_code) +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) + +#endif diff --git a/libc/sysdeps/linux/microblaze/__longjmp.S b/libc/sysdeps/linux/microblaze/__longjmp.S index fba1e9fbf..2752f0bd3 100644 --- a/libc/sysdeps/linux/microblaze/__longjmp.S +++ b/libc/sysdeps/linux/microblaze/__longjmp.S @@ -8,7 +8,7 @@ * 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. - * + * * Written by Miles Bader <miles@gnu.org> */ @@ -20,25 +20,25 @@ .text C_ENTRY(__longjmp): - /* load registers from memory to r5 (arg0)*/ + /* load registers from memory to r5 (arg0) */ lwi r1, r5, 0 lwi r15, r5, 4 lwi r18, r5, 8 lwi r19, r5, 12 lwi r20, r5, 16 - lwi r21, r5, 20 - lwi r22, r5, 24 + lwi r21, r5, 20 + lwi r22, r5, 24 lwi r23, r5, 28 - lwi r24, r5, 32 + lwi r24, r5, 32 lwi r25, r5, 36 lwi r26, r5, 40 lwi r27, r5, 44 lwi r28, r5, 48 lwi r29, r5, 52 lwi r30, r5, 56 - - addi r3, r0, 1 // return val - rtsd r15, 8 // normal return + + addi r3, r0, 1 /* return val */ + rtsd r15, 8 /* normal return */ nop C_END(__longjmp) diff --git a/libc/sysdeps/linux/microblaze/bits/fcntl.h b/libc/sysdeps/linux/microblaze/bits/fcntl.h index 97aa632c9..a3da35ae2 100644 --- a/libc/sysdeps/linux/microblaze/bits/fcntl.h +++ b/libc/sysdeps/linux/microblaze/bits/fcntl.h @@ -182,8 +182,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -194,7 +193,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -207,18 +205,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/microblaze/crt0.S b/libc/sysdeps/linux/microblaze/crt0.S index 99687b707..591c3a2f8 100644 --- a/libc/sysdeps/linux/microblaze/crt0.S +++ b/libc/sysdeps/linux/microblaze/crt0.S @@ -20,22 +20,22 @@ .text C_ENTRY(_start): - lw r5, r0, r1 // Arg 0: argc + lw r5, r0, r1 /* Arg 0: argc */ - addi r6, r1, 4 // Arg 1: argv + addi r6, r1, 4 /* Arg 1: argv */ - // Arg 2: envp - addi r3, r5, 1 // skip argc elements to get envp start - // ...plus the NULL at the end of argv - add r3, r3, r3 // Make word offset + /* Arg 2: envp */ + addi r3, r5, 1 /* skip argc elements to get envp start */ + /* ...plus the NULL at the end of argv */ + add r3, r3, r3 /* Make word offset */ add r3, r3, r3 - add r7, r6, r3 // add to argv to get offset + add r7, r6, r3 /* add to argv to get offset */ - // Load SDAs + /* Load SDAs */ la r2, r0, C_SYMBOL_NAME(_SDA_BASE_) la r13, r0, C_SYMBOL_NAME(_SDA2_BASE_) - // tail-call uclibc's startup routine + /* tail-call uclibc's startup routine */ brid C_SYMBOL_NAME(__uClibc_main) nop diff --git a/libc/sysdeps/linux/microblaze/mmap.c b/libc/sysdeps/linux/microblaze/mmap.c index cad528d17..be780eba3 100644 --- a/libc/sysdeps/linux/microblaze/mmap.c +++ b/libc/sysdeps/linux/microblaze/mmap.c @@ -10,8 +10,8 @@ #include <sys/mman.h> #include <sys/syscall.h> -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ _syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot, - int, flags, int, fd, __off_t, offset); + int, flags, int, fd, __off_t, offset) libc_hidden_def(mmap) diff --git a/libc/sysdeps/linux/microblaze/vfork.S b/libc/sysdeps/linux/microblaze/vfork.S index 1e802ae29..42458308a 100644 --- a/libc/sysdeps/linux/microblaze/vfork.S +++ b/libc/sysdeps/linux/microblaze/vfork.S @@ -8,7 +8,7 @@ * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ -/* +/* * Written by Miles Bader <miles@gnu.org> * Microblaze port by John Williams */ @@ -31,13 +31,13 @@ C_ENTRY (__vfork): addi r12, r0, SYS_vfork bralid r17, 0x08; nop - addi r4, r3, 125 // minimum err value - blti r4, 1f // is r3 < -125? - rtsd r15, 8 // normal return + addi r4, r3, 125 /* minimum err value */ + blti r4, 1f /* is r3 < -125? */ + rtsd r15, 8 /* normal return */ nop -1: sub r3, r3, r0 // r3 = -r3 +1: sub r3, r3, r0 /* r3 = -r3 */ swi r3, r0, C_SYMBOL_NAME(errno); - rtsd r15, 8 // error return + rtsd r15, 8 /* error return */ nop C_END(__vfork) weak_alias(__vfork,vfork) diff --git a/libc/sysdeps/linux/mips/bits/atomic.h b/libc/sysdeps/linux/mips/bits/atomic.h index ca53d3842..4f73cc261 100644 --- a/libc/sysdeps/linux/mips/bits/atomic.h +++ b/libc/sysdeps/linux/mips/bits/atomic.h @@ -110,22 +110,22 @@ typedef uintmax_t uatomic_max_t; /* For all "bool" routines, we return FALSE if exchange succesful. */ #define __arch_compare_and_exchange_bool_8_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \ !__cmp; }) #define __arch_compare_and_exchange_bool_16_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \ !__cmp; }) #define __arch_compare_and_exchange_bool_32_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \ !__cmp; }) #define __arch_compare_and_exchange_bool_64_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \ !__cmp; }) @@ -133,24 +133,24 @@ typedef uintmax_t uatomic_max_t; successful or not. */ #define __arch_compare_and_exchange_val_8_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) + (__typeof (*mem))__prev; }) #define __arch_compare_and_exchange_val_16_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) + (__typeof (*mem))__prev; }) #define __arch_compare_and_exchange_val_32_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) + (__typeof (*mem))__prev; }) #define __arch_compare_and_exchange_val_64_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) + (__typeof (*mem))__prev; }) /* Compare and exchange with "acquire" semantics, ie barrier after. */ @@ -183,7 +183,7 @@ typedef uintmax_t uatomic_max_t; (abort (), 0) #define __arch_exchange_xxx_32_int(mem, newval, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __asm__ __volatile__ ("\n" \ ".set push\n\t" \ MIPS_PUSH_MIPS2 \ @@ -207,7 +207,7 @@ typedef uintmax_t uatomic_max_t; (abort (), 0) #else #define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __asm__ __volatile__ ("\n" \ ".set push\n\t" \ MIPS_PUSH_MIPS2 \ @@ -236,13 +236,13 @@ typedef uintmax_t uatomic_max_t; /* Atomically add value and return the previous (unincremented) value. */ #define __arch_exchange_and_add_8_int(mem, newval, rel, acq) \ - (abort (), (typeof(*mem)) 0) + (abort (), (__typeof(*mem)) 0) #define __arch_exchange_and_add_16_int(mem, newval, rel, acq) \ - (abort (), (typeof(*mem)) 0) + (abort (), (__typeof(*mem)) 0) #define __arch_exchange_and_add_32_int(mem, value, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __asm__ __volatile__ ("\n" \ ".set push\n\t" \ MIPS_PUSH_MIPS2 \ @@ -263,10 +263,10 @@ typedef uintmax_t uatomic_max_t; #if _MIPS_SIM == _ABIO32 /* We can't do an atomic 64-bit operation in O32. */ #define __arch_exchange_and_add_64_int(mem, value, rel, acq) \ - (abort (), (typeof(*mem)) 0) + (abort (), (__typeof(*mem)) 0) #else #define __arch_exchange_and_add_64_int(mem, value, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ __typeof (*mem) __prev; int __cmp; \ __asm__ __volatile__ ( \ ".set push\n\t" \ MIPS_PUSH_MIPS2 \ diff --git a/libc/sysdeps/linux/mips/bits/fcntl.h b/libc/sysdeps/linux/mips/bits/fcntl.h index 90011d5d0..ef015a4b0 100644 --- a/libc/sysdeps/linux/mips/bits/fcntl.h +++ b/libc/sysdeps/linux/mips/bits/fcntl.h @@ -209,8 +209,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -221,7 +220,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -234,18 +232,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/mips/bits/kernel_types.h b/libc/sysdeps/linux/mips/bits/kernel_types.h index b7e61bd6b..9fc3b9672 100644 --- a/libc/sysdeps/linux/mips/bits/kernel_types.h +++ b/libc/sysdeps/linux/mips/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/mips/bits/mathdef.h b/libc/sysdeps/linux/mips/bits/mathdef.h index 331da13a9..b741f6551 100644 --- a/libc/sysdeps/linux/mips/bits/mathdef.h +++ b/libc/sysdeps/linux/mips/bits/mathdef.h @@ -39,10 +39,8 @@ typedef double double_t; /* `double' expressions are evaluated as #endif /* ISO C99 */ -#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32 +#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && _MIPS_SIM == _ABIO32 /* Signal that we do not really have a `long double'. This disables the declaration of all the `long double' function variants. */ -# define __NO_LONG_DOUBLE_MATH 1 -#elif !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ -# define __NO_LONG_DOUBLE_MATH 1 +# error defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ and _MIPS_SIM == _ABIO32 #endif diff --git a/libc/sysdeps/linux/mips/bits/socket.h b/libc/sysdeps/linux/mips/bits/socket.h index c43a4cd2e..0860b4d38 100644 --- a/libc/sysdeps/linux/mips/bits/socket.h +++ b/libc/sysdeps/linux/mips/bits/socket.h @@ -315,7 +315,13 @@ struct ucred }; /* Get socket manipulation related informations from kernel headers. */ +#ifndef __GLIBC__ +#define __GLIBC__ 2 #include <asm/socket.h> +#undef __GLIBC__ +#else +#include <asm/socket.h> +#endif /* Structure used to manipulate the SO_LINGER option. */ diff --git a/libc/sysdeps/linux/mips/brk.c b/libc/sysdeps/linux/mips/brk.c index 36620b210..e1c682902 100644 --- a/libc/sysdeps/linux/mips/brk.c +++ b/libc/sysdeps/linux/mips/brk.c @@ -23,7 +23,7 @@ void *__curbrk attribute_hidden = 0; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk (void *addr) { void *newbrk; diff --git a/libc/sysdeps/linux/mips/cacheflush.c b/libc/sysdeps/linux/mips/cacheflush.c index f99c58171..235414dbd 100644 --- a/libc/sysdeps/linux/mips/cacheflush.c +++ b/libc/sysdeps/linux/mips/cacheflush.c @@ -21,10 +21,10 @@ #include <sys/syscall.h> #ifdef __NR_cacheflush -_syscall3(int, cacheflush, void *, addr, const int, nbytes, const int, op); +_syscall3(int, cacheflush, void *, addr, const int, nbytes, const int, op) strong_alias(cacheflush, _flush_cache) #endif #ifdef __NR_cachectl -_syscall3(int, cachectl, void *, addr, const int, nbytes, const int, op); +_syscall3(int, cachectl, void *, addr, const int, nbytes, const int, op) #endif diff --git a/libc/sysdeps/linux/mips/mmap.c b/libc/sysdeps/linux/mips/mmap.c index 4e0897f45..ff923cf63 100644 --- a/libc/sysdeps/linux/mips/mmap.c +++ b/libc/sysdeps/linux/mips/mmap.c @@ -10,7 +10,7 @@ #include <sys/mman.h> #include <sys/syscall.h> -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ #if 0 /* For now, leave mmap using mmap1 since mmap2 seems @@ -23,5 +23,5 @@ libc_hidden_proto(mmap) #endif _syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot, - int, flags, int, fd, __off_t, offset); + int, flags, int, fd, __off_t, offset) libc_hidden_def(mmap) diff --git a/libc/sysdeps/linux/mips/pread_write.c b/libc/sysdeps/linux/mips/pread_write.c index 0939e17b6..b1cce027f 100644 --- a/libc/sysdeps/linux/mips/pread_write.c +++ b/libc/sysdeps/linux/mips/pread_write.c @@ -40,17 +40,17 @@ extern __typeof(pwrite64) __libc_pwrite64; # if _MIPS_SIM == _MIPS_SIM_ABI64 # define __NR___libc_pread __NR_pread -_syscall4(ssize_t, __libc_pread, int, fd, void *, buf, size_t, count, off_t, offset); +_syscall4(ssize_t, __libc_pread, int, fd, void *, buf, size_t, count, off_t, offset) weak_alias (__libc_pread, pread) # ifdef __UCLIBC_HAS_LFS__ # define __NR___libc_pread64 __NR_pread -_syscall4(ssize_t, __libc_pread64, int, fd, void *, buf, size_t, count, off64_t, offset); +_syscall4(ssize_t, __libc_pread64, int, fd, void *, buf, size_t, count, off64_t, offset) weak_alias (__libc_pread64, pread64) # endif /* __UCLIBC_HAS_LFS__ */ # else /* O32 || N32 */ # define __NR___syscall_pread __NR_pread static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, - size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo); + size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo) ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) { @@ -84,17 +84,17 @@ weak_alias(__libc_pread64,pread64) # if _MIPS_SIM == _MIPS_SIM_ABI64 # define __NR___libc_pwrite __NR_pwrite -_syscall4(ssize_t, __libc_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset); +_syscall4(ssize_t, __libc_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset) weak_alias (__libc_pwrite, pwrite) # ifdef __UCLIBC_HAS_LFS__ # define __NR___libc_pwrite64 __NR_pwrite -_syscall4(ssize_t, __libc_pwrite64, int, fd, const void *, buf, size_t, count, off64_t, offset); +_syscall4(ssize_t, __libc_pwrite64, int, fd, const void *, buf, size_t, count, off64_t, offset) weak_alias (__libc_pwrite64, pwrite64) # endif /* __UCLIBC_HAS_LFS__ */ # else /* O32 || N32 */ # define __NR___syscall_pwrite __NR_pwrite static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, - size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo); + size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo) ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) { diff --git a/libc/sysdeps/linux/mips/sigaction.c b/libc/sysdeps/linux/mips/sigaction.c index 39d38b86f..edd265438 100644 --- a/libc/sysdeps/linux/mips/sigaction.c +++ b/libc/sysdeps/linux/mips/sigaction.c @@ -125,7 +125,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa #endif #ifndef LIBC_SIGACTION -libc_hidden_proto(sigaction) +/* libc_hidden_proto(sigaction) */ weak_alias(__libc_sigaction,sigaction) libc_hidden_weak(sigaction) #endif diff --git a/libc/sysdeps/linux/mips/sysmips.c b/libc/sysdeps/linux/mips/sysmips.c index 020f02dd3..1384782b4 100644 --- a/libc/sysdeps/linux/mips/sysmips.c +++ b/libc/sysdeps/linux/mips/sysmips.c @@ -3,5 +3,5 @@ #include <sys/sysmips.h> #ifdef __NR_sysmips -_syscall4(int, sysmips, const int, cmd, const long, arg1, const int, arg2, const int, arg3); +_syscall4(int, sysmips, const int, cmd, const long, arg1, const int, arg2, const int, arg3) #endif diff --git a/libc/sysdeps/linux/nios/bits/endian.h b/libc/sysdeps/linux/nios/bits/endian.h index 252597931..34ea91f71 100644 --- a/libc/sysdeps/linux/nios/bits/endian.h +++ b/libc/sysdeps/linux/nios/bits/endian.h @@ -4,5 +4,5 @@ # error "Never use <bits/endian.h> directly; include <endian.h> instead." #endif -//mle +/*mle */ #define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/libc/sysdeps/linux/nios/bits/fcntl.h b/libc/sysdeps/linux/nios/bits/fcntl.h index fec19f1dd..b66f303e8 100644 --- a/libc/sysdeps/linux/nios/bits/fcntl.h +++ b/libc/sysdeps/linux/nios/bits/fcntl.h @@ -185,8 +185,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -197,7 +196,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -210,18 +208,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/nios/bits/mathdef.h b/libc/sysdeps/linux/nios/bits/mathdef.h index e013e74b7..22722e37a 100644 --- a/libc/sysdeps/linux/nios/bits/mathdef.h +++ b/libc/sysdeps/linux/nios/bits/mathdef.h @@ -34,11 +34,3 @@ typedef double double_t; /* `double' expressions are evaluated as # define FP_ILOGBNAN (2147483647) #endif /* ISO C99 */ - -#ifndef __NO_LONG_DOUBLE_MATH -/* Signal that we do not really have a `long double'. This disables the - declaration of all the `long double' function variants. */ -/* XXX The FPA does support this but the patterns in GCC are currently - turned off. */ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/libc/sysdeps/linux/nios/brk.c b/libc/sysdeps/linux/nios/brk.c index ea2e45765..fb4ea94b6 100644 --- a/libc/sysdeps/linux/nios/brk.c +++ b/libc/sysdeps/linux/nios/brk.c @@ -24,7 +24,7 @@ /* This must be initialized data because commons can't have aliases. */ void *__curbrk attribute_hidden = 0; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk (void *addr) { void *newbrk; diff --git a/libc/sysdeps/linux/nios/crt1.S b/libc/sysdeps/linux/nios/crt1.S index 98777e831..e80a82189 100644 --- a/libc/sysdeps/linux/nios/crt1.S +++ b/libc/sysdeps/linux/nios/crt1.S @@ -35,13 +35,13 @@ Cambridge, MA 02139, USA. */ .text -_start: +_start: nop nop MOVIA %o0, main@h - lds %o1,[%sp, (REGWIN_SZ / 4) + 0] // main's argc - lds %o2,[%sp, (REGWIN_SZ / 4) + 1] // main's argv + lds %o1,[%sp, (REGWIN_SZ / 4) + 0] /* main's argc */ + lds %o2,[%sp, (REGWIN_SZ / 4) + 1] /* main's argv */ MOVIA %o3, _init@h MOVIA %o4, _fini@h diff --git a/libc/sysdeps/linux/nios2/bits/fcntl.h b/libc/sysdeps/linux/nios2/bits/fcntl.h index cb86c8a90..52aed58b9 100644 --- a/libc/sysdeps/linux/nios2/bits/fcntl.h +++ b/libc/sysdeps/linux/nios2/bits/fcntl.h @@ -185,8 +185,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -197,7 +196,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -210,18 +208,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/nios2/bits/mathdef.h b/libc/sysdeps/linux/nios2/bits/mathdef.h index e013e74b7..22722e37a 100644 --- a/libc/sysdeps/linux/nios2/bits/mathdef.h +++ b/libc/sysdeps/linux/nios2/bits/mathdef.h @@ -34,11 +34,3 @@ typedef double double_t; /* `double' expressions are evaluated as # define FP_ILOGBNAN (2147483647) #endif /* ISO C99 */ - -#ifndef __NO_LONG_DOUBLE_MATH -/* Signal that we do not really have a `long double'. This disables the - declaration of all the `long double' function variants. */ -/* XXX The FPA does support this but the patterns in GCC are currently - turned off. */ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/libc/sysdeps/linux/nios2/brk.c b/libc/sysdeps/linux/nios2/brk.c index 0420798bc..6f69932a3 100644 --- a/libc/sysdeps/linux/nios2/brk.c +++ b/libc/sysdeps/linux/nios2/brk.c @@ -24,7 +24,7 @@ /* This must be initialized data because commons can't have aliases. */ void *__curbrk attribute_hidden = 0; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk (void *addr) { void *newbrk; diff --git a/libc/sysdeps/linux/powerpc/bits/fcntl.h b/libc/sysdeps/linux/powerpc/bits/fcntl.h index a96abc974..ceb75b4f1 100644 --- a/libc/sysdeps/linux/powerpc/bits/fcntl.h +++ b/libc/sysdeps/linux/powerpc/bits/fcntl.h @@ -189,8 +189,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -201,7 +200,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -214,18 +212,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/powerpc/bits/mathdef.h b/libc/sysdeps/linux/powerpc/bits/mathdef.h index f28bacece..81a46ddcd 100644 --- a/libc/sysdeps/linux/powerpc/bits/mathdef.h +++ b/libc/sysdeps/linux/powerpc/bits/mathdef.h @@ -65,13 +65,11 @@ typedef double double_t; #endif /* ISO C99 */ -#ifndef __NO_LONG_DOUBLE_MATH +#ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__ #include <bits/wordsize.h> /* Signal that we do not really have a `long double'. The disables the declaration of all the `long double' function variants. */ # if __WORDSIZE == 32 -# define __NO_LONG_DOUBLE_MATH 1 -# elif !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ -# define __NO_LONG_DOUBLE_MATH 1 +# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__ # endif /* __WORDSIZE == 32 */ -#endif /* __NO_LONG_DOUBLE_MATH */ +#endif /* __UCLIBC_HAS_LONG_DOUBLE_MATH__ */ diff --git a/libc/sysdeps/linux/powerpc/bits/wordsize.h b/libc/sysdeps/linux/powerpc/bits/wordsize.h index cf934234f..dc19246d7 100644 --- a/libc/sysdeps/linux/powerpc/bits/wordsize.h +++ b/libc/sysdeps/linux/powerpc/bits/wordsize.h @@ -7,13 +7,13 @@ # define __WORDSIZE 32 #endif -#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL +#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __LONG_DOUBLE_MATH_OPTIONAL /* Signal the glibc ABI didn't used to have a `long double'. The changes all the `long double' function variants to be redirects to the double functions. */ # define __LONG_DOUBLE_MATH_OPTIONAL 1 # ifndef __LONG_DOUBLE_128__ -# define __NO_LONG_DOUBLE_MATH 1 +# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__ # endif #endif diff --git a/libc/sysdeps/linux/powerpc/ioctl.c b/libc/sysdeps/linux/powerpc/ioctl.c index 7f92be410..06f12eed4 100644 --- a/libc/sysdeps/linux/powerpc/ioctl.c +++ b/libc/sysdeps/linux/powerpc/ioctl.c @@ -22,17 +22,17 @@ #include <sys/ioctl.h> #include <sys/syscall.h> -libc_hidden_proto(ioctl) +/* libc_hidden_proto(ioctl) */ -libc_hidden_proto(tcsetattr) -libc_hidden_proto(tcgetattr) +/* libc_hidden_proto(tcsetattr) */ +/* libc_hidden_proto(tcgetattr) */ /* The user-visible size of struct termios has changed. Catch ioctl calls using the new-style struct termios, and translate them to old-style. */ #define __NR___syscall_ioctl __NR_ioctl -static inline -_syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg); +static __always_inline +_syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg) int ioctl (int fd, unsigned long int request, ...) diff --git a/libc/sysdeps/linux/powerpc/pread_write.c b/libc/sysdeps/linux/powerpc/pread_write.c index cdbadfdf3..dcdb39be1 100644 --- a/libc/sysdeps/linux/powerpc/pread_write.c +++ b/libc/sysdeps/linux/powerpc/pread_write.c @@ -14,6 +14,7 @@ #include <sys/syscall.h> #include <unistd.h> +#include <endian.h> #ifndef __UCLIBC_HAS_LFS__ # define off64_t off_t @@ -22,12 +23,12 @@ #ifdef __NR_pread extern __typeof(pread) __libc_pread; # define __NR___syscall_pread __NR_pread -static __inline__ _syscall4(ssize_t, __syscall_pread, int, fd, - void *, buf, size_t, count, off64_t, offset); +static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, + void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo) ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) { - return(__syscall_pread(fd, buf, count, (off64_t)offset)); + return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 31, offset))); } weak_alias(__libc_pread,pread) @@ -35,7 +36,7 @@ weak_alias(__libc_pread,pread) extern __typeof(pread64) __libc_pread64; ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset) { - return(__syscall_pread(fd, buf, count, offset)); + return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 32, offset))); } weak_alias(__libc_pread64,pread64) # endif /* __UCLIBC_HAS_LFS__ */ @@ -45,12 +46,12 @@ weak_alias(__libc_pread64,pread64) #ifdef __NR_pwrite extern __typeof(pwrite) __libc_pwrite; # define __NR___syscall_pwrite __NR_pwrite -static __inline__ _syscall4(ssize_t, __syscall_pwrite, int, fd, - const void *, buf, size_t, count, off64_t, offset); +static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, + const void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo) ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) { - return(__syscall_pwrite(fd, buf, count, (off64_t)offset)); + return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 31, offset))); } weak_alias(__libc_pwrite,pwrite) @@ -58,7 +59,7 @@ weak_alias(__libc_pwrite,pwrite) extern __typeof(pwrite64) __libc_pwrite64; ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset) { - return(__syscall_pwrite(fd, buf, count, offset)); + return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 32, offset))); } weak_alias(__libc_pwrite64,pwrite64) # endif /* __UCLIBC_HAS_LFS__ */ @@ -67,9 +68,9 @@ weak_alias(__libc_pwrite64,pwrite64) #if ! defined __NR_pread || ! defined __NR_pwrite -libc_hidden_proto(read) -libc_hidden_proto(write) -libc_hidden_proto(lseek) +/* libc_hidden_proto(read) */ +/* libc_hidden_proto(write) */ +/* libc_hidden_proto(lseek) */ static ssize_t __fake_pread_write(int fd, void *buf, size_t count, off_t offset, int do_pwrite) @@ -87,7 +88,7 @@ static ssize_t __fake_pread_write(int fd, void *buf, if (lseek (fd, offset, SEEK_SET) == (off_t) -1) return -1; - if (do_pwrite==1) { + if (do_pwrite == 1) { /* Write the data. */ result = write(fd, buf, count); } else { @@ -109,7 +110,7 @@ static ssize_t __fake_pread_write(int fd, void *buf, } # ifdef __UCLIBC_HAS_LFS__ -libc_hidden_proto(lseek64) +/* libc_hidden_proto(lseek64) */ static ssize_t __fake_pread_write64(int fd, void *buf, size_t count, off64_t offset, int do_pwrite) @@ -127,7 +128,7 @@ static ssize_t __fake_pread_write64(int fd, void *buf, if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1) return -1; - if (do_pwrite==1) { + if (do_pwrite == 1) { /* Write the data. */ result = write(fd, buf, count); } else { diff --git a/libc/sysdeps/linux/sh/__init_brk.c b/libc/sysdeps/linux/sh/__init_brk.c index bb0692448..8a41eb3c4 100644 --- a/libc/sysdeps/linux/sh/__init_brk.c +++ b/libc/sysdeps/linux/sh/__init_brk.c @@ -7,7 +7,7 @@ void * __curbrk attribute_hidden = 0; #define __NR__brk __NR_brk -attribute_hidden _syscall1(void *, _brk, void *, ptr); +attribute_hidden _syscall1(void *, _brk, void *, ptr) extern int __init_brk (void) attribute_hidden; int diff --git a/libc/sysdeps/linux/sh/bits/fcntl.h b/libc/sysdeps/linux/sh/bits/fcntl.h index 0fc129405..570484c2f 100644 --- a/libc/sysdeps/linux/sh/bits/fcntl.h +++ b/libc/sysdeps/linux/sh/bits/fcntl.h @@ -189,8 +189,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -201,7 +200,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -214,18 +212,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/sh/bits/mathdef.h b/libc/sysdeps/linux/sh/bits/mathdef.h index 2b8caf194..c419fcd4a 100644 --- a/libc/sysdeps/linux/sh/bits/mathdef.h +++ b/libc/sysdeps/linux/sh/bits/mathdef.h @@ -61,9 +61,3 @@ typedef double double_t; # define FP_ILOGBNAN 0x7fffffff #endif /* ISO C99 */ - -#ifndef __NO_LONG_DOUBLE_MATH -/* Signal that we do not really have a `long double'. The disables the - declaration of all the `long double' function variants. */ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/libc/sysdeps/linux/sh/bits/syscalls.h b/libc/sysdeps/linux/sh/bits/syscalls.h index e0ab65b82..bcd73eb43 100644 --- a/libc/sysdeps/linux/sh/bits/syscalls.h +++ b/libc/sysdeps/linux/sh/bits/syscalls.h @@ -140,13 +140,14 @@ __asm__ __volatile__ ("trapa %1" \ __syscall_return(type,__sc0); \ } -#define SYSCALL_INST_STR0 "trapa #0x10\n\t" -#define SYSCALL_INST_STR1 "trapa #0x11\n\t" -#define SYSCALL_INST_STR2 "trapa #0x12\n\t" -#define SYSCALL_INST_STR3 "trapa #0x13\n\t" -#define SYSCALL_INST_STR4 "trapa #0x14\n\t" -#define SYSCALL_INST_STR5 "trapa #0x15\n\t" -#define SYSCALL_INST_STR6 "trapa #0x16\n\t" +#define SYSCALL_INST_STR(x) "trapa #"__stringify(__SH_SYSCALL_TRAP_BASE + x)"\n\t" +#define SYSCALL_INST_STR0 SYSCALL_INST_STR(0) +#define SYSCALL_INST_STR1 SYSCALL_INST_STR(1) +#define SYSCALL_INST_STR2 SYSCALL_INST_STR(2) +#define SYSCALL_INST_STR3 SYSCALL_INST_STR(3) +#define SYSCALL_INST_STR4 SYSCALL_INST_STR(4) +#define SYSCALL_INST_STR5 SYSCALL_INST_STR(5) +#define SYSCALL_INST_STR6 SYSCALL_INST_STR(6) # ifdef NEED_SYSCALL_INST_PAD # define SYSCALL_INST_PAD "\ diff --git a/libc/sysdeps/linux/sh/brk.c b/libc/sysdeps/linux/sh/brk.c index c69c97ad6..cac45bae2 100644 --- a/libc/sysdeps/linux/sh/brk.c +++ b/libc/sysdeps/linux/sh/brk.c @@ -13,7 +13,7 @@ extern void * __curbrk attribute_hidden; extern int __init_brk (void) attribute_hidden; extern void *_brk(void *ptr) attribute_hidden; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk(void * end_data_seg) { if (__init_brk () == 0) diff --git a/libc/sysdeps/linux/sh/mmap.c b/libc/sysdeps/linux/sh/mmap.c index e711b0ff8..2d77a5d98 100644 --- a/libc/sysdeps/linux/sh/mmap.c +++ b/libc/sysdeps/linux/sh/mmap.c @@ -23,7 +23,7 @@ #include <errno.h> #include <sys/mman.h> -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ #ifdef HIOS # define __SH_SYSCALL6_TRAPA 0x2E @@ -31,5 +31,5 @@ libc_hidden_proto(mmap) #include <sys/syscall.h> -_syscall6(__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, __off_t, offset); +_syscall6(__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, __off_t, offset) libc_hidden_def(mmap) diff --git a/libc/sysdeps/linux/sh/pipe.c b/libc/sysdeps/linux/sh/pipe.c index 432a5bc03..56ae46c00 100644 --- a/libc/sysdeps/linux/sh/pipe.c +++ b/libc/sysdeps/linux/sh/pipe.c @@ -12,7 +12,7 @@ #include <unistd.h> #include <syscall.h> -libc_hidden_proto(pipe) +/* libc_hidden_proto(pipe) */ int pipe(int *fd) { diff --git a/libc/sysdeps/linux/sh/pread_write.c b/libc/sysdeps/linux/sh/pread_write.c index 16c9c6d8a..76c750ad6 100644 --- a/libc/sysdeps/linux/sh/pread_write.c +++ b/libc/sysdeps/linux/sh/pread_write.c @@ -36,7 +36,7 @@ extern __typeof(pread) __libc_pread; # define __NR___syscall_pread __NR_pread static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, - size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo); + size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo) ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) { @@ -86,7 +86,7 @@ weak_alias(__libc_pread64,pread64) extern __typeof(pwrite) __libc_pwrite; # define __NR___syscall_pwrite __NR_pwrite static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, - size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo); + size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo) ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) { diff --git a/libc/sysdeps/linux/sh/sbrk.c b/libc/sysdeps/linux/sh/sbrk.c index a1ff2a148..616b81318 100644 --- a/libc/sysdeps/linux/sh/sbrk.c +++ b/libc/sysdeps/linux/sh/sbrk.c @@ -8,7 +8,7 @@ extern void * __curbrk attribute_hidden; extern int __init_brk (void) attribute_hidden; extern void *_brk(void *ptr) attribute_hidden; -libc_hidden_proto(sbrk) +/* libc_hidden_proto(sbrk) */ void * sbrk(intptr_t increment) { diff --git a/libc/sysdeps/linux/sh/sys/io.h b/libc/sysdeps/linux/sh/sys/io.h index 6fdc44ff8..f833c4e8b 100644 --- a/libc/sysdeps/linux/sh/sys/io.h +++ b/libc/sysdeps/linux/sh/sys/io.h @@ -28,6 +28,7 @@ __BEGIN_DECLS permission off for that range. This call requires root privileges. */ extern int ioperm (unsigned long int __from, unsigned long int __num, int __turn_on) __THROW; +libc_hidden_proto(ioperm) /* Set the I/O privilege level to LEVEL. If LEVEL is nonzero, permission to access any I/O port is granted. This call requires diff --git a/libc/sysdeps/linux/sh/vfork.S b/libc/sysdeps/linux/sh/vfork.S index a9b440d8f..060a36b33 100644 --- a/libc/sysdeps/linux/sh/vfork.S +++ b/libc/sysdeps/linux/sh/vfork.S @@ -42,7 +42,7 @@ __vfork: trapa #__SH_SYSCALL_TRAP_BASE mov r0, r1 #ifdef __CONFIG_SH2__ -// 12 arithmetic shifts for the crappy sh2, because shad doesn't exist! +/* 12 arithmetic shifts for the crappy sh2, because shad doesn't exist! */ shar r1 shar r1 shar r1 @@ -55,13 +55,13 @@ __vfork: shar r1 shar r1 shar r1 -#else +#else mov #-12, r2 shad r2, r1 #endif - not r1, r1 // r1=0 means r0 = -1 to -4095 - tst r1, r1 // i.e. error in linux + not r1, r1 /* r1=0 means r0 = -1 to -4095 */ + tst r1, r1 /* i.e. error in linux */ bf 2f mov.w .L1, r1 cmp/eq r1, r0 @@ -73,7 +73,7 @@ __vfork: trapa #__SH_SYSCALL_TRAP_BASE mov r0, r1 #ifdef __CONFIG_SH2__ -// 12 arithmetic shifts for the crappy sh2, because shad doesn't exist! +/* 12 arithmetic shifts for the crappy sh2, because shad doesn't exist! */ shar r1 shar r1 shar r1 @@ -86,13 +86,13 @@ __vfork: shar r1 shar r1 shar r1 -#else +#else mov #-12, r2 shad r2, r1 #endif - not r1, r1 // r1=0 means r0 = -1 to -4095 - tst r1, r1 // i.e. error in linux + not r1, r1 /* r1=0 means r0 = -1 to -4095 */ + tst r1, r1 /* i.e. error in linux */ bt/s __syscall_error mov r0, r4 2: diff --git a/libc/sysdeps/linux/sh64/__init_brk.c b/libc/sysdeps/linux/sh64/__init_brk.c index bb0692448..8a41eb3c4 100644 --- a/libc/sysdeps/linux/sh64/__init_brk.c +++ b/libc/sysdeps/linux/sh64/__init_brk.c @@ -7,7 +7,7 @@ void * __curbrk attribute_hidden = 0; #define __NR__brk __NR_brk -attribute_hidden _syscall1(void *, _brk, void *, ptr); +attribute_hidden _syscall1(void *, _brk, void *, ptr) extern int __init_brk (void) attribute_hidden; int diff --git a/libc/sysdeps/linux/sh64/bits/fcntl.h b/libc/sysdeps/linux/sh64/bits/fcntl.h index a53830ca8..f0f1b9384 100644 --- a/libc/sysdeps/linux/sh64/bits/fcntl.h +++ b/libc/sysdeps/linux/sh64/bits/fcntl.h @@ -164,8 +164,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -176,7 +175,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -189,18 +187,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/sh64/brk.c b/libc/sysdeps/linux/sh64/brk.c index c69c97ad6..cac45bae2 100644 --- a/libc/sysdeps/linux/sh64/brk.c +++ b/libc/sysdeps/linux/sh64/brk.c @@ -13,7 +13,7 @@ extern void * __curbrk attribute_hidden; extern int __init_brk (void) attribute_hidden; extern void *_brk(void *ptr) attribute_hidden; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk(void * end_data_seg) { if (__init_brk () == 0) diff --git a/libc/sysdeps/linux/sh64/sbrk.c b/libc/sysdeps/linux/sh64/sbrk.c index a1ff2a148..616b81318 100644 --- a/libc/sysdeps/linux/sh64/sbrk.c +++ b/libc/sysdeps/linux/sh64/sbrk.c @@ -8,7 +8,7 @@ extern void * __curbrk attribute_hidden; extern int __init_brk (void) attribute_hidden; extern void *_brk(void *ptr) attribute_hidden; -libc_hidden_proto(sbrk) +/* libc_hidden_proto(sbrk) */ void * sbrk(intptr_t increment) { diff --git a/libc/sysdeps/linux/sparc/bits/fcntl.h b/libc/sysdeps/linux/sparc/bits/fcntl.h index ea6dc6cf4..29c09a957 100644 --- a/libc/sysdeps/linux/sparc/bits/fcntl.h +++ b/libc/sysdeps/linux/sparc/bits/fcntl.h @@ -208,8 +208,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -220,7 +219,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -233,18 +231,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/sparc/bits/mathdef.h b/libc/sysdeps/linux/sparc/bits/mathdef.h index 7f9bbee81..b1a0d917c 100644 --- a/libc/sysdeps/linux/sparc/bits/mathdef.h +++ b/libc/sysdeps/linux/sparc/bits/mathdef.h @@ -57,15 +57,13 @@ typedef double double_t; #endif /* ISO C99 */ -#ifndef __NO_LONG_DOUBLE_MATH +#ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__ # if __WORDSIZE == 32 /* Signal that in 32bit ABI we do not really have a `long double'. The disables the declaration of all the `long double' function variants. */ -# define __NO_LONG_DOUBLE_MATH 1 -# elif !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ -# define __NO_LONG_DOUBLE_MATH 1 +# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__ # endif #endif diff --git a/libc/sysdeps/linux/sparc/bits/mathinline.h b/libc/sysdeps/linux/sparc/bits/mathinline.h index 729145e14..66ca0473d 100644 --- a/libc/sysdeps/linux/sparc/bits/mathinline.h +++ b/libc/sysdeps/linux/sparc/bits/mathinline.h @@ -37,7 +37,7 @@ # if __WORDSIZE == 32 -# ifndef __NO_LONG_DOUBLE_MATH +# ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__ # define __unordered_cmp(x, y) \ (__extension__ \ @@ -94,7 +94,7 @@ # define __unordered_v9cmp(x, y, op, qop) \ (__extension__ \ - ({ unsigned __r; \ + ({ unsigned __r; \ if (sizeof (x) == 4 && sizeof (y) == 4) \ { \ float __x = (x); float __y = (y); \ @@ -111,7 +111,7 @@ { \ long double __x = (x); long double __y = (y); \ extern int _Qp_cmp (const long double *a, const long double *b); \ - __r = qop; \ + __r = qop; \ } \ __r; })) @@ -157,7 +157,7 @@ __NTH (__signbit (double __x)) return __u.__i[0] < 0; } -# ifndef __NO_LONG_DOUBLE_MATH +# ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__ __MATH_INLINE int __NTH (__signbitl (long double __x)) { @@ -219,7 +219,7 @@ __NTH (sqrtl (long double __x)) _Qp_sqrt (&__r, &__x); return __r; } -# elif !defined __NO_LONG_DOUBLE_MATH +# elif defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ __MATH_INLINE long double sqrtl (long double __x) __THROW { @@ -257,7 +257,7 @@ __ieee754_sqrtl (long double __x) _Qp_sqrt(&__r, &__x); return __r; } -# elif !defined __NO_LONG_DOUBLE_MATH +# elif defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ __MATH_INLINE long double __ieee754_sqrtl (long double __x) { diff --git a/libc/sysdeps/linux/sparc/bits/wordsize.h b/libc/sysdeps/linux/sparc/bits/wordsize.h index c0e600ed5..c8e5bfdea 100644 --- a/libc/sysdeps/linux/sparc/bits/wordsize.h +++ b/libc/sysdeps/linux/sparc/bits/wordsize.h @@ -6,7 +6,7 @@ # define __WORDSIZE 32 #endif -#if 0 /* uClibc: done in mathdefs.h: !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL*/ +#if 0 /* uClibc: done in mathdefs.h: defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __LONG_DOUBLE_MATH_OPTIONAL*/ # if __WORDSIZE == 32 /* Signal that in 32bit ABI we didn't used to have a `long double'. @@ -14,7 +14,7 @@ to the double functions. */ # define __LONG_DOUBLE_MATH_OPTIONAL 1 # ifndef __LONG_DOUBLE_128__ -# define __NO_LONG_DOUBLE_MATH 1 +# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__ # endif # endif #endif diff --git a/libc/sysdeps/linux/sparc/brk.c b/libc/sysdeps/linux/sparc/brk.c index 53f2c9c1d..37415d49d 100644 --- a/libc/sysdeps/linux/sparc/brk.c +++ b/libc/sysdeps/linux/sparc/brk.c @@ -25,7 +25,7 @@ /* This must be initialized data because commons can't have aliases. */ void *__curbrk attribute_hidden = 0; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk (void *addr) { void *newbrk; diff --git a/libc/sysdeps/linux/sparc/qp_ops.c b/libc/sysdeps/linux/sparc/qp_ops.c index 9080baaee..5336a292f 100644 --- a/libc/sysdeps/linux/sparc/qp_ops.c +++ b/libc/sysdeps/linux/sparc/qp_ops.c @@ -1,4 +1,4 @@ -// XXX add ops from glibc sysdeps/sparc/sparc64/soft-fp +/* XXX add ops from glibc sysdeps/sparc/sparc64/soft-fp */ #define fakedef(name) \ void name(void) \ diff --git a/libc/sysdeps/linux/v850/__longjmp.S b/libc/sysdeps/linux/v850/__longjmp.S index 2c470264f..fa29e0f78 100644 --- a/libc/sysdeps/linux/v850/__longjmp.S +++ b/libc/sysdeps/linux/v850/__longjmp.S @@ -7,7 +7,7 @@ * 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. - * + * * Written by Miles Bader <miles@gnu.org> */ @@ -35,7 +35,7 @@ C_ENTRY(__longjmp): sld.w 40[ep], r27 sld.w 44[ep], r28 sld.w 48[ep], r29 - mov 1, r10 // return val + mov 1, r10 /* return val */ jmp [lp] C_END(__longjmp) libc_hidden_def(__longjmp) diff --git a/libc/sysdeps/linux/v850/bits/fcntl.h b/libc/sysdeps/linux/v850/bits/fcntl.h index 97aa632c9..a3da35ae2 100644 --- a/libc/sysdeps/linux/v850/bits/fcntl.h +++ b/libc/sysdeps/linux/v850/bits/fcntl.h @@ -182,8 +182,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -194,7 +193,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -207,18 +205,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/v850/crt0.S b/libc/sysdeps/linux/v850/crt0.S index 11d7bb5aa..01e9f8309 100644 --- a/libc/sysdeps/linux/v850/crt0.S +++ b/libc/sysdeps/linux/v850/crt0.S @@ -19,25 +19,25 @@ .text C_ENTRY(start): - ld.w 0[sp], r6 // Arg 0: argc + ld.w 0[sp], r6 /* Arg 0: argc */ - addi 4, sp, r7 // Arg 1: argv + addi 4, sp, r7 /* Arg 1: argv */ - mov r7, r8 // Arg 2: envp - mov r6, r10 // skip argc elements to get envp start - add 1, r10 // ...plus the NULL at the end of argv - shl 2, r10 // Convert to byte-count to skip + mov r7, r8 /* Arg 2: envp */ + mov r6, r10 /* skip argc elements to get envp start */ + add 1, r10 /* ...plus the NULL at the end of argv */ + shl 2, r10 /* Convert to byte-count to skip */ add r10, r8 - // Load CTBP register + /* Load CTBP register */ mov hilo(C_SYMBOL_NAME(_ctbp)), r19 ldsr r19, ctbp - // Load GP + /* Load GP */ mov hilo(C_SYMBOL_NAME(_gp)), gp - // tail-call uclibc's startup routine - addi -24, sp, sp // Stack space reserved for args + /* tail-call uclibc's startup routine */ + addi -24, sp, sp /* Stack space reserved for args */ jr C_SYMBOL_NAME(__uClibc_main) diff --git a/libc/sysdeps/linux/v850/mmap.c b/libc/sysdeps/linux/v850/mmap.c index 72fb37dd2..7732b07f3 100644 --- a/libc/sysdeps/linux/v850/mmap.c +++ b/libc/sysdeps/linux/v850/mmap.c @@ -10,8 +10,8 @@ #include <sys/mman.h> #include <sys/syscall.h> -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ _syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot, - int, flags, int, fd, __off_t, offset); + int, flags, int, fd, __off_t, offset) libc_hidden_def(mmap) diff --git a/libc/sysdeps/linux/v850/vfork.S b/libc/sysdeps/linux/v850/vfork.S index 82d127079..2533853b5 100644 --- a/libc/sysdeps/linux/v850/vfork.S +++ b/libc/sysdeps/linux/v850/vfork.S @@ -7,7 +7,7 @@ * 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. - * + * * Written by Miles Bader <miles@gnu.org> */ @@ -29,14 +29,14 @@ C_ENTRY (__vfork): addi SYS_vfork, r0, r12 trap 0 - addi -125, r0, r11 // minimum err value + addi -125, r0, r11 /* minimum err value */ cmp r11, r10 bh 1f - jmp [lp] // normal return + jmp [lp] /* normal return */ 1: mov hilo(C_SYMBOL_NAME(errno)), r11 subr r0, r10 st.w r10, 0[r11] - jmp [lp] // error return + jmp [lp] /* error return */ C_END(__vfork) weak_alias(__vfork,vfork) libc_hidden_weak(vfork) diff --git a/libc/sysdeps/linux/vax/bits/fcntl.h b/libc/sysdeps/linux/vax/bits/fcntl.h index a38bf52ad..66c2812c4 100644 --- a/libc/sysdeps/linux/vax/bits/fcntl.h +++ b/libc/sysdeps/linux/vax/bits/fcntl.h @@ -162,8 +162,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -174,7 +173,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -187,18 +185,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/vax/brk.c b/libc/sysdeps/linux/vax/brk.c index 47fd3e529..53652f922 100644 --- a/libc/sysdeps/linux/vax/brk.c +++ b/libc/sysdeps/linux/vax/brk.c @@ -24,7 +24,7 @@ /* This must be initialized data because commons can't have aliases. */ void *__curbrk attribute_hidden = NULL; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk (void *addr) { diff --git a/libc/sysdeps/linux/vax/mmap.c b/libc/sysdeps/linux/vax/mmap.c index 41bfb79f1..2df685c21 100644 --- a/libc/sysdeps/linux/vax/mmap.c +++ b/libc/sysdeps/linux/vax/mmap.c @@ -4,8 +4,8 @@ #include <errno.h> #include <sys/syscall.h> -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ _syscall6 (void *, mmap, void *, start, size_t, length, int, prot, int, flags, - int, fd, off_t, offset); + int, fd, off_t, offset) libc_hidden_def(mmap) diff --git a/libc/sysdeps/linux/x86_64/bits/fcntl.h b/libc/sysdeps/linux/x86_64/bits/fcntl.h index 858240fe5..be00e4ac7 100644 --- a/libc/sysdeps/linux/x86_64/bits/fcntl.h +++ b/libc/sysdeps/linux/x86_64/bits/fcntl.h @@ -203,8 +203,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -215,7 +214,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -228,18 +226,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/x86_64/bits/mathdef.h b/libc/sysdeps/linux/x86_64/bits/mathdef.h index b0567e4d4..7b1618959 100644 --- a/libc/sysdeps/linux/x86_64/bits/mathdef.h +++ b/libc/sysdeps/linux/x86_64/bits/mathdef.h @@ -46,7 +46,3 @@ typedef long double double_t; /* `double' expressions are evaluated as # define FP_ILOGBNAN (-2147483647 - 1) #endif /* ISO C99 */ - -#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/libc/sysdeps/linux/x86_64/brk.c b/libc/sysdeps/linux/x86_64/brk.c index eddfd9830..fc906abc1 100644 --- a/libc/sysdeps/linux/x86_64/brk.c +++ b/libc/sysdeps/linux/x86_64/brk.c @@ -24,7 +24,7 @@ /* This must be initialized data because commons can't have aliases. */ void *__curbrk attribute_hidden = 0; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk (void *addr) { void *__unbounded newbrk; diff --git a/libc/sysdeps/linux/x86_64/mmap.c b/libc/sysdeps/linux/x86_64/mmap.c index baaee6847..9c5077acb 100644 --- a/libc/sysdeps/linux/x86_64/mmap.c +++ b/libc/sysdeps/linux/x86_64/mmap.c @@ -13,8 +13,8 @@ #include <sys/mman.h> #include <sys/syscall.h> -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ _syscall6(void *, mmap, void *, start, size_t, length, int, prot, - int, flags, int, fd, off_t, offset); + int, flags, int, fd, off_t, offset) libc_hidden_def(mmap) diff --git a/libc/sysdeps/linux/x86_64/sigaction.c b/libc/sysdeps/linux/x86_64/sigaction.c index aa5c0d472..3d9e4ea29 100644 --- a/libc/sysdeps/linux/x86_64/sigaction.c +++ b/libc/sysdeps/linux/x86_64/sigaction.c @@ -120,7 +120,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) #endif #ifndef LIBC_SIGACTION -libc_hidden_proto(sigaction) +/* libc_hidden_proto(sigaction) */ weak_alias(__libc_sigaction,sigaction) libc_hidden_weak(sigaction) #endif diff --git a/libc/sysdeps/linux/x86_64/sys/io.h b/libc/sysdeps/linux/x86_64/sys/io.h index 802a0dfb4..ec1212560 100644 --- a/libc/sysdeps/linux/x86_64/sys/io.h +++ b/libc/sysdeps/linux/x86_64/sys/io.h @@ -32,6 +32,7 @@ __BEGIN_DECLS E.g., Linux/Alpha for Alpha PCs supports this. */ extern int ioperm (unsigned long int __from, unsigned long int __num, int __turn_on) __THROW; +libc_hidden_proto(ioperm) /* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to access any I/O port is granted. This call requires root diff --git a/libc/sysdeps/linux/x86_64/sys/perm.h b/libc/sysdeps/linux/x86_64/sys/perm.h index 382fa92ee..37964552c 100644 --- a/libc/sysdeps/linux/x86_64/sys/perm.h +++ b/libc/sysdeps/linux/x86_64/sys/perm.h @@ -26,6 +26,7 @@ __BEGIN_DECLS /* Set port input/output permissions. */ extern int ioperm (unsigned long int __from, unsigned long int __num, int __turn_on) __THROW; +libc_hidden_proto(ioperm) /* Change I/O privilege level. */ diff --git a/libc/sysdeps/linux/xtensa/__longjmp.S b/libc/sysdeps/linux/xtensa/__longjmp.S index 0fa939095..5d5dd2f5b 100644 --- a/libc/sysdeps/linux/xtensa/__longjmp.S +++ b/libc/sysdeps/linux/xtensa/__longjmp.S @@ -84,7 +84,7 @@ ENTRY (__longjmp) slli a4, a7, 4 sub a6, a8, a4 addi a5, a2, 16 - addi a8, a8, -16 // a8 = end of register overflow area + addi a8, a8, -16 /* a8 = end of register overflow area */ .Lljloop: l32i a7, a5, 0 l32i a4, a5, 4 @@ -105,8 +105,8 @@ ENTRY (__longjmp) case the contents were moved by an alloca after calling setjmp. This is a bit paranoid but it doesn't cost much. */ - l32i a7, a2, 4 // load the target stack pointer - addi a7, a7, -16 // find the destination save area + l32i a7, a2, 4 /* load the target stack pointer */ + addi a7, a7, -16 /* find the destination save area */ l32i a4, a2, 48 l32i a5, a2, 52 s32i a4, a7, 0 diff --git a/libc/sysdeps/linux/xtensa/bits/fcntl.h b/libc/sysdeps/linux/xtensa/bits/fcntl.h index 4a8018a9f..a89362e46 100644 --- a/libc/sysdeps/linux/xtensa/bits/fcntl.h +++ b/libc/sysdeps/linux/xtensa/bits/fcntl.h @@ -186,8 +186,7 @@ struct flock64 #endif -#ifdef __USE_GNU -#if 0 +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the @@ -198,7 +197,6 @@ struct flock64 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ -#endif /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ @@ -211,18 +209,16 @@ struct flock64 __BEGIN_DECLS -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ /* Provide kernel hint to read ahead. */ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; -#if 0 /* Selective file content synch'ing. */ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, unsigned int __flags); -#endif /* Splice address range into a pipe. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, diff --git a/libc/sysdeps/linux/xtensa/bits/mathdef.h b/libc/sysdeps/linux/xtensa/bits/mathdef.h index 0177fa9fc..99a4a318d 100644 --- a/libc/sysdeps/linux/xtensa/bits/mathdef.h +++ b/libc/sysdeps/linux/xtensa/bits/mathdef.h @@ -36,8 +36,8 @@ typedef double double_t; /* `double' expressions are evaluated as #endif /* ISO C99 */ -#ifndef __NO_LONG_DOUBLE_MATH +#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ /* Signal that we do not really have a `long double'. The disables the declaration of all the `long double' function variants. */ -# define __NO_LONG_DOUBLE_MATH 1 +# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__ #endif diff --git a/libc/sysdeps/linux/xtensa/bits/uClibc_arch_features.h b/libc/sysdeps/linux/xtensa/bits/uClibc_arch_features.h index 142aacd53..d6a99b4d2 100644 --- a/libc/sysdeps/linux/xtensa/bits/uClibc_arch_features.h +++ b/libc/sysdeps/linux/xtensa/bits/uClibc_arch_features.h @@ -12,7 +12,7 @@ #define __UCLIBC_MMAP_HAS_6_ARGS__ /* does your target use syscall4() for truncate64 ? (32bit arches only) */ -#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__ +#define __UCLIBC_TRUNCATE64_HAS_4_ARGS__ /* does your target have a broken create_module() ? */ #undef __UCLIBC_BROKEN_CREATE_MODULE__ diff --git a/libc/sysdeps/linux/xtensa/brk.c b/libc/sysdeps/linux/xtensa/brk.c index 51f610b70..b7a783f61 100644 --- a/libc/sysdeps/linux/xtensa/brk.c +++ b/libc/sysdeps/linux/xtensa/brk.c @@ -24,7 +24,7 @@ /* This must be initialized data because commons can't have aliases. */ void *__curbrk attribute_hidden = 0; -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ int brk (void *addr) { diff --git a/libc/sysdeps/linux/xtensa/pread_write.c b/libc/sysdeps/linux/xtensa/pread_write.c index 40d0f0324..212a40935 100644 --- a/libc/sysdeps/linux/xtensa/pread_write.c +++ b/libc/sysdeps/linux/xtensa/pread_write.c @@ -32,7 +32,7 @@ extern __typeof(pwrite64) __libc_pwrite64; # define __NR___syscall_pread __NR_pread /* On Xtensa, 64-bit values are aligned in even/odd register pairs. */ static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, - size_t, count, int, pad, off_t, offset_hi, off_t, offset_lo); + size_t, count, int, pad, off_t, offset_hi, off_t, offset_lo) ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) { @@ -57,7 +57,7 @@ weak_alias(__libc_pread64,pread64) # define __NR___syscall_pwrite __NR_pwrite /* On Xtensa, 64-bit values are aligned in even/odd register pairs. */ static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, - size_t, count, int, pad, off_t, offset_hi, off_t, offset_lo); + size_t, count, int, pad, off_t, offset_hi, off_t, offset_lo) ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) { @@ -77,9 +77,9 @@ weak_alias(__libc_pwrite64,pwrite64) #endif /* __NR_pwrite */ #if ! defined __NR_pread || ! defined __NR_pwrite -libc_hidden_proto(read) -libc_hidden_proto(write) -libc_hidden_proto(lseek) +/* libc_hidden_proto(read) */ +/* libc_hidden_proto(write) */ +/* libc_hidden_proto(lseek) */ static ssize_t __fake_pread_write(int fd, void *buf, size_t count, off_t offset, int do_pwrite) @@ -119,7 +119,7 @@ static ssize_t __fake_pread_write(int fd, void *buf, } # ifdef __UCLIBC_HAS_LFS__ -libc_hidden_proto(lseek64) +/* libc_hidden_proto(lseek64) */ static ssize_t __fake_pread_write64(int fd, void *buf, size_t count, off64_t offset, int do_pwrite) diff --git a/libc/sysdeps/linux/xtensa/setjmp.S b/libc/sysdeps/linux/xtensa/setjmp.S index 5e81460c7..cd74caf6e 100644 --- a/libc/sysdeps/linux/xtensa/setjmp.S +++ b/libc/sysdeps/linux/xtensa/setjmp.S @@ -61,13 +61,13 @@ END (setjmp) a3 = int savemask) */ ENTRY (__sigsetjmp) -1: +1: /* Flush registers. */ movi a4, __window_spill callx4 a4 /* Preserve the second argument (savemask) in a15. The selection - of a15 is arbitrary, except it's otherwise unused. There is no + of a15 is arbitrary, except it's otherwise unused. There is no risk of triggering a window overflow since we just returned from __window_spill(). */ mov a15, a3 @@ -90,7 +90,7 @@ ENTRY (__sigsetjmp) slli a4, a3, 4 sub a5, a7, a4 addi a6, a2, 16 - addi a7, a7, -16 // a7 = end of register overflow area + addi a7, a7, -16 /* a7 = end of register overflow area */ .Lsjloop: l32i a3, a5, 0 l32i a4, a5, 4 diff --git a/libc/sysdeps/linux/xtensa/vfork.S b/libc/sysdeps/linux/xtensa/vfork.S index 830a0cd4d..6e490fe45 100644 --- a/libc/sysdeps/linux/xtensa/vfork.S +++ b/libc/sysdeps/linux/xtensa/vfork.S @@ -52,19 +52,19 @@ ENTRY (__vfork) movi a6, .Ljumptable - extui a2, a0, 30, 2 // call-size: call4/8/12 = 1/2/3 - addx4 a4, a2, a6 // find return address in jumptable + extui a2, a0, 30, 2 /* call-size: call4/8/12 = 1/2/3 */ + addx4 a4, a2, a6 /* find return address in jumptable */ l32i a4, a4, 0 add a4, a4, a6 slli a2, a2, 30 - xor a3, a0, a2 // remove call-size from return address - extui a5, a4, 30, 2 // get high bits of jump target + xor a3, a0, a2 /* remove call-size from return addr */ + extui a5, a4, 30, 2 /* get high bits of jump target */ slli a5, a5, 30 - or a3, a3, a5 // stuff them into the return address - xor a4, a4, a5 // clear high bits of jump target - or a0, a4, a2 // create temporary return address - retw // "return" to .L4, .L8, or .L12 + or a3, a3, a5 /* stuff them into the return address */ + xor a4, a4, a5 /* clear high bits of jump target */ + or a0, a4, a2 /* create temporary return address */ + retw /* "return" to .L4, .L8, or .L12 */ .align 4 .Ljumptable: @@ -81,7 +81,7 @@ ENTRY (__vfork) /* Use syscall 'clone'. Set new stack pointer to the same address. */ movi a2, SYS_ify (clone) - movi a3, 0 + movi a3, 0 movi a6, CLONE_VM | CLONE_VFORK | SIGCHLD syscall @@ -95,7 +95,7 @@ ENTRY (__vfork) bgeu a6, a5, 1f jx a7 -1: call4 .Lerr // returns to original caller +1: call4 .Lerr /* returns to original caller */ /* a11: return address */ @@ -121,7 +121,7 @@ ENTRY (__vfork) bgeu a10, a9, 1f jx a11 -1: call8 .Lerr // returns to original caller +1: call8 .Lerr /* returns to original caller */ /* a15: return address */ @@ -148,18 +148,18 @@ ENTRY (__vfork) bgeu a14, a13, 1f jx a15 -1: call12 .Lerr // returns to original caller +1: call12 .Lerr /* returns to original caller */ .align 4 .Lerr: entry a1, 16 /* Restore the return address. */ - extui a4, a0, 30, 2 // get the call-size bits + extui a4, a0, 30, 2 /* get the call-size bits */ slli a4, a4, 30 - slli a3, a3, 2 // clear high bits of target address + slli a3, a3, 2 /* clear high bits of target address */ srli a3, a3, 2 - or a0, a3, a4 // combine them + or a0, a3, a4 /* combine them */ PSEUDO_END (__vfork) .Lpseudo_end: diff --git a/libc/sysdeps/linux/xtensa/windowspill.S b/libc/sysdeps/linux/xtensa/windowspill.S index a63771756..1487f079f 100644 --- a/libc/sysdeps/linux/xtensa/windowspill.S +++ b/libc/sysdeps/linux/xtensa/windowspill.S @@ -26,8 +26,8 @@ .type __window_spill, @function __window_spill: entry a1, 48 - bbci.l a0, 31, .L4 // branch if called with call4 - bbsi.l a0, 30, .L12 // branch if called with call12 + bbci.l a0, 31, .L4 /* branch if called with call4 */ + bbsi.l a0, 30, .L12 /* branch if called with call12 */ /* Called with call8: touch register NUM_REGS-12 (4/20/52) */ .L8: @@ -36,18 +36,18 @@ __window_spill: retw .align 4 -1: _entry a1, 48 // touch NUM_REGS-24 (x/8/40) +1: _entry a1, 48 /* touch NUM_REGS-24 (x/8/40) */ #if XCHAL_NUM_AREGS == 32 mov a8, a0 retw #else mov a12, a0 - _entry a1, 48 // touch NUM_REGS-36 (x/x/28) + _entry a1, 48 /* touch NUM_REGS-36 (x/x/28) */ mov a12, a0 - _entry a1, 48 // touch NUM_REGS-48 (x/x/16) + _entry a1, 48 /* touch NUM_REGS-48 (x/x/16) */ mov a12, a0 - _entry a1, 16 // touch NUM_REGS-60 (x/x/4) + _entry a1, 16 /* touch NUM_REGS-60 (x/x/4) */ #endif #endif mov a4, a0 @@ -62,14 +62,14 @@ __window_spill: retw .align 4 -1: _entry a1, 48 // touch NUM_REGS-20 (x/12/44) +1: _entry a1, 48 /* touch NUM_REGS-20 (x/12/44) */ mov a12, a0 #if XCHAL_NUM_AREGS > 32 - _entry a1, 48 // touch NUM_REGS-32 (x/x/32) + _entry a1, 48 /* touch NUM_REGS-32 (x/x/32) */ mov a12, a0 - _entry a1, 48 // touch NUM_REGS-44 (x/x/20) + _entry a1, 48 /* touch NUM_REGS-44 (x/x/20) */ mov a12, a0 - _entry a1, 48 // touch NUM_REGS-56 (x/x/8) + _entry a1, 48 /* touch NUM_REGS-56 (x/x/8) */ mov a8, a0 #endif #endif @@ -82,14 +82,14 @@ __window_spill: retw .align 4 -1: _entry a1, 48 // touch NUM_REGS-28 (x/4/36) +1: _entry a1, 48 /* touch NUM_REGS-28 (x/4/36) */ #if XCHAL_NUM_AREGS == 32 mov a4, a0 #else mov a12, a0 - _entry a1, 48 // touch NUM_REGS-40 (x/x/24) + _entry a1, 48 /* touch NUM_REGS-40 (x/x/24) */ mov a12, a0 - _entry a1, 48 // touch NUM_REGS-52 (x/x/12) + _entry a1, 48 /* touch NUM_REGS-52 (x/x/12) */ mov a12, a0 #endif #endif |