zte's code,first commit
Change-Id: I9a04da59e459a9bc0d67f101f700d9d7dc8d681b
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/Makefile b/ap/build/uClibc/libc/sysdeps/linux/arm/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/Makefile
@@ -0,0 +1,13 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+top_srcdir=../../../../
+top_builddir=../../../../
+all: objs
+include $(top_builddir)Rules.mak
+include Makefile.arch
+include $(top_srcdir)Makerules
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/arm/Makefile.arch
new file mode 100644
index 0000000..cc73c45
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/Makefile.arch
@@ -0,0 +1,46 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+CSRC := brk.c ioperm.c iopl.c mmap.c __syscall_error.c sigaction.c
+
+SSRC := \
+ __longjmp.S setjmp.S bsd-setjmp.S \
+ bsd-_setjmp.S sigrestorer.S mmap64.S \
+ vfork.S clone.S
+
+ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+SSRC += libc-aeabi_read_tp.S libc-thumb_atomics.S
+endif
+
+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),y)
+CSRC += posix_fadvise.c posix_fadvise64.c
+endif
+
+# Is our compiler set up for EABI ?
+IS_EABI:=$(shell $(CC) $(CFLAGS) -x c - -E -dM </dev/null 2>/dev/null \
+ | grep __ARM_EABI__ 2>&1 >/dev/null && echo 'y' \
+ )
+
+ifeq ($(IS_EABI),y)
+CSRC += aeabi_assert.c aeabi_atexit.c aeabi_errno_addr.c \
+ aeabi_localeconv.c aeabi_memclr.c aeabi_memcpy.c \
+ aeabi_memmove.c aeabi_memset.c find_exidx.c
+SSRC += syscall-eabi.S
+ARCH_OBJ_FILTEROUT := syscall.c
+ifeq ($(UCLIBC_HAS_WCHAR),y)
+CSRC += aeabi_mb_cur_max.c
+endif
+else
+CSRC += syscall.c
+endif
+
+ifeq ($(IS_EABI),y)
+libc-static-y += $(ARCH_OUT)/aeabi_lcsts.o $(ARCH_OUT)/aeabi_math.o \
+ $(ARCH_OUT)/aeabi_sighandlers.o
+libc-nonshared-y += $(ARCH_OUT)/aeabi_lcsts.os $(ARCH_OUT)/aeabi_math.os \
+ $(ARCH_OUT)/aeabi_sighandlers.os $(ARCH_OUT)/aeabi_unwind_cpp_pr1.o
+endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/arm/__longjmp.S
new file mode 100644
index 0000000..5faf4ec
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/__longjmp.S
@@ -0,0 +1,114 @@
+/* longjmp for ARM.
+ Copyright (C) 1997, 1998 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. */
+
+#include <features.h>
+#include <bits/arm_asm.h>
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+
+.global __longjmp
+.type __longjmp,%function
+.align 2
+#if defined(THUMB1_ONLY)
+.thumb_func
+__longjmp:
+ mov r2, r0
+ movs r0, r1
+ /* can't let setjmp() return zero! */
+ bne 1f
+ mov r0, #1
+1:
+ mov r1, r2
+ /* Restore registers, shuffling them through low regs. */
+ add r2, #(4 * 4)
+ ldmia r2!, {r4, r5, r6, r7}
+ mov r8, r4
+ mov r9, r5
+ mov sl, r6
+ mov fp, r7
+ ldmia r2!, {r4, r5}
+ mov sp, r4
+ mov lr, r5
+ ldmia r1!, {r4, r5, r6, r7}
+ bx lr
+#else
+__longjmp:
+ mov ip, r0 /* save jmp_buf pointer */
+
+ movs r0, r1 /* get the return value in place */
+ IT(t, eq)
+ moveq r0, #1 /* can't let setjmp() return zero! */
+
+#if defined(__thumb2__)
+ /* Thumb-2 does not allow loading sp with ldm. */
+ ldmia ip!, {v1-v6, sl, fp}
+ ldr sp, [ip], #4
+ ldr lr, [ip], #4
+#else
+ ldmia ip!, {v1-v6, sl, fp, sp, lr}
+#endif
+
+#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+#ifdef __VFP_FP__
+ /* Restore the VFP registers. */
+ /* Following instruction is fldmiax ip!, {d8-d15}. */
+ ldc p11, cr8, [r12], #68
+ /* Restore the floating-point status register. */
+ ldr r1, [ip], #4
+ /* Following instruction is fmxr fpscr, r1. */
+ mcr p10, 7, r1, cr1, cr0, 0
+# elif defined __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
+#endif
+#ifdef __IWMMXT__
+ /* Restore the call-preserved iWMMXt registers. */
+ /* Following instructions are wldrd wr10, [ip], #8 (etc.) */
+ ldcl p1, cr10, [r12], #8
+ ldcl p1, cr11, [r12], #8
+ ldcl p1, cr12, [r12], #8
+ ldcl p1, cr13, [r12], #8
+ ldcl p1, cr14, [r12], #8
+ ldcl p1, cr15, [r12], #8
+#endif
+
+#if defined(__USE_BX__)
+ bx lr
+#else
+ mov pc, lr
+#endif
+#endif
+
+.size __longjmp,.-__longjmp
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/__syscall_error.c b/ap/build/uClibc/libc/sysdeps/linux/arm/__syscall_error.c
new file mode 100644
index 0000000..2b642e8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/__syscall_error.c
@@ -0,0 +1,18 @@
+/* Wrapper for setting errno.
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <features.h>
+
+/* This routine is jumped to by all the syscall handlers, to stash
+ * an error number into errno. */
+int __syscall_error(int err_no) attribute_hidden;
+int __syscall_error(int err_no)
+{
+ __set_errno(-err_no);
+ return -1;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_assert.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_assert.c
new file mode 100644
index 0000000..a725ad4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_assert.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2004, 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
+ 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. */
+
+#undef NDEBUG
+#include <assert.h>
+#include <stdlib.h>
+
+
+void __aeabi_assert(const char *assertion, const char *file, unsigned int line);
+void __aeabi_assert(const char *assertion, const char *file, unsigned int line)
+{
+ __assert (assertion, file, line, NULL);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_atexit.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_atexit.c
new file mode 100644
index 0000000..ebb233b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_atexit.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 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
+ 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. */
+
+#include <stdlib.h>
+
+extern int __cxa_atexit (void (*func) (void *), void *arg, void *dso_handle);
+libc_hidden_proto(__cxa_atexit)
+
+/* Register a function to be called by exit or when a shared library
+ is unloaded. This routine is like __cxa_atexit, but uses the
+ calling sequence required by the ARM EABI. */
+int __aeabi_atexit (void *arg, void (*func) (void *), void *d);
+int __aeabi_atexit (void *arg, void (*func) (void *), void *d)
+{
+ return __cxa_atexit (func, arg, d);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_errno_addr.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_errno_addr.c
new file mode 100644
index 0000000..5e262a6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_errno_addr.c
@@ -0,0 +1,25 @@
+/* Copyright (C) 2004, 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
+ 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. */
+
+#include <errno.h>
+
+volatile int * __aeabi_errno_addr (void);
+volatile int * __aeabi_errno_addr (void)
+{
+ return &errno;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_lcsts.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_lcsts.c
new file mode 100644
index 0000000..e1e5390
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_lcsts.c
@@ -0,0 +1,101 @@
+/* Link-time constants for ARM EABI.
+ Copyright (C) 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
+ 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.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ 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. */
+
+/* The ARM EABI requires that we provide ISO compile-time constants as
+ link-time constants. Some portable applications may reference these. */
+
+#include <errno.h>
+#include <limits.h>
+#include <locale.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdio.h>
+#include <time.h>
+
+#define eabi_constant2(X,Y) const int __aeabi_##X attribute_hidden = Y
+#define eabi_constant(X) const int __aeabi_##X attribute_hidden = X
+
+eabi_constant (EDOM);
+eabi_constant (ERANGE);
+eabi_constant (EILSEQ);
+
+eabi_constant (MB_LEN_MAX);
+
+eabi_constant (LC_COLLATE);
+eabi_constant (LC_CTYPE);
+eabi_constant (LC_MONETARY);
+eabi_constant (LC_NUMERIC);
+eabi_constant (LC_TIME);
+eabi_constant (LC_ALL);
+
+/* The value of __aeabi_JMP_BUF_SIZE is the number of doublewords in a
+ jmp_buf. */
+eabi_constant2 (JMP_BUF_SIZE, sizeof (jmp_buf) / 8);
+
+eabi_constant (SIGABRT);
+eabi_constant (SIGFPE);
+eabi_constant (SIGILL);
+eabi_constant (SIGINT);
+eabi_constant (SIGSEGV);
+eabi_constant (SIGTERM);
+
+eabi_constant2 (IOFBF, _IOFBF);
+eabi_constant2 (IOLBF, _IOLBF);
+eabi_constant2 (IONBF, _IONBF);
+eabi_constant (BUFSIZ);
+eabi_constant (FOPEN_MAX);
+eabi_constant (TMP_MAX);
+eabi_constant (FILENAME_MAX);
+#ifdef __UCLIBC_SUSV4_LEGACY__
+eabi_constant (L_tmpnam);
+#endif
+
+FILE *__aeabi_stdin attribute_hidden;
+FILE *__aeabi_stdout attribute_hidden;
+FILE *__aeabi_stderr attribute_hidden;
+
+static void __attribute__ ((used))
+setup_aeabi_stdio (void)
+{
+ __aeabi_stdin = stdin;
+ __aeabi_stdout = stdout;
+ __aeabi_stderr = stderr;
+}
+
+static void (*fp) (void) __attribute__ ((used, section (".preinit_array")))
+ = setup_aeabi_stdio;
+
+eabi_constant (CLOCKS_PER_SEC);
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_localeconv.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_localeconv.c
new file mode 100644
index 0000000..0cd0f37
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_localeconv.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 2004, 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
+ 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. */
+
+#include <locale.h>
+
+
+struct lconv * __aeabi_localeconv (void);
+struct lconv * __aeabi_localeconv (void)
+{
+ return localeconv ();
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_math.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_math.c
new file mode 100644
index 0000000..e7f1dbf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_math.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 2004, 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
+ 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.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ 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. */
+
+#include <math.h>
+
+const double __aeabi_HUGE_VAL attribute_hidden = HUGE_VAL;
+const long double __aeabi_HUGE_VALL attribute_hidden = HUGE_VALL;
+const float __aeabi_HUGE_VALF attribute_hidden = HUGE_VALF;
+const float __aeabi_INFINITY attribute_hidden = INFINITY;
+const float __aeabi_NAN attribute_hidden = NAN;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_mb_cur_max.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_mb_cur_max.c
new file mode 100644
index 0000000..77e979a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_mb_cur_max.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 2004, 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
+ 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. */
+
+#include <langinfo.h>
+#include <locale.h>
+#include <stdlib.h>
+
+int
+__aeabi_MB_CUR_MAX (void)
+{
+ return MB_CUR_MAX;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memclr.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memclr.c
new file mode 100644
index 0000000..c6e2e3a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memclr.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 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
+ 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. */
+
+#include <string.h>
+
+
+/* Clear memory. Can't alias to bzero because it's not defined in the
+ same translation unit. */
+void __aeabi_memclr (void *dest, size_t n);
+void __aeabi_memclr (void *dest, size_t n)
+{
+ memset (dest, 0, n);
+}
+
+/* Versions of the above which may assume memory alignment. */
+strong_alias (__aeabi_memclr, __aeabi_memclr4)
+strong_alias (__aeabi_memclr, __aeabi_memclr8)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memcpy.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memcpy.c
new file mode 100644
index 0000000..2fce4fd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memcpy.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 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
+ 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. */
+
+#include <string.h>
+
+
+/* Copy memory like memcpy, but no return value required. Can't alias
+ to memcpy because it's not defined in the same translation
+ unit. */
+void __aeabi_memcpy (void *dest, const void *src, size_t n);
+void __aeabi_memcpy (void *dest, const void *src, size_t n)
+{
+ memcpy (dest, src, n);
+}
+
+/* Versions of the above which may assume memory alignment. */
+strong_alias (__aeabi_memcpy, __aeabi_memcpy4)
+strong_alias (__aeabi_memcpy, __aeabi_memcpy8)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memmove.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memmove.c
new file mode 100644
index 0000000..8a5f33a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memmove.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 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
+ 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. */
+
+#include <string.h>
+
+
+/* Copy memory like memmove, but no return value required. Can't
+ alias to memmove because it's not defined in the same translation
+ unit. */
+void __aeabi_memmove (void *dest, const void *src, size_t n);
+void __aeabi_memmove (void *dest, const void *src, size_t n)
+{
+ memmove (dest, src, n);
+}
+
+/* Versions of the above which may assume memory alignment. */
+strong_alias (__aeabi_memmove, __aeabi_memmove4)
+strong_alias (__aeabi_memmove, __aeabi_memmove8)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memset.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memset.c
new file mode 100644
index 0000000..eca59b1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_memset.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 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
+ 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. */
+
+#include <string.h>
+
+
+/* Set memory like memset, but different argument order and no return
+ value required. */
+void __aeabi_memset (void *dest, size_t n, int c);
+void __aeabi_memset (void *dest, size_t n, int c)
+{
+ memset (dest, c, n);
+}
+
+/* Versions of the above which may assume memory alignment. */
+strong_alias (__aeabi_memset, __aeabi_memset4)
+strong_alias (__aeabi_memset, __aeabi_memset8)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_sighandlers.S b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_sighandlers.S
new file mode 100644
index 0000000..ba9769f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_sighandlers.S
@@ -0,0 +1,52 @@
+/* Link-time constants for ARM EABI - signal handlers.
+ Copyright (C) 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
+ 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.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ 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. */
+
+/* The ARM EABI defines these as "functions". */
+
+ .global __aeabi_SIG_DFL
+ .hidden __aeabi_SIG_DFL
+ .type __aeabi_SIG_DFL, %function
+ .set __aeabi_SIG_DFL, 0
+
+ .global __aeabi_SIG_IGN
+ .hidden __aeabi_SIG_IGN
+ .type __aeabi_SIG_IGN, %function
+ .set __aeabi_SIG_IGN, 1
+
+ .global __aeabi_SIG_ERR
+ .hidden __aeabi_SIG_ERR
+ .type __aeabi_SIG_ERR, %function
+ .set __aeabi_SIG_ERR, -1
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c
new file mode 100644
index 0000000..4544dc7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 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
+ 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. */
+
+/* Because some objects in ld.so and libc.so are built with
+ -fexceptions, we end up with references to this personality
+ routine. However, these libraries are not linked against
+ libgcc_eh.a, so we need a dummy definition. This routine will
+ never actually be called. */
+
+#include <stdlib.h>
+
+attribute_hidden void __aeabi_unwind_cpp_pr0 (void);
+attribute_hidden void __aeabi_unwind_cpp_pr0 (void)
+{
+}
+
+attribute_hidden void __aeabi_unwind_cpp_pr1 (void);
+attribute_hidden void __aeabi_unwind_cpp_pr1 (void)
+{
+}
+
+attribute_hidden void __aeabi_unwind_cpp_pr2 (void);
+attribute_hidden void __aeabi_unwind_cpp_pr2 (void)
+{
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/arm_asm.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/arm_asm.h
new file mode 100644
index 0000000..c1a3c0e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/arm_asm.h
@@ -0,0 +1,37 @@
+/* Various definitons used the the ARM uClibc assembly code. */
+#ifndef _ARM_ASM_H
+#define _ARM_ASM_H
+
+#ifdef __thumb2__
+#ifdef __ASSEMBLER__
+.thumb
+.syntax unified
+#define IT(t, cond) i##t cond
+#endif
+#else
+/* XXX: This can be removed if/when we require an assembler that supports
+ unified assembly syntax. */
+#define IT(t, cond)
+/* Code to return from a thumb function stub. */
+#ifdef __ARM_ARCH_4T__
+#define POP_RET pop {r2, pc}
+#else
+#define POP_RET pop {r2, r3}; bx r3
+#endif
+#endif
+
+#if defined(__ARM_ARCH_6M__)
+/* Force arm mode to flush out errors on M profile cores. */
+#undef IT
+#define THUMB1_ONLY 1
+#endif
+
+#if defined(__USE_BX__)
+# if ( defined (__ARM_ARCH_2__) || defined (__ARM_ARCH_3__) \
+ || defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \
+ )
+# error Use of BX was requested, but is not available on the target processor.
+# endif /* ARCH level */
+#endif /* __USE_BX__ */
+
+#endif /* _ARM_ASM_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/armsigctx.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/armsigctx.h
new file mode 100644
index 0000000..4530cdb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/armsigctx.h
@@ -0,0 +1,73 @@
+/* Definition of `struct sigcontext' for Linux/ARM
+ Copyright (C) 1996, 1997, 1998, 1999, 2000 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. */
+
+/* The format of struct sigcontext changed between 2.0 and 2.1 kernels.
+ Fortunately 2.0 puts a magic number in the first word and this is not
+ a legal value for `trap_no', so we can tell them apart. */
+
+/* Early 2.2 and 2.3 kernels do not have the `fault_address' member in
+ the sigcontext structure. Unfortunately there is no reliable way
+ to test for its presence and this word will contain garbage for too-old
+ kernels. Versions 2.2.14 and 2.3.35 (plus later versions) are known to
+ include this element. */
+
+#ifndef __ARMSIGCTX_H
+#define __ARMSIGCTX_H 1
+
+#include <asm/ptrace.h>
+
+union k_sigcontext
+ {
+ struct
+ {
+ unsigned long int trap_no;
+ unsigned long int error_code;
+ unsigned long int oldmask;
+ unsigned long int arm_r0;
+ unsigned long int arm_r1;
+ unsigned long int arm_r2;
+ unsigned long int arm_r3;
+ unsigned long int arm_r4;
+ unsigned long int arm_r5;
+ unsigned long int arm_r6;
+ unsigned long int arm_r7;
+ unsigned long int arm_r8;
+ unsigned long int arm_r9;
+ unsigned long int arm_r10;
+ unsigned long int arm_fp;
+ unsigned long int arm_ip;
+ unsigned long int arm_sp;
+ unsigned long int arm_lr;
+ unsigned long int arm_pc;
+ unsigned long int arm_cpsr;
+ unsigned long fault_address;
+ } v21;
+ struct
+ {
+ unsigned long int magic;
+ struct pt_regs reg;
+ unsigned long int trap_no;
+ unsigned long int error_code;
+ unsigned long int oldmask;
+ } v20;
+};
+
+#define SIGCONTEXT_2_0_MAGIC 0x4B534154
+
+#endif /* bits/armsigctx.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/atomic.h
new file mode 100644
index 0000000..0b90330
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/atomic.h
@@ -0,0 +1,136 @@
+/* Copyright (C) 2002, 2003, 2004, 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
+ 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. */
+
+#if defined __thumb__ && !defined __thumb2__
+#include_next <common/bits/atomic.h>
+#else
+#include <stdint.h>
+#include <sysdep.h>
+
+
+typedef int8_t atomic8_t;
+typedef uint8_t uatomic8_t;
+typedef int_fast8_t atomic_fast8_t;
+typedef uint_fast8_t uatomic_fast8_t;
+
+typedef int32_t atomic32_t;
+typedef uint32_t uatomic32_t;
+typedef int_fast32_t atomic_fast32_t;
+typedef uint_fast32_t uatomic_fast32_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+void __arm_link_error (void);
+
+/* Use the atomic builtins provided by GCC in case the backend provides
+ a pattern to do this efficiently. */
+
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+#define atomic_full_barrier() __sync_synchronize ()
+#elif defined __thumb2__
+#define atomic_full_barrier() \
+ __asm__ __volatile__ \
+ ("movw\tip, #0x0fa0\n\t" \
+ "movt\tip, #0xffff\n\t" \
+ "blx\tip" \
+ : : : "ip", "lr", "cc", "memory");
+#else
+#define atomic_full_barrier() \
+ __asm__ __volatile__ \
+ ("mov\tip, #0xffff0fff\n\t" \
+ "mov\tlr, pc\n\t" \
+ "add\tpc, ip, #(0xffff0fa0 - 0xffff0fff)" \
+ : : : "ip", "lr", "cc", "memory");
+#endif
+
+/* Atomic compare and exchange. This sequence relies on the kernel to
+ provide a compare and exchange operation which is atomic on the
+ current architecture, either via cleverness on pre-ARMv6 or via
+ ldrex / strex on ARMv6. */
+
+#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
+ ({ __arm_link_error (); oldval; })
+
+#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
+ ({ __arm_link_error (); oldval; })
+
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+ __sync_val_compare_and_swap ((mem), (oldval), (newval))
+
+/* It doesn't matter what register is used for a_oldval2, but we must
+ specify one to work around GCC PR rtl-optimization/21223. Otherwise
+ it may cause a_oldval or a_tmp to be moved to a different register. */
+
+#elif defined __thumb2__
+/* Thumb-2 has ldrex/strex. However it does not have barrier instructions,
+ so we still need to use the kernel helper. */
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+ ({ register __typeof (oldval) a_oldval __asm__ ("r0"); \
+ register __typeof (oldval) a_newval __asm__ ("r1") = (newval); \
+ register __typeof (mem) a_ptr __asm__ ("r2") = (mem); \
+ register __typeof (oldval) a_tmp __asm__ ("r3"); \
+ register __typeof (oldval) a_oldval2 __asm__ ("r4") = (oldval); \
+ __asm__ __volatile__ \
+ ("0:\tldr\t%[tmp],[%[ptr]]\n\t" \
+ "cmp\t%[tmp], %[old2]\n\t" \
+ "bne\t1f\n\t" \
+ "mov\t%[old], %[old2]\n\t" \
+ "movw\t%[tmp], #0x0fc0\n\t" \
+ "movt\t%[tmp], #0xffff\n\t" \
+ "blx\t%[tmp]\n\t" \
+ "bcc\t0b\n\t" \
+ "mov\t%[tmp], %[old2]\n\t" \
+ "1:" \
+ : [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp) \
+ : [new] "r" (a_newval), [ptr] "r" (a_ptr), \
+ [old2] "r" (a_oldval2) \
+ : "ip", "lr", "cc", "memory"); \
+ a_tmp; })
+#else
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+ ({ register __typeof (oldval) a_oldval __asm__ ("r0"); \
+ register __typeof (oldval) a_newval __asm__ ("r1") = (newval); \
+ register __typeof (mem) a_ptr __asm__ ("r2") = (mem); \
+ register __typeof (oldval) a_tmp __asm__ ("r3"); \
+ register __typeof (oldval) a_oldval2 __asm__ ("r4") = (oldval); \
+ __asm__ __volatile__ \
+ ("0:\tldr\t%[tmp],[%[ptr]]\n\t" \
+ "cmp\t%[tmp], %[old2]\n\t" \
+ "bne\t1f\n\t" \
+ "mov\t%[old], %[old2]\n\t" \
+ "mov\t%[tmp], #0xffff0fff\n\t" \
+ "mov\tlr, pc\n\t" \
+ "add\tpc, %[tmp], #(0xffff0fc0 - 0xffff0fff)\n\t" \
+ "bcc\t0b\n\t" \
+ "mov\t%[tmp], %[old2]\n\t" \
+ "1:" \
+ : [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp) \
+ : [new] "r" (a_newval), [ptr] "r" (a_ptr), \
+ [old2] "r" (a_oldval2) \
+ : "ip", "lr", "cc", "memory"); \
+ a_tmp; })
+#endif
+
+#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+ ({ __arm_link_error (); oldval; })
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/endian.h
new file mode 100644
index 0000000..6e9967d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/endian.h
@@ -0,0 +1,19 @@
+#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
+
+/* 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
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/fcntl.h
new file mode 100644
index 0000000..7cc5a9d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/fcntl.h
@@ -0,0 +1,238 @@
+/* O_*, F_*, FD_* bit values for Linux.
+ Copyright (C) 1995-1998, 2000, 2004, 2006, 2007, 2008
+ 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 _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#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 */
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_CREAT 0100 /* not fcntl */
+#define O_EXCL 0200 /* not fcntl */
+#define O_NOCTTY 0400 /* not fcntl */
+#define O_TRUNC 01000 /* not fcntl */
+#define O_APPEND 02000
+#define O_NONBLOCK 04000
+#define O_NDELAY O_NONBLOCK
+#define O_SYNC 010000
+#define O_FSYNC O_SYNC
+#define O_ASYNC 020000
+
+#ifdef __USE_GNU
+# define O_DIRECTORY 040000 /* Must be a directory. */
+# define O_NOFOLLOW 0100000 /* Do not follow links. */
+# define O_DIRECT 0200000 /* Direct disk access. */
+# define O_NOATIME 01000000 /* Do not set atime. */
+# define O_CLOEXEC 02000000 /* Set close_on_exec. */
+#endif
+
+/* For now Linux has synchronisity options for data and read operations.
+ We define the symbols here but let them do the same as O_SYNC since
+ this is a superset. */
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_RSYNC O_SYNC /* Synchronize read operations. */
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE 0400000
+#endif
+
+/* Values for the second argument to `fcntl'. */
+#define F_DUPFD 0 /* Duplicate file descriptor. */
+#define F_GETFD 1 /* Get file descriptor flags. */
+#define F_SETFD 2 /* Set file descriptor flags. */
+#define F_GETFL 3 /* Get file status flags. */
+#define F_SETFL 4 /* Set file status flags. */
+#ifndef __USE_FILE_OFFSET64
+# define F_GETLK 5 /* Get record locking info. */
+# define F_SETLK 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW 7 /* Set record locking info (blocking). */
+#else
+# define F_GETLK F_GETLK64 /* Get record locking info. */
+# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
+# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
+#endif
+#define F_GETLK64 12 /* Get record locking info. */
+#define F_SETLK64 13 /* Set record locking info (non-blocking). */
+#define F_SETLKW64 14 /* Set record locking info (blocking). */
+
+#if defined __USE_BSD || defined __USE_UNIX98
+# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
+# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG 10 /* Set number of signal to be sent. */
+# define F_GETSIG 11 /* Get number of signal to be sent. */
+#endif
+
+#ifdef __USE_GNU
+# 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
+
+/* 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(). */
+#define F_RDLCK 0 /* Read lock. */
+#define F_WRLCK 1 /* Write lock. */
+#define F_UNLCK 2 /* Remove lock. */
+
+/* For old implementation of bsd flock(). */
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+
+#ifdef __USE_BSD
+/* Operations for bsd flock(), also used by the kernel implementation. */
+# define LOCK_SH 1 /* shared lock */
+# define LOCK_EX 2 /* exclusive lock */
+# define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+# define LOCK_UN 8 /* remove lock */
+#endif
+
+#ifdef __USE_GNU
+# define LOCK_MAND 32 /* This is a mandatory flock: */
+# define LOCK_READ 64 /* ... which allows concurrent read operations. */
+# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
+# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
+#endif
+
+#ifdef __USE_GNU
+/* Types of directory notifications that may be requested with F_NOTIFY. */
+# define DN_ACCESS 0x00000001 /* File accessed. */
+# define DN_MODIFY 0x00000002 /* File modified. */
+# define DN_CREATE 0x00000004 /* File created. */
+# define DN_DELETE 0x00000008 /* File removed. */
+# define DN_RENAME 0x00000010 /* File renamed. */
+# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
+# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
+#endif
+
+struct flock
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+#ifndef __USE_FILE_OFFSET64
+ __off_t l_start; /* Offset where the lock begins. */
+ __off_t l_len; /* Size of the locked area; zero means until EOF. */
+#else
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+#endif
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+#endif
+
+/* Define some more compatibility macros to be backward compatible with
+ BSD systems which did not managed to hide these kernel macros. */
+#ifdef __USE_BSD
+# define FAPPEND O_APPEND
+# define FFSYNC O_FSYNC
+# define FASYNC O_ASYNC
+# define FNONBLOCK O_NONBLOCK
+# define FNDELAY O_NDELAY
+#endif /* Use BSD. */
+
+/* Advise to `posix_fadvise'. */
+#ifdef __USE_XOPEN2K
+# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
+# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
+#endif
+
+
+#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
+ 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. */
+
+/* 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
+
+#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;
+
+/* 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 ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
+
+/* Splice two files together. */
+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 ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
+
+#endif
+__END_DECLS
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/fenv.h
new file mode 100644
index 0000000..3764d77
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/fenv.h
@@ -0,0 +1,99 @@
+/* Copyright (C) 1997, 1998, 1999 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 _FENV_H
+# 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
+ {
+ FE_INVALID = 1,
+#define FE_INVALID FE_INVALID
+ FE_DIVBYZERO = 2,
+#define FE_DIVBYZERO FE_DIVBYZERO
+ FE_OVERFLOW = 4,
+#define FE_OVERFLOW FE_OVERFLOW
+ FE_UNDERFLOW = 8,
+#define FE_UNDERFLOW FE_UNDERFLOW
+ };
+
+/* Amount to shift by to convert an exception to a mask bit. */
+#define FE_EXCEPT_SHIFT 16
+
+/* All supported exceptions. */
+#define FE_ALL_EXCEPT \
+ (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW)
+
+/* The ARM FPU basically only supports round-to-nearest. Other rounding
+ 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;
+
+/* Type representing floating-point environment. */
+typedef struct
+ {
+ unsigned long int __cw;
+ }
+fenv_t;
+
+/* If the default argument is used we use this value. */
+#define FE_DFL_ENV ((fenv_t *) -1l)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/huge_val.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/huge_val.h
new file mode 100644
index 0000000..745e0bb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/huge_val.h
@@ -0,0 +1,72 @@
+/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity).
+ Used by <stdlib.h> and <math.h> functions for overflow.
+ ARM version.
+ Copyright (C) 1992, 95, 96, 97, 98, 99, 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
+ 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 _MATH_H
+# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VAL (__builtin_huge_val())
+#elif __GNUC_PREREQ(2,96)
+# define HUGE_VAL (__extension__ 0x1.0p2047)
+#elif defined __GNUC__
+
+#ifndef __ARM_EABI__
+# define HUGE_VAL \
+ (__extension__ \
+ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
+ { __l: 0x000000007ff00000ULL }).__d)
+#else
+# define HUGE_VAL \
+ (__extension__ \
+ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
+ { __l: 0x7ff0000000000000ULL }).__d)
+#endif
+
+#else /* not GCC */
+
+# include <endian.h>
+
+typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
+
+#ifndef __ARM_EABI__
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0x7f, 0xf0, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __HUGE_VAL_bytes { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 }
+# endif
+#else
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
+# endif
+#endif
+
+static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
+# define HUGE_VAL (__huge_val.__d)
+
+#endif /* GCC. */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/kernel_stat.h
new file mode 100644
index 0000000..7bd89f9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/kernel_stat.h
@@ -0,0 +1,64 @@
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+/* This file provides whatever this particular arch's kernel thinks
+ * struct kernel_stat should look like... It turns out each arch has a
+ * different opinion on the subject... */
+
+struct kernel_stat {
+#if defined(__ARMEB__)
+ unsigned short st_dev;
+ unsigned short __pad1;
+#else
+ unsigned long st_dev;
+#endif
+ unsigned long st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+#if defined(__ARMEB__)
+ unsigned short st_rdev;
+ unsigned short __pad2;
+#else
+ unsigned long st_rdev;
+#endif
+ unsigned long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+struct kernel_stat64 {
+ unsigned long long st_dev;
+ unsigned char __pad0[4];
+
+#define _HAVE_STAT64___ST_INO
+ unsigned long __st_ino;
+ unsigned int st_mode;
+ unsigned int st_nlink;
+ unsigned long st_uid;
+ unsigned long st_gid;
+
+ unsigned long long st_rdev;
+ unsigned char __pad3[4];
+
+ long long st_size;
+ unsigned long st_blksize;
+ unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
+
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+ unsigned long long st_ino;
+#ifndef __ARM_EABI__
+} __attribute__((packed));
+#else
+};
+#endif
+
+#endif /* _BITS_STAT_STRUCT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/kernel_types.h
new file mode 100644
index 0000000..6b36f32
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/kernel_types.h
@@ -0,0 +1,46 @@
+/* Note that we use the exact same include guard #define names
+ * as asm/posix_types.h. This will avoid gratuitous conflicts
+ * with the posix_types.h kernel header, and will ensure that
+ * our private content, and not the kernel header, will win.
+ * -Erik
+ */
+#ifndef __ARCH_ARM_POSIX_TYPES_H
+#define __ARCH_ARM_POSIX_TYPES_H
+
+typedef unsigned short __kernel_dev_t;
+typedef unsigned long __kernel_ino_t;
+typedef unsigned short __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned short __kernel_uid_t;
+typedef unsigned short __kernel_gid_t;
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int __kernel_uid32_t;
+typedef unsigned int __kernel_gid32_t;
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+typedef long long __kernel_loff_t;
+typedef __kernel_dev_t __kernel_old_dev_t;
+typedef long __kernel_long_t;
+typedef unsigned long __kernel_ulong_t;
+
+typedef struct {
+#ifdef __USE_ALL
+ int val[2];
+#else
+ int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* __ARCH_ARM_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/mathdef.h
new file mode 100644
index 0000000..e013e74
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/mathdef.h
@@ -0,0 +1,44 @@
+/* Copyright (C) 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
+ 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. */
+
+#if !defined _MATH_H && !defined _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#endif
+
+#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
+# define _MATH_H_MATHDEF 1
+
+/* GCC does not promote `float' values to `double'. */
+typedef float float_t; /* `float' expressions are evaluated as
+ `float'. */
+typedef double double_t; /* `double' expressions are evaluated as
+ `double'. */
+
+/* The values returned by `ilogb' for 0 and NaN respectively. */
+# define FP_ILOGB0 (-2147483647)
+# define FP_ILOGBNAN (2147483647)
+
+#endif /* ISO C99 */
+
+#ifndef __NO_LONG_DOUBLE_MATH
+/* Signal that we do not really have a `long double'. This disables the
+ declaration of all the `long double' function variants. */
+/* XXX The FPA does support this but the patterns in GCC are currently
+ turned off. */
+# define __NO_LONG_DOUBLE_MATH 1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/setjmp.h
new file mode 100644
index 0000000..ac52f12
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/setjmp.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 1997, 1998 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. */
+
+/* Define the machine-dependent type `jmp_buf'. ARM version. */
+#ifndef _BITS_SETJMP_H
+#define _BITS_SETJMP_H 1
+
+#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 __ARM_EABI__
+/* The exact set of registers saved may depend on the particular core
+ in use, as some coprocessor registers may need to be saved. The C
+ Library ABI requires that the buffer be 8-byte aligned, and
+ recommends that the buffer contain 64 words. The first 28 words
+ are occupied by v1-v6, sl, fp, sp, pc, d8-d15, and fpscr. (Note
+ that d8-15 require 17 words, due to the use of fstmx.) */
+typedef int __jmp_buf[64] __attribute__((aligned (8)));
+#elif defined __MAVERICK__ || defined __IWMMXT__
+typedef int __jmp_buf[34];
+#else
+typedef int __jmp_buf[22];
+#endif
+#endif
+
+#define __JMP_BUF_SP 8
+
+/* Test if longjmp to JMPBUF would unwind the frame
+ 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/ap/build/uClibc/libc/sysdeps/linux/arm/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/shm.h
new file mode 100644
index 0000000..c89c00a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/shm.h
@@ -0,0 +1,103 @@
+/* Copyright (C) 1995,1996,1997,2000,2002,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
+ 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_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Permission flag for shmget. */
+#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
+#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
+
+/* Flags for `shmat'. */
+#define SHM_RDONLY 010000 /* attach read-only else read-write */
+#define SHM_RND 020000 /* round attach address to SHMLBA */
+#define SHM_REMAP 040000 /* take-over region on attach */
+
+/* Commands for `shmctl'. */
+#define SHM_LOCK 11 /* lock segment (root only) */
+#define SHM_UNLOCK 12 /* unlock segment (root only) */
+
+__BEGIN_DECLS
+
+/* Segment low boundary address multiple. */
+#define SHMLBA (__getpagesize () << 2)
+extern int __getpagesize (void) __THROW __attribute__ ((__const__));
+
+
+/* Type to count number of attaches. */
+typedef unsigned long int shmatt_t;
+
+/* Data structure describing a set of semaphores. */
+struct shmid_ds
+ {
+ struct ipc_perm shm_perm; /* operation permission struct */
+ size_t shm_segsz; /* size of segment in bytes */
+ __time_t shm_atime; /* time of last shmat() */
+ unsigned long int __unused1;
+ __time_t shm_dtime; /* time of last shmdt() */
+ unsigned long int __unused2;
+ __time_t shm_ctime; /* time of last change by shmctl() */
+ unsigned long int __unused3;
+ __pid_t shm_cpid; /* pid of creator */
+ __pid_t shm_lpid; /* pid of last shmop */
+ shmatt_t shm_nattch; /* number of current attaches */
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+ };
+
+#ifdef __USE_MISC
+
+/* ipcs ctl commands */
+# define SHM_STAT 13
+# define SHM_INFO 14
+
+/* shm_mode upper byte flags */
+# define SHM_DEST 01000 /* segment will be destroyed on last detach */
+# define SHM_LOCKED 02000 /* segment will not be swapped */
+# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
+# define SHM_NORESERVE 010000 /* don't check for reservations */
+
+struct shminfo
+ {
+ unsigned long int shmmax;
+ unsigned long int shmmin;
+ unsigned long int shmmni;
+ unsigned long int shmseg;
+ unsigned long int shmall;
+ unsigned long int __unused1;
+ unsigned long int __unused2;
+ unsigned long int __unused3;
+ unsigned long int __unused4;
+ };
+
+struct shm_info
+ {
+ int used_ids;
+ unsigned long int shm_tot; /* total allocated shm */
+ unsigned long int shm_rss; /* total resident shm */
+ unsigned long int shm_swp; /* total swapped shm */
+ unsigned long int swap_attempts;
+ unsigned long int swap_successes;
+ };
+
+#endif /* __USE_MISC */
+
+__END_DECLS
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/sigcontextinfo.h
new file mode 100644
index 0000000..67167f9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/sigcontextinfo.h
@@ -0,0 +1,51 @@
+/* Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Philip Blundell <philb@gnu.org>, 1999.
+
+ 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. */
+
+#include <bits/armsigctx.h>
+#include <linux/version.h>
+
+#define SIGCONTEXT int _a2, int _a3, int _a4, union k_sigcontext
+#define SIGCONTEXT_EXTRA_ARGS _a2, _a3, _a4,
+
+/* The sigcontext structure changed between 2.0 and 2.1 kernels. On any
+ modern system we should be able to assume that the "new" format will be
+ in use. */
+#if LINUX_VERSION_CODE > 131328
+
+#define GET_PC(ctx) ((void *) ctx.v21.arm_pc)
+#define GET_FRAME(ctx) ADVANCE_STACK_FRAME ((void *) ctx.v21.arm_fp)
+#define GET_STACK(ctx) ((void *) ctx.v21.arm_sp)
+
+#else
+
+#define GET_PC(ctx) ((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
+ ctx.v20.reg.ARM_pc : ctx.v21.arm_pc))
+#define GET_FRAME(ctx) \
+ ADVANCE_STACK_FRAME((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
+ ctx.v20.reg.ARM_fp : ctx.v21.arm_fp))
+#define GET_STACK(ctx) ((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
+ ctx.v20.reg.ARM_sp : ctx.v21.arm_sp))
+
+#endif
+
+#define ADVANCE_STACK_FRAME(frm) \
+ ((struct layout *)frm - 1)
+
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+ (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/stackinfo.h
new file mode 100644
index 0000000..2410ba9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 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. */
+
+/* This file contains a bit of information about the stack allocation
+ of the processor. */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H 1
+
+/* On Arm the stack grows down. */
+#define _STACK_GROWS_DOWN 1
+
+#endif /* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/syscalls.h
new file mode 100644
index 0000000..6b747d9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/syscalls.h
@@ -0,0 +1,149 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+/*
+ Some of the sneaky macros in the code were taken from
+ glibc-2.3.2/sysdeps/unix/sysv/linux/arm/sysdep.h
+*/
+
+#ifdef __ASSEMBLER__
+
+/* Call a given syscall, with arguments loaded. For EABI, we must
+ save and restore r7 for the syscall number. Unlike the DO_CALL
+ macro in glibc, this macro does not load syscall arguments. */
+#undef DO_CALL
+#if defined(__ARM_EABI__)
+#define DO_CALL(syscall_name) \
+ mov ip, r7; \
+ ldr r7, =SYS_ify (syscall_name); \
+ swi 0x0; \
+ mov r7, ip;
+#else
+#define DO_CALL(syscall_name) \
+ swi SYS_ify (syscall_name);
+#endif
+
+#else
+
+#include <errno.h>
+
+#define INLINE_SYSCALL_NCS(name, nr, args...) \
+(__extension__ \
+ ({ \
+ unsigned int _inline_sys_result = INTERNAL_SYSCALL_NCS (name, , nr, args);\
+ if (unlikely (INTERNAL_SYSCALL_ERROR_P (_inline_sys_result, ))) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (_inline_sys_result, )); \
+ _inline_sys_result = (unsigned int) -1; \
+ } \
+ (int) _inline_sys_result; \
+ }) \
+)
+
+#if !defined(__thumb__)
+#if defined(__ARM_EABI__)
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+(__extension__ \
+ ({unsigned int __internal_sys_result; \
+ { \
+ register int __a1 __asm__ ("r0"), _nr __asm__ ("r7"); \
+ LOAD_ARGS_##nr (args) \
+ _nr = (name); \
+ __asm__ __volatile__ ("swi 0x0 @ syscall " #name \
+ : "=r" (__a1) \
+ : "r" (_nr) ASM_ARGS_##nr \
+ : "memory"); \
+ __internal_sys_result = __a1; \
+ } \
+ (int) __internal_sys_result; }) \
+)
+#else /* defined(__ARM_EABI__) */
+
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+(__extension__ \
+ ({ unsigned int __internal_sys_result; \
+ { \
+ register int __a1 __asm__ ("a1"); \
+ LOAD_ARGS_##nr (args) \
+ __asm__ __volatile__ ("swi %1 @ syscall " #name \
+ : "=r" (__a1) \
+ : "i" (name) ASM_ARGS_##nr \
+ : "memory"); \
+ __internal_sys_result = __a1; \
+ } \
+ (int) __internal_sys_result; }) \
+)
+#endif
+#else /* !defined(__thumb__) */
+/* We can't use push/pop inside the asm because that breaks
+ unwinding (ie. thread cancellation).
+ */
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+(__extension__ \
+ ({ unsigned int __internal_sys_result; \
+ { \
+ int _sys_buf[2]; \
+ register int __a1 __asm__ ("a1"); \
+ register int *_v3 __asm__ ("v3") = _sys_buf; \
+ *_v3 = (int) (name); \
+ LOAD_ARGS_##nr (args) \
+ __asm__ __volatile__ ("str r7, [v3, #4]\n" \
+ "\tldr r7, [v3]\n" \
+ "\tswi 0 @ syscall " #name "\n" \
+ "\tldr r7, [v3, #4]" \
+ : "=r" (__a1) \
+ : "r" (_v3) ASM_ARGS_##nr \
+ : "memory"); \
+ __internal_sys_result = __a1; \
+ } \
+ (int) __internal_sys_result; }) \
+)
+#endif /*!defined(__thumb__)*/
+
+#define INTERNAL_SYSCALL_ERROR_P(val, err) \
+ ((unsigned int) (val) >= 0xfffff001u)
+
+#define LOAD_ARGS_0()
+#define ASM_ARGS_0
+#define LOAD_ARGS_1(a1) \
+ int __a1tmp = (int) (a1); \
+ LOAD_ARGS_0 () \
+ __a1 = __a1tmp;
+#define ASM_ARGS_1 ASM_ARGS_0, "r" (__a1)
+#define LOAD_ARGS_2(a1, a2) \
+ int __a2tmp = (int) (a2); \
+ LOAD_ARGS_1 (a1) \
+ register int __a2 __asm__ ("a2") = __a2tmp;
+#define ASM_ARGS_2 ASM_ARGS_1, "r" (__a2)
+#define LOAD_ARGS_3(a1, a2, a3) \
+ int __a3tmp = (int) (a3); \
+ LOAD_ARGS_2 (a1, a2) \
+ register int __a3 __asm__ ("a3") = __a3tmp;
+#define ASM_ARGS_3 ASM_ARGS_2, "r" (__a3)
+#define LOAD_ARGS_4(a1, a2, a3, a4) \
+ int __a4tmp = (int) (a4); \
+ LOAD_ARGS_3 (a1, a2, a3) \
+ register int __a4 __asm__ ("a4") = __a4tmp;
+#define ASM_ARGS_4 ASM_ARGS_3, "r" (__a4)
+#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
+ int _v1tmp = (int) (a5); \
+ LOAD_ARGS_4 (a1, a2, a3, a4) \
+ register int _v1 __asm__ ("v1") = _v1tmp;
+#define ASM_ARGS_5 ASM_ARGS_4, "r" (_v1)
+#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
+ int _v2tmp = (int) (a6); \
+ LOAD_ARGS_5 (a1, a2, a3, a4, a5) \
+ register int _v2 __asm__ ("v2") = _v2tmp;
+#define ASM_ARGS_6 ASM_ARGS_5, "r" (_v2)
+#define LOAD_ARGS_7(a1, a2, a3, a4, a5, a6, a7) \
+ int _v3tmp = (int) (a7); \
+ LOAD_ARGS_6 (a1, a2, a3, a4, a5, a6) \
+ register int _v3 __asm__ ("v3") = _v3tmp;
+#define ASM_ARGS_7 ASM_ARGS_6, "r" (_v3)
+
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..14621d9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h
@@ -0,0 +1,51 @@
+/*
+ * Track misc arch-specific features that aren't config options
+ */
+
+#ifndef _BITS_UCLIBC_ARCH_FEATURES_H
+#define _BITS_UCLIBC_ARCH_FEATURES_H
+
+/* instruction used when calling abort() to kill yourself */
+#define __UCLIBC_ABORT_INSTRUCTION__ "bl abort"
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#ifdef __ARM_EABI__
+#define __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+#else
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+#endif
+
+/* 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__
+
+/* only weird assemblers generally need this */
+#undef __UCLIBC_ASM_LINE_SEP__
+
+#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bits/wordsize.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 1999 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. */
+
+#define __WORDSIZE 32
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/brk.c b/ap/build/uClibc/libc/sysdeps/linux/arm/brk.c
new file mode 100644
index 0000000..9e41c57
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/brk.c
@@ -0,0 +1,41 @@
+/* brk system call for Linux/ARM.
+ Copyright (C) 1995, 1996 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. */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+
+/* This must be initialized data because commons can't have aliases. */
+void *__curbrk attribute_hidden = 0;
+
+int brk (void *addr)
+{
+ void *newbrk = (void*)INTERNAL_SYSCALL(brk, , 1, addr);
+
+ __curbrk = newbrk;
+
+ if (newbrk < addr) {
+ __set_errno (ENOMEM);
+ return -1;
+ }
+
+ return 0;
+}
+libc_hidden_def(brk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/arm/bsd-_setjmp.S
new file mode 100644
index 0000000..a05570d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bsd-_setjmp.S
@@ -0,0 +1,61 @@
+/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. ARM version.
+ Copyright (C) 1997, 1998 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. */
+
+#include <bits/arm_asm.h>
+
+/* This just does a tail-call to `__sigsetjmp (ARG, 0)'.
+ We cannot do it in C because it must be a tail-call, so frame-unwinding
+ in setjmp doesn't clobber the state restored by longjmp. */
+
+.global _setjmp
+.type _setjmp,%function
+.align 2
+#if defined(THUMB1_ONLY)
+.thumb_func
+_setjmp:
+ mov r1, #0
+#ifdef __PIC__
+ ldr r3, .L_GOT
+ adr r2, .L_GOT
+ add r3, r2, r3
+
+ ldr r2, .L_GOT+4 /* __sigsetjmp */
+ ldr r2, [r2, r3]
+ bx r2
+
+ .align 2
+.L_GOT:
+ .word _GLOBAL_OFFSET_TABLE_-.L_GOT
+ .word __sigsetjmp(GOT)
+#else
+ ldr r2, =__sigsetjmp
+ bx r2
+.pool
+#endif
+#else
+_setjmp:
+ mov r1, #0
+#ifdef __PIC__
+ b __sigsetjmp(PLT)
+#else
+ b __sigsetjmp
+#endif
+#endif
+
+.size _setjmp,.-_setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/arm/bsd-setjmp.S
new file mode 100644
index 0000000..d7ca72a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/bsd-setjmp.S
@@ -0,0 +1,61 @@
+/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. ARM version.
+ Copyright (C) 1997, 1998 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. */
+
+#include <bits/arm_asm.h>
+
+/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
+ We cannot do it in C because it must be a tail-call, so frame-unwinding
+ in setjmp doesn't clobber the state restored by longjmp. */
+
+.global setjmp
+.type setjmp,%function
+.align 2
+#if defined(THUMB1_ONLY)
+.thumb_func
+setjmp:
+ mov r1, #1
+#ifdef __PIC__
+ ldr r3, .L_GOT
+ adr r2, .L_GOT
+ add r3, r2, r3
+
+ ldr r2, .L_GOT+4 /* __sigsetjmp */
+ ldr r2, [r2, r3]
+ bx r2
+
+ .align 2
+.L_GOT:
+ .word _GLOBAL_OFFSET_TABLE_-.L_GOT
+ .word __sigsetjmp(GOT)
+#else
+ ldr r2, =__sigsetjmp
+ bx r2
+.pool
+#endif
+#else
+setjmp:
+ mov r1, #1
+#ifdef __PIC__
+ b __sigsetjmp(PLT)
+#else
+ b __sigsetjmp
+#endif
+#endif
+
+.size setjmp,.-setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/clone.S b/ap/build/uClibc/libc/sysdeps/linux/arm/clone.S
new file mode 100644
index 0000000..fdc05b8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/clone.S
@@ -0,0 +1,138 @@
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Pat Beirne <patb@corelcomputer.com>
+
+ 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. */
+
+/* clone() is even more special than fork() as it mucks with stacks
+ and invokes a function in the right context after its all over. */
+
+#define _ERRNO_H
+#include <features.h>
+#include <bits/errno.h>
+#include <sys/syscall.h>
+#include <bits/arm_asm.h>
+
+#if defined(__NR_clone)
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
+
+.text
+.global __clone
+.type __clone,%function
+.align 2
+#if defined(THUMB1_ONLY)
+.thumb_func
+__clone:
+ @ sanity check args
+ cmp r0, #0
+ beq __einval
+ cmp r1, #0
+ beq __einval
+
+ @ insert the args onto the new stack
+ sub r1, r1, #8
+ str r3, [r1, #4]
+ @ save the function pointer as the 0th element
+ str r0, [r1]
+
+ @ do the system call
+ @ get flags
+ mov r0, r2
+ @ new sp is already in r1
+ @ load remaining arguments off the stack
+ stmfd sp!, {r4}
+ ldr r2, [sp, #4]
+ ldr r3, [sp, #8]
+ ldr r4, [sp, #12]
+ DO_CALL (clone)
+ movs a1, a1
+ blt __error
+ ldmnefd sp!, {r4}
+ beq 1f
+ bx lr
+1:
+
+ @ pick the function arg and call address off the stack and execute
+ ldr r0, [sp, #4]
+ ldr r1, [sp]
+ bl 2f @ blx r1
+
+ @ and we are done, passing the return value through r0
+ bl HIDDEN_JUMPTARGET(_exit)
+ @ Should never return
+ b .
+
+2:
+ bx r1
+
+__einval:
+ ldr r0, =-EINVAL
+__error:
+ push {r3, lr}
+ bl __syscall_error
+ POP_RET
+.pool
+#else
+__clone:
+ @ sanity check args
+ cmp r0, #0
+ IT(te, ne)
+ cmpne r1, #0
+ moveq r0, #-EINVAL
+ beq __error
+
+ @ insert the args onto the new stack
+ sub r1, r1, #8
+ str r3, [r1, #4]
+ @ save the function pointer as the 0th element
+ str r0, [r1]
+
+ @ do the system call
+ @ get flags
+ mov r0, r2
+ @ new sp is already in r1
+ @ load remaining arguments off the stack
+ stmfd sp!, {r4}
+ ldr r2, [sp, #4]
+ ldr r3, [sp, #8]
+ ldr r4, [sp, #12]
+ DO_CALL (clone)
+ movs a1, a1
+ blt __error
+ ldmnefd sp!, {r4}
+ IT(t, ne)
+#if defined(__USE_BX__)
+ bxne lr
+#else
+ movne pc, lr
+#endif
+
+ @ pick the function arg and call address off the stack and execute
+ ldr r0, [sp, #4]
+ mov lr, pc
+ ldr pc, [sp]
+
+ @ and we are done, passing the return value through r0
+ b HIDDEN_JUMPTARGET(_exit)
+
+__error:
+ b __syscall_error
+#endif
+
+.size __clone,.-__clone
+weak_alias(__clone, clone)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/arm/crt1.S
new file mode 100644
index 0000000..f2d9507
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/crt1.S
@@ -0,0 +1,253 @@
+/* Startup code for ARM & ELF
+ 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
+ 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.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ 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. */
+
+/* This is the canonical entry point, usually the first thing in the text
+ segment.
+
+ Note that the code in the .init section has already been run.
+ This includes _init and _libc_init
+
+
+ At this entry point, most registers' values are unspecified, except:
+
+ a1 Contains a function pointer to be registered with `atexit'.
+ This is how the dynamic linker arranges to have DT_FINI
+ functions called for shared libraries that have been loaded
+ before this code runs.
+
+ sp The stack contains the arguments and environment:
+ 0(sp) argc
+ 4(sp) argv[0]
+ ...
+ (4*argc)(sp) NULL
+ (4*(argc+1))(sp) envp[0]
+ ...
+ NULL
+*/
+/*
+ For uClinux it looks like this:
+
+ argc argument counter (integer)
+ argv char *argv[]
+ envp char *envp[]
+ argv[0] program name (pointer)
+ argv[1...N] program args (pointers)
+ argv[argc-1] end of args (integer)
+ NULL
+ env[0...N] environment variables (pointers)
+ NULL
+
+ARM register quick reference:
+
+ Name Number ARM Procedure Calling Standard Role
+
+ a1 r0 argument 1 / integer result / scratch register / argc
+ a2 r1 argument 2 / scratch register / argv
+ a3 r2 argument 3 / scratch register / envp
+ a4 r3 argument 4 / scratch register
+ v1 r4 register variable
+ v2 r5 register variable
+ v3 r6 register variable
+ v4 r7 register variable
+ v5 r8 register variable
+ sb/v6 r9 static base / register variable
+ sl/v7 r10 stack limit / stack chunk handle / reg. variable
+ fp r11 frame pointer
+ ip r12 scratch register / new-sb in inter-link-unit calls
+ sp r13 lower end of current stack frame
+ lr r14 link address / scratch register
+ pc r15 program counter
+*/
+
+#include <features.h>
+#include <bits/arm_asm.h>
+
+.text
+ .globl _start
+ .type _start,%function
+ .type _init,%function
+ .type _fini,%function
+#ifndef __UCLIBC_CTOR_DTOR__
+ .weak _init
+ .weak _fini
+#endif
+
+#if defined(THUMB1_ONLY)
+.thumb_func
+_start:
+ /* Clear the frame pointer since this is the outermost frame. */
+ mov r3, #0
+ mov fp, r3
+
+#ifdef __ARCH_USE_MMU__
+ /* Pop argc off the stack and save a pointer to argv */
+ pop {a2}
+ mov a3, sp
+#else
+ /*
+ * uClinux/arm stacks look a little different from normal
+ * MMU-full Linux/arm stacks (for no good reason)
+ */
+ /* pull argc and argv off the stack. We are going to push 3
+ * arguments, so pop one here to maintain doubleword alignment. */
+ pop {a2}
+ ldr a3, [sp]
+#endif
+
+ /* Push stack limit and rtld_fini */
+ push {a1, a3}
+
+#ifdef __PIC__
+ ldr r4, .L_GOT
+ adr r5, .L_GOT
+ add r4, r5, r4
+
+ ldr r5, .L_GOT+4 /* _fini */
+ ldr a1, [r4, r5]
+ push {a1} /* Push _fini */
+
+ ldr r5, .L_GOT+8 /* _init */
+ ldr a4, [r4, r5]
+
+ ldr r5, .L_GOT+12 /* main */
+ ldr a1, [r4, r5]
+
+#else
+ /* Fetch address of fini */
+ ldr r4, =_fini
+ /* Push fini */
+ push {r4}
+
+ /* Set up the other arguments in registers */
+ ldr a1, =main
+ ldr a4, =_init
+#endif
+ /* __uClibc_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
+ /* Let the libc call main and exit with its return code. */
+ bl __uClibc_main
+
+ /* should never get here....*/
+ bl abort
+.pool
+
+#ifdef __PIC__
+.L_GOT:
+ .word _GLOBAL_OFFSET_TABLE_-.L_GOT
+ .word _fini(GOT)
+ .word _init(GOT)
+ .word main(GOT)
+#endif
+#else /* !THUMB1_ONLY */
+_start:
+ /* Clear the frame pointer and link register since this is the outermost frame. */
+ mov fp, #0
+ mov lr, #0
+
+#ifdef __ARCH_USE_MMU__
+ /* Pop argc off the stack and save a pointer to argv */
+ ldr a2, [sp], #4
+ mov a3, sp
+#else
+ /*
+ * uClinux/arm stacks look a little different from normal
+ * MMU-full Linux/arm stacks (for no good reason)
+ */
+ /* pull argc and argv off the stack. We are going to push 3
+ * arguments, so pop one here to maintain doubleword alignment. */
+ ldr a2, [sp], #4
+ ldr a3, [sp]
+#endif
+
+ /* Push stack limit */
+ str a3, [sp, #-4]!
+
+ /* Push rtld_fini */
+ str a1, [sp, #-4]!
+
+#ifdef __PIC__
+ ldr sl, .L_GOT
+ adr a4, .L_GOT
+ add sl, sl, a4
+
+ ldr ip, .L_GOT+4 /* _fini */
+ ldr a1, [sl, ip]
+ str a1, [sp, #-4]! /* Push _fini */
+
+ ldr ip, .L_GOT+8 /* _init */
+ ldr a4, [sl, ip]
+
+ ldr ip, .L_GOT+12 /* main */
+ ldr a1, [sl, ip]
+
+ /* __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(PLT)
+#else
+ /* Fetch address of fini */
+ ldr ip, =_fini
+ /* Push fini */
+ str ip, [sp, #-4]!
+
+ /* Set up the other arguments in registers */
+ ldr a1, =main
+ 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
+ .word _fini(GOT)
+ .word _init(GOT)
+ .word main(GOT)
+#endif
+#endif
+
+/* Define a symbol for the first piece of initialized data. */
+ .data
+ .globl __data_start
+__data_start:
+ .long 0
+ .weak data_start
+ data_start = __data_start
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/crti.S b/ap/build/uClibc/libc/sysdeps/linux/arm/crti.S
new file mode 100644
index 0000000..e335b71
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/crti.S
@@ -0,0 +1,87 @@
+ .file "initfini.c"
+
+#include <bits/arm_asm.h>
+ .section .init
+ .global _init
+ .type _init, %function
+#if defined __thumb__
+ .align 1
+ .thumb
+ .thumb_func
+_init:
+ push {r4-r7, lr}
+#else
+ .align 2
+ .arm
+_init:
+ @ gcc 3.3.2 didn't create a stack frame, gcc 3.4.4 does -
+ @ presumably 3.4.4 can put stuff into .init which requires
+ @ the arguments to be saved. This code is copied from 3.4.4
+ mov ip, sp
+ stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc}
+ sub fp, ip, #4
+#endif
+
+
+ .section .fini
+ .global _fini
+ .type _fini, %function
+#if defined __thumb__
+ .align 1
+ .thumb
+ .thumb_func
+_fini:
+ push {r4-r7, lr}
+#else
+ .align 2
+ .arm
+_fini:
+ mov ip, sp
+ stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc}
+ sub fp, ip, #4
+#endif
+
+
+#if (defined __thumb__ || defined __THUMB_INTERWORK__) && (defined __ARM_ARCH_4T__ || defined __ARM_ARCH_5T__ || defined __ARM_ARCH_5TE__)
+ @ To support thumb code it is currently necessary to have the _call_via_rX
+ @ functions exposed to the linker for any program or shared library. PLT
+ @ references are inadequate - the PLT zaps ip and therefore breaks _call_via_ip
+ @ (and the compiler does generate this). It is simpler to put all the
+ @ required code in here - it only amounts to 60 bytes overhead.
+ @NOTE: it would be better to have the compiler generate this stuff as
+ @ required...
+ .section ".text"
+ .align 0
+ .force_thumb
+
+.macro call_via register
+ .global _call_via_\register
+ .type _call_via_\register, %function
+ .weak _call_via_\register
+ .hidden _call_via_\register
+ .thumb_func
+_call_via_\register:
+ bx \register
+ nop
+ .size _call_via_\register, . - _call_via_\register
+.endm
+
+ @ and calls for the 15 general purpose registers (2 bytes each).
+ call_via r0
+ call_via r1
+ call_via r2
+ call_via r3
+ call_via r4
+ call_via r5
+ call_via r6
+ call_via r7
+ call_via r8
+ call_via r9
+ call_via sl
+ call_via fp
+ call_via ip
+ call_via sp
+ call_via lr
+#endif
+
+ .ident "GCC: (GNU) 3.3.2 20031005 (Debian prerelease)"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/arm/crtn.S
new file mode 100644
index 0000000..a4752c1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/crtn.S
@@ -0,0 +1,33 @@
+ .file "initfini.c"
+
+#include <bits/arm_asm.h>
+ .section .init
+ .global _init
+ .type _init, %function
+#if defined __thumb__
+ .align 1
+ .thumb
+ @ this will not work on ARMv4T, but lots of stuff
+ @ in here won't work there anyway...
+ pop {r4-r7, pc}
+#else
+ .align 2
+ .arm
+ ldmdb fp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, pc}
+#endif
+
+ .section .fini
+ .global _fini
+ .type _fini, %function
+#if defined __thumb__
+ .align 1
+ .thumb
+ pop {r4-r7, pc}
+#else
+ .align 2
+ .arm
+ ldmdb fp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, pc}
+#endif
+
+ @ In fact this is modified to 3.4.4
+ .ident "GCC: (GNU) 3.3.2 20031005 (Debian prerelease)"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/find_exidx.c b/ap/build/uClibc/libc/sysdeps/linux/arm/find_exidx.c
new file mode 100644
index 0000000..a16534b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/find_exidx.c
@@ -0,0 +1,80 @@
+/* Copyright (C) 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
+ 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. */
+
+#include <link.h>
+#include <unwind.h>
+
+struct unw_eh_callback_data
+{
+ _Unwind_Ptr pc;
+ _Unwind_Ptr exidx_start;
+ int exidx_len;
+};
+
+
+/* Callback to determins if the PC lies within an object, and remember the
+ location of the exception index table if it does. */
+
+static int
+find_exidx_callback (struct dl_phdr_info * info, size_t size, void * ptr)
+{
+ struct unw_eh_callback_data * data;
+ const ElfW(Phdr) *phdr;
+ int i;
+ int match;
+ _Unwind_Ptr load_base;
+
+ data = (struct unw_eh_callback_data *) ptr;
+ load_base = info->dlpi_addr;
+ phdr = info->dlpi_phdr;
+
+ match = 0;
+ for (i = info->dlpi_phnum; i > 0; i--, phdr++)
+ {
+ if (phdr->p_type == PT_LOAD)
+ {
+ _Unwind_Ptr vaddr = phdr->p_vaddr + load_base;
+ if (data->pc >= vaddr && data->pc < vaddr + phdr->p_memsz)
+ match = 1;
+ }
+ else if (phdr->p_type == PT_ARM_EXIDX)
+ {
+ data->exidx_start = (_Unwind_Ptr) (phdr->p_vaddr + load_base);
+ data->exidx_len = phdr->p_memsz;
+ }
+ }
+
+ return match;
+}
+
+
+/* Find the exception index table containing PC. */
+
+_Unwind_Ptr __gnu_Unwind_Find_exidx (_Unwind_Ptr pc, int * pcount);
+_Unwind_Ptr __gnu_Unwind_Find_exidx (_Unwind_Ptr pc, int * pcount)
+{
+ struct unw_eh_callback_data data;
+
+ data.pc = pc;
+ data.exidx_start = 0;
+ if (dl_iterate_phdr (find_exidx_callback, &data) <= 0)
+ return 0;
+
+ *pcount = data.exidx_len / 8;
+ return data.exidx_start;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/arm/fpu_control.h
new file mode 100644
index 0000000..1170c9e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/fpu_control.h
@@ -0,0 +1,203 @@
+/* FPU control word definitions. ARM version.
+ Copyright (C) 1996, 1997, 1998, 2000 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 _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+#ifdef __VFP_FP__
+
+/* masking of interrupts */
+#define _FPU_MASK_IM 0x00000100 /* invalid operation */
+#define _FPU_MASK_ZM 0x00000200 /* divide by zero */
+#define _FPU_MASK_OM 0x00000400 /* overflow */
+#define _FPU_MASK_UM 0x00000800 /* underflow */
+#define _FPU_MASK_PM 0x00001000 /* inexact */
+
+/* Some bits in the FPSCR are not yet defined. They must be preserved when
+ modifying the contents. */
+#define _FPU_RESERVED 0x0e08e0e0
+#define _FPU_DEFAULT 0x00000000
+/* Default + exceptions enabled. */
+#define _FPU_IEEE (_FPU_DEFAULT | 0x00001f00)
+
+/* Type of the control word. */
+typedef unsigned int fpu_control_t;
+
+/* Macros for accessing the hardware control word. */
+/* This is fmrx %0, fpscr. */
+#define _FPU_GETCW(cw) \
+ __asm__ __volatile__ ("mrc p10, 7, %0, cr1, cr0, 0" : "=r" (cw))
+/* This is fmxr fpscr, %0. */
+#define _FPU_SETCW(cw) \
+ __asm__ __volatile__ ("mcr p10, 7, %0, cr1, cr0, 0" : : "r" (cw))
+
+#elif defined __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
+ * accessible from supervisor mode.)
+ *
+ * The FPSR looks like this:
+ *
+ * 31-24 23-16 15-8 7-0
+ * | system ID | trap enable | system control | exception flags |
+ *
+ * We ignore the system ID bits; for interest's sake they are:
+ *
+ * 0000 "old" FPE
+ * 1000 FPPC hardware
+ * 0001 FPE 400
+ * 1001 FPA hardware
+ *
+ * The trap enable and exception flags are both structured like this:
+ *
+ * 7 - 5 4 3 2 1 0
+ * | reserved | INX | UFL | OFL | DVZ | IVO |
+ *
+ * where a `1' bit in the enable byte means that the trap can occur, and
+ * a `1' bit in the flags byte means the exception has occurred.
+ *
+ * The exceptions are:
+ *
+ * IVO - invalid operation
+ * DVZ - divide by zero
+ * OFL - overflow
+ * UFL - underflow
+ * INX - inexact (do not use; implementations differ)
+ *
+ * The system control byte looks like this:
+ *
+ * 7-5 4 3 2 1 0
+ * | reserved | AC | EP | SO | NE | ND |
+ *
+ * where the bits mean
+ *
+ * ND - no denormalised numbers (force them all to zero)
+ * NE - enable NaN exceptions
+ * SO - synchronous operation
+ * EP - use expanded packed-decimal format
+ * AC - use alternate definition for C flag on compare operations
+ */
+
+/* masking of interrupts */
+#define _FPU_MASK_IM 0x00010000 /* invalid operation */
+#define _FPU_MASK_ZM 0x00020000 /* divide by zero */
+#define _FPU_MASK_OM 0x00040000 /* overflow */
+#define _FPU_MASK_UM 0x00080000 /* underflow */
+#define _FPU_MASK_PM 0x00100000 /* inexact */
+#define _FPU_MASK_DM 0x00000000 /* denormalized operation */
+
+/* The system id bytes cannot be changed.
+ Only the bottom 5 bits in the trap enable byte can be changed.
+ Only the bottom 5 bits in the system control byte can be changed.
+ Only the bottom 5 bits in the exception flags are used.
+ The exception flags are set by the fpu, but can be zeroed by the user. */
+#define _FPU_RESERVED 0xffe0e0e0 /* These bits are reserved. */
+
+/* The fdlibm code requires strict IEEE double precision arithmetic,
+ no interrupts for exceptions, rounding to nearest. Changing the
+ rounding mode will break long double I/O. Turn on the AC bit,
+ the compiler generates code that assumes it is on. */
+#define _FPU_DEFAULT 0x00001000 /* Default value. */
+#define _FPU_IEEE 0x001f1000 /* 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) __asm__ ("rfs %0" : "=r" (cw))
+#define _FPU_SETCW(cw) __asm__ ("wfs %0" : : "r" (cw))
+
+#endif /* __MAVERICK__ */
+
+#if 0
+/* Default control word set at startup. */
+extern fpu_control_t __fpu_control;
+#endif
+
+#endif /* _FPU_CONTROL_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/ioperm.c b/ap/build/uClibc/libc/sysdeps/linux/arm/ioperm.c
new file mode 100644
index 0000000..e1da187
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/ioperm.c
@@ -0,0 +1,241 @@
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Phil Blundell, based on the Alpha version by
+ David Mosberger.
+
+ 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. */
+
+/* I/O port access on the ARM is something of a fiction. What we do is to
+ map an appropriate area of /dev/mem into user space so that a program
+ can blast away at the hardware in such a way as to generate I/O cycles
+ on the bus. To insulate user code from dependencies on particular
+ hardware we don't allow calls to inb() and friends to be inlined, but
+ force them to come through code in here every time. Performance-critical
+ registers tend to be memory mapped these days so this should be no big
+ problem. */
+
+/* Once upon a time this file used mprotect to enable and disable
+ access to particular areas of I/O space. Unfortunately the
+ mprotect syscall also has the side effect of enabling caching for
+ the area affected (this is a kernel limitation). So we now just
+ enable all the ports all of the time. */
+
+#include <sys/io.h>
+#include <sys/mman.h>
+#include <sys/sysctl.h>
+#include <paths.h>
+#include <errno.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <linux/version.h>
+
+#define PATH_ARM_SYSTYPE "/etc/arm_systype"
+#define PATH_CPUINFO "/proc/cpuinfo"
+
+#define MAX_PORT 0x10000
+
+static struct {
+ unsigned long int base;
+ unsigned long int io_base;
+ unsigned int shift;
+ unsigned int initdone; /* since all the above could be 0 */
+} io;
+
+#define IO_BASE_FOOTBRIDGE 0x7c000000
+#define IO_SHIFT_FOOTBRIDGE 0
+
+static struct platform {
+ const char *name;
+ unsigned long int io_base;
+ unsigned int shift;
+} platform[] = {
+ /* All currently supported platforms are in fact the same. :-) */
+ {"Chalice-CATS", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
+ {"DEC-EBSA285", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
+ {"Corel-NetWinder", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
+ {"Rebel-NetWinder", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
+};
+
+#define IO_ADDR(port) (io.base + ((port) << io.shift))
+
+/*
+ * Initialize I/O system. There are several ways to get the information
+ * we need. Each is tried in turn until one succeeds.
+ *
+ * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*). This is the preferred method
+ * but not all kernels support it.
+ *
+ * 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE.
+ * - If it matches one of the entries in the table above, use the
+ * corresponding values.
+ * - If it begins with a number, assume this is a previously
+ * unsupported system and the values encode, in order,
+ * "<io_base>,<port_shift>".
+ *
+ * 3. Lookup the "system type" field in /proc/cpuinfo. Again, if it
+ * matches an entry in the platform[] table, use the corresponding
+ * values.
+ *
+ * 4. BUS_ISA is changed to CTL_BUS_ISA (for kernel since 2.4.23).
+ */
+
+static int
+init_iosys (void)
+{
+ char systype[256];
+ int i, n;
+
+#if LINUX_VERSION_CODE < 132119
+ static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
+ static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
+#else
+ static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE };
+ static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT };
+#endif
+
+ size_t len = sizeof(io.base);
+
+ if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
+ && ! sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0)) {
+ io.initdone = 1;
+ return 0;
+ }
+
+ n = readlink (PATH_ARM_SYSTYPE, systype, sizeof (systype) - 1);
+ if (n > 0) {
+ systype[n] = '\0';
+ if (isdigit (systype[0])) {
+ if (sscanf (systype, "%li,%i", &io.io_base, &io.shift) == 2) {
+ io.initdone = 1;
+ return 0;
+ }
+ /* else we're likely going to fail with the system match below */
+ }
+ }
+ else {
+ FILE * fp;
+
+ fp = fopen (PATH_CPUINFO, "r");
+ if (! fp)
+ return -1;
+ while ((n = fscanf (fp, "Hardware\t: %256[^\n]\n", systype)) != EOF) {
+ if (n == 1)
+ break;
+ else
+ fgets (systype, 256, fp);
+ }
+ fclose (fp);
+
+ if (n == EOF) {
+ /* this can happen if the format of /proc/cpuinfo changes... */
+ fprintf (stderr, "ioperm: Unable to determine system type.\n"
+ "\t(May need " PATH_ARM_SYSTYPE " symlink?)\n");
+ __set_errno (ENODEV);
+ return -1;
+ }
+ }
+
+ /* translate systype name into i/o system: */
+ for (i = 0; i < sizeof (platform) / sizeof (platform[0]); ++i) {
+ if (strcmp (platform[i].name, systype) == 0) {
+ io.shift = platform[i].shift;
+ io.io_base = platform[i].io_base;
+ io.initdone = 1;
+ return 0;
+ }
+ }
+
+ /* systype is not a known platform name... */
+ __set_errno (EINVAL);
+ return -1;
+}
+
+int ioperm (unsigned long int from, unsigned long int num, int turn_on)
+{
+ if (! io.initdone && init_iosys () < 0)
+ return -1;
+
+ /* this test isn't as silly as it may look like; consider overflows! */
+ if (from >= MAX_PORT || from + num > MAX_PORT) {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ if (turn_on) {
+ if (! io.base) {
+ int fd;
+
+ fd = open (_PATH_MEM, O_RDWR);
+ if (fd < 0)
+ return -1;
+
+ io.base = (unsigned long int) mmap (0, MAX_PORT << io.shift,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED, fd, io.io_base);
+ close (fd);
+ if ((long) io.base == -1)
+ return -1;
+ }
+ }
+
+ return 0;
+}
+libc_hidden_def(ioperm)
+
+
+void
+outb(unsigned char b, unsigned long int port)
+{
+ *((__volatile__ unsigned char *)(IO_ADDR (port))) = b;
+}
+
+
+void
+outw(unsigned short b, unsigned long int port)
+{
+ *((__volatile__ unsigned short *)(IO_ADDR (port))) = b;
+}
+
+
+void
+outl(unsigned long b, unsigned long int port)
+{
+ *((__volatile__ unsigned long *)(IO_ADDR (port))) = b;
+}
+
+
+unsigned char
+inb (unsigned long int port)
+{
+ return *((__volatile__ unsigned char *)(IO_ADDR (port)));
+}
+
+
+unsigned short int
+inw(unsigned long int port)
+{
+ return *((__volatile__ unsigned short *)(IO_ADDR (port)));
+}
+
+
+unsigned long int
+inl(unsigned long int port)
+{
+ return *((__volatile__ unsigned long *)(IO_ADDR (port)));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/iopl.c b/ap/build/uClibc/libc/sysdeps/linux/arm/iopl.c
new file mode 100644
index 0000000..df953d3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/iopl.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Phil Blundell, based on the Alpha version by
+ David Mosberger.
+
+ 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. */
+
+#include <sys/io.h>
+#include <errno.h>
+
+
+#define MAX_PORT 0x10000
+
+int iopl(int level)
+{
+ if (level > 3) {
+ __set_errno(EINVAL);
+ return -1;
+ }
+ if (level)
+ return ioperm(0, MAX_PORT, 1);
+ return 0;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/libc-aeabi_read_tp.S b/ap/build/uClibc/libc/sysdeps/linux/arm/libc-aeabi_read_tp.S
new file mode 100644
index 0000000..3aa135b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/libc-aeabi_read_tp.S
@@ -0,0 +1 @@
+#include <ldso/ldso/arm/aeabi_read_tp.S>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/libc-thumb_atomics.S b/ap/build/uClibc/libc/sysdeps/linux/arm/libc-thumb_atomics.S
new file mode 100644
index 0000000..e7bc895
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/libc-thumb_atomics.S
@@ -0,0 +1 @@
+#include <ldso/ldso/arm/thumb_atomics.S>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/arm/mmap.c
new file mode 100644
index 0000000..df550fe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/mmap.c
@@ -0,0 +1,74 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * _mmap() for uClibc
+ *
+ * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ */
+#include <errno.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+#if defined (__NR_mmap) || defined (__NR_mmap2)
+
+libc_hidden_proto(mmap)
+#if defined (__UCLIBC_MMAP_HAS_6_ARGS__) && defined (__NR_mmap)
+#define __NR__mmap __NR_mmap
+static __inline__ _syscall6 (__ptr_t, _mmap, __ptr_t, addr, size_t, len,
+ int, prot, int, flags, int, fd, __off_t, offset)
+__ptr_t mmap(__ptr_t addr, size_t len, int prot,
+ int flags, int fd, __off_t offset)
+{
+ return (__ptr_t) _mmap (addr, len, prot, flags,
+ fd, offset);
+}
+
+#elif defined (__NR_mmap2)
+#define __NR__mmap __NR_mmap2
+
+#ifndef MMAP2_PAGE_SHIFT
+# define MMAP2_PAGE_SHIFT 12
+#endif
+
+static __inline__ _syscall6 (__ptr_t, _mmap, __ptr_t, addr, size_t, len,
+ int, prot, int, flags, int, fd, __off_t, offset);
+__ptr_t mmap(__ptr_t addr, size_t len, int prot,
+ int flags, int fd, __off_t offset)
+{
+ /* check if offset is page aligned */
+ if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1))
+ {
+ __set_errno(EINVAL);
+ return MAP_FAILED;
+ }
+#ifdef __USE_FILE_OFFSET64
+ return (__ptr_t) _mmap (addr, len, prot, flags,
+ fd, ((__u_quad_t) offset >> MMAP2_PAGE_SHIFT));
+#else
+ return (__ptr_t) _mmap (addr, len, prot, flags,
+ fd, ((__u_long) offset >> MMAP2_PAGE_SHIFT));
+#endif
+}
+#elif defined (__NR_mmap)
+# define __NR__mmap __NR_mmap
+static __inline__ _syscall1(__ptr_t, _mmap, unsigned long *, buffer)
+__ptr_t mmap(__ptr_t addr, size_t len, int prot,
+ int flags, int fd, __off_t offset)
+{
+ unsigned long buffer[6];
+
+ buffer[0] = (unsigned long) addr;
+ buffer[1] = (unsigned long) len;
+ buffer[2] = (unsigned long) prot;
+ buffer[3] = (unsigned long) flags;
+ buffer[4] = (unsigned long) fd;
+ buffer[5] = (unsigned long) offset;
+ return (__ptr_t) _mmap(buffer);
+}
+#endif
+libc_hidden_def (mmap)
+#else
+# error "Your architecture doesn't seem to provide mmap() !?"
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/mmap64.S b/ap/build/uClibc/libc/sysdeps/linux/arm/mmap64.S
new file mode 100644
index 0000000..7071541
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/mmap64.S
@@ -0,0 +1,142 @@
+/* Copyright (C) 2000 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. */
+
+#include <features.h>
+#define _ERRNO_H
+#include <bits/errno.h>
+#include <sys/syscall.h>
+#include <bits/arm_asm.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_mmap2
+
+/* The mmap2 system call takes six arguments, all in registers. */
+.text
+.global mmap64
+.type mmap64,%function
+.align 2
+
+#ifdef __ARM_EABI__
+#if defined(THUMB1_ONLY)
+.thumb_func
+mmap64:
+#ifdef __ARMEB__
+/* Offsets are after pushing 3 words. */
+# define LOW_OFFSET 12 + 8 + 4
+# define HIGH_OFFSET 12 + 8 + 0
+#else
+# define LOW_OFFSET 12 + 8 + 0
+# define HIGH_OFFSET 12 + 8 + 4
+#endif
+ push {r4, r5, r6}
+ ldr r6, [sp, $LOW_OFFSET]
+ ldr r5, [sp, $HIGH_OFFSET]
+ lsl r4, r6, #20 @ check that offset is page-aligned
+ bne .Linval
+ lsr r4, r5, #12 @ check for overflow
+ bne .Linval
+ @ compose page offset
+ lsr r6, r6, #12
+ lsl r5, r5, #20
+ orr r5, r5, r6
+ ldr r4, [sp, #8] @ load fd
+ DO_CALL (mmap2)
+ ldr r1, =0xfffff000
+ cmp r0, r1
+ bcs .Lerror
+ bx lr
+.Linval:
+ ldr r0, =-EINVAL
+ pop {r4, r5, r6}
+.Lerror:
+ push {r3, lr}
+ bl __syscall_error
+ POP_RET
+.pool
+#else /* !THUMB1_ONLY */
+mmap64:
+#ifdef __ARMEB__
+# define LOW_OFFSET 8 + 4
+/* The initial + 4 is for the stack postdecrement. */
+# define HIGH_OFFSET 4 + 8 + 0
+#else
+# define LOW_OFFSET 8 + 0
+# define HIGH_OFFSET 4 + 8 + 4
+#endif
+ ldr ip, [sp, $LOW_OFFSET]
+ str r5, [sp, #-4]!
+ ldr r5, [sp, $HIGH_OFFSET]
+ str r4, [sp, #-4]!
+ movs r4, ip, lsl $20 @ check that offset is page-aligned
+ mov ip, ip, lsr $12
+ IT(t, eq)
+ moveqs r4, r5, lsr $12 @ check for overflow
+ bne .Linval
+ ldr r4, [sp, $8] @ load fd
+ orr r5, ip, r5, lsl $20 @ compose page offset
+ DO_CALL (mmap2)
+ cmn r0, $4096
+ ldmfd sp!, {r4, r5}
+ IT(t, cc)
+#if defined(__USE_BX__)
+ bxcc lr
+#else
+ movcc pc, lr
+#endif
+ b __syscall_error
+.Linval:
+ mov r0, $-EINVAL
+ ldmfd sp!, {r4, r5}
+ b __syscall_error
+#endif
+#else /* !__ARM_EABI__ */
+mmap64:
+ stmfd sp!, {r4, r5, lr}
+ ldr r5, [sp, $16]
+ ldr r4, [sp, $12]
+ movs ip, r5, lsl $20 @ check that offset is page-aligned
+ bne .Linval
+ ldr ip, [sp, $20]
+ mov r5, r5, lsr $12
+ orr r5, r5, ip, lsl $20 @ compose page offset
+ movs ip, ip, lsr $12
+ bne .Linval @ check for overflow
+ mov ip, r0
+ DO_CALL (mmap2)
+ cmn r0, $4096
+ ldmccfd sp!, {r4, r5, pc}
+ cmn r0, $ENOSYS
+ ldmnefd sp!, {r4, r5, lr}
+ bne __error
+ /* The current kernel does not support mmap2. Fall back to plain
+ mmap if the offset is small enough. */
+ ldr r5, [sp, $20]
+ mov r0, ip @ first arg was clobbered
+ teq r5, $0
+ ldmeqfd sp!, {r4, r5, lr}
+ beq HIDDEN_JUMPTARGET(mmap)
+.Linval:
+ mov r0, $-EINVAL
+ ldmfd sp!, {r4, r5, lr}
+ b __error
+
+__error:
+ b __syscall_error
+#endif
+.size mmap64,.-mmap64
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/posix_fadvise.c b/ap/build/uClibc/libc/sysdeps/linux/arm/posix_fadvise.c
new file mode 100644
index 0000000..d8ba58f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/posix_fadvise.c
@@ -0,0 +1,49 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise() for ARM uClibc
+ * http://www.opengroup.org/onlinepubs/009695399/functions/posix_fadvise.html
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+#if defined __NR_arm_fadvise64_64
+
+#define HIGH_BITS(x) (sizeof(x) > 4 ? (x) >> 32 : 0)
+
+/* Was named __libc_posix_fadvise for some inexplicable reason.
+** google says only uclibc has *__libc*_posix_fadviseXXX,
+** so it cannot be compat with anything.
+**
+** Remove this comment and one at the end after 0.9.31
+*/
+
+/* This is for the ARM version of fadvise64_64 which swaps the params
+ * about to avoid having ABI compat issues
+ */
+#define __NR___syscall_arm_fadvise64_64 __NR_arm_fadvise64_64
+int posix_fadvise(int fd, off_t offset, off_t len, int advise)
+{
+ INTERNAL_SYSCALL_DECL (err);
+ int ret = INTERNAL_SYSCALL (arm_fadvise64_64, err, 6, fd, advise,
+ __LONG_LONG_PAIR (HIGH_BITS(offset), (long)offset),
+ __LONG_LONG_PAIR (HIGH_BITS(len), (long)len));
+
+ if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+ return INTERNAL_SYSCALL_ERRNO (ret, err);
+ return 0;
+}
+
+/* weak_alias(__libc_posix_fadvise, posix_fadvise); */
+
+#elif defined __UCLIBC_HAS_STUBS__
+
+int posix_fadvise(int fd attribute_unused, off_t offset attribute_unused, off_t len attribute_unused, int advice attribute_unused)
+{
+ return ENOSYS;
+}
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/posix_fadvise64.c b/ap/build/uClibc/libc/sysdeps/linux/arm/posix_fadvise64.c
new file mode 100644
index 0000000..678c42f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/posix_fadvise64.c
@@ -0,0 +1,59 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise64() for ARM uClibc
+ * http://www.opengroup.org/onlinepubs/009695399/functions/posix_fadvise.html
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+#include <unistd.h>
+#include <errno.h>
+#include <endian.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+
+#if defined __NR_arm_fadvise64_64
+
+/* Was named __libc_posix_fadvise64 for some inexplicable reason.
+** google says only uclibc has *__libc*_posix_fadviseXXX,
+** so it cannot be compat with anything.
+**
+** Remove this comment and one at the end after 0.9.31
+*/
+
+/* This is for the ARM version of fadvise64_64 which swaps the params
+ * about to avoid having ABI compat issues
+ */
+#define __NR___syscall_arm_fadvise64_64 __NR_arm_fadvise64_64
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise)
+{
+ INTERNAL_SYSCALL_DECL (err);
+ int ret = INTERNAL_SYSCALL (arm_fadvise64_64, err, 6, fd, advise,
+ __LONG_LONG_PAIR ((long)(offset >> 32), (long)offset),
+ __LONG_LONG_PAIR ((long)(len >> 32), (long)len));
+ if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
+ return 0;
+ if (INTERNAL_SYSCALL_ERRNO (ret, err) != ENOSYS)
+ return INTERNAL_SYSCALL_ERRNO (ret, err);
+ return 0;
+}
+
+/* weak_alias(__libc_posix_fadvise64, posix_fadvise64); */
+
+#elif defined __UCLIBC_HAS_STUBS__
+
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise)
+{
+ return ENOSYS;
+}
+
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/arm/setjmp.S
new file mode 100644
index 0000000..76d1790
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/setjmp.S
@@ -0,0 +1,101 @@
+/* setjmp for ARM.
+ Copyright (C) 1997, 1998 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. */
+
+#include <features.h>
+#include <bits/arm_asm.h>
+
+.global __sigsetjmp
+.type __sigsetjmp,%function
+.align 2
+#if defined(THUMB1_ONLY)
+.thumb_func
+__sigsetjmp:
+ push {r3, r4, r5, r6, r7, lr}
+ mov ip, r0
+ stmia r0!, {r4, r5, r6, r7}
+ mov r2, r8
+ mov r3, r9
+ mov r4, sl
+ mov r5, fp
+ add r6, sp, #(6 * 4)
+ mov r7, lr
+ stmia r0!, {r2, r3, r4, r5, r6, r7}
+
+ mov r0, ip
+ bl __sigjmp_save
+ pop {r3, r4, r5, r6, r7, pc}
+
+#else
+__sigsetjmp:
+ /* Save registers */
+ mov ip, r0
+#if defined(__thumb2__)
+ stmia ip!, {v1-v6, sl, fp}
+ mov r2, sp
+ stmia ip!, {r2, lr}
+#else
+ /* Save registers */
+ stmia ip!, {v1-v6, sl, fp, sp, lr}
+#endif
+#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+# ifdef __VFP_FP__
+ /* Store the VFP registers. */
+ /* Following instruction is fstmiax ip!, {d8-d15}. */
+ stc p11, cr8, [r12], #68
+ /* Store the floating-point status register. */
+ /* Following instruction is fmrx r2, fpscr. */
+ mrc p10, 7, r2, cr1, cr0, 0
+ str r2, [ip], #4
+# elif defined __MAVERICK__
+ cfstrd mvd4, [ip], #8 ; nop
+ cfstrd mvd5, [ip], #8 ; nop
+ cfstrd mvd6, [ip], #8 ; nop
+ cfstrd mvd7, [ip], #8 ; nop
+ cfstrd mvd8, [ip], #8 ; nop
+ cfstrd mvd9, [ip], #8 ; nop
+ cfstrd mvd10, [ip], #8 ; nop
+ cfstrd mvd11, [ip], #8 ; nop
+ cfstrd mvd12, [ip], #8 ; nop
+ cfstrd mvd13, [ip], #8 ; nop
+ cfstrd mvd14, [ip], #8 ; nop
+ cfstrd mvd15, [ip], #8
+# else
+ sfmea f4, 4, [ip]!
+# endif
+#endif
+#ifdef __IWMMXT__
+ /* Save the call-preserved iWMMXt registers. */
+ /* Following instructions are wstrd wr10, [ip], #8 (etc.) */
+ stcl p1, cr10, [r12], #8
+ stcl p1, cr11, [r12], #8
+ stcl p1, cr12, [r12], #8
+ stcl p1, cr13, [r12], #8
+ stcl p1, cr14, [r12], #8
+ stcl p1, cr15, [r12], #8
+#endif
+
+ /* Make a tail call to __sigjmp_save; it takes the same args. */
+#ifdef __PIC__
+ B __sigjmp_save(PLT)
+#else
+ B __sigjmp_save
+#endif
+#endif
+
+.size __sigsetjmp,.-__sigsetjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/arm/sigaction.c
new file mode 100644
index 0000000..4fd23c5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/sigaction.c
@@ -0,0 +1,106 @@
+/* Copyright (C) 1997,1998,1999,2000,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.
+
+ Totally hacked up for uClibc by Erik Andersen <andersen@codepoet.org>
+ */
+
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+#include <sys/syscall.h>
+#include <bits/kernel_sigaction.h>
+
+#define SA_RESTORER 0x04000000
+extern void __default_sa_restorer(void);
+extern void __default_rt_sa_restorer(void);
+
+extern __typeof(sigaction) __libc_sigaction;
+
+/* When RT signals are in use we need to use a different return stub. */
+#ifdef __NR_rt_sigreturn
+#define choose_restorer(flags) \
+ (flags & SA_SIGINFO) ? __default_rt_sa_restorer \
+ : __default_sa_restorer
+#else
+#define choose_restorer(flags) \
+ __default_sa_restorer
+#endif
+
+
+#ifdef __NR_rt_sigaction
+
+/* If ACT is not NULL, change the action for SIG to *ACT.
+ If OACT is not NULL, put the old action for SIG in *OACT. */
+int __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
+{
+ struct sigaction kact;
+ if (act && !(act->sa_flags & SA_RESTORER)) {
+ memcpy(&kact, act, sizeof(kact));
+ kact.sa_restorer = choose_restorer(kact.sa_flags);
+ kact.sa_flags |= SA_RESTORER;
+ act = &kact;
+ }
+ /* NB: kernel (as of 2.6.25) will return EINVAL
+ * if sizeof(act->sa_mask) does not match kernel's sizeof(sigset_t) */
+ return __syscall_rt_sigaction(sig, act, oact, sizeof(act->sa_mask));
+}
+
+#else
+
+/* If ACT is not NULL, change the action for SIG to *ACT.
+ If OACT is not NULL, put the old action for SIG in *OACT. */
+int __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
+{
+ int result;
+ struct old_kernel_sigaction kact, koact;
+
+ if (act) {
+ kact.k_sa_handler = act->sa_handler;
+ kact.sa_mask = act->sa_mask.__val[0];
+ kact.sa_flags = act->sa_flags;
+ if (kact.sa_flags & SA_RESTORER) {
+ kact.sa_restorer = act->sa_restorer;
+ } else {
+ kact.sa_restorer = choose_restorer(kact.sa_flags);
+ kact.sa_flags |= SA_RESTORER;
+ }
+ }
+ result = __syscall_sigaction(sig,
+ act ? &kact : NULL,
+ oact ? &koact : NULL);
+ if (oact && result >= 0) {
+ oact->sa_handler = koact.k_sa_handler;
+ oact->sa_mask.__val[0] = koact.sa_mask;
+ oact->sa_flags = koact.sa_flags;
+ oact->sa_restorer = koact.sa_restorer;
+ }
+ return result;
+}
+
+#endif
+
+
+#ifndef LIBC_SIGACTION
+# ifndef __UCLIBC_HAS_THREADS__
+strong_alias(__libc_sigaction,sigaction)
+libc_hidden_def(sigaction)
+# else
+weak_alias(__libc_sigaction,sigaction)
+libc_hidden_weak(sigaction)
+# endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/sigrestorer.S b/ap/build/uClibc/libc/sysdeps/linux/arm/sigrestorer.S
new file mode 100644
index 0000000..79728fd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/sigrestorer.S
@@ -0,0 +1,89 @@
+/* Copyright (C) 1999 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. */
+
+#include <bits/arm_asm.h>
+#include <sys/syscall.h>
+#include <linux/version.h>
+
+/* If no SA_RESTORER function was specified by the application we use
+ one of these. This avoids the need for the kernel to synthesise a return
+ instruction on the stack, which would involve expensive cache flushes.
+
+ Nowadays (2.6 series, and somewhat earlier) the kernel uses a high page
+ for signal trampolines, so the cache flushes are not an issue. But since
+ we do not have a vDSO, continue to use these so that we can provide
+ unwind information.
+
+ Start the unwind tables at least one instruction before the signal
+ trampoline, because the unwinder will assume we are returning after
+ a call site.
+
+ The signal frame layout changed in 2.6.18. */
+
+.global __default_sa_restorer
+.type __default_sa_restorer,%function
+.align 2
+#ifdef __ARM_EABI__
+#ifdef __thumb__
+.thumb_func
+#endif
+ .fnstart
+ .save {r0-r15}
+#if LINUX_VERSION_CODE >= 0x020612
+ .pad #32
+#else
+ .pad #12
+#endif
+ nop
+__default_sa_restorer:
+ mov r7, $SYS_ify(sigreturn)
+ swi 0x0
+ .fnend
+#else
+__default_sa_restorer:
+ DO_CALL (sigreturn)
+#endif
+
+
+#ifdef __NR_rt_sigreturn
+
+.global __default_rt_sa_restorer
+.type __default_rt_sa_restorer,%function
+.align 2
+#ifdef __ARM_EABI__
+#ifdef __thumb__
+.thumb_func
+#endif
+ .fnstart
+ .save {r0-r15}
+#if LINUX_VERSION_CODE >= 0x020612
+ .pad #160
+#else
+ .pad #168
+#endif
+ nop
+__default_rt_sa_restorer:
+ mov r7, $SYS_ify(rt_sigreturn)
+ swi 0x0
+ .fnend
+#else
+__default_rt_sa_restorer:
+ DO_CALL (rt_sigreturn)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/sys/elf.h b/ap/build/uClibc/libc/sysdeps/linux/arm/sys/elf.h
new file mode 100644
index 0000000..faa7310
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/sys/elf.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 1996, 1997, 1999, 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. */
+
+#ifndef _SYS_ELF_H
+#define _SYS_ELF_H 1
+
+#warning "This header is obsolete; use <sys/procfs.h> instead."
+
+#include <sys/procfs.h>
+
+#endif /* sys/elf.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/sys/io.h b/ap/build/uClibc/libc/sysdeps/linux/arm/sys/io.h
new file mode 100644
index 0000000..81762be
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/sys/io.h
@@ -0,0 +1,49 @@
+/* Copyright (C) 1996, 1998, 1999 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_IO_H
+
+#define _SYS_IO_H 1
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* If TURN_ON is TRUE, request for permission to do direct i/o on the
+ port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O
+ permission off for that range. This call requires root privileges. */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+ int __turn_on) __THROW;
+libc_hidden_proto(ioperm)
+
+/* Set the I/O privilege level to LEVEL. If LEVEL is nonzero,
+ permission to access any I/O port is granted. This call requires
+ root privileges. */
+extern int iopl (int __level) __THROW;
+
+/* The functions that actually perform reads and writes. */
+extern unsigned char inb (unsigned long int port) __THROW;
+extern unsigned short int inw (unsigned long int port) __THROW;
+extern unsigned long int inl (unsigned long int port) __THROW;
+
+extern void outb (unsigned char value, unsigned long int port) __THROW;
+extern void outw (unsigned short value, unsigned long int port) __THROW;
+extern void outl (unsigned long value, unsigned long int port) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_IO_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/arm/sys/procfs.h
new file mode 100644
index 0000000..3b37363
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/sys/procfs.h
@@ -0,0 +1,123 @@
+/* Copyright (C) 1996, 1997, 1999, 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. */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H 1
+
+/* This is somewhat modelled after the file of the same name on SVR4
+ systems. It provides a definition of the core file format for ELF
+ used on Linux. It doesn't have anything to do with the /proc file
+ system, even though Linux has one.
+
+ Anyway, the whole purpose of this file is for GDB and GDB only.
+ Don't read too much into it. Don't use it for anything other than
+ GDB unless you know what you are doing. */
+
+#include <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/user.h>
+
+__BEGIN_DECLS
+
+/* Type for a general-purpose register. */
+typedef unsigned long elf_greg_t;
+
+/* And the whole bunch of them. We could have used `struct
+ user_regs' directly in the typedef, but tradition says that
+ the register set is an array, which does have some peculiar
+ semantics, so leave it that way. */
+#define ELF_NGREG (sizeof (struct user_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers. */
+typedef struct user_fpregs elf_fpregset_t;
+
+/* Signal info. */
+struct elf_siginfo
+ {
+ int si_signo; /* Signal number. */
+ int si_code; /* Extra code. */
+ int si_errno; /* Errno. */
+ };
+
+/* Definitions to generate Intel SVR4-like core files. These mostly
+ have the same names as the SVR4 types with "elf_" tacked on the
+ front to prevent clashes with Linux definitions, and the typedef
+ forms have been avoided. This is mostly like the SVR4 structure,
+ but more Linuxy, with things that Linux does not support and which
+ GDB doesn't really use excluded. */
+
+struct elf_prstatus
+ {
+ struct elf_siginfo pr_info; /* Info associated with signal. */
+ short int pr_cursig; /* Current signal. */
+ unsigned long int pr_sigpend; /* Set of pending signals. */
+ unsigned long int pr_sighold; /* Set of held signals. */
+ __pid_t pr_pid;
+ __pid_t pr_ppid;
+ __pid_t pr_pgrp;
+ __pid_t pr_sid;
+ struct timeval pr_utime; /* User time. */
+ struct timeval pr_stime; /* System time. */
+ struct timeval pr_cutime; /* Cumulative user time. */
+ struct timeval pr_cstime; /* Cumulative system time. */
+ elf_gregset_t pr_reg; /* GP registers. */
+ int pr_fpvalid; /* True if math copro being used. */
+ };
+
+
+#define ELF_PRARGSZ (80) /* Number of chars for args. */
+
+struct elf_prpsinfo
+ {
+ char pr_state; /* Numeric process state. */
+ char pr_sname; /* Char for pr_state. */
+ char pr_zomb; /* Zombie. */
+ char pr_nice; /* Nice val. */
+ unsigned long int pr_flag; /* Flags. */
+ unsigned short int pr_uid;
+ unsigned short int pr_gid;
+ int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ /* Lots missing */
+ char pr_fname[16]; /* Filename of executable. */
+ char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
+ };
+
+/* The rest of this file provides the types for emulation of the
+ Solaris <proc_service.h> interfaces that should be implemented by
+ users of libthread_db. */
+
+/* Addresses. */
+typedef void *psaddr_t;
+
+/* Register sets. Linux has different names. */
+typedef elf_gregset_t prgregset_t;
+typedef elf_fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+ therefore have only one PID type. */
+typedef __pid_t lwpid_t;
+
+/* Process status and info. In the end we do provide typedefs for them. */
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+
+__END_DECLS
+
+#endif /* sys/procfs.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/arm/sys/ucontext.h
new file mode 100644
index 0000000..9ecff7b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/sys/ucontext.h
@@ -0,0 +1,97 @@
+/* Copyright (C) 1998, 1999, 2001, 2006 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. */
+
+/* System V/ARM ABI compliant context switching support. */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#include <features.h>
+#include <signal.h>
+#include <sys/procfs.h>
+
+/* We need the signal context definitions even if they are not used
+ included in <signal.h>. */
+#include <bits/sigcontext.h>
+
+typedef int greg_t;
+
+/* Number of general registers. */
+#define NGREG 18
+
+/* Container for all general registers. */
+typedef elf_gregset_t gregset_t;
+
+/* Number of each register is the `gregset_t' array. */
+enum
+{
+ R0 = 0,
+#define R0 R0
+ R1 = 1,
+#define R1 R1
+ R2 = 2,
+#define R2 R2
+ R3 = 3,
+#define R3 R3
+ R4 = 4,
+#define R4 R4
+ R5 = 5,
+#define R5 R5
+ R6 = 6,
+#define R6 R6
+ R7 = 7,
+#define R7 R7
+ R8 = 8,
+#define R8 R8
+ R9 = 9,
+#define R9 R9
+ R10 = 10,
+#define R10 R10
+ R11 = 11,
+#define R11 R11
+ R12 = 12,
+#define R12 R12
+ R13 = 13,
+#define R13 R13
+ R14 = 14,
+#define R14 R14
+ R15 = 15
+#define R15 R15
+};
+
+/* Structure to describe FPU registers. */
+typedef elf_fpregset_t fpregset_t;
+
+/* Context to describe whole processor state. This only describes
+ the core registers; coprocessor registers get saved elsewhere
+ (e.g. in uc_regspace, or somewhere unspecified on the stack
+ during non-RT signal handlers). */
+typedef struct sigcontext mcontext_t;
+
+/* Userlevel context. */
+typedef struct ucontext
+ {
+ unsigned long uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ __sigset_t uc_sigmask;
+ unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
+ } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/arm/sys/user.h
new file mode 100644
index 0000000..3fae43f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/sys/user.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 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. */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H 1
+
+/* The whole purpose of this file is for GDB and GDB only. Don't read
+ too much into it. Don't use it for anything other than GDB unless
+ you know what you are doing. */
+
+struct user_fpregs
+{
+ struct fp_reg
+ {
+ unsigned int sign1:1;
+ unsigned int unused:15;
+ unsigned int sign2:1;
+ unsigned int exponent:14;
+ unsigned int j:1;
+ unsigned int mantissa1:31;
+ unsigned int mantissa0:32;
+ } fpregs[8];
+ unsigned int fpsr:32;
+ unsigned int fpcr:32;
+ unsigned char ftype[8];
+ unsigned int init_flag;
+};
+
+struct user_regs
+{
+ unsigned long int uregs[18];
+};
+
+struct user
+{
+ struct user_regs regs; /* General registers */
+ int u_fpvalid; /* True if math co-processor being used. */
+
+ unsigned long int u_tsize; /* Text segment size (pages). */
+ unsigned long int u_dsize; /* Data segment size (pages). */
+ unsigned long int u_ssize; /* Stack segment size (pages). */
+
+ unsigned long start_code; /* Starting virtual address of text. */
+ unsigned long start_stack; /* Starting virtual address of stack. */
+
+ long int signal; /* Signal that caused the core dump. */
+ int reserved; /* No longer used */
+ struct user_regs *u_ar0; /* help gdb to find the general registers. */
+
+ unsigned long magic; /* uniquely identify a core file */
+ char u_comm[32]; /* User command that was responsible */
+ int u_debugreg[8];
+ struct user_fpregs u_fp; /* Floating point registers */
+ struct user_fpregs *u_fp0; /* help gdb to find the FP registers. */
+};
+
+#endif /* sys/user.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/syscall-eabi.S b/ap/build/uClibc/libc/sysdeps/linux/arm/syscall-eabi.S
new file mode 100644
index 0000000..b931882
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/syscall-eabi.S
@@ -0,0 +1,73 @@
+/* Copyright (C) 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
+ 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. */
+
+#include <sys/syscall.h>
+#include <bits/arm_asm.h>
+
+/* In the EABI syscall interface, we don't need a special syscall to
+ implement syscall(). It won't work reliably with 64-bit arguments
+ (but that is true on many modern platforms). */
+
+.text
+.global syscall
+.type syscall,%function
+.align 4
+#if defined(THUMB1_ONLY)
+.thumb_func
+syscall:
+ push {r4, r5, r6, r7}
+ mov ip, r0
+ mov r0, r1
+ mov r1, r2
+ mov r2, r3
+ add r7, sp, #(4 * 4)
+ ldmia r7!, {r3, r4, r5, r6}
+ mov r7, ip
+ swi 0x0
+ pop {r4, r5, r6, r7}
+ ldr r1, =0xfffff000
+ cmp r0, r1
+ bcs 1f
+ bx lr
+1:
+ push {r3, lr}
+ bl __syscall_error
+ POP_RET
+.pool
+#else
+syscall:
+ mov ip, sp
+ stmfd sp!, {r4, r5, r6, r7}
+ mov r7, r0
+ mov r0, r1
+ mov r1, r2
+ mov r2, r3
+ ldmfd ip, {r3, r4, r5, r6}
+ swi 0x0
+ ldmfd sp!, {r4, r5, r6, r7}
+ cmn r0, #4096
+ IT(t, cc)
+#if defined(__USE_BX__)
+ bxcc lr
+#else
+ movcc pc, lr
+#endif
+ b __syscall_error
+#endif
+
+.size syscall,.-syscall
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/syscall.c b/ap/build/uClibc/libc/sysdeps/linux/arm/syscall.c
new file mode 100644
index 0000000..60fbcf8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/syscall.c
@@ -0,0 +1,53 @@
+/* vi: set sw=4 ts=4: */
+/* syscall for arm/uClibc
+ *
+ * Copyright (C) 2002 by Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+
+long syscall(long sysnum, long a, long b, long c, long d, long e, long f)
+{
+#if !defined(__thumb__)
+ register long _r0 __asm__("r0")=(long)(sysnum);
+ register long _r6 __asm__("r6")=(long)(f);
+ register long _r5 __asm__("r5")=(long)(e);
+ register long _r4 __asm__("r4")=(long)(d);
+ register long _r3 __asm__("r3")=(long)(c);
+ register long _r2 __asm__("r2")=(long)(b);
+ register long _r1 __asm__("r1")=(long)(a);
+ __asm__ __volatile__(
+ "swi %1"
+ : "=r"(_r0)
+ : "i"(__NR_syscall), "r"(_r0), "r"(_r1),
+ "r"(_r2), "r"(_r3), "r"(_r4), "r"(_r5),
+ "r"(_r6)
+ : "memory");
+#else
+ register long _r7 __asm__("r7")=(long)(sysnum);
+ register long _r5 __asm__("r5")=(long)(f);
+ register long _r4 __asm__("r4")=(long)(e);
+ register long _r3 __asm__("r3")=(long)(d);
+ register long _r2 __asm__("r2")=(long)(c);
+ register long _r1 __asm__("r1")=(long)(b);
+ register long _r0 __asm__("r0")=(long)(a);
+ __asm__ __volatile__(
+ "swi 0"
+ : "=r"(_r0)
+ : "r"(_r0), "r"(_r1), "r"(_r2), "r"(_r3),
+ "r"(_r4), "r"(_r5), "r"(_r7)
+ : "memory");
+#endif
+ if(_r0 >=(unsigned long) -4095) {
+ long err = _r0;
+ (*__errno_location())=(-err);
+ _r0=(unsigned long) -1;
+ }
+ return (long) _r0;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/arm/sysdep.h
new file mode 100644
index 0000000..e498695
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/sysdep.h
@@ -0,0 +1,368 @@
+/* Assembler macros for ARM.
+ Copyright (C) 1997, 1998, 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 _LINUX_ARM_SYSDEP_H
+#define _LINUX_ARM_SYSDEP_H 1
+
+#include <common/sysdep.h>
+#include <bits/arm_asm.h>
+
+#include <sys/syscall.h>
+/* For Linux we can use the system call table in the header file
+ /usr/include/asm/unistd.h
+ of the kernel. But these symbols do not follow the SYS_* syntax
+ so we have to redefine the `SYS_ify' macro here. */
+#undef SYS_ify
+#define SWI_BASE (0x900000)
+#define SYS_ify(syscall_name) (__NR_##syscall_name)
+
+#ifdef __ASSEMBLER__
+
+/* Syntactic details of assembler. */
+
+#define ALIGNARG(log2) log2
+/* For ELF we need the `.type' directive to make shared libs work right. */
+#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,%##typearg;
+#define ASM_SIZE_DIRECTIVE(name) .size name,.-name
+
+/* In ELF C symbols are asm symbols. */
+#undef NO_UNDERSCORES
+#define NO_UNDERSCORES
+
+#define PLTJMP(_x) _x##(PLT)
+
+/* APCS-32 doesn't preserve the condition codes across function call. */
+#ifdef __APCS_32__
+#define LOADREGS(cond, base, reglist...)\
+ ldm##cond base,reglist
+#ifdef __USE_BX__
+#define RETINSTR(cond, reg) \
+ bx##cond reg
+#define DO_RET(_reg) \
+ bx _reg
+#else
+#define RETINSTR(cond, reg) \
+ mov##cond pc, reg
+#define DO_RET(_reg) \
+ mov pc, _reg
+#endif
+#else /* APCS-26 */
+#define LOADREGS(cond, base, reglist...) \
+ ldm##cond base,reglist^
+#define RETINSTR(cond, reg) \
+ mov##cond##s pc, reg
+#define DO_RET(_reg) \
+ movs pc, _reg
+#endif
+
+/* Define an entry point visible from C. */
+#define ENTRY(name) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
+ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
+ .align ALIGNARG(4); \
+ name##: \
+ CALL_MCOUNT
+
+#undef END
+#define END(name) \
+ ASM_SIZE_DIRECTIVE(name)
+
+/* If compiled for profiling, call `mcount' at the start of each function. */
+#ifdef PROF
+#define CALL_MCOUNT \
+ str lr,[sp, #-4]! ; \
+ bl PLTJMP(mcount) ; \
+ ldr lr, [sp], #4 ;
+#else
+#define CALL_MCOUNT /* Do nothing. */
+#endif
+
+#ifdef NO_UNDERSCORES
+/* Since C identifiers are not normally prefixed with an underscore
+ on this system, the asm identifier `syscall_error' intrudes on the
+ C name space. Make sure we use an innocuous name. */
+#define syscall_error __syscall_error
+#define mcount _mcount
+#endif
+/* Linux uses a negative return value to indicate syscall errors,
+ unlike most Unices, which use the condition codes' carry flag.
+
+ Since version 2.1 the return value of a system call might be
+ negative even if the call succeeded. E.g., the `lseek' system call
+ might return a large offset. Therefore we must not anymore test
+ for < 0, but test for a real error by making sure the value in R0
+ is a real error number. Linus said he will make sure the no syscall
+ returns a value in -1 .. -4095 as a valid result so we can safely
+ test with -4095. */
+
+#undef PSEUDO
+#define PSEUDO(name, syscall_name, args) \
+ .text; \
+ ENTRY (name); \
+ DO_CALL (syscall_name, args); \
+ cmn r0, $4096;
+
+#define PSEUDO_RET \
+ RETINSTR(cc, lr); \
+ b PLTJMP(SYSCALL_ERROR)
+#undef ret
+#define ret PSEUDO_RET
+
+#undef PSEUDO_END
+#define PSEUDO_END(name) \
+ SYSCALL_ERROR_HANDLER \
+ END (name)
+
+#undef PSEUDO_NOERRNO
+#define PSEUDO_NOERRNO(name, syscall_name, args) \
+ .text; \
+ ENTRY (name); \
+ DO_CALL (syscall_name, args);
+
+#define PSEUDO_RET_NOERRNO \
+ DO_RET (lr);
+
+#undef ret_NOERRNO
+#define ret_NOERRNO PSEUDO_RET_NOERRNO
+
+#undef PSEUDO_END_NOERRNO
+#define PSEUDO_END_NOERRNO(name) \
+ END (name)
+
+/* The function has to return the error code. */
+#undef PSEUDO_ERRVAL
+#define PSEUDO_ERRVAL(name, syscall_name, args) \
+ .text; \
+ ENTRY (name) \
+ DO_CALL (syscall_name, args); \
+ rsb r0, r0, #0
+
+#undef PSEUDO_END_ERRVAL
+#define PSEUDO_END_ERRVAL(name) \
+ END (name)
+
+#define ret_ERRVAL PSEUDO_RET_NOERRNO
+
+#if defined NOT_IN_libc
+# define SYSCALL_ERROR __local_syscall_error
+# ifdef RTLD_PRIVATE_ERRNO
+# define SYSCALL_ERROR_HANDLER \
+__local_syscall_error: \
+ ldr r1, 1f; \
+ rsb r0, r0, #0; \
+0: str r0, [pc, r1]; \
+ mvn r0, #0; \
+ DO_RET(lr); \
+1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8;
+# else
+# define SYSCALL_ERROR_HANDLER \
+__local_syscall_error: \
+ str lr, [sp, #-4]!; \
+ str r0, [sp, #-4]!; \
+ bl PLTJMP(C_SYMBOL_NAME(__errno_location)); \
+ ldr r1, [sp], #4; \
+ rsb r1, r1, #0; \
+ str r1, [r0]; \
+ mvn r0, #0; \
+ ldr pc, [sp], #4;
+# endif
+#else
+# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
+# define SYSCALL_ERROR __syscall_error
+#endif
+
+/* Linux takes system call args in registers:
+ syscall number in the SWI instruction
+ arg 1 r0
+ arg 2 r1
+ arg 3 r2
+ arg 4 r3
+ arg 5 r4 (this is different from the APCS convention)
+ arg 6 r5
+ arg 7 r6
+
+ The compiler is going to form a call by coming here, through PSEUDO, with
+ arguments
+ syscall number in the DO_CALL macro
+ arg 1 r0
+ arg 2 r1
+ arg 3 r2
+ arg 4 r3
+ arg 5 [sp]
+ arg 6 [sp+4]
+ arg 7 [sp+8]
+
+ We need to shuffle values between R4..R6 and the stack so that the
+ caller's v1..v3 and stack frame are not corrupted, and the kernel
+ sees the right arguments.
+
+*/
+
+#undef DO_CALL
+#if defined(__ARM_EABI__)
+#define DO_CALL(syscall_name, args) \
+ DOARGS_##args \
+ mov ip, r7; \
+ ldr r7, =SYS_ify (syscall_name); \
+ swi 0x0; \
+ mov r7, ip; \
+ UNDOARGS_##args
+#else
+#define DO_CALL(syscall_name, args) \
+ DOARGS_##args \
+ swi SYS_ify (syscall_name); \
+ UNDOARGS_##args
+#endif
+
+#define DOARGS_0 /* nothing */
+#define DOARGS_1 /* nothing */
+#define DOARGS_2 /* nothing */
+#define DOARGS_3 /* nothing */
+#define DOARGS_4 /* nothing */
+#define DOARGS_5 str r4, [sp, $-4]!; ldr r4, [sp, $4];
+#define DOARGS_6 mov ip, sp; stmfd sp!, {r4, r5}; ldmia ip, {r4, r5};
+#define DOARGS_7 mov ip, sp; stmfd sp!, {r4, r5, r6}; ldmia ip, {r4, r5, r6};
+
+#define UNDOARGS_0 /* nothing */
+#define UNDOARGS_1 /* nothing */
+#define UNDOARGS_2 /* nothing */
+#define UNDOARGS_3 /* nothing */
+#define UNDOARGS_4 /* nothing */
+#define UNDOARGS_5 ldr r4, [sp], $4;
+#define UNDOARGS_6 ldmfd sp!, {r4, r5};
+#define UNDOARGS_7 ldmfd sp!, {r4, r5, r6};
+
+#else /* not __ASSEMBLER__ */
+/* Define a macro which expands into the inline wrapper code for a system
+ call. */
+#undef INLINE_SYSCALL
+#define INLINE_SYSCALL(name, nr, args...) \
+ ({ unsigned int _inline_sys_result = INTERNAL_SYSCALL (name, , nr, args); \
+ if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_inline_sys_result, ), 0)) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (_inline_sys_result, )); \
+ _inline_sys_result = (unsigned int) -1; \
+ } \
+ (int) _inline_sys_result; })
+
+#undef INTERNAL_SYSCALL_DECL
+#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
+
+#undef INTERNAL_SYSCALL_RAW
+#if defined(__thumb__)
+/* Hide the use of r7 from the compiler, this would be a lot
+ * easier but for the fact that the syscalls can exceed 255.
+ * For the moment the LOAD_ARG_7 is sacrificed.
+ * We can't use push/pop inside the asm because that breaks
+ * unwinding (ie. thread cancellation).
+ */
+#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
+ ({ unsigned int _internal_sys_result; \
+ { \
+ int _sys_buf[2]; \
+ register int __a1 __asm__ ("a1"); \
+ register int *_v3 __asm__ ("v3") = _sys_buf; \
+ LOAD_ARGS_##nr (args) \
+ *_v3 = (int) (name); \
+ __asm__ __volatile__ ("str r7, [v3, #4]\n" \
+ "\tldr r7, [v3]\n" \
+ "\tswi 0 @ syscall " #name "\n" \
+ "\tldr r7, [v3, #4]" \
+ : "=r" (__a1) \
+ : "r" (_v3) ASM_ARGS_##nr \
+ : "memory"); \
+ _internal_sys_result = __a1; \
+ } \
+ (int) _internal_sys_result; })
+#elif defined(__ARM_EABI__)
+#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
+ ({unsigned int _internal_sys_result; \
+ { \
+ register int __a1 __asm__ ("r0"), _nr __asm__ ("r7"); \
+ LOAD_ARGS_##nr (args) \
+ _nr = name; \
+ __asm__ __volatile__ ("swi 0x0 @ syscall " #name \
+ : "=r" (__a1) \
+ : "r" (_nr) ASM_ARGS_##nr \
+ : "memory"); \
+ _internal_sys_result = __a1; \
+ } \
+ (int) _internal_sys_result; })
+#else /* !defined(__ARM_EABI__) */
+#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
+ ({ unsigned int _internal_sys_result; \
+ { \
+ register int __a1 __asm__ ("a1"); \
+ LOAD_ARGS_##nr (args) \
+ __asm__ __volatile__ ("swi %1 @ syscall " #name \
+ : "=r" (__a1) \
+ : "i" (name) ASM_ARGS_##nr \
+ : "memory"); \
+ _internal_sys_result = __a1; \
+ } \
+ (int) _internal_sys_result; })
+#endif
+
+#undef INTERNAL_SYSCALL
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args)
+
+#undef INTERNAL_SYSCALL_ARM
+#define INTERNAL_SYSCALL_ARM(name, err, nr, args...) \
+ INTERNAL_SYSCALL_RAW(__ARM_NR_##name, err, nr, args)
+
+#undef INTERNAL_SYSCALL_ERROR_P
+#define INTERNAL_SYSCALL_ERROR_P(val, err) \
+ ((unsigned int) (val) >= 0xfffff001u)
+
+#undef INTERNAL_SYSCALL_ERRNO
+#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val))
+
+#if defined(__ARM_EABI__)
+#undef INTERNAL_SYSCALL_NCS
+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ INTERNAL_SYSCALL_RAW(number, err, nr, args)
+#else
+/* We can't implement non-constant syscalls directly since the syscall
+ number is normally encoded in the instruction. So use SYS_syscall. */
+#undef INTERNAL_SYSCALL_NCS
+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ INTERNAL_SYSCALL_NCS_##nr (number, err, args)
+
+#define INTERNAL_SYSCALL_NCS_0(number, err, args...) \
+ INTERNAL_SYSCALL (syscall, err, 1, number, args)
+#define INTERNAL_SYSCALL_NCS_1(number, err, args...) \
+ INTERNAL_SYSCALL (syscall, err, 2, number, args)
+#define INTERNAL_SYSCALL_NCS_2(number, err, args...) \
+ INTERNAL_SYSCALL (syscall, err, 3, number, args)
+#define INTERNAL_SYSCALL_NCS_3(number, err, args...) \
+ INTERNAL_SYSCALL (syscall, err, 4, number, args)
+#define INTERNAL_SYSCALL_NCS_4(number, err, args...) \
+ INTERNAL_SYSCALL (syscall, err, 5, number, args)
+#define INTERNAL_SYSCALL_NCS_5(number, err, args...) \
+ INTERNAL_SYSCALL (syscall, err, 6, number, args)
+#endif
+
+#endif /* __ASSEMBLER__ */
+
+/* Pointer mangling is not yet supported for ARM. */
+#define PTR_MANGLE(var) (void) (var)
+#define PTR_DEMANGLE(var) (void) (var)
+
+#endif /* linux/arm/sysdep.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/unwind.h b/ap/build/uClibc/libc/sysdeps/linux/arm/unwind.h
new file mode 100644
index 0000000..eeb9cf8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/unwind.h
@@ -0,0 +1,279 @@
+/* Header file for the ARM EABI unwinder
+ Copyright (C) 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+ Contributed by Paul Brook
+
+ This file is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ In addition to the permissions in the GNU General Public License, the
+ Free Software Foundation gives you unlimited permission to link the
+ compiled version of this file into combinations with other programs,
+ and to distribute those combinations without any restriction coming
+ from the use of this file. (The General Public License restrictions
+ do apply in other respects; for example, they cover modification of
+ the file, and distribution when not linked into a combine
+ executable.)
+
+ This file 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* Language-independent unwinder header public defines. This contains both
+ ABI defined objects, and GNU support routines. */
+
+#ifndef UNWIND_ARM_H
+#define UNWIND_ARM_H
+
+#define __ARM_EABI_UNWINDER__ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
+ typedef signed _Unwind_Sword __attribute__((__mode__(__word__)));
+ typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
+ typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
+ typedef _Unwind_Word _uw;
+ typedef unsigned _uw64 __attribute__((mode(__DI__)));
+ typedef unsigned _uw16 __attribute__((mode(__HI__)));
+ typedef unsigned _uw8 __attribute__((mode(__QI__)));
+
+ typedef enum
+ {
+ _URC_OK = 0, /* operation completed successfully */
+ _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
+ _URC_END_OF_STACK = 5,
+ _URC_HANDLER_FOUND = 6,
+ _URC_INSTALL_CONTEXT = 7,
+ _URC_CONTINUE_UNWIND = 8,
+ _URC_FAILURE = 9 /* unspecified failure of some kind */
+ }
+ _Unwind_Reason_Code;
+
+ typedef enum
+ {
+ _US_VIRTUAL_UNWIND_FRAME = 0,
+ _US_UNWIND_FRAME_STARTING = 1,
+ _US_UNWIND_FRAME_RESUME = 2,
+ _US_ACTION_MASK = 3,
+ _US_FORCE_UNWIND = 8,
+ _US_END_OF_STACK = 16
+ }
+ _Unwind_State;
+
+ /* Provided only for for compatibility with existing code. */
+ typedef int _Unwind_Action;
+#define _UA_SEARCH_PHASE 1
+#define _UA_CLEANUP_PHASE 2
+#define _UA_HANDLER_FRAME 4
+#define _UA_FORCE_UNWIND 8
+#define _UA_END_OF_STACK 16
+#define _URC_NO_REASON _URC_OK
+
+ typedef struct _Unwind_Control_Block _Unwind_Control_Block;
+ typedef struct _Unwind_Context _Unwind_Context;
+ typedef _uw _Unwind_EHT_Header;
+
+
+ /* UCB: */
+
+ struct _Unwind_Control_Block
+ {
+#ifdef _LIBC
+ /* For the benefit of code which assumes this is a scalar. All
+ glibc ever does is clear it. */
+ _uw64 exception_class;
+#else
+ char exception_class[8];
+#endif
+ void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
+ /* Unwinder cache, private fields for the unwinder's use */
+ struct
+ {
+ _uw reserved1; /* Forced unwind stop fn, 0 if not forced */
+ _uw reserved2; /* Personality routine address */
+ _uw reserved3; /* Saved callsite address */
+ _uw reserved4; /* Forced unwind stop arg */
+ _uw reserved5;
+ }
+ unwinder_cache;
+ /* Propagation barrier cache (valid after phase 1): */
+ struct
+ {
+ _uw sp;
+ _uw bitpattern[5];
+ }
+ barrier_cache;
+ /* Cleanup cache (preserved over cleanup): */
+ struct
+ {
+ _uw bitpattern[4];
+ }
+ cleanup_cache;
+ /* Pr cache (for pr's benefit): */
+ struct
+ {
+ _uw fnstart; /* function start address */
+ _Unwind_EHT_Header *ehtp; /* pointer to EHT entry header word */
+ _uw additional; /* additional data */
+ _uw reserved1;
+ }
+ pr_cache;
+ long long int :0; /* Force alignment to 8-byte boundary */
+ };
+
+ /* Virtual Register Set*/
+
+ typedef enum
+ {
+ _UVRSC_CORE = 0, /* integer register */
+ _UVRSC_VFP = 1, /* vfp */
+ _UVRSC_FPA = 2, /* fpa */
+ _UVRSC_WMMXD = 3, /* Intel WMMX data register */
+ _UVRSC_WMMXC = 4 /* Intel WMMX control register */
+ }
+ _Unwind_VRS_RegClass;
+
+ typedef enum
+ {
+ _UVRSD_UINT32 = 0,
+ _UVRSD_VFPX = 1,
+ _UVRSD_FPAX = 2,
+ _UVRSD_UINT64 = 3,
+ _UVRSD_FLOAT = 4,
+ _UVRSD_DOUBLE = 5
+ }
+ _Unwind_VRS_DataRepresentation;
+
+ typedef enum
+ {
+ _UVRSR_OK = 0,
+ _UVRSR_NOT_IMPLEMENTED = 1,
+ _UVRSR_FAILED = 2
+ }
+ _Unwind_VRS_Result;
+
+ /* Frame unwinding state. */
+ typedef struct
+ {
+ /* The current word (bytes packed msb first). */
+ _uw data;
+ /* Pointer to the next word of data. */
+ _uw *next;
+ /* The number of bytes left in this word. */
+ _uw8 bytes_left;
+ /* The number of words pointed to by ptr. */
+ _uw8 words_left;
+ }
+ __gnu_unwind_state;
+
+ typedef _Unwind_Reason_Code (*personality_routine) (_Unwind_State,
+ _Unwind_Control_Block *, _Unwind_Context *);
+
+ _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *, _Unwind_VRS_RegClass,
+ _uw, _Unwind_VRS_DataRepresentation,
+ void *);
+
+ _Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *, _Unwind_VRS_RegClass,
+ _uw, _Unwind_VRS_DataRepresentation,
+ void *);
+
+ _Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *, _Unwind_VRS_RegClass,
+ _uw, _Unwind_VRS_DataRepresentation);
+
+
+ /* Support functions for the PR. */
+#define _Unwind_Exception _Unwind_Control_Block
+ typedef char _Unwind_Exception_Class[8];
+
+ void * _Unwind_GetLanguageSpecificData (_Unwind_Context *);
+ _Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *);
+
+ /* These two should never be used. */
+ _Unwind_Ptr _Unwind_GetDataRelBase (_Unwind_Context *);
+ _Unwind_Ptr _Unwind_GetTextRelBase (_Unwind_Context *);
+
+ /* Interface functions: */
+ _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp);
+ void __attribute__((noreturn)) _Unwind_Resume(_Unwind_Control_Block *ucbp);
+ _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (_Unwind_Control_Block *ucbp);
+
+ typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
+ (int, _Unwind_Action, _Unwind_Exception_Class,
+ _Unwind_Control_Block *, struct _Unwind_Context *, void *);
+ _Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Control_Block *,
+ _Unwind_Stop_Fn, void *);
+ _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
+ void _Unwind_Complete(_Unwind_Control_Block *ucbp);
+ void _Unwind_DeleteException (_Unwind_Exception *);
+
+ _Unwind_Reason_Code __gnu_unwind_frame (_Unwind_Control_Block *,
+ _Unwind_Context *);
+ _Unwind_Reason_Code __gnu_unwind_execute (_Unwind_Context *,
+ __gnu_unwind_state *);
+
+ /* Decode an R_ARM_TARGET2 relocation. */
+ static inline _Unwind_Word
+ _Unwind_decode_target2 (_Unwind_Word ptr)
+ {
+ _Unwind_Word tmp;
+
+ tmp = *(_Unwind_Word *) ptr;
+ /* Zero values are always NULL. */
+ if (!tmp)
+ return 0;
+
+#if defined(linux) || defined(__NetBSD__)
+ /* Pc-relative indirect. */
+ tmp += ptr;
+ tmp = *(_Unwind_Word *) tmp;
+#elif defined(__symbian__)
+ /* Absolute pointer. Nothing more to do. */
+#else
+ /* Pc-relative pointer. */
+ tmp += ptr;
+#endif
+ return tmp;
+ }
+
+ static inline _Unwind_Word
+ _Unwind_GetGR (_Unwind_Context *context, int regno)
+ {
+ _uw val;
+ _Unwind_VRS_Get (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val);
+ return val;
+ }
+
+ /* Return the address of the instruction, not the actual IP value. */
+#define _Unwind_GetIP(context) \
+ (_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
+
+ static inline void
+ _Unwind_SetGR (_Unwind_Context *context, int regno, _Unwind_Word val)
+ {
+ _Unwind_VRS_Set (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val);
+ }
+
+ /* The dwarf unwinder doesn't understand arm/thumb state. We assume the
+ landing pad uses the same instruction set as the call site. */
+#define _Unwind_SetIP(context, val) \
+ _Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1))
+
+typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
+ (struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* defined UNWIND_ARM_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/arm/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/arm/vfork.S
new file mode 100644
index 0000000..17d6a4d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/arm/vfork.S
@@ -0,0 +1,108 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * vfork for uClibc
+ * Copyright (C) 2000-2006 by Erik Andersen <andersen@uclibc.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+#include <bits/arm_asm.h>
+
+#define _ERRNO_H
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+#ifndef SAVE_PID
+#define SAVE_PID
+#endif
+
+#ifndef RESTORE_PID
+#define RESTORE_PID
+#endif
+
+
+#ifdef __NR_fork
+.text
+.global __vfork
+.hidden __vfork
+.type __vfork,%function
+.align 4
+
+#if defined(__thumb__) && !defined(__thumb2__)
+.thumb_func
+__vfork:
+#ifdef __NR_vfork
+ SAVE_PID
+ DO_CALL (vfork)
+ RESTORE_PID
+ ldr r1, =0xfffff000
+ cmp r0, r1
+ bcs 1f
+ bx lr
+1:
+
+ /* Check if vfork even exists. */
+ ldr r1, =-ENOSYS
+ cmp r0, r1
+ bne __error
+
+ /* If we don't have vfork, use fork. */
+ DO_CALL (fork)
+ ldr r1, =0xfffff000
+ cmp r0, r1
+
+ /* Syscall worked. Return to child/parent */
+ bcs 1f
+ bx lr
+1:
+
+__error:
+ push {r3, lr}
+ bl __syscall_error
+ POP_RET
+.pool
+
+#endif
+
+#else
+__vfork:
+
+#ifdef __NR_vfork
+ SAVE_PID
+ DO_CALL (vfork)
+ RESTORE_PID
+ cmn r0, #4096
+ IT(t, cc)
+#if defined(__USE_BX__)
+ bxcc lr
+#else
+ movcc pc, lr
+#endif
+
+ /* Check if vfork even exists. */
+ ldr r1, =-ENOSYS
+ teq r0, r1
+ bne __error
+#endif
+
+ /* If we don't have vfork, use fork. */
+ DO_CALL (fork)
+ cmn r0, #4096
+
+ /* Syscall worked. Return to child/parent */
+ IT(t, cc)
+#if defined(__USE_BX__)
+ bxcc lr
+#else
+ movcc pc, lr
+#endif
+
+__error:
+ b __syscall_error
+#endif
+
+.size __vfork,.-__vfork
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
+#endif