summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/arm
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-11-17 02:07:34 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-11-17 02:07:34 +0000
commit94a2a2040adfc4863ab2fb501cdbf4fb87849be2 (patch)
tree39155622b8c9114bf41aa79b2918837e73a933cb /libc/sysdeps/linux/arm
parentf749efc0e5f1f8602c7e4f0c8c5b7d52ac18ab53 (diff)
downloaduClibc-alpine-94a2a2040adfc4863ab2fb501cdbf4fb87849be2.tar.bz2
uClibc-alpine-94a2a2040adfc4863ab2fb501cdbf4fb87849be2.tar.xz
Massive merge from trunk.
Diffstat (limited to 'libc/sysdeps/linux/arm')
-rw-r--r--libc/sysdeps/linux/arm/Makefile.arch28
-rw-r--r--libc/sysdeps/linux/arm/__longjmp.S19
-rw-r--r--libc/sysdeps/linux/arm/bits/endian.h11
-rw-r--r--libc/sysdeps/linux/arm/bits/fenv.h41
-rw-r--r--libc/sysdeps/linux/arm/bits/setjmp.h10
-rw-r--r--libc/sysdeps/linux/arm/crt1.S7
-rw-r--r--libc/sysdeps/linux/arm/fpu_control.h72
-rw-r--r--libc/sysdeps/linux/arm/setjmp.S39
-rw-r--r--libc/sysdeps/linux/arm/sigaction.c4
-rw-r--r--libc/sysdeps/linux/arm/syscall.c14
-rw-r--r--libc/sysdeps/linux/arm/vfork.S14
11 files changed, 191 insertions, 68 deletions
diff --git a/libc/sysdeps/linux/arm/Makefile.arch b/libc/sysdeps/linux/arm/Makefile.arch
index e44b145f9..c6edc12a1 100644
--- a/libc/sysdeps/linux/arm/Makefile.arch
+++ b/libc/sysdeps/linux/arm/Makefile.arch
@@ -5,28 +5,10 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC:=brk.c syscall.c ioperm.c iopl.c sigaction.c __syscall_error.c
-SSRC:= __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
- bsd-_setjmp.S sigrestorer.S mmap64.S
-
-ARCH_DIR:=$(top_srcdir)libc/sysdeps/linux/arm
-ARCH_OUT:=$(top_builddir)libc/sysdeps/linux/arm
-
-ARCH_CSRC:=$(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
-ARCH_COBJ:=$(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
-ARCH_SSRC:=$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
-ARCH_SOBJ:=$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
-
-ARCH_OBJS:=$(ARCH_COBJ) $(ARCH_SOBJ)
+CSRC := brk.c syscall.c ioperm.c iopl.c sigaction.c __syscall_error.c
-crt-y:=create
-libc-a-y+=$(ARCH_OBJS)
-libc-so-y+=$(ARCH_OBJS:.o=.os)
-
-#libc-multi-y+=$(ARCH_CSRC)
-libc-nomulti-y+=$(ARCH_OBJS)
-
-objclean-y+=arch_objclean
+SSRC := \
+ __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
+ bsd-_setjmp.S sigrestorer.S mmap64.S
-arch_objclean:
- $(RM) $(ARCH_OUT)/*.{o,os}
+include $(top_srcdir)libc/sysdeps/linux/Makefile.arch
diff --git a/libc/sysdeps/linux/arm/__longjmp.S b/libc/sysdeps/linux/arm/__longjmp.S
index 44837911b..822e15a69 100644
--- a/libc/sysdeps/linux/arm/__longjmp.S
+++ b/libc/sysdeps/linux/arm/__longjmp.S
@@ -33,9 +33,28 @@ __longjmp:
moveq r0, #1 /* can't let setjmp() return zero! */
#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+# ifdef __MAVERICK__
+ cfldrd mvd4, [ip], #8 ; nop
+ cfldrd mvd5, [ip], #8 ; nop
+ cfldrd mvd6, [ip], #8 ; nop
+ cfldrd mvd7, [ip], #8 ; nop
+ cfldrd mvd8, [ip], #8 ; nop
+ cfldrd mvd9, [ip], #8 ; nop
+ cfldrd mvd10, [ip], #8 ; nop
+ cfldrd mvd11, [ip], #8 ; nop
+ cfldrd mvd12, [ip], #8 ; nop
+ cfldrd mvd13, [ip], #8 ; nop
+ cfldrd mvd14, [ip], #8 ; nop
+ cfldrd mvd15, [ip], #8
+# else
lfmfd f4, 4, [ip] ! /* load the floating point regs */
+# endif
#else
+# ifdef __MAVERICK__
+ add ip, ip, #96 /* skip the FP registers */
+# else
add ip, ip, #48 /* skip the FP registers */
+# endif
#endif
ldmia ip , {v1-v6, sl, fp, sp, pc}
diff --git a/libc/sysdeps/linux/arm/bits/endian.h b/libc/sysdeps/linux/arm/bits/endian.h
index 1476881cb..27946cdee 100644
--- a/libc/sysdeps/linux/arm/bits/endian.h
+++ b/libc/sysdeps/linux/arm/bits/endian.h
@@ -1,19 +1,18 @@
-/* ARM is (usually) little-endian.
- * Older FPU style (FPA) is always big-endian.
- * Newer FPU style (VFP) is same as host byte-order.
- */
-
#ifndef _ENDIAN_H
# error "Never use <bits/endian.h> directly; include <endian.h> instead."
#endif
+/* ARM can be either big or little endian. */
#ifdef __ARMEB__
# define __BYTE_ORDER __BIG_ENDIAN
#else
# define __BYTE_ORDER __LITTLE_ENDIAN
#endif
-#ifdef __VFP_FP__
+/* FPA floating point units are always big-endian, irrespective of the
+ CPU endianness. VFP floating point units use the same endianness
+ as the rest of the system. */
+#if defined __VFP_FP__ || defined __MAVERICK__
# define __FLOAT_WORD_ORDER __BYTE_ORDER
#else
# define __FLOAT_WORD_ORDER __BIG_ENDIAN
diff --git a/libc/sysdeps/linux/arm/bits/fenv.h b/libc/sysdeps/linux/arm/bits/fenv.h
index 7bd242385..3764d7749 100644
--- a/libc/sysdeps/linux/arm/bits/fenv.h
+++ b/libc/sysdeps/linux/arm/bits/fenv.h
@@ -20,6 +20,45 @@
# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
#endif
+#ifdef __MAVERICK__
+
+/* Define bits representing exceptions in the FPU status word. */
+enum
+ {
+ FE_INVALID = 1,
+#define FE_INVALID FE_INVALID
+ FE_OVERFLOW = 4,
+#define FE_OVERFLOW FE_OVERFLOW
+ FE_UNDERFLOW = 8,
+#define FE_UNDERFLOW FE_UNDERFLOW
+ FE_INEXACT = 16,
+#define FE_INEXACT FE_INEXACT
+ };
+
+/* Amount to shift by to convert an exception to a mask bit. */
+#define FE_EXCEPT_SHIFT 5
+
+/* All supported exceptions. */
+#define FE_ALL_EXCEPT \
+ (FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
+
+/* IEEE rounding modes. */
+enum
+ {
+ FE_TONEAREST = 0,
+#define FE_TONEAREST FE_TONEAREST
+ FE_TOWARDZERO = 0x400,
+#define FE_TOWARDZERO FE_TOWARDZERO
+ FE_DOWNWARD = 0x800,
+#define FE_DOWNWARD FE_DOWNWARD
+ FE_UPWARD = 0xc00,
+#define FE_UPWARD FE_UPWARD
+ };
+
+#define FE_ROUND_MASK (FE_UPWARD)
+
+#else /* !__MAVERICK__ */
+
/* Define bits representing exceptions in the FPU status word. */
enum
{
@@ -44,6 +83,8 @@ enum
modes exist, but you have to encode them in the actual instruction. */
#define FE_TONEAREST 0
+#endif /* __MAVERICK__ */
+
/* Type representing exception flags. */
typedef unsigned long int fexcept_t;
diff --git a/libc/sysdeps/linux/arm/bits/setjmp.h b/libc/sysdeps/linux/arm/bits/setjmp.h
index dd8524303..ad42f96cd 100644
--- a/libc/sysdeps/linux/arm/bits/setjmp.h
+++ b/libc/sysdeps/linux/arm/bits/setjmp.h
@@ -17,16 +17,22 @@
02111-1307 USA. */
/* Define the machine-dependent type `jmp_buf'. ARM version. */
+#ifndef _BITS_SETJMP_H
+#define _BITS_SETJMP_H 1
-#ifndef _SETJMP_H
+#if !defined _SETJMP_H && !defined _PTHREAD_H
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
#ifndef _ASM
/* Jump buffer contains v1-v6, sl, fp, sp and pc. Other registers are not
saved. */
+#ifdef __MAVERICK__
+typedef int __jmp_buf[34];
+#else
typedef int __jmp_buf[22];
#endif
+#endif
#define __JMP_BUF_SP 20
@@ -34,3 +40,5 @@ typedef int __jmp_buf[22];
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address) \
((void *) (address) < (void *) (jmpbuf[__JMP_BUF_SP]))
+
+#endif /* bits/setjmp.h */
diff --git a/libc/sysdeps/linux/arm/crt1.S b/libc/sysdeps/linux/arm/crt1.S
index 26146ba86..7470715a1 100644
--- a/libc/sysdeps/linux/arm/crt1.S
+++ b/libc/sysdeps/linux/arm/crt1.S
@@ -1,5 +1,6 @@
/* Startup code for ARM & ELF
- Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002, 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
@@ -148,10 +149,14 @@ _start:
ldr a4, =_init
/* __uClibc_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
+
/* Let the libc call main and exit with its return code. */
b __uClibc_main
#endif
+ /* should never get here....*/
+ bl abort
+
#ifdef __PIC__
.L_GOT:
.word _GLOBAL_OFFSET_TABLE_-(.L_GOT_OFF+8)
diff --git a/libc/sysdeps/linux/arm/fpu_control.h b/libc/sysdeps/linux/arm/fpu_control.h
index 65912e496..8c13ca3a3 100644
--- a/libc/sysdeps/linux/arm/fpu_control.h
+++ b/libc/sysdeps/linux/arm/fpu_control.h
@@ -20,6 +20,76 @@
#ifndef _FPU_CONTROL_H
#define _FPU_CONTROL_H
+#ifdef __MAVERICK__
+
+/* DSPSC register: (from EP9312 User's Guide)
+ *
+ * bits 31..29 - DAID
+ * bits 28..26 - HVID
+ * bits 25..24 - RSVD
+ * bit 23 - ISAT
+ * bit 22 - UI
+ * bit 21 - INT
+ * bit 20 - AEXC
+ * bits 19..18 - SAT
+ * bits 17..16 - FCC
+ * bit 15 - V
+ * bit 14 - FWDEN
+ * bit 13 - Invalid
+ * bit 12 - Denorm
+ * bits 11..10 - RM
+ * bits 9..5 - IXE, UFE, OFE, RSVD, IOE
+ * bits 4..0 - IX, UF, OF, RSVD, IO
+ */
+
+/* masking of interrupts */
+#define _FPU_MASK_IM (1 << 5) /* invalid operation */
+#define _FPU_MASK_ZM 0 /* divide by zero */
+#define _FPU_MASK_OM (1 << 7) /* overflow */
+#define _FPU_MASK_UM (1 << 8) /* underflow */
+#define _FPU_MASK_PM (1 << 9) /* inexact */
+#define _FPU_MASK_DM 0 /* denormalized operation */
+
+#define _FPU_RESERVED 0xfffff000 /* These bits are reserved. */
+
+#define _FPU_DEFAULT 0x00b00000 /* Default value. */
+#define _FPU_IEEE 0x00b003a0 /* Default + exceptions enabled. */
+
+/* Type of the control word. */
+typedef unsigned int fpu_control_t;
+
+/* Macros for accessing the hardware control word. */
+#define _FPU_GETCW(cw) ({ \
+ register int __t1, __t2; \
+ \
+ __asm__ volatile ( \
+ "cfmvr64l %1, mvdx0\n\t" \
+ "cfmvr64h %2, mvdx0\n\t" \
+ "cfmv32sc mvdx0, dspsc\n\t" \
+ "cfmvr64l %0, mvdx0\n\t" \
+ "cfmv64lr mvdx0, %1\n\t" \
+ "cfmv64hr mvdx0, %2" \
+ : "=r" (cw), "=r" (__t1), "=r" (__t2) \
+ ); \
+})
+
+#define _FPU_SETCW(cw) ({ \
+ register int __t0, __t1, __t2; \
+ \
+ __asm__ volatile ( \
+ "cfmvr64l %1, mvdx0\n\t" \
+ "cfmvr64h %2, mvdx0\n\t" \
+ "cfmv64lr mvdx0, %0\n\t" \
+ "cfmvsc32 dspsc, mvdx0\n\t" \
+ "cfmv64lr mvdx0, %1\n\t" \
+ "cfmv64hr mvdx0, %2" \
+ : "=r" (__t0), "=r" (__t1), "=r" (__t2) \
+ : "0" (cw) \
+ ); \
+})
+
+#else /* !__MAVERICK__ */
+
/* We have a slight terminology confusion here. On the ARM, the register
* we're interested in is actually the FPU status word - the FPU control
* word is something different (which is implementation-defined and only
@@ -96,6 +166,8 @@ typedef unsigned int fpu_control_t;
#define _FPU_GETCW(cw) __asm__ ("rfs %0" : "=r" (cw))
#define _FPU_SETCW(cw) __asm__ ("wfs %0" : : "r" (cw))
+#endif /* __MAVERICK__ */
+
/* Default control word set at startup. */
extern fpu_control_t __fpu_control;
diff --git a/libc/sysdeps/linux/arm/setjmp.S b/libc/sysdeps/linux/arm/setjmp.S
index 62d038cc5..4048d7934 100644
--- a/libc/sysdeps/linux/arm/setjmp.S
+++ b/libc/sysdeps/linux/arm/setjmp.S
@@ -3,19 +3,19 @@
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 Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ 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
- Library General Public License for more details.
+ Lesser General Public License for more details.
- 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. */
+ 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. */
#include <features.h>
#define _SETJMP_H
@@ -28,14 +28,37 @@
__sigsetjmp:
/* Save registers */
#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+# ifdef __MAVERICK__
+ cfstrd mvd4, [r0], #8 ; nop
+ cfstrd mvd5, [r0], #8 ; nop
+ cfstrd mvd6, [r0], #8 ; nop
+ cfstrd mvd7, [r0], #8 ; nop
+ cfstrd mvd8, [r0], #8 ; nop
+ cfstrd mvd9, [r0], #8 ; nop
+ cfstrd mvd10, [r0], #8 ; nop
+ cfstrd mvd11, [r0], #8 ; nop
+ cfstrd mvd12, [r0], #8 ; nop
+ cfstrd mvd13, [r0], #8 ; nop
+ cfstrd mvd14, [r0], #8 ; nop
+ cfstrd mvd15, [r0], #8
+# else
sfmea f4, 4, [r0]!
+# endif
#else
+# ifdef __MAVERICK__
+ add r0, r0, #96 /* skip the FP registers */
+# else
add r0, r0, #48 /* skip the FP registers */
+# endif
#endif
stmia r0, {v1-v6, sl, fp, sp, lr}
/* Restore pointer to jmp_buf */
+#ifdef __MAVERICK__
+ sub r0, r0, #96
+#else
sub r0, r0, #48
+#endif
/* Make a tail call to __sigjmp_save; it takes the same args. */
#ifdef __PIC__
diff --git a/libc/sysdeps/linux/arm/sigaction.c b/libc/sysdeps/linux/arm/sigaction.c
index df9ea4c35..5fbb7fbf1 100644
--- a/libc/sysdeps/linux/arm/sigaction.c
+++ b/libc/sysdeps/linux/arm/sigaction.c
@@ -132,7 +132,5 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa
}
#endif
-
-#ifndef LIBC_SIGACTION
weak_alias(__libc_sigaction, sigaction)
-#endir
+
diff --git a/libc/sysdeps/linux/arm/syscall.c b/libc/sysdeps/linux/arm/syscall.c
index 195c31c74..33d9f5fea 100644
--- a/libc/sysdeps/linux/arm/syscall.c
+++ b/libc/sysdeps/linux/arm/syscall.c
@@ -3,19 +3,7 @@
*
* Copyright (C) 2002 by Erik Andersen <andersen@uclibc.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program 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 Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <features.h>
diff --git a/libc/sysdeps/linux/arm/vfork.S b/libc/sysdeps/linux/arm/vfork.S
index cf9d3d8d6..530bba07c 100644
--- a/libc/sysdeps/linux/arm/vfork.S
+++ b/libc/sysdeps/linux/arm/vfork.S
@@ -5,19 +5,7 @@
* Copyright (C) 2000,2001 by Erik Andersen <andersen@uclibc.org>
* Written by Erik Andersen <andersen@uclibc.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program 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 Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define _ERRNO_H