summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/avr32/Makefile.arch6
-rw-r--r--libc/sysdeps/linux/avr32/__longjmp.S20
-rw-r--r--libc/sysdeps/linux/avr32/bits/atomic.h174
-rw-r--r--libc/sysdeps/linux/avr32/bits/byteswap.h54
-rw-r--r--libc/sysdeps/linux/avr32/bits/fcntl.h191
-rw-r--r--libc/sysdeps/linux/avr32/bits/kernel_stat.h74
-rw-r--r--libc/sysdeps/linux/avr32/bits/kernel_types.h58
-rw-r--r--libc/sysdeps/linux/avr32/bits/mman.h86
-rw-r--r--libc/sysdeps/linux/avr32/bits/setjmp.h4
-rw-r--r--libc/sysdeps/linux/avr32/bits/stackinfo.h4
-rw-r--r--libc/sysdeps/linux/avr32/bits/syscalls.h180
-rw-r--r--libc/sysdeps/linux/avr32/bits/wordsize.h2
-rw-r--r--libc/sysdeps/linux/avr32/brk.c16
-rw-r--r--libc/sysdeps/linux/avr32/bsd-_setjmp.S14
-rw-r--r--libc/sysdeps/linux/avr32/bsd-setjmp.S14
-rw-r--r--libc/sysdeps/linux/avr32/clone.c34
-rw-r--r--libc/sysdeps/linux/avr32/crt1.S114
-rw-r--r--libc/sysdeps/linux/avr32/crti.S40
-rw-r--r--libc/sysdeps/linux/avr32/crtn.S24
-rw-r--r--libc/sysdeps/linux/avr32/mmap.c18
-rw-r--r--libc/sysdeps/linux/avr32/setjmp.S24
-rw-r--r--libc/sysdeps/linux/avr32/sigaction.c60
-rw-r--r--libc/sysdeps/linux/avr32/sigrestorer.S10
-rw-r--r--libc/sysdeps/linux/avr32/sys/elf.h4
-rw-r--r--libc/sysdeps/linux/avr32/sys/procfs.h44
-rw-r--r--libc/sysdeps/linux/avr32/sys/ucontext.h48
-rw-r--r--libc/sysdeps/linux/avr32/sys/user.h58
-rw-r--r--libc/sysdeps/linux/avr32/syscall.S70
-rw-r--r--libc/sysdeps/linux/avr32/vfork.S42
-rw-r--r--libc/sysdeps/linux/cris/__init_brk.c2
-rw-r--r--libc/sysdeps/linux/cris/bits/fcntl.h32
-rw-r--r--libc/sysdeps/linux/cris/bits/syscalls.h6
-rw-r--r--libc/sysdeps/linux/cris/bits/uClibc_arch_features.h3
-rw-r--r--libc/sysdeps/linux/cris/brk.c2
-rw-r--r--libc/sysdeps/linux/cris/sbrk.c2
-rw-r--r--libc/sysdeps/linux/frv/bits/fcntl.h64
-rw-r--r--libc/sysdeps/linux/frv/bits/uClibc_arch_features.h3
-rw-r--r--libc/sysdeps/linux/h8300/bits/fcntl.h58
-rw-r--r--libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h3
-rw-r--r--libc/sysdeps/linux/h8300/brk.c2
-rw-r--r--libc/sysdeps/linux/h8300/ptrace.c2
-rw-r--r--libc/sysdeps/linux/hppa/bits/fcntl.h28
-rw-r--r--libc/sysdeps/linux/hppa/bits/syscalls.h4
-rw-r--r--libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h3
-rw-r--r--libc/sysdeps/linux/hppa/syscall.c5
-rw-r--r--libc/sysdeps/linux/i386/__longjmp.S1
-rw-r--r--libc/sysdeps/linux/i386/bits/atomic.h2
-rw-r--r--libc/sysdeps/linux/i386/bits/fcntl.h38
-rw-r--r--libc/sysdeps/linux/i386/bits/kernel_types.h6
-rw-r--r--libc/sysdeps/linux/i386/bits/syscalls.h49
-rw-r--r--libc/sysdeps/linux/i386/bits/uClibc_arch_features.h5
-rw-r--r--libc/sysdeps/linux/i386/bits/wordsize.h6
-rw-r--r--libc/sysdeps/linux/i386/bsd-_setjmp.S1
-rw-r--r--libc/sysdeps/linux/i386/bsd-setjmp.S1
-rw-r--r--libc/sysdeps/linux/i386/mmap64.S1
-rw-r--r--libc/sysdeps/linux/i386/setjmp.S1
-rw-r--r--libc/sysdeps/linux/i386/sigaction.c4
-rw-r--r--libc/sysdeps/linux/i386/sys/io.h2
-rw-r--r--libc/sysdeps/linux/i386/syscall.S1
-rw-r--r--libc/sysdeps/linux/i386/vfork.S1
-rw-r--r--libc/sysdeps/linux/ia64/__syscall_error.c2
-rw-r--r--libc/sysdeps/linux/ia64/bits/fcntl.h40
-rw-r--r--libc/sysdeps/linux/ia64/bits/syscalls.h18
-rw-r--r--libc/sysdeps/linux/ia64/bits/uClibc_arch_features.h3
-rw-r--r--libc/sysdeps/linux/ia64/sysdep.h2
-rw-r--r--libc/sysdeps/linux/nios/bits/fcntl.h32
-rw-r--r--libc/sysdeps/linux/nios/bits/uClibc_arch_features.h3
-rw-r--r--libc/sysdeps/linux/nios/brk.c6
-rw-r--r--libc/sysdeps/linux/nios/crtend.c3
-rw-r--r--libc/sysdeps/linux/nios2/bits/fcntl.h32
-rw-r--r--libc/sysdeps/linux/nios2/bits/uClibc_arch_features.h3
-rw-r--r--libc/sysdeps/linux/nios2/brk.c8
-rw-r--r--libc/sysdeps/linux/nios2/clone.c12
-rw-r--r--libc/sysdeps/linux/nios2/syscall.c18
-rw-r--r--libc/sysdeps/linux/v850/bits/fcntl.h58
-rw-r--r--libc/sysdeps/linux/v850/bits/uClibc_arch_features.h3
-rw-r--r--libc/sysdeps/linux/v850/clone.c12
-rw-r--r--libc/sysdeps/linux/v850/syscall.c18
-rw-r--r--libc/sysdeps/linux/x86_64/__longjmp.S1
-rw-r--r--libc/sysdeps/linux/x86_64/bits/atomic.h2
-rw-r--r--libc/sysdeps/linux/x86_64/bits/fcntl.h38
-rw-r--r--libc/sysdeps/linux/x86_64/bits/syscalls.h14
-rw-r--r--libc/sysdeps/linux/x86_64/bits/uClibc_arch_features.h3
-rw-r--r--libc/sysdeps/linux/x86_64/brk.c2
-rw-r--r--libc/sysdeps/linux/x86_64/bsd-_setjmp.S1
-rw-r--r--libc/sysdeps/linux/x86_64/bsd-setjmp.S1
-rw-r--r--libc/sysdeps/linux/x86_64/clone.S1
-rw-r--r--libc/sysdeps/linux/x86_64/setjmp.S1
-rw-r--r--libc/sysdeps/linux/x86_64/sigaction.c11
-rw-r--r--libc/sysdeps/linux/x86_64/syscall.S1
-rw-r--r--libc/sysdeps/linux/x86_64/vfork.S1
-rw-r--r--libc/sysdeps/linux/xtensa/bits/fcntl.h46
-rw-r--r--libc/sysdeps/linux/xtensa/bits/syscalls.h4
-rw-r--r--libc/sysdeps/linux/xtensa/sigaction.c2
-rw-r--r--libc/sysdeps/linux/xtensa/windowspill.S1
95 files changed, 1282 insertions, 946 deletions
diff --git a/libc/sysdeps/linux/avr32/Makefile.arch b/libc/sysdeps/linux/avr32/Makefile.arch
index c71c3ce56..44fc01ebf 100644
--- a/libc/sysdeps/linux/avr32/Makefile.arch
+++ b/libc/sysdeps/linux/avr32/Makefile.arch
@@ -5,9 +5,9 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC := brk.c clone.c mmap.c sigaction.c
+CSRC := brk.c clone.c mmap.c sigaction.c
-SSRC := __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
- sigrestorer.S syscall.S vfork.S
+SSRC := __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
+ sigrestorer.S syscall.S vfork.S
include $(top_srcdir)/libc/sysdeps/linux/Makefile.commonarch
diff --git a/libc/sysdeps/linux/avr32/__longjmp.S b/libc/sysdeps/linux/avr32/__longjmp.S
index 245611a46..6154bb2ac 100644
--- a/libc/sysdeps/linux/avr32/__longjmp.S
+++ b/libc/sysdeps/linux/avr32/__longjmp.S
@@ -6,16 +6,16 @@
* archive for more details.
*/
- .global __longjmp
- .type __longjmp,"function"
- .align 1
+ .global __longjmp
+ .type __longjmp,"function"
+ .align 1
__longjmp:
- ldm r12++, r0-r8,sp,lr
- mustr r8 /* restore status register (lower half) */
- cp r11, 0 /* can't return zero */
- frs
- moveq r11, 1
- retal r11
- .size __longjmp, . - __longjmp
+ ldm r12++, r0-r8,sp,lr
+ mustr r8 /* restore status register (lower half) */
+ cp r11, 0 /* can't return zero */
+ frs
+ moveq r11, 1
+ retal r11
+ .size __longjmp, . - __longjmp
libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/avr32/bits/atomic.h b/libc/sysdeps/linux/avr32/bits/atomic.h
index 4f870c023..e6be41f01 100644
--- a/libc/sysdeps/linux/avr32/bits/atomic.h
+++ b/libc/sysdeps/linux/avr32/bits/atomic.h
@@ -20,101 +20,101 @@ typedef uintptr_t uatomicptr_t;
typedef intmax_t atomic_max_t;
typedef uintmax_t uatomic_max_t;
-#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
- (abort(), 0)
+#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
+ (abort(), 0)
-#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
- (abort(), 0)
+#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
+ (abort(), 0)
-#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
- ({ \
- __typeof__(*(mem)) __prev; \
- __asm__ __volatile__( \
- "/* __arch_compare_and_exchange_val_32_acq */\n" \
- "1: ssrf 5\n" \
- " ld.w %[result], %[m]\n" \
- " cp.w %[result], %[old]\n" \
- " brne 2f\n" \
- " stcond %[m], %[new]\n" \
- " brne 1b\n" \
- "2:" \
- : [result] "=&r"(__result), [m] "=m"(*(mem)) \
- : "m"(*(mem)), [old] "ir"(oldval), \
- [new] "r"(newval) \
- : "memory", "cc"); \
- __prev; \
- })
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+ ({ \
+ __typeof__(*(mem)) __prev; \
+ __asm__ __volatile__( \
+ "/* __arch_compare_and_exchange_val_32_acq */\n" \
+ "1: ssrf 5\n" \
+ " ld.w %[result], %[m]\n" \
+ " cp.w %[result], %[old]\n" \
+ " brne 2f\n" \
+ " stcond %[m], %[new]\n" \
+ " brne 1b\n" \
+ "2:" \
+ : [result] "=&r"(__result), [m] "=m"(*(mem)) \
+ : "m"(*(mem)), [old] "ir"(oldval), \
+ [new] "r"(newval) \
+ : "memory", "cc"); \
+ __prev; \
+ })
-#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
- (abort(), 0)
+#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+ (abort(), 0)
-#define __arch_exchange_32_acq(mem, newval) \
- ({ \
- __typeof__(*(mem)) __oldval; \
- __asm__ __volatile__( \
- "/*__arch_exchange_32_acq */\n" \
- " xchg %[old], %[m], %[new]" \
- : [old] "=&r"(__oldval) \
- : [m] "r"(mem), [new] "r"(newval) \
- : "memory"); \
- __oldval; \
- })
+#define __arch_exchange_32_acq(mem, newval) \
+ ({ \
+ __typeof__(*(mem)) __oldval; \
+ __asm__ __volatile__( \
+ "/*__arch_exchange_32_acq */\n" \
+ " xchg %[old], %[m], %[new]" \
+ : [old] "=&r"(__oldval) \
+ : [m] "r"(mem), [new] "r"(newval) \
+ : "memory"); \
+ __oldval; \
+ })
-#define __arch_atomic_exchange_and_add_32(mem, value) \
- ({ \
- __typeof__(*(mem)) __oldval, __tmp; \
- __asm__ __volatile__( \
- "/* __arch_atomic_exchange_and_add_32 */\n" \
- "1: ssrf 5\n" \
- " ld.w %[old], %[m]\n" \
- " add %[tmp], %[old], %[val]\n" \
- " stcond %[m], %[tmp]\n" \
- " brne 1b" \
- : [old] "=&r"(__oldval), [tmp] "=&r"(__tmp), \
- [m] "=m"(*(mem)) \
- : "m"(*(mem)), [val] "r"(value) \
- : "memory", "cc"); \
- __oldval; \
- })
+#define __arch_atomic_exchange_and_add_32(mem, value) \
+ ({ \
+ __typeof__(*(mem)) __oldval, __tmp; \
+ __asm__ __volatile__( \
+ "/* __arch_atomic_exchange_and_add_32 */\n" \
+ "1: ssrf 5\n" \
+ " ld.w %[old], %[m]\n" \
+ " add %[tmp], %[old], %[val]\n" \
+ " stcond %[m], %[tmp]\n" \
+ " brne 1b" \
+ : [old] "=&r"(__oldval), [tmp] "=&r"(__tmp), \
+ [m] "=m"(*(mem)) \
+ : "m"(*(mem)), [val] "r"(value) \
+ : "memory", "cc"); \
+ __oldval; \
+ })
-#define __arch_atomic_decrement_if_positive_32(mem) \
- ({ \
- __typeof__(*(mem)) __oldval, __tmp; \
- __asm__ __volatile__( \
- "/* __arch_atomic_decrement_if_positive_32 */\n" \
- "1: ssrf 5\n" \
- " ld.w %[old], %[m]\n" \
- " sub %[tmp], %[old], 1\n" \
- " brlt 2f\n" \
- " stcond %[m], %[tmp]\n" \
- " brne 1b" \
- "2:" \
- : [old] "=&r"(__oldval), [tmp] "=&r"(__tmp), \
- [m] "=m"(*(mem)) \
- : "m"(*(mem)) \
- : "memory", "cc"); \
- __oldval; \
- })
+#define __arch_atomic_decrement_if_positive_32(mem) \
+ ({ \
+ __typeof__(*(mem)) __oldval, __tmp; \
+ __asm__ __volatile__( \
+ "/* __arch_atomic_decrement_if_positive_32 */\n" \
+ "1: ssrf 5\n" \
+ " ld.w %[old], %[m]\n" \
+ " sub %[tmp], %[old], 1\n" \
+ " brlt 2f\n" \
+ " stcond %[m], %[tmp]\n" \
+ " brne 1b" \
+ "2:" \
+ : [old] "=&r"(__oldval), [tmp] "=&r"(__tmp), \
+ [m] "=m"(*(mem)) \
+ : "m"(*(mem)) \
+ : "memory", "cc"); \
+ __oldval; \
+ })
-#define atomic_exchange_acq(mem, newval) \
- ({ \
- if (sizeof(*(mem)) != 4) \
- abort(); \
- __arch_exchange_32_acq(mem, newval); \
- })
+#define atomic_exchange_acq(mem, newval) \
+ ({ \
+ if (sizeof(*(mem)) != 4) \
+ abort(); \
+ __arch_exchange_32_acq(mem, newval); \
+ })
-#define atomic_exchange_and_add(mem, newval) \
- ({ \
- if (sizeof(*(mem)) != 4) \
- abort(); \
- __arch_atomic_exchange_and_add_32(mem, newval); \
- })
+#define atomic_exchange_and_add(mem, newval) \
+ ({ \
+ if (sizeof(*(mem)) != 4) \
+ abort(); \
+ __arch_atomic_exchange_and_add_32(mem, newval); \
+ })
-#define atomic_decrement_if_positive(mem) \
- ({ \
- if (sizeof(*(mem)) != 4) \
- abort(); \
- __arch_atomic_decrement_if_positive_32(mem); \
- })
+#define atomic_decrement_if_positive(mem) \
+ ({ \
+ if (sizeof(*(mem)) != 4) \
+ abort(); \
+ __arch_atomic_decrement_if_positive_32(mem); \
+ })
#endif /* _AVR32_BITS_ATOMIC_H */
diff --git a/libc/sysdeps/linux/avr32/bits/byteswap.h b/libc/sysdeps/linux/avr32/bits/byteswap.h
index 59e96320f..1c030b976 100644
--- a/libc/sysdeps/linux/avr32/bits/byteswap.h
+++ b/libc/sysdeps/linux/avr32/bits/byteswap.h
@@ -21,7 +21,7 @@
static __inline unsigned short int
__bswap_16 (unsigned short int __bsx)
{
- return ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8));
+ return ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8));
}
#endif
@@ -33,38 +33,38 @@ static __inline unsigned int
__bswap_32 (unsigned int __bsx)
{
return ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) |
- (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24));
+ (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24));
}
#endif
#if defined __GNUC__
/* Swap bytes in 64 bit value. */
-# define __bswap_constant_64(x) \
- ((((x) & 0xff00000000000000ull) >> 56) \
- | (((x) & 0x00ff000000000000ull) >> 40) \
- | (((x) & 0x0000ff0000000000ull) >> 24) \
- | (((x) & 0x000000ff00000000ull) >> 8) \
- | (((x) & 0x00000000ff000000ull) << 8) \
- | (((x) & 0x0000000000ff0000ull) << 24) \
- | (((x) & 0x000000000000ff00ull) << 40) \
- | (((x) & 0x00000000000000ffull) << 56))
+# define __bswap_constant_64(x) \
+ ((((x) & 0xff00000000000000ull) >> 56) \
+ | (((x) & 0x00ff000000000000ull) >> 40) \
+ | (((x) & 0x0000ff0000000000ull) >> 24) \
+ | (((x) & 0x000000ff00000000ull) >> 8) \
+ | (((x) & 0x00000000ff000000ull) << 8) \
+ | (((x) & 0x0000000000ff0000ull) << 24) \
+ | (((x) & 0x000000000000ff00ull) << 40) \
+ | (((x) & 0x00000000000000ffull) << 56))
-# define __bswap_64(x) \
- (__extension__ \
- ({ \
- union { \
- __extension__ unsigned long long int __ll; \
- unsigned int __l[2]; \
- } __w, __r; \
- if (__builtin_constant_p(x)) \
- __r.__ll = __bswap_constant_64(x); \
- else { \
- __w.__ll = (x); \
- __r.__l[0] = __bswap_32(__w.__l[1]); \
- __r.__l[1] = __bswap_32(__w.__l[0]); \
- } \
- __r.__ll; \
- }))
+# define __bswap_64(x) \
+ (__extension__ \
+ ({ \
+ union { \
+ __extension__ unsigned long long int __ll; \
+ unsigned int __l[2]; \
+ } __w, __r; \
+ if (__builtin_constant_p(x)) \
+ __r.__ll = __bswap_constant_64(x); \
+ else { \
+ __w.__ll = (x); \
+ __r.__l[0] = __bswap_32(__w.__l[1]); \
+ __r.__l[1] = __bswap_32(__w.__l[0]); \
+ } \
+ __r.__ll; \
+ }))
#endif
#endif /* _BITS_BYTESWAP_H */
diff --git a/libc/sysdeps/linux/avr32/bits/fcntl.h b/libc/sysdeps/linux/avr32/bits/fcntl.h
index b45dd2c4c..3bf4e1ac8 100644
--- a/libc/sysdeps/linux/avr32/bits/fcntl.h
+++ b/libc/sysdeps/linux/avr32/bits/fcntl.h
@@ -3,144 +3,147 @@
#endif
#include <sys/types.h>
+#ifdef __USE_GNU
+# include <bits/uio.h>
+#endif
/*
* open/fcntl - O_SYNC is only implemented on blocks devices and on files
* located on an ext2 file system
*/
-#define O_ACCMODE 00000003
-#define O_RDONLY 00000000
-#define O_WRONLY 00000001
-#define O_RDWR 00000002
-#define O_CREAT 00000100 /* not fcntl */
-#define O_EXCL 00000200 /* not fcntl */
-#define O_NOCTTY 00000400 /* not fcntl */
-#define O_TRUNC 00001000 /* not fcntl */
-#define O_APPEND 00002000
-#define O_NONBLOCK 00004000
-#define O_NDELAY O_NONBLOCK
-#define O_SYNC 00010000
-#define O_ASYNC 00020000
+#define O_ACCMODE 00000003
+#define O_RDONLY 00000000
+#define O_WRONLY 00000001
+#define O_RDWR 00000002
+#define O_CREAT 00000100 /* not fcntl */
+#define O_EXCL 00000200 /* not fcntl */
+#define O_NOCTTY 00000400 /* not fcntl */
+#define O_TRUNC 00001000 /* not fcntl */
+#define O_APPEND 00002000
+#define O_NONBLOCK 00004000
+#define O_NDELAY O_NONBLOCK
+#define O_SYNC 00010000
+#define O_ASYNC 00020000
#ifdef __USE_GNU
-# define O_DIRECT 00040000 /* must be a directory */
-# define O_DIRECTORY 00200000 /* direct disk access */
-# define O_NOFOLLOW 00400000 /* don't follow links */
-# define O_NOATIME 01000000 /* don't set atime */
+# define O_DIRECT 00040000 /* must be a directory */
+# define O_DIRECTORY 00200000 /* direct disk access */
+# define O_NOFOLLOW 00400000 /* don't follow links */
+# define O_NOATIME 01000000 /* don't set atime */
#endif
#ifdef __USE_LARGEFILE64
-# define O_LARGEFILE 00100000
+# define O_LARGEFILE 00100000
#endif
/* For now Linux has synchronisity options for data and read operations.
We define the symbols here but let them do the same as O_SYNC since
- this is a superset. */
+ this is a superset. */
#if defined __USE_POSIX199309 || defined __USE_UNIX98
-# define O_DSYNC O_SYNC /* Synchronize data. */
-# define O_RSYNC O_SYNC /* Synchronize read operations. */
+# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_RSYNC O_SYNC /* Synchronize read operations. */
#endif
-#define F_DUPFD 0 /* dup */
-#define F_GETFD 1 /* get close_on_exec */
-#define F_SETFD 2 /* set/clear close_on_exec */
-#define F_GETFL 3 /* get file->f_flags */
-#define F_SETFL 4 /* set file->f_flags */
+#define F_DUPFD 0 /* dup */
+#define F_GETFD 1 /* get close_on_exec */
+#define F_SETFD 2 /* set/clear close_on_exec */
+#define F_GETFL 3 /* get file->f_flags */
+#define F_SETFL 4 /* set file->f_flags */
#ifndef __USE_FILE_OFFSET64
-# define F_GETLK 5
-# define F_SETLK 6
-# define F_SETLKW 7
+# define F_GETLK 5
+# define F_SETLK 6
+# define F_SETLKW 7
#else
-# define F_GETLK F_GETLK64
-# define F_SETLK F_SETLK64
-# define F_SETLKW F_SETLKW64
+# define F_GETLK F_GETLK64
+# define F_SETLK F_SETLK64
+# define F_SETLKW F_SETLKW64
#endif
-#define F_GETLK64 12 /* using 'struct flock64' */
-#define F_SETLK64 13
-#define F_SETLKW64 14
+#define F_GETLK64 12 /* using 'struct flock64' */
+#define F_SETLK64 13
+#define F_SETLKW64 14
#if defined __USE_BSD || defined __USE_XOPEN2K
-# define F_SETOWN 8 /* for sockets. */
-# define F_GETOWN 9 /* for sockets. */
+# define F_SETOWN 8 /* for sockets. */
+# define F_GETOWN 9 /* for sockets. */
#endif
#ifdef __USE_GNU
-# define F_SETSIG 10 /* for sockets. */
-# define F_GETSIG 11 /* for sockets. */
+# define F_SETSIG 10 /* for sockets. */
+# define F_GETSIG 11 /* for sockets. */
#endif
#ifdef __USE_GNU
-# define F_SETLEASE 1024 /* Set a lease. */
-# define F_GETLEASE 1025 /* Enquire what lease is active. */
-# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_SETLEASE 1024 /* Set a lease. */
+# define F_GETLEASE 1025 /* Enquire what lease is active. */
+# define F_NOTIFY 1026 /* Request notfications on a directory. */
#endif
/* for F_[GET|SET]FL */
-#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* for posix fcntl() and lockf() */
-#define F_RDLCK 0
-#define F_WRLCK 1
-#define F_UNLCK 2
+#define F_RDLCK 0
+#define F_WRLCK 1
+#define F_UNLCK 2
/* for old implementation of bsd flock () */
-#define F_EXLCK 4 /* or 3 */
-#define F_SHLCK 8 /* or 4 */
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
/* for leases */
-#define F_INPROGRESS 16
+#define F_INPROGRESS 16
#ifdef __USE_BSD
/* operations for bsd flock(), also used by the kernel implementation */
-# define LOCK_SH 1 /* shared lock */
-# define LOCK_EX 2 /* exclusive lock */
-# define LOCK_NB 4 /* or'd with one of the above to prevent
- blocking */
-# define LOCK_UN 8 /* remove lock */
+# define LOCK_SH 1 /* shared lock */
+# define LOCK_EX 2 /* exclusive lock */
+# define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+# define LOCK_UN 8 /* remove lock */
#endif
#ifdef __USE_GNU
-# define LOCK_MAND 32 /* This is a mandatory flock */
-# define LOCK_READ 64 /* ... Which allows concurrent
- read operations */
-# define LOCK_WRITE 128 /* ... Which allows concurrent
- write operations */
-# define LOCK_RW 192 /* ... Which allows concurrent
- read & write ops */
+# define LOCK_MAND 32 /* This is a mandatory flock */
+# define LOCK_READ 64 /* ... Which allows concurrent
+ read operations */
+# define LOCK_WRITE 128 /* ... Which allows concurrent
+ write operations */
+# define LOCK_RW 192 /* ... Which allows concurrent
+ read & write ops */
#endif
#ifdef __USE_GNU
/* Types of directory notifications that may be requested with F_NOTIFY. */
-# define DN_ACCESS 0x00000001 /* File accessed. */
-# define DN_MODIFY 0x00000002 /* File modified. */
-# define DN_CREATE 0x00000004 /* File created. */
-# define DN_DELETE 0x00000008 /* File removed. */
-# define DN_RENAME 0x00000010 /* File renamed. */
-# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
-# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
+# define DN_ACCESS 0x00000001 /* File accessed. */
+# define DN_MODIFY 0x00000002 /* File modified. */
+# define DN_CREATE 0x00000004 /* File created. */
+# define DN_DELETE 0x00000008 /* File removed. */
+# define DN_RENAME 0x00000010 /* File renamed. */
+# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
+# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
#endif
struct flock {
- short l_type;
- short l_whence;
+ short l_type;
+ short l_whence;
#ifndef __USE_FILE_OFFSET64
- __off_t l_start;
- __off_t l_len;
+ __off_t l_start;
+ __off_t l_len;
#else
- __off64_t l_start;
- __off64_t l_len;
+ __off64_t l_start;
+ __off64_t l_len;
#endif
- __pid_t l_pid;
+ __pid_t l_pid;
};
#ifdef __USE_LARGEFILE64
struct flock64 {
- short l_type;
- short l_whence;
- __off64_t l_start;
- __off64_t l_len;
- __pid_t l_pid;
+ short l_type;
+ short l_whence;
+ __off64_t l_start;
+ __off64_t l_len;
+ __pid_t l_pid;
};
#endif
@@ -163,3 +166,31 @@ struct flock64 {
# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
+#ifdef __USE_GNU
+
+/* Flags for splice() and vmsplice() */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to) */
+# define SPLICE_F_MORE 4 /* Expect more data */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift */
+
+__BEGIN_DECLS
+
+/* Splice address range into a pipe */
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
+
+/* Splice two files together */
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
+
+/* In-kernel implementation of tee for pipe buffers */
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
+
+__END_DECLS
+#endif
diff --git a/libc/sysdeps/linux/avr32/bits/kernel_stat.h b/libc/sysdeps/linux/avr32/bits/kernel_stat.h
index e5cc813c4..f97d23bc5 100644
--- a/libc/sysdeps/linux/avr32/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/avr32/bits/kernel_stat.h
@@ -11,57 +11,57 @@
*/
struct kernel_stat {
- unsigned long st_dev;
- unsigned long st_ino;
- unsigned short st_mode;
- unsigned short st_nlink;
- unsigned short st_uid;
- unsigned short st_gid;
- unsigned long st_rdev;
- unsigned long st_size;
- unsigned long st_blksize;
- unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long st_atime_nsec;
- unsigned long st_mtime;
- unsigned long st_mtime_nsec;
- unsigned long st_ctime;
- unsigned long st_ctime_nsec;
- unsigned long __unused4;
- unsigned long __unused5;
+ unsigned long st_dev;
+ unsigned long st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned long st_rdev;
+ unsigned long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
+ unsigned long st_mtime;
+ unsigned long st_mtime_nsec;
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+ unsigned long __unused4;
+ unsigned long __unused5;
};
#define STAT_HAVE_NSEC 1
struct kernel_stat64 {
- unsigned long long st_dev;
+ unsigned long long st_dev;
- unsigned long long st_ino;
- unsigned int st_mode;
- unsigned int st_nlink;
+ unsigned long long st_ino;
+ unsigned int st_mode;
+ unsigned int st_nlink;
- unsigned long st_uid;
- unsigned long st_gid;
+ unsigned long st_uid;
+ unsigned long st_gid;
- unsigned long long st_rdev;
+ unsigned long long st_rdev;
- long long st_size;
- unsigned long __pad1;
- unsigned long st_blksize;
+ long long st_size;
+ unsigned long __pad1;
+ unsigned long st_blksize;
- unsigned long long st_blocks;
+ unsigned long long st_blocks;
- unsigned long st_atime;
- unsigned long st_atime_nsec;
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
- unsigned long st_mtime;
- unsigned long st_mtime_nsec;
+ unsigned long st_mtime;
+ unsigned long st_mtime_nsec;
- unsigned long st_ctime;
- unsigned long st_ctime_nsec;
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
- unsigned long __unused1;
- unsigned long __unused2;
+ unsigned long __unused1;
+ unsigned long __unused2;
};
#endif /* _BITS_STAT_STRUCT_H */
diff --git a/libc/sysdeps/linux/avr32/bits/kernel_types.h b/libc/sysdeps/linux/avr32/bits/kernel_types.h
index 159a440b2..f7d8b5298 100644
--- a/libc/sysdeps/linux/avr32/bits/kernel_types.h
+++ b/libc/sysdeps/linux/avr32/bits/kernel_types.h
@@ -13,42 +13,42 @@
* assume GCC is being used.
*/
-typedef unsigned long __kernel_dev_t;
-typedef unsigned long __kernel_ino_t;
-typedef unsigned short __kernel_mode_t;
-typedef unsigned short __kernel_nlink_t;
-typedef long __kernel_off_t;
-typedef int __kernel_pid_t;
-typedef unsigned short __kernel_ipc_pid_t;
-typedef unsigned int __kernel_uid_t;
-typedef unsigned int __kernel_gid_t;
-typedef unsigned long __kernel_size_t;
-typedef long __kernel_ssize_t;
-typedef int __kernel_ptrdiff_t;
-typedef long __kernel_time_t;
-typedef long __kernel_suseconds_t;
-typedef long __kernel_clock_t;
-typedef int __kernel_timer_t;
-typedef int __kernel_clockid_t;
-typedef int __kernel_daddr_t;
-typedef char * __kernel_caddr_t;
-typedef unsigned short __kernel_uid16_t;
-typedef unsigned short __kernel_gid16_t;
-typedef unsigned int __kernel_uid32_t;
-typedef unsigned int __kernel_gid32_t;
-typedef unsigned short __kernel_old_uid_t;
-typedef unsigned short __kernel_old_gid_t;
-typedef unsigned short __kernel_old_dev_t;
+typedef unsigned long __kernel_dev_t;
+typedef unsigned long __kernel_ino_t;
+typedef unsigned short __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned int __kernel_uid_t;
+typedef unsigned int __kernel_gid_t;
+typedef unsigned long __kernel_size_t;
+typedef long __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_timer_t;
+typedef int __kernel_clockid_t;
+typedef int __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int __kernel_uid32_t;
+typedef unsigned int __kernel_gid32_t;
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+typedef unsigned short __kernel_old_dev_t;
#ifdef __GNUC__
-typedef long long __kernel_loff_t;
+typedef long long __kernel_loff_t;
#endif
typedef struct {
#if defined(__USE_ALL)
- int val[2];
+ int val[2];
#else
- int __val[2];
+ int __val[2];
#endif
} __kernel_fsid_t;
diff --git a/libc/sysdeps/linux/avr32/bits/mman.h b/libc/sysdeps/linux/avr32/bits/mman.h
index be5837a7c..5f6e3c37a 100644
--- a/libc/sysdeps/linux/avr32/bits/mman.h
+++ b/libc/sysdeps/linux/avr32/bits/mman.h
@@ -30,74 +30,74 @@
without PROT_READ. The only guarantees are that no writing will be
allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
+#define PROT_READ 0x1 /* Page can be read. */
+#define PROT_WRITE 0x2 /* Page can be written. */
+#define PROT_EXEC 0x4 /* Page can be executed. */
+#define PROT_NONE 0x0 /* Page can not be accessed. */
+#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
+ growsdown vma (mprotect only). */
+#define PROT_GROWSUP 0x02000000 /* Extend change to start of
+ growsup vma (mprotect only). */
/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
+#define MAP_SHARED 0x01 /* Share changes. */
+#define MAP_PRIVATE 0x02 /* Changes are private. */
#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
+# define MAP_TYPE 0x0f /* Mask for type of mapping. */
#endif
/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
+#define MAP_FIXED 0x10 /* Interpret addr exactly. */
#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
+# define MAP_FILE 0
+# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
+# define MAP_ANON MAP_ANONYMOUS
#endif
/* These are Linux-specific. */
#ifdef __USE_MISC
-# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */
-# define MAP_DENYWRITE 0x0800 /* ETXTBSY */
-# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */
-# define MAP_LOCKED 0x2000 /* Lock the mapping. */
-# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */
-# define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
-# define MAP_NONBLOCK 0x10000 /* do not block on IO */
+# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */
+# define MAP_DENYWRITE 0x0800 /* ETXTBSY */
+# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */
+# define MAP_LOCKED 0x2000 /* Lock the mapping. */
+# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */
+# define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
+# define MAP_NONBLOCK 0x10000 /* do not block on IO */
#endif
/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
+#define MS_ASYNC 1 /* Sync memory asynchronously. */
+#define MS_SYNC 4 /* Synchronous memory sync. */
+#define MS_INVALIDATE 2 /* Invalidate the caches. */
/* Flags for `mlockall'. */
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 2 /* Lock all additions to address
- space. */
+#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
+#define MCL_FUTURE 2 /* Lock all additions to address
+ space. */
/* Flags for `mremap'. */
#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
+# define MREMAP_MAYMOVE 1
+# define MREMAP_FIXED 2
#endif
/* Advise to `madvise'. */
#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
#endif
/* The POSIX people had to invent similar names for the same things. */
#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
+# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
#endif
diff --git a/libc/sysdeps/linux/avr32/bits/setjmp.h b/libc/sysdeps/linux/avr32/bits/setjmp.h
index 733a473d1..78348a329 100644
--- a/libc/sysdeps/linux/avr32/bits/setjmp.h
+++ b/libc/sysdeps/linux/avr32/bits/setjmp.h
@@ -6,7 +6,7 @@
* archive for more details.
*/
#ifndef _BITS_SETJMP_H
-#define _BITS_SETJMP_H 1
+#define _BITS_SETJMP_H 1
#if !defined _SETJMP_H && !defined _PTHREAD_H
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
@@ -20,7 +20,7 @@
typedef int __jmp_buf[11];
#endif
-#define __JMP_BUF_SP 4
+#define __JMP_BUF_SP 4
/* Test if longjmp to JMPBUF would unwind the frame containing a local
variable at ADDRESS. */
diff --git a/libc/sysdeps/linux/avr32/bits/stackinfo.h b/libc/sysdeps/linux/avr32/bits/stackinfo.h
index 3723e2448..2c17d30a7 100644
--- a/libc/sysdeps/linux/avr32/bits/stackinfo.h
+++ b/libc/sysdeps/linux/avr32/bits/stackinfo.h
@@ -20,9 +20,9 @@
of the processor. */
#ifndef _STACKINFO_H
-#define _STACKINFO_H 1
+#define _STACKINFO_H 1
/* On AVR32 the stack grows down. */
-#define _STACK_GROWS_DOWN 1
+#define _STACK_GROWS_DOWN 1
#endif /* stackinfo.h */
diff --git a/libc/sysdeps/linux/avr32/bits/syscalls.h b/libc/sysdeps/linux/avr32/bits/syscalls.h
index b58ca0b4b..22ac05960 100644
--- a/libc/sysdeps/linux/avr32/bits/syscalls.h
+++ b/libc/sysdeps/linux/avr32/bits/syscalls.h
@@ -18,126 +18,126 @@
#define SYS_ify(syscall_name) (__NR_##syscall_name)
#undef _syscall0
-#define _syscall0(type,name) \
- type name(void) \
- { \
- return (type)(INLINE_SYSCALL(name, 0)); \
- }
+#define _syscall0(type,name) \
+ type name(void) \
+ { \
+ return (type)(INLINE_SYSCALL(name, 0)); \
+ }
#undef _syscall1
-#define _syscall1(type,name,type1,arg1) \
- type name(type1 arg1) \
- { \
- return (type)(INLINE_SYSCALL(name, 1, arg1)); \
- }
+#define _syscall1(type,name,type1,arg1) \
+ type name(type1 arg1) \
+ { \
+ return (type)(INLINE_SYSCALL(name, 1, arg1)); \
+ }
#undef _syscall2
-#define _syscall2(type,name,type1,arg1,type2,arg2) \
- type name(type1 arg1, type2 arg2) \
- { \
- return (type)(INLINE_SYSCALL(name, 2, arg1, arg2)); \
- }
+#define _syscall2(type,name,type1,arg1,type2,arg2) \
+ type name(type1 arg1, type2 arg2) \
+ { \
+ return (type)(INLINE_SYSCALL(name, 2, arg1, arg2)); \
+ }
#undef _syscall3
-#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
- type name(type1 arg1, type2 arg2, type3 arg3) \
- { \
- return (type)(INLINE_SYSCALL(name, 3, arg1, \
- arg2, arg3)); \
- }
+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
+ type name(type1 arg1, type2 arg2, type3 arg3) \
+ { \
+ return (type)(INLINE_SYSCALL(name, 3, arg1, \
+ arg2, arg3)); \
+ }
#undef _syscall4
-#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3, \
- type4,arg4) \
- type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
- { \
- return (type)(INLINE_SYSCALL(name, 4, arg1, arg2, \
- arg3, arg4)); \
- }
+#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3, \
+ type4,arg4) \
+ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+ { \
+ return (type)(INLINE_SYSCALL(name, 4, arg1, arg2, \
+ arg3, arg4)); \
+ }
#undef _syscall5
-#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3, \
- type4,arg4,type5,arg5) \
- type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5) \
- { \
- return (type)(INLINE_SYSCALL(name, 5, arg1, arg2, \
- arg3, arg4, arg5)); \
- }
+#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3, \
+ type4,arg4,type5,arg5) \
+ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
+ type5 arg5) \
+ { \
+ return (type)(INLINE_SYSCALL(name, 5, arg1, arg2, \
+ arg3, arg4, arg5)); \
+ }
#undef _syscall6
-#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3, \
- type4,arg4,type5,arg5,type6,arg6) \
- type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5, type6 arg6) \
- { \
- return (type)(INLINE_SYSCALL(name, 6, arg1, arg2, arg3, \
- arg4, arg5, arg6)); \
- }
+#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3, \
+ type4,arg4,type5,arg5,type6,arg6) \
+ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
+ type5 arg5, type6 arg6) \
+ { \
+ return (type)(INLINE_SYSCALL(name, 6, arg1, arg2, arg3, \
+ arg4, arg5, arg6)); \
+ }
#undef unlikely
#define unlikely(x) __builtin_expect((x), 0)
#undef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...) \
- ({ \
- unsigned _sys_result = INTERNAL_SYSCALL(name, , nr, args); \
- if (unlikely(INTERNAL_SYSCALL_ERROR_P(_sys_result, ))) { \
- __set_errno(INTERNAL_SYSCALL_ERRNO(_sys_result, )); \
- _sys_result = (unsigned int) -1; \
- } \
- (int) _sys_result; \
- })
+#define INLINE_SYSCALL(name, nr, args...) \
+ ({ \
+ unsigned _sys_result = INTERNAL_SYSCALL(name, , nr, args); \
+ if (unlikely(INTERNAL_SYSCALL_ERROR_P(_sys_result, ))) { \
+ __set_errno(INTERNAL_SYSCALL_ERRNO(_sys_result, )); \
+ _sys_result = (unsigned int) -1; \
+ } \
+ (int) _sys_result; \
+ })
#undef INTERNAL_SYSCALL_DECL
#define INTERNAL_SYSCALL_DECL(err) do { } while(0)
#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err, nr, args...) \
- ({ \
- register int _a1 asm ("r12"); \
- register int _scno asm("r8") = SYS_ify(name); \
- LOAD_ARGS_##nr (args); \
- asm volatile ("scall /* syscall " #name " */" \
- : "=r" (_a1) \
- : "r"(_scno) ASM_ARGS_##nr \
- : "cc", "memory"); \
- _a1; \
- })
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ \
+ register int _a1 asm ("r12"); \
+ register int _scno asm("r8") = SYS_ify(name); \
+ LOAD_ARGS_##nr (args); \
+ asm volatile ("scall /* syscall " #name " */" \
+ : "=r" (_a1) \
+ : "r"(_scno) ASM_ARGS_##nr \
+ : "cc", "memory"); \
+ _a1; \
+ })
#undef INTERNAL_SYSCALL_ERROR_P
-#define INTERNAL_SYSCALL_ERROR_P(val, err) \
- ((unsigned int)(val) >= 0xfffff001U)
+#define INTERNAL_SYSCALL_ERROR_P(val, err) \
+ ((unsigned int)(val) >= 0xfffff001U)
#undef INTERNAL_SYSCALL_ERRNO
#define INTERNAL_SYSCALL_ERRNO(val, errr) (-(val))
#define LOAD_ARGS_0() do { } while(0)
#define ASM_ARGS_0
-#define LOAD_ARGS_1(a1) \
- _a1 = (int) (a1); \
- LOAD_ARGS_0()
-#define ASM_ARGS_1 ASM_ARGS_0, "r"(_a1)
-#define LOAD_ARGS_2(a1, a2) \
- register int _a2 asm("r11") = (int)(a2); \
- LOAD_ARGS_1(a1)
-#define ASM_ARGS_2 ASM_ARGS_1, "r"(_a2)
-#define LOAD_ARGS_3(a1, a2, a3) \
- register int _a3 asm("r10") = (int)(a3); \
- LOAD_ARGS_2(a1, a2)
-#define ASM_ARGS_3 ASM_ARGS_2, "r"(_a3)
-#define LOAD_ARGS_4(a1, a2, a3, a4) \
- register int _a4 asm("r9") = (int)(a4); \
- LOAD_ARGS_3(a1, a2, a3)
-#define ASM_ARGS_4 ASM_ARGS_3, "r"(_a4)
-#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
- register int _a5 asm("r5") = (int)(a5); \
- LOAD_ARGS_4(a1, a2, a3, a4)
-#define ASM_ARGS_5 ASM_ARGS_4, "r"(_a5)
-#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
- register int _a6 asm("r3") = (int)(a6); \
- LOAD_ARGS_5(a1, a2, a3, a4, a5)
-#define ASM_ARGS_6 ASM_ARGS_5, "r"(_a6)
+#define LOAD_ARGS_1(a1) \
+ _a1 = (int) (a1); \
+ LOAD_ARGS_0()
+#define ASM_ARGS_1 ASM_ARGS_0, "r"(_a1)
+#define LOAD_ARGS_2(a1, a2) \
+ register int _a2 asm("r11") = (int)(a2); \
+ LOAD_ARGS_1(a1)
+#define ASM_ARGS_2 ASM_ARGS_1, "r"(_a2)
+#define LOAD_ARGS_3(a1, a2, a3) \
+ register int _a3 asm("r10") = (int)(a3); \
+ LOAD_ARGS_2(a1, a2)
+#define ASM_ARGS_3 ASM_ARGS_2, "r"(_a3)
+#define LOAD_ARGS_4(a1, a2, a3, a4) \
+ register int _a4 asm("r9") = (int)(a4); \
+ LOAD_ARGS_3(a1, a2, a3)
+#define ASM_ARGS_4 ASM_ARGS_3, "r"(_a4)
+#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
+ register int _a5 asm("r5") = (int)(a5); \
+ LOAD_ARGS_4(a1, a2, a3, a4)
+#define ASM_ARGS_5 ASM_ARGS_4, "r"(_a5)
+#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
+ register int _a6 asm("r3") = (int)(a6); \
+ LOAD_ARGS_5(a1, a2, a3, a4, a5)
+#define ASM_ARGS_6 ASM_ARGS_5, "r"(_a6)
#endif /* __ASSEMBLER__ */
#endif /* _BITS_SYSCALLS_H */
diff --git a/libc/sysdeps/linux/avr32/bits/wordsize.h b/libc/sysdeps/linux/avr32/bits/wordsize.h
index 0880d37e9..1b5842adb 100644
--- a/libc/sysdeps/linux/avr32/bits/wordsize.h
+++ b/libc/sysdeps/linux/avr32/bits/wordsize.h
@@ -1 +1 @@
-#define __WORDSIZE 32
+#define __WORDSIZE 32
diff --git a/libc/sysdeps/linux/avr32/brk.c b/libc/sysdeps/linux/avr32/brk.c
index d824c7cd0..a54b49a61 100644
--- a/libc/sysdeps/linux/avr32/brk.c
+++ b/libc/sysdeps/linux/avr32/brk.c
@@ -15,17 +15,17 @@ void *__curbrk attribute_hidden = 0;
int brk (void *addr)
{
- void *newbrk;
+ void *newbrk;
- newbrk = (void *)INLINE_SYSCALL(brk, 1, addr);
+ newbrk = (void *)INLINE_SYSCALL(brk, 1, addr);
- __curbrk = newbrk;
+ __curbrk = newbrk;
- if (newbrk < addr) {
- __set_errno (ENOMEM);
- return -1;
- }
+ if (newbrk < addr) {
+ __set_errno (ENOMEM);
+ return -1;
+ }
- return 0;
+ return 0;
}
libc_hidden_def(brk)
diff --git a/libc/sysdeps/linux/avr32/bsd-_setjmp.S b/libc/sysdeps/linux/avr32/bsd-_setjmp.S
index 867edd9c2..f23e73b86 100644
--- a/libc/sysdeps/linux/avr32/bsd-_setjmp.S
+++ b/libc/sysdeps/linux/avr32/bsd-_setjmp.S
@@ -6,11 +6,11 @@
* archive for more details.
*/
- /* This just does a tail-call to __sigsetjmp(env, 0) */
- .global _setjmp
- .type _setjmp,"function"
- .align 1
+ /* This just does a tail-call to __sigsetjmp(env, 0) */
+ .global _setjmp
+ .type _setjmp,"function"
+ .align 1
_setjmp:
- mov r11, 0
- bral HIDDEN_JUMPTARGET(__sigsetjmp)
- .size _setjmp, . - _setjmp
+ mov r11, 0
+ bral HIDDEN_JUMPTARGET(__sigsetjmp)
+ .size _setjmp, . - _setjmp
diff --git a/libc/sysdeps/linux/avr32/bsd-setjmp.S b/libc/sysdeps/linux/avr32/bsd-setjmp.S
index b9f483bda..5247ec368 100644
--- a/libc/sysdeps/linux/avr32/bsd-setjmp.S
+++ b/libc/sysdeps/linux/avr32/bsd-setjmp.S
@@ -6,11 +6,11 @@
* archive for more details.
*/
- /* This just does a tail-call to __sigsetjmp(env, 1) */
- .global setjmp
- .type setjmp,"function"
- .align 1
+ /* This just does a tail-call to __sigsetjmp(env, 1) */
+ .global setjmp
+ .type setjmp,"function"
+ .align 1
setjmp:
- mov r11, 1
- bral HIDDEN_JUMPTARGET(__sigsetjmp)
- .size setjmp, . - setjmp
+ mov r11, 1
+ bral HIDDEN_JUMPTARGET(__sigsetjmp)
+ .size setjmp, . - setjmp
diff --git a/libc/sysdeps/linux/avr32/clone.c b/libc/sysdeps/linux/avr32/clone.c
index c5f5a74a8..e43b0f3bf 100644
--- a/libc/sysdeps/linux/avr32/clone.c
+++ b/libc/sysdeps/linux/avr32/clone.c
@@ -16,26 +16,26 @@
*/
int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg)
{
- register int (*_fn)(void *arg) = fn;
- register void *_arg = arg;
- int err;
+ register int (*_fn)(void *arg) = fn;
+ register void *_arg = arg;
+ int err;
- /* Sanity check the arguments */
- err = -EINVAL;
- if (!fn)
- goto syscall_error;
- if (!child_stack)
- goto syscall_error;
+ /* Sanity check the arguments */
+ err = -EINVAL;
+ if (!fn)
+ goto syscall_error;
+ if (!child_stack)
+ goto syscall_error;
- err = INLINE_SYSCALL(clone, 2, flags, child_stack);
- if (err < 0)
- goto syscall_error;
- else if (err != 0)
- return err;
+ err = INLINE_SYSCALL(clone, 2, flags, child_stack);
+ if (err < 0)
+ goto syscall_error;
+ else if (err != 0)
+ return err;
- _exit(_fn(_arg));
+ _exit(_fn(_arg));
syscall_error:
- __set_errno (-err);
- return -1;
+ __set_errno (-err);
+ return -1;
}
diff --git a/libc/sysdeps/linux/avr32/crt1.S b/libc/sysdeps/linux/avr32/crt1.S
index 0f0a2e87d..ca1fa7a4c 100644
--- a/libc/sysdeps/linux/avr32/crt1.S
+++ b/libc/sysdeps/linux/avr32/crt1.S
@@ -6,12 +6,12 @@
* archive for more details.
*
* When we enter _start, the stack looks like this:
- * argc argument counter
- * argv[0] pointer to program name
- * argv[1..argc-1] pointers to program args
- * NULL
- * env[0..N] pointers to environment variables
- * NULL
+ * argc argument counter
+ * argv[0] pointer to program name
+ * argv[1..argc-1] pointers to program args
+ * NULL
+ * env[0..N] pointers to environment variables
+ * NULL
*
* r12 contains a function pointer to be registered with `atexit'.
* This is how the dynamic linker arranges to have DT_FINI functions
@@ -20,78 +20,78 @@
*
* We're going to call the following function:
* __uClibc_main(int (*main)(int, char **, char **), int argc,
- * char **argv, void (*app_init)(void), void (*app_fini)(void),
- * void (*rtld_fini)(void), void *stack_end)
+ * char **argv, void (*app_init)(void), void (*app_fini)(void),
+ * void (*rtld_fini)(void), void *stack_end)
*
* So we need to set up things as follows:
- * r12 = address of main
- * r11 = argc
- * r10 = &argv[0]
- * r9 = address of _init
- * r8 = address of _fini
- * sp[0] = whatever we got passed in r12
+ * r12 = address of main
+ * r11 = argc
+ * r10 = &argv[0]
+ * r9 = address of _init
+ * r8 = address of _fini
+ * sp[0] = whatever we got passed in r12
*/
#include <features.h>
- .text
- .global _start
- .type _start, @function
+ .text
+ .global _start
+ .type _start, @function
_start:
- /* Clear the frame pointer and link register since this is the outermost frame. */
- mov r7, 0
- mov lr, 0
+ /* Clear the frame pointer and link register since this is the outermost frame. */
+ mov r7, 0
+ mov lr, 0
- ld.w r11, sp++ /* argc */
- mov r10, sp /* &argv[0] */
+ ld.w r11, sp++ /* argc */
+ mov r10, sp /* &argv[0] */
- st.w --sp, r10 /* stack_end */
- st.w --sp, r12 /* rtld_fini */
+ st.w --sp, r10 /* stack_end */
+ st.w --sp, r12 /* rtld_fini */
#ifdef __PIC__
- lddpc r6, .L_GOT
+ lddpc r6, .L_GOT
.L_RGOT:
- rsub r6, pc
- lda.w r9, _init
- lda.w r8, _fini
- lda.w r12, main
+ rsub r6, pc
+ lda.w r9, _init
+ lda.w r8, _fini
+ lda.w r12, main
- /* Ok, now run uClibc's main() -- should not return */
- call __uClibc_main
+ /* Ok, now run uClibc's main() -- should not return */
+ call __uClibc_main
- .align 2
+ .align 2
.L_GOT:
- .long .L_RGOT - _GLOBAL_OFFSET_TABLE_
+ .long .L_RGOT - _GLOBAL_OFFSET_TABLE_
#else
- lddpc r9, __init_addr /* app_init */
- lddpc r8, __fini_addr /* app_fini */
- lddpc r12, __main_addr /* main */
+ lddpc r9, __init_addr /* app_init */
+ lddpc r8, __fini_addr /* app_fini */
+ lddpc r12, __main_addr /* main */
- /* Ok, now run uClibc's main() -- should not return */
- lddpc pc, ___uClibc_main_addr
+ /* Ok, now run uClibc's main() -- should not return */
+ lddpc pc, ___uClibc_main_addr
- .align 2
+ .align 2
__init_addr:
- .long _init
+ .long _init
__fini_addr:
- .long _fini
+ .long _fini
__main_addr:
- .long main
+ .long main
___uClibc_main_addr:
- .long __uClibc_main
+ .long __uClibc_main
#endif
- .size _start, . - _start
+ .size _start, . - _start
- /*
- * The LSB says we need this.
- */
- .section ".note.ABI-tag", "a"
- .align 4
- .long 2f - 1f /* namesz */
- .long 4f - 3f /* descsz */
- .long 1 /* type */
-1: .asciz "GNU" /* name */
-2: .align 4
-3: .long 0 /* Linux executable */
- .long 2,6,0 /* Earliest compatible kernel */
-4: .align 4
+ /*
+ * The LSB says we need this.
+ */
+ .section ".note.ABI-tag", "a"
+ .align 4
+ .long 2f - 1f /* namesz */
+ .long 4f - 3f /* descsz */
+ .long 1 /* type */
+1: .asciz "GNU" /* name */
+2: .align 4
+3: .long 0 /* Linux executable */
+ .long 2,6,0 /* Earliest compatible kernel */
+4: .align 4
diff --git a/libc/sysdeps/linux/avr32/crti.S b/libc/sysdeps/linux/avr32/crti.S
index 69b387cb8..660f47c49 100644
--- a/libc/sysdeps/linux/avr32/crti.S
+++ b/libc/sysdeps/linux/avr32/crti.S
@@ -1,26 +1,26 @@
- .section .init
- .align 2
- .global _init
- .type _init, @function
+ .section .init
+ .align 2
+ .global _init
+ .type _init, @function
_init:
- stm --sp, r6, lr
- lddpc r6, 2f
-1: rsub r6, pc
- rjmp 3f
- .align 2
-2: .long 1b - _GLOBAL_OFFSET_TABLE_
+ stm --sp, r6, lr
+ lddpc r6, 2f
+1: rsub r6, pc
+ rjmp 3f
+ .align 2
+2: .long 1b - _GLOBAL_OFFSET_TABLE_
3:
- .section .fini
- .align 2
- .global _fini
- .type _fini, @function
+ .section .fini
+ .align 2
+ .global _fini
+ .type _fini, @function
_fini:
- stm --sp, r6, lr
- lddpc r6, 2f
-1: rsub r6, pc
- rjmp 3f
- .align 2
-2: .long 1b - _GLOBAL_OFFSET_TABLE_
+ stm --sp, r6, lr
+ lddpc r6, 2f
+1: rsub r6, pc
+ rjmp 3f
+ .align 2
+2: .long 1b - _GLOBAL_OFFSET_TABLE_
3:
diff --git a/libc/sysdeps/linux/avr32/crtn.S b/libc/sysdeps/linux/avr32/crtn.S
index 02e1a8367..f7d104070 100644
--- a/libc/sysdeps/linux/avr32/crtn.S
+++ b/libc/sysdeps/linux/avr32/crtn.S
@@ -1,14 +1,14 @@
- .section .init
- .align 2
- .global _init
- .type _init, @function
- ldm sp++, r6, pc
- .size _init, . - _init
+ .section .init
+ .align 2
+ .global _init
+ .type _init, @function
+ ldm sp++, r6, pc
+ .size _init, . - _init
- .section .fini
- .align 2
- .global _fini
- .type _fini, @function
- ldm sp++, r6, pc
- .size _fini, . - _fini
+ .section .fini
+ .align 2
+ .global _fini
+ .type _fini, @function
+ ldm sp++, r6, pc
+ .size _fini, . - _fini
diff --git a/libc/sysdeps/linux/avr32/mmap.c b/libc/sysdeps/linux/avr32/mmap.c
index 80310a45f..2ee025a26 100644
--- a/libc/sysdeps/linux/avr32/mmap.c
+++ b/libc/sysdeps/linux/avr32/mmap.c
@@ -14,20 +14,20 @@
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)
{
- unsigned long page_size = sysconf(_SC_PAGESIZE);
- unsigned long pgoff;
+ unsigned long page_size = sysconf(_SC_PAGESIZE);
+ unsigned long pgoff;
- if (offset & (page_size - 1)) {
- __set_errno(EINVAL);
- return MAP_FAILED;
- }
+ if (offset & (page_size - 1)) {
+ __set_errno(EINVAL);
+ return MAP_FAILED;
+ }
- pgoff = (unsigned long)offset >> (31 - __builtin_clz(page_size));
+ pgoff = (unsigned long)offset >> (31 - __builtin_clz(page_size));
- return mmap2(addr, len, prot, flags, fd, pgoff);
+ return mmap2(addr, len, prot, flags, fd, pgoff);
}
libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/avr32/setjmp.S b/libc/sysdeps/linux/avr32/setjmp.S
index 77f80d277..7d0354be9 100644
--- a/libc/sysdeps/linux/avr32/setjmp.S
+++ b/libc/sysdeps/linux/avr32/setjmp.S
@@ -9,21 +9,21 @@
#define _ASM
#include <bits/setjmp.h>
- .text
+ .text
- .global __sigsetjmp
- .type __sigsetjmp,"function"
+ .global __sigsetjmp
+ .type __sigsetjmp,"function"
- .align 1
+ .align 1
__sigsetjmp:
- mustr r8
- stm r12, r0,r1,r2,r3,r4,r5,r6,r7,r8,sp,lr
+ mustr r8
+ stm r12, r0,r1,r2,r3,r4,r5,r6,r7,r8,sp,lr
- /*
- * Make a tail call to __sigjmp_save; it takes the same args
- * and is hidden so we don't need to mess around with the GOT.
- */
- rjmp __sigjmp_save
- .size __sigsetjmp, . - __sigsetjmp
+ /*
+ * Make a tail call to __sigjmp_save; it takes the same args
+ * and is hidden so we don't need to mess around with the GOT.
+ */
+ rjmp __sigjmp_save
+ .size __sigsetjmp, . - __sigsetjmp
libc_hidden_def(__sigsetjmp)
diff --git a/libc/sysdeps/linux/avr32/sigaction.c b/libc/sysdeps/linux/avr32/sigaction.c
index 03cc9a049..6b6b3466c 100644
--- a/libc/sysdeps/linux/avr32/sigaction.c
+++ b/libc/sysdeps/linux/avr32/sigaction.c
@@ -11,45 +11,45 @@
#include <sys/syscall.h>
#include <bits/kernel_sigaction.h>
-#define SA_RESTORER 0x04000000
+#define SA_RESTORER 0x04000000
extern void __default_rt_sa_restorer(void);
-libc_hidden_proto(memcpy)
+/* Experimentally off - libc_hidden_proto(memcpy) */
/*
* 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.
*/
int __libc_sigaction(int signum, const struct sigaction *act,
- struct sigaction *oldact)
+ struct sigaction *oldact)
{
- struct kernel_sigaction kact, koact;
- int result;
-
- if (act) {
- kact.k_sa_handler = act->sa_handler;
- memcpy(&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask));
- kact.sa_flags = act->sa_flags;
- if (kact.sa_flags & SA_RESTORER)
- kact.sa_restorer = act->sa_restorer;
- else
- kact.sa_restorer = __default_rt_sa_restorer;
- kact.sa_flags |= SA_RESTORER;
- }
-
- result = __syscall_rt_sigaction(signum, act ? __ptrvalue(&kact) : NULL,
- oldact ? __ptrvalue(&koact) : NULL,
- _NSIG / 8);
-
- if (oldact && result >= 0) {
- oldact->sa_handler = koact.k_sa_handler;
- memcpy(&oldact->sa_mask, &koact.sa_mask,
- sizeof(oldact->sa_mask));
- oldact->sa_flags = koact.sa_flags;
- oldact->sa_restorer = koact.sa_restorer;
- }
-
- return result;
+ struct kernel_sigaction kact, koact;
+ int result;
+
+ if (act) {
+ kact.k_sa_handler = act->sa_handler;
+ memcpy(&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask));
+ kact.sa_flags = act->sa_flags;
+ if (kact.sa_flags & SA_RESTORER)
+ kact.sa_restorer = act->sa_restorer;
+ else
+ kact.sa_restorer = __default_rt_sa_restorer;
+ kact.sa_flags |= SA_RESTORER;
+ }
+
+ result = __syscall_rt_sigaction(signum, act ? __ptrvalue(&kact) : NULL,
+ oldact ? __ptrvalue(&koact) : NULL,
+ _NSIG / 8);
+
+ if (oldact && result >= 0) {
+ oldact->sa_handler = koact.k_sa_handler;
+ memcpy(&oldact->sa_mask, &koact.sa_mask,
+ sizeof(oldact->sa_mask));
+ oldact->sa_flags = koact.sa_flags;
+ oldact->sa_restorer = koact.sa_restorer;
+ }
+
+ return result;
}
#ifndef LIBC_SIGACTION
diff --git a/libc/sysdeps/linux/avr32/sigrestorer.S b/libc/sysdeps/linux/avr32/sigrestorer.S
index 03f8bb568..df6a1ba3a 100644
--- a/libc/sysdeps/linux/avr32/sigrestorer.S
+++ b/libc/sysdeps/linux/avr32/sigrestorer.S
@@ -7,9 +7,9 @@
*/
#include <sys/syscall.h>
- .global __default_rt_sa_restorer
- .type __default_rt_sa_restorer,"function"
- .align 1
+ .global __default_rt_sa_restorer
+ .type __default_rt_sa_restorer,"function"
+ .align 1
__default_rt_sa_restorer:
- mov r8, __NR_rt_sigreturn
- scall
+ mov r8, __NR_rt_sigreturn
+ scall
diff --git a/libc/sysdeps/linux/avr32/sys/elf.h b/libc/sysdeps/linux/avr32/sys/elf.h
index 3dbefae15..faa731068 100644
--- a/libc/sysdeps/linux/avr32/sys/elf.h
+++ b/libc/sysdeps/linux/avr32/sys/elf.h
@@ -17,10 +17,10 @@
02111-1307 USA. */
#ifndef _SYS_ELF_H
-#define _SYS_ELF_H 1
+#define _SYS_ELF_H 1
#warning "This header is obsolete; use <sys/procfs.h> instead."
#include <sys/procfs.h>
-#endif /* sys/elf.h */
+#endif /* sys/elf.h */
diff --git a/libc/sysdeps/linux/avr32/sys/procfs.h b/libc/sysdeps/linux/avr32/sys/procfs.h
index af6dcb0ab..3b3736324 100644
--- a/libc/sysdeps/linux/avr32/sys/procfs.h
+++ b/libc/sysdeps/linux/avr32/sys/procfs.h
@@ -17,7 +17,7 @@
02111-1307 USA. */
#ifndef _SYS_PROCFS_H
-#define _SYS_PROCFS_H 1
+#define _SYS_PROCFS_H 1
/* This is somewhat modelled after the file of the same name on SVR4
systems. It provides a definition of the core file format for ELF
@@ -51,9 +51,9 @@ typedef struct user_fpregs elf_fpregset_t;
/* Signal info. */
struct elf_siginfo
{
- int si_signo; /* Signal number. */
- int si_code; /* Extra code. */
- int si_errno; /* Errno. */
+ int si_signo; /* Signal number. */
+ int si_code; /* Extra code. */
+ int si_errno; /* Errno. */
};
/* Definitions to generate Intel SVR4-like core files. These mostly
@@ -65,20 +65,20 @@ struct elf_siginfo
struct elf_prstatus
{
- struct elf_siginfo pr_info; /* Info associated with signal. */
- short int pr_cursig; /* Current signal. */
- unsigned long int pr_sigpend; /* Set of pending signals. */
- unsigned long int pr_sighold; /* Set of held signals. */
+ struct elf_siginfo pr_info; /* Info associated with signal. */
+ short int pr_cursig; /* Current signal. */
+ unsigned long int pr_sigpend; /* Set of pending signals. */
+ unsigned long int pr_sighold; /* Set of held signals. */
__pid_t pr_pid;
__pid_t pr_ppid;
__pid_t pr_pgrp;
__pid_t pr_sid;
- struct timeval pr_utime; /* User time. */
- struct timeval pr_stime; /* System time. */
- struct timeval pr_cutime; /* Cumulative user time. */
- struct timeval pr_cstime; /* Cumulative system time. */
- elf_gregset_t pr_reg; /* GP registers. */
- int pr_fpvalid; /* True if math copro being used. */
+ struct timeval pr_utime; /* User time. */
+ struct timeval pr_stime; /* System time. */
+ struct timeval pr_cutime; /* Cumulative user time. */
+ struct timeval pr_cstime; /* Cumulative system time. */
+ elf_gregset_t pr_reg; /* GP registers. */
+ int pr_fpvalid; /* True if math copro being used. */
};
@@ -86,17 +86,17 @@ struct elf_prstatus
struct elf_prpsinfo
{
- char pr_state; /* Numeric process state. */
- char pr_sname; /* Char for pr_state. */
- char pr_zomb; /* Zombie. */
- char pr_nice; /* Nice val. */
- unsigned long int pr_flag; /* Flags. */
+ char pr_state; /* Numeric process state. */
+ char pr_sname; /* Char for pr_state. */
+ char pr_zomb; /* Zombie. */
+ char pr_nice; /* Nice val. */
+ unsigned long int pr_flag; /* Flags. */
unsigned short int pr_uid;
unsigned short int pr_gid;
int pr_pid, pr_ppid, pr_pgrp, pr_sid;
/* Lots missing */
- char pr_fname[16]; /* Filename of executable. */
- char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
+ char pr_fname[16]; /* Filename of executable. */
+ char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
};
/* The rest of this file provides the types for emulation of the
@@ -120,4 +120,4 @@ typedef struct elf_prpsinfo prpsinfo_t;
__END_DECLS
-#endif /* sys/procfs.h */
+#endif /* sys/procfs.h */
diff --git a/libc/sysdeps/linux/avr32/sys/ucontext.h b/libc/sysdeps/linux/avr32/sys/ucontext.h
index ba8940cb2..82c7fe24a 100644
--- a/libc/sysdeps/linux/avr32/sys/ucontext.h
+++ b/libc/sysdeps/linux/avr32/sys/ucontext.h
@@ -19,7 +19,7 @@
/* Linux/AVR32 ABI compliant context switching support. */
#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#define _SYS_UCONTEXT_H 1
#include <features.h>
#include <signal.h>
@@ -29,7 +29,7 @@
typedef int greg_t;
/* Number of general registers. */
-#define NGREG 16
+#define NGREG 16
/* Container for all general registers. */
typedef elf_gregset_t gregset_t;
@@ -38,41 +38,41 @@ typedef elf_gregset_t gregset_t;
enum
{
R0 = 0,
-#define R0 R0
+#define R0 R0
R1 = 1,
-#define R1 R1
+#define R1 R1
R2 = 2,
-#define R2 R2
+#define R2 R2
R3 = 3,
-#define R3 R3
+#define R3 R3
R4 = 4,
-#define R4 R4
+#define R4 R4
R5 = 5,
-#define R5 R5
+#define R5 R5
R6 = 6,
-#define R6 R6
+#define R6 R6
R7 = 7,
-#define R7 R7
+#define R7 R7
R8 = 8,
-#define R8 R8
+#define R8 R8
R9 = 9,
-#define R9 R9
+#define R9 R9
R10 = 10,
-#define R10 R10
+#define R10 R10
R11 = 11,
-#define R11 R11
+#define R11 R11
R12 = 12,
-#define R12 R12
+#define R12 R12
R13 = 13,
-#define R13 R13
+#define R13 R13
R14 = 14,
-#define R14 R14
+#define R14 R14
R15 = 15
-#define R15 R15
+#define R15 R15
};
/* Structure to describe FPU registers. */
-typedef elf_fpregset_t fpregset_t;
+typedef elf_fpregset_t fpregset_t;
/* Context to describe whole processor state. */
typedef struct sigcontext mcontext_t;
@@ -80,11 +80,11 @@ typedef struct sigcontext mcontext_t;
/* Userlevel context. */
typedef struct ucontext
{
- unsigned long uc_flags;
- struct ucontext *uc_link;
- stack_t uc_stack;
- mcontext_t uc_mcontext;
- sigset_t uc_sigmask; /* mask last for extensibility */
+ unsigned long uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ sigset_t uc_sigmask; /* mask last for extensibility */
} ucontext_t;
#endif /* sys/ucontext.h */
diff --git a/libc/sysdeps/linux/avr32/sys/user.h b/libc/sysdeps/linux/avr32/sys/user.h
index 4fa58480b..c0b3d384c 100644
--- a/libc/sysdeps/linux/avr32/sys/user.h
+++ b/libc/sysdeps/linux/avr32/sys/user.h
@@ -8,39 +8,39 @@ struct user_fpregs
struct user_regs
{
- unsigned long sr;
- unsigned long pc;
- unsigned long lr;
- unsigned long sp;
- unsigned long r12;
- unsigned long r11;
- unsigned long r10;
- unsigned long r9;
- unsigned long r8;
- unsigned long r7;
- unsigned long r6;
- unsigned long r5;
- unsigned long r4;
- unsigned long r3;
- unsigned long r2;
- unsigned long r1;
- unsigned long r0;
- unsigned long r12_orig;
+ unsigned long sr;
+ unsigned long pc;
+ unsigned long lr;
+ unsigned long sp;
+ unsigned long r12;
+ unsigned long r11;
+ unsigned long r10;
+ unsigned long r9;
+ unsigned long r8;
+ unsigned long r7;
+ unsigned long r6;
+ unsigned long r5;
+ unsigned long r4;
+ unsigned long r3;
+ unsigned long r2;
+ unsigned long r1;
+ unsigned long r0;
+ unsigned long r12_orig;
};
struct user
{
- struct user_regs regs; /* general registers */
- size_t u_tsize; /* text size (pages) */
- size_t u_dsize; /* data size (pages) */
- size_t u_ssize; /* stack size (pages) */
- unsigned long start_code; /* text starting address */
- unsigned long start_data; /* data starting address */
- unsigned long start_stack; /* stack starting address */
- long int signal; /* signal causing core dump */
- struct user_regs * u_ar0; /* help gdb find registers */
- unsigned long magic; /* identifies a core file */
- char u_comm[32]; /* user command name */
+ struct user_regs regs; /* general registers */
+ size_t u_tsize; /* text size (pages) */
+ size_t u_dsize; /* data size (pages) */
+ size_t u_ssize; /* stack size (pages) */
+ unsigned long start_code; /* text starting address */
+ unsigned long start_data; /* data starting address */
+ unsigned long start_stack; /* stack starting address */
+ long int signal; /* signal causing core dump */
+ struct user_regs * u_ar0; /* help gdb find registers */
+ unsigned long magic; /* identifies a core file */
+ char u_comm[32]; /* user command name */
};
#endif /* _SYS_USER_H */
diff --git a/libc/sysdeps/linux/avr32/syscall.S b/libc/sysdeps/linux/avr32/syscall.S
index f14fcdb30..55c1b1fa2 100644
--- a/libc/sysdeps/linux/avr32/syscall.S
+++ b/libc/sysdeps/linux/avr32/syscall.S
@@ -7,65 +7,65 @@
*/
#include <features.h>
- .text
+ .text
- /*
- * long int syscall(long int sysno, ...)
- */
- .global syscall
- .type syscall, @function
- .align 2
+ /*
+ * long int syscall(long int sysno, ...)
+ */
+ .global syscall
+ .type syscall, @function
+ .align 2
syscall:
- stm --sp, r3,r5,r6,lr
- sub lr, sp, -16
- mov r8, r12
- ldm lr, r3,r5,r9-r12
- scall
- cp.w r12, -4095
- brlo .Ldone
+ stm --sp, r3,r5,r6,lr
+ sub lr, sp, -16
+ mov r8, r12
+ ldm lr, r3,r5,r9-r12
+ scall
+ cp.w r12, -4095
+ brlo .Ldone
#ifdef __PIC__
- lddpc r6, .Lgot
+ lddpc r6, .Lgot
.Lgotcalc:
- rsub r6, pc
+ rsub r6, pc
# ifdef __UCLIBC_HAS_THREADS__
- rsub r3, r12, 0
- mcall r6[__errno_location@got]
- st.w r12[0], r3
+ rsub r3, r12, 0
+ mcall r6[__errno_location@got]
+ st.w r12[0], r3
# else
- ld.w r3, r6[errno@got]
- neg r12
- st.w r3[0], r12
+ ld.w r3, r6[errno@got]
+ neg r12
+ st.w r3[0], r12
# endif
#else
# ifdef __UCLIBC_HAS_THREADS__
- rsub r3, r12, 0
- mcall .Lerrno_location
- st.w r12[0], r3
+ rsub r3, r12, 0
+ mcall .Lerrno_location
+ st.w r12[0], r3
# else
- lddpc r3, .Lerrno
- neg r12
- st.w r3[0], r12
+ lddpc r3, .Lerrno
+ neg r12
+ st.w r3[0], r12
# endif
#endif
- mov r12, -1
+ mov r12, -1
.Ldone:
- ldm sp++, r3,r5,r6,pc
+ ldm sp++, r3,r5,r6,pc
- .align 2
+ .align 2
#ifdef __PIC__
.Lgot:
- .long .Lgotcalc - _GLOBAL_OFFSET_TABLE_
+ .long .Lgotcalc - _GLOBAL_OFFSET_TABLE_
#else
# ifdef __UCLIBC_HAS_THREADS__
.Lerrno_location:
- .long __errno_location
+ .long __errno_location
# else
.Lerrno:
- .long errno
+ .long errno
# endif
#endif
- .size syscall, . - syscall
+ .size syscall, . - syscall
diff --git a/libc/sysdeps/linux/avr32/vfork.S b/libc/sysdeps/linux/avr32/vfork.S
index d25fbecdb..03ca99f65 100644
--- a/libc/sysdeps/linux/avr32/vfork.S
+++ b/libc/sysdeps/linux/avr32/vfork.S
@@ -20,39 +20,39 @@
#include <features.h>
#include <sys/syscall.h>
- .global __vfork
- .type __vfork,@function
- .align 1
+ .global __vfork
+ .type __vfork,@function
+ .align 1
__vfork:
- mov r8, __NR_vfork
- scall
- cp.w r12, -4096
- retls r12
+ mov r8, __NR_vfork
+ scall
+ cp.w r12, -4096
+ retls r12
- /* vfork failed, so we may use the stack freely */
- pushm r4-r7,lr
+ /* vfork failed, so we may use the stack freely */
+ pushm r4-r7,lr
#ifdef __PIC__
- lddpc r6, .L_GOT
- rsub r4, r12, 0
+ lddpc r6, .L_GOT
+ rsub r4, r12, 0
.L_RGOT:
- rsub r6, pc
- mcall r6[__errno_location@got]
+ rsub r6, pc
+ mcall r6[__errno_location@got]
#else
- rsub r4, r12, 0
- mcall .L__errno_location
+ rsub r4, r12, 0
+ mcall .L__errno_location
#endif
- st.w r12[0], r4
- popm r4-r7,pc,r12=-1
+ st.w r12[0], r4
+ popm r4-r7,pc,r12=-1
- .align 2
+ .align 2
#ifdef __PIC__
.L_GOT:
- .long .L_RGOT - _GLOBAL_OFFSET_TABLE_
+ .long .L_RGOT - _GLOBAL_OFFSET_TABLE_
#else
.L__errno_location:
- .long __errno_location
+ .long __errno_location
#endif
- .size __vfork, . - __vfork
+ .size __vfork, . - __vfork
weak_alias(__vfork,vfork)
libc_hidden_weak(vfork)
diff --git a/libc/sysdeps/linux/cris/__init_brk.c b/libc/sysdeps/linux/cris/__init_brk.c
index c8c6a37e7..27b8524b2 100644
--- a/libc/sysdeps/linux/cris/__init_brk.c
+++ b/libc/sysdeps/linux/cris/__init_brk.c
@@ -15,7 +15,7 @@ __init_brk (void)
/* Notice that we don't need to save/restore the GOT
* register since that is not call clobbered by the syscall.
*/
- asm ("clear.d $r10\n\t"
+ __asm__ ("clear.d $r10\n\t"
"movu.w " STR(__NR_brk) ",$r9\n\t"
"break 13\n\t"
"move.d $r10, %0"
diff --git a/libc/sysdeps/linux/cris/bits/fcntl.h b/libc/sysdeps/linux/cris/bits/fcntl.h
index 87e943f78..944159ca6 100644
--- a/libc/sysdeps/linux/cris/bits/fcntl.h
+++ b/libc/sysdeps/linux/cris/bits/fcntl.h
@@ -97,6 +97,8 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set on new fd. */
#endif
/* For F_[GET|SET]FL. */
@@ -183,7 +185,10 @@ struct flock64
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
#ifdef __USE_GNU
+#if 0
+/* 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. */
@@ -195,6 +200,15 @@ struct flock64
write. */
#endif
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
__BEGIN_DECLS
#ifdef __USE_GNU
@@ -208,21 +222,21 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
/* 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 int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
- unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
/* Splice two files together. */
-extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
/* In-kernel implementation of tee for pipe buffers. */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
-#endif
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
#endif
-
__END_DECLS
+
diff --git a/libc/sysdeps/linux/cris/bits/syscalls.h b/libc/sysdeps/linux/cris/bits/syscalls.h
index 065f48742..d44e79ca2 100644
--- a/libc/sysdeps/linux/cris/bits/syscalls.h
+++ b/libc/sysdeps/linux/cris/bits/syscalls.h
@@ -66,11 +66,11 @@ return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \
#define INLINE_SYSCALL(name, nr, args...) \
({ \
unsigned long __sys_res; \
- register unsigned long __res asm ("r10"); \
+ register unsigned long __res __asm__ ("r10"); \
LOAD_ARGS_c_##nr (args) \
- register unsigned long __callno asm ("r9") \
+ register unsigned long __callno __asm__ ("r9") \
= SYS_ify (name); \
- asm volatile (LOAD_ARGS_asm_##nr (args) \
+ __asm__ __volatile__ (LOAD_ARGS_asm_##nr (args) \
CHECK_ARGS_asm_##nr \
"break 13" \
: "=r" (__res) \
diff --git a/libc/sysdeps/linux/cris/bits/uClibc_arch_features.h b/libc/sysdeps/linux/cris/bits/uClibc_arch_features.h
index 98548e0bd..bdd338792 100644
--- a/libc/sysdeps/linux/cris/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/cris/bits/uClibc_arch_features.h
@@ -18,9 +18,6 @@
/* does your target have a broken create_module() ? */
#define __UCLIBC_BROKEN_CREATE_MODULE__
-/* does your target prefix all symbols with an _ ? */
-#define __UCLIBC_NO_UNDERSCORES__
-
/* does your target have an asm .set ? */
#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
diff --git a/libc/sysdeps/linux/cris/brk.c b/libc/sysdeps/linux/cris/brk.c
index 938b15714..ae99e109c 100644
--- a/libc/sysdeps/linux/cris/brk.c
+++ b/libc/sysdeps/linux/cris/brk.c
@@ -20,7 +20,7 @@ int brk(void * end_data_seg)
* Notice that we don't need to save/restore the GOT
* register since that is not call clobbered by the syscall.
*/
- asm ("move.d %1,$r10\n\t"
+ __asm__ ("move.d %1,$r10\n\t"
"movu.w " STR(__NR_brk) ",$r9\n\t"
"break 13\n\t"
"move.d $r10, %0"
diff --git a/libc/sysdeps/linux/cris/sbrk.c b/libc/sysdeps/linux/cris/sbrk.c
index f3fab95bb..830d01dd6 100644
--- a/libc/sysdeps/linux/cris/sbrk.c
+++ b/libc/sysdeps/linux/cris/sbrk.c
@@ -24,7 +24,7 @@ sbrk(intptr_t increment)
* Notice that we don't need to save/restore the GOT
* register since that is not call clobbered by the syscall.
*/
- asm ("move.d %1,$r10\n\t"
+ __asm__ ("move.d %1,$r10\n\t"
"movu.w " STR(__NR_brk) ",$r9\n\t"
"break 13\n\t"
"move.d $r10, %0"
diff --git a/libc/sysdeps/linux/frv/bits/fcntl.h b/libc/sysdeps/linux/frv/bits/fcntl.h
index 69a20966d..a53830ca8 100644
--- a/libc/sysdeps/linux/frv/bits/fcntl.h
+++ b/libc/sysdeps/linux/frv/bits/fcntl.h
@@ -89,6 +89,14 @@
# define F_GETSIG 11 /* Get number of signal to be sent. */
#endif
+#ifdef __USE_GNU
+# define F_SETLEASE 1024 /* Set a lease. */
+# define F_GETLEASE 1025 /* Enquire what lease is active. */
+# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set on new fd. */
+#endif
+
/* For F_[GET|SET]FL. */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
@@ -154,3 +162,59 @@ struct flock64
# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
+
+#ifdef __USE_GNU
+#if 0
+/* 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. */
+#endif
+
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
+__BEGIN_DECLS
+
+#ifdef __USE_GNU
+
+/* 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,
+ size_t __count, unsigned int __flags);
+
+/* Splice two files together. */
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
+
+/* In-kernel implementation of tee for pipe buffers. */
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
+
+#endif
+__END_DECLS
+
diff --git a/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h b/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h
index ff0e20fad..f4adaf5ad 100644
--- a/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h
@@ -18,9 +18,6 @@
/* does your target have a broken create_module() ? */
#undef __UCLIBC_BROKEN_CREATE_MODULE__
-/* does your target prefix all symbols with an _ ? */
-#define __UCLIBC_NO_UNDERSCORES__
-
/* does your target have an asm .set ? */
#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
diff --git a/libc/sysdeps/linux/h8300/bits/fcntl.h b/libc/sysdeps/linux/h8300/bits/fcntl.h
index 4b41b4715..97aa632c9 100644
--- a/libc/sysdeps/linux/h8300/bits/fcntl.h
+++ b/libc/sysdeps/linux/h8300/bits/fcntl.h
@@ -93,6 +93,8 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set on new fd. */
#endif
/* For F_[GET|SET]FL. */
@@ -178,3 +180,59 @@ struct flock64
# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
+
+#ifdef __USE_GNU
+#if 0
+/* 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. */
+#endif
+
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
+__BEGIN_DECLS
+
+#ifdef __USE_GNU
+
+/* 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,
+ size_t __count, unsigned int __flags);
+
+/* Splice two files together. */
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
+
+/* In-kernel implementation of tee for pipe buffers. */
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
+
+#endif
+__END_DECLS
+
diff --git a/libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h b/libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h
index c424d9bb6..b0d032d30 100644
--- a/libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h
@@ -18,9 +18,6 @@
/* does your target have a broken create_module() ? */
#undef __UCLIBC_BROKEN_CREATE_MODULE__
-/* does your target prefix all symbols with an _ ? */
-#undef __UCLIBC_NO_UNDERSCORES__
-
/* does your target have an asm .set ? */
#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
diff --git a/libc/sysdeps/linux/h8300/brk.c b/libc/sysdeps/linux/h8300/brk.c
index 668e6fe70..9eab66060 100644
--- a/libc/sysdeps/linux/h8300/brk.c
+++ b/libc/sysdeps/linux/h8300/brk.c
@@ -17,7 +17,7 @@ int brk (void *addr)
{
void *newbrk;
- asm ("mov.l %2,er1\n\t"
+ __asm__ ("mov.l %2,er1\n\t"
"mov.l %1,er0\n\t"
"trapa #0\n\t"
"mov.l er0,%0"
diff --git a/libc/sysdeps/linux/h8300/ptrace.c b/libc/sysdeps/linux/h8300/ptrace.c
index 7ce1b277e..1dd7d063d 100644
--- a/libc/sysdeps/linux/h8300/ptrace.c
+++ b/libc/sysdeps/linux/h8300/ptrace.c
@@ -11,7 +11,7 @@ ptrace(int request, int pid, int addr, int data)
if (request > 0 && request < 4) data = (int)&ret;
- __asm__ volatile ("sub.l er0,er0\n\t"
+ __asm__ __volatile__ ("sub.l er0,er0\n\t"
"mov.b %1,r0l\n\t"
"mov.l %2,er1\n\t"
"mov.l %3,er2\n\t"
diff --git a/libc/sysdeps/linux/hppa/bits/fcntl.h b/libc/sysdeps/linux/hppa/bits/fcntl.h
index 28600b580..ccd1d43de 100644
--- a/libc/sysdeps/linux/hppa/bits/fcntl.h
+++ b/libc/sysdeps/linux/hppa/bits/fcntl.h
@@ -69,7 +69,7 @@
#define F_SETFL 4 /* Set file status flags. */
#ifndef __USE_FILE_OFFSET64
# define F_GETLK 5 /* Get record locking info. */
-# define F_SETLK 6 /* Set record locking info (non-blocking). */
+# define F_SETLK 6 /* Set record locking info (non-blocking). */
# define F_SETLKW 7 /* Set record locking info (blocking). */
#else
# define F_GETLK F_GETLK64 /* Get record locking info. */
@@ -94,6 +94,8 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set on new fd. */
#endif
/* for F_[GET|SET]FL */
@@ -173,7 +175,10 @@ struct flock64
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
#ifdef __USE_GNU
+#if 0
+/* 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. */
@@ -183,6 +188,7 @@ 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,24 +207,26 @@ __BEGIN_DECLS
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 int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
- unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
/* Splice two files together. */
-extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
/* In-kernel implementation of tee for pipe buffers. */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
-#endif
-
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
+
#endif
-
__END_DECLS
+
diff --git a/libc/sysdeps/linux/hppa/bits/syscalls.h b/libc/sysdeps/linux/hppa/bits/syscalls.h
index 99effb260..9035cd5aa 100644
--- a/libc/sysdeps/linux/hppa/bits/syscalls.h
+++ b/libc/sysdeps/linux/hppa/bits/syscalls.h
@@ -48,10 +48,10 @@
#define K_INLINE_SYSCALL(name, nr, args...) ({ \
long __sys_res; \
{ \
- register unsigned long __res asm("r28"); \
+ register unsigned long __res __asm__("r28"); \
K_LOAD_ARGS_##nr(args) \
/* FIXME: HACK stw/ldw r19 around syscall */ \
- asm volatile( \
+ __asm__ __volatile__( \
K_STW_ASM_PIC \
" ble 0x100(%%sr2, %%r0)\n" \
" ldi %1, %%r20\n" \
diff --git a/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h b/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h
index 5eea002c7..2c04f1b77 100644
--- a/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h
@@ -17,9 +17,6 @@
/* does your target have a broken create_module() ? */
#undef __UCLIBC_BROKEN_CREATE_MODULE__
-/* does your target prefix all symbols with an _ ? */
-#define __UCLIBC_NO_UNDERSCORES__
-
/* does your target have an asm .set ? */
#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
diff --git a/libc/sysdeps/linux/hppa/syscall.c b/libc/sysdeps/linux/hppa/syscall.c
index 87dff0f34..04e80b2b2 100644
--- a/libc/sysdeps/linux/hppa/syscall.c
+++ b/libc/sysdeps/linux/hppa/syscall.c
@@ -19,6 +19,7 @@
#include <stdarg.h>
#include <errno.h>
#include <sys/syscall.h>
+#include <unistd.h>
/* HPPA implements syscall() in 'C'; the assembler version would
typically be in syscall.S. Also note that we have INLINE_SYSCALL,
@@ -44,9 +45,9 @@ syscall (long int __sysno, ...)
va_end (args);
{
- register unsigned long int __res asm("r28");
+ register unsigned long int __res __asm__("r28");
K_LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5)
- asm volatile (K_STW_ASM_PIC
+ __asm__ __volatile__ (K_STW_ASM_PIC
" ble 0x100(%%sr2, %%r0) \n"
" copy %1, %%r20 \n"
K_LDW_ASM_PIC
diff --git a/libc/sysdeps/linux/i386/__longjmp.S b/libc/sysdeps/linux/i386/__longjmp.S
index d73a7cda2..e2809c06c 100644
--- a/libc/sysdeps/linux/i386/__longjmp.S
+++ b/libc/sysdeps/linux/i386/__longjmp.S
@@ -24,7 +24,6 @@
.global __longjmp
.type __longjmp,%function
-.align 4
__longjmp:
movl 4(%esp), %ecx /* User's jmp_buf in %ecx. */
movl 8(%esp), %eax /* Second argument is return value. */
diff --git a/libc/sysdeps/linux/i386/bits/atomic.h b/libc/sysdeps/linux/i386/bits/atomic.h
index e0c5ae79c..33279af5f 100644
--- a/libc/sysdeps/linux/i386/bits/atomic.h
+++ b/libc/sysdeps/linux/i386/bits/atomic.h
@@ -366,4 +366,4 @@ typedef uintmax_t uatomic_max_t;
__result; })
-#define atomic_delay() asm ("rep; nop")
+#define atomic_delay() __asm__ ("rep; nop")
diff --git a/libc/sysdeps/linux/i386/bits/fcntl.h b/libc/sysdeps/linux/i386/bits/fcntl.h
index 10286a88d..347d79eaf 100644
--- a/libc/sysdeps/linux/i386/bits/fcntl.h
+++ b/libc/sysdeps/linux/i386/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -50,6 +50,9 @@
# define O_DIRECTORY 0200000 /* Must be a directory. */
# define O_NOFOLLOW 0400000 /* Do not follow links. */
# define O_NOATIME 01000000 /* Do not set atime. */
+# if 0
+# define O_CLOEXEC 02000000 /* Set close_on_exec. */
+# endif
#endif
/* For now Linux has synchronisity options for data and read operations.
@@ -97,9 +100,11 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set on new fd. */
#endif
-/* For F_[GET|SET]FL. */
+/* For F_[GET|SET]FD. */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
@@ -185,6 +190,8 @@ struct flock64
#ifdef __USE_GNU
+#if 0
+/* 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. */
@@ -196,6 +203,15 @@ struct flock64
write. */
#endif
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
__BEGIN_DECLS
#ifdef __USE_GNU
@@ -209,21 +225,21 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
/* 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 int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
- unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
/* Splice two files together. */
-extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
/* In-kernel implementation of tee for pipe buffers. */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
-#endif
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
#endif
-
__END_DECLS
+
diff --git a/libc/sysdeps/linux/i386/bits/kernel_types.h b/libc/sysdeps/linux/i386/bits/kernel_types.h
index efeb01b03..deb615f53 100644
--- a/libc/sysdeps/linux/i386/bits/kernel_types.h
+++ b/libc/sysdeps/linux/i386/bits/kernel_types.h
@@ -4,7 +4,11 @@
* our private content, and not the kernel header, will win.
* -Erik
*/
-#ifndef __ARCH_I386_POSIX_TYPES_H
+
+/* a hack for compiling a 32 bit user space with 64 bit
+ * kernel on x86_64 */
+#if !defined(__ARCH_I386_POSIX_TYPES_H) && !defined(_ASM_X86_64_POSIX_TYPES_H)
+#define _ASM_X86_64_POSIX_TYPES_H
#define __ARCH_I386_POSIX_TYPES_H
typedef unsigned short __kernel_dev_t;
diff --git a/libc/sysdeps/linux/i386/bits/syscalls.h b/libc/sysdeps/linux/i386/bits/syscalls.h
index d612071b4..014539c2a 100644
--- a/libc/sysdeps/linux/i386/bits/syscalls.h
+++ b/libc/sysdeps/linux/i386/bits/syscalls.h
@@ -15,6 +15,13 @@
#define SYS_ify(syscall_name) (__NR_##syscall_name)
+#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
+
+#define INTERNAL_SYSCALL_ERROR_P(val, err) \
+ ((unsigned int) (val) >= 0xfffff001u)
+
+#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val))
+
/* We need some help from the assembler to generate optimal code. We
define some macros here which later will be used. */
@@ -145,23 +152,27 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6) \
{ \
return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \
}
-
-#define INLINE_SYSCALL(name, nr, args...) \
- ({ \
- unsigned int resultvar; \
- __asm__ __volatile__ ( \
- LOADARGS_##nr \
- "movl %1, %%eax\n\t" \
- "int $0x80\n\t" \
- RESTOREARGS_##nr \
- : "=a" (resultvar) \
- : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \
- if (resultvar >= 0xfffff001) \
- { \
- __set_errno (-resultvar); \
- resultvar = 0xffffffff; \
- } \
- (int) resultvar; })
+ #define INLINE_SYSCALL(name, nr, args...) \
+ ({ \
+ unsigned int _resultvar = INTERNAL_SYSCALL (name, , nr, args); \
+ if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_resultvar, ), 0)) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (_resultvar, )); \
+ _resultvar = 0xffffffff; \
+ } \
+ (int) _resultvar; })
+
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ \
+ register unsigned int resultvar; \
+ __asm__ __volatile__ ( \
+ LOADARGS_##nr \
+ "movl %1, %%eax\n\t" \
+ "int $0x80\n\t" \
+ RESTOREARGS_##nr \
+ : "=a" (resultvar) \
+ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \
+ (int) resultvar; })
#define LOADARGS_0
#define LOADARGS_1 \
@@ -186,9 +197,9 @@ return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \
#define ASMFMT_1(arg1) \
, "acdSD" (arg1)
#define ASMFMT_2(arg1, arg2) \
- , "adCD" (arg1), "c" (arg2)
+ , "adSD" (arg1), "c" (arg2)
#define ASMFMT_3(arg1, arg2, arg3) \
- , "aCD" (arg1), "c" (arg2), "d" (arg3)
+ , "aSD" (arg1), "c" (arg2), "d" (arg3)
#define ASMFMT_4(arg1, arg2, arg3, arg4) \
, "aD" (arg1), "c" (arg2), "d" (arg3), "S" (arg4)
#define ASMFMT_5(arg1, arg2, arg3, arg4, arg5) \
diff --git a/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h b/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
index d08ac0bd7..f4730d987 100644
--- a/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
@@ -21,9 +21,6 @@
/* this is only an issue on i386 where linux < 2.3.25, so we just assume it works ... */
#undef __UCLIBC_HANDLE_OLDER_RLIMIT__
-/* does your target prefix all symbols with an _ ? */
-#define __UCLIBC_NO_UNDERSCORES__
-
/* does your target have an asm .set ? */
#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
@@ -42,6 +39,8 @@
/* define if target supports IEEE signed zero floats */
#define __UCLIBC_HAVE_SIGNED_ZERO__
+#if defined _LIBC
#define internal_function __attribute__ ((regparm (3), stdcall))
+#endif
#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/libc/sysdeps/linux/i386/bits/wordsize.h b/libc/sysdeps/linux/i386/bits/wordsize.h
index ba643b60a..7c3cd9c7d 100644
--- a/libc/sysdeps/linux/i386/bits/wordsize.h
+++ b/libc/sysdeps/linux/i386/bits/wordsize.h
@@ -17,3 +17,9 @@
02111-1307 USA. */
#define __WORDSIZE 32
+
+#ifdef UCLIBC_INTERNAL
+#ifndef smallint_type
+#define smallint_type char
+#endif
+#endif
diff --git a/libc/sysdeps/linux/i386/bsd-_setjmp.S b/libc/sysdeps/linux/i386/bsd-_setjmp.S
index ac2c8930d..f3cd6cbf6 100644
--- a/libc/sysdeps/linux/i386/bsd-_setjmp.S
+++ b/libc/sysdeps/linux/i386/bsd-_setjmp.S
@@ -27,7 +27,6 @@
.global _setjmp
.type _setjmp,%function
-.align 4
_setjmp:
xorl %eax, %eax
movl 4 (%esp), %edx
diff --git a/libc/sysdeps/linux/i386/bsd-setjmp.S b/libc/sysdeps/linux/i386/bsd-setjmp.S
index 532dfa1bd..df46997d9 100644
--- a/libc/sysdeps/linux/i386/bsd-setjmp.S
+++ b/libc/sysdeps/linux/i386/bsd-setjmp.S
@@ -23,7 +23,6 @@
.global setjmp
.type setjmp,%function
-.align 4
setjmp:
movl 4 (%esp), %eax
/* Save registers. */
diff --git a/libc/sysdeps/linux/i386/mmap64.S b/libc/sysdeps/linux/i386/mmap64.S
index 5405c8a09..a6b4aa042 100644
--- a/libc/sysdeps/linux/i386/mmap64.S
+++ b/libc/sysdeps/linux/i386/mmap64.S
@@ -40,7 +40,6 @@
.text
.global mmap64
.type mmap64,%function
-.align 1<<4
mmap64:
/* Save registers. */
diff --git a/libc/sysdeps/linux/i386/setjmp.S b/libc/sysdeps/linux/i386/setjmp.S
index 917ee283b..20a6a0bcf 100644
--- a/libc/sysdeps/linux/i386/setjmp.S
+++ b/libc/sysdeps/linux/i386/setjmp.S
@@ -24,7 +24,6 @@
.global __sigsetjmp
.type __sigsetjmp,%function
-.align 4
__sigsetjmp:
movl 4 (%esp), %eax
diff --git a/libc/sysdeps/linux/i386/sigaction.c b/libc/sysdeps/linux/i386/sigaction.c
index 341c0d16b..fbd5014e7 100644
--- a/libc/sysdeps/linux/i386/sigaction.c
+++ b/libc/sysdeps/linux/i386/sigaction.c
@@ -30,7 +30,7 @@
extern __typeof(sigaction) __libc_sigaction;
#if defined __NR_rt_sigaction
-libc_hidden_proto(memcpy)
+/* Experimentally off - libc_hidden_proto(memcpy) */
extern void restore_rt (void) __asm__ ("__restore_rt") attribute_hidden;
extern void restore (void) __asm__ ("__restore") attribute_hidden;
@@ -145,7 +145,6 @@ libc_hidden_weak(sigaction)
__asm__ \
( \
".text\n" \
- " .align 16\n" \
"__" #name ":\n" \
" movl $" #syscall ", %eax\n" \
" int $0x80" \
@@ -163,7 +162,6 @@ RESTORE (restore_rt, __NR_rt_sigreturn)
__asm__ \
( \
".text\n" \
- " .align 8\n" \
"__" #name ":\n" \
" popl %eax\n" \
" movl $" #syscall ", %eax\n" \
diff --git a/libc/sysdeps/linux/i386/sys/io.h b/libc/sysdeps/linux/i386/sys/io.h
index 39a7877f7..87b99a94a 100644
--- a/libc/sysdeps/linux/i386/sys/io.h
+++ b/libc/sysdeps/linux/i386/sys/io.h
@@ -23,6 +23,7 @@
__BEGIN_DECLS
+#if defined __UCLIBC_LINUX_SPECIFIC__
/* If TURN_ON is TRUE, request for permission to do direct i/o on the
port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O
permission off for that range. This call requires root privileges.
@@ -37,6 +38,7 @@ extern int ioperm (unsigned long int __from, unsigned long int __num,
access any I/O port is granted. This call requires root
privileges. */
extern int iopl (int __level) __THROW;
+#endif /* __UCLIBC_LINUX_SPECIFIC__ */
#if defined __GNUC__ && __GNUC__ >= 2
diff --git a/libc/sysdeps/linux/i386/syscall.S b/libc/sysdeps/linux/i386/syscall.S
index 19adf97a8..b9f65feb6 100644
--- a/libc/sysdeps/linux/i386/syscall.S
+++ b/libc/sysdeps/linux/i386/syscall.S
@@ -23,7 +23,6 @@
.text
.global syscall
.type syscall,%function
-.align 4
syscall:
pushl %ebp
pushl %edi
diff --git a/libc/sysdeps/linux/i386/vfork.S b/libc/sysdeps/linux/i386/vfork.S
index 543da6e90..8005ff1d2 100644
--- a/libc/sysdeps/linux/i386/vfork.S
+++ b/libc/sysdeps/linux/i386/vfork.S
@@ -15,7 +15,6 @@
.global __vfork
.hidden __vfork
.type __vfork,%function
-.align 1<<4
__vfork:
popl %ecx
diff --git a/libc/sysdeps/linux/ia64/__syscall_error.c b/libc/sysdeps/linux/ia64/__syscall_error.c
index bb4ba4755..0727b2b53 100644
--- a/libc/sysdeps/linux/ia64/__syscall_error.c
+++ b/libc/sysdeps/linux/ia64/__syscall_error.c
@@ -13,7 +13,7 @@
int __syscall_error(void) attribute_hidden;
int __syscall_error(void)
{
- register int err_no asm("%r8");
+ register int err_no __asm__("%r8");
__set_errno(err_no);
return -1;
}
diff --git a/libc/sysdeps/linux/ia64/bits/fcntl.h b/libc/sysdeps/linux/ia64/bits/fcntl.h
index e7e7c3039..95efa56c6 100644
--- a/libc/sysdeps/linux/ia64/bits/fcntl.h
+++ b/libc/sysdeps/linux/ia64/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/IA64.
- Copyright (C) 1999, 2000, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2004, 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
@@ -43,12 +43,15 @@
#define O_SYNC 010000
#define O_FSYNC O_SYNC
#define O_ASYNC 020000
-#define O_DIRECT 040000
#ifdef __USE_GNU
+# define O_DIRECT 040000
# define O_DIRECTORY 0200000 /* must be a directory */
# define O_NOFOLLOW 0400000 /* don't follow links */
# define O_NOATIME 01000000 /* Do not set atime. */
+# if 0
+# define O_CLOEXEC 02000000 /* Set close_on_exec. */
+# endif
#endif
#ifdef __USE_LARGEFILE64
@@ -93,9 +96,11 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set on new fd. */
#endif
-/* For F_[GET|SET]FL. */
+/* For F_[GET|SET]FD. */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
@@ -179,6 +184,8 @@ struct flock64
#ifdef __USE_GNU
+#if 0
+/* 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. */
@@ -190,6 +197,15 @@ struct flock64
write. */
#endif
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
__BEGIN_DECLS
#ifdef __USE_GNU
@@ -203,21 +219,21 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
/* 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 int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
- unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
/* Splice two files together. */
-extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
/* In-kernel implementation of tee for pipe buffers. */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
-#endif
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
#endif
-
__END_DECLS
+
diff --git a/libc/sysdeps/linux/ia64/bits/syscalls.h b/libc/sysdeps/linux/ia64/bits/syscalls.h
index b9c45a741..4e8a305ea 100644
--- a/libc/sysdeps/linux/ia64/bits/syscalls.h
+++ b/libc/sysdeps/linux/ia64/bits/syscalls.h
@@ -40,9 +40,9 @@
#define _DO_SYSCALL(name, nr, args...) \
LOAD_ARGS_##nr (args) \
- register long _r8 asm ("r8"); \
- register long _r10 asm ("r10"); \
- register long _r15 asm ("r15") = SYS_ify(name); \
+ register long _r8 __asm__ ("r8"); \
+ register long _r10 __asm__ ("r10"); \
+ register long _r15 __asm__ ("r15") = SYS_ify(name); \
long _retval; \
LOAD_REGS_##nr \
__asm __volatile ("break " ___IA64_BREAK_SYSCALL ";;\n\t" \
@@ -61,37 +61,37 @@
long _arg1 = (long) (a1); \
LOAD_ARGS_0 ()
#define LOAD_REGS_1 \
- register long _out0 asm ("out0") = _arg1; \
+ register long _out0 __asm__ ("out0") = _arg1; \
LOAD_REGS_0
#define LOAD_ARGS_2(a1, a2) \
long _arg2 = (long) (a2); \
LOAD_ARGS_1 (a1)
#define LOAD_REGS_2 \
- register long _out1 asm ("out1") = _arg2; \
+ register long _out1 __asm__ ("out1") = _arg2; \
LOAD_REGS_1
#define LOAD_ARGS_3(a1, a2, a3) \
long _arg3 = (long) (a3); \
LOAD_ARGS_2 (a1, a2)
#define LOAD_REGS_3 \
- register long _out2 asm ("out2") = _arg3; \
+ register long _out2 __asm__ ("out2") = _arg3; \
LOAD_REGS_2
#define LOAD_ARGS_4(a1, a2, a3, a4) \
long _arg4 = (long) (a4); \
LOAD_ARGS_3 (a1, a2, a3)
#define LOAD_REGS_4 \
- register long _out3 asm ("out3") = _arg4; \
+ register long _out3 __asm__ ("out3") = _arg4; \
LOAD_REGS_3
#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
long _arg5 = (long) (a5); \
LOAD_ARGS_4 (a1, a2, a3, a4)
#define LOAD_REGS_5 \
- register long _out4 asm ("out4") = _arg5; \
+ register long _out4 __asm__ ("out4") = _arg5; \
LOAD_REGS_4
#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
long _arg6 = (long) (a6); \
LOAD_ARGS_5 (a1, a2, a3, a4, a5)
#define LOAD_REGS_6 \
- register long _out5 asm ("out5") = _arg6; \
+ register long _out5 __asm__ ("out5") = _arg6; \
LOAD_REGS_5
#define ASM_OUTARGS_0
diff --git a/libc/sysdeps/linux/ia64/bits/uClibc_arch_features.h b/libc/sysdeps/linux/ia64/bits/uClibc_arch_features.h
index ebfabce90..953279e73 100644
--- a/libc/sysdeps/linux/ia64/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/ia64/bits/uClibc_arch_features.h
@@ -17,9 +17,6 @@
/* does your target have a broken create_module() ? */
#undef __UCLIBC_BROKEN_CREATE_MODULE__
-/* does your target prefix all symbols with an _ ? */
-#define __UCLIBC_NO_UNDERSCORES__
-
/* does your target have an asm .set ? */
#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
diff --git a/libc/sysdeps/linux/ia64/sysdep.h b/libc/sysdeps/linux/ia64/sysdep.h
index 03e74360d..d10020ac1 100644
--- a/libc/sysdeps/linux/ia64/sysdep.h
+++ b/libc/sysdeps/linux/ia64/sysdep.h
@@ -34,7 +34,7 @@
#define ASM_UNW_PRLG_GRSAVE(ninputs) (32+(ninputs))
#ifdef __STDC__
-#define C_LABEL(name) name##:
+#define C_LABEL(name) name :
#else
#define C_LABEL(name) name/**/:
#endif
diff --git a/libc/sysdeps/linux/nios/bits/fcntl.h b/libc/sysdeps/linux/nios/bits/fcntl.h
index 1d7df4c81..fec19f1dd 100644
--- a/libc/sysdeps/linux/nios/bits/fcntl.h
+++ b/libc/sysdeps/linux/nios/bits/fcntl.h
@@ -96,6 +96,8 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set on new fd. */
#endif
/* For F_[GET|SET]FL. */
@@ -182,7 +184,10 @@ struct flock64
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
#ifdef __USE_GNU
+#if 0
+/* 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. */
@@ -194,6 +199,15 @@ struct flock64
write. */
#endif
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
__BEGIN_DECLS
#ifdef __USE_GNU
@@ -207,21 +221,21 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
/* 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 int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
- unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
/* Splice two files together. */
-extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
/* In-kernel implementation of tee for pipe buffers. */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
-#endif
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
#endif
-
__END_DECLS
+
diff --git a/libc/sysdeps/linux/nios/bits/uClibc_arch_features.h b/libc/sysdeps/linux/nios/bits/uClibc_arch_features.h
index ff0e20fad..f4adaf5ad 100644
--- a/libc/sysdeps/linux/nios/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/nios/bits/uClibc_arch_features.h
@@ -18,9 +18,6 @@
/* does your target have a broken create_module() ? */
#undef __UCLIBC_BROKEN_CREATE_MODULE__
-/* does your target prefix all symbols with an _ ? */
-#define __UCLIBC_NO_UNDERSCORES__
-
/* does your target have an asm .set ? */
#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
diff --git a/libc/sysdeps/linux/nios/brk.c b/libc/sysdeps/linux/nios/brk.c
index 8e626a7fb..ea2e45765 100644
--- a/libc/sysdeps/linux/nios/brk.c
+++ b/libc/sysdeps/linux/nios/brk.c
@@ -28,10 +28,10 @@ libc_hidden_proto(brk)
int brk (void *addr)
{
void *newbrk;
- register int g1 asm("%g1") = __NR_brk;
- register void *o0 asm("%o0") = addr;
+ register int g1 __asm__("%g1") = __NR_brk;
+ register void *o0 __asm__("%o0") = addr;
- asm volatile ("trap 63\n\t" : "=r"(newbrk) : "0"(o0), "r"(g1));
+ __asm__ __volatile__ ("trap 63\n\t" : "=r"(newbrk) : "0"(o0), "r"(g1));
__curbrk = newbrk;
diff --git a/libc/sysdeps/linux/nios/crtend.c b/libc/sysdeps/linux/nios/crtend.c
index 26af229af..29af728a9 100644
--- a/libc/sysdeps/linux/nios/crtend.c
+++ b/libc/sysdeps/linux/nios/crtend.c
@@ -1,5 +1,6 @@
#include <errno.h>
#include <stdlib.h>
+#include <unistd.h>
/*
static void (*__CTOR_END__[1]) __P((void))
__attribute__((section(".ctors"))) = { (void *)-1 };
@@ -25,7 +26,7 @@ static void dummy_init(void) __attribute__((section(".trash")));
void
dummy_init(void)
{
- static int initialized = 0;
+ static smallint initialized;
static void (*volatile call__ctors)(void) = __do_global_ctors_aux;
/*
* Call global constructors.
diff --git a/libc/sysdeps/linux/nios2/bits/fcntl.h b/libc/sysdeps/linux/nios2/bits/fcntl.h
index 544e2145b..cb86c8a90 100644
--- a/libc/sysdeps/linux/nios2/bits/fcntl.h
+++ b/libc/sysdeps/linux/nios2/bits/fcntl.h
@@ -96,6 +96,8 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set on new fd. */
#endif
/* For F_[GET|SET]FL. */
@@ -182,7 +184,10 @@ struct flock64
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
#ifdef __USE_GNU
+#if 0
+/* 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. */
@@ -194,6 +199,15 @@ struct flock64
write. */
#endif
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
__BEGIN_DECLS
#ifdef __USE_GNU
@@ -207,21 +221,21 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
/* 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 int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
- unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
/* Splice two files together. */
-extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
/* In-kernel implementation of tee for pipe buffers. */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
-#endif
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
#endif
-
__END_DECLS
+
diff --git a/libc/sysdeps/linux/nios2/bits/uClibc_arch_features.h b/libc/sysdeps/linux/nios2/bits/uClibc_arch_features.h
index ff0e20fad..f4adaf5ad 100644
--- a/libc/sysdeps/linux/nios2/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/nios2/bits/uClibc_arch_features.h
@@ -18,9 +18,6 @@
/* does your target have a broken create_module() ? */
#undef __UCLIBC_BROKEN_CREATE_MODULE__
-/* does your target prefix all symbols with an _ ? */
-#define __UCLIBC_NO_UNDERSCORES__
-
/* does your target have an asm .set ? */
#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
diff --git a/libc/sysdeps/linux/nios2/brk.c b/libc/sysdeps/linux/nios2/brk.c
index 8d6288793..0420798bc 100644
--- a/libc/sysdeps/linux/nios2/brk.c
+++ b/libc/sysdeps/linux/nios2/brk.c
@@ -28,11 +28,11 @@ libc_hidden_proto(brk)
int brk (void *addr)
{
void *newbrk;
- register int r2 asm("r2") = TRAP_ID_SYSCALL;
- register int r3 asm("r3") = __NR_brk;
- register void *r4 asm("r4") = addr;
+ register int r2 __asm__("r2") = TRAP_ID_SYSCALL;
+ register int r3 __asm__("r3") = __NR_brk;
+ register void *r4 __asm__("r4") = addr;
- asm volatile ("trap\n\t" : "=r"(newbrk) : "0"(r2), "r"(r3), "r"(r4));
+ __asm__ __volatile__ ("trap\n\t" : "=r"(newbrk) : "0"(r2), "r"(r3), "r"(r4));
__curbrk = newbrk;
diff --git a/libc/sysdeps/linux/nios2/clone.c b/libc/sysdeps/linux/nios2/clone.c
index 78dcac1af..eec9f42ff 100644
--- a/libc/sysdeps/linux/nios2/clone.c
+++ b/libc/sysdeps/linux/nios2/clone.c
@@ -19,19 +19,19 @@
int clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg, ...)
{
- register unsigned long rval asm ("r2") = -EINVAL;
+ register unsigned long rval __asm__ ("r2") = -EINVAL;
if (fn && child_stack) {
- register unsigned long syscall asm ("r3");
- register unsigned long arg0 asm ("r4");
- register unsigned long arg1 asm ("r5");
+ register unsigned long syscall __asm__ ("r3");
+ register unsigned long arg0 __asm__ ("r4");
+ register unsigned long arg1 __asm__ ("r5");
/* Clone this thread. */
rval = TRAP_ID_SYSCALL;
syscall = __NR_clone;
arg0 = flags;
arg1 = (unsigned long)child_stack;
- asm volatile ("trap "
+ __asm__ __volatile__ ("trap "
: "=r" (rval), "=r" (syscall)
: "0" (rval),"1" (syscall), "r" (arg0), "r" (arg1)
);
@@ -40,7 +40,7 @@ int clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg, ...)
/* In child thread, call fn and exit. */
arg0 = (*fn) (arg);
syscall = __NR_exit;
- asm volatile ("trap "
+ __asm__ __volatile__ ("trap "
: "=r" (rval), "=r" (syscall)
: "1" (syscall), "r" (arg0));
}
diff --git a/libc/sysdeps/linux/nios2/syscall.c b/libc/sysdeps/linux/nios2/syscall.c
index c6cce215a..df925fde8 100644
--- a/libc/sysdeps/linux/nios2/syscall.c
+++ b/libc/sysdeps/linux/nios2/syscall.c
@@ -26,16 +26,16 @@
long syscall(long sysnum, long a, long b, long c, long d, long e, long f)
{
- register long _r2 asm("r2")=(long)TRAP_ID_SYSCALL;
- register long _r3 asm("r3")=(long)sysnum;
+ register long _r2 __asm__("r2")=(long)TRAP_ID_SYSCALL;
+ register long _r3 __asm__("r3")=(long)sysnum;
- register long _r4 asm("r4")=(long)(a);
- register long _r5 asm("r5")=(long)(b);
- register long _r6 asm("r6")=(long)(c);
- register long _r7 asm("r7")=(long)(d);
- register long _r8 asm("r8")=(long)(e);
- register long _r9 asm("r9")=(long)(f);
- asm volatile(
+ register long _r4 __asm__("r4")=(long)(a);
+ register long _r5 __asm__("r5")=(long)(b);
+ register long _r6 __asm__("r6")=(long)(c);
+ register long _r7 __asm__("r7")=(long)(d);
+ register long _r8 __asm__("r8")=(long)(e);
+ register long _r9 __asm__("r9")=(long)(f);
+ __asm__ __volatile__(
"trap "
: "=r"(_r2), "=r"(_r3)
: "0"(_r2), "1"(_r3),
diff --git a/libc/sysdeps/linux/v850/bits/fcntl.h b/libc/sysdeps/linux/v850/bits/fcntl.h
index 4b41b4715..97aa632c9 100644
--- a/libc/sysdeps/linux/v850/bits/fcntl.h
+++ b/libc/sysdeps/linux/v850/bits/fcntl.h
@@ -93,6 +93,8 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set on new fd. */
#endif
/* For F_[GET|SET]FL. */
@@ -178,3 +180,59 @@ struct flock64
# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
+
+#ifdef __USE_GNU
+#if 0
+/* 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. */
+#endif
+
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
+__BEGIN_DECLS
+
+#ifdef __USE_GNU
+
+/* 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,
+ size_t __count, unsigned int __flags);
+
+/* Splice two files together. */
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
+
+/* In-kernel implementation of tee for pipe buffers. */
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
+
+#endif
+__END_DECLS
+
diff --git a/libc/sysdeps/linux/v850/bits/uClibc_arch_features.h b/libc/sysdeps/linux/v850/bits/uClibc_arch_features.h
index 1b40e32a2..f4adaf5ad 100644
--- a/libc/sysdeps/linux/v850/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/v850/bits/uClibc_arch_features.h
@@ -18,9 +18,6 @@
/* does your target have a broken create_module() ? */
#undef __UCLIBC_BROKEN_CREATE_MODULE__
-/* does your target prefix all symbols with an _ ? */
-#undef __UCLIBC_NO_UNDERSCORES__
-
/* does your target have an asm .set ? */
#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
diff --git a/libc/sysdeps/linux/v850/clone.c b/libc/sysdeps/linux/v850/clone.c
index 515981f4e..d2e220823 100644
--- a/libc/sysdeps/linux/v850/clone.c
+++ b/libc/sysdeps/linux/v850/clone.c
@@ -17,19 +17,19 @@
int
clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg)
{
- register unsigned long rval asm (SYSCALL_RET) = -EINVAL;
+ register unsigned long rval __asm__ (SYSCALL_RET) = -EINVAL;
if (fn && child_stack)
{
- register unsigned long syscall asm (SYSCALL_NUM);
- register unsigned long arg0 asm (SYSCALL_ARG0);
- register unsigned long arg1 asm (SYSCALL_ARG1);
+ register unsigned long syscall __asm__ (SYSCALL_NUM);
+ register unsigned long arg0 __asm__ (SYSCALL_ARG0);
+ register unsigned long arg1 __asm__ (SYSCALL_ARG1);
/* Clone this thread. */
arg0 = flags;
arg1 = (unsigned long)child_stack;
syscall = __NR_clone;
- asm volatile ("trap " SYSCALL_SHORT_TRAP
+ __asm__ __volatile__ ("trap " SYSCALL_SHORT_TRAP
: "=r" (rval), "=r" (syscall)
: "1" (syscall), "r" (arg0), "r" (arg1)
: SYSCALL_SHORT_CLOBBERS);
@@ -39,7 +39,7 @@ clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg)
{
arg0 = (*fn) (arg);
syscall = __NR_exit;
- asm volatile ("trap " SYSCALL_SHORT_TRAP
+ __asm__ __volatile__ ("trap " SYSCALL_SHORT_TRAP
: "=r" (rval), "=r" (syscall)
: "1" (syscall), "r" (arg0)
: SYSCALL_SHORT_CLOBBERS);
diff --git a/libc/sysdeps/linux/v850/syscall.c b/libc/sysdeps/linux/v850/syscall.c
index 2b7d67b4a..614d874f5 100644
--- a/libc/sysdeps/linux/v850/syscall.c
+++ b/libc/sysdeps/linux/v850/syscall.c
@@ -25,16 +25,16 @@ syscall (long num, arg_t a1, arg_t a2, arg_t a3, arg_t a4, arg_t a5, arg_t a6)
off the stack even for (the majority of) system calls with fewer
arguments; hopefully this won't cause any problems. A1-A4 are in
registers, so they're OK. */
- register arg_t a asm (SYSCALL_ARG0) = a1;
- register arg_t b asm (SYSCALL_ARG1) = a2;
- register arg_t c asm (SYSCALL_ARG2) = a3;
- register arg_t d asm (SYSCALL_ARG3) = a4;
- register arg_t e asm (SYSCALL_ARG4) = a5;
- register arg_t f asm (SYSCALL_ARG5) = a6;
- register unsigned long syscall asm (SYSCALL_NUM) = num;
- register unsigned long ret asm (SYSCALL_RET);
+ register arg_t a __asm__ (SYSCALL_ARG0) = a1;
+ register arg_t b __asm__ (SYSCALL_ARG1) = a2;
+ register arg_t c __asm__ (SYSCALL_ARG2) = a3;
+ register arg_t d __asm__ (SYSCALL_ARG3) = a4;
+ register arg_t e __asm__ (SYSCALL_ARG4) = a5;
+ register arg_t f __asm__ (SYSCALL_ARG5) = a6;
+ register unsigned long syscall __asm__ (SYSCALL_NUM) = num;
+ register unsigned long ret __asm__ (SYSCALL_RET);
- asm ("trap " SYSCALL_LONG_TRAP
+ __asm__ ("trap " SYSCALL_LONG_TRAP
: "=r" (ret)
: "r" (syscall), "r" (a), "r" (b), "r" (c), "r" (d), "r" (e), "r" (f)
: SYSCALL_CLOBBERS);
diff --git a/libc/sysdeps/linux/x86_64/__longjmp.S b/libc/sysdeps/linux/x86_64/__longjmp.S
index 1ff6e0169..db2928bf0 100644
--- a/libc/sysdeps/linux/x86_64/__longjmp.S
+++ b/libc/sysdeps/linux/x86_64/__longjmp.S
@@ -26,7 +26,6 @@
void __longjmp (__jmp_buf env, int val). */
.global __longjmp
.type __longjmp,%function
-.align 16
__longjmp:
/* Restore registers. */
movq (JB_RBX*8)(%rdi),%rbx
diff --git a/libc/sysdeps/linux/x86_64/bits/atomic.h b/libc/sysdeps/linux/x86_64/bits/atomic.h
index 133a68d19..67a512568 100644
--- a/libc/sysdeps/linux/x86_64/bits/atomic.h
+++ b/libc/sysdeps/linux/x86_64/bits/atomic.h
@@ -321,4 +321,4 @@ typedef uintmax_t uatomic_max_t;
__result; })
-#define atomic_delay() asm ("rep; nop")
+#define atomic_delay() __asm__ ("rep; nop")
diff --git a/libc/sysdeps/linux/x86_64/bits/fcntl.h b/libc/sysdeps/linux/x86_64/bits/fcntl.h
index 7114eb87e..858240fe5 100644
--- a/libc/sysdeps/linux/x86_64/bits/fcntl.h
+++ b/libc/sysdeps/linux/x86_64/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/x86-64.
- Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2004, 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
@@ -50,6 +50,9 @@
# define O_DIRECTORY 0200000 /* Must be a directory. */
# define O_NOFOLLOW 0400000 /* Do not follow links. */
# define O_NOATIME 01000000 /* Do not set atime. */
+# if 0
+# define O_CLOEXEC 02000000 /* Set close_on_exec. */
+# endif
#endif
/* For now Linux has synchronisity options for data and read operations.
@@ -111,9 +114,11 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set on new fd. */
#endif
-/* For F_[GET|SET]FL. */
+/* For F_[GET|SET]FD. */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
@@ -199,6 +204,8 @@ struct flock64
#ifdef __USE_GNU
+#if 0
+/* 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. */
@@ -210,6 +217,15 @@ struct flock64
write. */
#endif
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
__BEGIN_DECLS
#ifdef __USE_GNU
@@ -223,21 +239,21 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
/* 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 int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
- unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
/* Splice two files together. */
-extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
/* In-kernel implementation of tee for pipe buffers. */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
-#endif
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
#endif
-
__END_DECLS
+
diff --git a/libc/sysdeps/linux/x86_64/bits/syscalls.h b/libc/sysdeps/linux/x86_64/bits/syscalls.h
index d31304430..7431d6d7f 100644
--- a/libc/sysdeps/linux/x86_64/bits/syscalls.h
+++ b/libc/sysdeps/linux/x86_64/bits/syscalls.h
@@ -141,7 +141,7 @@ return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \
unsigned long resultvar; \
LOAD_ARGS_##nr (args) \
LOAD_REGS_##nr \
- asm volatile ( \
+ __asm__ __volatile__ ( \
"syscall\n\t" \
: "=a" (resultvar) \
: "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx"); \
@@ -165,7 +165,7 @@ return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \
long int __arg1 = (long) (a1); \
LOAD_ARGS_0 ()
#define LOAD_REGS_1 \
- register long int _a1 asm ("rdi") = __arg1; \
+ register long int _a1 __asm__ ("rdi") = __arg1; \
LOAD_REGS_0
#define ASM_ARGS_1 ASM_ARGS_0, "r" (_a1)
@@ -173,7 +173,7 @@ return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \
long int __arg2 = (long) (a2); \
LOAD_ARGS_1 (a1)
#define LOAD_REGS_2 \
- register long int _a2 asm ("rsi") = __arg2; \
+ register long int _a2 __asm__ ("rsi") = __arg2; \
LOAD_REGS_1
#define ASM_ARGS_2 ASM_ARGS_1, "r" (_a2)
@@ -181,7 +181,7 @@ return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \
long int __arg3 = (long) (a3); \
LOAD_ARGS_2 (a1, a2)
#define LOAD_REGS_3 \
- register long int _a3 asm ("rdx") = __arg3; \
+ register long int _a3 __asm__ ("rdx") = __arg3; \
LOAD_REGS_2
#define ASM_ARGS_3 ASM_ARGS_2, "r" (_a3)
@@ -189,7 +189,7 @@ return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \
long int __arg4 = (long) (a4); \
LOAD_ARGS_3 (a1, a2, a3)
#define LOAD_REGS_4 \
- register long int _a4 asm ("r10") = __arg4; \
+ register long int _a4 __asm__ ("r10") = __arg4; \
LOAD_REGS_3
#define ASM_ARGS_4 ASM_ARGS_3, "r" (_a4)
@@ -197,7 +197,7 @@ return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \
long int __arg5 = (long) (a5); \
LOAD_ARGS_4 (a1, a2, a3, a4)
#define LOAD_REGS_5 \
- register long int _a5 asm ("r8") = __arg5; \
+ register long int _a5 __asm__ ("r8") = __arg5; \
LOAD_REGS_4
#define ASM_ARGS_5 ASM_ARGS_4, "r" (_a5)
@@ -205,7 +205,7 @@ return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \
long int __arg6 = (long) (a6); \
LOAD_ARGS_5 (a1, a2, a3, a4, a5)
#define LOAD_REGS_6 \
- register long int _a6 asm ("r9") = __arg6; \
+ register long int _a6 __asm__ ("r9") = __arg6; \
LOAD_REGS_5
#define ASM_ARGS_6 ASM_ARGS_5, "r" (_a6)
diff --git a/libc/sysdeps/linux/x86_64/bits/uClibc_arch_features.h b/libc/sysdeps/linux/x86_64/bits/uClibc_arch_features.h
index 03d8125e0..e3e2c8332 100644
--- a/libc/sysdeps/linux/x86_64/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/x86_64/bits/uClibc_arch_features.h
@@ -17,9 +17,6 @@
/* does your target have a broken create_module() ? */
#undef __UCLIBC_BROKEN_CREATE_MODULE__
-/* does your target prefix all symbols with an _ ? */
-#define __UCLIBC_NO_UNDERSCORES__
-
/* does your target have an asm .set ? */
#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
diff --git a/libc/sysdeps/linux/x86_64/brk.c b/libc/sysdeps/linux/x86_64/brk.c
index 22f006d7e..eddfd9830 100644
--- a/libc/sysdeps/linux/x86_64/brk.c
+++ b/libc/sysdeps/linux/x86_64/brk.c
@@ -29,7 +29,7 @@ int brk (void *addr)
{
void *__unbounded newbrk;
- asm ("syscall\n"
+ __asm__ ("syscall\n"
: "=a" (newbrk)
: "0" (__NR_brk), "D" (__ptrvalue (addr))
: "r11","rcx","memory");
diff --git a/libc/sysdeps/linux/x86_64/bsd-_setjmp.S b/libc/sysdeps/linux/x86_64/bsd-_setjmp.S
index d5f9ae1b8..81a4352f3 100644
--- a/libc/sysdeps/linux/x86_64/bsd-_setjmp.S
+++ b/libc/sysdeps/linux/x86_64/bsd-_setjmp.S
@@ -23,7 +23,6 @@
.global _setjmp
.type _setjmp,%function
-.align 16
_setjmp:
xorq %rsi, %rsi
jmp __sigsetjmp@PLT
diff --git a/libc/sysdeps/linux/x86_64/bsd-setjmp.S b/libc/sysdeps/linux/x86_64/bsd-setjmp.S
index 21d0191d0..a906a6132 100644
--- a/libc/sysdeps/linux/x86_64/bsd-setjmp.S
+++ b/libc/sysdeps/linux/x86_64/bsd-setjmp.S
@@ -23,7 +23,6 @@
.global setjmp
.type setjmp,%function
-.align 16
setjmp:
movq $1, %rsi
jmp __sigsetjmp@PLT
diff --git a/libc/sysdeps/linux/x86_64/clone.S b/libc/sysdeps/linux/x86_64/clone.S
index b93c2d9a4..dc5eeb0a0 100644
--- a/libc/sysdeps/linux/x86_64/clone.S
+++ b/libc/sysdeps/linux/x86_64/clone.S
@@ -53,7 +53,6 @@
.text
.global clone
.type clone,%function
-.align 4
clone:
/* Sanity check arguments. */
movq $-EINVAL,%rax
diff --git a/libc/sysdeps/linux/x86_64/setjmp.S b/libc/sysdeps/linux/x86_64/setjmp.S
index a44f968c5..eb4b97363 100644
--- a/libc/sysdeps/linux/x86_64/setjmp.S
+++ b/libc/sysdeps/linux/x86_64/setjmp.S
@@ -23,7 +23,6 @@
.global __sigsetjmp
.type __sigsetjmp,%function
-.align 4
__sigsetjmp:
/* Save registers. */
movq %rbx, (JB_RBX*8)(%rdi)
diff --git a/libc/sysdeps/linux/x86_64/sigaction.c b/libc/sysdeps/linux/x86_64/sigaction.c
index dad45f69e..29b6ed03a 100644
--- a/libc/sysdeps/linux/x86_64/sigaction.c
+++ b/libc/sysdeps/linux/x86_64/sigaction.c
@@ -38,10 +38,10 @@ extern __typeof(sigaction) __libc_sigaction;
#ifdef __NR_rt_sigaction
/* Using the hidden attribute here does not change the code but it
helps to avoid warnings. */
-extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
-extern void restore (void) asm ("__restore") attribute_hidden;
+extern void restore_rt (void) __asm__ ("__restore_rt") attribute_hidden;
+extern void restore (void) __asm__ ("__restore") attribute_hidden;
-libc_hidden_proto(memcpy)
+/* Experimentally off - libc_hidden_proto(memcpy) */
/* 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. */
@@ -74,7 +74,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
}
#else
-extern void restore (void) asm ("__restore") attribute_hidden;
+extern void restore (void) __asm__ ("__restore") attribute_hidden;
/* 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. */
@@ -98,7 +98,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
kact.sa_restorer = &restore;
}
- asm volatile ("syscall\n"
+ __asm__ __volatile__ ("syscall\n"
: "=a" (result)
: "0" (__NR_sigaction), "mr" (sig),
"c" (act ? __ptrvalue (&kact) : 0),
@@ -138,7 +138,6 @@ libc_hidden_weak(sigaction)
asm \
( \
".text\n" \
- ".align 16\n" \
"__" #name ":\n" \
" movq $" #syscall ", %rax\n" \
" syscall\n" \
diff --git a/libc/sysdeps/linux/x86_64/syscall.S b/libc/sysdeps/linux/x86_64/syscall.S
index 86306906a..ee223e3e6 100644
--- a/libc/sysdeps/linux/x86_64/syscall.S
+++ b/libc/sysdeps/linux/x86_64/syscall.S
@@ -26,7 +26,6 @@
.text
.globl syscall
.type syscall,%function
-.align 16
syscall:
movq %rdi, %rax /* Syscall number -> rax. */
movq %rsi, %rdi /* shift arg1 - arg5. */
diff --git a/libc/sysdeps/linux/x86_64/vfork.S b/libc/sysdeps/linux/x86_64/vfork.S
index b22b7b422..2dadbbfe0 100644
--- a/libc/sysdeps/linux/x86_64/vfork.S
+++ b/libc/sysdeps/linux/x86_64/vfork.S
@@ -32,7 +32,6 @@
.global __vfork
.hidden __vfork
.type __vfork,%function
-.align 16
__vfork:
diff --git a/libc/sysdeps/linux/xtensa/bits/fcntl.h b/libc/sysdeps/linux/xtensa/bits/fcntl.h
index 2c4e2f01b..4a8018a9f 100644
--- a/libc/sysdeps/linux/xtensa/bits/fcntl.h
+++ b/libc/sysdeps/linux/xtensa/bits/fcntl.h
@@ -97,6 +97,8 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set on new fd. */
#endif
/* For F_[GET|SET]FD. */
@@ -183,6 +185,30 @@ struct flock64
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
+#ifdef __USE_GNU
+#if 0
+/* 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. */
+#endif
+
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
__BEGIN_DECLS
#ifdef __USE_GNU
@@ -191,6 +217,26 @@ __BEGIN_DECLS
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,
+ size_t __count, unsigned int __flags);
+
+/* Splice two files together. */
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
+
+/* In-kernel implementation of tee for pipe buffers. */
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
+
+#endif
__END_DECLS
+
diff --git a/libc/sysdeps/linux/xtensa/bits/syscalls.h b/libc/sysdeps/linux/xtensa/bits/syscalls.h
index 76bcf404f..e0506e4cc 100644
--- a/libc/sysdeps/linux/xtensa/bits/syscalls.h
+++ b/libc/sysdeps/linux/xtensa/bits/syscalls.h
@@ -53,7 +53,7 @@
#include <errno.h>
#define STR(s) #s
-#define LD_ARG(n,ar) register int _a##n asm (STR(a##n)) = (int) (ar)
+#define LD_ARG(n,ar) register int _a##n __asm__ (STR(a##n)) = (int) (ar)
#define LD_ARGS_0()
#define LD_ARGS_1(a0) LD_ARG(6,a0)
@@ -90,7 +90,7 @@
#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
({ LD_ARG(2, name); \
LD_ARGS_##nr(args); \
- asm volatile ("syscall\n" \
+ __asm__ __volatile__ ("syscall\n" \
: "=a" (_a2) \
: ASM_ARGS_##nr \
: "memory"); \
diff --git a/libc/sysdeps/linux/xtensa/sigaction.c b/libc/sysdeps/linux/xtensa/sigaction.c
index 5ef40c36e..60d915c56 100644
--- a/libc/sysdeps/linux/xtensa/sigaction.c
+++ b/libc/sysdeps/linux/xtensa/sigaction.c
@@ -17,7 +17,7 @@
extern void __default_sa_restorer (void);
-libc_hidden_proto(memcpy)
+/* Experimentally off - libc_hidden_proto(memcpy) */
int __libc_sigaction (int signum, const struct sigaction *act,
struct sigaction *oldact)
diff --git a/libc/sysdeps/linux/xtensa/windowspill.S b/libc/sysdeps/linux/xtensa/windowspill.S
index 950c27b1b..a63771756 100644
--- a/libc/sysdeps/linux/xtensa/windowspill.S
+++ b/libc/sysdeps/linux/xtensa/windowspill.S
@@ -42,6 +42,7 @@ __window_spill:
mov a8, a0
retw
#else
+ mov a12, a0
_entry a1, 48 // touch NUM_REGS-36 (x/x/28)
mov a12, a0
_entry a1, 48 // touch NUM_REGS-48 (x/x/16)