summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/m68k
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/m68k')
-rw-r--r--libc/sysdeps/linux/m68k/bits/fcntl.h37
-rw-r--r--libc/sysdeps/linux/m68k/bits/mathdef.h9
-rw-r--r--libc/sysdeps/linux/m68k/bits/mathinline.h77
-rw-r--r--libc/sysdeps/linux/m68k/bits/stat.h27
4 files changed, 98 insertions, 52 deletions
diff --git a/libc/sysdeps/linux/m68k/bits/fcntl.h b/libc/sysdeps/linux/m68k/bits/fcntl.h
index 90c0a481e..6983cd410 100644
--- a/libc/sysdeps/linux/m68k/bits/fcntl.h
+++ b/libc/sysdeps/linux/m68k/bits/fcntl.h
@@ -23,6 +23,9 @@
#include <sys/types.h>
+#ifdef __USE_GNU
+# include <bits/uio.h>
+#endif
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
@@ -179,10 +182,44 @@ struct flock64
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+#ifdef __USE_GNU
+# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
+ in the range before performing the
+ write. */
+# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those
+ dirty pages in the range which are
+ not presently under writeback. */
+# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
+ the range after performing the
+ write. */
+#endif
+
__BEGIN_DECLS
+#if 0 /*def __USE_GNU*/
+
/* Provide kernel hint to read ahead. */
extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
__THROW;
+
+/* Selective file content synch'ing. */
+extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
+ unsigned int __flags);
+
+
+/* Splice address range into a pipe. */
+extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
+ unsigned int __flags);
+
+/* Splice two files together. */
+extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
+ __THROW;
+
+/* In-kernel implementation of tee for pipe buffers. */
+extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
+ __THROW;
+
+#endif
+
__END_DECLS
diff --git a/libc/sysdeps/linux/m68k/bits/mathdef.h b/libc/sysdeps/linux/m68k/bits/mathdef.h
index 90146f17a..a69e93089 100644
--- a/libc/sysdeps/linux/m68k/bits/mathdef.h
+++ b/libc/sysdeps/linux/m68k/bits/mathdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,11 +31,12 @@ typedef long double float_t; /* `float' expressions are evaluated as
typedef long double double_t; /* `double' expressions are evaluated as
`long double'. */
-/* Define `INFINITY' as value of type `float'. */
-# define INFINITY HUGE_VALF
-
/* The values returned by `ilogb' for 0 and NaN respectively. */
# define FP_ILOGB0 (-2147483647 - 1)
# define FP_ILOGBNAN (2147483647)
#endif /* ISO C99 */
+
+#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
+# define __NO_LONG_DOUBLE_MATH 1
+#endif
diff --git a/libc/sysdeps/linux/m68k/bits/mathinline.h b/libc/sysdeps/linux/m68k/bits/mathinline.h
index 81aab8881..acbac47aa 100644
--- a/libc/sysdeps/linux/m68k/bits/mathinline.h
+++ b/libc/sysdeps/linux/m68k/bits/mathinline.h
@@ -1,5 +1,6 @@
/* Definitions of inline math functions implemented by the m68881/2.
- Copyright (C) 1991,92,93,94,96,97,98,99,2000 Free Software Foundation, Inc.
+ Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,52 +21,60 @@
#ifdef __GNUC__
#ifdef __USE_ISOC99
-
+/* GCC 3.1 and up have builtins that actually can be used. */
+# if !__GNUC_PREREQ (3,1)
/* ISO C99 defines some macros to perform unordered comparisons. The
m68k FPU supports this with special opcodes and we should use them.
These must not be inline functions since we have to be able to handle
all floating-point types. */
-# define isgreater(x, y) \
+# undef isgreater
+# undef isgreaterequal
+# undef isless
+# undef islessequal
+# undef islessgreater
+# undef isunordered
+# define isgreater(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsogt %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
-# define isgreaterequal(x, y) \
+# define isgreaterequal(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsoge %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
-# define isless(x, y) \
+# define isless(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsolt %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
-# define islessequal(x, y) \
+# define islessequal(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsole %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
-# define islessgreater(x, y) \
+# define islessgreater(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsogl %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
-# define isunordered(x, y) \
+# define isunordered(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsun %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
+# endif /* GCC 3.1 */
#endif
@@ -101,7 +110,7 @@
#if defined __USE_MISC || defined __USE_ISOC99
# define __inline_mathop(func, op) \
__inline_mathop1(double, func, op) \
- __inline_mathop1(float, __CONCAT(func,f), op) \
+ __inline_mathop1(float, __CONCAT(func,f), op) \
__inline_mathop1(long double, __CONCAT(func,l), op)
#else
# define __inline_mathop(func, op) \
@@ -166,29 +175,7 @@ __inline_mathop(trunc, intrz)
for the function names. */
#define __inline_functions(float_type, s) \
-__m81_inline float_type \
-__m81_u(__CONCAT(__frexp,s))(float_type __value, int *__expptr) \
-{ \
- float_type __mantissa, __exponent; \
- int __iexponent; \
- unsigned long __fpsr; \
- __asm("ftst%.x %1\n" \
- "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \
- if (__fpsr & (7 << 24)) \
- { \
- /* Not finite or zero. */ \
- *__expptr = 0; \
- return __value; \
- } \
- __asm("fgetexp%.x %1, %0" : "=f" (__exponent) : "f" (__value)); \
- __iexponent = (int) __exponent + 1; \
- *__expptr = __iexponent; \
- __asm("fscale%.l %2, %0" : "=f" (__mantissa) \
- : "0" (__value), "dmi" (-__iexponent)); \
- return __mantissa; \
-} \
- \
-__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \
+__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \
{ \
float_type __result; \
unsigned long int __ctrl_reg; \
@@ -204,7 +191,7 @@ __m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \
return __result; \
} \
\
-__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \
+__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \
{ \
float_type __result; \
unsigned long int __ctrl_reg; \
@@ -230,7 +217,7 @@ __inline_functions(long double,l)
#ifdef __USE_MISC
# define __inline_functions(float_type, s) \
-__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \
+__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \
{ \
/* There is no branch-condition for infinity, \
so we must extract and examine the condition codes manually. */ \
@@ -240,7 +227,7 @@ __m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \
return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \
} \
\
-__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \
+__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \
{ \
/* There is no branch-condition for infinity, so we must extract and \
examine the condition codes manually. */ \
@@ -268,7 +255,7 @@ __inline_functions(long double,l)
#if defined __USE_MISC || defined __USE_XOPEN
# define __inline_functions(float_type, s) \
-__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \
+__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \
{ \
char __result; \
__asm("ftst%.x %1\n" \
@@ -288,7 +275,7 @@ __inline_functions(long double,l)
#ifdef __USE_ISOC99
# define __inline_functions(float_type, s) \
-__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \
+__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \
{ \
/* There is no branch-condition for the sign bit, so we must extract \
and examine the condition codes manually. */ \
@@ -298,7 +285,7 @@ __m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \
return (__fpsr >> 27) & 1; \
} \
\
-__m81_defun (float_type, __CONCAT(__scalbln,s), \
+ __m81_defun (float_type, __CONCAT(__scalbln,s), \
(float_type __x, long int __n)) \
{ \
return __CONCAT(__scalbn,s) (__x, __n); \
@@ -364,10 +351,10 @@ __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__)) \
-name args1 \
-{ \
- return __CONCAT(__,name) args2; \
+extern __inline rettype __attribute__((__const__)) \
+ name args1 \
+{ \
+ return __CONCAT(__,name) args2; \
}
# define __inline_forward(rettype, name, args1, args2) \
@@ -376,8 +363,6 @@ extern __inline rettype name args1 \
return __CONCAT(__,name) args2; \
}
-__inline_forward(double,frexp, (double __value, int *__expptr),
- (__value, __expptr))
__inline_forward_c(double,floor, (double __x), (__x))
__inline_forward_c(double,ceil, (double __x), (__x))
# ifdef __USE_MISC
@@ -406,8 +391,6 @@ __inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
# if defined __USE_MISC || defined __USE_ISOC99
-__inline_forward(float,frexpf, (float __value, int *__expptr),
- (__value, __expptr))
__inline_forward_c(float,floorf, (float __x), (__x))
__inline_forward_c(float,ceilf, (float __x), (__x))
# ifdef __USE_MISC
@@ -428,8 +411,6 @@ __inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx),
(__x, __sinx, __cosx))
# endif
-__inline_forward(long double,frexpl, (long double __value, int *__expptr),
- (__value, __expptr))
__inline_forward_c(long double,floorl, (long double __x), (__x))
__inline_forward_c(long double,ceill, (long double __x), (__x))
# ifdef __USE_MISC
diff --git a/libc/sysdeps/linux/m68k/bits/stat.h b/libc/sysdeps/linux/m68k/bits/stat.h
index a435240cd..a0fefbe2b 100644
--- a/libc/sysdeps/linux/m68k/bits/stat.h
+++ b/libc/sysdeps/linux/m68k/bits/stat.h
@@ -61,12 +61,27 @@ struct stat
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
+#if 0 /*def __USE_MISC*/
+ /* Nanosecond resolution timestamps are stored in a format
+ equivalent to 'struct timespec'. This is the type used
+ whenever possible but the Unix namespace rules do not allow the
+ identifier 'timespec' to appear in the <sys/stat.h> header.
+ Therefore we have to handle the use of this header in strictly
+ standard-compliant sources special. */
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+# define st_atime st_atim.tv_sec /* Backward compatibility. */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
__time_t st_atime; /* Time of last access. */
unsigned long int st_atimensec; /* Nscecs of last access. */
__time_t st_mtime; /* Time of last modification. */
unsigned long int st_mtimensec; /* Nsecs of last modification. */
__time_t st_ctime; /* Time of last status change. */
unsigned long int st_ctimensec; /* Nsecs of last status change. */
+#endif
#ifndef __USE_FILE_OFFSET64
unsigned long int __unused4;
unsigned long int __unused5;
@@ -92,12 +107,24 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
+#if 0 /*def __USE_MISC*/
+ /* Nanosecond resolution timestamps are stored in a format
+ equivalent to 'struct timespec'. This is the type used
+ whenever possible but the Unix namespace rules do not allow the
+ identifier 'timespec' to appear in the <sys/stat.h> header.
+ Therefore we have to handle the use of this header in strictly
+ standard-compliant sources special. */
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+#else
__time_t st_atime; /* Time of last access. */
unsigned long int st_atimensec; /* Nscecs of last access. */
__time_t st_mtime; /* Time of last modification. */
unsigned long int st_mtimensec; /* Nsecs of last modification. */
__time_t st_ctime; /* Time of last status change. */
unsigned long int st_ctimensec; /* Nsecs of last status change. */
+#endif
__ino64_t st_ino; /* File serial number. */
};
#endif