summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/mips
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2008-11-27 14:38:34 +0000
committerCarmelo Amoroso <carmelo.amoroso@st.com>2008-11-27 14:38:34 +0000
commitc836f1ad544d4b57dd1b93c480b7e625f24fb147 (patch)
tree97669f5a5ddf6d10280b4d58dc759459c9613a54 /libc/sysdeps/linux/mips
parent0dbf6abb93407b6aa83f8a3b397cafbd3095cfdc (diff)
downloaduClibc-alpine-c836f1ad544d4b57dd1b93c480b7e625f24fb147.tar.bz2
uClibc-alpine-c836f1ad544d4b57dd1b93c480b7e625f24fb147.tar.xz
Synch with trunk @ 24160
Step 14: miscellaneous merge for arch specific files in libc/sysdeps. Comments, cleanup, formatting, hidden_proto removal and others.
Diffstat (limited to 'libc/sysdeps/linux/mips')
-rw-r--r--libc/sysdeps/linux/mips/bits/atomic.h38
-rw-r--r--libc/sysdeps/linux/mips/bits/fcntl.h8
-rw-r--r--libc/sysdeps/linux/mips/bits/kernel_types.h4
-rw-r--r--libc/sysdeps/linux/mips/bits/mathdef.h6
-rw-r--r--libc/sysdeps/linux/mips/bits/socket.h6
-rw-r--r--libc/sysdeps/linux/mips/brk.c2
-rw-r--r--libc/sysdeps/linux/mips/cacheflush.c4
-rw-r--r--libc/sysdeps/linux/mips/mmap.c4
-rw-r--r--libc/sysdeps/linux/mips/pread_write.c12
-rw-r--r--libc/sysdeps/linux/mips/sigaction.c2
-rw-r--r--libc/sysdeps/linux/mips/sysmips.c2
11 files changed, 44 insertions, 44 deletions
diff --git a/libc/sysdeps/linux/mips/bits/atomic.h b/libc/sysdeps/linux/mips/bits/atomic.h
index ca53d3842..4f73cc261 100644
--- a/libc/sysdeps/linux/mips/bits/atomic.h
+++ b/libc/sysdeps/linux/mips/bits/atomic.h
@@ -110,22 +110,22 @@ typedef uintmax_t uatomic_max_t;
/* For all "bool" routines, we return FALSE if exchange succesful. */
#define __arch_compare_and_exchange_bool_8_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \
!__cmp; })
#define __arch_compare_and_exchange_bool_16_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \
!__cmp; })
#define __arch_compare_and_exchange_bool_32_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \
!__cmp; })
#define __arch_compare_and_exchange_bool_64_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \
!__cmp; })
@@ -133,24 +133,24 @@ typedef uintmax_t uatomic_max_t;
successful or not. */
#define __arch_compare_and_exchange_val_8_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \
- (typeof (*mem))__prev; })
+ (__typeof (*mem))__prev; })
#define __arch_compare_and_exchange_val_16_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \
- (typeof (*mem))__prev; })
+ (__typeof (*mem))__prev; })
#define __arch_compare_and_exchange_val_32_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \
- (typeof (*mem))__prev; })
+ (__typeof (*mem))__prev; })
#define __arch_compare_and_exchange_val_64_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \
- (typeof (*mem))__prev; })
+ (__typeof (*mem))__prev; })
/* Compare and exchange with "acquire" semantics, ie barrier after. */
@@ -183,7 +183,7 @@ typedef uintmax_t uatomic_max_t;
(abort (), 0)
#define __arch_exchange_xxx_32_int(mem, newval, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__asm__ __volatile__ ("\n" \
".set push\n\t" \
MIPS_PUSH_MIPS2 \
@@ -207,7 +207,7 @@ typedef uintmax_t uatomic_max_t;
(abort (), 0)
#else
#define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__asm__ __volatile__ ("\n" \
".set push\n\t" \
MIPS_PUSH_MIPS2 \
@@ -236,13 +236,13 @@ typedef uintmax_t uatomic_max_t;
/* Atomically add value and return the previous (unincremented) value. */
#define __arch_exchange_and_add_8_int(mem, newval, rel, acq) \
- (abort (), (typeof(*mem)) 0)
+ (abort (), (__typeof(*mem)) 0)
#define __arch_exchange_and_add_16_int(mem, newval, rel, acq) \
- (abort (), (typeof(*mem)) 0)
+ (abort (), (__typeof(*mem)) 0)
#define __arch_exchange_and_add_32_int(mem, value, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__asm__ __volatile__ ("\n" \
".set push\n\t" \
MIPS_PUSH_MIPS2 \
@@ -263,10 +263,10 @@ typedef uintmax_t uatomic_max_t;
#if _MIPS_SIM == _ABIO32
/* We can't do an atomic 64-bit operation in O32. */
#define __arch_exchange_and_add_64_int(mem, value, rel, acq) \
- (abort (), (typeof(*mem)) 0)
+ (abort (), (__typeof(*mem)) 0)
#else
#define __arch_exchange_and_add_64_int(mem, value, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
+({ __typeof (*mem) __prev; int __cmp; \
__asm__ __volatile__ ( \
".set push\n\t" \
MIPS_PUSH_MIPS2 \
diff --git a/libc/sysdeps/linux/mips/bits/fcntl.h b/libc/sysdeps/linux/mips/bits/fcntl.h
index 90011d5d0..ef015a4b0 100644
--- a/libc/sysdeps/linux/mips/bits/fcntl.h
+++ b/libc/sysdeps/linux/mips/bits/fcntl.h
@@ -209,8 +209,7 @@ struct flock64
#endif
-#ifdef __USE_GNU
-#if 0
+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
/* Flags for SYNC_FILE_RANGE. */
# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
in the range before performing the
@@ -221,7 +220,6 @@ struct flock64
# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
the range after performing the
write. */
-#endif
/* Flags for SPLICE and VMSPLICE. */
# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
@@ -234,18 +232,16 @@ struct flock64
__BEGIN_DECLS
-#ifdef __USE_GNU
+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
/* Provide kernel hint to read ahead. */
extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
__THROW;
-#if 0
/* Selective file content synch'ing. */
extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
unsigned int __flags);
-#endif
/* Splice address range into a pipe. */
extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
diff --git a/libc/sysdeps/linux/mips/bits/kernel_types.h b/libc/sysdeps/linux/mips/bits/kernel_types.h
index b7e61bd6b..9fc3b9672 100644
--- a/libc/sysdeps/linux/mips/bits/kernel_types.h
+++ b/libc/sysdeps/linux/mips/bits/kernel_types.h
@@ -1,6 +1,6 @@
/* Note that we use the exact same include guard #define names
- * as asm/posix_types.h. This will avoid gratuitous conflicts
- * with the posix_types.h kernel header, and will ensure that
+ * as asm/posix_types.h. This will avoid gratuitous conflicts
+ * with the posix_types.h kernel header, and will ensure that
* our private content, and not the kernel header, will win.
* -Erik
*/
diff --git a/libc/sysdeps/linux/mips/bits/mathdef.h b/libc/sysdeps/linux/mips/bits/mathdef.h
index 331da13a9..b741f6551 100644
--- a/libc/sysdeps/linux/mips/bits/mathdef.h
+++ b/libc/sysdeps/linux/mips/bits/mathdef.h
@@ -39,10 +39,8 @@ typedef double double_t; /* `double' expressions are evaluated as
#endif /* ISO C99 */
-#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32
+#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && _MIPS_SIM == _ABIO32
/* Signal that we do not really have a `long double'. This disables the
declaration of all the `long double' function variants. */
-# define __NO_LONG_DOUBLE_MATH 1
-#elif !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-# define __NO_LONG_DOUBLE_MATH 1
+# error defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ and _MIPS_SIM == _ABIO32
#endif
diff --git a/libc/sysdeps/linux/mips/bits/socket.h b/libc/sysdeps/linux/mips/bits/socket.h
index c43a4cd2e..0860b4d38 100644
--- a/libc/sysdeps/linux/mips/bits/socket.h
+++ b/libc/sysdeps/linux/mips/bits/socket.h
@@ -315,7 +315,13 @@ struct ucred
};
/* Get socket manipulation related informations from kernel headers. */
+#ifndef __GLIBC__
+#define __GLIBC__ 2
#include <asm/socket.h>
+#undef __GLIBC__
+#else
+#include <asm/socket.h>
+#endif
/* Structure used to manipulate the SO_LINGER option. */
diff --git a/libc/sysdeps/linux/mips/brk.c b/libc/sysdeps/linux/mips/brk.c
index 36620b210..e1c682902 100644
--- a/libc/sysdeps/linux/mips/brk.c
+++ b/libc/sysdeps/linux/mips/brk.c
@@ -23,7 +23,7 @@
void *__curbrk attribute_hidden = 0;
-libc_hidden_proto(brk)
+/* libc_hidden_proto(brk) */
int brk (void *addr)
{
void *newbrk;
diff --git a/libc/sysdeps/linux/mips/cacheflush.c b/libc/sysdeps/linux/mips/cacheflush.c
index f99c58171..235414dbd 100644
--- a/libc/sysdeps/linux/mips/cacheflush.c
+++ b/libc/sysdeps/linux/mips/cacheflush.c
@@ -21,10 +21,10 @@
#include <sys/syscall.h>
#ifdef __NR_cacheflush
-_syscall3(int, cacheflush, void *, addr, const int, nbytes, const int, op);
+_syscall3(int, cacheflush, void *, addr, const int, nbytes, const int, op)
strong_alias(cacheflush, _flush_cache)
#endif
#ifdef __NR_cachectl
-_syscall3(int, cachectl, void *, addr, const int, nbytes, const int, op);
+_syscall3(int, cachectl, void *, addr, const int, nbytes, const int, op)
#endif
diff --git a/libc/sysdeps/linux/mips/mmap.c b/libc/sysdeps/linux/mips/mmap.c
index 4e0897f45..ff923cf63 100644
--- a/libc/sysdeps/linux/mips/mmap.c
+++ b/libc/sysdeps/linux/mips/mmap.c
@@ -10,7 +10,7 @@
#include <sys/mman.h>
#include <sys/syscall.h>
-libc_hidden_proto(mmap)
+/* libc_hidden_proto(mmap) */
#if 0
/* For now, leave mmap using mmap1 since mmap2 seems
@@ -23,5 +23,5 @@ libc_hidden_proto(mmap)
#endif
_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
- int, flags, int, fd, __off_t, offset);
+ int, flags, int, fd, __off_t, offset)
libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/mips/pread_write.c b/libc/sysdeps/linux/mips/pread_write.c
index 0939e17b6..b1cce027f 100644
--- a/libc/sysdeps/linux/mips/pread_write.c
+++ b/libc/sysdeps/linux/mips/pread_write.c
@@ -40,17 +40,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
# if _MIPS_SIM == _MIPS_SIM_ABI64
# define __NR___libc_pread __NR_pread
-_syscall4(ssize_t, __libc_pread, int, fd, void *, buf, size_t, count, off_t, offset);
+_syscall4(ssize_t, __libc_pread, int, fd, void *, buf, size_t, count, off_t, offset)
weak_alias (__libc_pread, pread)
# ifdef __UCLIBC_HAS_LFS__
# define __NR___libc_pread64 __NR_pread
-_syscall4(ssize_t, __libc_pread64, int, fd, void *, buf, size_t, count, off64_t, offset);
+_syscall4(ssize_t, __libc_pread64, int, fd, void *, buf, size_t, count, off64_t, offset)
weak_alias (__libc_pread64, pread64)
# endif /* __UCLIBC_HAS_LFS__ */
# else /* O32 || N32 */
# define __NR___syscall_pread __NR_pread
static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf,
- size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo);
+ size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
{
@@ -84,17 +84,17 @@ weak_alias(__libc_pread64,pread64)
# if _MIPS_SIM == _MIPS_SIM_ABI64
# define __NR___libc_pwrite __NR_pwrite
-_syscall4(ssize_t, __libc_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset);
+_syscall4(ssize_t, __libc_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset)
weak_alias (__libc_pwrite, pwrite)
# ifdef __UCLIBC_HAS_LFS__
# define __NR___libc_pwrite64 __NR_pwrite
-_syscall4(ssize_t, __libc_pwrite64, int, fd, const void *, buf, size_t, count, off64_t, offset);
+_syscall4(ssize_t, __libc_pwrite64, int, fd, const void *, buf, size_t, count, off64_t, offset)
weak_alias (__libc_pwrite64, pwrite64)
# endif /* __UCLIBC_HAS_LFS__ */
# else /* O32 || N32 */
# define __NR___syscall_pwrite __NR_pwrite
static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf,
- size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo);
+ size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
{
diff --git a/libc/sysdeps/linux/mips/sigaction.c b/libc/sysdeps/linux/mips/sigaction.c
index 39d38b86f..edd265438 100644
--- a/libc/sysdeps/linux/mips/sigaction.c
+++ b/libc/sysdeps/linux/mips/sigaction.c
@@ -125,7 +125,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa
#endif
#ifndef LIBC_SIGACTION
-libc_hidden_proto(sigaction)
+/* libc_hidden_proto(sigaction) */
weak_alias(__libc_sigaction,sigaction)
libc_hidden_weak(sigaction)
#endif
diff --git a/libc/sysdeps/linux/mips/sysmips.c b/libc/sysdeps/linux/mips/sysmips.c
index 020f02dd3..1384782b4 100644
--- a/libc/sysdeps/linux/mips/sysmips.c
+++ b/libc/sysdeps/linux/mips/sysmips.c
@@ -3,5 +3,5 @@
#include <sys/sysmips.h>
#ifdef __NR_sysmips
-_syscall4(int, sysmips, const int, cmd, const long, arg1, const int, arg2, const int, arg3);
+_syscall4(int, sysmips, const int, cmd, const long, arg1, const int, arg2, const int, arg3)
#endif