summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/powerpc')
-rw-r--r--libc/sysdeps/linux/powerpc/bits/fcntl.h8
-rw-r--r--libc/sysdeps/linux/powerpc/bits/mathdef.h8
-rw-r--r--libc/sysdeps/linux/powerpc/bits/wordsize.h4
-rw-r--r--libc/sysdeps/linux/powerpc/ioctl.c10
-rw-r--r--libc/sysdeps/linux/powerpc/pread_write.c29
5 files changed, 27 insertions, 32 deletions
diff --git a/libc/sysdeps/linux/powerpc/bits/fcntl.h b/libc/sysdeps/linux/powerpc/bits/fcntl.h
index a96abc974..ceb75b4f1 100644
--- a/libc/sysdeps/linux/powerpc/bits/fcntl.h
+++ b/libc/sysdeps/linux/powerpc/bits/fcntl.h
@@ -189,8 +189,7 @@ struct flock64
#endif
-#ifdef __USE_GNU
-#if 0
+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
/* Flags for SYNC_FILE_RANGE. */
# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
in the range before performing the
@@ -201,7 +200,6 @@ struct flock64
# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
the range after performing the
write. */
-#endif
/* Flags for SPLICE and VMSPLICE. */
# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
@@ -214,18 +212,16 @@ struct flock64
__BEGIN_DECLS
-#ifdef __USE_GNU
+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
/* Provide kernel hint to read ahead. */
extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
__THROW;
-#if 0
/* Selective file content synch'ing. */
extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
unsigned int __flags);
-#endif
/* Splice address range into a pipe. */
extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
diff --git a/libc/sysdeps/linux/powerpc/bits/mathdef.h b/libc/sysdeps/linux/powerpc/bits/mathdef.h
index f28bacece..81a46ddcd 100644
--- a/libc/sysdeps/linux/powerpc/bits/mathdef.h
+++ b/libc/sysdeps/linux/powerpc/bits/mathdef.h
@@ -65,13 +65,11 @@ typedef double double_t;
#endif /* ISO C99 */
-#ifndef __NO_LONG_DOUBLE_MATH
+#ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__
#include <bits/wordsize.h>
/* Signal that we do not really have a `long double'. The disables the
declaration of all the `long double' function variants. */
# if __WORDSIZE == 32
-# define __NO_LONG_DOUBLE_MATH 1
-# elif !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-# define __NO_LONG_DOUBLE_MATH 1
+# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
# endif /* __WORDSIZE == 32 */
-#endif /* __NO_LONG_DOUBLE_MATH */
+#endif /* __UCLIBC_HAS_LONG_DOUBLE_MATH__ */
diff --git a/libc/sysdeps/linux/powerpc/bits/wordsize.h b/libc/sysdeps/linux/powerpc/bits/wordsize.h
index cf934234f..dc19246d7 100644
--- a/libc/sysdeps/linux/powerpc/bits/wordsize.h
+++ b/libc/sysdeps/linux/powerpc/bits/wordsize.h
@@ -7,13 +7,13 @@
# define __WORDSIZE 32
#endif
-#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
+#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __LONG_DOUBLE_MATH_OPTIONAL
/* Signal the glibc ABI didn't used to have a `long double'.
The changes all the `long double' function variants to be redirects
to the double functions. */
# define __LONG_DOUBLE_MATH_OPTIONAL 1
# ifndef __LONG_DOUBLE_128__
-# define __NO_LONG_DOUBLE_MATH 1
+# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
# endif
#endif
diff --git a/libc/sysdeps/linux/powerpc/ioctl.c b/libc/sysdeps/linux/powerpc/ioctl.c
index 7f92be410..06f12eed4 100644
--- a/libc/sysdeps/linux/powerpc/ioctl.c
+++ b/libc/sysdeps/linux/powerpc/ioctl.c
@@ -22,17 +22,17 @@
#include <sys/ioctl.h>
#include <sys/syscall.h>
-libc_hidden_proto(ioctl)
+/* libc_hidden_proto(ioctl) */
-libc_hidden_proto(tcsetattr)
-libc_hidden_proto(tcgetattr)
+/* libc_hidden_proto(tcsetattr) */
+/* libc_hidden_proto(tcgetattr) */
/* The user-visible size of struct termios has changed. Catch ioctl calls
using the new-style struct termios, and translate them to old-style. */
#define __NR___syscall_ioctl __NR_ioctl
-static inline
-_syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg);
+static __always_inline
+_syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg)
int ioctl (int fd, unsigned long int request, ...)
diff --git a/libc/sysdeps/linux/powerpc/pread_write.c b/libc/sysdeps/linux/powerpc/pread_write.c
index cdbadfdf3..dcdb39be1 100644
--- a/libc/sysdeps/linux/powerpc/pread_write.c
+++ b/libc/sysdeps/linux/powerpc/pread_write.c
@@ -14,6 +14,7 @@
#include <sys/syscall.h>
#include <unistd.h>
+#include <endian.h>
#ifndef __UCLIBC_HAS_LFS__
# define off64_t off_t
@@ -22,12 +23,12 @@
#ifdef __NR_pread
extern __typeof(pread) __libc_pread;
# define __NR___syscall_pread __NR_pread
-static __inline__ _syscall4(ssize_t, __syscall_pread, int, fd,
- void *, buf, size_t, count, off64_t, offset);
+static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd,
+ void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
{
- return(__syscall_pread(fd, buf, count, (off64_t)offset));
+ return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 31, offset)));
}
weak_alias(__libc_pread,pread)
@@ -35,7 +36,7 @@ weak_alias(__libc_pread,pread)
extern __typeof(pread64) __libc_pread64;
ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
{
- return(__syscall_pread(fd, buf, count, offset));
+ return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 32, offset)));
}
weak_alias(__libc_pread64,pread64)
# endif /* __UCLIBC_HAS_LFS__ */
@@ -45,12 +46,12 @@ weak_alias(__libc_pread64,pread64)
#ifdef __NR_pwrite
extern __typeof(pwrite) __libc_pwrite;
# define __NR___syscall_pwrite __NR_pwrite
-static __inline__ _syscall4(ssize_t, __syscall_pwrite, int, fd,
- const void *, buf, size_t, count, off64_t, offset);
+static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd,
+ const void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
{
- return(__syscall_pwrite(fd, buf, count, (off64_t)offset));
+ return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 31, offset)));
}
weak_alias(__libc_pwrite,pwrite)
@@ -58,7 +59,7 @@ weak_alias(__libc_pwrite,pwrite)
extern __typeof(pwrite64) __libc_pwrite64;
ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
{
- return(__syscall_pwrite(fd, buf, count, offset));
+ return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 32, offset)));
}
weak_alias(__libc_pwrite64,pwrite64)
# endif /* __UCLIBC_HAS_LFS__ */
@@ -67,9 +68,9 @@ weak_alias(__libc_pwrite64,pwrite64)
#if ! defined __NR_pread || ! defined __NR_pwrite
-libc_hidden_proto(read)
-libc_hidden_proto(write)
-libc_hidden_proto(lseek)
+/* libc_hidden_proto(read) */
+/* libc_hidden_proto(write) */
+/* libc_hidden_proto(lseek) */
static ssize_t __fake_pread_write(int fd, void *buf,
size_t count, off_t offset, int do_pwrite)
@@ -87,7 +88,7 @@ static ssize_t __fake_pread_write(int fd, void *buf,
if (lseek (fd, offset, SEEK_SET) == (off_t) -1)
return -1;
- if (do_pwrite==1) {
+ if (do_pwrite == 1) {
/* Write the data. */
result = write(fd, buf, count);
} else {
@@ -109,7 +110,7 @@ static ssize_t __fake_pread_write(int fd, void *buf,
}
# ifdef __UCLIBC_HAS_LFS__
-libc_hidden_proto(lseek64)
+/* libc_hidden_proto(lseek64) */
static ssize_t __fake_pread_write64(int fd, void *buf,
size_t count, off64_t offset, int do_pwrite)
@@ -127,7 +128,7 @@ static ssize_t __fake_pread_write64(int fd, void *buf,
if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1)
return -1;
- if (do_pwrite==1) {
+ if (do_pwrite == 1) {
/* Write the data. */
result = write(fd, buf, count);
} else {