diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-06-18 15:45:00 +0000 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-06-18 15:45:00 +0000 |
commit | 80ee234a186cf81220a37cd561fb8c91f9e9cadc (patch) | |
tree | f4d6b9a607325e4fa12ea9aaa33c654187d30733 /libc/sysdeps/linux/sparc | |
parent | 328d2c63d3529eacf2d4c47c949f1f9830bf8470 (diff) | |
download | uClibc-alpine-80ee234a186cf81220a37cd561fb8c91f9e9cadc.tar.bz2 uClibc-alpine-80ee234a186cf81220a37cd561fb8c91f9e9cadc.tar.xz |
Synch libc sparc specific with trunk
Diffstat (limited to 'libc/sysdeps/linux/sparc')
-rw-r--r-- | libc/sysdeps/linux/sparc/Makefile.arch | 2 | ||||
-rw-r--r-- | libc/sysdeps/linux/sparc/__longjmp.S | 3 | ||||
-rw-r--r-- | libc/sysdeps/linux/sparc/_math_inc.h | 4 | ||||
-rw-r--r-- | libc/sysdeps/linux/sparc/bits/fcntl.h | 38 | ||||
-rw-r--r-- | libc/sysdeps/linux/sparc/bits/mathinline.h | 8 | ||||
-rw-r--r-- | libc/sysdeps/linux/sparc/bits/setjmp.h | 2 | ||||
-rw-r--r-- | libc/sysdeps/linux/sparc/bits/typesizes.h | 66 | ||||
-rw-r--r-- | libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h | 3 | ||||
-rw-r--r-- | libc/sysdeps/linux/sparc/brk.c | 2 | ||||
-rw-r--r-- | libc/sysdeps/linux/sparc/qp_ops.c | 46 |
10 files changed, 152 insertions, 22 deletions
diff --git a/libc/sysdeps/linux/sparc/Makefile.arch b/libc/sysdeps/linux/sparc/Makefile.arch index 1e401fc84..4562eaba5 100644 --- a/libc/sysdeps/linux/sparc/Makefile.arch +++ b/libc/sysdeps/linux/sparc/Makefile.arch @@ -5,7 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CSRC := brk.c __syscall_error.c +CSRC := brk.c __syscall_error.c qp_ops.c SSRC := \ __longjmp.S fork.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \ diff --git a/libc/sysdeps/linux/sparc/__longjmp.S b/libc/sysdeps/linux/sparc/__longjmp.S index fa60264ef..c7d4f0794 100644 --- a/libc/sysdeps/linux/sparc/__longjmp.S +++ b/libc/sysdeps/linux/sparc/__longjmp.S @@ -30,7 +30,8 @@ .type __longjmp,%function .align 4 __longjmp: - + .register %g2, #scratch + .register %g3, #scratch /* Store our arguments in global registers so we can still * use them while unwinding frames and their register windows. */ diff --git a/libc/sysdeps/linux/sparc/_math_inc.h b/libc/sysdeps/linux/sparc/_math_inc.h index 9139c06f0..1bf84f04e 100644 --- a/libc/sysdeps/linux/sparc/_math_inc.h +++ b/libc/sysdeps/linux/sparc/_math_inc.h @@ -7,7 +7,11 @@ #include <bits/wordsize.h> #define __ASSEMBLY__ +#ifndef __sparc_v9__ #include <asm/traps.h> +#endif + +/* Is alignment really needed? */ #if __WORDSIZE == 32 # define ENTRY_ALIGN 4 diff --git a/libc/sysdeps/linux/sparc/bits/fcntl.h b/libc/sysdeps/linux/sparc/bits/fcntl.h index cb4e6a8c8..ea6dc6cf4 100644 --- a/libc/sysdeps/linux/sparc/bits/fcntl.h +++ b/libc/sysdeps/linux/sparc/bits/fcntl.h @@ -1,5 +1,5 @@ /* O_*, F_*, FD_* bit values for Linux/SPARC. - Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006 + Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -49,6 +49,9 @@ # define O_NOFOLLOW 0x20000 /* don't follow links */ # define O_DIRECT 0x100000 /* direct disk access hint */ # define O_NOATIME 0x200000 /* Do not set atime. */ +# if 0 +# define O_CLOEXEC 0x400000 /* Set close_on_exit. */ +# endif #endif #ifdef __USE_LARGEFILE64 @@ -104,6 +107,8 @@ # define F_SETLEASE 1024 /* Set a lease. */ # define F_GETLEASE 1025 /* Enquire what lease is active. */ # 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. */ #endif #if __WORDSIZE == 64 @@ -116,7 +121,7 @@ # define F_SETLKW64 14 /* Set record locking info (blocking). */ #endif -/* for F_[GET|SET]FL */ +/* for F_[GET|SET]FD */ #define FD_CLOEXEC 1 /* actually anything with low bit set goes */ /* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ @@ -204,6 +209,8 @@ struct flock64 #ifdef __USE_GNU +#if 0 +/* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the write. */ @@ -215,6 +222,15 @@ struct flock64 write. */ #endif +/* Flags for SPLICE and VMSPLICE. */ +# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ +# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing + (but we may still block on the fd + we splice from/to). */ +# define SPLICE_F_MORE 4 /* Expect more data. */ +# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ +#endif + __BEGIN_DECLS #ifdef __USE_GNU @@ -228,21 +244,21 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) /* 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 int vmsplice (int __fdout, const struct iovec *__iov, size_t __count, - unsigned int __flags); +extern ssize_t 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; +extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, + __off64_t *__offout, size_t __len, + unsigned int __flags); /* In-kernel implementation of tee for pipe buffers. */ -extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags) - __THROW; -#endif +extern ssize_t tee (int __fdin, int __fdout, size_t __len, + unsigned int __flags); #endif - __END_DECLS + diff --git a/libc/sysdeps/linux/sparc/bits/mathinline.h b/libc/sysdeps/linux/sparc/bits/mathinline.h index 9dd784d12..729145e14 100644 --- a/libc/sysdeps/linux/sparc/bits/mathinline.h +++ b/libc/sysdeps/linux/sparc/bits/mathinline.h @@ -198,7 +198,7 @@ __MATH_INLINE double __NTH (sqrt (double __x)) { register double __r; - __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x)); + __asm__ ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x)); return __r; } @@ -206,7 +206,7 @@ __MATH_INLINE float __NTH (sqrtf (float __x)) { register float __r; - __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x)); + __asm__ ("fsqrts %1,%0" : "=f" (__r) : "f" (__x)); return __r; } @@ -236,7 +236,7 @@ __MATH_INLINE double __ieee754_sqrt (double __x) { register double __r; - __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x)); + __asm__ ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x)); return __r; } @@ -244,7 +244,7 @@ __MATH_INLINE float __ieee754_sqrtf (float __x) { register float __r; - __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x)); + __asm__ ("fsqrts %1,%0" : "=f" (__r) : "f" (__x)); return __r; } diff --git a/libc/sysdeps/linux/sparc/bits/setjmp.h b/libc/sysdeps/linux/sparc/bits/setjmp.h index dac9ac5cb..ac5a4b2d6 100644 --- a/libc/sysdeps/linux/sparc/bits/setjmp.h +++ b/libc/sysdeps/linux/sparc/bits/setjmp.h @@ -25,7 +25,7 @@ #include <bits/wordsize.h> -#if __WORDSIZE == 64 +#if 0 /*__WORDSIZE == 64*/ #ifndef _ASM typedef struct __sparc64_jmp_buf diff --git a/libc/sysdeps/linux/sparc/bits/typesizes.h b/libc/sysdeps/linux/sparc/bits/typesizes.h new file mode 100644 index 000000000..b0dd1bd89 --- /dev/null +++ b/libc/sysdeps/linux/sparc/bits/typesizes.h @@ -0,0 +1,66 @@ +/* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version. + Copyright (C) 2002, 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 _BITS_TYPES_H +# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See <bits/types.h> for the meaning of these macros. This file exists so + that <bits/types.h> need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __U32_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __S32_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __SWBLK_T_TYPE __SLONGWORD_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ diff --git a/libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h b/libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h index 2cf505256..41d3e7c3d 100644 --- a/libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h +++ b/libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h @@ -17,9 +17,6 @@ /* does your target have a broken create_module() ? */ #undef __UCLIBC_BROKEN_CREATE_MODULE__ -/* does your target prefix all symbols with an _ ? */ -#define __UCLIBC_NO_UNDERSCORES__ - /* does your target have an asm .set ? */ #define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__ diff --git a/libc/sysdeps/linux/sparc/brk.c b/libc/sysdeps/linux/sparc/brk.c index 7791f55e5..53f2c9c1d 100644 --- a/libc/sysdeps/linux/sparc/brk.c +++ b/libc/sysdeps/linux/sparc/brk.c @@ -33,7 +33,7 @@ int brk (void *addr) { register void *o0 __asm__("%o0") = addr; register int g1 __asm__("%g1") = 17 ; - __asm ("t 0x10" : "=r"(o0) : "r"(g1), "0"(o0) : "cc"); + __asm__ ("t 0x10" : "=r"(o0) : "r"(g1), "0"(o0) : "cc"); newbrk = o0; } diff --git a/libc/sysdeps/linux/sparc/qp_ops.c b/libc/sysdeps/linux/sparc/qp_ops.c new file mode 100644 index 000000000..9080baaee --- /dev/null +++ b/libc/sysdeps/linux/sparc/qp_ops.c @@ -0,0 +1,46 @@ +// XXX add ops from glibc sysdeps/sparc/sparc64/soft-fp + +#define fakedef(name) \ + void name(void) \ + { \ + printf("Unimplemented %s called, exiting\n", #name); \ + exit(-1); \ + } + +#ifdef __sparc_v9__ +fakedef(_Qp_fne) +fakedef(_Qp_feq) +fakedef(_Qp_div) +fakedef(_Qp_flt) +fakedef(_Qp_mul) +fakedef(_Qp_fge) +fakedef(_Qp_qtoux) +fakedef(_Qp_uxtoq) +fakedef(_Qp_sub) +fakedef(_Qp_dtoq) +fakedef(_Qp_qtod) +fakedef(_Qp_qtos) +fakedef(_Qp_stoq) +fakedef(_Qp_itoq) +fakedef(_Qp_add) +#else +fakedef(_Q_fne) +fakedef(_Q_feq) +fakedef(_Q_div) +fakedef(_Q_flt) +fakedef(_Q_mul) +fakedef(_Q_fge) +fakedef(_Q_qtoux) +fakedef(_Q_uxtoq) +fakedef(_Q_qtou) +fakedef(_Q_utoq) +fakedef(_Q_sub) +fakedef(_Q_dtoq) +fakedef(_Q_qtod) +fakedef(_Q_qtos) +fakedef(_Q_stoq) +fakedef(_Q_itoq) +fakedef(_Q_add) +#endif + +#undef fakedef |