diff options
Diffstat (limited to 'libc/sysdeps/linux')
171 files changed, 466 insertions, 460 deletions
diff --git a/libc/sysdeps/linux/Makefile.commonarch b/libc/sysdeps/linux/Makefile.commonarch index ff3e90aa7..1c616ec4a 100644 --- a/libc/sysdeps/linux/Makefile.commonarch +++ b/libc/sysdeps/linux/Makefile.commonarch @@ -20,6 +20,9 @@ libc-y += $(ARCH_OBJS) libc-nomulti-y += $(ARCH_SOBJ) objclean-y += arch_objclean +CFLAGS-crti.S+=$(PICFLAG) +CFLAGS-crtn.S+=$(PICFLAG) + arch_objclean: $(RM) $(ARCH_OUT)/*.{o,os} $(CTOR_TARGETS) $(CRTS) diff --git a/libc/sysdeps/linux/alpha/bits/atomic.h b/libc/sysdeps/linux/alpha/bits/atomic.h index bbfd201b5..5ef091dc0 100644 --- a/libc/sysdeps/linux/alpha/bits/atomic.h +++ b/libc/sysdeps/linux/alpha/bits/atomic.h @@ -348,7 +348,7 @@ typedef uintmax_t uatomic_max_t; : "memory"); \ __ret; }) -/* ??? Barrier semantics for atomic_exchange_and_add appear to be +/* ??? Barrier semantics for atomic_exchange_and_add appear to be undefined. Use full barrier for now, as that's safe. */ #define atomic_exchange_and_add(mem, value) \ __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, __MB, __MB) diff --git a/libc/sysdeps/linux/alpha/bits/kernel_stat.h b/libc/sysdeps/linux/alpha/bits/kernel_stat.h index 9fcbc031a..649257b7e 100644 --- a/libc/sysdeps/linux/alpha/bits/kernel_stat.h +++ b/libc/sysdeps/linux/alpha/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ struct kernel_stat { unsigned int st_dev; diff --git a/libc/sysdeps/linux/alpha/bits/kernel_types.h b/libc/sysdeps/linux/alpha/bits/kernel_types.h index 01d2a8be0..d5574c9b4 100644 --- a/libc/sysdeps/linux/alpha/bits/kernel_types.h +++ b/libc/sysdeps/linux/alpha/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/alpha/bits/syscalls.h b/libc/sysdeps/linux/alpha/bits/syscalls.h index 02b73c5a8..b5e0c1602 100644 --- a/libc/sysdeps/linux/alpha/bits/syscalls.h +++ b/libc/sysdeps/linux/alpha/bits/syscalls.h @@ -126,7 +126,7 @@ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ _sc_ret = _sc_0, _sc_err = _sc_19; \ } \ _syscall_return(type); \ -} +} #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5) \ diff --git a/libc/sysdeps/linux/alpha/sigprocmask.c b/libc/sysdeps/linux/alpha/sigprocmask.c index 1da6f7baf..e9ebe091f 100644 --- a/libc/sysdeps/linux/alpha/sigprocmask.c +++ b/libc/sysdeps/linux/alpha/sigprocmask.c @@ -25,7 +25,7 @@ /* When there is kernel support for more than 64 signals, we'll have to switch to a new system call convention here. */ -static inline _syscall2(int, osf_sigprocmask, int, how, unsigned long int, setval); +static __inline__ _syscall2(int, osf_sigprocmask, int, how, unsigned long int, setval); libc_hidden_proto(sigprocmask) int diff --git a/libc/sysdeps/linux/arm/bits/endian.h b/libc/sysdeps/linux/arm/bits/endian.h index 27946cdee..6e9967db5 100644 --- a/libc/sysdeps/linux/arm/bits/endian.h +++ b/libc/sysdeps/linux/arm/bits/endian.h @@ -13,7 +13,7 @@ CPU endianness. VFP floating point units use the same endianness as the rest of the system. */ #if defined __VFP_FP__ || defined __MAVERICK__ -# define __FLOAT_WORD_ORDER __BYTE_ORDER +# define __FLOAT_WORD_ORDER __BYTE_ORDER #else # define __FLOAT_WORD_ORDER __BIG_ENDIAN #endif diff --git a/libc/sysdeps/linux/arm/bits/kernel_stat.h b/libc/sysdeps/linux/arm/bits/kernel_stat.h index b686c479a..ebac6f5ff 100644 --- a/libc/sysdeps/linux/arm/bits/kernel_stat.h +++ b/libc/sysdeps/linux/arm/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ #define STAT_HAVE_NSEC 1 diff --git a/libc/sysdeps/linux/arm/bits/kernel_types.h b/libc/sysdeps/linux/arm/bits/kernel_types.h index d7a1b1530..766a30621 100644 --- a/libc/sysdeps/linux/arm/bits/kernel_types.h +++ b/libc/sysdeps/linux/arm/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/arm/bits/syscalls.h b/libc/sysdeps/linux/arm/bits/syscalls.h index 85c6cbd55..2d2e0f0a4 100644 --- a/libc/sysdeps/linux/arm/bits/syscalls.h +++ b/libc/sysdeps/linux/arm/bits/syscalls.h @@ -5,7 +5,7 @@ #endif /* - Some of the sneaky macros in the code were taken from + Some of the sneaky macros in the code were taken from glibc-2.3.2/sysdeps/unix/sysv/linux/arm/sysdep.h */ @@ -65,7 +65,7 @@ return (type) (INLINE_SYSCALL(name, 3, arg1, arg2, arg3)); \ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ { \ return (type) (INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4)); \ -} +} #undef _syscall5 #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ @@ -145,13 +145,13 @@ return (type) (INLINE_SYSCALL(name, 7, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \ int _sys_buf[2]; \ register int _a1 __asm__ ("a1"); \ - register int *_v3 asm ("v3") = _sys_buf; \ + register int *_v3 __asm__ ("v3") = _sys_buf; \ *_v3 = (int) (SYS_ify(name)); \ LOAD_ARGS_##nr (args) \ - asm volatile ("str r7, [v3, #4]\n" \ - "\tldr r7, [v3]\n" \ - "\tswi 0 @ syscall " #name "\n" \ - "\tldr r7, [v3, #4]" \ + __asm__ __volatile__ ("str r7, [v3, #4]\n" \ + "\tldr r7, [v3]\n" \ + "\tswi 0 @ syscall " #name "\n" \ + "\tldr r7, [v3, #4]" \ : "=r" (_a1) \ : "r" (_v3) ASM_ARGS_##nr \ : "memory"); \ diff --git a/libc/sysdeps/linux/arm/ioperm.c b/libc/sysdeps/linux/arm/ioperm.c index 0229f871d..708e8ec49 100644 --- a/libc/sysdeps/linux/arm/ioperm.c +++ b/libc/sysdeps/linux/arm/ioperm.c @@ -117,7 +117,7 @@ init_iosys (void) { char systype[256]; int i, n; - + #if LINUX_VERSION_CODE < 132119 static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE }; static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT }; diff --git a/libc/sysdeps/linux/arm/iopl.c b/libc/sysdeps/linux/arm/iopl.c index 552ba6c67..654a4158f 100644 --- a/libc/sysdeps/linux/arm/iopl.c +++ b/libc/sysdeps/linux/arm/iopl.c @@ -25,7 +25,7 @@ libc_hidden_proto(ioperm) #define MAX_PORT 0x10000 -int iopl(int level) +int iopl(int level) { if (level > 3) { __set_errno(EINVAL); diff --git a/libc/sysdeps/linux/arm/mmap.c b/libc/sysdeps/linux/arm/mmap.c index 440cb17b1..47a29f4ae 100644 --- a/libc/sysdeps/linux/arm/mmap.c +++ b/libc/sysdeps/linux/arm/mmap.c @@ -16,7 +16,7 @@ libc_hidden_proto (mmap) #if defined (__UCLIBC_MMAP_HAS_6_ARGS__) && defined (__NR_mmap) #define __NR__mmap __NR_mmap -static inline _syscall6 (__ptr_t, _mmap, __ptr_t, addr, size_t, len, +static __inline__ _syscall6 (__ptr_t, _mmap, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, __off_t, offset); __ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset) @@ -32,7 +32,7 @@ __ptr_t mmap(__ptr_t addr, size_t len, int prot, # define MMAP2_PAGE_SHIFT 12 #endif -static inline _syscall6 (__ptr_t, _mmap, __ptr_t, addr, size_t, len, +static __inline__ _syscall6 (__ptr_t, _mmap, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, __off_t, offset); __ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset) @@ -53,7 +53,7 @@ __ptr_t mmap(__ptr_t addr, size_t len, int prot, } #elif defined (__NR_mmap) # define __NR__mmap __NR_mmap -static inline _syscall1(__ptr_t, _mmap, unsigned long *, buffer); +static __inline__ _syscall1(__ptr_t, _mmap, unsigned long *, buffer); __ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset) { diff --git a/libc/sysdeps/linux/avr32/bits/byteswap.h b/libc/sysdeps/linux/avr32/bits/byteswap.h index 1c030b976..f0bea4cea 100644 --- a/libc/sysdeps/linux/avr32/bits/byteswap.h +++ b/libc/sysdeps/linux/avr32/bits/byteswap.h @@ -18,7 +18,7 @@ # define __bswap_16(x) (__extension__ __builtin_bswap_16(x)) #else /* This is better than nothing. */ -static __inline unsigned short int +static __inline__ unsigned short int __bswap_16 (unsigned short int __bsx) { return ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8)); @@ -29,7 +29,7 @@ __bswap_16 (unsigned short int __bsx) #if defined __GNUC__ # define __bswap_32(x) (__extension__ __builtin_bswap_32(x)) #else -static __inline unsigned int +static __inline__ unsigned int __bswap_32 (unsigned int __bsx) { return ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) | diff --git a/libc/sysdeps/linux/avr32/bits/syscalls.h b/libc/sysdeps/linux/avr32/bits/syscalls.h index 22ac05960..ff5d1a7be 100644 --- a/libc/sysdeps/linux/avr32/bits/syscalls.h +++ b/libc/sysdeps/linux/avr32/bits/syscalls.h @@ -95,10 +95,10 @@ #undef INTERNAL_SYSCALL #define INTERNAL_SYSCALL(name, err, nr, args...) \ ({ \ - register int _a1 asm ("r12"); \ - register int _scno asm("r8") = SYS_ify(name); \ + register int _a1 __asm__("r12"); \ + register int _scno __asm__("r8") = SYS_ify(name); \ LOAD_ARGS_##nr (args); \ - asm volatile ("scall /* syscall " #name " */" \ + __asm__ __volatile__("scall /* syscall " #name " */" \ : "=r" (_a1) \ : "r"(_scno) ASM_ARGS_##nr \ : "cc", "memory"); \ @@ -119,23 +119,23 @@ 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); \ + 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); \ + 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); \ + 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); \ + 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); \ + register int _a6 __asm__("r3") = (int)(a6); \ LOAD_ARGS_5(a1, a2, a3, a4, a5) #define ASM_ARGS_6 ASM_ARGS_5, "r"(_a6) diff --git a/libc/sysdeps/linux/bfin/bits/elf-fdpic.h b/libc/sysdeps/linux/bfin/bits/elf-fdpic.h index 0dbb54b4c..905648054 100644 --- a/libc/sysdeps/linux/bfin/bits/elf-fdpic.h +++ b/libc/sysdeps/linux/bfin/bits/elf-fdpic.h @@ -103,7 +103,7 @@ __reloc_pointer (void *p, || (offset == map->segs[c].p_memsz && c + 1 == map->nsegs)) return (char*)map->segs[c].addr + offset; } - + /* We might want to crash instead. */ return (void*)-1; } diff --git a/libc/sysdeps/linux/bfin/bits/kernel_stat.h b/libc/sysdeps/linux/bfin/bits/kernel_stat.h index 2a59d8eea..8c7ba0533 100644 --- a/libc/sysdeps/linux/bfin/bits/kernel_stat.h +++ b/libc/sysdeps/linux/bfin/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ struct kernel_stat { diff --git a/libc/sysdeps/linux/bfin/crtreloc.c b/libc/sysdeps/linux/bfin/crtreloc.c index 4c09f904f..5e038256a 100644 --- a/libc/sysdeps/linux/bfin/crtreloc.c +++ b/libc/sysdeps/linux/bfin/crtreloc.c @@ -93,7 +93,7 @@ __self_reloc (const struct elf32_fdpic_loadmap *map, if (p >= e) return (void*)-1; - + return __reloc_pointer (*p, map); } diff --git a/libc/sysdeps/linux/common/__syscall_fcntl64.c b/libc/sysdeps/linux/common/__syscall_fcntl64.c index 4c5495c24..84c2ea2bf 100644 --- a/libc/sysdeps/linux/common/__syscall_fcntl64.c +++ b/libc/sysdeps/linux/common/__syscall_fcntl64.c @@ -16,7 +16,7 @@ extern __typeof(fcntl64) __libc_fcntl64; libc_hidden_proto(__libc_fcntl64) #define __NR___syscall_fcntl64 __NR_fcntl64 -static inline _syscall3(int, __syscall_fcntl64, int, fd, int, cmd, long, arg); +static __inline__ _syscall3(int, __syscall_fcntl64, int, fd, int, cmd, long, arg); int __libc_fcntl64(int fd, int cmd, ...) { long arg; diff --git a/libc/sysdeps/linux/common/_exit.c b/libc/sysdeps/linux/common/_exit.c index 4614ef9e0..7592e9b45 100644 --- a/libc/sysdeps/linux/common/_exit.c +++ b/libc/sysdeps/linux/common/_exit.c @@ -22,7 +22,7 @@ libc_hidden_proto(_exit) #ifndef INLINE_SYSCALL #define INLINE_SYSCALL(name, nr, args...) __syscall_exit (args) #define __NR___syscall_exit __NR_exit -static inline _syscall1(void, __syscall_exit, int, status); +static __inline__ _syscall1(void, __syscall_exit, int, status); #endif void attribute_noreturn _exit(int status) diff --git a/libc/sysdeps/linux/common/bits/kernel_sigaction.h b/libc/sysdeps/linux/common/bits/kernel_sigaction.h index 7af027735..ede905bb4 100644 --- a/libc/sysdeps/linux/common/bits/kernel_sigaction.h +++ b/libc/sysdeps/linux/common/bits/kernel_sigaction.h @@ -1,7 +1,7 @@ #ifndef _BITS_SIGACTION_STRUCT_H #define _BITS_SIGACTION_STRUCT_H -/* This file provides whatever this particular arch's kernel thinks +/* This file provides whatever this particular arch's kernel thinks * the sigaction struct should look like... */ #undef NO_OLD_SIGACTION diff --git a/libc/sysdeps/linux/common/bits/kernel_types.h b/libc/sysdeps/linux/common/bits/kernel_types.h index 4567827b3..1c23ebfe7 100644 --- a/libc/sysdeps/linux/common/bits/kernel_types.h +++ b/libc/sysdeps/linux/common/bits/kernel_types.h @@ -6,7 +6,7 @@ * arches have broken headers that introduce tons of gratuitous * conflicts with uClibc's namespace. See bits/kernel_types.h * for i386, arm, etc for examples... */ -#warning You really should include a proper bits/kernel_types.h for your architecture +#warning You really should include a proper bits/kernel_types.h for your architecture #ifndef __GLIBC__ #define __GLIBC__ 2 diff --git a/libc/sysdeps/linux/common/bits/stdio_lim.h b/libc/sysdeps/linux/common/bits/stdio_lim.h index ea6d693f5..c35ee601b 100644 --- a/libc/sysdeps/linux/common/bits/stdio_lim.h +++ b/libc/sysdeps/linux/common/bits/stdio_lim.h @@ -23,7 +23,7 @@ #ifdef _STDIO_H # define L_tmpnam 20 # define TMP_MAX 238328 -# define FILENAME_MAX 4095 +# define FILENAME_MAX 4095 # ifdef __USE_POSIX # define L_ctermid 9 @@ -37,5 +37,5 @@ #endif #if defined __need_IOV_MAX && !defined IOV_MAX -# define IOV_MAX 1024 +# define IOV_MAX 1024 #endif diff --git a/libc/sysdeps/linux/common/bits/syscalls.h b/libc/sysdeps/linux/common/bits/syscalls.h index 4895c4fa0..ceba568e5 100644 --- a/libc/sysdeps/linux/common/bits/syscalls.h +++ b/libc/sysdeps/linux/common/bits/syscalls.h @@ -2,7 +2,7 @@ * this file must be able to cope with PIC and non-PIC code. For some arches * there is no difference. For x86 (which has far too few registers) there is * a difference. Regardless, including asm/unistd.h is hereby officially - * forbidden. Don't do it. It is bad for you. - */ + * forbidden. Don't do it. It is bad for you. + */ #error You have not provided architecture specific _syscall[0-6] macros diff --git a/libc/sysdeps/linux/common/bits/uClibc_ctype.h b/libc/sysdeps/linux/common/bits/uClibc_ctype.h index dd723c77c..0b02c5dbf 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_ctype.h +++ b/libc/sysdeps/linux/common/bits/uClibc_ctype.h @@ -78,7 +78,7 @@ enum { #define __CTYPE_ispunct(D) (D == __CTYPE_punct) #define __CTYPE_isspace(D) (((unsigned int)(D - __CTYPE_print_space_nonblank)) <= 5) #define __CTYPE_isupper(D) (((unsigned int)(D - __CTYPE_alpha_upper_lower)) <= 1) -/* #define __CTYPE_isxdigit(D) -- isxdigit is untestable this way. +/* #define __CTYPE_isxdigit(D) -- isxdigit is untestable this way. * But that's ok as isxdigit() (and isdigit() too) are locale-invariant. */ #else /* __UCLIBC_GEN_LOCALE *****************************************/ diff --git a/libc/sysdeps/linux/common/bits/uClibc_locale.h b/libc/sysdeps/linux/common/bits/uClibc_locale.h index 1de735a25..a6b381c95 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_locale.h +++ b/libc/sysdeps/linux/common/bits/uClibc_locale.h @@ -39,7 +39,7 @@ #else /* __UCLIBC_HAS_LOCALE__ */ -#define __LOCALE_C_ONLY +#define __LOCALE_C_ONLY #define __XL_NPP(N) N #define __LOCALE_PARAM diff --git a/libc/sysdeps/linux/common/chdir.c b/libc/sysdeps/linux/common/chdir.c index d67fa0c9c..95a825eb7 100644 --- a/libc/sysdeps/linux/common/chdir.c +++ b/libc/sysdeps/linux/common/chdir.c @@ -15,7 +15,7 @@ libc_hidden_proto(chdir) #define __NR___syscall_chdir __NR_chdir -static inline _syscall1(int, __syscall_chdir, const char *, path); +static __inline__ _syscall1(int, __syscall_chdir, const char *, path); int chdir(const char *path) { return __syscall_chdir(path); diff --git a/libc/sysdeps/linux/common/chmod.c b/libc/sysdeps/linux/common/chmod.c index 0b9e89426..34a30a4b0 100644 --- a/libc/sysdeps/linux/common/chmod.c +++ b/libc/sysdeps/linux/common/chmod.c @@ -13,7 +13,7 @@ libc_hidden_proto(chmod) #define __NR___syscall_chmod __NR_chmod -static inline _syscall2(int, __syscall_chmod, const char *, path, __kernel_mode_t, mode); +static __inline__ _syscall2(int, __syscall_chmod, const char *, path, __kernel_mode_t, mode); int chmod(const char *path, mode_t mode) { diff --git a/libc/sysdeps/linux/common/chown.c b/libc/sysdeps/linux/common/chown.c index 169ea3aea..27b89a3f4 100644 --- a/libc/sysdeps/linux/common/chown.c +++ b/libc/sysdeps/linux/common/chown.c @@ -24,7 +24,7 @@ _syscall3(int, chown, const char *, path, uid_t, owner, gid_t, group); #else # define __NR___syscall_chown __NR_chown -static inline _syscall3(int, __syscall_chown, const char *, path, +static __inline__ _syscall3(int, __syscall_chown, const char *, path, __kernel_uid_t, owner, __kernel_gid_t, group); int chown(const char *path, uid_t owner, gid_t group) diff --git a/libc/sysdeps/linux/common/chroot.c b/libc/sysdeps/linux/common/chroot.c index 5ea76ab0d..12d09bbbe 100644 --- a/libc/sysdeps/linux/common/chroot.c +++ b/libc/sysdeps/linux/common/chroot.c @@ -14,7 +14,7 @@ #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K) #define __NR___syscall_chroot __NR_chroot -static inline _syscall1(int, __syscall_chroot, const char *, path); +static __inline__ _syscall1(int, __syscall_chroot, const char *, path); int chroot(const char *path) { diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c index f15bb18c5..95ff900e0 100644 --- a/libc/sysdeps/linux/common/create_module.c +++ b/libc/sysdeps/linux/common/create_module.c @@ -19,7 +19,7 @@ unsigned long create_module(const char *name, size_t size); #if defined(__UCLIBC_BROKEN_CREATE_MODULE__) # define __NR___create_module __NR_create_module -static inline _syscall2(long, __create_module, const char *, name, size_t, size); +static __inline__ _syscall2(long, __create_module, const char *, name, size_t, size); /* By checking the value of errno, we know if we have been fooled * by the syscall2 macro making a very high address look like a * negative, so we we fix it up here. */ @@ -38,7 +38,7 @@ unsigned long create_module(const char *name, size_t size) # define __NR___create_module __NR_create_module /* Alpha doesn't have the same problem, exactly, but a bug in older kernels fails to clear the error flag. Clear it here explicitly. */ -static inline _syscall4(unsigned long, __create_module, const char *, name, +static __inline__ _syscall4(unsigned long, __create_module, const char *, name, size_t, size, size_t, dummy, size_t, err); unsigned long create_module(const char *name, size_t size) { diff --git a/libc/sysdeps/linux/common/dl-osinfo.h b/libc/sysdeps/linux/common/dl-osinfo.h index cd791306e..5155322e0 100644 --- a/libc/sysdeps/linux/common/dl-osinfo.h +++ b/libc/sysdeps/linux/common/dl-osinfo.h @@ -54,7 +54,7 @@ static __always_inline uintptr_t _dl_setup_stack_chk_guard(void) /* Start with the "terminator canary". */ ret = 0xFF0A0D00UL; - /* Everything failed? Or we are using a weakened model of the + /* Everything failed? Or we are using a weakened model of the * terminator canary */ { struct timeval tv; diff --git a/libc/sysdeps/linux/common/fchmod.c b/libc/sysdeps/linux/common/fchmod.c index 72ec37a89..cb0058133 100644 --- a/libc/sysdeps/linux/common/fchmod.c +++ b/libc/sysdeps/linux/common/fchmod.c @@ -11,7 +11,7 @@ #include <sys/stat.h> #define __NR___syscall_fchmod __NR_fchmod -static inline _syscall2(int, __syscall_fchmod, +static __inline__ _syscall2(int, __syscall_fchmod, int, fildes, __kernel_mode_t, mode); int fchmod(int fildes, mode_t mode) diff --git a/libc/sysdeps/linux/common/fchown.c b/libc/sysdeps/linux/common/fchown.c index e8d6eee48..31111ca54 100644 --- a/libc/sysdeps/linux/common/fchown.c +++ b/libc/sysdeps/linux/common/fchown.c @@ -22,7 +22,7 @@ _syscall3(int, fchown, int, fd, uid_t, owner, gid_t, group); #else # define __NR___syscall_fchown __NR_fchown -static inline _syscall3(int, __syscall_fchown, int, fd, +static __inline__ _syscall3(int, __syscall_fchown, int, fd, __kernel_uid_t, owner, __kernel_gid_t, group); int fchown(int fd, uid_t owner, gid_t group) diff --git a/libc/sysdeps/linux/common/flock.c b/libc/sysdeps/linux/common/flock.c index 8a4aa895d..9b275d031 100644 --- a/libc/sysdeps/linux/common/flock.c +++ b/libc/sysdeps/linux/common/flock.c @@ -11,7 +11,7 @@ #include <sys/file.h> #define __NR___syscall_flock __NR_flock -static inline _syscall2(int, __syscall_flock, int, fd, int, operation); +static __inline__ _syscall2(int, __syscall_flock, int, fd, int, operation); int flock(int fd, int operation) { diff --git a/libc/sysdeps/linux/common/fstat.c b/libc/sysdeps/linux/common/fstat.c index 437c2d16b..fee750aa4 100644 --- a/libc/sysdeps/linux/common/fstat.c +++ b/libc/sysdeps/linux/common/fstat.c @@ -21,7 +21,7 @@ libc_hidden_proto(fstat) #define __NR___syscall_fstat __NR_fstat -static inline _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf); +static __inline__ _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf); int fstat(int fd, struct stat *buf) { diff --git a/libc/sysdeps/linux/common/fstat64.c b/libc/sysdeps/linux/common/fstat64.c index 215868d89..67c519a8b 100644 --- a/libc/sysdeps/linux/common/fstat64.c +++ b/libc/sysdeps/linux/common/fstat64.c @@ -17,7 +17,7 @@ libc_hidden_proto(fstat64) #define __NR___syscall_fstat64 __NR_fstat64 -static inline _syscall2(int, __syscall_fstat64, +static __inline__ _syscall2(int, __syscall_fstat64, int, filedes, struct kernel_stat64 *, buf); int fstat64(int fd, struct stat64 *buf) diff --git a/libc/sysdeps/linux/common/fstatfs.c b/libc/sysdeps/linux/common/fstatfs.c index 830de8103..8a471d36f 100644 --- a/libc/sysdeps/linux/common/fstatfs.c +++ b/libc/sysdeps/linux/common/fstatfs.c @@ -10,7 +10,6 @@ #include <sys/syscall.h> #include <sys/vfs.h> -#if !defined __UCLIBC_LINUX_SPECIFIC__ #ifndef __USE_FILE_OFFSET64 extern int fstatfs (int __fildes, struct statfs *__buf) __THROW __nonnull ((2)); @@ -22,7 +21,7 @@ extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf), # define fstatfs fstatfs64 # endif #endif -#endif + extern __typeof(fstatfs) __libc_fstatfs; libc_hidden_proto(__libc_fstatfs) #define __NR___libc_fstatfs __NR_fstatfs diff --git a/libc/sysdeps/linux/common/ftruncate64.c b/libc/sysdeps/linux/common/ftruncate64.c index cea9bc1bc..04cdc0a99 100644 --- a/libc/sysdeps/linux/common/ftruncate64.c +++ b/libc/sysdeps/linux/common/ftruncate64.c @@ -5,7 +5,7 @@ * * ftruncate64 syscall. Copes with 64 bit and 32 bit machines * and on 32 bit machines this sends things into the kernel as - * two 32-bit arguments (high and low 32 bits of length) that + * two 32-bit arguments (high and low 32 bits of length) that * are ordered based on endianess. It turns out endian.h has * just the macro we need to order things, __LONG_LONG_PAIR. */ @@ -36,10 +36,10 @@ _syscall2(int, ftruncate64, int, fd, __off64_t, length); # define INLINE_SYSCALL(name, nr, args...) __syscall_ftruncate64 (args) # define __NR___syscall_ftruncate64 __NR_ftruncate64 # if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__) -static inline _syscall4(int, __syscall_ftruncate64, int, fd, uint32_t, pad, +static __inline__ _syscall4(int, __syscall_ftruncate64, int, fd, uint32_t, pad, unsigned long, high_length, unsigned long, low_length); # else -static inline _syscall3(int, __syscall_ftruncate64, int, fd, +static __inline__ _syscall3(int, __syscall_ftruncate64, int, fd, unsigned long, high_length, unsigned long, low_length); # endif # endif diff --git a/libc/sysdeps/linux/common/getdents64.c b/libc/sysdeps/linux/common/getdents64.c index 2328df29e..e695b969c 100644 --- a/libc/sysdeps/linux/common/getdents64.c +++ b/libc/sysdeps/linux/common/getdents64.c @@ -27,7 +27,7 @@ libc_hidden_proto(lseek64) # define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) # endif -struct kernel_dirent64 +struct kernel_dirent64 { uint64_t d_ino; int64_t d_off; @@ -38,7 +38,7 @@ struct kernel_dirent64 # define __NR___syscall_getdents64 __NR_getdents64 -static inline _syscall3(int, __syscall_getdents64, int, fd, unsigned char *, dirp, size_t, count); +static __inline__ _syscall3(int, __syscall_getdents64, int, fd, unsigned char *, dirp, size_t, count); ssize_t __getdents64 (int fd, char *buf, size_t nbytes) attribute_hidden; ssize_t __getdents64 (int fd, char *buf, size_t nbytes) @@ -51,8 +51,8 @@ ssize_t __getdents64 (int fd, char *buf, size_t nbytes) const size_t size_diff = (offsetof (struct dirent64, d_name) - offsetof (struct kernel_dirent64, d_name)); - red_nbytes = MIN (nbytes - ((nbytes / - (offsetof (struct dirent64, d_name) + 14)) * size_diff), + red_nbytes = MIN (nbytes - ((nbytes / + (offsetof (struct dirent64, d_name) + 14)) * size_diff), nbytes - size_diff); dp = (struct dirent64 *) buf; diff --git a/libc/sysdeps/linux/common/getegid.c b/libc/sysdeps/linux/common/getegid.c index 7c34b6c09..eaa708f15 100644 --- a/libc/sysdeps/linux/common/getegid.c +++ b/libc/sysdeps/linux/common/getegid.c @@ -19,7 +19,7 @@ _syscall0(gid_t, getegid); #elif defined(__NR_getegid) # define __NR___syscall_getegid __NR_getegid -static inline _syscall0(int, __syscall_getegid); +static __inline__ _syscall0(int, __syscall_getegid); gid_t getegid(void) { return (__syscall_getegid()); diff --git a/libc/sysdeps/linux/common/geteuid.c b/libc/sysdeps/linux/common/geteuid.c index d10c350e4..60151214d 100644 --- a/libc/sysdeps/linux/common/geteuid.c +++ b/libc/sysdeps/linux/common/geteuid.c @@ -19,7 +19,7 @@ _syscall0(uid_t, geteuid); #elif defined(__NR_geteuid) # define __NR___syscall_geteuid __NR_geteuid -static inline _syscall0(int, __syscall_geteuid); +static __inline__ _syscall0(int, __syscall_geteuid); uid_t geteuid(void) { return (__syscall_geteuid()); diff --git a/libc/sysdeps/linux/common/getgroups.c b/libc/sysdeps/linux/common/getgroups.c index 10da03ddd..7e1604294 100644 --- a/libc/sysdeps/linux/common/getgroups.c +++ b/libc/sysdeps/linux/common/getgroups.c @@ -28,7 +28,7 @@ libc_hidden_proto(sysconf) #define MIN(a,b) (((a)<(b))?(a):(b)) #define __NR___syscall_getgroups __NR_getgroups -static inline _syscall2(int, __syscall_getgroups, +static __inline__ _syscall2(int, __syscall_getgroups, int, size, __kernel_gid_t *, list); int getgroups(int size, gid_t groups[]) diff --git a/libc/sysdeps/linux/common/getpgid.c b/libc/sysdeps/linux/common/getpgid.c index 49f780adf..25ff12907 100644 --- a/libc/sysdeps/linux/common/getpgid.c +++ b/libc/sysdeps/linux/common/getpgid.c @@ -13,7 +13,7 @@ #include <unistd.h> #define __NR___syscall_getpgid __NR_getpgid -static inline _syscall1(__kernel_pid_t, __syscall_getpgid, __kernel_pid_t, pid); +static __inline__ _syscall1(__kernel_pid_t, __syscall_getpgid, __kernel_pid_t, pid); pid_t getpgid(pid_t pid) { diff --git a/libc/sysdeps/linux/common/getpriority.c b/libc/sysdeps/linux/common/getpriority.c index b66b1ea15..bdfc723e6 100644 --- a/libc/sysdeps/linux/common/getpriority.c +++ b/libc/sysdeps/linux/common/getpriority.c @@ -13,7 +13,7 @@ libc_hidden_proto(getpriority) #define __NR___syscall_getpriority __NR_getpriority -static inline _syscall2(int, __syscall_getpriority, +static __inline__ _syscall2(int, __syscall_getpriority, __priority_which_t, which, id_t, who); /* The return value of __syscall_getpriority is biased by this value diff --git a/libc/sysdeps/linux/common/getresgid.c b/libc/sysdeps/linux/common/getresgid.c index 9c2d13ba9..922874a3d 100644 --- a/libc/sysdeps/linux/common/getresgid.c +++ b/libc/sysdeps/linux/common/getresgid.c @@ -18,7 +18,7 @@ _syscall3(int, getresgid, gid_t *, rgid, gid_t *, egid, gid_t *, sgid) #elif defined(__NR_getresgid) # define __NR___syscall_getresgid __NR_getresgid -static inline _syscall3(int, __syscall_getresgid, __kernel_gid_t *, rgid, +static __inline__ _syscall3(int, __syscall_getresgid, __kernel_gid_t *, rgid, __kernel_gid_t *, egid, __kernel_gid_t *, sgid); int getresgid(gid_t * rgid, gid_t * egid, gid_t * sgid) diff --git a/libc/sysdeps/linux/common/getresuid.c b/libc/sysdeps/linux/common/getresuid.c index dbc8df903..5a070cc42 100644 --- a/libc/sysdeps/linux/common/getresuid.c +++ b/libc/sysdeps/linux/common/getresuid.c @@ -18,7 +18,7 @@ _syscall3(int, getresuid, uid_t *, ruid, uid_t *, euid, uid_t *, suid) #elif defined(__NR_getresuid) # define __NR___syscall_getresuid __NR_getresuid -static inline _syscall3(int, __syscall_getresuid, __kernel_uid_t *, ruid, +static __inline__ _syscall3(int, __syscall_getresuid, __kernel_uid_t *, ruid, __kernel_uid_t *, euid, __kernel_uid_t *, suid); int getresuid(uid_t * ruid, uid_t * euid, uid_t * suid) diff --git a/libc/sysdeps/linux/common/getsid.c b/libc/sysdeps/linux/common/getsid.c index 398851873..9743a976f 100644 --- a/libc/sysdeps/linux/common/getsid.c +++ b/libc/sysdeps/linux/common/getsid.c @@ -14,7 +14,7 @@ libc_hidden_proto(getsid) #define __NR___syscall_getsid __NR_getsid -static inline _syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid); +static __inline__ _syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid); pid_t getsid(pid_t pid) { diff --git a/libc/sysdeps/linux/common/kill.c b/libc/sysdeps/linux/common/kill.c index 46eabf0c9..c7729113b 100644 --- a/libc/sysdeps/linux/common/kill.c +++ b/libc/sysdeps/linux/common/kill.c @@ -13,7 +13,7 @@ libc_hidden_proto(kill) #define __NR___syscall_kill __NR_kill -static inline _syscall2(int, __syscall_kill, __kernel_pid_t, pid, int, sig); +static __inline__ _syscall2(int, __syscall_kill, __kernel_pid_t, pid, int, sig); int kill(pid_t pid, int sig) { diff --git a/libc/sysdeps/linux/common/klogctl.c b/libc/sysdeps/linux/common/klogctl.c index 81451022e..e378e3e67 100644 --- a/libc/sysdeps/linux/common/klogctl.c +++ b/libc/sysdeps/linux/common/klogctl.c @@ -11,7 +11,7 @@ #include <unistd.h> #include <sys/klog.h> #define __NR__syslog __NR_syslog -static inline _syscall3(int, _syslog, int, type, char *, buf, int, len); +static __inline__ _syscall3(int, _syslog, int, type, char *, buf, int, len); int klogctl(int type, char *buf, int len) { return (_syslog(type, buf, len)); diff --git a/libc/sysdeps/linux/common/lchown.c b/libc/sysdeps/linux/common/lchown.c index 8095c941e..08c686fd6 100644 --- a/libc/sysdeps/linux/common/lchown.c +++ b/libc/sysdeps/linux/common/lchown.c @@ -22,7 +22,7 @@ _syscall3(int, lchown, const char *, path, uid_t, owner, gid_t, group); #else # define __NR___syscall_lchown __NR_lchown -static inline _syscall3(int, __syscall_lchown, const char *, path, +static __inline__ _syscall3(int, __syscall_lchown, const char *, path, __kernel_uid_t, owner, __kernel_gid_t, group); int lchown(const char *path, uid_t owner, gid_t group) diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c index ea72dc4f3..35365d8ae 100644 --- a/libc/sysdeps/linux/common/llseek.c +++ b/libc/sysdeps/linux/common/llseek.c @@ -18,14 +18,14 @@ extern __typeof(lseek64) __libc_lseek64; # ifndef INLINE_SYSCALL # define INLINE_SYSCALL(name, nr, args...) __syscall_llseek (args) # define __NR___syscall_llseek __NR__llseek -static inline _syscall5(int, __syscall_llseek, int, fd, off_t, offset_hi, +static __inline__ _syscall5(int, __syscall_llseek, int, fd, off_t, offset_hi, off_t, offset_lo, loff_t *, result, int, whence); # endif loff_t __libc_lseek64(int fd, loff_t offset, int whence) { loff_t result; - return(loff_t)(INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32), + return(loff_t)(INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32), (off_t) (offset & 0xffffffff), &result, whence) ?: result); } #else diff --git a/libc/sysdeps/linux/common/lstat.c b/libc/sysdeps/linux/common/lstat.c index 379ffd30d..4707dfc7c 100644 --- a/libc/sysdeps/linux/common/lstat.c +++ b/libc/sysdeps/linux/common/lstat.c @@ -21,7 +21,7 @@ libc_hidden_proto(lstat) #define __NR___syscall_lstat __NR_lstat -static inline _syscall2(int, __syscall_lstat, +static __inline__ _syscall2(int, __syscall_lstat, const char *, file_name, struct kernel_stat *, buf); int lstat(const char *file_name, struct stat *buf) diff --git a/libc/sysdeps/linux/common/lstat64.c b/libc/sysdeps/linux/common/lstat64.c index 1c392636f..6777dff6a 100644 --- a/libc/sysdeps/linux/common/lstat64.c +++ b/libc/sysdeps/linux/common/lstat64.c @@ -17,7 +17,7 @@ libc_hidden_proto(lstat64) # define __NR___syscall_lstat64 __NR_lstat64 -static inline _syscall2(int, __syscall_lstat64, const char *, file_name, +static __inline__ _syscall2(int, __syscall_lstat64, const char *, file_name, struct kernel_stat64 *, buf); int lstat64(const char *file_name, struct stat64 *buf) diff --git a/libc/sysdeps/linux/common/mkdir.c b/libc/sysdeps/linux/common/mkdir.c index 1d7238456..ab3cbfee5 100644 --- a/libc/sysdeps/linux/common/mkdir.c +++ b/libc/sysdeps/linux/common/mkdir.c @@ -13,7 +13,7 @@ libc_hidden_proto(mkdir) #define __NR___syscall_mkdir __NR_mkdir -static inline _syscall2(int, __syscall_mkdir, const char *, pathname, +static __inline__ _syscall2(int, __syscall_mkdir, const char *, pathname, __kernel_mode_t, mode); int mkdir(const char *pathname, mode_t mode) diff --git a/libc/sysdeps/linux/common/mknod.c b/libc/sysdeps/linux/common/mknod.c index 02b3822f8..75aff70c8 100644 --- a/libc/sysdeps/linux/common/mknod.c +++ b/libc/sysdeps/linux/common/mknod.c @@ -14,7 +14,7 @@ libc_hidden_proto(mknod) #define __NR___syscall_mknod __NR_mknod -static inline _syscall3(int, __syscall_mknod, const char *, path, +static __inline__ _syscall3(int, __syscall_mknod, const char *, path, __kernel_mode_t, mode, __kernel_dev_t, dev); int mknod(const char *path, mode_t mode, dev_t dev) diff --git a/libc/sysdeps/linux/common/mmap.c b/libc/sysdeps/linux/common/mmap.c index f40554ebb..7645565a2 100644 --- a/libc/sysdeps/linux/common/mmap.c +++ b/libc/sysdeps/linux/common/mmap.c @@ -24,7 +24,7 @@ _syscall6(void *, mmap, void *, start, size_t, length, #else # define __NR__mmap __NR_mmap -static inline _syscall1(__ptr_t, _mmap, unsigned long *, buffer); +static __inline__ _syscall1(__ptr_t, _mmap, unsigned long *, buffer); __ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset) { @@ -48,7 +48,7 @@ libc_hidden_def(mmap) libc_hidden_proto(mmap) #define __NR___syscall_mmap2 __NR_mmap2 -static inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, +static __inline__ _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, off_t, offset); /* Some architectures always use 12 as page shift for mmap2() eventhough the diff --git a/libc/sysdeps/linux/common/mmap64.c b/libc/sysdeps/linux/common/mmap64.c index 8c0518d1d..a1aa19fb8 100644 --- a/libc/sysdeps/linux/common/mmap64.c +++ b/libc/sysdeps/linux/common/mmap64.c @@ -41,7 +41,7 @@ __ptr_t mmap64(__ptr_t addr, size_t len, int prot, int flags, int fd, __off64_t # else # define __NR___syscall_mmap2 __NR_mmap2 -static inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, size_t, len, +static __inline__ _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, off_t, offset); /* Some architectures always use 12 as page shift for mmap2() eventhough the diff --git a/libc/sysdeps/linux/common/nice.c b/libc/sysdeps/linux/common/nice.c index 393ffef4e..8ced60915 100644 --- a/libc/sysdeps/linux/common/nice.c +++ b/libc/sysdeps/linux/common/nice.c @@ -17,7 +17,7 @@ libc_hidden_proto(getpriority) #ifdef __NR_nice # define __NR___syscall_nice __NR_nice -static inline _syscall1(int, __syscall_nice, int, incr); +static __inline__ _syscall1(int, __syscall_nice, int, incr); #else @@ -25,7 +25,7 @@ static inline _syscall1(int, __syscall_nice, int, incr); libc_hidden_proto(setpriority) -static inline int int_add_no_wrap(int a, int b) +static __inline__ int int_add_no_wrap(int a, int b) { int s = a + b; @@ -38,7 +38,7 @@ static inline int int_add_no_wrap(int a, int b) return s; } -static inline int __syscall_nice(int incr) +static __inline__ int __syscall_nice(int incr) { int old_priority; # if 1 diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c index b4bef3c63..7c0566b46 100644 --- a/libc/sysdeps/linux/common/open.c +++ b/libc/sysdeps/linux/common/open.c @@ -18,7 +18,7 @@ extern __typeof(open) __libc_open; extern __typeof(creat) __libc_creat; #define __NR___syscall_open __NR_open -static inline _syscall3(int, __syscall_open, const char *, file, +static __inline__ _syscall3(int, __syscall_open, const char *, file, int, flags, __kernel_mode_t, mode); libc_hidden_proto(__libc_open) diff --git a/libc/sysdeps/linux/common/pause.c b/libc/sysdeps/linux/common/pause.c index 22a039b4f..31d3563fb 100644 --- a/libc/sysdeps/linux/common/pause.c +++ b/libc/sysdeps/linux/common/pause.c @@ -10,19 +10,23 @@ #define __UCLIBC_HIDE_DEPRECATED__ #include <sys/syscall.h> #include <unistd.h> +#include <sysdep-cancel.h> -extern __typeof(pause) __libc_pause; -#ifdef __NR_pause -#define __NR___libc_pause __NR_pause -_syscall0(int, __libc_pause); -#else -#include <signal.h> -libc_hidden_proto(__sigpause) -libc_hidden_proto(sigblock) - -int __libc_pause(void) +/* Suspend the process until a signal arrives. + This always returns -1 and sets errno to EINTR. */ +int +__libc_pause (void) { - return (__sigpause(sigblock(0), 0)); + sigset_t set; + + __sigemptyset (&set); + sigprocmask (SIG_BLOCK, NULL, &set); + + /* pause is a cancellation point, but so is sigsuspend. + So no need for anything special here. */ + + return sigsuspend (&set); } -#endif -weak_alias(__libc_pause,pause) +weak_alias (__libc_pause, pause) + +LIBC_CANCEL_HANDLED (); /* sigsuspend handles our cancellation. */ diff --git a/libc/sysdeps/linux/common/posix_fadvise64.c b/libc/sysdeps/linux/common/posix_fadvise64.c index 7944c4985..5d8ed65b6 100644 --- a/libc/sysdeps/linux/common/posix_fadvise64.c +++ b/libc/sysdeps/linux/common/posix_fadvise64.c @@ -49,7 +49,7 @@ _syscall4(int, posix_fadvise64, int, fd, __off64_t, offset, #ifdef _syscall6 /* workaround until everyone has _syscall6() */ #define __NR___syscall_fadvise64_64 __NR_fadvise64_64 -static inline _syscall6(int, __syscall_fadvise64_64, int, fd, +static __inline__ _syscall6(int, __syscall_fadvise64_64, int, fd, unsigned long, high_offset, unsigned long, low_offset, unsigned long, high_len, unsigned long, low_len, int, advice); diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c index 3c0df19a3..b2aaa2a1d 100644 --- a/libc/sysdeps/linux/common/pread_write.c +++ b/libc/sysdeps/linux/common/pread_write.c @@ -30,7 +30,7 @@ extern __typeof(pwrite64) __libc_pwrite64; #ifdef __NR_pread # define __NR___syscall_pread __NR_pread -static inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf, +static __inline__ _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, off_t, offset_hi, off_t, offset_lo); ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) @@ -54,7 +54,7 @@ weak_alias(__libc_pread64,pread64) #ifdef __NR_pwrite # define __NR___syscall_pwrite __NR_pwrite -static inline _syscall5(ssize_t, __syscall_pwrite, int, fd, const void *, buf, +static __inline__ _syscall5(ssize_t, __syscall_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset_hi, off_t, offset_lo); ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) diff --git a/libc/sysdeps/linux/common/ptrace.c b/libc/sysdeps/linux/common/ptrace.c index 9d6767374..4f11260b8 100644 --- a/libc/sysdeps/linux/common/ptrace.c +++ b/libc/sysdeps/linux/common/ptrace.c @@ -12,7 +12,7 @@ #if defined __NR_ptrace && defined __USE_BSD && defined __USE_MISC #define __NR___syscall_ptrace __NR_ptrace -static inline _syscall4(long, __syscall_ptrace, enum __ptrace_request, request, +static __inline__ _syscall4(long, __syscall_ptrace, enum __ptrace_request, request, __kernel_pid_t, pid, void*, addr, void*, data); long int diff --git a/libc/sysdeps/linux/common/readahead.c b/libc/sysdeps/linux/common/readahead.c index ae7a57c44..94e2481cf 100644 --- a/libc/sysdeps/linux/common/readahead.c +++ b/libc/sysdeps/linux/common/readahead.c @@ -33,7 +33,7 @@ # if __WORDSIZE == 64 -static inline _syscall3(ssize_t, __readahead, int, fd, +static __inline__ _syscall3(ssize_t, __readahead, int, fd, off_t, offset, size_t, count); ssize_t readahead(int fd, off_t offset, size_t count) @@ -43,7 +43,7 @@ ssize_t readahead(int fd, off_t offset, size_t count) # else -static inline _syscall4(ssize_t, __readahead, int, fd, +static __inline__ _syscall4(ssize_t, __readahead, int, fd, off_t, high_offset, off_t, low_offset, size_t, count); ssize_t readahead(int fd, off64_t offset, size_t count) diff --git a/libc/sysdeps/linux/common/reboot.c b/libc/sysdeps/linux/common/reboot.c index 44828ce64..9ce57b1ec 100644 --- a/libc/sysdeps/linux/common/reboot.c +++ b/libc/sysdeps/linux/common/reboot.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <sys/reboot.h> #define __NR__reboot __NR_reboot -static inline _syscall3(int, _reboot, int, magic, int, magic2, int, flag); +static __inline__ _syscall3(int, _reboot, int, magic, int, magic2, int, flag); int reboot(int flag) { return (_reboot((int) 0xfee1dead, 672274793, flag)); diff --git a/libc/sysdeps/linux/common/rename.c b/libc/sysdeps/linux/common/rename.c index 7e88bf346..fd7318f02 100644 --- a/libc/sysdeps/linux/common/rename.c +++ b/libc/sysdeps/linux/common/rename.c @@ -14,7 +14,7 @@ #include <stdio.h> #define __NR___syscall_rename __NR_rename -static inline _syscall2(int, __syscall_rename, const char *, oldpath, +static __inline__ _syscall2(int, __syscall_rename, const char *, oldpath, const char *, newpath); int rename(const char * oldpath, const char * newpath) diff --git a/libc/sysdeps/linux/common/sched_getaffinity.c b/libc/sysdeps/linux/common/sched_getaffinity.c index b876cf932..5c801c68f 100644 --- a/libc/sysdeps/linux/common/sched_getaffinity.c +++ b/libc/sysdeps/linux/common/sched_getaffinity.c @@ -30,7 +30,7 @@ /* Experimentally off - libc_hidden_proto(memset) */ #define __NR___syscall_sched_getaffinity __NR_sched_getaffinity -static inline _syscall3(int, __syscall_sched_getaffinity, __kernel_pid_t, pid, +static __inline__ _syscall3(int, __syscall_sched_getaffinity, __kernel_pid_t, pid, size_t, cpusetsize, cpu_set_t *, cpuset); int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset) diff --git a/libc/sysdeps/linux/common/sched_getparam.c b/libc/sysdeps/linux/common/sched_getparam.c index 117c6baa2..af5ba6071 100644 --- a/libc/sysdeps/linux/common/sched_getparam.c +++ b/libc/sysdeps/linux/common/sched_getparam.c @@ -12,7 +12,7 @@ #include <sys/syscall.h> #define __NR___syscall_sched_getparam __NR_sched_getparam -static inline _syscall2(int, __syscall_sched_getparam, +static __inline__ _syscall2(int, __syscall_sched_getparam, __kernel_pid_t, pid, struct sched_param *, p); int sched_getparam(pid_t pid, struct sched_param *p) diff --git a/libc/sysdeps/linux/common/sched_getscheduler.c b/libc/sysdeps/linux/common/sched_getscheduler.c index 89ecdf911..9564da7fd 100644 --- a/libc/sysdeps/linux/common/sched_getscheduler.c +++ b/libc/sysdeps/linux/common/sched_getscheduler.c @@ -12,7 +12,7 @@ #include <sys/syscall.h> #define __NR___syscall_sched_getscheduler __NR_sched_getscheduler -static inline _syscall1(int, __syscall_sched_getscheduler, __kernel_pid_t, pid); +static __inline__ _syscall1(int, __syscall_sched_getscheduler, __kernel_pid_t, pid); int sched_getscheduler(pid_t pid) { diff --git a/libc/sysdeps/linux/common/sched_rr_get_interval.c b/libc/sysdeps/linux/common/sched_rr_get_interval.c index a87d27fd2..c59812d94 100644 --- a/libc/sysdeps/linux/common/sched_rr_get_interval.c +++ b/libc/sysdeps/linux/common/sched_rr_get_interval.c @@ -12,7 +12,7 @@ #include <sys/syscall.h> #define __NR___syscall_sched_rr_get_interval __NR_sched_rr_get_interval -static inline _syscall2(int, __syscall_sched_rr_get_interval, +static __inline__ _syscall2(int, __syscall_sched_rr_get_interval, __kernel_pid_t, pid, struct timespec *, tp); int sched_rr_get_interval(pid_t pid, struct timespec *tp) diff --git a/libc/sysdeps/linux/common/sched_setaffinity.c b/libc/sysdeps/linux/common/sched_setaffinity.c index a25fbe356..c687970f1 100644 --- a/libc/sysdeps/linux/common/sched_setaffinity.c +++ b/libc/sysdeps/linux/common/sched_setaffinity.c @@ -34,7 +34,7 @@ libc_hidden_proto(getpid) #define __NR___syscall_sched_setaffinity __NR_sched_setaffinity -static inline _syscall3(int, __syscall_sched_setaffinity, __kernel_pid_t, pid, +static __inline__ _syscall3(int, __syscall_sched_setaffinity, __kernel_pid_t, pid, size_t, cpusetsize, cpu_set_t *, cpuset); static size_t __kernel_cpumask_size; diff --git a/libc/sysdeps/linux/common/sched_setparam.c b/libc/sysdeps/linux/common/sched_setparam.c index 94a3cee54..1e1f8cf2d 100644 --- a/libc/sysdeps/linux/common/sched_setparam.c +++ b/libc/sysdeps/linux/common/sched_setparam.c @@ -12,7 +12,7 @@ #include <sys/syscall.h> #define __NR___syscall_sched_setparam __NR_sched_setparam -static inline _syscall2(int, __syscall_sched_setparam, +static __inline__ _syscall2(int, __syscall_sched_setparam, __kernel_pid_t, pid, const struct sched_param *, p); int sched_setparam(pid_t pid, const struct sched_param *p) diff --git a/libc/sysdeps/linux/common/sched_setscheduler.c b/libc/sysdeps/linux/common/sched_setscheduler.c index 05ada79e5..fe2630871 100644 --- a/libc/sysdeps/linux/common/sched_setscheduler.c +++ b/libc/sysdeps/linux/common/sched_setscheduler.c @@ -12,7 +12,7 @@ #include <sys/syscall.h> #define __NR___syscall_sched_setscheduler __NR_sched_setscheduler -static inline _syscall3(int, __syscall_sched_setscheduler, +static __inline__ _syscall3(int, __syscall_sched_setscheduler, __kernel_pid_t, pid, int, policy, const struct sched_param *, p); int sched_setscheduler(pid_t pid, int policy, const struct sched_param *p) diff --git a/libc/sysdeps/linux/common/sendfile64.c b/libc/sysdeps/linux/common/sendfile64.c index ccaa8d202..29cff5ec5 100644 --- a/libc/sysdeps/linux/common/sendfile64.c +++ b/libc/sysdeps/linux/common/sendfile64.c @@ -5,7 +5,7 @@ */ /* sendfile64 syscall. Copes with 64 bit and 32 bit machines * and on 32 bit machines this sends things into the kernel as - * two 32-bit arguments (high and low 32 bits of length) that + * two 32-bit arguments (high and low 32 bits of length) that * are ordered based on endianess. It turns out endian.h has * just the macro we need to order things, __LONG_LONG_PAIR. */ diff --git a/libc/sysdeps/linux/common/setfsgid.c b/libc/sysdeps/linux/common/setfsgid.c index b35006306..de005e28d 100644 --- a/libc/sysdeps/linux/common/setfsgid.c +++ b/libc/sysdeps/linux/common/setfsgid.c @@ -22,7 +22,7 @@ _syscall1(int, setfsgid, gid_t, gid); #else # define __NR___syscall_setfsgid __NR_setfsgid -static inline _syscall1(int, __syscall_setfsgid, __kernel_gid_t, gid); +static __inline__ _syscall1(int, __syscall_setfsgid, __kernel_gid_t, gid); int setfsgid(gid_t gid) { diff --git a/libc/sysdeps/linux/common/setfsuid.c b/libc/sysdeps/linux/common/setfsuid.c index d302ad48c..698117a1a 100644 --- a/libc/sysdeps/linux/common/setfsuid.c +++ b/libc/sysdeps/linux/common/setfsuid.c @@ -22,7 +22,7 @@ _syscall1(int, setfsuid, uid_t, uid); #else # define __NR___syscall_setfsuid __NR_setfsuid -static inline _syscall1(int, __syscall_setfsuid, __kernel_uid_t, uid); +static __inline__ _syscall1(int, __syscall_setfsuid, __kernel_uid_t, uid); int setfsuid(uid_t uid) { diff --git a/libc/sysdeps/linux/common/setgid.c b/libc/sysdeps/linux/common/setgid.c index 4a924a047..37175cd7c 100644 --- a/libc/sysdeps/linux/common/setgid.c +++ b/libc/sysdeps/linux/common/setgid.c @@ -22,7 +22,7 @@ _syscall1(int, setgid, gid_t, gid); #else # define __NR___syscall_setgid __NR_setgid -static inline _syscall1(int, __syscall_setgid, __kernel_gid_t, gid); +static __inline__ _syscall1(int, __syscall_setgid, __kernel_gid_t, gid); int setgid(gid_t gid) { diff --git a/libc/sysdeps/linux/common/setgroups.c b/libc/sysdeps/linux/common/setgroups.c index eb5245d59..3c77250d0 100644 --- a/libc/sysdeps/linux/common/setgroups.c +++ b/libc/sysdeps/linux/common/setgroups.c @@ -29,7 +29,7 @@ _syscall2(int, setgroups, size_t, size, const gid_t *, list); libc_hidden_proto(sysconf) #define __NR___syscall_setgroups __NR_setgroups -static inline _syscall2(int, __syscall_setgroups, +static __inline__ _syscall2(int, __syscall_setgroups, size_t, size, const __kernel_gid_t *, list); int setgroups(size_t size, const gid_t *groups) diff --git a/libc/sysdeps/linux/common/setpgid.c b/libc/sysdeps/linux/common/setpgid.c index 3447b999d..f91908ded 100644 --- a/libc/sysdeps/linux/common/setpgid.c +++ b/libc/sysdeps/linux/common/setpgid.c @@ -15,7 +15,7 @@ libc_hidden_proto(setpgid) #define __NR___syscall_setpgid __NR_setpgid -static inline _syscall2(int, __syscall_setpgid, +static __inline__ _syscall2(int, __syscall_setpgid, __kernel_pid_t, pid, __kernel_pid_t, pgid); int setpgid(pid_t pid, pid_t pgid) diff --git a/libc/sysdeps/linux/common/setregid.c b/libc/sysdeps/linux/common/setregid.c index d56c01f64..3fe95d9d0 100644 --- a/libc/sysdeps/linux/common/setregid.c +++ b/libc/sysdeps/linux/common/setregid.c @@ -24,7 +24,7 @@ _syscall2(int, setregid, gid_t, rgid, gid_t, egid); #else # define __NR___syscall_setregid __NR_setregid -static inline _syscall2(int, __syscall_setregid, +static __inline__ _syscall2(int, __syscall_setregid, __kernel_gid_t, rgid, __kernel_gid_t, egid); int setregid(gid_t rgid, gid_t egid) diff --git a/libc/sysdeps/linux/common/setresgid.c b/libc/sysdeps/linux/common/setresgid.c index 3bb54e3aa..13e4b1d6d 100644 --- a/libc/sysdeps/linux/common/setresgid.c +++ b/libc/sysdeps/linux/common/setresgid.c @@ -22,7 +22,7 @@ libc_hidden_def(setresgid) #elif defined(__NR_setresgid) # define __NR___syscall_setresgid __NR_setresgid -static inline _syscall3(int, __syscall_setresgid, +static __inline__ _syscall3(int, __syscall_setresgid, __kernel_gid_t, rgid, __kernel_gid_t, egid, __kernel_gid_t, sgid); libc_hidden_proto(setresgid) diff --git a/libc/sysdeps/linux/common/setresuid.c b/libc/sysdeps/linux/common/setresuid.c index 54b92465c..764b90523 100644 --- a/libc/sysdeps/linux/common/setresuid.c +++ b/libc/sysdeps/linux/common/setresuid.c @@ -22,7 +22,7 @@ libc_hidden_def(setresuid) #elif defined(__NR_setresuid) # define __NR___syscall_setresuid __NR_setresuid -static inline _syscall3(int, __syscall_setresuid, +static __inline__ _syscall3(int, __syscall_setresuid, __kernel_uid_t, rgid, __kernel_uid_t, egid, __kernel_uid_t, sgid); libc_hidden_proto(setresuid) diff --git a/libc/sysdeps/linux/common/setreuid.c b/libc/sysdeps/linux/common/setreuid.c index 7f908a333..bca7f8f43 100644 --- a/libc/sysdeps/linux/common/setreuid.c +++ b/libc/sysdeps/linux/common/setreuid.c @@ -24,7 +24,7 @@ _syscall2(int, setreuid, uid_t, ruid, uid_t, euid); #else # define __NR___syscall_setreuid __NR_setreuid -static inline _syscall2(int, __syscall_setreuid, +static __inline__ _syscall2(int, __syscall_setreuid, __kernel_uid_t, ruid, __kernel_uid_t, euid); int setreuid(uid_t ruid, uid_t euid) diff --git a/libc/sysdeps/linux/common/setuid.c b/libc/sysdeps/linux/common/setuid.c index 4036a3d09..32a4cd79e 100644 --- a/libc/sysdeps/linux/common/setuid.c +++ b/libc/sysdeps/linux/common/setuid.c @@ -22,7 +22,7 @@ _syscall1(int, setuid, uid_t, uid); #else # define __NR___syscall_setuid __NR_setuid -static inline _syscall1(int, __syscall_setuid, __kernel_uid_t, uid); +static __inline__ _syscall1(int, __syscall_setuid, __kernel_uid_t, uid); int setuid(uid_t uid) { diff --git a/libc/sysdeps/linux/common/sigpending.c b/libc/sysdeps/linux/common/sigpending.c index fa272c0f5..0a74afaa4 100644 --- a/libc/sysdeps/linux/common/sigpending.c +++ b/libc/sysdeps/linux/common/sigpending.c @@ -15,7 +15,7 @@ #ifdef __NR_rt_sigpending # define __NR___rt_sigpending __NR_rt_sigpending -static inline _syscall2(int, __rt_sigpending, sigset_t *, set, size_t, size); +static __inline__ _syscall2(int, __rt_sigpending, sigset_t *, set, size_t, size); int sigpending(sigset_t * set) { diff --git a/libc/sysdeps/linux/common/sigqueue.c b/libc/sysdeps/linux/common/sigqueue.c index 5d8e852fe..2bff597c1 100644 --- a/libc/sysdeps/linux/common/sigqueue.c +++ b/libc/sysdeps/linux/common/sigqueue.c @@ -31,7 +31,7 @@ libc_hidden_proto(getuid) #ifdef __NR_rt_sigqueueinfo # define __NR___libc_rt_sigqueueinfo __NR_rt_sigqueueinfo -static inline _syscall3(int, __libc_rt_sigqueueinfo, pid_t, pid, int, sig, void*, value); +static __inline__ _syscall3(int, __libc_rt_sigqueueinfo, pid_t, pid, int, sig, void*, value); /* Return any pending signal or wait for one for the given time. */ int sigqueue (pid_t pid, int sig, const union sigval val) diff --git a/libc/sysdeps/linux/common/stat.c b/libc/sysdeps/linux/common/stat.c index bbb070dbe..78211334e 100644 --- a/libc/sysdeps/linux/common/stat.c +++ b/libc/sysdeps/linux/common/stat.c @@ -22,7 +22,7 @@ libc_hidden_proto(stat) #define __NR___syscall_stat __NR_stat #undef stat -static inline _syscall2(int, __syscall_stat, +static __inline__ _syscall2(int, __syscall_stat, const char *, file_name, struct kernel_stat *, buf); int stat(const char *file_name, struct stat *buf) diff --git a/libc/sysdeps/linux/common/stat64.c b/libc/sysdeps/linux/common/stat64.c index 1ef39de4a..1a0865686 100644 --- a/libc/sysdeps/linux/common/stat64.c +++ b/libc/sysdeps/linux/common/stat64.c @@ -18,7 +18,7 @@ libc_hidden_proto(stat64) # include <sys/stat.h> # include "xstatconv.h" -static inline _syscall2(int, __syscall_stat64, +static __inline__ _syscall2(int, __syscall_stat64, const char *, file_name, struct kernel_stat64 *, buf); int stat64(const char *file_name, struct stat64 *buf) diff --git a/libc/sysdeps/linux/common/sync.c b/libc/sysdeps/linux/common/sync.c index dd69e335b..d2f81229c 100644 --- a/libc/sysdeps/linux/common/sync.c +++ b/libc/sysdeps/linux/common/sync.c @@ -14,8 +14,8 @@ #ifndef INLINE_SYSCALL #define INLINE_SYSCALL(name, nr, args...) __syscall_sync (args) -#define __NR___syscall_sync __NR_sync -static inline _syscall0(void, __syscall_sync); +#define __NR___syscall_sync __NR_sync +static __inline__ _syscall0(void, __syscall_sync); #endif void sync(void) diff --git a/libc/sysdeps/linux/common/truncate64.c b/libc/sysdeps/linux/common/truncate64.c index 53c46fc56..d4a1798fe 100644 --- a/libc/sysdeps/linux/common/truncate64.c +++ b/libc/sysdeps/linux/common/truncate64.c @@ -5,7 +5,7 @@ */ /* truncate64 syscall. Copes with 64 bit and 32 bit machines * and on 32 bit machines this sends things into the kernel as - * two 32-bit arguments (high and low 32 bits of length) that + * two 32-bit arguments (high and low 32 bits of length) that * are ordered based on endianess. It turns out endian.h has * just the macro we need to order things, __LONG_LONG_PAIR. */ @@ -33,10 +33,10 @@ _syscall2(int, truncate64, const char *, path, __off64_t, length); #define INLINE_SYSCALL(name, nr, args...) __syscall_truncate64 (args) #define __NR___syscall_truncate64 __NR_truncate64 #if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__) -static inline _syscall4(int, __syscall_truncate64, const char *, path, +static __inline__ _syscall4(int, __syscall_truncate64, const char *, path, uint32_t, pad, unsigned long, high_length, unsigned long, low_length); #else -static inline _syscall3(int, __syscall_truncate64, const char *, path, +static __inline__ _syscall3(int, __syscall_truncate64, const char *, path, unsigned long, high_length, unsigned long, low_length); #endif #endif diff --git a/libc/sysdeps/linux/common/umask.c b/libc/sysdeps/linux/common/umask.c index 24297e07e..01a7b9eb3 100644 --- a/libc/sysdeps/linux/common/umask.c +++ b/libc/sysdeps/linux/common/umask.c @@ -11,7 +11,7 @@ #include <sys/stat.h> #define __NR___syscall_umask __NR_umask -static inline _syscall1(__kernel_mode_t, __syscall_umask, __kernel_mode_t, mode); +static __inline__ _syscall1(__kernel_mode_t, __syscall_umask, __kernel_mode_t, mode); mode_t umask(mode_t mode) { diff --git a/libc/sysdeps/linux/common/umount.c b/libc/sysdeps/linux/common/umount.c index c62f9fb7c..9090696d5 100644 --- a/libc/sysdeps/linux/common/umount.c +++ b/libc/sysdeps/linux/common/umount.c @@ -21,7 +21,7 @@ _syscall1(int, umount, const char *, specialfile); #elif defined __NR_umount2 # define __NR___syscall_umount2 __NR_umount2 -static inline _syscall2(int, __syscall_umount2, const char *, special_file, int, flags); +static __inline__ _syscall2(int, __syscall_umount2, const char *, special_file, int, flags); int umount(const char *special_file) { diff --git a/libc/sysdeps/linux/common/ustat.c b/libc/sysdeps/linux/common/ustat.c index 27cfa95ad..578763cb5 100644 --- a/libc/sysdeps/linux/common/ustat.c +++ b/libc/sysdeps/linux/common/ustat.c @@ -12,7 +12,7 @@ #include <sys/sysmacros.h> #define __NR___syscall_ustat __NR_ustat -static inline _syscall2(int, __syscall_ustat, +static __inline__ _syscall2(int, __syscall_ustat, unsigned short int, kdev_t, struct ustat *, ubuf); int ustat(dev_t dev, struct ustat *ubuf) diff --git a/libc/sysdeps/linux/common/wait4.c b/libc/sysdeps/linux/common/wait4.c index ff3b82645..5c51116fa 100644 --- a/libc/sysdeps/linux/common/wait4.c +++ b/libc/sysdeps/linux/common/wait4.c @@ -15,7 +15,7 @@ libc_hidden_proto(wait4) #define __NR___syscall_wait4 __NR_wait4 -static inline _syscall4(int, __syscall_wait4, __kernel_pid_t, pid, +static __inline__ _syscall4(int, __syscall_wait4, __kernel_pid_t, pid, int *, status, int, opts, struct rusage *, rusage); pid_t wait4(pid_t pid, int *status, int opts, struct rusage *rusage) diff --git a/libc/sysdeps/linux/common/xattr.c b/libc/sysdeps/linux/common/xattr.c index 0ba17cde7..5b4c2f5bf 100644 --- a/libc/sysdeps/linux/common/xattr.c +++ b/libc/sysdeps/linux/common/xattr.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2004 <solar@gentoo.org> * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * diff --git a/libc/sysdeps/linux/cris/bits/syscalls.h b/libc/sysdeps/linux/cris/bits/syscalls.h index d44e79ca2..93e7cf2d9 100644 --- a/libc/sysdeps/linux/cris/bits/syscalls.h +++ b/libc/sysdeps/linux/cris/bits/syscalls.h @@ -44,7 +44,7 @@ return (type) (INLINE_SYSCALL(name, 3, arg1, arg2, arg3)); \ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ { \ return (type) (INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4)); \ -} +} #undef _syscall5 #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ diff --git a/libc/sysdeps/linux/e1/bits/fenv.h b/libc/sysdeps/linux/e1/bits/fenv.h index dde6aceaa..beeea3d51 100644 --- a/libc/sysdeps/linux/e1/bits/fenv.h +++ b/libc/sysdeps/linux/e1/bits/fenv.h @@ -36,7 +36,7 @@ enum #define FE_OVERFLOW FE_OVERFLOW FE_DIVBYZERO = (1 << 11), #define FE_DIVBYZERO FE_DIVBYZERO - FE_INVALID = (1 << 12) + FE_INVALID = (1 << 12) #define FE_INVALID FE_INVALID }; diff --git a/libc/sysdeps/linux/e1/bits/fenvinline.h b/libc/sysdeps/linux/e1/bits/fenvinline.h index cce266131..a16fc0fb2 100644 --- a/libc/sysdeps/linux/e1/bits/fenvinline.h +++ b/libc/sysdeps/linux/e1/bits/fenvinline.h @@ -1,4 +1,4 @@ -/* +/* Inline floating-point environment handling functions for Hyperstone e1-32X. Copyright (C) 2002-2003, George Thanos <george.thanos@gdt.gr> Yannis Mitsos <yannis.mitsos@gdt.gr> @@ -22,9 +22,9 @@ #if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_MATH_INLINES -/********************************************************** +/********************************************************** * --- A small description of the E1-16/32X FP unit. --- - * FP exceptions can be enabled and disabled through + * FP exceptions can be enabled and disabled through * <feenableexcept>, <fedisableexcept>. * * - When an enabled exception takes place a SIGFPE signal @@ -37,7 +37,7 @@ * a trap. The user can check if any exception took place after * an FP instruction by issuing an <fetestexcept> command. * User should first clear the G2 register by issuing an - * <feclearexcept> function. + * <feclearexcept> function. * The following program is a typical example of how the user * should check for exceptions that did not generate a SIGFPE * signal : @@ -49,7 +49,7 @@ * raised = fetestexcept (FE_OVERFLOW | FE_INVALID); * if (raised & FE_OVERFLOW) { ... } * if (raised & FE_INVALID) { ... } - * ... + * ... * } ***********************************************************/ @@ -92,7 +92,7 @@ /* The following functions test for accrued exceptions. * No trap is generated on an FP exception. */ -static inline feclearexcept(int __excepts) +static __inline__ feclearexcept(int __excepts) { unsigned int enabled_excepts, disabled_excepts; @@ -102,7 +102,7 @@ static inline feclearexcept(int __excepts) __asm__ __volatile__("mov %0, SR" :"=l"(enabled_excepts) - :/*no input*/ ); + :/*no input*/ ); enabled_excepts &= 0x1F00; disabled_excepts = ~enabled_excepts; @@ -123,9 +123,9 @@ static inline feclearexcept(int __excepts) /* fetestexcepts tests both for actual and accrued * excepts. You can test for an exception either after * an FP instruction or within a SIGFPE handler - */ + */ inline int fetestexcept(int __excepts) -{ +{ unsigned int G2, G2en, G2dis; unsigned int enabled_excepts, disabled_excepts; @@ -135,7 +135,7 @@ inline int fetestexcept(int __excepts) __asm__ __volatile__("mov %0, SR" :"=l"(enabled_excepts) - :/*no input*/ ); + :/*no input*/ ); enabled_excepts &= 0x1F00; disabled_excepts = ~enabled_excepts; @@ -152,7 +152,7 @@ inline int fetestexcept(int __excepts) return ( G2en | (G2dis << 8) ); } -static inline int feraiseexcept(int __excepts) +static __inline__ int feraiseexcept(int __excepts) { __asm__ __volatile__("or G2, %0" :/*no output*/ @@ -218,7 +218,7 @@ static inline int feraiseexcept(int __excepts) (__retval); \ }) -static inline int fegetexcept(int excepts) +static __inline__ int fegetexcept(int excepts) { unsigned int tmp; __asm__ __volatile__("mov %0, SR" @@ -228,7 +228,7 @@ static inline int fegetexcept(int excepts) return tmp; } -static inline int fegetenv(fenv_t *envp) +static __inline__ int fegetenv(fenv_t *envp) { __asm__ __volatile__("mov %0, SR\n\t mov %1, SR\n\t @@ -273,7 +273,7 @@ static inline int fegetenv(fenv_t *envp) :"l"( envp->actual_except ) ); \ (0); /* return 0 */ \ }) - + #define feupdateenv(envp) \ ({ \ /* Clear FRM & FTE field of SR */ \ @@ -292,7 +292,7 @@ static inline int fegetenv(fenv_t *envp) :"l"( envp->actual_except ) ); \ (0); /* return 0 */ \ }) - + #endif /* __GNUC__ && !_SOFT_FLOAT */ diff --git a/libc/sysdeps/linux/e1/bits/kernel_stat.h b/libc/sysdeps/linux/e1/bits/kernel_stat.h index 908a153d8..9be9d115d 100644 --- a/libc/sysdeps/linux/e1/bits/kernel_stat.h +++ b/libc/sysdeps/linux/e1/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ struct kernel_stat { diff --git a/libc/sysdeps/linux/e1/bits/kernel_types.h b/libc/sysdeps/linux/e1/bits/kernel_types.h index 513009d8f..8017d8578 100644 --- a/libc/sysdeps/linux/e1/bits/kernel_types.h +++ b/libc/sysdeps/linux/e1/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/e1/longjmp.c b/libc/sysdeps/linux/e1/longjmp.c index fbd5103a4..9f04e7b5c 100644 --- a/libc/sysdeps/linux/e1/longjmp.c +++ b/libc/sysdeps/linux/e1/longjmp.c @@ -12,7 +12,7 @@ #include <signal.h> #define __NR_e1newSP 224 -static inline _syscall1(int, e1newSP, unsigned long, SavedSP ) +static __inline__ _syscall1(int, e1newSP, unsigned long, SavedSP ) unsigned long jmpbuf_ptr; @@ -23,7 +23,7 @@ void longjmp(jmp_buf state, int value ) else state->__jmpbuf->ReturnValue = value; - jmpbuf_ptr = (unsigned long)state; + jmpbuf_ptr = (unsigned long)state; e1newSP(state->__jmpbuf->SavedSP); #define _state_ ((struct __jmp_buf_tag*)jmpbuf_ptr) @@ -55,9 +55,9 @@ void siglongjmp(sigjmp_buf state, int value ) else state->__jmpbuf->ReturnValue = value; - jmpbuf_ptr = (unsigned long)state; + jmpbuf_ptr = (unsigned long)state; e1newSP(state->__jmpbuf->SavedSP); - + #define _state_ ((struct __jmp_buf_tag*)jmpbuf_ptr) __asm__ __volatile__("mov L0, %0\n\t" diff --git a/libc/sysdeps/linux/e1/setjmp.c b/libc/sysdeps/linux/e1/setjmp.c index 3a3f3b7e8..bda18b13a 100644 --- a/libc/sysdeps/linux/e1/setjmp.c +++ b/libc/sysdeps/linux/e1/setjmp.c @@ -11,11 +11,11 @@ libc_hidden_proto(sigprocmask) int setjmp( jmp_buf state) { - __asm__ __volatile__( "mov %0, G3\n\t" - "mov %1, G4\n\t" - :"=l"(state->__jmpbuf->G3), - "=l"(state->__jmpbuf->G4) - :/*no input*/ + __asm__ __volatile__( "mov %0, G3\n\t" + "mov %1, G4\n\t" + :"=l"(state->__jmpbuf->G3), + "=l"(state->__jmpbuf->G4) + :/*no input*/ :"%G3", "%G4" ); __asm__ __volatile__( "setadr %0\n\t" @@ -38,11 +38,11 @@ int sigsetjmp( sigjmp_buf state , int savesigs) } else state->__mask_was_saved = 0; - __asm__ __volatile__( "mov %0, G3\n\t" - "mov %1, G4\n\t" - :"=l"(state->__jmpbuf->G3), - "=l"(state->__jmpbuf->G4) - :/*no input*/ + __asm__ __volatile__( "mov %0, G3\n\t" + "mov %1, G4\n\t" + :"=l"(state->__jmpbuf->G3), + "=l"(state->__jmpbuf->G4) + :/*no input*/ :"%G3", "%G4" ); __asm__ __volatile__( "setadr %0\n\t" diff --git a/libc/sysdeps/linux/frv/bits/elf-fdpic.h b/libc/sysdeps/linux/frv/bits/elf-fdpic.h index 0dbb54b4c..905648054 100644 --- a/libc/sysdeps/linux/frv/bits/elf-fdpic.h +++ b/libc/sysdeps/linux/frv/bits/elf-fdpic.h @@ -103,7 +103,7 @@ __reloc_pointer (void *p, || (offset == map->segs[c].p_memsz && c + 1 == map->nsegs)) return (char*)map->segs[c].addr + offset; } - + /* We might want to crash instead. */ return (void*)-1; } diff --git a/libc/sysdeps/linux/frv/bits/kernel_stat.h b/libc/sysdeps/linux/frv/bits/kernel_stat.h index 51cb57eda..8b80a2608 100644 --- a/libc/sysdeps/linux/frv/bits/kernel_stat.h +++ b/libc/sysdeps/linux/frv/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ struct kernel_stat { diff --git a/libc/sysdeps/linux/frv/bits/kernel_types.h b/libc/sysdeps/linux/frv/bits/kernel_types.h index 3d3f6304c..8403fd3e8 100644 --- a/libc/sysdeps/linux/frv/bits/kernel_types.h +++ b/libc/sysdeps/linux/frv/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/frv/crtreloc.c b/libc/sysdeps/linux/frv/crtreloc.c index 1a86728a3..e025b619f 100644 --- a/libc/sysdeps/linux/frv/crtreloc.c +++ b/libc/sysdeps/linux/frv/crtreloc.c @@ -70,7 +70,7 @@ __self_reloc (const struct elf32_fdpic_loadmap *map, if (p >= e) return (void*)-1; - + return __reloc_pointer (*p, map); } diff --git a/libc/sysdeps/linux/frv/mmap.c b/libc/sysdeps/linux/frv/mmap.c index d4cfcb062..f251babbb 100644 --- a/libc/sysdeps/linux/frv/mmap.c +++ b/libc/sysdeps/linux/frv/mmap.c @@ -32,7 +32,7 @@ libc_hidden_proto(mmap) #define __NR___syscall_mmap2 __NR_mmap2 -static inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, +static __inline__ _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, off_t, offset); /* This is always 12, even on architectures where PAGE_SHIFT != 12. */ diff --git a/libc/sysdeps/linux/h8300/bits/kernel_stat.h b/libc/sysdeps/linux/h8300/bits/kernel_stat.h index f589b1f66..9468292e5 100644 --- a/libc/sysdeps/linux/h8300/bits/kernel_stat.h +++ b/libc/sysdeps/linux/h8300/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ struct kernel_stat { diff --git a/libc/sysdeps/linux/h8300/bits/syscalls.h b/libc/sysdeps/linux/h8300/bits/syscalls.h index 8ef399fd7..5867ed608 100644 --- a/libc/sysdeps/linux/h8300/bits/syscalls.h +++ b/libc/sysdeps/linux/h8300/bits/syscalls.h @@ -2,8 +2,8 @@ * this file must be able to cope with PIC and non-PIC code. For some arches * there is no difference. For x86 (which has far too few registers) there is * a difference. Regardless, including asm/unistd.h is hereby officially - * forbidden. Don't do it. It is bad for you. - */ + * forbidden. Don't do it. It is bad for you. + */ #ifndef _SYSCALL_H # error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead." #endif diff --git a/libc/sysdeps/linux/hppa/bits/kernel_stat.h b/libc/sysdeps/linux/hppa/bits/kernel_stat.h index 51b5b0748..e4d784e91 100644 --- a/libc/sysdeps/linux/hppa/bits/kernel_stat.h +++ b/libc/sysdeps/linux/hppa/bits/kernel_stat.h @@ -1,4 +1,4 @@ -/* Ripped from linux/include/asm-parisc/stat.h +/* Ripped from linux/include/asm-parisc/stat.h * and renamed 'struct stat' to 'struct kernel_stat' */ #ifndef _PARISC_STAT_H diff --git a/libc/sysdeps/linux/hppa/bits/kernel_types.h b/libc/sysdeps/linux/hppa/bits/kernel_types.h index cf219dce1..4441f9b29 100644 --- a/libc/sysdeps/linux/hppa/bits/kernel_types.h +++ b/libc/sysdeps/linux/hppa/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/hppa/syscall.c b/libc/sysdeps/linux/hppa/syscall.c index 04e80b2b2..cd11e084e 100644 --- a/libc/sysdeps/linux/hppa/syscall.c +++ b/libc/sysdeps/linux/hppa/syscall.c @@ -26,8 +26,8 @@ INTERNAL_SYSCALL, and all the generated pure assembly syscall wrappers. How often the function is used is unknown. */ -long int -syscall (long int __sysno, ...) +long int +syscall (long int __sysno, ...) { /* FIXME: Keep this matching INLINE_SYSCALL for hppa */ va_list args; @@ -43,7 +43,7 @@ syscall (long int __sysno, ...) arg4 = va_arg (args, long int); arg5 = va_arg (args, long int); va_end (args); - + { register unsigned long int __res __asm__("r28"); K_LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5) diff --git a/libc/sysdeps/linux/i386/bits/atomic.h b/libc/sysdeps/linux/i386/bits/atomic.h index 33279af5f..a20f424f8 100644 --- a/libc/sysdeps/linux/i386/bits/atomic.h +++ b/libc/sysdeps/linux/i386/bits/atomic.h @@ -60,21 +60,21 @@ typedef uintmax_t uatomic_max_t; #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgb %b2, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "cmpxchgb %b2, %1" \ : "=a" (ret), "=m" (*mem) \ : "q" (newval), "m" (*mem), "0" (oldval)); \ ret; }) #define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgw %w2, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "cmpxchgw %w2, %1" \ : "=a" (ret), "=m" (*mem) \ : "r" (newval), "m" (*mem), "0" (oldval)); \ ret; }) #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgl %2, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "cmpxchgl %2, %1" \ : "=a" (ret), "=m" (*mem) \ : "r" (newval), "m" (*mem), "0" (oldval)); \ ret; }) @@ -92,7 +92,7 @@ typedef uintmax_t uatomic_max_t; # ifdef __PIC__ # define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ ({ __typeof (*mem) ret; \ - __asm __volatile ("xchgl %2, %%ebx\n\t" \ + __asm__ __volatile__ ("xchgl %2, %%ebx\n\t" \ LOCK_PREFIX "cmpxchg8b %1\n\t" \ "xchgl %2, %%ebx" \ : "=A" (ret), "=m" (*mem) \ @@ -106,7 +106,7 @@ typedef uintmax_t uatomic_max_t; # else # define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchg8b %1" \ + __asm__ __volatile__ (LOCK_PREFIX "cmpxchg8b %1" \ : "=A" (ret), "=m" (*mem) \ : "b" (((unsigned long long int) (newval)) \ & 0xffffffff), \ @@ -123,15 +123,15 @@ typedef uintmax_t uatomic_max_t; #define atomic_exchange_acq(mem, newvalue) \ ({ __typeof (*mem) result; \ if (sizeof (*mem) == 1) \ - __asm __volatile ("xchgb %b0, %1" \ + __asm__ __volatile__ ("xchgb %b0, %1" \ : "=r" (result), "=m" (*mem) \ : "0" (newvalue), "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile ("xchgw %w0, %1" \ + __asm__ __volatile__ ("xchgw %w0, %1" \ : "=r" (result), "=m" (*mem) \ : "0" (newvalue), "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile ("xchgl %0, %1" \ + __asm__ __volatile__ ("xchgl %0, %1" \ : "=r" (result), "=m" (*mem) \ : "0" (newvalue), "m" (*mem)); \ else \ @@ -146,15 +146,15 @@ typedef uintmax_t uatomic_max_t; ({ __typeof (*mem) __result; \ __typeof (value) __addval = (value); \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "xaddb %b0, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "xaddb %b0, %1" \ : "=r" (__result), "=m" (*mem) \ : "0" (__addval), "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "xaddw %w0, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "xaddw %w0, %1" \ : "=r" (__result), "=m" (*mem) \ : "0" (__addval), "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "xaddl %0, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "xaddl %0, %1" \ : "=r" (__result), "=m" (*mem) \ : "0" (__addval), "m" (*mem)); \ else \ @@ -176,15 +176,15 @@ typedef uintmax_t uatomic_max_t; else if (__builtin_constant_p (value) && (value) == -1) \ atomic_decrement (mem); \ else if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "addb %b1, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "addb %b1, %0" \ : "=m" (*mem) \ : "ir" (value), "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "addw %w1, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "addw %w1, %0" \ : "=m" (*mem) \ : "ir" (value), "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "addl %1, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "addl %1, %0" \ : "=m" (*mem) \ : "ir" (value), "m" (*mem)); \ else \ @@ -204,15 +204,15 @@ typedef uintmax_t uatomic_max_t; #define atomic_add_negative(mem, value) \ ({ unsigned char __result; \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "addb %b2, %0; sets %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addb %b2, %0; sets %1" \ : "=m" (*mem), "=qm" (__result) \ : "iq" (value), "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "addw %w2, %0; sets %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addw %w2, %0; sets %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" (value), "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "addl %2, %0; sets %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addl %2, %0; sets %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" (value), "m" (*mem)); \ else \ @@ -223,15 +223,15 @@ typedef uintmax_t uatomic_max_t; #define atomic_add_zero(mem, value) \ ({ unsigned char __result; \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "addb %b2, %0; setz %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addb %b2, %0; setz %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" (value), "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "addw %w2, %0; setz %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addw %w2, %0; setz %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" (value), "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "addl %2, %0; setz %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addl %2, %0; setz %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" (value), "m" (*mem)); \ else \ @@ -241,15 +241,15 @@ typedef uintmax_t uatomic_max_t; #define atomic_increment(mem) \ (void) ({ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "incb %b0" \ + __asm__ __volatile__ (LOCK_PREFIX "incb %b0" \ : "=m" (*mem) \ : "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "incw %w0" \ + __asm__ __volatile__ (LOCK_PREFIX "incw %w0" \ : "=m" (*mem) \ : "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "incl %0" \ + __asm__ __volatile__ (LOCK_PREFIX "incl %0" \ : "=m" (*mem) \ : "m" (*mem)); \ else \ @@ -268,15 +268,15 @@ typedef uintmax_t uatomic_max_t; #define atomic_increment_and_test(mem) \ ({ unsigned char __result; \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "incb %0; sete %b1" \ + __asm__ __volatile__ (LOCK_PREFIX "incb %0; sete %b1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "incw %0; sete %w1" \ + __asm__ __volatile__ (LOCK_PREFIX "incw %0; sete %w1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "incl %0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "incl %0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else \ @@ -286,15 +286,15 @@ typedef uintmax_t uatomic_max_t; #define atomic_decrement(mem) \ (void) ({ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "decb %b0" \ + __asm__ __volatile__ (LOCK_PREFIX "decb %b0" \ : "=m" (*mem) \ : "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "decw %w0" \ + __asm__ __volatile__ (LOCK_PREFIX "decw %w0" \ : "=m" (*mem) \ : "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "decl %0" \ + __asm__ __volatile__ (LOCK_PREFIX "decl %0" \ : "=m" (*mem) \ : "m" (*mem)); \ else \ @@ -313,15 +313,15 @@ typedef uintmax_t uatomic_max_t; #define atomic_decrement_and_test(mem) \ ({ unsigned char __result; \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "decb %b0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "decb %b0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "decw %w0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "decw %w0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "decl %0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "decl %0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else \ @@ -331,15 +331,15 @@ typedef uintmax_t uatomic_max_t; #define atomic_bit_set(mem, bit) \ (void) ({ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "orb %b2, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "orb %b2, %0" \ : "=m" (*mem) \ : "m" (*mem), "ir" (1 << (bit))); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "orw %w2, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "orw %w2, %0" \ : "=m" (*mem) \ : "m" (*mem), "ir" (1 << (bit))); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "orl %2, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "orl %2, %0" \ : "=m" (*mem) \ : "m" (*mem), "ir" (1 << (bit))); \ else \ @@ -350,15 +350,15 @@ typedef uintmax_t uatomic_max_t; #define atomic_bit_test_set(mem, bit) \ ({ unsigned char __result; \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "btsb %3, %1; setc %0" \ + __asm__ __volatile__ (LOCK_PREFIX "btsb %3, %1; setc %0" \ : "=q" (__result), "=m" (*mem) \ : "m" (*mem), "ir" (bit)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "btsw %3, %1; setc %0" \ + __asm__ __volatile__ (LOCK_PREFIX "btsw %3, %1; setc %0" \ : "=q" (__result), "=m" (*mem) \ : "m" (*mem), "ir" (bit)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "btsl %3, %1; setc %0" \ + __asm__ __volatile__ (LOCK_PREFIX "btsl %3, %1; setc %0" \ : "=q" (__result), "=m" (*mem) \ : "m" (*mem), "ir" (bit)); \ else \ diff --git a/libc/sysdeps/linux/i386/bits/kernel_stat.h b/libc/sysdeps/linux/i386/bits/kernel_stat.h index 9f659a47e..20eb6d2ef 100644 --- a/libc/sysdeps/linux/i386/bits/kernel_stat.h +++ b/libc/sysdeps/linux/i386/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct stat should look like... It turns out each arch has a * different opinion on the subject... */ struct kernel_stat { diff --git a/libc/sysdeps/linux/i386/bits/kernel_types.h b/libc/sysdeps/linux/i386/bits/kernel_types.h index deb615f53..6609dd312 100644 --- a/libc/sysdeps/linux/i386/bits/kernel_types.h +++ b/libc/sysdeps/linux/i386/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/i386/bits/mathinline.h b/libc/sysdeps/linux/i386/bits/mathinline.h index e04ce9509..879b76b40 100644 --- a/libc/sysdeps/linux/i386/bits/mathinline.h +++ b/libc/sysdeps/linux/i386/bits/mathinline.h @@ -206,7 +206,7 @@ __NTH (__signbitl (long double __x)) __MATH_INLINE float_type __NTH (func (float_type __x)) \ { \ register float_type __result; \ - __asm __volatile__ (op : "=t" (__result) : params); \ + __asm__ __volatile__ (op : "=t" (__result) : params); \ return __result; \ } @@ -531,22 +531,22 @@ __inline_mathcodeNP (floor, __x, \ register long double __value; \ __volatile unsigned short int __cw; \ __volatile unsigned short int __cwtmp; \ - __asm __volatile ("fnstcw %0" : "=m" (__cw)); \ + __asm__ __volatile__ ("fnstcw %0" : "=m" (__cw)); \ __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */ \ - __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); \ - __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); \ - __asm __volatile ("fldcw %0" : : "m" (__cw)); \ + __asm__ __volatile__ ("fldcw %0" : : "m" (__cwtmp)); \ + __asm__ __volatile__ ("frndint" : "=t" (__value) : "0" (__x)); \ + __asm__ __volatile__ ("fldcw %0" : : "m" (__cw)); \ return __value) __inline_mathcodeNP (ceil, __x, \ register long double __value; \ __volatile unsigned short int __cw; \ __volatile unsigned short int __cwtmp; \ - __asm __volatile ("fnstcw %0" : "=m" (__cw)); \ + __asm__ __volatile__ ("fnstcw %0" : "=m" (__cw)); \ __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */ \ - __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); \ - __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); \ - __asm __volatile ("fldcw %0" : : "m" (__cw)); \ + __asm__ __volatile__ ("fldcw %0" : : "m" (__cwtmp)); \ + __asm__ __volatile__ ("frndint" : "=t" (__value) : "0" (__x)); \ + __asm__ __volatile__ ("fldcw %0" : : "m" (__cw)); \ return __value) #ifdef __FAST_MATH__ @@ -746,7 +746,7 @@ __inline_mathcode (__acosh1p, __x, \ __inline_mathop (__ieee754_sqrt, "fsqrt") __inline_mathcode2 (__ieee754_atan2, __y, __x, register long double __value; - __asm __volatile__ ("fpatan\n\t" + __asm__ __volatile__ ("fpatan\n\t" : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); return __value;) diff --git a/libc/sysdeps/linux/i386/bits/sigcontextinfo.h b/libc/sysdeps/linux/i386/bits/sigcontextinfo.h index 6530ba6f3..b7367bac6 100644 --- a/libc/sysdeps/linux/i386/bits/sigcontextinfo.h +++ b/libc/sysdeps/linux/i386/bits/sigcontextinfo.h @@ -25,7 +25,7 @@ #define CALL_SIGHANDLER(handler, signo, ctx) \ do { \ int __tmp1, __tmp2, __tmp3, __tmp4; \ - __asm __volatile ("movl\t%%esp, %%edi\n\t" \ + __asm__ __volatile__ ("movl\t%%esp, %%edi\n\t" \ "andl\t$-16, %%esp\n\t" \ "subl\t%8, %%esp\n\t" \ "movl\t%%edi, %c8-4(%%esp)\n\t" \ diff --git a/libc/sysdeps/linux/i386/sigaction.c b/libc/sysdeps/linux/i386/sigaction.c index fbd5014e7..e8729647f 100644 --- a/libc/sysdeps/linux/i386/sigaction.c +++ b/libc/sysdeps/linux/i386/sigaction.c @@ -14,7 +14,7 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. + Boston, MA 02111-1307, USA. Totally hacked up for uClibc by Erik Andersen <andersen@codepoet.org> */ diff --git a/libc/sysdeps/linux/ia64/bits/kernel_types.h b/libc/sysdeps/linux/ia64/bits/kernel_types.h index 6449b5e27..c8ef86d77 100644 --- a/libc/sysdeps/linux/ia64/bits/kernel_types.h +++ b/libc/sysdeps/linux/ia64/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/ia64/bits/syscalls.h b/libc/sysdeps/linux/ia64/bits/syscalls.h index 4e8a305ea..0c3d6ca3a 100644 --- a/libc/sysdeps/linux/ia64/bits/syscalls.h +++ b/libc/sysdeps/linux/ia64/bits/syscalls.h @@ -45,7 +45,7 @@ register long _r15 __asm__ ("r15") = SYS_ify(name); \ long _retval; \ LOAD_REGS_##nr \ - __asm __volatile ("break " ___IA64_BREAK_SYSCALL ";;\n\t" \ + __asm__ __volatile__ ("break " ___IA64_BREAK_SYSCALL ";;\n\t" \ : "=r" (_r8), "=r" (_r10), "=r" (_r15) ASM_OUTARGS_##nr \ : "2" (_r15) ASM_ARGS_##nr \ : "memory" ASM_CLOBBERS_##nr); \ diff --git a/libc/sysdeps/linux/m68k/bits/kernel_stat.h b/libc/sysdeps/linux/m68k/bits/kernel_stat.h index 5f0514843..e60362b54 100644 --- a/libc/sysdeps/linux/m68k/bits/kernel_stat.h +++ b/libc/sysdeps/linux/m68k/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ struct kernel_stat { diff --git a/libc/sysdeps/linux/m68k/bits/kernel_types.h b/libc/sysdeps/linux/m68k/bits/kernel_types.h index 166b33fe6..0a77a8f46 100644 --- a/libc/sysdeps/linux/m68k/bits/kernel_types.h +++ b/libc/sysdeps/linux/m68k/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/m68k/bits/mathinline.h b/libc/sysdeps/linux/m68k/bits/mathinline.h index 567dbed89..f3166000d 100644 --- a/libc/sysdeps/linux/m68k/bits/mathinline.h +++ b/libc/sysdeps/linux/m68k/bits/mathinline.h @@ -179,14 +179,14 @@ __m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \ { \ float_type __result; \ unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ + __asm__ __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ /* Set rounding towards negative infinity. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ : "dmi" ((__ctrl_reg & ~0x10) | 0x20)); \ /* Convert X to an integer, using -Inf rounding. */ \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ + __asm__ __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ /* Restore the previous rounding mode. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ : "dmi" (__ctrl_reg)); \ return __result; \ } \ @@ -195,14 +195,14 @@ __m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \ { \ float_type __result; \ unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ + __asm__ __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ /* Set rounding towards positive infinity. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ : "dmi" (__ctrl_reg | 0x30)); \ /* Convert X to an integer, using +Inf rounding. */ \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ + __asm__ __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ /* Restore the previous rounding mode. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ : "dmi" (__ctrl_reg)); \ return __result; \ } @@ -295,12 +295,12 @@ __m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) \ { \ float_type __result; \ unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ + __asm__ __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ /* Temporarily disable the inexact exception. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ : "dmi" (__ctrl_reg & ~0x200)); \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + __asm__ __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ + __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ : "dmi" (__ctrl_reg)); \ return __result; \ } \ @@ -351,14 +351,14 @@ __inline_functions (long double,l) /* Note that there must be no whitespace before the argument passed for NAME, to make token pasting work correctly with -traditional. */ # define __inline_forward_c(rettype, name, args1, args2) \ -__extern_inline rettype __attribute__((__const__)) \ +extern __inline rettype __attribute__((__const__)) \ name args1 \ { \ return __CONCAT(__,name) args2; \ } # define __inline_forward(rettype, name, args1, args2) \ -__extern_inline rettype name args1 \ +extern __inline rettype name args1 \ { \ return __CONCAT(__,name) args2; \ } diff --git a/libc/sysdeps/linux/microblaze/bits/endian.h b/libc/sysdeps/linux/microblaze/bits/endian.h index a1012a3f1..8a4f6efcc 100644 --- a/libc/sysdeps/linux/microblaze/bits/endian.h +++ b/libc/sysdeps/linux/microblaze/bits/endian.h @@ -8,7 +8,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader <miles@gnu.org> * Microblaze port by John Williams */ diff --git a/libc/sysdeps/linux/microblaze/bits/setjmp.h b/libc/sysdeps/linux/microblaze/bits/setjmp.h index c3e218955..d966efd2b 100644 --- a/libc/sysdeps/linux/microblaze/bits/setjmp.h +++ b/libc/sysdeps/linux/microblaze/bits/setjmp.h @@ -8,7 +8,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader <miles@gnu.org> */ diff --git a/libc/sysdeps/linux/microblaze/clinkage.h b/libc/sysdeps/linux/microblaze/clinkage.h index cf5c34b54..a9beffc96 100644 --- a/libc/sysdeps/linux/microblaze/clinkage.h +++ b/libc/sysdeps/linux/microblaze/clinkage.h @@ -8,7 +8,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader <miles@gnu.org> */ diff --git a/libc/sysdeps/linux/microblaze/clone.c b/libc/sysdeps/linux/microblaze/clone.c index 887e2c8ac..a47ee8c68 100644 --- a/libc/sysdeps/linux/microblaze/clone.c +++ b/libc/sysdeps/linux/microblaze/clone.c @@ -31,7 +31,7 @@ clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg) arg0 = flags; arg1 = (unsigned long)child_stack; syscall = __NR_clone; - __asm__ __volatile__ ("bralid r17, trap;nop;" + __asm__ __volatile__ ("bralid r17, trap;nop;" : "=r" (rval), "=r" (syscall) : "1" (syscall), "r" (arg0), "r" (arg1) : SYSCALL_CLOBBERS); @@ -41,7 +41,7 @@ clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg) { arg0 = (*fn) (arg); syscall = __NR_exit; - __asm__ __volatile__ ("bralid r17, trap;nop;" + __asm__ __volatile__ ("bralid r17, trap;nop;" : "=r" (rval), "=r" (syscall) : "1" (syscall), "r" (arg0) : SYSCALL_CLOBBERS); diff --git a/libc/sysdeps/linux/microblaze/syscall.c b/libc/sysdeps/linux/microblaze/syscall.c index a7fd3ae7b..0e07e4595 100644 --- a/libc/sysdeps/linux/microblaze/syscall.c +++ b/libc/sysdeps/linux/microblaze/syscall.c @@ -8,7 +8,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader <miles@gnu.org> */ @@ -37,11 +37,11 @@ syscall (long num, arg_t a1, arg_t a2, arg_t a3, arg_t a4, arg_t a5, arg_t a6) unsigned long ret_sav; *((unsigned long *)0xFFFF4004) = (unsigned int)('+'); - __asm__ ("brlid r17, 08x; nop;" + __asm__ ("brlid r17, 08x; nop;" : "=r" (ret) : "r" (syscall), "r" (a), "r" (b), "r" (c), "r" (d), "r" (e), "r" (f) : SYSCALL_CLOBBERS); - + ret_sav=ret; *((unsigned long *)0xFFFF4004) = (unsigned int)('-'); diff --git a/libc/sysdeps/linux/mips/bits/atomic.h b/libc/sysdeps/linux/mips/bits/atomic.h index 167d9a59c..ca53d3842 100644 --- a/libc/sysdeps/linux/mips/bits/atomic.h +++ b/libc/sysdeps/linux/mips/bits/atomic.h @@ -285,7 +285,7 @@ typedef uintmax_t uatomic_max_t; __prev; }) #endif -/* ??? Barrier semantics for atomic_exchange_and_add appear to be +/* ??? Barrier semantics for atomic_exchange_and_add appear to be undefined. Use full barrier for now, as that's safe. */ #define atomic_exchange_and_add(mem, value) \ __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ diff --git a/libc/sysdeps/linux/mips/bits/kernel_stat.h b/libc/sysdeps/linux/mips/bits/kernel_stat.h index 13c23d359..3161562ea 100644 --- a/libc/sysdeps/linux/mips/bits/kernel_stat.h +++ b/libc/sysdeps/linux/mips/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ #include <sgidefs.h> diff --git a/libc/sysdeps/linux/mips/bits/syscalls.h b/libc/sysdeps/linux/mips/bits/syscalls.h index 324d75d9f..fa8b876d7 100644 --- a/libc/sysdeps/linux/mips/bits/syscalls.h +++ b/libc/sysdeps/linux/mips/bits/syscalls.h @@ -45,7 +45,7 @@ return (type) (INLINE_SYSCALL(name, 3, arg1, arg2, arg3)); \ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ { \ return (type) (INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4)); \ -} +} #undef _syscall5 #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ diff --git a/libc/sysdeps/linux/mips/pread_write.c b/libc/sysdeps/linux/mips/pread_write.c index 553864531..0939e17b6 100644 --- a/libc/sysdeps/linux/mips/pread_write.c +++ b/libc/sysdeps/linux/mips/pread_write.c @@ -49,7 +49,7 @@ weak_alias (__libc_pread64, pread64) # endif /* __UCLIBC_HAS_LFS__ */ # else /* O32 || N32 */ # define __NR___syscall_pread __NR_pread -static inline _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, +static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo); ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) @@ -93,7 +93,7 @@ weak_alias (__libc_pwrite64, pwrite64) # endif /* __UCLIBC_HAS_LFS__ */ # else /* O32 || N32 */ # define __NR___syscall_pwrite __NR_pwrite -static inline _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, +static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo); ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) diff --git a/libc/sysdeps/linux/mips/sigaction.c b/libc/sysdeps/linux/mips/sigaction.c index 0135481ae..d03371f5a 100644 --- a/libc/sysdeps/linux/mips/sigaction.c +++ b/libc/sysdeps/linux/mips/sigaction.c @@ -14,7 +14,7 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. + Boston, MA 02111-1307, USA. Totally hacked up for uClibc by Erik Andersen <andersen@codepoet.org> */ diff --git a/libc/sysdeps/linux/nios/bits/kernel_types.h b/libc/sysdeps/linux/nios/bits/kernel_types.h index acbb0c592..e66f42d7a 100644 --- a/libc/sysdeps/linux/nios/bits/kernel_types.h +++ b/libc/sysdeps/linux/nios/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/nios/crtbegin.c b/libc/sysdeps/linux/nios/crtbegin.c index c52999027..ac3f23f84 100644 --- a/libc/sysdeps/linux/nios/crtbegin.c +++ b/libc/sysdeps/linux/nios/crtbegin.c @@ -33,5 +33,5 @@ dummy_fini(void) __asm__ __volatile__ (".section .fini"); (*call__dtors)(); __asm__ __volatile__ (".section .trash"); - + } diff --git a/libc/sysdeps/linux/nios/crtend.c b/libc/sysdeps/linux/nios/crtend.c index 29af728a9..775eb0f9d 100644 --- a/libc/sysdeps/linux/nios/crtend.c +++ b/libc/sysdeps/linux/nios/crtend.c @@ -34,7 +34,7 @@ dummy_init(void) */ /* prevent function pointer constant propagation */ __asm__ __volatile__ (".section .init"); - + if (!initialized) { initialized = 1; (*call__ctors)(); diff --git a/libc/sysdeps/linux/nios2/bits/kernel_stat.h b/libc/sysdeps/linux/nios2/bits/kernel_stat.h index 908a153d8..9be9d115d 100644 --- a/libc/sysdeps/linux/nios2/bits/kernel_stat.h +++ b/libc/sysdeps/linux/nios2/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ struct kernel_stat { diff --git a/libc/sysdeps/linux/nios2/bits/kernel_types.h b/libc/sysdeps/linux/nios2/bits/kernel_types.h index 1fd1c4aaa..3fcd1af05 100644 --- a/libc/sysdeps/linux/nios2/bits/kernel_types.h +++ b/libc/sysdeps/linux/nios2/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/nios2/bits/setjmp.h b/libc/sysdeps/linux/nios2/bits/setjmp.h index 5d33caa98..fcff0316d 100644 --- a/libc/sysdeps/linux/nios2/bits/setjmp.h +++ b/libc/sysdeps/linux/nios2/bits/setjmp.h @@ -45,7 +45,7 @@ typedef struct /* floating point regs, if any */ #if defined __HAVE_FPU__ unsigned long __fpregs[64]; -#endif +#endif } __jmp_buf[1]; #endif diff --git a/libc/sysdeps/linux/nios2/syscall.c b/libc/sysdeps/linux/nios2/syscall.c index df925fde8..c3eb0022c 100644 --- a/libc/sysdeps/linux/nios2/syscall.c +++ b/libc/sysdeps/linux/nios2/syscall.c @@ -1,4 +1,4 @@ -/* +/* * libc/sysdeps/linux/nios2/syscall.c -- generic syscall function for linux/nios2 * * Copyright (C) 2004 Microtronix Datacom Ltd. @@ -28,7 +28,7 @@ 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 _r4 __asm__("r4")=(long)(a); register long _r5 __asm__("r5")=(long)(b); register long _r6 __asm__("r6")=(long)(c); diff --git a/libc/sysdeps/linux/powerpc/bits/atomic.h b/libc/sysdeps/linux/powerpc/bits/atomic.h index 977bda72f..d8a4ed33e 100644 --- a/libc/sysdeps/linux/powerpc/bits/atomic.h +++ b/libc/sysdeps/linux/powerpc/bits/atomic.h @@ -50,7 +50,7 @@ # define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \ ({ \ unsigned int __tmp, __tmp2; \ - __asm __volatile (" clrldi %1,%1,32\n" \ + __asm__ __volatile__ (" clrldi %1,%1,32\n" \ "1: lwarx %0,0,%2\n" \ " subf. %0,%1,%0\n" \ " bne 2f\n" \ @@ -66,7 +66,7 @@ # define __arch_compare_and_exchange_bool_32_rel(mem, newval, oldval) \ ({ \ unsigned int __tmp, __tmp2; \ - __asm __volatile (__ARCH_REL_INSTR "\n" \ + __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \ " clrldi %1,%1,32\n" \ "1: lwarx %0,0,%2\n" \ " subf. %0,%1,%0\n" \ @@ -88,7 +88,7 @@ # define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \ ({ \ unsigned long __tmp; \ - __asm __volatile ( \ + __asm__ __volatile__ ( \ "1: ldarx %0,0,%1\n" \ " subf. %0,%2,%0\n" \ " bne 2f\n" \ @@ -104,7 +104,7 @@ # define __arch_compare_and_exchange_bool_64_rel(mem, newval, oldval) \ ({ \ unsigned long __tmp; \ - __asm __volatile (__ARCH_REL_INSTR "\n" \ + __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \ "1: ldarx %0,0,%1\n" \ " subf. %0,%2,%0\n" \ " bne 2f\n" \ @@ -121,7 +121,7 @@ ({ \ __typeof (*(mem)) __tmp; \ __typeof (mem) __memp = (mem); \ - __asm __volatile ( \ + __asm__ __volatile__ ( \ "1: ldarx %0,0,%1\n" \ " cmpd %0,%2\n" \ " bne 2f\n" \ @@ -138,7 +138,7 @@ ({ \ __typeof (*(mem)) __tmp; \ __typeof (mem) __memp = (mem); \ - __asm __volatile (__ARCH_REL_INSTR "\n" \ + __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \ "1: ldarx %0,0,%1\n" \ " cmpd %0,%2\n" \ " bne 2f\n" \ @@ -154,7 +154,7 @@ # define __arch_atomic_exchange_64_acq(mem, value) \ ({ \ __typeof (*mem) __val; \ - __asm __volatile (__ARCH_REL_INSTR "\n" \ + __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \ "1: ldarx %0,0,%2\n" \ " stdcx. %3,0,%2\n" \ " bne- 1b\n" \ @@ -168,7 +168,7 @@ # define __arch_atomic_exchange_64_rel(mem, value) \ ({ \ __typeof (*mem) __val; \ - __asm __volatile (__ARCH_REL_INSTR "\n" \ + __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \ "1: ldarx %0,0,%2\n" \ " stdcx. %3,0,%2\n" \ " bne- 1b" \ @@ -181,7 +181,7 @@ # define __arch_atomic_exchange_and_add_64(mem, value) \ ({ \ __typeof (*mem) __val, __tmp; \ - __asm __volatile ("1: ldarx %0,0,%3\n" \ + __asm__ __volatile__ ("1: ldarx %0,0,%3\n" \ " add %1,%0,%4\n" \ " stdcx. %1,0,%3\n" \ " bne- 1b" \ @@ -194,7 +194,7 @@ # define __arch_atomic_increment_val_64(mem) \ ({ \ __typeof (*(mem)) __val; \ - __asm __volatile ("1: ldarx %0,0,%2\n" \ + __asm__ __volatile__ ("1: ldarx %0,0,%2\n" \ " addi %0,%0,1\n" \ " stdcx. %0,0,%2\n" \ " bne- 1b" \ @@ -207,7 +207,7 @@ # define __arch_atomic_decrement_val_64(mem) \ ({ \ __typeof (*(mem)) __val; \ - __asm __volatile ("1: ldarx %0,0,%2\n" \ + __asm__ __volatile__ ("1: ldarx %0,0,%2\n" \ " subi %0,%0,1\n" \ " stdcx. %0,0,%2\n" \ " bne- 1b" \ @@ -219,7 +219,7 @@ # define __arch_atomic_decrement_if_positive_64(mem) \ ({ int __val, __tmp; \ - __asm __volatile ("1: ldarx %0,0,%3\n" \ + __asm__ __volatile__ ("1: ldarx %0,0,%3\n" \ " cmpdi 0,%0,0\n" \ " addi %1,%0,-1\n" \ " ble 2f\n" \ @@ -273,7 +273,7 @@ # define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \ ({ \ unsigned int __tmp; \ - __asm __volatile ( \ + __asm__ __volatile__ ( \ "1: lwarx %0,0,%1\n" \ " subf. %0,%2,%0\n" \ " bne 2f\n" \ @@ -289,7 +289,7 @@ # define __arch_compare_and_exchange_bool_32_rel(mem, newval, oldval) \ ({ \ unsigned int __tmp; \ - __asm __volatile (__ARCH_REL_INSTR "\n" \ + __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \ "1: lwarx %0,0,%1\n" \ " subf. %0,%2,%0\n" \ " bne 2f\n" \ @@ -394,7 +394,7 @@ typedef uintmax_t uatomic_max_t; ({ \ __typeof (*(mem)) __tmp; \ __typeof (mem) __memp = (mem); \ - __asm __volatile ( \ + __asm__ __volatile__ ( \ "1: lwarx %0,0,%1\n" \ " cmpw %0,%2\n" \ " bne 2f\n" \ @@ -411,7 +411,7 @@ typedef uintmax_t uatomic_max_t; ({ \ __typeof (*(mem)) __tmp; \ __typeof (mem) __memp = (mem); \ - __asm __volatile (__ARCH_REL_INSTR "\n" \ + __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \ "1: lwarx %0,0,%1\n" \ " cmpw %0,%2\n" \ " bne 2f\n" \ @@ -427,7 +427,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_atomic_exchange_32_acq(mem, value) \ ({ \ __typeof (*mem) __val; \ - __asm __volatile ( \ + __asm__ __volatile__ ( \ "1: lwarx %0,0,%2\n" \ " stwcx. %3,0,%2\n" \ " bne- 1b\n" \ @@ -441,7 +441,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_atomic_exchange_32_rel(mem, value) \ ({ \ __typeof (*mem) __val; \ - __asm __volatile (__ARCH_REL_INSTR "\n" \ + __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \ "1: lwarx %0,0,%2\n" \ " stwcx. %3,0,%2\n" \ " bne- 1b" \ @@ -454,7 +454,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_atomic_exchange_and_add_32(mem, value) \ ({ \ __typeof (*mem) __val, __tmp; \ - __asm __volatile ("1: lwarx %0,0,%3\n" \ + __asm__ __volatile__ ("1: lwarx %0,0,%3\n" \ " add %1,%0,%4\n" \ " stwcx. %1,0,%3\n" \ " bne- 1b" \ @@ -467,7 +467,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_atomic_increment_val_32(mem) \ ({ \ __typeof (*(mem)) __val; \ - __asm __volatile ("1: lwarx %0,0,%2\n" \ + __asm__ __volatile__ ("1: lwarx %0,0,%2\n" \ " addi %0,%0,1\n" \ " stwcx. %0,0,%2\n" \ " bne- 1b" \ @@ -480,7 +480,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_atomic_decrement_val_32(mem) \ ({ \ __typeof (*(mem)) __val; \ - __asm __volatile ("1: lwarx %0,0,%2\n" \ + __asm__ __volatile__ ("1: lwarx %0,0,%2\n" \ " subi %0,%0,1\n" \ " stwcx. %0,0,%2\n" \ " bne- 1b" \ @@ -492,7 +492,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_atomic_decrement_if_positive_32(mem) \ ({ int __val, __tmp; \ - __asm __volatile ("1: lwarx %0,0,%3\n" \ + __asm__ __volatile__ ("1: lwarx %0,0,%3\n" \ " cmpwi 0,%0,0\n" \ " addi %1,%0,-1\n" \ " ble 2f\n" \ diff --git a/libc/sysdeps/linux/powerpc/bits/kernel_stat.h b/libc/sysdeps/linux/powerpc/bits/kernel_stat.h index d3c3f911c..bfa67229d 100644 --- a/libc/sysdeps/linux/powerpc/bits/kernel_stat.h +++ b/libc/sysdeps/linux/powerpc/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ #if __WORDSIZE == 64 #define kernel_stat kernel_stat64 diff --git a/libc/sysdeps/linux/powerpc/bits/kernel_types.h b/libc/sysdeps/linux/powerpc/bits/kernel_types.h index 223037545..3f3b93377 100644 --- a/libc/sysdeps/linux/powerpc/bits/kernel_types.h +++ b/libc/sysdeps/linux/powerpc/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/powerpc/bits/mathinline.h b/libc/sysdeps/linux/powerpc/bits/mathinline.h index e2536a3cc..d1b05f388 100644 --- a/libc/sysdeps/linux/powerpc/bits/mathinline.h +++ b/libc/sysdeps/linux/powerpc/bits/mathinline.h @@ -148,7 +148,7 @@ __NTH (__ieee754_sqrt (double __x)) { /* Volatile is required to prevent the compiler from moving the fsqrt instruction above the branch. */ - __asm __volatile ( + __asm__ __volatile__ ( " fsqrt %0,%1\n" : "=f" (__z) : "f" (__x)); @@ -170,7 +170,7 @@ __NTH (__ieee754_sqrtf (float __x)) { /* Volatile is required to prevent the compiler from moving the fsqrts instruction above the branch. */ - __asm __volatile ( + __asm__ __volatile__ ( " fsqrts %0,%1\n" : "=f" (__z) : "f" (__x)); diff --git a/libc/sysdeps/linux/powerpc/bits/sem.h b/libc/sysdeps/linux/powerpc/bits/sem.h index 1c648cd19..92a7a9043 100644 --- a/libc/sysdeps/linux/powerpc/bits/sem.h +++ b/libc/sysdeps/linux/powerpc/bits/sem.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002 +/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/libc/sysdeps/linux/powerpc/pread_write.c b/libc/sysdeps/linux/powerpc/pread_write.c index e9f8cbef8..cdbadfdf3 100644 --- a/libc/sysdeps/linux/powerpc/pread_write.c +++ b/libc/sysdeps/linux/powerpc/pread_write.c @@ -6,7 +6,7 @@ */ /* Based in part on the files * ./sysdeps/unix/sysv/linux/pwrite.c, - * ./sysdeps/unix/sysv/linux/pread.c, + * ./sysdeps/unix/sysv/linux/pread.c, * sysdeps/posix/pread.c * sysdeps/posix/pwrite.c * from GNU libc 2.2.5, but reworked considerably... @@ -15,26 +15,26 @@ #include <sys/syscall.h> #include <unistd.h> -#ifndef __UCLIBC_HAS_LFS__ +#ifndef __UCLIBC_HAS_LFS__ # define off64_t off_t #endif #ifdef __NR_pread extern __typeof(pread) __libc_pread; -# define __NR___syscall_pread __NR_pread -static inline _syscall4(ssize_t, __syscall_pread, int, fd, +# define __NR___syscall_pread __NR_pread +static __inline__ _syscall4(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, off64_t, offset); ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) -{ +{ return(__syscall_pread(fd, buf, count, (off64_t)offset)); } weak_alias(__libc_pread,pread) -# ifdef __UCLIBC_HAS_LFS__ +# ifdef __UCLIBC_HAS_LFS__ extern __typeof(pread64) __libc_pread64; ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset) -{ +{ return(__syscall_pread(fd, buf, count, offset)); } weak_alias(__libc_pread64,pread64) @@ -44,20 +44,20 @@ weak_alias(__libc_pread64,pread64) #ifdef __NR_pwrite extern __typeof(pwrite) __libc_pwrite; -# define __NR___syscall_pwrite __NR_pwrite -static inline _syscall4(ssize_t, __syscall_pwrite, int, fd, +# define __NR___syscall_pwrite __NR_pwrite +static __inline__ _syscall4(ssize_t, __syscall_pwrite, int, fd, const void *, buf, size_t, count, off64_t, offset); ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) -{ +{ return(__syscall_pwrite(fd, buf, count, (off64_t)offset)); } weak_alias(__libc_pwrite,pwrite) -# ifdef __UCLIBC_HAS_LFS__ +# ifdef __UCLIBC_HAS_LFS__ extern __typeof(pwrite64) __libc_pwrite64; ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset) -{ +{ return(__syscall_pwrite(fd, buf, count, offset)); } weak_alias(__libc_pwrite64,pwrite64) @@ -71,14 +71,14 @@ libc_hidden_proto(read) libc_hidden_proto(write) libc_hidden_proto(lseek) -static ssize_t __fake_pread_write(int fd, void *buf, +static ssize_t __fake_pread_write(int fd, void *buf, size_t count, off_t offset, int do_pwrite) { int save_errno; ssize_t result; off_t old_offset; - /* Since we must not change the file pointer preserve the + /* Since we must not change the file pointer preserve the * value so that we can restore it later. */ if ((old_offset=lseek(fd, 0, SEEK_CUR)) == (off_t) -1) return -1; @@ -95,7 +95,7 @@ static ssize_t __fake_pread_write(int fd, void *buf, result = read(fd, buf, count); } - /* Now we have to restore the position. If this fails we + /* Now we have to restore the position. If this fails we * have to return this as an error. */ save_errno = errno; if (lseek(fd, old_offset, SEEK_SET) == (off_t) -1) @@ -108,24 +108,24 @@ static ssize_t __fake_pread_write(int fd, void *buf, return(result); } -# ifdef __UCLIBC_HAS_LFS__ +# ifdef __UCLIBC_HAS_LFS__ libc_hidden_proto(lseek64) -static ssize_t __fake_pread_write64(int fd, void *buf, +static ssize_t __fake_pread_write64(int fd, void *buf, size_t count, off64_t offset, int do_pwrite) { int save_errno; ssize_t result; off64_t old_offset; - /* Since we must not change the file pointer preserve the + /* Since we must not change the file pointer preserve the * value so that we can restore it later. */ if ((old_offset=lseek64(fd, 0, SEEK_CUR)) == (off64_t) -1) return -1; /* Set to wanted position. */ - if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1) - return -1; + if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1) + return -1; if (do_pwrite==1) { /* Write the data. */ @@ -155,9 +155,9 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) } weak_alias(__libc_pread,pread) -# ifdef __UCLIBC_HAS_LFS__ +# ifdef __UCLIBC_HAS_LFS__ ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset) -{ +{ return(__fake_pread_write64(fd, buf, count, offset, 0)); } weak_alias(__libc_pread64,pread64) @@ -172,9 +172,9 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) } weak_alias(__libc_pwrite,pwrite) -# ifdef __UCLIBC_HAS_LFS__ +# ifdef __UCLIBC_HAS_LFS__ ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset) -{ +{ return(__fake_pread_write64(fd, (void*)buf, count, offset, 1)); } weak_alias(__libc_pwrite64,pwrite64) diff --git a/libc/sysdeps/linux/powerpc/sys/procfs.h b/libc/sysdeps/linux/powerpc/sys/procfs.h index d2d597241..118463649 100644 --- a/libc/sysdeps/linux/powerpc/sys/procfs.h +++ b/libc/sysdeps/linux/powerpc/sys/procfs.h @@ -32,9 +32,9 @@ __BEGIN_DECLS -/* These definitions are normally provided by ucontext.h via - asm/sigcontext.h, asm/ptrace.h, and asm/elf.h. Otherwise we define - them here. */ +/* These definitions are normally provided by ucontext.h via + asm/sigcontext.h, asm/ptrace.h, and asm/elf.h. Otherwise we define + them here. */ #ifndef __PPC64_ELF_H #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ #define ELF_NFPREG 33 /* includes fpscr */ diff --git a/libc/sysdeps/linux/powerpc/sys/ucontext.h b/libc/sysdeps/linux/powerpc/sys/ucontext.h index 9eb50aa96..737512afc 100644 --- a/libc/sysdeps/linux/powerpc/sys/ucontext.h +++ b/libc/sysdeps/linux/powerpc/sys/ucontext.h @@ -62,14 +62,14 @@ typedef struct #else -/* For 64-bit kernels with Altivec support, a machine context is exactly - * a sigcontext. For older kernel (without Altivec) the sigcontext matches - * the mcontext upto but not including the v_regs field. For kernels that - * don't AT_HWCAP or return AT_HWCAP without PPC_FEATURE_HAS_ALTIVEC the +/* For 64-bit kernels with Altivec support, a machine context is exactly + * a sigcontext. For older kernel (without Altivec) the sigcontext matches + * the mcontext upto but not including the v_regs field. For kernels that + * don't AT_HWCAP or return AT_HWCAP without PPC_FEATURE_HAS_ALTIVEC the * v_regs field may not exit and should not be referenced. The v_regd field * can be refernced safely only after verifying that PPC_FEATURE_HAS_ALTIVEC * is set in AT_HWCAP. */ - + /* Number of general registers. */ # define NGREG 48 /* includes r0-r31, nip, msr, lr, etc. */ # define NFPREG 33 /* includes fp0-fp31 &fpscr. */ @@ -79,7 +79,7 @@ typedef unsigned long gregset_t[NGREG]; typedef double fpregset_t[NFPREG]; /* Container for Altivec/VMX Vector Status and Control Register. Only 32-bits - but can only be copied to/from a 128-bit vector register. So we allocated + but can only be copied to/from a 128-bit vector register. So we allocated a whole quadword speedup save/restore. */ typedef struct _libc_vscr { @@ -107,22 +107,22 @@ typedef struct { gregset_t gp_regs; fpregset_t fp_regs; /* - * To maintain compatibility with current implementations the sigcontext is - * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t) - * followed by an unstructured (vmx_reserve) field of 69 doublewords. This - * allows the array of vector registers to be quadword aligned independent of - * the alignment of the containing sigcontext or ucontext. It is the - * responsibility of the code setting the sigcontext to set this pointer to - * either NULL (if this processor does not support the VMX feature) or the + * To maintain compatibility with current implementations the sigcontext is + * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t) + * followed by an unstructured (vmx_reserve) field of 69 doublewords. This + * allows the array of vector registers to be quadword aligned independent of + * the alignment of the containing sigcontext or ucontext. It is the + * responsibility of the code setting the sigcontext to set this pointer to + * either NULL (if this processor does not support the VMX feature) or the * address of the first quadword within the allocated (vmx_reserve) area. * - * The pointer (v_regs) of vector type (elf_vrreg_t) is essentually - * an array of 34 quadword entries. The entries with - * indexes 0-31 contain the corresponding vector registers. The entry with - * index 32 contains the vscr as the last word (offset 12) within the - * quadword. This allows the vscr to be stored as either a quadword (since - * it must be copied via a vector register to/from storage) or as a word. - * The entry with index 33 contains the vrsave as the first word (offset 0) + * The pointer (v_regs) of vector type (elf_vrreg_t) is essentually + * an array of 34 quadword entries. The entries with + * indexes 0-31 contain the corresponding vector registers. The entry with + * index 32 contains the vscr as the last word (offset 12) within the + * quadword. This allows the vscr to be stored as either a quadword (since + * it must be copied via a vector register to/from storage) or as a word. + * The entry with index 33 contains the vrsave as the first word (offset 0) * within the quadword. */ vrregset_t *v_regs; diff --git a/libc/sysdeps/linux/sh/bits/kernel_stat.h b/libc/sysdeps/linux/sh/bits/kernel_stat.h index 8a29b3f5f..2e88dad82 100644 --- a/libc/sysdeps/linux/sh/bits/kernel_stat.h +++ b/libc/sysdeps/linux/sh/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ #include <endian.h> diff --git a/libc/sysdeps/linux/sh/bits/kernel_types.h b/libc/sysdeps/linux/sh/bits/kernel_types.h index baccd305e..7d55cf510 100644 --- a/libc/sysdeps/linux/sh/bits/kernel_types.h +++ b/libc/sysdeps/linux/sh/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/sh/pread_write.c b/libc/sysdeps/linux/sh/pread_write.c index d043ae651..16c9c6d8a 100644 --- a/libc/sysdeps/linux/sh/pread_write.c +++ b/libc/sysdeps/linux/sh/pread_write.c @@ -35,7 +35,7 @@ #ifdef __NR_pread extern __typeof(pread) __libc_pread; # define __NR___syscall_pread __NR_pread -static inline _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, +static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo); ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) @@ -85,7 +85,7 @@ weak_alias(__libc_pread64,pread64) #ifdef __NR_pwrite extern __typeof(pwrite) __libc_pwrite; # define __NR___syscall_pwrite __NR_pwrite -static inline _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, +static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo); ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) diff --git a/libc/sysdeps/linux/sh64/bits/kernel_types.h b/libc/sysdeps/linux/sh64/bits/kernel_types.h index 2e160fcac..671cc8345 100644 --- a/libc/sysdeps/linux/sh64/bits/kernel_types.h +++ b/libc/sysdeps/linux/sh64/bits/kernel_types.h @@ -9,10 +9,10 @@ * directory of this archive for more details. */ -/* +/* * Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/sh64/sys/ucontext.h b/libc/sysdeps/linux/sh64/sys/ucontext.h index 16feb49a5..74407841a 100644 --- a/libc/sysdeps/linux/sh64/sys/ucontext.h +++ b/libc/sysdeps/linux/sh64/sys/ucontext.h @@ -189,7 +189,7 @@ typedef struct unsigned long long sc_pc; unsigned long long sc_sr; unsigned long long sc_fpscr; - + } mcontext_t; /* Userlevel context. */ diff --git a/libc/sysdeps/linux/sparc/bits/kernel_stat.h b/libc/sysdeps/linux/sparc/bits/kernel_stat.h index ac167fadd..ab85be257 100644 --- a/libc/sysdeps/linux/sparc/bits/kernel_stat.h +++ b/libc/sysdeps/linux/sparc/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ #if __WORDSIZE == 64 #define kernel_stat kernel_stat64 diff --git a/libc/sysdeps/linux/sparc/bits/kernel_types.h b/libc/sysdeps/linux/sparc/bits/kernel_types.h index 3db603fc7..1b2452446 100644 --- a/libc/sysdeps/linux/sparc/bits/kernel_types.h +++ b/libc/sysdeps/linux/sparc/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/sparc/bits/syscalls.h b/libc/sysdeps/linux/sparc/bits/syscalls.h index 9065b0042..fdaa4dee1 100644 --- a/libc/sysdeps/linux/sparc/bits/syscalls.h +++ b/libc/sysdeps/linux/sparc/bits/syscalls.h @@ -110,7 +110,7 @@ __asm__ __volatile__ (__SYSCALL_STRING \ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__g1) \ : "cc"); \ __SYSCALL_RETURN(type) \ -} +} #undef _syscall5 #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ diff --git a/libc/sysdeps/linux/v850/bits/endian.h b/libc/sysdeps/linux/v850/bits/endian.h index 8fdd95520..ae78da373 100644 --- a/libc/sysdeps/linux/v850/bits/endian.h +++ b/libc/sysdeps/linux/v850/bits/endian.h @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader <miles@gnu.org> */ diff --git a/libc/sysdeps/linux/v850/bits/setjmp.h b/libc/sysdeps/linux/v850/bits/setjmp.h index 93395ade4..c94373787 100644 --- a/libc/sysdeps/linux/v850/bits/setjmp.h +++ b/libc/sysdeps/linux/v850/bits/setjmp.h @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader <miles@gnu.org> */ diff --git a/libc/sysdeps/linux/v850/clinkage.h b/libc/sysdeps/linux/v850/clinkage.h index 7aef23529..e85d39fb8 100644 --- a/libc/sysdeps/linux/v850/clinkage.h +++ b/libc/sysdeps/linux/v850/clinkage.h @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader <miles@gnu.org> */ diff --git a/libc/sysdeps/linux/v850/syscall.c b/libc/sysdeps/linux/v850/syscall.c index 614d874f5..dbcc87cec 100644 --- a/libc/sysdeps/linux/v850/syscall.c +++ b/libc/sysdeps/linux/v850/syscall.c @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader <miles@gnu.org> */ diff --git a/libc/sysdeps/linux/x86_64/bits/atomic.h b/libc/sysdeps/linux/x86_64/bits/atomic.h index 67a512568..04870cbf5 100644 --- a/libc/sysdeps/linux/x86_64/bits/atomic.h +++ b/libc/sysdeps/linux/x86_64/bits/atomic.h @@ -57,28 +57,28 @@ typedef uintmax_t uatomic_max_t; #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgb %b2, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "cmpxchgb %b2, %1" \ : "=a" (ret), "=m" (*mem) \ : "q" (newval), "m" (*mem), "0" (oldval)); \ ret; }) #define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgw %w2, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "cmpxchgw %w2, %1" \ : "=a" (ret), "=m" (*mem) \ : "r" (newval), "m" (*mem), "0" (oldval)); \ ret; }) #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgl %2, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "cmpxchgl %2, %1" \ : "=a" (ret), "=m" (*mem) \ : "r" (newval), "m" (*mem), "0" (oldval)); \ ret; }) #define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgq %q2, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "cmpxchgq %q2, %1" \ : "=a" (ret), "=m" (*mem) \ : "r" ((long) (newval)), "m" (*mem), \ "0" ((long) (oldval))); \ @@ -89,19 +89,19 @@ typedef uintmax_t uatomic_max_t; #define atomic_exchange_acq(mem, newvalue) \ ({ __typeof (*mem) result; \ if (sizeof (*mem) == 1) \ - __asm __volatile ("xchgb %b0, %1" \ + __asm__ __volatile__ ("xchgb %b0, %1" \ : "=r" (result), "=m" (*mem) \ : "0" (newvalue), "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile ("xchgw %w0, %1" \ + __asm__ __volatile__ ("xchgw %w0, %1" \ : "=r" (result), "=m" (*mem) \ : "0" (newvalue), "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile ("xchgl %0, %1" \ + __asm__ __volatile__ ("xchgl %0, %1" \ : "=r" (result), "=m" (*mem) \ : "0" (newvalue), "m" (*mem)); \ else \ - __asm __volatile ("xchgq %q0, %1" \ + __asm__ __volatile__ ("xchgq %q0, %1" \ : "=r" (result), "=m" (*mem) \ : "0" ((long) (newvalue)), "m" (*mem)); \ result; }) @@ -110,19 +110,19 @@ typedef uintmax_t uatomic_max_t; #define atomic_exchange_and_add(mem, value) \ ({ __typeof (*mem) result; \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "xaddb %b0, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "xaddb %b0, %1" \ : "=r" (result), "=m" (*mem) \ : "0" (value), "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "xaddw %w0, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "xaddw %w0, %1" \ : "=r" (result), "=m" (*mem) \ : "0" (value), "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "xaddl %0, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "xaddl %0, %1" \ : "=r" (result), "=m" (*mem) \ : "0" (value), "m" (*mem)); \ else \ - __asm __volatile (LOCK_PREFIX "xaddq %q0, %1" \ + __asm__ __volatile__ (LOCK_PREFIX "xaddq %q0, %1" \ : "=r" (result), "=m" (*mem) \ : "0" ((long) (value)), "m" (*mem)); \ result; }) @@ -134,19 +134,19 @@ typedef uintmax_t uatomic_max_t; else if (__builtin_constant_p (value) && (value) == 1) \ atomic_decrement (mem); \ else if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "addb %b1, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "addb %b1, %0" \ : "=m" (*mem) \ : "ir" (value), "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "addw %w1, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "addw %w1, %0" \ : "=m" (*mem) \ : "ir" (value), "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "addl %1, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "addl %1, %0" \ : "=m" (*mem) \ : "ir" (value), "m" (*mem)); \ else \ - __asm __volatile (LOCK_PREFIX "addq %q1, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "addq %q1, %0" \ : "=m" (*mem) \ : "ir" ((long) (value)), "m" (*mem)); \ }) @@ -155,19 +155,19 @@ typedef uintmax_t uatomic_max_t; #define atomic_add_negative(mem, value) \ ({ unsigned char __result; \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "addb %b2, %0; sets %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addb %b2, %0; sets %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" (value), "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "addw %w2, %0; sets %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addw %w2, %0; sets %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" (value), "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "addl %2, %0; sets %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addl %2, %0; sets %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" (value), "m" (*mem)); \ else \ - __asm __volatile (LOCK_PREFIX "addq %q2, %0; sets %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addq %q2, %0; sets %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" ((long) (value)), "m" (*mem)); \ __result; }) @@ -176,19 +176,19 @@ typedef uintmax_t uatomic_max_t; #define atomic_add_zero(mem, value) \ ({ unsigned char __result; \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "addb %b2, %0; setz %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addb %b2, %0; setz %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" (value), "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "addw %w2, %0; setz %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addw %w2, %0; setz %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" (value), "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "addl %2, %0; setz %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addl %2, %0; setz %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" (value), "m" (*mem)); \ else \ - __asm __volatile (LOCK_PREFIX "addq %q2, %0; setz %1" \ + __asm__ __volatile__ (LOCK_PREFIX "addq %q2, %0; setz %1" \ : "=m" (*mem), "=qm" (__result) \ : "ir" ((long) (value)), "m" (*mem)); \ __result; }) @@ -196,19 +196,19 @@ typedef uintmax_t uatomic_max_t; #define atomic_increment(mem) \ (void) ({ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "incb %b0" \ + __asm__ __volatile__ (LOCK_PREFIX "incb %b0" \ : "=m" (*mem) \ : "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "incw %w0" \ + __asm__ __volatile__ (LOCK_PREFIX "incw %w0" \ : "=m" (*mem) \ : "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "incl %0" \ + __asm__ __volatile__ (LOCK_PREFIX "incl %0" \ : "=m" (*mem) \ : "m" (*mem)); \ else \ - __asm __volatile (LOCK_PREFIX "incq %q0" \ + __asm__ __volatile__ (LOCK_PREFIX "incq %q0" \ : "=m" (*mem) \ : "m" (*mem)); \ }) @@ -217,19 +217,19 @@ typedef uintmax_t uatomic_max_t; #define atomic_increment_and_test(mem) \ ({ unsigned char __result; \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "incb %b0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "incb %b0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "incw %w0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "incw %w0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "incl %0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "incl %0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else \ - __asm __volatile (LOCK_PREFIX "incq %q0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "incq %q0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ __result; }) @@ -237,19 +237,19 @@ typedef uintmax_t uatomic_max_t; #define atomic_decrement(mem) \ (void) ({ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "decb %b0" \ + __asm__ __volatile__ (LOCK_PREFIX "decb %b0" \ : "=m" (*mem) \ : "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "decw %w0" \ + __asm__ __volatile__ (LOCK_PREFIX "decw %w0" \ : "=m" (*mem) \ : "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "decl %0" \ + __asm__ __volatile__ (LOCK_PREFIX "decl %0" \ : "=m" (*mem) \ : "m" (*mem)); \ else \ - __asm __volatile (LOCK_PREFIX "decq %q0" \ + __asm__ __volatile__ (LOCK_PREFIX "decq %q0" \ : "=m" (*mem) \ : "m" (*mem)); \ }) @@ -258,19 +258,19 @@ typedef uintmax_t uatomic_max_t; #define atomic_decrement_and_test(mem) \ ({ unsigned char __result; \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "decb %b0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "decb %b0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "decw %w0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "decw %w0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "decl %0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "decl %0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ else \ - __asm __volatile (LOCK_PREFIX "decq %q0; sete %1" \ + __asm__ __volatile__ (LOCK_PREFIX "decq %q0; sete %1" \ : "=m" (*mem), "=qm" (__result) \ : "m" (*mem)); \ __result; }) @@ -278,23 +278,23 @@ typedef uintmax_t uatomic_max_t; #define atomic_bit_set(mem, bit) \ (void) ({ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "orb %b2, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "orb %b2, %0" \ : "=m" (*mem) \ : "m" (*mem), "ir" (1L << (bit))); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "orw %w2, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "orw %w2, %0" \ : "=m" (*mem) \ : "m" (*mem), "ir" (1L << (bit))); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "orl %2, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "orl %2, %0" \ : "=m" (*mem) \ : "m" (*mem), "ir" (1L << (bit))); \ else if (__builtin_constant_p (bit) && (bit) < 32) \ - __asm __volatile (LOCK_PREFIX "orq %2, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "orq %2, %0" \ : "=m" (*mem) \ : "m" (*mem), "i" (1L << (bit))); \ else \ - __asm __volatile (LOCK_PREFIX "orq %q2, %0" \ + __asm__ __volatile__ (LOCK_PREFIX "orq %q2, %0" \ : "=m" (*mem) \ : "m" (*mem), "r" (1UL << (bit))); \ }) @@ -303,19 +303,19 @@ typedef uintmax_t uatomic_max_t; #define atomic_bit_test_set(mem, bit) \ ({ unsigned char __result; \ if (sizeof (*mem) == 1) \ - __asm __volatile (LOCK_PREFIX "btsb %3, %1; setc %0" \ + __asm__ __volatile__ (LOCK_PREFIX "btsb %3, %1; setc %0" \ : "=q" (__result), "=m" (*mem) \ : "m" (*mem), "ir" (bit)); \ else if (sizeof (*mem) == 2) \ - __asm __volatile (LOCK_PREFIX "btsw %3, %1; setc %0" \ + __asm__ __volatile__ (LOCK_PREFIX "btsw %3, %1; setc %0" \ : "=q" (__result), "=m" (*mem) \ : "m" (*mem), "ir" (bit)); \ else if (sizeof (*mem) == 4) \ - __asm __volatile (LOCK_PREFIX "btsl %3, %1; setc %0" \ + __asm__ __volatile__ (LOCK_PREFIX "btsl %3, %1; setc %0" \ : "=q" (__result), "=m" (*mem) \ : "m" (*mem), "ir" (bit)); \ else \ - __asm __volatile (LOCK_PREFIX "btsq %3, %1; setc %0" \ + __asm__ __volatile__ (LOCK_PREFIX "btsq %3, %1; setc %0" \ : "=q" (__result), "=m" (*mem) \ : "m" (*mem), "ir" (bit)); \ __result; }) diff --git a/libc/sysdeps/linux/x86_64/bits/kernel_stat.h b/libc/sysdeps/linux/x86_64/bits/kernel_stat.h index a2af2cd37..7dca5ffbb 100644 --- a/libc/sysdeps/linux/x86_64/bits/kernel_stat.h +++ b/libc/sysdeps/linux/x86_64/bits/kernel_stat.h @@ -1,4 +1,4 @@ -/* Ripped from linux/include/asm-x86_64/stat.h +/* Ripped from linux/include/asm-x86_64/stat.h * and renamed 'struct stat' to 'struct kernel_stat' */ #ifndef _ASM_X86_64_STAT_H diff --git a/libc/sysdeps/linux/x86_64/bits/kernel_types.h b/libc/sysdeps/linux/x86_64/bits/kernel_types.h index 060660cf9..73f6ffb54 100644 --- a/libc/sysdeps/linux/x86_64/bits/kernel_types.h +++ b/libc/sysdeps/linux/x86_64/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/x86_64/bits/syscalls.h b/libc/sysdeps/linux/x86_64/bits/syscalls.h index 7431d6d7f..80f42596a 100644 --- a/libc/sysdeps/linux/x86_64/bits/syscalls.h +++ b/libc/sysdeps/linux/x86_64/bits/syscalls.h @@ -5,7 +5,7 @@ #endif /* - Some of the sneaky macros in the code were taken from + Some of the sneaky macros in the code were taken from glibc-2.2.5/sysdeps/unix/sysv/linux/x86_64/sysdep.h */ @@ -48,7 +48,7 @@ return (type) (INLINE_SYSCALL(name, 3, arg1, arg2, arg3)); \ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ { \ return (type) (INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4)); \ -} +} #undef _syscall5 #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ diff --git a/libc/sysdeps/linux/xtensa/bits/kernel_stat.h b/libc/sysdeps/linux/xtensa/bits/kernel_stat.h index 6afb3a697..26da9281b 100644 --- a/libc/sysdeps/linux/xtensa/bits/kernel_stat.h +++ b/libc/sysdeps/linux/xtensa/bits/kernel_stat.h @@ -5,8 +5,8 @@ #error bits/kernel_stat.h is for internal uClibc use only! #endif -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a +/* This file provides whatever this particular arch's kernel thinks + * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ #define STAT_HAVE_NSEC 1 diff --git a/libc/sysdeps/linux/xtensa/bits/kernel_types.h b/libc/sysdeps/linux/xtensa/bits/kernel_types.h index f392ba755..44f1075f7 100644 --- a/libc/sysdeps/linux/xtensa/bits/kernel_types.h +++ b/libc/sysdeps/linux/xtensa/bits/kernel_types.h @@ -1,6 +1,6 @@ /* Note that we use the exact same include guard #define names - * as asm/posix_types.h. This will avoid gratuitous conflicts - * with the posix_types.h kernel header, and will ensure that + * as asm/posix_types.h. This will avoid gratuitous conflicts + * with the posix_types.h kernel header, and will ensure that * our private content, and not the kernel header, will win. * -Erik */ diff --git a/libc/sysdeps/linux/xtensa/bits/syscalls.h b/libc/sysdeps/linux/xtensa/bits/syscalls.h index e0506e4cc..a59a8052a 100644 --- a/libc/sysdeps/linux/xtensa/bits/syscalls.h +++ b/libc/sysdeps/linux/xtensa/bits/syscalls.h @@ -5,7 +5,7 @@ #endif /* - Some of the sneaky macros in the code were taken from + Some of the sneaky macros in the code were taken from glibc .../sysdeps/unix/sysv/linux/xtensa/sysdep.h */ @@ -123,7 +123,7 @@ #define C_DECL_ARGS_5(t, v, args...) t v, C_DECL_ARGS_4(args) #define C_DECL_ARGS_6(t, v, args...) t v, C_DECL_ARGS_5(args) -#define C_ARGS_0() +#define C_ARGS_0() #define C_ARGS_1(t, v) v #define C_ARGS_2(t, v, args...) v, C_ARGS_1 (args) #define C_ARGS_3(t, v, args...) v, C_ARGS_2 (args) diff --git a/libc/sysdeps/linux/xtensa/fork.c b/libc/sysdeps/linux/xtensa/fork.c index 034844122..b06d934fb 100644 --- a/libc/sysdeps/linux/xtensa/fork.c +++ b/libc/sysdeps/linux/xtensa/fork.c @@ -5,7 +5,7 @@ * Copyright (C) 2007 Tensilica Inc. * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - */ + */ #include <unistd.h> #include <sys/syscall.h> diff --git a/libc/sysdeps/linux/xtensa/pread_write.c b/libc/sysdeps/linux/xtensa/pread_write.c index 9e8813210..40d0f0324 100644 --- a/libc/sysdeps/linux/xtensa/pread_write.c +++ b/libc/sysdeps/linux/xtensa/pread_write.c @@ -31,7 +31,7 @@ extern __typeof(pwrite64) __libc_pwrite64; # define __NR___syscall_pread __NR_pread /* On Xtensa, 64-bit values are aligned in even/odd register pairs. */ -static inline _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, +static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, int, pad, off_t, offset_hi, off_t, offset_lo); ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) @@ -56,7 +56,7 @@ weak_alias(__libc_pread64,pread64) # define __NR___syscall_pwrite __NR_pwrite /* On Xtensa, 64-bit values are aligned in even/odd register pairs. */ -static inline _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, +static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, size_t, count, int, pad, off_t, offset_hi, off_t, offset_lo); ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) diff --git a/libc/sysdeps/linux/xtensa/sigaction.c b/libc/sysdeps/linux/xtensa/sigaction.c index 60d915c56..790a8f21f 100644 --- a/libc/sysdeps/linux/xtensa/sigaction.c +++ b/libc/sysdeps/linux/xtensa/sigaction.c @@ -5,7 +5,7 @@ * Copyright (C) 2007, 2008 Tensilica Inc. * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - */ + */ #include <errno.h> #include <signal.h> @@ -13,13 +13,13 @@ #include <string.h> #include <bits/kernel_sigaction.h> -#define SA_RESTORER 0x04000000 +#define SA_RESTORER 0x04000000 extern void __default_sa_restorer (void); /* Experimentally off - libc_hidden_proto(memcpy) */ -int __libc_sigaction (int signum, const struct sigaction *act, +int __libc_sigaction (int signum, const struct sigaction *act, struct sigaction *oldact) { struct kernel_sigaction kact, koldact; |