summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/cris
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/cris')
-rw-r--r--libc/sysdeps/linux/cris/Makefile.arch10
-rw-r--r--libc/sysdeps/linux/cris/__longjmp.S7
-rw-r--r--libc/sysdeps/linux/cris/bits/byteswap.h79
-rw-r--r--libc/sysdeps/linux/cris/bits/fcntl.h13
-rw-r--r--libc/sysdeps/linux/cris/bits/kernel_stat.h42
-rw-r--r--libc/sysdeps/linux/cris/bits/kernel_types.h2
-rw-r--r--libc/sysdeps/linux/cris/bits/mathcalls.h333
-rw-r--r--libc/sysdeps/linux/cris/bits/mman.h98
-rw-r--r--libc/sysdeps/linux/cris/bits/setjmp.h32
-rw-r--r--libc/sysdeps/linux/cris/bits/stackinfo.h5
-rw-r--r--libc/sysdeps/linux/cris/bits/syscalls.h77
-rw-r--r--libc/sysdeps/linux/cris/bits/termios.h5
-rw-r--r--libc/sysdeps/linux/cris/bits/uClibc_arch_features.h16
-rw-r--r--libc/sysdeps/linux/cris/bits/uClibc_page.h4
-rw-r--r--libc/sysdeps/linux/cris/bits/wordsize.h3
-rw-r--r--libc/sysdeps/linux/cris/brk.c1
-rw-r--r--libc/sysdeps/linux/cris/clone.S3
-rw-r--r--libc/sysdeps/linux/cris/crti.S8
-rw-r--r--libc/sysdeps/linux/cris/crtn.S2
-rw-r--r--libc/sysdeps/linux/cris/fork.c19
-rw-r--r--libc/sysdeps/linux/cris/jmpbuf-offsets.h8
-rw-r--r--libc/sysdeps/linux/cris/jmpbuf-unwind.h12
-rw-r--r--libc/sysdeps/linux/cris/sbrk.c1
-rw-r--r--libc/sysdeps/linux/cris/setjmp.S6
-rw-r--r--libc/sysdeps/linux/cris/sys/procfs.h9
-rw-r--r--libc/sysdeps/linux/cris/sys/ucontext.h5
-rw-r--r--libc/sysdeps/linux/cris/sys/user.h81
-rw-r--r--libc/sysdeps/linux/cris/syscall.S3
-rw-r--r--libc/sysdeps/linux/cris/sysdep.S5
-rw-r--r--libc/sysdeps/linux/cris/sysdep.h15
-rw-r--r--libc/sysdeps/linux/cris/vfork.S30
31 files changed, 224 insertions, 710 deletions
diff --git a/libc/sysdeps/linux/cris/Makefile.arch b/libc/sysdeps/linux/cris/Makefile.arch
index 850c83de5..178294215 100644
--- a/libc/sysdeps/linux/cris/Makefile.arch
+++ b/libc/sysdeps/linux/cris/Makefile.arch
@@ -5,11 +5,7 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC := __init_brk.c brk.c sbrk.c
+CSRC-y := __init_brk.c brk.c sbrk.c
-SSRC := setjmp.S __longjmp.S clone.S sysdep.S syscall.S
-ifeq ($(UNIFIED_SYSCALL),y)
-SSRC += __uClibc_syscall.S
-endif
-
-include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch
+SSRC-y := setjmp.S __longjmp.S clone.S sysdep.S syscall.S vfork.S
+SSRC-$(UNIFIED_SYSCALL) += __uClibc_syscall.S
diff --git a/libc/sysdeps/linux/cris/__longjmp.S b/libc/sysdeps/linux/cris/__longjmp.S
index 52a986fd9..196fdfd1f 100644
--- a/libc/sysdeps/linux/cris/__longjmp.S
+++ b/libc/sysdeps/linux/cris/__longjmp.S
@@ -14,14 +14,9 @@
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. */
+ see <http://www.gnu.org/licenses/>. */
-#include <features.h>
#include "sysdep.h"
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
.syntax no_register_prefix
diff --git a/libc/sysdeps/linux/cris/bits/byteswap.h b/libc/sysdeps/linux/cris/bits/byteswap.h
index 4027456ac..a82f9c098 100644
--- a/libc/sysdeps/linux/cris/bits/byteswap.h
+++ b/libc/sysdeps/linux/cris/bits/byteswap.h
@@ -1,83 +1,20 @@
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H 1
+#ifndef _ASM_BITS_BYTESWAP_H
+#define _ASM_BITS_BYTESWAP_H 1
/* CRIS specific byte swap operations: 16, 32 and 64-bit */
-/* Swap bytes in 16 bit value. */
-#define __bswap_constant_16(x) \
-({ \
- unsigned short __x = (x); \
- ((unsigned short)( \
- (((unsigned short)(__x) & (unsigned short)0x00ffu) << 8) | \
- (((unsigned short)(__x) & (unsigned short)0xff00u) >> 8) )); \
-})
-
-#if defined __GNUC__ && __GNUC__ >= 2
-# define __bswap_16(x) \
+#define __bswap_non_constant_16(x) \
__extension__ \
({ unsigned short __bswap_16_v; \
- if (__builtin_constant_p (x)) \
- __bswap_16_v = __bswap_constant_16 (x); \
- else \
- __asm__ ("swapb %0" : "=r" (__bswap_16_v) : "0" (x)); \
+ __asm__ ("swapb %0" : "=r" (__bswap_16_v) : "0" (x)); \
__bswap_16_v; })
-#else
-# define __bswap_16(x) __bswap_constant_16 (x)
-#endif
-
-
-/* Swap bytes in 32 bit value. */
-#define __bswap_constant_32(x) \
-({ \
- unsigned long __x = (x); \
- ((unsigned long)( \
- (((unsigned long)(__x) & (unsigned long)0x000000fful) << 24) | \
- (((unsigned long)(__x) & (unsigned long)0x0000ff00ul) << 8) | \
- (((unsigned long)(__x) & (unsigned long)0x00ff0000ul) >> 8) | \
- (((unsigned long)(__x) & (unsigned long)0xff000000ul) >> 24) )); \
-})
-#if defined __GNUC__ && __GNUC__ >= 2
-# define __bswap_32(x) \
+#define __bswap_non_constant_32(x) \
__extension__ \
- ({ unsigned long __bswap_32_v; \
- if (__builtin_constant_p (x)) \
- __bswap_32_v = __bswap_constant_32 (x); \
- else \
- __asm__ ("swapwb %0" : "=r" (__bswap_32_v) : "0" (x)); \
+ ({ unsigned int __bswap_32_v; \
+ __asm__ ("swapwb %0" : "=r" (__bswap_32_v) : "0" (x)); \
__bswap_32_v; })
-#else
-# define __bswap_32(x) __bswap_constant_32 (x)
-#endif
-
-
-/* Swap bytes in 64 bit value. */
-# define __bswap_constant_64(x) \
- ((((x) & 0xff00000000000000ull) >> 56) \
- | (((x) & 0x00ff000000000000ull) >> 40) \
- | (((x) & 0x0000ff0000000000ull) >> 24) \
- | (((x) & 0x000000ff00000000ull) >> 8) \
- | (((x) & 0x00000000ff000000ull) << 8) \
- | (((x) & 0x0000000000ff0000ull) << 24) \
- | (((x) & 0x000000000000ff00ull) << 40) \
- | (((x) & 0x00000000000000ffull) << 56))
-#if defined __GNUC__ && __GNUC__ >= 2
-# define __bswap_64(x) \
- (__extension__ \
- ({ union { __extension__ unsigned long long int __ll; \
- unsigned int __l[2]; } __w, __r; \
- if (__builtin_constant_p (x)) \
- __r.__ll = __bswap_constant_64 (x); \
- else \
- { \
- __w.__ll = (x); \
- __r.__l[0] = __bswap_32 (__w.__l[1]); \
- __r.__l[1] = __bswap_32 (__w.__l[0]); \
- } \
- __r.__ll; }))
-#else
-# define __bswap_64(x) __bswap_constant_64 (x)
#endif
-#endif /* _BITS_BYTESWAP_H */
+#include <bits/byteswap-common.h>
diff --git a/libc/sysdeps/linux/cris/bits/fcntl.h b/libc/sysdeps/linux/cris/bits/fcntl.h
index 2637a6b63..b6a755be1 100644
--- a/libc/sysdeps/linux/cris/bits/fcntl.h
+++ b/libc/sysdeps/linux/cris/bits/fcntl.h
@@ -14,9 +14,8 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _FCNTL_H
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
@@ -50,6 +49,8 @@
# define O_DIRECTORY 0200000 /* Must be a directory. */
# define O_NOFOLLOW 0400000 /* Do not follow links. */
# define O_NOATIME 01000000 /* Do not set atime. */
+# define O_CLOEXEC 02000000 /* set close_on_exec */
+# define O_PATH 010000000 /* Resolve pathname but do not open file. */
#endif
/* For now Linux has synchronisity options for data and read operations.
@@ -99,6 +100,8 @@
# define F_NOTIFY 1026 /* Request notfications on a directory. */
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
close-on-exit set on new fd. */
+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
#endif
/* For F_[GET|SET]FL. */
@@ -186,7 +189,7 @@ struct flock64
#endif
-#ifdef __USE_GNU
+#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
@@ -209,7 +212,7 @@ 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)
diff --git a/libc/sysdeps/linux/cris/bits/kernel_stat.h b/libc/sysdeps/linux/cris/bits/kernel_stat.h
index 50202e542..619f35e9e 100644
--- a/libc/sysdeps/linux/cris/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/cris/bits/kernel_stat.h
@@ -1,25 +1,7 @@
/* Taken from linux/include/asm-cris/stat.h */
-#ifndef _CRIS_STAT_H
-#define _CRIS_STAT_H
-
-#ifndef _LIBC
-#error bits/kernel_stat.h is for internal uClibc use only!
-#endif
-
-struct __old_kernel_stat {
- unsigned short st_dev;
- unsigned short st_ino;
- unsigned short st_mode;
- unsigned short st_nlink;
- unsigned short st_uid;
- unsigned short st_gid;
- unsigned short st_rdev;
- unsigned long st_size;
- unsigned long st_atime;
- unsigned long st_mtime;
- unsigned long st_ctime;
-};
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
struct kernel_stat {
unsigned short st_dev;
@@ -34,12 +16,9 @@ struct kernel_stat {
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long __unused1;
- unsigned long st_mtime;
- unsigned long __unused2;
- unsigned long st_ctime;
- unsigned long __unused3;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long __unused4;
unsigned long __unused5;
};
@@ -69,14 +48,9 @@ struct kernel_stat64 {
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
unsigned long __pad4; /* future possible st_blocks high bits */
- unsigned long st_atime;
- unsigned long __pad5;
-
- unsigned long st_mtime;
- unsigned long __pad6;
-
- unsigned long st_ctime;
- unsigned long __pad7; /* will be high 32 bits of ctime someday */
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long st_ino;
};
diff --git a/libc/sysdeps/linux/cris/bits/kernel_types.h b/libc/sysdeps/linux/cris/bits/kernel_types.h
index f122c7f57..5d31f7b6a 100644
--- a/libc/sysdeps/linux/cris/bits/kernel_types.h
+++ b/libc/sysdeps/linux/cris/bits/kernel_types.h
@@ -28,6 +28,8 @@ typedef unsigned int __kernel_gid32_t;
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;
typedef __kernel_dev_t __kernel_old_dev_t;
+typedef long __kernel_long_t;
+typedef unsigned long __kernel_ulong_t;
#ifdef __GNUC__
typedef long long __kernel_loff_t;
diff --git a/libc/sysdeps/linux/cris/bits/mathcalls.h b/libc/sysdeps/linux/cris/bits/mathcalls.h
deleted file mode 100644
index c1181f737..000000000
--- a/libc/sysdeps/linux/cris/bits/mathcalls.h
+++ /dev/null
@@ -1,333 +0,0 @@
-/* Prototype declarations for math functions; helper file for <math.h>.
- Copyright (C) 1996,1997,1998,1999,2000,2001 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* NOTE: Because of the special way this file is used by <math.h>, this
- file must NOT be protected from multiple inclusion as header files
- usually are.
-
- This file provides prototype declarations for the math functions.
- Most functions are declared using the macro:
-
- __MATHCALL (NAME,[_r], (ARGS...));
-
- This means there is a function `NAME' returning `double' and a function
- `NAMEf' returning `float'. Each place `_Mdouble_' appears in the
- prototype, that is actually `double' in the prototype for `NAME' and
- `float' in the prototype for `NAMEf'. Reentrant variant functions are
- called `NAME_r' and `NAMEf_r'.
-
- Functions returning other types like `int' are declared using the macro:
-
- __MATHDECL (TYPE, NAME,[_r], (ARGS...));
-
- This is just like __MATHCALL but for a function returning `TYPE'
- instead of `_Mdouble_'. In all of these cases, there is still
- both a `NAME' and a `NAMEf' that takes `float' arguments.
-
- Note that there must be no whitespace before the argument passed for
- NAME, to make token pasting work with -traditional. */
-
-#ifndef _MATH_H
- #error "Never include <bits/mathcalls.h> directly; include <math.h> instead."
-#endif
-
-
-/* Trigonometric functions. */
-
-/* Arc cosine of X. */
-__MATHCALL (acos,, (_Mdouble_ __x));
-/* Arc sine of X. */
-__MATHCALL (asin,, (_Mdouble_ __x));
-/* Arc tangent of X. */
-__MATHCALL (atan,, (_Mdouble_ __x));
-/* Arc tangent of Y/X. */
-__MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x));
-
-/* Cosine of X. */
-__MATHCALL (cos,, (_Mdouble_ __x));
-/* Sine of X. */
-__MATHCALL (sin,, (_Mdouble_ __x));
-/* Tangent of X. */
-__MATHCALL (tan,, (_Mdouble_ __x));
-
-#ifdef __USE_GNU
-/* Cosine and sine of X. */
-__MATHDECL (void,sincos,,
- (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx));
-#endif
-
-/* Hyperbolic functions. */
-
-/* Hyperbolic cosine of X. */
-__MATHCALL (cosh,, (_Mdouble_ __x));
-/* Hyperbolic sine of X. */
-__MATHCALL (sinh,, (_Mdouble_ __x));
-/* Hyperbolic tangent of X. */
-__MATHCALL (tanh,, (_Mdouble_ __x));
-
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-/* Hyperbolic arc cosine of X. */
-__MATHCALL (acosh,, (_Mdouble_ __x));
-/* Hyperbolic arc sine of X. */
-__MATHCALL (asinh,, (_Mdouble_ __x));
-/* Hyperbolic arc tangent of X. */
-__MATHCALL (atanh,, (_Mdouble_ __x));
-#endif
-
-/* Exponential and logarithmic functions. */
-
-/* Exponential function of X. */
-__MATHCALL (exp,, (_Mdouble_ __x));
-
-#ifdef __USE_GNU
-/* A function missing in all standards: compute exponent to base ten. */
-__MATHCALL (exp10,, (_Mdouble_ __x));
-/* Another name occasionally used. */
-__MATHCALL (pow10,, (_Mdouble_ __x));
-#endif
-
-/* Break VALUE into a normalized fraction and an integral power of 2. */
-__MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent));
-
-/* X times (two to the EXP power). */
-__MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent));
-
-/* Natural logarithm of X. */
-__MATHCALL (log,, (_Mdouble_ __x));
-
-/* Base-ten logarithm of X. */
-__MATHCALL (log10,, (_Mdouble_ __x));
-
-/* Break VALUE into integral and fractional parts. */
-__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr));
-
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-/* Return exp(X) - 1. */
-__MATHCALL (expm1,, (_Mdouble_ __x));
-
-/* Return log(1 + X). */
-__MATHCALL (log1p,, (_Mdouble_ __x));
-
-/* Return the base 2 signed integral exponent of X. */
-__MATHCALL (logb,, (_Mdouble_ __x));
-#endif
-
-#ifdef __USE_ISOC99
-/* Compute base-2 exponential of X. */
-__MATHCALL (exp2,, (_Mdouble_ __x));
-
-/* Compute base-2 logarithm of X. */
-__MATHCALL (log2,, (_Mdouble_ __x));
-#endif
-
-
-/* Power functions. */
-
-/* Return X to the Y power. */
-__MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y));
-
-/* Return the square root of X. */
-__MATHCALL (sqrt,, (_Mdouble_ __x));
-
-#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
-/* Return `sqrt(X*X + Y*Y)'. */
-__MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
-#endif
-
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-/* Return the cube root of X. */
-__MATHCALL (cbrt,, (_Mdouble_ __x));
-#endif
-
-
-/* Nearest integer, absolute value, and remainder functions. */
-
-/* Smallest integral value not less than X. */
-__MATHCALL (ceil,, (_Mdouble_ __x));
-
-/* Absolute value of X. */
-__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
-
-/* Largest integer not greater than X. */
-__MATHCALL (floor,, (_Mdouble_ __x));
-
-/* Floating-point modulo remainder of X/Y. */
-__MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y));
-
-
-/* Return 0 if VALUE is finite or NaN, +1 if it
- is +Infinity, -1 if it is -Infinity. */
-__MATHDECL_1 (int,__isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
-
-/* Return nonzero if VALUE is finite and not NaN. */
-__MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
-
-#ifdef __USE_MISC
-/* Return 0 if VALUE is finite or NaN, +1 if it
- is +Infinity, -1 if it is -Infinity. */
-__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
-
-/* Return nonzero if VALUE is finite and not NaN. */
-__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
-
-/* Return the remainder of X/Y. */
-__MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
-
-
-/* Return the fractional part of X after dividing out `ilogb (X)'. */
-__MATHCALL (significand,, (_Mdouble_ __x));
-#endif /* Use misc. */
-
-#if defined __USE_MISC || defined __USE_ISOC99
-/* Return X with its signed changed to Y's. */
-__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
-#endif
-
-#ifdef __USE_ISOC99
-/* Return representation of NaN for double type. */
-__MATHCALLX (nan,, (__const char *__tagb), (__const__));
-#endif
-
-
-/* Return nonzero if VALUE is not a number. */
-__MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
-
-#if defined __USE_MISC || defined __USE_XOPEN
-/* Return nonzero if VALUE is not a number. */
-__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
-
-/* Bessel functions. */
-__MATHCALL (j0,, (_Mdouble_));
-__MATHCALL (j1,, (_Mdouble_));
-__MATHCALL (jn,, (int, _Mdouble_));
-__MATHCALL (y0,, (_Mdouble_));
-__MATHCALL (y1,, (_Mdouble_));
-__MATHCALL (yn,, (int, _Mdouble_));
-#endif
-
-
-#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
-/* Error and gamma functions. */
-__MATHCALL (erf,, (_Mdouble_));
-__MATHCALL (erfc,, (_Mdouble_));
-__MATHCALL (lgamma,, (_Mdouble_));
-#endif
-
-#ifdef __USE_ISOC99
-__MATHCALL (tgamma,, (_Mdouble_));
-#endif
-
-#if defined __USE_MISC || defined __USE_XOPEN
-/* Obsolete alias for `lgamma'. */
-__MATHCALL (gamma,, (_Mdouble_));
-#endif
-
-#ifdef __USE_MISC
-/* Reentrant version of lgamma. This function uses the global variable
- `signgam'. The reentrant version instead takes a pointer and stores
- the value through it. */
-__MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp));
-#endif
-
-
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-/* Return the integer nearest X in the direction of the
- prevailing rounding mode. */
-__MATHCALL (rint,, (_Mdouble_ __x));
-
-/* Return X + epsilon if X < Y, X - epsilon if X > Y. */
-__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
-# ifdef __USE_ISOC99
-__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
-# endif
-
-/* Return the remainder of integer divison X / Y with infinite precision. */
-__MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
-
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
-/* Return X times (2 to the Nth power). */
-__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
-# endif
-
-# if defined __USE_MISC || defined __USE_ISOC99
-/* Return X times (2 to the Nth power). */
-__MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
-# endif
-
-/* Return the binary exponent of X, which must be nonzero. */
-__MATHDECL (int,ilogb,, (_Mdouble_ __x));
-#endif
-
-#ifdef __USE_ISOC99
-/* Return X times (2 to the Nth power). */
-__MATHCALL (scalbln,, (_Mdouble_ __x, long int __n));
-
-/* Round X to integral value in floating-point format using current
- rounding direction, but do not raise inexact exception. */
-__MATHCALL (nearbyint,, (_Mdouble_ __x));
-
-/* Round X to nearest integral value, rounding halfway cases away from
- zero. */
-__MATHCALL (round,, (_Mdouble_ __x));
-
-/* Round X to the integral value in floating-point format nearest but
- not larger in magnitude. */
-__MATHCALLX (trunc,, (_Mdouble_ __x), (__const__));
-
-/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
- and magnitude congruent `mod 2^n' to the magnitude of the integral
- quotient x/y, with n >= 3. */
-__MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo));
-
-
-/* Conversion functions. */
-
-/* Round X to nearest integral value according to current rounding
- direction. */
-__MATHDECL (long int,lrint,, (_Mdouble_ __x));
-__MATHDECL (long long int,llrint,, (_Mdouble_ __x));
-
-/* Round X to nearest integral value, rounding halfway cases away from
- zero. */
-__MATHDECL (long int,lround,, (_Mdouble_ __x));
-__MATHDECL (long long int,llround,, (_Mdouble_ __x));
-
-
-/* Return positive difference between X and Y. */
-__MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y));
-
-/* Return maximum numeric value from X and Y. */
-__MATHCALL (fmax,, (_Mdouble_ __x, _Mdouble_ __y));
-
-/* Return minimum numeric value from X and Y. */
-__MATHCALL (fmin,, (_Mdouble_ __x, _Mdouble_ __y));
-
-
-/* Classify given number. */
-__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value))
- __attribute__ ((__const__));
-
-/* Test for negative number. */
-__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
- __attribute__ ((__const__));
-
-
-/* Multiply-add function computed as a ternary operation. */
-__MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
-#endif /* Use ISO C99. */
diff --git a/libc/sysdeps/linux/cris/bits/mman.h b/libc/sysdeps/linux/cris/bits/mman.h
deleted file mode 100644
index ec9d2a558..000000000
--- a/libc/sysdeps/linux/cris/bits/mman.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Definitions for POSIX memory map interface. Linux/CRIS version.
- Copyright (C) 1997, 2000, 2001, 2003 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#ifndef _SYS_MMAN_H
-# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
-#endif
-
-/* The following definitions basically come from the kernel headers.
- But the kernel header is not namespace clean. */
-
-
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-#endif
-
-/* These are Linux-specific. */
-#ifdef __USE_MISC
-# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */
-# define MAP_DENYWRITE 0x0800 /* ETXTBSY */
-# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */
-# define MAP_LOCKED 0x2000 /* Lock the mapping. */
-# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */
-#endif
-
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
-/* Flags for `mlockall'. */
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 2 /* Lock all additions to address
- space. */
-
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
-
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
diff --git a/libc/sysdeps/linux/cris/bits/setjmp.h b/libc/sysdeps/linux/cris/bits/setjmp.h
index 2a29c8ca9..e9fcec184 100644
--- a/libc/sysdeps/linux/cris/bits/setjmp.h
+++ b/libc/sysdeps/linux/cris/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2005 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
@@ -12,11 +12,10 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
-/* Define the machine-dependent type `jmp_buf'. CRIS version. */
+/* Define the machine-dependent type `jmp_buf', CRIS version. */
#ifndef _BITS_SETJMP_H
#define _BITS_SETJMP_H 1
@@ -24,10 +23,8 @@
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
-/*
- Note that we save and restore CCR to be able to
- correctly handle DI/EI. Note also that the "move x,ccr" does NOT affect
- the DMA enable bits (E and D).
+/* Note that saving and restoring CCR has no meaning in user mode, so we
+ don't actually do it; the slot is now reserved.
jmp_buf[0] - PC
jmp_buf[1] - SP (R14)
@@ -46,21 +43,8 @@
jmp_buf[14] - R1
jmp_buf[15] - R0
jmp_buf[16] - SRP
- jmp_buf[17] - CCR
- */
+ jmp_buf[17] - CCR */
-#define _JBLEN 18
-#if defined (__USE_MISC) || defined (_ASM)
-#define JB_SP 1
-#endif
-
-#ifndef _ASM
-typedef int __jmp_buf[_JBLEN];
-#endif
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) < (void *) (jmpbuf)[JB_SP])
+typedef int __jmp_buf[18];
#endif /* bits/setjmp.h */
diff --git a/libc/sysdeps/linux/cris/bits/stackinfo.h b/libc/sysdeps/linux/cris/bits/stackinfo.h
index 43c944834..6b36cafd6 100644
--- a/libc/sysdeps/linux/cris/bits/stackinfo.h
+++ b/libc/sysdeps/linux/cris/bits/stackinfo.h
@@ -12,9 +12,8 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* This file contains a bit of information about the stack allocation
of the processor. */
diff --git a/libc/sysdeps/linux/cris/bits/syscalls.h b/libc/sysdeps/linux/cris/bits/syscalls.h
index 93e7cf2d9..cb2f41cf7 100644
--- a/libc/sysdeps/linux/cris/bits/syscalls.h
+++ b/libc/sysdeps/linux/cris/bits/syscalls.h
@@ -7,85 +7,22 @@
#ifndef __ASSEMBLER__
-#include <errno.h>
-
-#define SYS_ify(syscall_name) (__NR_##syscall_name)
-
-#undef _syscall0
-#define _syscall0(type,name) \
-type name(void) \
-{ \
-return (type) (INLINE_SYSCALL(name, 0)); \
-}
-
-#undef _syscall1
-#define _syscall1(type,name,type1,arg1) \
-type name(type1 arg1) \
-{ \
-return (type) (INLINE_SYSCALL(name, 1, arg1)); \
-}
-
-#undef _syscall2
-#define _syscall2(type,name,type1,arg1,type2,arg2) \
-type name(type1 arg1,type2 arg2) \
-{ \
-return (type) (INLINE_SYSCALL(name, 2, arg1, arg2)); \
-}
-
-#undef _syscall3
-#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
-type name(type1 arg1,type2 arg2,type3 arg3) \
-{ \
-return (type) (INLINE_SYSCALL(name, 3, arg1, arg2, arg3)); \
-}
-
-#undef _syscall4
-#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
-type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
-{ \
-return (type) (INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4)); \
-}
-
-#undef _syscall5
-#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5) \
-type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
-{ \
-return (type) (INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5)); \
-}
-
-#undef _syscall6
-#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5,type6,arg6) \
-type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
-{ \
-return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \
-}
-
-#undef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...) \
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+(__extension__ \
({ \
- unsigned long __sys_res; \
register unsigned long __res __asm__ ("r10"); \
- LOAD_ARGS_c_##nr (args) \
+ LOAD_ARGS_c_##nr(args) \
register unsigned long __callno __asm__ ("r9") \
- = SYS_ify (name); \
+ = name; \
__asm__ __volatile__ (LOAD_ARGS_asm_##nr (args) \
CHECK_ARGS_asm_##nr \
"break 13" \
: "=r" (__res) \
: ASM_ARGS_##nr (args) \
: ASM_CLOBBER_##nr); \
- __sys_res = __res; \
- \
- if (__sys_res >= (unsigned long) -4096) \
- { \
- __set_errno (- __sys_res); \
- __sys_res = (unsigned long) -1; \
- } \
- __sys_res; \
- })
-
+ __res; \
+ }) \
+)
#define LOAD_ARGS_c_0()
#define LOAD_ARGS_asm_0()
#define ASM_CLOBBER_0 "memory"
diff --git a/libc/sysdeps/linux/cris/bits/termios.h b/libc/sysdeps/linux/cris/bits/termios.h
index 63ca4ea93..22b59db3c 100644
--- a/libc/sysdeps/linux/cris/bits/termios.h
+++ b/libc/sysdeps/linux/cris/bits/termios.h
@@ -14,9 +14,8 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _TERMIOS_H
# error "Never include <bits/termios.h> directly; use <termios.h> instead."
diff --git a/libc/sysdeps/linux/cris/bits/uClibc_arch_features.h b/libc/sysdeps/linux/cris/bits/uClibc_arch_features.h
index bdd338792..517f68cd6 100644
--- a/libc/sysdeps/linux/cris/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/cris/bits/uClibc_arch_features.h
@@ -12,31 +12,31 @@
/* can your target use syscall6() for mmap ? */
#undef __UCLIBC_MMAP_HAS_6_ARGS__
-/* does your target use syscall4() for truncate64 ? (32bit arches only) */
-#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+/* does your target align 64bit values in register pairs ? (32bit arches only) */
+#undef __UCLIBC_SYSCALL_ALIGN_64BIT__
/* does your target have a broken create_module() ? */
#define __UCLIBC_BROKEN_CREATE_MODULE__
+/* does your target have to worry about older [gs]etrlimit() ? */
+#undef __UCLIBC_HANDLE_OLDER_RLIMIT__
+
/* does your target have an asm .set ? */
#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
-/* define if target doesn't like .global */
-#undef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
-
/* define if target supports .weak */
#define __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
/* define if target supports .weakext */
#undef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
-/* needed probably only for ppc64 */
-#undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
+/* define if target supports CFI pseudo ops */
+#undef __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__
/* define if target supports IEEE signed zero floats */
#define __UCLIBC_HAVE_SIGNED_ZERO__
-/* lovely */
+/* only weird assemblers generally need this */
#define __UCLIBC_ASM_LINE_SEP__ @
#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/libc/sysdeps/linux/cris/bits/uClibc_page.h b/libc/sysdeps/linux/cris/bits/uClibc_page.h
index adfc3c9af..2818b333c 100644
--- a/libc/sysdeps/linux/cris/bits/uClibc_page.h
+++ b/libc/sysdeps/linux/cris/bits/uClibc_page.h
@@ -11,8 +11,8 @@
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/>.
*/
/* Supply an architecture specific value for PAGE_SIZE and friends. */
diff --git a/libc/sysdeps/linux/cris/bits/wordsize.h b/libc/sysdeps/linux/cris/bits/wordsize.h
index d6a2fc685..0f7882f88 100644
--- a/libc/sysdeps/linux/cris/bits/wordsize.h
+++ b/libc/sysdeps/linux/cris/bits/wordsize.h
@@ -13,7 +13,6 @@
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. */
+ see <http://www.gnu.org/licenses/>. */
#define __WORDSIZE 32
diff --git a/libc/sysdeps/linux/cris/brk.c b/libc/sysdeps/linux/cris/brk.c
index ae99e109c..6c877bb9a 100644
--- a/libc/sysdeps/linux/cris/brk.c
+++ b/libc/sysdeps/linux/cris/brk.c
@@ -12,7 +12,6 @@
extern void * __curbrk attribute_hidden;
extern int __init_brk (void) attribute_hidden;
-libc_hidden_proto(brk)
int brk(void * end_data_seg)
{
if (__init_brk () == 0) {
diff --git a/libc/sysdeps/linux/cris/clone.S b/libc/sysdeps/linux/cris/clone.S
index 9e284fe0a..fabf69595 100644
--- a/libc/sysdeps/linux/cris/clone.S
+++ b/libc/sysdeps/linux/cris/clone.S
@@ -13,8 +13,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. */
+ see <http://www.gnu.org/licenses/>. */
#include <features.h>
#include <sys/syscall.h>
diff --git a/libc/sysdeps/linux/cris/crti.S b/libc/sysdeps/linux/cris/crti.S
index 0740c765d..d9e1397da 100644
--- a/libc/sysdeps/linux/cris/crti.S
+++ b/libc/sysdeps/linux/cris/crti.S
@@ -10,8 +10,12 @@ _init:
move $srp,$r1
subq 4,$sp
move.d $r0,[$sp]
+#ifdef __arch_v32
+ lapc _GLOBAL_OFFSET_TABLE_,$r0
+#else
move.d $pc,$r0
sub.d .:GOTOFF,$r0
+#endif
.align 1
.section .fini
@@ -24,6 +28,10 @@ _fini:
move $srp,$r1
subq 4,$sp
move.d $r0,[$sp]
+#ifdef __arch_v32
+ lapc _GLOBAL_OFFSET_TABLE_,$r0
+#else
move.d $pc,$r0
sub.d .:GOTOFF,$r0
+#endif
.align 1
diff --git a/libc/sysdeps/linux/cris/crtn.S b/libc/sysdeps/linux/cris/crtn.S
index 951ae5449..7b2dce17c 100644
--- a/libc/sysdeps/linux/cris/crtn.S
+++ b/libc/sysdeps/linux/cris/crtn.S
@@ -9,7 +9,6 @@
move.d [$sp+],$r1
Ret
nop
- .size _init, .-_init
.section .fini
.align 1
@@ -20,4 +19,3 @@
move.d [$sp+],$r1
Ret
nop
- .size _fini, .-_fini
diff --git a/libc/sysdeps/linux/cris/fork.c b/libc/sysdeps/linux/cris/fork.c
deleted file mode 100644
index 20b546901..000000000
--- a/libc/sysdeps/linux/cris/fork.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-#include "sysdep.h"
-
-#define __NR___libc_fork __NR_fork
-SYSCALL__ (__libc_fork, 0)
- /* R1 is now 0 for the parent and 1 for the child. Decrement it to
- make it -1 (all bits set) for the parent, and 0 (no bits set)
- for the child. Then AND it with R0, so the parent gets
- R0&-1==R0, and the child gets R0&0==0. */
- /* i dunno what the blurb above is useful for. we just return. */
-__asm__("ret\n\tnop");
-libc_hidden_proto(fork)
-weak_alias(__libc_fork,fork)
-libc_hidden_weak(fork)
diff --git a/libc/sysdeps/linux/cris/jmpbuf-offsets.h b/libc/sysdeps/linux/cris/jmpbuf-offsets.h
new file mode 100644
index 000000000..9a95acc1b
--- /dev/null
+++ b/libc/sysdeps/linux/cris/jmpbuf-offsets.h
@@ -0,0 +1,8 @@
+/* Private macros for accessing __jmp_buf contents. BFIN version. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define JB_SP 1
diff --git a/libc/sysdeps/linux/cris/jmpbuf-unwind.h b/libc/sysdeps/linux/cris/jmpbuf-unwind.h
new file mode 100644
index 000000000..8b75dce5c
--- /dev/null
+++ b/libc/sysdeps/linux/cris/jmpbuf-unwind.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#include <setjmp.h>
+#include <jmpbuf-offsets.h>
+
+/* Test if longjmp to JMPBUF would unwind the frame
+ containing a local variable at ADDRESS. */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+ ((void *) (address) < (void *) (jmpbuf)[JB_SP])
diff --git a/libc/sysdeps/linux/cris/sbrk.c b/libc/sysdeps/linux/cris/sbrk.c
index 830d01dd6..fa04b20b0 100644
--- a/libc/sysdeps/linux/cris/sbrk.c
+++ b/libc/sysdeps/linux/cris/sbrk.c
@@ -13,7 +13,6 @@
extern void * __curbrk attribute_hidden;
extern int __init_brk (void) attribute_hidden;
-libc_hidden_proto(sbrk)
void *
sbrk(intptr_t increment)
{
diff --git a/libc/sysdeps/linux/cris/setjmp.S b/libc/sysdeps/linux/cris/setjmp.S
index e7bb6358a..69de07a1f 100644
--- a/libc/sysdeps/linux/cris/setjmp.S
+++ b/libc/sysdeps/linux/cris/setjmp.S
@@ -14,13 +14,9 @@
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. */
+ see <http://www.gnu.org/licenses/>. */
#include "sysdep.h"
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
.syntax no_register_prefix
diff --git a/libc/sysdeps/linux/cris/sys/procfs.h b/libc/sysdeps/linux/cris/sys/procfs.h
index 072029bc8..65b57ba4e 100644
--- a/libc/sysdeps/linux/cris/sys/procfs.h
+++ b/libc/sysdeps/linux/cris/sys/procfs.h
@@ -13,8 +13,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. */
+ see <http://www.gnu.org/licenses/>. */
#ifndef _SYS_PROCFS_H
#define _SYS_PROCFS_H 1
@@ -29,10 +28,14 @@
#include <sys/types.h>
#include <sys/ucontext.h>
#include <sys/user.h>
-#include <asm/elf.h>
__BEGIN_DECLS
+typedef unsigned long elf_greg_t;
+
+#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
struct elf_siginfo
{
int si_signo; /* Signal number. */
diff --git a/libc/sysdeps/linux/cris/sys/ucontext.h b/libc/sysdeps/linux/cris/sys/ucontext.h
index 5f875453f..2d99a95f9 100644
--- a/libc/sysdeps/linux/cris/sys/ucontext.h
+++ b/libc/sysdeps/linux/cris/sys/ucontext.h
@@ -12,9 +12,8 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* System V/cris ABI compliant context switching support. */
diff --git a/libc/sysdeps/linux/cris/sys/user.h b/libc/sysdeps/linux/cris/sys/user.h
new file mode 100644
index 000000000..d629c30d7
--- /dev/null
+++ b/libc/sysdeps/linux/cris/sys/user.h
@@ -0,0 +1,81 @@
+#ifndef __ASM_CRIS_USER_H
+#define __ASM_CRIS_USER_H
+
+/* User-mode register used for core dumps. */
+
+struct user_fpregs {
+};
+
+struct user_regs_struct {
+ unsigned long r0; /* General registers. */
+ unsigned long r1;
+ unsigned long r2;
+ unsigned long r3;
+ unsigned long r4;
+ unsigned long r5;
+ unsigned long r6;
+ unsigned long r7;
+ unsigned long r8;
+ unsigned long r9;
+ unsigned long r10;
+ unsigned long r11;
+ unsigned long r12;
+ unsigned long r13;
+ unsigned long sp; /* R14, Stack pointer. */
+ unsigned long acr; /* R15, Address calculation register. */
+ unsigned long bz; /* P0, Constant zero (8-bits). */
+ unsigned long vr; /* P1, Version register (8-bits). */
+ unsigned long pid; /* P2, Process ID (8-bits). */
+ unsigned long srs; /* P3, Support register select (8-bits). */
+ unsigned long wz; /* P4, Constant zero (16-bits). */
+ unsigned long exs; /* P5, Exception status. */
+ unsigned long eda; /* P6, Exception data address. */
+ unsigned long mof; /* P7, Multiply overflow regiter. */
+ unsigned long dz; /* P8, Constant zero (32-bits). */
+ unsigned long ebp; /* P9, Exception base pointer. */
+ unsigned long erp; /* P10, Exception return pointer. */
+ unsigned long srp; /* P11, Subroutine return pointer. */
+ unsigned long nrp; /* P12, NMI return pointer. */
+ unsigned long ccs; /* P13, Condition code stack. */
+ unsigned long usp; /* P14, User mode stack pointer. */
+ unsigned long spc; /* P15, Single step PC. */
+};
+
+/*
+ * Core file format: The core file is written in such a way that gdb
+ * can understand it and provide useful information to the user (under
+ * linux we use the `trad-core' bfd). The file contents are as follows:
+ *
+ * upage: 1 page consisting of a user struct that tells gdb
+ * what is present in the file. Directly after this is a
+ * copy of the task_struct, which is currently not used by gdb,
+ * but it may come in handy at some point. All of the registers
+ * are stored as part of the upage. The upage should always be
+ * only one page long.
+ * data: The data segment follows next. We use current->end_text to
+ * current->brk to pick up all of the user variables, plus any memory
+ * that may have been sbrk'ed. No attempt is made to determine if a
+ * page is demand-zero or if a page is totally unused, we just cover
+ * the entire range. All of the addresses are rounded in such a way
+ * that an integral number of pages is written.
+ * stack: We need the stack information in order to get a meaningful
+ * backtrace. We need to write the data from usp to
+ * current->start_stack, so we round each of these in order to be able
+ * to write an integer number of pages.
+ */
+
+struct user {
+ struct user_regs_struct regs; /* entire machine state */
+ size_t u_tsize; /* text size (pages) */
+ size_t u_dsize; /* data size (pages) */
+ size_t u_ssize; /* stack size (pages) */
+ unsigned long start_code; /* text starting address */
+ unsigned long start_data; /* data starting address */
+ unsigned long start_stack; /* stack starting address */
+ long int signal; /* signal causing core dump */
+ unsigned long u_ar0; /* help gdb find registers */
+ unsigned long magic; /* identifies a core file */
+ char u_comm[32]; /* user command name */
+};
+
+#endif /* __ASM_CRIS_USER_H */
diff --git a/libc/sysdeps/linux/cris/syscall.S b/libc/sysdeps/linux/cris/syscall.S
index d4b052e8e..a81f31140 100644
--- a/libc/sysdeps/linux/cris/syscall.S
+++ b/libc/sysdeps/linux/cris/syscall.S
@@ -13,8 +13,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. */
+ see <http://www.gnu.org/licenses/>. */
#include "sysdep.h"
diff --git a/libc/sysdeps/linux/cris/sysdep.S b/libc/sysdeps/linux/cris/sysdep.S
index 416751d65..a23bb260f 100644
--- a/libc/sysdeps/linux/cris/sysdep.S
+++ b/libc/sysdeps/linux/cris/sysdep.S
@@ -13,8 +13,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. */
+ see <http://www.gnu.org/licenses/>. */
#include <features.h>
#include "sysdep.h"
@@ -36,7 +35,7 @@ ENTRY (__syscall_error)
/* Note that __syscall_error is only visible within this library,
and no-one passes it on as a pointer, so can assume that R0 (GOT
pointer) is correctly set up. */
- PLTCALL (HIDDEN_JUMPTARGET(__errno_location))
+ PLTCALL (__errno_location)
move [sp+],srp
move.d [sp+],r11
diff --git a/libc/sysdeps/linux/cris/sysdep.h b/libc/sysdeps/linux/cris/sysdep.h
index 593e7772e..cd21fc87d 100644
--- a/libc/sysdeps/linux/cris/sysdep.h
+++ b/libc/sysdeps/linux/cris/sysdep.h
@@ -14,12 +14,13 @@
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. */
+ see <http://www.gnu.org/licenses/>. */
#ifndef _SYSDEP_H_
#define _SYSDEP_H_
+#include <common/sysdep.h>
+
#ifndef C_LABEL
/* Define a macro we can use to construct the asm name for a C symbol. */
@@ -120,7 +121,15 @@
/* Define an entry point visible from C. */
#define ENTRY(name) \
.text @ \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (name) @ \
+ .globl C_SYMBOL_NAME (name) @ \
+ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME (name), function) @ \
+ .align ALIGNARG (2) @ \
+ C_LABEL(name)
+
+#define HIDDEN_ENTRY(name) \
+ .text @ \
+ .globl C_SYMBOL_NAME (name) @ \
+ .hidden C_SYMBOL_NAME (name) @ \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME (name), function) @ \
.align ALIGNARG (2) @ \
C_LABEL(name)
diff --git a/libc/sysdeps/linux/cris/vfork.S b/libc/sysdeps/linux/cris/vfork.S
new file mode 100644
index 000000000..964eca4c1
--- /dev/null
+++ b/libc/sysdeps/linux/cris/vfork.S
@@ -0,0 +1,30 @@
+/*-
+ * Copyright (c) 2011
+ * Thorsten Glaser <tg@freewrt.org>
+ *
+ * This file is available either under the terms and conditions of
+ * the MirOS Licence, or the same terms as klibc or uClibc.
+ */
+
+#include "sysdep.h"
+
+ .syntax no_register_prefix
+
+/*
+ * vfork is special, but PSEUDO() would probably work were it not broken;
+ * there must be nothing at all on the stack above the stack frame of the
+ * enclosing function
+ */
+
+HIDDEN_ENTRY(__vfork)
+ movu.w __NR_vfork,$r9
+ break 13
+ cmps.w -4096,$r10
+ bhs 0f
+ nop
+ Ret
+ nop
+PSEUDO_END(__vfork)
+
+weak_alias(__vfork,vfork)
+libc_hidden_def(vfork)