zte's code,first commit

Change-Id: I9a04da59e459a9bc0d67f101f700d9d7dc8d681b
diff --git a/ap/build/uClibc/libc/sysdeps/Makefile b/ap/build/uClibc/libc/sysdeps/Makefile
new file mode 100644
index 0000000..11f362a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/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.in
+include $(top_srcdir)Makerules
diff --git a/ap/build/uClibc/libc/sysdeps/Makefile.in b/ap/build/uClibc/libc/sysdeps/Makefile.in
new file mode 100644
index 0000000..686cb72
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/Makefile.in
@@ -0,0 +1,8 @@
+# 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.
+#
+
+include $(top_srcdir)libc/sysdeps/linux/Makefile.in
diff --git a/ap/build/uClibc/libc/sysdeps/README b/ap/build/uClibc/libc/sysdeps/README
new file mode 100644
index 0000000..6448433
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/README
@@ -0,0 +1,6 @@
+This directory level abstracts out the UN*X-like Operating System dependent
+features of uClibc for all UN*X-like operating systems.  If you wanted to port
+uClibc to some other UN*X-like OS, this is the place to add that support.
+
+If you want to port uClibc to support some non-UN*X-like Operating System, you
+should probably stop using crack.  It is bad for you.  ;-)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/Makefile b/ap/build/uClibc/libc/sysdeps/linux/Makefile
new file mode 100644
index 0000000..4a8f4a0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/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.in
+include $(top_srcdir)Makerules
diff --git a/ap/build/uClibc/libc/sysdeps/linux/Makefile.commonarch b/ap/build/uClibc/libc/sysdeps/linux/Makefile.commonarch
new file mode 100644
index 0000000..c1bc5df
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/Makefile.commonarch
@@ -0,0 +1,41 @@
+# Makefile template to be included by sysdeps/linux/<ARCH>/Makefile.arch
+#
+# Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+ARCH_DIR  := $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
+ARCH_OUT  := $(top_builddir)libc/sysdeps/linux/$(TARGET_ARCH)
+
+ARCH_CSRC := $(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
+ARCH_COBJ := $(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
+ARCH_SSRC = $(patsubst %.s,$(ARCH_DIR)/%.s,$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC)))
+ARCH_SOBJ = $(patsubst %.s,$(ARCH_OUT)/%.o,$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC)))
+
+ARCH_OBJS = $(ARCH_COBJ) $(ARCH_SOBJ)
+
+crt-y          := FORCE
+libc-y         += $(ARCH_OBJS)
+libc-nomulti-y += $(ARCH_SOBJ)
+objclean-y     += CLEAN_$(subst $(top_builddir),,$(ARCH_OUT))
+
+CFLAGS-crti.S+=$(PICFLAG)
+CFLAGS-crtn.S+=$(PICFLAG)
+
+CLEAN_$(subst $(top_builddir),,$(ARCH_OUT)):
+	$(do_rm) $(addprefix $(ARCH_OUT)/*., o os oS) $(CTOR_TARGETS) $(CRTS)
+
+ifneq ($(ARCH_HEADERS),)
+
+ARCH_HEADERS_OUT := $(patsubst %,$(top_builddir)include/%,$(ARCH_HEADERS))
+
+$(ARCH_HEADERS_OUT):
+	$(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@
+
+headers-y += $(ARCH_HEADERS_OUT)
+headers_clean-y += HEADERCLEAN_$(subst $(top_builddir),,$(ARCH_OUT))
+HEADERCLEAN_$(subst $(top_builddir),,$(ARCH_OUT)):
+	$(do_rm) $(ARCH_HEADERS_OUT)
+
+endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/Makefile.in b/ap/build/uClibc/libc/sysdeps/linux/Makefile.in
new file mode 100644
index 0000000..dd91f21
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/Makefile.in
@@ -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.
+#
+
+subdirs += libc/sysdeps/linux/$(TARGET_ARCH) libc/sysdeps/linux/common
+
+# order is relevant
+-include $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/Makefile.arch
+include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch
+include $(top_srcdir)libc/sysdeps/linux/common/Makefile.in
diff --git a/ap/build/uClibc/libc/sysdeps/linux/README b/ap/build/uClibc/libc/sysdeps/linux/README
new file mode 100644
index 0000000..76944f9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/README
@@ -0,0 +1,7 @@
+This directory level abstracts out the Linux Operating System dependent
+features of uClibc for supported Linux architectures/CPUs.  If you wanted to
+port uClibc to some new Linux architecture (arm, mips, etc), this is the place
+to add that support.
+
+All stuff that is not at all dependent on a particular Linux architecture
+goes in the 'common' directory.
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/Makefile b/ap/build/uClibc/libc/sysdeps/linux/alpha/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/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/alpha/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/alpha/Makefile.arch
new file mode 100644
index 0000000..d9defc3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/Makefile.arch
@@ -0,0 +1,13 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+CSRC := __syscall_error.c sigprocmask.c
+
+SSRC := \
+	__longjmp.S brk.S bsd-_setjmp.S bsd-setjmp.S clone.S \
+	divl.S divq.S pipe.S reml.S remq.S __syscall_rt_sigaction.S setjmp.S \
+	syscall.S
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/__longjmp.S
new file mode 100644
index 0000000..910ec07
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/__longjmp.S
@@ -0,0 +1,57 @@
+/* Copyright (C) 1992, 1994, 1997 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 _SETJMP_H
+#define __ASSEMBLY__
+#include <bits/setjmp.h>
+
+#define a0  $16
+
+.globl  __longjmp;
+.align 3;
+.ent  __longjmp , 0;
+
+__longjmp:
+	.frame $30 , 0, $26
+	.prologue 0
+
+	mov     $17, $0
+	ldq     $9, JB_S0*8(a0)
+	ldq     $10, JB_S1*8(a0)
+	ldq     $11, JB_S2*8(a0)
+	ldq     $12, JB_S3*8(a0)
+	ldq     $13, JB_S4*8(a0)
+	ldq     $14, JB_S5*8(a0)
+	ldq     $26, JB_PC*8(a0)
+	ldq     $15, JB_FP*8(a0)
+	ldq     $1, JB_SP*8(a0)
+	ldt     $f2, JB_F2*8(a0)
+	ldt     $f3, JB_F3*8(a0)
+	ldt     $f4, JB_F4*8(a0)
+	ldt     $f5, JB_F5*8(a0)
+	ldt     $f6, JB_F6*8(a0)
+	ldt     $f7, JB_F7*8(a0)
+	ldt     $f8, JB_F8*8(a0)
+	ldt     $f9, JB_F9*8(a0)
+	cmoveq  $0, 1, $0
+	mov     $1, $30
+	ret
+
+.end  __longjmp
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/__syscall_error.c b/ap/build/uClibc/libc/sysdeps/linux/alpha/__syscall_error.c
new file mode 100644
index 0000000..7c081f3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/__syscall_error.c
@@ -0,0 +1,16 @@
+/*
+ * 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>
+
+/* This routine is jumped to by all the syscall handlers, to stash
+   an error number into errno.  */
+int attribute_hidden __syscall_error (void)
+{
+	register int err_no __asm__("$0");
+	__set_errno (err_no);
+	return -1;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/__syscall_rt_sigaction.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/__syscall_rt_sigaction.S
new file mode 100644
index 0000000..f7e9e44
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/__syscall_rt_sigaction.S
@@ -0,0 +1,81 @@
+/* Copyright (C) 1998, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@cygnus.com>, 1998
+
+   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 <sys/syscall.h>
+#include <sys/regdef.h>
+
+/* On Alpha we desparately want to avoid having to issue an imb.  Ordinarily
+   the kernel would have to issue one after setting up the signal return
+   stack, but the Linux rt_sigaction syscall is prepared to accept a pointer
+   to the sigreturn syscall, instead of inlining it on the stack.
+
+   This just about halves signal delivery time.  */
+
+	.text
+
+.globl __syscall_rt_sigaction
+.align 4
+.ent __syscall_rt_sigaction, 0
+__syscall_rt_sigaction:
+	.frame	sp,0,ra,0
+	ldgp	gp,0(pv)
+	.prologue 1
+
+	beq	a1, 0f
+	ldl	t0, 8(a1)			# sa_flags
+
+	/* The unwinder will subtract one from the return address when
+	   attempting to find the call instruction that led us here.
+	   Since we didn't get here via a normal call, if we do nothing
+	   we would pick up the wrong symbol and the wrong FDE.  Account
+	   for this by adding a nop to the start of the function and 
+	   then skipping it here by adding 4.  */
+	ldah	a4, __syscall_sigreturn+4(gp)		!gprelhigh
+	ldah	t1, __syscall_rt_sigreturn+4(gp)	!gprelhigh
+	lda	a4, __syscall_sigreturn+4(a4)		!gprellow
+	lda	t1, __syscall_rt_sigreturn+4(t1)	!gprellow
+	and	t0, 0x40, t0				# SA_SIGINFO
+	cmovne	t0, t1, a4
+
+0:	ldi	v0, __NR_rt_sigaction
+	callsys
+	bne	a3, $error
+	ret
+
+$error:
+	jmp	zero,__syscall_error
+
+.end __syscall_rt_sigaction
+
+__syscall_sigreturn:
+	nop
+	mov	sp, a0
+	ldi	v0, __NR_sigreturn
+	callsys
+	.size	__syscall_sigreturn, .-__syscall_sigreturn
+	.type	__syscall_sigreturn, @function
+
+__syscall_rt_sigreturn:
+	nop
+	mov	sp,a0
+	ldi	v0,__NR_rt_sigreturn
+	callsys
+	.size	__syscall_rt_sigreturn, .-__syscall_rt_sigreturn
+	.type	__syscall_rt_sigreturn, @function
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/atomic.h
new file mode 100644
index 0000000..5ad4c54
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/atomic.h
@@ -0,0 +1,369 @@
+/* Copyright (C) 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.  */
+
+#include <stdint.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 int16_t atomic16_t;
+typedef uint16_t uatomic16_t;
+typedef int_fast16_t atomic_fast16_t;
+typedef uint_fast16_t uatomic_fast16_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 int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+typedef int_fast64_t atomic_fast64_t;
+typedef uint_fast64_t uatomic_fast64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+
+#ifdef UP
+# define __MB		/* nothing */
+#else
+# define __MB		"	mb\n"
+#endif
+
+
+/* Compare and exchange.  For all of the "xxx" routines, we expect a
+   "__prev" and a "__cmp" variable to be provided by the enclosing scope,
+   in which values are returned.  */
+
+#define __arch_compare_and_exchange_xxx_8_int(mem, new, old, mb1, mb2)	\
+({									\
+  unsigned long __tmp, __snew, __addr64;				\
+  __asm__ __volatile__ (						\
+		mb1							\
+	"	andnot	%[__addr8],7,%[__addr64]\n"			\
+	"	insbl	%[__new],%[__addr8],%[__snew]\n"		\
+	"1:	ldq_l	%[__tmp],0(%[__addr64])\n"			\
+	"	extbl	%[__tmp],%[__addr8],%[__prev]\n"		\
+	"	cmpeq	%[__prev],%[__old],%[__cmp]\n"			\
+	"	beq	%[__cmp],2f\n"					\
+	"	mskbl	%[__tmp],%[__addr8],%[__tmp]\n"			\
+	"	or	%[__snew],%[__tmp],%[__tmp]\n"			\
+	"	stq_c	%[__tmp],0(%[__addr64])\n"			\
+	"	beq	%[__tmp],1b\n"					\
+		mb2							\
+	"2:"								\
+	: [__prev] "=&r" (__prev),					\
+	  [__snew] "=&r" (__snew),					\
+	  [__tmp] "=&r" (__tmp),					\
+	  [__cmp] "=&r" (__cmp),					\
+	  [__addr64] "=&r" (__addr64)					\
+	: [__addr8] "r" (mem),						\
+	  [__old] "Ir" ((uint64_t)(uint8_t)(uint64_t)(old)),		\
+	  [__new] "r" (new)						\
+	: "memory");							\
+})
+
+#define __arch_compare_and_exchange_xxx_16_int(mem, new, old, mb1, mb2) \
+({									\
+  unsigned long __tmp, __snew, __addr64;				\
+  __asm__ __volatile__ (						\
+		mb1							\
+	"	andnot	%[__addr16],7,%[__addr64]\n"			\
+	"	inswl	%[__new],%[__addr16],%[__snew]\n"		\
+	"1:	ldq_l	%[__tmp],0(%[__addr64])\n"			\
+	"	extwl	%[__tmp],%[__addr16],%[__prev]\n"		\
+	"	cmpeq	%[__prev],%[__old],%[__cmp]\n"			\
+	"	beq	%[__cmp],2f\n"					\
+	"	mskwl	%[__tmp],%[__addr16],%[__tmp]\n"		\
+	"	or	%[__snew],%[__tmp],%[__tmp]\n"			\
+	"	stq_c	%[__tmp],0(%[__addr64])\n"			\
+	"	beq	%[__tmp],1b\n"					\
+		mb2							\
+	"2:"								\
+	: [__prev] "=&r" (__prev),					\
+	  [__snew] "=&r" (__snew),					\
+	  [__tmp] "=&r" (__tmp),					\
+	  [__cmp] "=&r" (__cmp),					\
+	  [__addr64] "=&r" (__addr64)					\
+	: [__addr16] "r" (mem),						\
+	  [__old] "Ir" ((uint64_t)(uint16_t)(uint64_t)(old)),		\
+	  [__new] "r" (new)						\
+	: "memory");							\
+})
+
+#define __arch_compare_and_exchange_xxx_32_int(mem, new, old, mb1, mb2) \
+({									\
+  __asm__ __volatile__ (						\
+		mb1							\
+	"1:	ldl_l	%[__prev],%[__mem]\n"				\
+	"	cmpeq	%[__prev],%[__old],%[__cmp]\n"			\
+	"	beq	%[__cmp],2f\n"					\
+	"	mov	%[__new],%[__cmp]\n"				\
+	"	stl_c	%[__cmp],%[__mem]\n"				\
+	"	beq	%[__cmp],1b\n"					\
+		mb2							\
+	"2:"								\
+	: [__prev] "=&r" (__prev),					\
+	  [__cmp] "=&r" (__cmp)						\
+	: [__mem] "m" (*(mem)),						\
+	  [__old] "Ir" ((uint64_t)(atomic32_t)(uint64_t)(old)),		\
+	  [__new] "Ir" (new)						\
+	: "memory");							\
+})
+
+#define __arch_compare_and_exchange_xxx_64_int(mem, new, old, mb1, mb2) \
+({									\
+  __asm__ __volatile__ (						\
+		mb1							\
+	"1:	ldq_l	%[__prev],%[__mem]\n"				\
+	"	cmpeq	%[__prev],%[__old],%[__cmp]\n"			\
+	"	beq	%[__cmp],2f\n"					\
+	"	mov	%[__new],%[__cmp]\n"				\
+	"	stq_c	%[__cmp],%[__mem]\n"				\
+	"	beq	%[__cmp],1b\n"					\
+		mb2							\
+	"2:"								\
+	: [__prev] "=&r" (__prev),					\
+	  [__cmp] "=&r" (__cmp)						\
+	: [__mem] "m" (*(mem)),						\
+	  [__old] "Ir" ((uint64_t)(old)),				\
+	  [__new] "Ir" (new)						\
+	: "memory");							\
+})
+
+/* For all "bool" routines, we return FALSE if exchange succesful.  */
+
+#define __arch_compare_and_exchange_bool_8_int(mem, new, old, mb1, mb2)	\
+({ unsigned long __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_8_int(mem, new, old, mb1, mb2);	\
+   !__cmp; })
+
+#define __arch_compare_and_exchange_bool_16_int(mem, new, old, mb1, mb2) \
+({ unsigned long __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_16_int(mem, new, old, mb1, mb2);	\
+   !__cmp; })
+
+#define __arch_compare_and_exchange_bool_32_int(mem, new, old, mb1, mb2) \
+({ unsigned long __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_32_int(mem, new, old, mb1, mb2);	\
+   !__cmp; })
+
+#define __arch_compare_and_exchange_bool_64_int(mem, new, old, mb1, mb2) \
+({ unsigned long __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_64_int(mem, new, old, mb1, mb2);	\
+   !__cmp; })
+
+/* For all "val" routines, return the old value whether exchange
+   successful or not.  */
+
+#define __arch_compare_and_exchange_val_8_int(mem, new, old, mb1, mb2)	\
+({ unsigned long __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_8_int(mem, new, old, mb1, mb2);	\
+   (__typeof (*mem))__prev; })
+
+#define __arch_compare_and_exchange_val_16_int(mem, new, old, mb1, mb2) \
+({ unsigned long __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_16_int(mem, new, old, mb1, mb2);	\
+   (__typeof (*mem))__prev; })
+
+#define __arch_compare_and_exchange_val_32_int(mem, new, old, mb1, mb2) \
+({ unsigned long __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_32_int(mem, new, old, mb1, mb2);	\
+   (__typeof (*mem))__prev; })
+
+#define __arch_compare_and_exchange_val_64_int(mem, new, old, mb1, mb2) \
+({ unsigned long __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_64_int(mem, new, old, mb1, mb2);	\
+   (__typeof (*mem))__prev; })
+
+/* Compare and exchange with "acquire" semantics, ie barrier after.  */
+
+#define atomic_compare_and_exchange_bool_acq(mem, new, old)	\
+  __atomic_bool_bysize (__arch_compare_and_exchange_bool, int,	\
+		        mem, new, old, "", __MB)
+
+#define atomic_compare_and_exchange_val_acq(mem, new, old)	\
+  __atomic_val_bysize (__arch_compare_and_exchange_val, int,	\
+		       mem, new, old, "", __MB)
+
+/* Compare and exchange with "release" semantics, ie barrier before.  */
+
+#define atomic_compare_and_exchange_bool_rel(mem, new, old)	\
+  __atomic_bool_bysize (__arch_compare_and_exchange_bool, int,	\
+		        mem, new, old, __MB, "")
+
+#define atomic_compare_and_exchange_val_rel(mem, new, old)	\
+  __atomic_val_bysize (__arch_compare_and_exchange_val, int,	\
+		       mem, new, old, __MB, "")
+
+
+/* Atomically store value and return the previous value.  */
+
+#define __arch_exchange_8_int(mem, value, mb1, mb2)			\
+({									\
+  unsigned long __ret, __tmp, __addr64, __sval;				\
+  __asm__ __volatile__ (						\
+		mb1							\
+	"	andnot	%[__addr8],7,%[__addr64]\n"			\
+	"	insbl	%[__value],%[__addr8],%[__sval]\n"		\
+	"1:	ldq_l	%[__tmp],0(%[__addr64])\n"			\
+	"	extbl	%[__tmp],%[__addr8],%[__ret]\n"			\
+	"	mskbl	%[__tmp],%[__addr8],%[__tmp]\n"			\
+	"	or	%[__sval],%[__tmp],%[__tmp]\n"			\
+	"	stq_c	%[__tmp],0(%[__addr64])\n"			\
+	"	beq	%[__tmp],1b\n"					\
+		mb2							\
+	: [__ret] "=&r" (__ret),					\
+	  [__sval] "=&r" (__sval),					\
+	  [__tmp] "=&r" (__tmp),					\
+	  [__addr64] "=&r" (__addr64)					\
+	: [__addr8] "r" (mem),						\
+	  [__value] "r" (value)						\
+	: "memory");							\
+  __ret; })
+
+#define __arch_exchange_16_int(mem, value, mb1, mb2)			\
+({									\
+  unsigned long __ret, __tmp, __addr64, __sval;				\
+  __asm__ __volatile__ (						\
+		mb1							\
+	"	andnot	%[__addr16],7,%[__addr64]\n"			\
+	"	inswl	%[__value],%[__addr16],%[__sval]\n"		\
+	"1:	ldq_l	%[__tmp],0(%[__addr64])\n"			\
+	"	extwl	%[__tmp],%[__addr16],%[__ret]\n"		\
+	"	mskwl	%[__tmp],%[__addr16],%[__tmp]\n"		\
+	"	or	%[__sval],%[__tmp],%[__tmp]\n"			\
+	"	stq_c	%[__tmp],0(%[__addr64])\n"			\
+	"	beq	%[__tmp],1b\n"					\
+		mb2							\
+	: [__ret] "=&r" (__ret),					\
+	  [__sval] "=&r" (__sval),					\
+	  [__tmp] "=&r" (__tmp),					\
+	  [__addr64] "=&r" (__addr64)					\
+	: [__addr16] "r" (mem),						\
+	  [__value] "r" (value)						\
+	: "memory");							\
+  __ret; })
+
+#define __arch_exchange_32_int(mem, value, mb1, mb2)			\
+({									\
+  signed int __ret, __tmp;						\
+  __asm__ __volatile__ (						\
+		mb1							\
+	"1:	ldl_l	%[__ret],%[__mem]\n"				\
+	"	mov	%[__val],%[__tmp]\n"				\
+	"	stl_c	%[__tmp],%[__mem]\n"				\
+	"	beq	%[__tmp],1b\n"					\
+		mb2							\
+	: [__ret] "=&r" (__ret),					\
+	  [__tmp] "=&r" (__tmp)						\
+	: [__mem] "m" (*(mem)),						\
+	  [__val] "Ir" (value)						\
+	: "memory");							\
+  __ret; })
+
+#define __arch_exchange_64_int(mem, value, mb1, mb2)			\
+({									\
+  unsigned long __ret, __tmp;						\
+  __asm__ __volatile__ (						\
+		mb1							\
+	"1:	ldq_l	%[__ret],%[__mem]\n"				\
+	"	mov	%[__val],%[__tmp]\n"				\
+	"	stq_c	%[__tmp],%[__mem]\n"				\
+	"	beq	%[__tmp],1b\n"					\
+		mb2							\
+	: [__ret] "=&r" (__ret),					\
+	  [__tmp] "=&r" (__tmp)						\
+	: [__mem] "m" (*(mem)),						\
+	  [__val] "Ir" (value)						\
+	: "memory");							\
+  __ret; })
+
+#define atomic_exchange_acq(mem, value) \
+  __atomic_val_bysize (__arch_exchange, int, mem, value, "", __MB)
+
+#define atomic_exchange_rel(mem, value) \
+  __atomic_val_bysize (__arch_exchange, int, mem, value, __MB, "")
+
+
+/* Atomically add value and return the previous (unincremented) value.  */
+
+#define __arch_exchange_and_add_8_int(mem, value, mb1, mb2) \
+  ({ __builtin_trap (); 0; })
+
+#define __arch_exchange_and_add_16_int(mem, value, mb1, mb2) \
+  ({ __builtin_trap (); 0; })
+
+#define __arch_exchange_and_add_32_int(mem, value, mb1, mb2)		\
+({									\
+  signed int __ret, __tmp;						\
+  __asm__ __volatile__ (						\
+		mb1							\
+	"1:	ldl_l	%[__ret],%[__mem]\n"				\
+	"	addl	%[__ret],%[__val],%[__tmp]\n"			\
+	"	stl_c	%[__tmp],%[__mem]\n"				\
+	"	beq	%[__tmp],1b\n"					\
+		mb2							\
+	: [__ret] "=&r" (__ret),					\
+	  [__tmp] "=&r" (__tmp)						\
+	: [__mem] "m" (*(mem)),						\
+	  [__val] "Ir" ((signed int)(value))				\
+	: "memory");							\
+  __ret; })
+
+#define __arch_exchange_and_add_64_int(mem, value, mb1, mb2)		\
+({									\
+  unsigned long __ret, __tmp;						\
+  __asm__ __volatile__ (						\
+		mb1							\
+	"1:	ldq_l	%[__ret],%[__mem]\n"				\
+	"	addq	%[__ret],%[__val],%[__tmp]\n"			\
+	"	stq_c	%[__tmp],%[__mem]\n"				\
+	"	beq	%[__tmp],1b\n"					\
+		mb2							\
+	: [__ret] "=&r" (__ret),					\
+	  [__tmp] "=&r" (__tmp)						\
+	: [__mem] "m" (*(mem)),						\
+	  [__val] "Ir" ((unsigned long)(value))				\
+	: "memory");							\
+  __ret; })
+
+/* ??? Barrier semantics for atomic_exchange_and_add appear to be
+   undefined.  Use full barrier for now, as that's safe.  */
+#define atomic_exchange_and_add(mem, value) \
+  __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, __MB, __MB)
+
+
+/* ??? Blah, I'm lazy.  Implement these later.  Can do better than the
+   compare-and-exchange loop provided by generic code.
+
+#define atomic_decrement_if_positive(mem)
+#define atomic_bit_test_set(mem, bit)
+
+*/
+
+#ifndef UP
+# define atomic_full_barrier()	__asm__ ("mb" : : : "memory");
+# define atomic_read_barrier()	__asm__ ("mb" : : : "memory");
+# define atomic_write_barrier()	__asm__ ("wmb" : : : "memory");
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/dirent.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/dirent.h
new file mode 100644
index 0000000..6ed7478
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/dirent.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_DIRENT_H
+#define _BITS_DIRENT_H	1
+
+struct dirent
+  {
+#ifdef __USE_FILE_OFFSET64
+    __ino64_t d_ino;
+#else
+    __ino_t d_ino;
+    int __pad;
+#endif
+    __off_t d_off;
+    unsigned short int d_reclen;
+    unsigned char d_type;
+    char d_name[256];		/* We must not include limits.h! */
+  };
+
+#ifdef __USE_LARGEFILE64
+/* Note dirent64 is the same as dirent.  */
+struct dirent64
+  {
+    __ino64_t d_ino;
+    __off64_t d_off;
+    unsigned short int d_reclen;
+    unsigned char d_type;
+    char d_name[256];		/* We must not include limits.h! */
+  };
+#endif
+
+#define d_fileno	d_ino	/* Backwards compatibility.  */
+
+#undef  _DIRENT_HAVE_D_NAMLEN
+#define _DIRENT_HAVE_D_RECLEN
+#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
+
+#endif /* bits/dirent.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/elfclass.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/elfclass.h
new file mode 100644
index 0000000..e5aa4a0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/elfclass.h
@@ -0,0 +1,14 @@
+/* This file specifies the native word size of the machine, which indicates
+   the ELF file class used for executables and shared objects on this
+   machine.  */
+
+#ifndef _LINK_H
+# error "Never use <bits/elfclass.h> directly; include <link.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#define __ELF_NATIVE_CLASS __WORDSIZE
+
+/* Linux/Alpha is exceptional as it has .hash section with 64 bit entries.  */
+typedef uint64_t Elf_Symndx;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/endian.h
new file mode 100644
index 0000000..8a16e14
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/endian.h
@@ -0,0 +1,7 @@
+/* Alpha is little-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/epoll.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/epoll.h
new file mode 100644
index 0000000..7f9f374
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/epoll.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_EPOLL_H
+# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+#endif
+
+/* Flags to be passed to epoll_create1.  */
+enum
+  {
+    EPOLL_CLOEXEC  = 010000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 000000004
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/fcntl.h
new file mode 100644
index 0000000..649c563
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/fcntl.h
@@ -0,0 +1,230 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995-2000,2004,2005,2006,2007 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		 01000	/* not fcntl */
+#define O_TRUNC		 02000	/* not fcntl */
+#define O_EXCL		 04000	/* not fcntl */
+#define O_NOCTTY	010000	/* not fcntl */
+
+#define O_NONBLOCK	 00004
+#define O_APPEND	 00010
+#define O_NDELAY	O_NONBLOCK
+#define O_SYNC		040000
+#define O_FSYNC		O_SYNC
+#define O_ASYNC		020000	/* fcntl, for BSD compatibility */
+
+#ifdef __USE_GNU
+# define O_DIRECTORY	0100000	/* Must be a directory.  */
+# define O_NOFOLLOW	0200000	/* Do not follow links.  */
+# define O_DIRECT	02000000 /* Direct disk access.  */
+# define O_NOATIME	04000000 /* Do not set atime.  */
+# define O_CLOEXEC      010000000 /* Set close_on_exec.  */
+#endif
+
+#ifdef __USE_LARGEFILE64
+/* Not necessary, files are always with 64bit off_t.  */
+# define O_LARGEFILE	0
+#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
+
+/* 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.  */
+#define F_GETLK		7	/* Get record locking info.  */
+#define F_SETLK		8	/* Set record locking info (non-blocking).  */
+#define F_SETLKW	9	/* Set record locking info (blocking).  */
+#define F_GETLK64	F_GETLK	/* Get record locking info.  */
+#define F_SETLK64	F_SETLK	/* Set record locking info (non-blocking).  */
+#define F_SETLKW64	F_SETLKW /* Set record locking info (blocking).  */
+
+#if defined __USE_BSD || defined __USE_UNIX98
+# define F_SETOWN	5	/* Get owner of socket (receiver of SIGIO).  */
+# define F_GETOWN	6	/* 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		1	/* Read lock.  */
+#define F_WRLCK		2	/* Write lock.  */
+#define F_UNLCK		8	/* Remove lock.  */
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK		16	/* or 3 */
+#define F_SHLCK		32	/* or 4 */
+
+/* Operations for bsd flock(), also used by the kernel implementation */
+#ifdef __USE_BSD
+# 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
+
+/* We don't need to support __USE_FILE_OFFSET64.  */
+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').  */
+    __off_t l_start;	/* Offset where the lock begins.  */
+    __off_t l_len;	/* Size of the locked area; zero means until EOF.  */
+    __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/alpha/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/fenv.h
new file mode 100644
index 0000000..a9e89b4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/fenv.h
@@ -0,0 +1,123 @@
+/* Copyright (C) 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.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Define the bits representing the exception.
+
+   Note that these are the bit positions as defined by the OSF/1
+   ieee_{get,set}_control_word interface and not by the hardware fpcr.
+
+   See the Alpha Architecture Handbook section 4.7.7.3 for details,
+   but in summary, trap shadows mean the hardware register can acquire
+   extra exception bits so for proper IEEE support the tracking has to
+   be done in software -- in this case with kernel support.
+
+   As to why the system call interface isn't in the same format as
+   the hardware register, only those crazy folks at DEC can tell you.  */
+
+enum
+  {
+#ifdef __USE_GNU
+    FE_DENORMAL =	1UL << 22,
+#define FE_DENORMAL	FE_DENORMAL
+#endif
+
+    FE_INEXACT =	1UL << 21,
+#define FE_INEXACT	FE_INEXACT
+
+    FE_UNDERFLOW =	1UL << 20,
+#define FE_UNDERFLOW	FE_UNDERFLOW
+
+    FE_OVERFLOW =	1UL << 19,
+#define FE_OVERFLOW	FE_OVERFLOW
+
+    FE_DIVBYZERO =	1UL << 18,
+#define FE_DIVBYZERO	FE_DIVBYZERO
+
+    FE_INVALID =	1UL << 17,
+#define FE_INVALID	FE_INVALID
+
+    FE_ALL_EXCEPT =	0x3f << 17
+#define FE_ALL_EXCEPT	FE_ALL_EXCEPT
+  };
+
+/* Alpha chips support all four defined rouding modes.
+
+   Note that code must be compiled to use dynamic rounding (/d) instructions
+   to see these changes.  For gcc this is -mfp-rounding-mode=d; for DEC cc
+   this is -fprm d.  The default for both is static rounding to nearest.
+
+   These are shifted down 58 bits from the hardware fpcr because the
+   functions are declared to take integers.  */
+
+enum
+  {
+    FE_TOWARDZERO =	0,
+#define FE_TOWARDZERO	FE_TOWARDZERO
+
+    FE_DOWNWARD = 	1,
+#define FE_DOWNWARD	FE_DOWNWARD
+
+    FE_TONEAREST =	2,
+#define FE_TONEAREST	FE_TONEAREST
+
+    FE_UPWARD =		3,
+#define FE_UPWARD	FE_UPWARD
+  };
+
+#ifdef __USE_GNU
+/* On later hardware, and later kernels for earlier hardware, we can forcibly
+   underflow denormal inputs and outputs.  This can speed up certain programs
+   significantly, usually without affecting accuracy.  */
+enum
+  {
+    FE_MAP_DMZ =	1UL << 12,	/* Map denorm inputs to zero */
+#define FE_MAP_DMZ	FE_MAP_DMZ
+
+    FE_MAP_UMZ =	1UL << 13,	/* Map underflowed outputs to zero */
+#define FE_MAP_UMZ	FE_MAP_UMZ
+  };
+#endif
+
+/* Type representing exception flags.  */
+typedef unsigned long int fexcept_t;
+
+/* Type representing floating-point environment.  */
+typedef unsigned long int fenv_t;
+
+/* If the default argument is used we use this value.  Note that due to
+   architecture-specified page mappings, no user-space pointer will ever
+   have its two high bits set.  Co-opt one.  */
+#define FE_DFL_ENV	((__const fenv_t *) 0x8800000000000000UL)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exceptions are masked.  */
+# define FE_NOMASK_ENV	((__const fenv_t *) 0x880000000000003eUL)
+
+/* Floating-point environment with (processor-dependent) non-IEEE floating
+   point.  In this case, mapping denormals to zero.  */
+# define FE_NONIEEE_ENV ((__const fenv_t *) 0x8800000000003000UL)
+#endif
+
+/* The system calls to talk to the kernel's FP code.  */
+extern unsigned long int __ieee_get_fp_control (void) __THROW;
+extern void __ieee_set_fp_control (unsigned long int __value) __THROW;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/inotify.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/inotify.h
new file mode 100644
index 0000000..3fbe3b8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/inotify.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2005-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_INOTIFY_H
+# error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead."
+#endif
+
+/* Flags for the parameter of inotify_init1.  */
+enum
+  {
+    IN_CLOEXEC  = 010000000,
+#define IN_CLOEXEC IN_CLOEXEC
+    IN_NONBLOCK = 000000004
+#define IN_NONBLOCK IN_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/ioctls.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/ioctls.h
new file mode 100644
index 0000000..c525046
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/ioctls.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 1996, 1997 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_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Use the definitions from the kernel header files.  */
+#include <asm/ioctls.h>
+
+/* Oh well, this is necessary since the kernel data structure is
+   different from the user-level version.  */
+#undef  TCGETS
+#undef  TCSETS
+#undef  TCSETSW
+#undef  TCSETSF
+#define TCGETS	_IOR ('t', 19, char[44])
+#define TCSETS	_IOW ('t', 20, char[44])
+#define TCSETSW	_IOW ('t', 21, char[44])
+#define TCSETSF	_IOW ('t', 22, char[44])
+
+#include <linux/sockios.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/ipc.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/ipc.h
new file mode 100644
index 0000000..77f3c93
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/ipc.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 1995, 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.  */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#ifdef __USE_GNU
+# define IPC_INFO	3		/* See ipcs.  */
+#endif
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;			/* Key.  */
+    unsigned int uid;			/* Owner's user ID.  */
+    unsigned int gid;			/* Owner's group ID.  */
+    unsigned int cuid;			/* Creator's user ID.  */
+    unsigned int cgid;			/* Creator's group ID.  */
+    unsigned int mode;			/* Read/write permission.  */
+    unsigned short int __seq;		/* Sequence number.  */
+    unsigned short int __pad1;
+    unsigned long int __unused1;
+    unsigned long int __unused2;
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/kernel_sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/kernel_sigaction.h
new file mode 100644
index 0000000..cd6b213
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/kernel_sigaction.h
@@ -0,0 +1,20 @@
+#ifndef _BITS_SIGACTION_STRUCT_H
+#define _BITS_SIGACTION_STRUCT_H
+
+/* This is the sigaction struction from the Linux 2.1.20 kernel.  */
+
+struct old_kernel_sigaction {
+	__sighandler_t k_sa_handler;
+	unsigned long sa_mask;
+	unsigned int sa_flags;
+};
+
+/* In uclibc, userspace struct sigaction is identical to
+ * "new" struct kernel_sigaction (one from the Linux 2.1.68 kernel).
+ * See sigaction.h
+ */
+
+extern int __syscall_rt_sigaction (int, const struct sigaction *,
+	struct sigaction *, size_t) attribute_hidden;
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/kernel_stat.h
new file mode 100644
index 0000000..e919b21
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/kernel_stat.h
@@ -0,0 +1,45 @@
+#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 {
+	unsigned int	st_dev;
+	unsigned int	st_ino;
+	unsigned int	st_mode;
+	unsigned int	st_nlink;
+	unsigned int	st_uid;
+	unsigned int	st_gid;
+	unsigned int	st_rdev;
+	long int		st_size;
+	unsigned long	st_atime;
+	unsigned long	st_mtime;
+	unsigned long	st_ctime;
+	unsigned int	st_blksize;
+	int		st_blocks;
+	unsigned int	st_flags;
+	unsigned int	st_gen;
+};
+
+struct kernel_stat64 {
+	unsigned long	st_dev;
+	unsigned long	st_ino;
+	unsigned long	st_rdev;
+	long		st_size;
+	unsigned long	st_blocks;
+
+	unsigned int	st_mode;
+	unsigned int	st_uid;
+	unsigned int	st_gid;
+	unsigned int	st_blksize;
+	unsigned int	st_nlink;
+	unsigned int	__pad0;
+
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	long		__unused[3];
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/kernel_types.h
new file mode 100644
index 0000000..cd59b9d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/kernel_types.h
@@ -0,0 +1,43 @@
+/* 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 _ALPHA_POSIX_TYPES_H
+#define _ALPHA_POSIX_TYPES_H
+
+typedef unsigned int	__kernel_dev_t;
+typedef unsigned int	__kernel_ino_t;
+typedef unsigned int	__kernel_mode_t;
+typedef unsigned int	__kernel_nlink_t;
+typedef long		__kernel_off_t;
+typedef long		__kernel_loff_t;
+typedef int		__kernel_pid_t;
+typedef int		__kernel_ipc_pid_t;
+typedef unsigned int	__kernel_uid_t;
+typedef unsigned int	__kernel_gid_t;
+typedef unsigned long	__kernel_size_t;
+typedef long		__kernel_ssize_t;
+typedef long		__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 long	__kernel_sigset_t;
+typedef unsigned short	__kernel_uid16_t;
+typedef unsigned short	__kernel_gid16_t;
+typedef __kernel_uid_t __kernel_old_uid_t;
+typedef __kernel_gid_t __kernel_old_gid_t;
+typedef __kernel_uid_t __kernel_uid32_t;
+typedef __kernel_gid_t __kernel_gid32_t;
+typedef __kernel_dev_t __kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+
+typedef struct {
+	int val[2];
+} __kernel_fsid_t;
+
+#endif /* _ALPHA_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/mathdef.h
new file mode 100644
index 0000000..615eb9d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/mathdef.h
@@ -0,0 +1,66 @@
+/* Copyright (C) 1997,1998,1999,2000,2003,2004,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.  */
+
+#if !defined _MATH_H && !defined _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#endif
+
+/* FIXME! This file describes properties of the compiler, not the machine;
+   it should not be part of libc!  */
+
+#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
+# define _MATH_H_MATHDEF	1
+
+/* Alpha has both `float' and `double' arithmetic.  */
+typedef float float_t;
+typedef double double_t;
+
+/* The values returned by `ilogb' for 0 and NaN respectively.  */
+# define FP_ILOGB0     (-2147483647)
+# define FP_ILOGBNAN   (2147483647)
+
+#endif	/* ISO C99 && MATH_H */
+
+#if defined _COMPLEX_H && !defined _COMPLEX_H_MATHDEF
+# define _COMPLEX_H_MATHDEF 1
+# if defined(__GNUC__) && !__GNUC_PREREQ(3,4)
+
+/* Due to an ABI change, we need to remap the complex float symbols.  */
+#  define _Mdouble_		float
+#  define __MATHCALL(function, args) \
+	__MATHDECL(_Complex float, function, args)
+#  define __MATHDECL(type, function, args) \
+	__MATHDECL_1(type, function##f, args, __c1_##function##f); \
+	__MATHDECL_1(type, __##function##f, args, __c1_##function##f)
+#  define __MATHDECL_1(type, function, args, alias) \
+	extern type function args __asm__(#alias) __THROW
+
+#  include <bits/cmathcalls.h>
+
+#  undef _Mdouble_
+#  undef __MATHCALL
+#  undef __MATHDECL
+#  undef __MATHDECL_1
+
+# endif /* GNUC before 3.4 */
+#endif /* COMPLEX_H */
+
+#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/mathinline.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/mathinline.h
new file mode 100644
index 0000000..3dd38e8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/mathinline.h
@@ -0,0 +1,183 @@
+/* Inline math functions for Alpha.
+   Copyright (C) 1996, 1997, 1999-2001, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Mosberger-Tang.
+
+   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/mathinline.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __cplusplus
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE extern __inline
+#endif
+
+#if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0)
+# undef isgreater
+# undef isgreaterequal
+# undef isless
+# undef islessequal
+# undef islessgreater
+# undef isunordered
+# define isunordered(u, v)				\
+  (__extension__					\
+   ({ double __r, __u = (u), __v = (v);			\
+      __asm__ ("cmptun/su %1,%2,%0\n\ttrapb"		\
+	     : "=&f" (__r) : "f" (__u), "f"(__v));	\
+      __r != 0; }))
+#endif /* ISO C99 */
+
+#if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
+    && defined __OPTIMIZE__
+
+#if !__GNUC_PREREQ (4, 0)
+# define __inline_copysign(NAME, TYPE)					\
+__MATH_INLINE TYPE							\
+__NTH (NAME (TYPE __x, TYPE __y))					\
+{									\
+  TYPE __z;								\
+  __asm__ ("cpys %1, %2, %0" : "=f" (__z) : "f" (__y), "f" (__x));	\
+  return __z;								\
+}
+
+__inline_copysign (__copysignf, float)
+__inline_copysign (copysignf, float)
+__inline_copysign (__copysign, double)
+__inline_copysign (copysign, double)
+
+# undef __inline_copysign
+#endif
+
+
+#if !__GNUC_PREREQ (2, 8)
+# define __inline_fabs(NAME, TYPE)			\
+__MATH_INLINE TYPE					\
+__NTH (NAME (TYPE __x))					\
+{							\
+  TYPE __z;						\
+  __asm__ ("cpys $f31, %1, %0" : "=f" (__z) : "f" (__x));	\
+  return __z;						\
+}
+
+__inline_fabs (__fabsf, float)
+__inline_fabs (fabsf, float)
+__inline_fabs (__fabs, double)
+__inline_fabs (fabs, double)
+
+# undef __inline_fabs
+#endif
+
+
+/* Use the -inf rounding mode conversion instructions to implement
+   floor.  We note when the exponent is large enough that the value
+   must be integral, as this avoids unpleasant integer overflows.  */
+
+__MATH_INLINE float
+__NTH (__floorf (float __x))
+{
+  /* Check not zero since floor(-0) == -0.  */
+  if (__x != 0 && fabsf (__x) < 16777216.0f)  /* 1 << FLT_MANT_DIG */
+    {
+      /* Note that Alpha S_Floating is stored in registers in a
+	 restricted T_Floating format, so we don't even need to
+	 convert back to S_Floating in the end.  The initial
+	 conversion to T_Floating is needed to handle denormals.  */
+
+      float __tmp1, __tmp2;
+
+      __asm__ ("cvtst/s %3,%2\n\t"
+#ifdef _IEEE_FP_INEXACT
+	     "cvttq/svim %2,%1\n\t"
+#else
+	     "cvttq/svm %2,%1\n\t"
+#endif
+	     "cvtqt/m %1,%0\n\t"
+	     : "=f"(__x), "=&f"(__tmp1), "=&f"(__tmp2)
+	     : "f"(__x));
+    }
+  return __x;
+}
+
+__MATH_INLINE double
+__NTH (__floor (double __x))
+{
+  if (__x != 0 && fabs (__x) < 9007199254740992.0)  /* 1 << DBL_MANT_DIG */
+    {
+      double __tmp1;
+      __asm__ (
+#ifdef _IEEE_FP_INEXACT
+	     "cvttq/svim %2,%1\n\t"
+#else
+	     "cvttq/svm %2,%1\n\t"
+#endif
+	     "cvtqt/m %1,%0\n\t"
+	     : "=f"(__x), "=&f"(__tmp1)
+	     : "f"(__x));
+    }
+  return __x;
+}
+
+__MATH_INLINE float __NTH (floorf (float __x)) { return __floorf(__x); }
+__MATH_INLINE double __NTH (floor (double __x)) { return __floor(__x); }
+
+
+#ifdef __USE_ISOC99
+
+__MATH_INLINE float
+__NTH (__fdimf (float __x, float __y))
+{
+  return __x <= __y ? 0.0f : __x - __y;
+}
+
+__MATH_INLINE float
+__NTH (fdimf (float __x, float __y))
+{
+  return __x <= __y ? 0.0f : __x - __y;
+}
+
+__MATH_INLINE double
+__NTH (__fdim (double __x, double __y))
+{
+  return __x <= __y ? 0.0 : __x - __y;
+}
+
+__MATH_INLINE double
+__NTH (fdim (double __x, double __y))
+{
+  return __x <= __y ? 0.0 : __x - __y;
+}
+
+/* Test for negative number.  Used in the signbit() macro.  */
+__MATH_INLINE int
+__NTH (__signbitf (float __x))
+{
+  __extension__ union { float __f; int __i; } __u = { __f: __x };
+  return __u.__i < 0;
+}
+
+__MATH_INLINE int
+__NTH (__signbit (double __x))
+{
+  __extension__ union { double __d; long __i; } __u = { __d: __x };
+  return __u.__i < 0;
+}
+
+#endif /* C99 */
+
+#endif /* __NO_MATH_INLINES */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/mman.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/mman.h
new file mode 100644
index 0000000..cafad4a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/mman.h
@@ -0,0 +1,120 @@
+/* Definitions for POSIX memory map interface.  Linux/Alpha version.
+   Copyright (C) 1997, 1998, 2000, 2003, 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.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+   But the kernel header is not namespace clean.  */
+
+
+/* Protections are chosen from these bits, OR'd together.  The
+   implementation does not necessarily support PROT_EXEC or PROT_WRITE
+   without PROT_READ.  The only guarantees are that no writing will be
+   allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ	  0x1		/* Page can be read.  */
+#define PROT_WRITE	  0x2		/* Page can be written.  */
+#define PROT_EXEC	  0x4		/* Page can be executed.  */
+#define PROT_NONE	  0x0		/* Page can not be accessed.  */
+#define PROT_GROWSDOWN	  0x01000000	/* Extend change to start of
+					   growsdown vma (mprotect only).  */
+#define PROT_GROWSUP	  0x02000000	/* Extend change to start of
+					   growsup vma (mprotect only).  */
+
+/* Sharing types (must choose one and only one of these).  */
+#define MAP_SHARED	  0x01		/* Share changes.  */
+#define MAP_PRIVATE	  0x02		/* Changes are private.  */
+#ifdef __USE_MISC
+# define MAP_TYPE	  0x0f		/* Mask for type of mapping.  */
+#endif
+
+/* Other flags.  */
+#define MAP_FIXED	  0x100		/* Interpret addr exactly.  */
+#ifdef __USE_MISC
+# define MAP_FILE	  0
+# define MAP_ANONYMOUS	  0x10		/* Don't use a file.  */
+# define MAP_ANON	  MAP_ANONYMOUS
+#endif
+
+/* Not used by Linux, but here to make sure we don't clash with
+   OSF/1 defines.  */
+#if 0 && defined __USE_BSD
+# define MAP_HASSEMAPHORE 0x0200
+# define MAP_INHERIT	  0x0400
+# define MAP_UNALIGNED	  0x0800
+#endif
+
+/* These are Linux-specific.  */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN	  0x01000	/* Stack-like segment.  */
+# define MAP_DENYWRITE	  0x02000	/* ETXTBSY */
+# define MAP_EXECUTABLE	  0x04000	/* Mark it as an executable.  */
+# define MAP_LOCKED	  0x08000	/* Lock the mapping.  */
+# define MAP_NORESERVE	  0x10000	/* Don't check for reservations.  */
+# define MAP_POPULATE	  0x20000	/* Populate (prefault) pagetables.  */
+# define MAP_NONBLOCK	  0x40000	/* Do not block on IO.  */
+# define MAP_UNINITIALIZE 0x4000000     /* For anonymous mmap, memory could
+					   be uninitialized. */
+#endif
+
+/* Flags to `msync'.  */
+#define MS_ASYNC	  1		/* Sync memory asynchronously.  */
+#define MS_SYNC		  2		/* Synchronous memory sync.  */
+#define MS_INVALIDATE	  4		/* Invalidate the caches.  */
+
+/* Flags for `mlockall'.  */
+#define MCL_CURRENT	  8192		/* Lock all currently mapped pages.  */
+#define MCL_FUTURE	  16384		/* Lock all additions to address
+					   space.  */
+
+/* Flags for `mremap'.  */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE	1
+# define MREMAP_FIXED	2
+#endif
+
+/* Advice to `madvise'.  */
+#ifdef __USE_BSD
+# define MADV_NORMAL     0	/* No further special treatment.  */
+# define MADV_RANDOM     1	/* Expect random page references.  */
+# define MADV_SEQUENTIAL 2	/* Expect sequential page references.  */
+# define MADV_WILLNEED   3	/* Will need these pages.  */
+# define MADV_DONTNEED   6	/* Don't need these pages.  */
+# define MADV_REMOVE	 9	/* Remove these pages and resources.  */
+# define MADV_DONTFORK	 10	/* Do not inherit across fork.  */
+# define MADV_DOFORK	 11	/* Do inherit across fork.  */
+#endif
+
+/* The POSIX people had to invent similar names for the same things.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_MADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_MADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+# define POSIX_MADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_MADV_DONTNEED	6 /* Don't need these pages.  */
+#endif
+
+/* Not used by Linux, but here to make sure we don't clash with
+   OSF/1 defines.  */
+#if 0 && defined __USE_BSD
+# define MADV_DONTNEED_COMPAT 4	/* Old version?  */
+# define MADV_SPACEAVAIL 5	/* Ensure resources are available.  */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/msq.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/msq.h
new file mode 100644
index 0000000..ab251ea
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/msq.h
@@ -0,0 +1,74 @@
+/* Copyright (C) 1995, 1996, 1997, 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 _SYS_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Define options for message queue functions.  */
+#define MSG_NOERROR	010000	/* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT	020000	/* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition.  */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+
+/* Structure of record for one message inside the kernel.
+   The type `struct msg' is opaque.  */
+struct msqid_ds
+{
+  struct ipc_perm msg_perm;	/* structure describing operation permission */
+  __time_t msg_stime;		/* time of last msgsnd command */
+  __time_t msg_rtime;		/* time of last msgrcv command */
+  __time_t msg_ctime;		/* time of last change */
+  unsigned long int __msg_cbytes; /* current number of bytes on queue */
+  msgqnum_t msg_qnum;		/* number of messages currently on queue */
+  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
+  __pid_t msg_lspid;		/* pid of last msgsnd() */
+  __pid_t msg_lrpid;		/* pid of last msgrcv() */
+  unsigned long int __unused1;
+  unsigned long int __unused2;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes	__msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+  {
+    int msgpool;
+    int msgmap;
+    int msgmax;
+    int msgmnb;
+    int msgmni;
+    int msgssz;
+    int msgtql;
+    unsigned short int msgseg;
+  };
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/netdb.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/netdb.h
new file mode 100644
index 0000000..e3664fd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/netdb.h
@@ -0,0 +1,35 @@
+/* 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.  */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network.  NOTE: here a
+   poor assumption is made.  The network number is expected to fit
+   into an unsigned long int variable.  */
+struct netent
+{
+  char *n_name;			/* Official name of network.  */
+  char **n_aliases;		/* Alias list.  */
+  int n_addrtype;		/* Net address type.  */
+  /* XXX We should probably use uint32_t for the field and ensure
+     compatiblity by adding appropriate padding.  */
+  unsigned long	int n_net;	/* Network number.  */
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/resource.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/resource.h
new file mode 100644
index 0000000..2163745
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/resource.h
@@ -0,0 +1,225 @@
+/* Bit values & structures for resource limits.  Alpha/Linux version.
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 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.  */
+
+#ifndef _SYS_RESOURCE_H
+# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Transmute defines to enumerations.  The macro re-definitions are
+   necessary because some programs want to test for operating system
+   features with #ifdef RUSAGE_SELF.  In ISO C the reflexive
+   definition is a no-op.  */
+
+/* Kinds of resource limit.  */
+enum __rlimit_resource
+{
+  /* Per-process CPU limit, in seconds.  */
+  RLIMIT_CPU = 0,
+#define RLIMIT_CPU RLIMIT_CPU
+
+  /* Largest file that can be created, in bytes.  */
+  RLIMIT_FSIZE = 1,
+#define	RLIMIT_FSIZE RLIMIT_FSIZE
+
+  /* Maximum size of data segment, in bytes.  */
+  RLIMIT_DATA = 2,
+#define	RLIMIT_DATA RLIMIT_DATA
+
+  /* Maximum size of stack segment, in bytes.  */
+  RLIMIT_STACK = 3,
+#define	RLIMIT_STACK RLIMIT_STACK
+
+  /* Largest core file that can be created, in bytes.  */
+  RLIMIT_CORE = 4,
+#define	RLIMIT_CORE RLIMIT_CORE
+
+  /* Largest resident set size, in bytes.
+     This affects swapping; processes that are exceeding their
+     resident set size will be more likely to have physical memory
+     taken from them.  */
+  __RLIMIT_RSS = 5,
+#define	RLIMIT_RSS __RLIMIT_RSS
+
+  /* Number of open files.  */
+  RLIMIT_NOFILE = 6,
+  __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same.  */
+#define RLIMIT_NOFILE RLIMIT_NOFILE
+#define RLIMIT_OFILE __RLIMIT_OFILE
+
+  /* Address space limit (?) */
+  RLIMIT_AS = 7,
+#define RLIMIT_AS RLIMIT_AS
+
+  /* Number of processes.  */
+  __RLIMIT_NPROC = 8,
+#define RLIMIT_NPROC __RLIMIT_NPROC
+
+  /* Locked-in-memory address space.  */
+  __RLIMIT_MEMLOCK = 9,
+#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK
+
+  /* Maximum number of file locks.  */
+  __RLIMIT_LOCKS = 10,
+#define RLIMIT_LOCKS __RLIMIT_LOCKS
+
+  /* Maximum number of pending signals.  */
+  __RLIMIT_SIGPENDING = 11,
+#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING
+
+  /* Maximum bytes in POSIX message queues.  */
+  __RLIMIT_MSGQUEUE = 12,
+#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
+
+  /* Maximum nice priority allowed to raise to.
+     Nice levels 19 .. -20 correspond to 0 .. 39
+     values of this resource limit.  */
+  __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+  /* Maximum realtime priority allowed for non-priviledged
+     processes.  */
+  __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
+
+  __RLIMIT_NLIMITS = 15,
+  __RLIM_NLIMITS = __RLIMIT_NLIMITS
+#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
+#define RLIM_NLIMITS __RLIM_NLIMITS
+};
+
+/* Value to indicate that there is no limit.  */
+#ifndef __USE_FILE_OFFSET64
+# define RLIM_INFINITY ((long int)(~0UL >> 1))
+#else
+# define RLIM_INFINITY 0x7fffffffffffffffLL
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define RLIM64_INFINITY 0x7fffffffffffffffLL
+#endif
+
+/* We can represent all limits.  */
+#define RLIM_SAVED_MAX	RLIM_INFINITY
+#define RLIM_SAVED_CUR	RLIM_INFINITY
+
+
+/* Type for resource quantity measurement.  */
+#ifndef __USE_FILE_OFFSET64
+typedef __rlim_t rlim_t;
+#else
+typedef __rlim64_t rlim_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef __rlim64_t rlim64_t;
+#endif
+
+struct rlimit
+  {
+    /* The current (soft) limit.  */
+    rlim_t rlim_cur;
+    /* The hard limit.  */
+    rlim_t rlim_max;
+  };
+
+#ifdef __USE_LARGEFILE64
+struct rlimit64
+  {
+    /* The current (soft) limit.  */
+    rlim64_t rlim_cur;
+    /* The hard limit.  */
+    rlim64_t rlim_max;
+ };
+#endif
+
+/* Whose usage statistics do you want?  */
+enum __rusage_who
+{
+  /* The calling process.  */
+  RUSAGE_SELF = 0,
+#define RUSAGE_SELF RUSAGE_SELF
+
+  /* All of its terminated child processes.  */
+  RUSAGE_CHILDREN = -1
+#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+};
+
+#define __need_timeval
+#include <bits/time.h>		/* For `struct timeval'.  */
+
+/* Structure which says how much of each resource has been used.  */
+struct rusage
+  {
+    /* Total amount of user time used.  */
+    struct timeval ru_utime;
+    /* Total amount of system time used.  */
+    struct timeval ru_stime;
+    /* Maximum resident set size (in kilobytes).  */
+    long int ru_maxrss;
+    /* Amount of sharing of text segment memory
+       with other processes (kilobyte-seconds).  */
+    long int ru_ixrss;
+    /* Amount of data segment memory used (kilobyte-seconds).  */
+    long int ru_idrss;
+    /* Amount of stack memory used (kilobyte-seconds).  */
+    long int ru_isrss;
+    /* Number of soft page faults (i.e. those serviced by reclaiming
+       a page from the list of pages awaiting reallocation.  */
+    long int ru_minflt;
+    /* Number of hard page faults (i.e. those that required I/O).  */
+    long int ru_majflt;
+    /* Number of times a process was swapped out of physical memory.  */
+    long int ru_nswap;
+    /* Number of input operations via the file system.  Note: This
+       and `ru_oublock' do not include operations with the cache.  */
+    long int ru_inblock;
+    /* Number of output operations via the file system.  */
+    long int ru_oublock;
+    /* Number of IPC messages sent.  */
+    long int ru_msgsnd;
+    /* Number of IPC messages received.  */
+    long int ru_msgrcv;
+    /* Number of signals delivered.  */
+    long int ru_nsignals;
+    /* Number of voluntary context switches, i.e. because the process
+       gave up the process before it had to (usually to wait for some
+       resource to be available).  */
+    long int ru_nvcsw;
+    /* Number of involuntary context switches, i.e. a higher priority process
+       became runnable or the current process used up its time slice.  */
+    long int ru_nivcsw;
+  };
+
+/* Priority limits.  */
+#define PRIO_MIN	-20	/* Minimum priority a process can have.  */
+#define PRIO_MAX	20	/* Maximum priority a process can have.  */
+
+/* The type of the WHICH argument to `getpriority' and `setpriority',
+   indicating what flavor of entity the WHO argument specifies.  */
+enum __priority_which
+{
+  PRIO_PROCESS = 0,		/* WHO is a process ID.  */
+#define PRIO_PROCESS PRIO_PROCESS
+  PRIO_PGRP = 1,		/* WHO is a process group ID.  */
+#define PRIO_PGRP PRIO_PGRP
+  PRIO_USER = 2			/* WHO is a user ID.  */
+#define PRIO_USER PRIO_USER
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/sem.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/sem.h
new file mode 100644
index 0000000..f63360b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/sem.h
@@ -0,0 +1,85 @@
+/* Copyright (C) 1995, 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 _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'.  */
+#define SEM_UNDO	0x1000		/* undo the operation on exit */
+
+/* Commands for `semctl'.  */
+#define GETPID		11		/* get sempid */
+#define GETVAL		12		/* get semval */
+#define GETALL		13		/* get all semval's */
+#define GETNCNT		14		/* get semncnt */
+#define GETZCNT		15		/* get semzcnt */
+#define SETVAL		16		/* set semval */
+#define SETALL		17		/* set all semval's */
+
+
+/* Data structure describing a set of semaphores.  */
+struct semid_ds
+{
+  struct ipc_perm sem_perm;		/* operation permission struct */
+  __time_t sem_otime;			/* last semop() time */
+  __time_t sem_ctime;			/* last time changed by semctl() */
+  unsigned long int sem_nsems;		/* number of semaphores in set */
+  unsigned long int __unused1;
+  unsigned long int __unused2;
+};
+
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;				<= value for SETVAL
+     struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;		<= array for GETALL & SETALL
+     struct seminfo *__buf;		<= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED	1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct  seminfo
+{
+  int semmap;
+  int semmni;
+  int semmns;
+  int semmnu;
+  int semmsl;
+  int semopm;
+  int semume;
+  int semusz;
+  int semvmx;
+  int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/setjmp.h
new file mode 100644
index 0000000..4471ba9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/setjmp.h
@@ -0,0 +1,87 @@
+/* Define the machine-dependent type `jmp_buf'.  Alpha version.
+   Copyright (C) 1992,1997,2003,2005,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.  */
+
+#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
+
+/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
+   We use an array of 'long int' instead, to make writing the
+   assembler easier. Naturally, user code should not depend on
+   either representation. */
+
+/*
+ * Integer registers:
+ *    $0 is the return value (va);
+ *    $1-$8, $22-$25, $28 are call-used (t0-t7, t8-t11, at);
+ *    $9-$14 we save here (s0-s5);
+ *    $15 is the FP and we save it here (fp or s6);
+ *    $16-$21 are input arguments (call-used) (a0-a5);
+ *    $26 is the return PC and we save it here (ra);
+ *    $27 is the procedure value (i.e., the address of __setjmp) (pv or t12);
+ *    $29 is the global pointer, which the caller will reconstruct
+ *        from the return address restored in $26 (gp);
+ *    $30 is the stack pointer and we save it here (sp);
+ *    $31 is always zero (zero).
+ *
+ * Floating-point registers:
+ *    $f0 is the floating return value;
+ *    $f1, $f10-$f15, $f22-$f30 are call-used;
+ *    $f2-$f9 we save here;
+ *    $f16-$21 are input args (call-used);
+ *    $f31 is always zero.
+ *
+ * Note that even on Alpha hardware that does not have an FPU (there
+ * isn't such a thing currently) it is required to implement the FP
+ * registers.
+ */
+
+#if defined __USE_MISC || defined __ASSEMBLY__
+# define JB_S0  0
+# define JB_S1  1
+# define JB_S2  2
+# define JB_S3  3
+# define JB_S4  4
+# define JB_S5  5
+# define JB_PC  6
+# define JB_FP  7
+# define JB_SP  8
+# define JB_F2  9
+# define JB_F3  10
+# define JB_F4  11
+# define JB_F5  12
+# define JB_F6  13
+# define JB_F7  14
+# define JB_F8  15
+# define JB_F9  16
+#endif
+
+#ifndef __ASSEMBLY__
+typedef long int __jmp_buf[17];
+
+/* Test if longjmp to JMPBUF would unwind the frame containing a local
+   variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(_jmpbuf, _address)				\
+     ((void *)(_address) < (void *)((_jmpbuf)[JB_SP]))
+#endif
+
+#endif  /* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/shm.h
new file mode 100644
index 0000000..35226c1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/shm.h
@@ -0,0 +1,101 @@
+/* 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 ())
+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() */
+    __time_t shm_dtime;			/* time of last shmdt() */
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+    __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 __unused1;
+    unsigned long int __unused2;
+  };
+
+#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/alpha/bits/sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/sigaction.h
new file mode 100644
index 0000000..61dea11
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/sigaction.h
@@ -0,0 +1,65 @@
+/* The proper definitions for Linux/Alpha sigaction.
+   Copyright (C) 1996, 1997, 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.  */
+
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives.  */
+struct sigaction {
+#ifdef __USE_POSIX199309
+	union {
+		__sighandler_t sa_handler;
+		void (*sa_sigaction)(int, siginfo_t *, void *);
+	} __sigaction_handler;
+# define sa_handler     __sigaction_handler.sa_handler
+# define sa_sigaction   __sigaction_handler.sa_sigaction
+#else
+	__sighandler_t  sa_handler;
+#endif
+	unsigned        sa_flags;
+	sigset_t        sa_mask;
+	/* Alpha has no sa_restorer field.  */
+};
+
+/* Bits in `sa_flags'.  */
+#define	SA_NOCLDSTOP  0x00000004 /* Don't send SIGCHLD when children stop.  */
+#define SA_NOCLDWAIT  0x00000020 /* Don't create zombie on child death.  */
+#define SA_SIGINFO    0x00000040 /* Invoke signal-catching function with
+				    three arguments instead of one.  */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK   0x00000001 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART   0x00000002 /* Restart syscall on signal return.  */
+# define SA_NODEFER   0x00000008 /* Don't automatically block the signal
+				    when its handler is being executed.  */
+# define SA_RESETHAND 0x00000010 /* Reset to SIG_DFL on entry to handler.  */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historical no-op.  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
+# define SA_STACK     SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'.  */
+#define	SIG_BLOCK     1		 /* Block signals.  */
+#define	SIG_UNBLOCK   2		 /* Unblock signals.  */
+#define	SIG_SETMASK   3		 /* Set the set of blocked signals.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/sigcontextinfo.h
new file mode 100644
index 0000000..16c5dcb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/sigcontextinfo.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 1999, 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.  */
+
+#define SIGCONTEXT int _code, struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS _code,
+#define GET_PC(ctx)	((void *) (ctx)->sc_pc)
+#define GET_FRAME(ctx)	((void *) (ctx)->sc_regs[15])
+#define GET_STACK(ctx)	((void *) (ctx)->sc_regs[30])
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/siginfo.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/siginfo.h
new file mode 100644
index 0000000..a2aacc0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/siginfo.h
@@ -0,0 +1,303 @@
+/* siginfo_t, sigevent and constants.  Linux/Alpha version.
+   Copyright (C) 1997-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.  */
+
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+    && !defined __need_sigevent_t
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+#if (!defined __have_sigval_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t \
+	 || defined __need_sigevent_t))
+# define __have_sigval_t	1
+
+/* Type for data associated with a signal.  */
+typedef union sigval
+  {
+    int sival_int;
+    void *sival_ptr;
+  } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t	1
+
+# define __SI_MAX_SIZE     128
+# define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 4)
+
+typedef struct siginfo
+  {
+    int si_signo;		/* Signal number.  */
+    int si_errno;		/* If non-zero, an errno value associated with
+				   this signal, as defined in <errno.h>.  */
+    int si_code;		/* Signal code.  */
+
+    union
+      {
+	int _pad[__SI_PAD_SIZE];
+
+	 /* kill().  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	  } _kill;
+
+	/* POSIX.1b timers.  */
+	struct
+	  {
+	    int si_tid;		/* Timer ID.  */
+	    int si_overrun;	/* Overrun count.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _timer;
+
+	/* POSIX.1b signals.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _rt;
+
+	/* SIGCHLD.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Which child.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    int si_status;	/* Exit value or signal.  */
+	    __clock_t si_utime;
+	    __clock_t si_stime;
+	  } _sigchld;
+
+	/* SIGILL, SIGFPE, SIGSEGV, SIGBUS.  */
+	struct
+	  {
+	    void *si_addr;	/* Faulting insn/memory ref.  */
+	  } _sigfault;
+
+	/* SIGPOLL.  */
+	struct
+	  {
+	    int si_band;	/* Band event for SIGPOLL.  */
+	    int si_fd;
+	  } _sigpoll;
+      } _sifields;
+  } siginfo_t;
+
+
+/* X/Open requires some more fields with fixed names.  */
+# define si_pid		_sifields._kill.si_pid
+# define si_uid		_sifields._kill.si_uid
+# define si_timerid	_sifields._timer.si_tid
+# define si_overrun	_sifields._timer.si_overrun
+# define si_status	_sifields._sigchld.si_status
+# define si_utime	_sifields._sigchld.si_utime
+# define si_stime	_sifields._sigchld.si_stime
+# define si_value	_sifields._rt.si_sigval
+# define si_int		_sifields._rt.si_sigval.sival_int
+# define si_ptr		_sifields._rt.si_sigval.sival_ptr
+# define si_addr	_sifields._sigfault.si_addr
+# define si_band	_sifields._sigpoll.si_band
+# define si_fd		_sifields._sigpoll.si_fd
+
+
+/* Values for `si_code'.  Positive values are reserved for kernel-generated
+   signals.  */
+enum
+{
+  SI_ASYNCNL = -60,		/* Sent by asynch name lookup completion.  */
+# define SI_ASYNCNL	SI_ASYNCNL
+  SI_TKILL = -6,		/* Sent by tkill.  */
+# define SI_TKILL	SI_TKILL
+  SI_SIGIO,			/* Sent by queued SIGIO. */
+# define SI_SIGIO	SI_SIGIO
+  SI_ASYNCIO,			/* Sent by AIO completion.  */
+# define SI_ASYNCIO	SI_ASYNCIO
+  SI_MESGQ,			/* Sent by real time mesq state change.  */
+# define SI_MESGQ	SI_MESGQ
+  SI_TIMER,			/* Sent by timer expiration.  */
+# define SI_TIMER	SI_TIMER
+  SI_QUEUE,			/* Sent by sigqueue.  */
+# define SI_QUEUE	SI_QUEUE
+  SI_USER,			/* Sent by kill, sigsend, raise.  */
+# define SI_USER	SI_USER
+  SI_KERNEL = 0x80		/* Send by kernel.  */
+#define SI_KERNEL	SI_KERNEL
+};
+
+
+/* `si_code' values for SIGILL signal.  */
+enum
+{
+  ILL_ILLOPC = 1,		/* Illegal opcode.  */
+# define ILL_ILLOPC	ILL_ILLOPC
+  ILL_ILLOPN,			/* Illegal operand.  */
+# define ILL_ILLOPN	ILL_ILLOPN
+  ILL_ILLADR,			/* Illegal addressing mode.  */
+# define ILL_ILLADR	ILL_ILLADR
+  ILL_ILLTRP,			/* Illegal trap. */
+# define ILL_ILLTRP	ILL_ILLTRP
+  ILL_PRVOPC,			/* Privileged opcode.  */
+# define ILL_PRVOPC	ILL_PRVOPC
+  ILL_PRVREG,			/* Privileged register.  */
+# define ILL_PRVREG	ILL_PRVREG
+  ILL_COPROC,			/* Coprocessor error.  */
+# define ILL_COPROC	ILL_COPROC
+  ILL_BADSTK			/* Internal stack error.  */
+# define ILL_BADSTK	ILL_BADSTK
+};
+
+/* `si_code' values for SIGFPE signal.  */
+enum
+{
+  FPE_INTDIV = 1,		/* Integer divide by zero.  */
+# define FPE_INTDIV	FPE_INTDIV
+  FPE_INTOVF,			/* Integer overflow.  */
+# define FPE_INTOVF	FPE_INTOVF
+  FPE_FLTDIV,			/* Floating point divide by zero.  */
+# define FPE_FLTDIV	FPE_FLTDIV
+  FPE_FLTOVF,			/* Floating point overflow.  */
+# define FPE_FLTOVF	FPE_FLTOVF
+  FPE_FLTUND,			/* Floating point underflow.  */
+# define FPE_FLTUND	FPE_FLTUND
+  FPE_FLTRES,			/* Floating point inexact result.  */
+# define FPE_FLTRES	FPE_FLTRES
+  FPE_FLTINV,			/* Floating point invalid operation.  */
+# define FPE_FLTINV	FPE_FLTINV
+  FPE_FLTSUB			/* Subscript out of range.  */
+# define FPE_FLTSUB	FPE_FLTSUB
+};
+
+/* `si_code' values for SIGSEGV signal.  */
+enum
+{
+  SEGV_MAPERR = 1,		/* Address not mapped to object.  */
+# define SEGV_MAPERR	SEGV_MAPERR
+  SEGV_ACCERR			/* Invalid permissions for mapped object.  */
+# define SEGV_ACCERR	SEGV_ACCERR
+};
+
+/* `si_code' values for SIGBUS signal.  */
+enum
+{
+  BUS_ADRALN = 1,		/* Invalid address alignment.  */
+# define BUS_ADRALN	BUS_ADRALN
+  BUS_ADRERR,			/* Non-existant physical address.  */
+# define BUS_ADRERR	BUS_ADRERR
+  BUS_OBJERR			/* Object specific hardware error.  */
+# define BUS_OBJERR	BUS_OBJERR
+};
+
+/* `si_code' values for SIGTRAP signal.  */
+enum
+{
+  TRAP_BRKPT = 1,		/* Process breakpoint.  */
+# define TRAP_BRKPT	TRAP_BRKPT
+  TRAP_TRACE			/* Process trace trap.  */
+# define TRAP_TRACE	TRAP_TRACE
+};
+
+/* `si_code' values for SIGCHLD signal.  */
+enum
+{
+  CLD_EXITED = 1,		/* Child has exited.  */
+# define CLD_EXITED	CLD_EXITED
+  CLD_KILLED,			/* Child was killed.  */
+# define CLD_KILLED	CLD_KILLED
+  CLD_DUMPED,			/* Child terminated abnormally.  */
+# define CLD_DUMPED	CLD_DUMPED
+  CLD_TRAPPED,			/* Traced child has trapped.  */
+# define CLD_TRAPPED	CLD_TRAPPED
+  CLD_STOPPED,			/* Child has stopped.  */
+# define CLD_STOPPED	CLD_STOPPED
+  CLD_CONTINUED			/* Stopped child has continued.  */
+# define CLD_CONTINUED	CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal.  */
+enum
+{
+  POLL_IN = 1,			/* Data input available.  */
+# define POLL_IN	POLL_IN
+  POLL_OUT,			/* Output buffers available.  */
+# define POLL_OUT	POLL_OUT
+  POLL_MSG,			/* Input message available.   */
+# define POLL_MSG	POLL_MSG
+  POLL_ERR,			/* I/O error.  */
+# define POLL_ERR	POLL_ERR
+  POLL_PRI,			/* High priority input available.  */
+# define POLL_PRI	POLL_PRI
+  POLL_HUP			/* Device disconnected.  */
+# define POLL_HUP	POLL_HUP
+};
+
+# undef __need_siginfo_t
+#endif	/* !have siginfo_t && (have _SIGNAL_H || need siginfo_t).  */
+
+
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+    && !defined __have_sigevent_t
+# define __have_sigevent_t	1
+
+/* Structure to transport application-defined values with signals.  */
+# define __SIGEV_MAX_SIZE	64
+# define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+
+typedef struct sigevent
+  {
+    sigval_t sigev_value;
+    int sigev_signo;
+    int sigev_notify;
+
+    union
+      {
+	int _pad[__SIGEV_PAD_SIZE];
+
+	/* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+	   thread to receive the signal.  */
+	__pid_t _tid;
+
+	struct
+	  {
+	    void (*_function) (sigval_t);	/* Function to start.  */
+	    void *_attribute;			/* Really pthread_attr_t.  */
+	  } _sigev_thread;
+      } _sigev_un;
+  } sigevent_t;
+
+/* POSIX names to access some of the members.  */
+# define sigev_notify_function   _sigev_un._sigev_thread._function
+# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+/* `sigev_notify' values.  */
+enum
+{
+  SIGEV_SIGNAL = 0,		/* Notify via signal.  */
+# define SIGEV_SIGNAL	SIGEV_SIGNAL
+  SIGEV_NONE,			/* Other notification: meaningless.  */
+# define SIGEV_NONE	SIGEV_NONE
+  SIGEV_THREAD,			/* Deliver via thread creation.  */
+# define SIGEV_THREAD	SIGEV_THREAD
+
+  SIGEV_THREAD_ID = 4		/* Send signal to specific thread.  */
+#define SIGEV_THREAD_ID	SIGEV_THREAD_ID
+};
+
+#endif	/* have _SIGNAL_H.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/signalfd.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/signalfd.h
new file mode 100644
index 0000000..7ea70fa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/signalfd.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2007-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_SIGNALFD_H
+# error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead."
+#endif
+
+/* Flags for signalfd.  */
+enum
+  {
+    SFD_CLOEXEC  = 010000000,
+#define SFD_CLOEXEC SFD_CLOEXEC
+    SFD_NONBLOCK = 000000004
+#define SFD_NONBLOCK SFD_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/signum.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/signum.h
new file mode 100644
index 0000000..46dca8c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/signum.h
@@ -0,0 +1,63 @@
+/* Signal number definitions.  Linux/Alpha version.
+   Copyright (C) 1996, 1997, 1998, 1999, 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.  */
+
+#ifdef	_SIGNAL_H
+
+/*
+ * Linux/AXP has different signal numbers that Linux/i386: I'm trying
+ * to make it OSF/1 binary compatible, at least for normal binaries.
+ */
+#define SIGHUP		 1
+#define SIGINT		 2
+#define SIGQUIT		 3
+#define SIGILL		 4
+#define SIGTRAP		 5
+#define SIGABRT		 6
+#define SIGEMT		 7
+#define SIGFPE		 8
+#define SIGKILL		 9
+#define SIGBUS		10
+#define SIGSEGV		11
+#define SIGSYS		12
+#define SIGPIPE		13
+#define SIGALRM		14
+#define SIGTERM		15
+#define SIGURG		16
+#define SIGSTOP		17
+#define SIGTSTP		18
+#define SIGCONT		19
+#define SIGCHLD		20
+#define SIGCLD          SIGCHLD
+#define SIGTTIN		21
+#define SIGTTOU		22
+#define SIGIO		23
+#define SIGXCPU		24
+#define SIGXFSZ		25
+#define SIGVTALRM	26
+#define SIGPROF		27
+#define SIGWINCH	28
+#define SIGINFO		29
+#define SIGUSR1		30
+#define SIGUSR2		31
+
+#define SIGPOLL	SIGIO
+#define SIGPWR	SIGINFO
+#define SIGIOT	SIGABRT
+
+#endif	/* <signal.h> included.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/sigstack.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/sigstack.h
new file mode 100644
index 0000000..e9fbc6d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/sigstack.h
@@ -0,0 +1,57 @@
+/* sigstack, sigaltstack definitions.
+   Copyright (C) 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.  */
+
+#ifndef _SIGNAL_H
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+
+#if defined __UCLIBC_SUSV4_LEGACY__ || !defined __UCLIBC_STRICT_HEADERS__
+/* Structure describing a signal stack (obsolete).  */
+struct sigstack
+  {
+    __ptr_t ss_sp;		/* Signal stack pointer.  */
+    int ss_onstack;		/* Nonzero if executing on this stack.  */
+  };
+#endif
+
+
+/* Possible values for `ss_flags.'.  */
+enum
+{
+  SS_ONSTACK = 1,
+#define SS_ONSTACK	SS_ONSTACK
+  SS_DISABLE
+#define SS_DISABLE	SS_DISABLE
+};
+
+/* Minimum stack size for a signal handler.  */
+#define MINSIGSTKSZ	4096
+
+/* System default stack size.  */
+#define SIGSTKSZ	16384
+
+
+/* Alternate, preferred interface.  */
+typedef struct sigaltstack
+  {
+    __ptr_t ss_sp;
+    int ss_flags;
+    size_t ss_size;
+  } stack_t;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/stackinfo.h
new file mode 100644
index 0000000..0a281bd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/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 Alpha the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/stat.h
new file mode 100644
index 0000000..6cb1648
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/stat.h
@@ -0,0 +1,156 @@
+/* Copyright (C) 1996,1997,1998,1999,2000,2001,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_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_KERNEL	0
+#define _STAT_VER_GLIBC2	1
+#define _STAT_VER_GLIBC2_1	2
+#define _STAT_VER_KERNEL64	3
+#define _STAT_VER_GLIBC2_3_4	3
+#define _STAT_VER		_STAT_VER_GLIBC2_3_4
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	0
+
+
+/* Nanosecond resolution timestamps are stored in a format equivalent to
+   'struct timespec'.  This is the type used whenever possible but the
+   Unix namespace rules do not allow the identifier 'timespec' to appear
+   in the <sys/stat.h> header.  Therefore we have to handle the use of
+   this header in strictly standard-compliant sources special.
+
+   Use neat tidy anonymous unions and structures when possible.  */
+
+#ifdef __USE_MISC
+# if __GNUC_PREREQ(3,3)
+#  define __ST_TIME(X)				\
+	__extension__ union {			\
+	    struct timespec st_##X##tim;	\
+	    struct {				\
+		__time_t st_##X##time;		\
+		unsigned long st_##X##timensec;	\
+	    };					\
+	}
+# else
+#  define __ST_TIME(X) struct timespec st_##X##tim
+#  define st_atime st_atim.tv_sec
+#  define st_mtime st_mtim.tv_sec
+#  define st_ctime st_ctim.tv_sec
+# endif
+#else
+# define __ST_TIME(X)				\
+	__time_t st_##X##time;			\
+	unsigned long st_##X##timensec
+#endif
+
+
+struct stat
+  {
+    __dev_t st_dev;		/* Device.  */
+#ifdef __USE_FILE_OFFSET64
+    __ino64_t st_ino;		/* File serial number.  */
+#else
+    __ino_t st_ino;		/* File serial number.	*/
+    int __pad0;			/* 64-bit st_ino.  */
+#endif
+    __dev_t st_rdev;		/* Device number, if device.  */
+    __off_t st_size;		/* Size of file, in bytes.  */
+#ifdef __USE_FILE_OFFSET64
+    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+#else
+    __blkcnt_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+    int __pad1;			/* 64-bit st_blocks.  */
+#endif
+    __mode_t st_mode;		/* File mode.  */
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
+    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+    __nlink_t st_nlink;		/* Link count.  */
+    int __pad2;			/* Real padding.  */
+    __ST_TIME(a);		/* Time of last access.  */
+    __ST_TIME(m);		/* Time of last modification.  */
+    __ST_TIME(c);		/* Time of last status change.  */
+    long __unused[3];
+  };
+
+#ifdef __USE_LARGEFILE64
+/* Note stat64 is the same shape as stat.  */
+struct stat64
+  {
+    __dev_t st_dev;		/* Device.  */
+    __ino64_t st_ino;		/* File serial number.  */
+    __dev_t st_rdev;		/* Device number, if device.  */
+    __off_t st_size;		/* Size of file, in bytes.  */
+    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+    __mode_t st_mode;		/* File mode.  */
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
+    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+    __nlink_t st_nlink;		/* Link count.  */
+    int __pad0;			/* Real padding.  */
+    __ST_TIME(a);		/* Time of last access.  */
+    __ST_TIME(m);		/* Time of last modification.  */
+    __ST_TIME(c);		/* Time of last status change.  */
+    long __unused[3];
+  };
+#endif
+
+#undef __ST_TIME
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/statfs.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/statfs.h
new file mode 100644
index 0000000..d838e6b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/statfs.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
+
+#include <bits/types.h>  /* for __fsid_t and __fsblkcnt_t.  */
+
+struct statfs
+  {
+    int f_type;
+    int f_bsize;
+#ifndef __USE_FILE_OFFSET64
+    __fsblkcnt_t f_blocks;
+    __fsblkcnt_t f_bfree;
+    __fsblkcnt_t f_bavail;
+    __fsfilcnt_t f_files;
+    __fsfilcnt_t f_ffree;
+#else
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+#endif
+    __fsid_t f_fsid;
+    int f_namelen;
+    int f_frsize;
+    int f_spare[5];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+  {
+    int f_type;
+    int f_bsize;
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsid_t f_fsid;
+    int f_namelen;
+    int f_frsize;
+    int f_spare[5];
+  };
+#endif
+
+/* Tell code we have this member.  */
+#define _STATFS_F_NAMELEN
+#define _STATFS_F_FRSIZE
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/syscalls.h
new file mode 100644
index 0000000..7ffd025
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/syscalls.h
@@ -0,0 +1,260 @@
+/* Copyright (C) 1992, 1995, 1996, 2000, 2003, 2004, 2006
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Brendan Kehoe (brendan@zen.org).
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+#define INLINE_SYSCALL_NCS(name, nr, args...)	\
+(__extension__					\
+ ({						\
+	long _sc_ret, _sc_err;			\
+	inline_syscall##nr(name, args);		\
+	if (unlikely (_sc_err))			\
+	  {					\
+	    __set_errno (_sc_ret);		\
+	    _sc_ret = -1L;			\
+	  }					\
+	_sc_ret;				\
+  })						\
+)
+
+#define INTERNAL_SYSCALL_NCS(name, err_out, nr, args...) \
+(__extension__ \
+ ({							\
+	long _sc_ret, _sc_err;				\
+	inline_syscall##nr(name, args);			\
+	err_out = _sc_err;				\
+	_sc_ret;					\
+  }) \
+)
+#define INTERNAL_SYSCALL_DECL(err)		long int err
+#define INTERNAL_SYSCALL_ERROR_P(val, err)	err
+#define INTERNAL_SYSCALL_ERRNO(val, err)	val
+
+#define inline_syscall_clobbers				\
+	"$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8",	\
+	"$22", "$23", "$24", "$25", "$27", "$28", "memory"
+
+/* If TLS is in use, we have a conflict between the PAL_rduniq primitive,
+   as modeled within GCC, and explicit use of the R0 register.  If we use
+   the register via the asm, the scheduler may place the PAL_rduniq insn
+   before we've copied the data from R0 into _sc_ret.  If this happens
+   we'll get a reload abort, since R0 is live at the same time it is
+   needed for the PAL_rduniq.
+
+   Solve this by using the "v" constraint instead of an asm for the syscall
+   output.  We don't do this unconditionally to allow compilation with
+   older compilers.  */
+
+#ifdef HAVE___THREAD
+#define inline_syscall_r0_asm
+#define inline_syscall_r0_out_constraint	"=v"
+#else
+#define inline_syscall_r0_asm			__asm__("$0")
+#define inline_syscall_r0_out_constraint	"=r"
+#endif
+
+/* It is moderately important optimization-wise to limit the lifetime
+   of the hard-register variables as much as possible.  Thus we copy
+   in/out as close to the asm as possible.  */
+
+#define inline_syscall0(name, args...)				\
+{								\
+	register long _sc_0 inline_syscall_r0_asm;		\
+	register long _sc_19 __asm__("$19");			\
+								\
+	_sc_0 = name;						\
+	__asm__ __volatile__					\
+	  ("callsys # %0 %1 <= %2"				\
+	   : inline_syscall_r0_out_constraint (_sc_0),		\
+	     "=r"(_sc_19)					\
+	   : "0"(_sc_0)						\
+	   : inline_syscall_clobbers,				\
+	     "$16", "$17", "$18", "$20", "$21");		\
+	_sc_ret = _sc_0, _sc_err = _sc_19;			\
+}
+
+#define inline_syscall1(name,arg1)				\
+{								\
+	register long _sc_0 inline_syscall_r0_asm;		\
+	register long _sc_16 __asm__("$16");			\
+	register long _sc_19 __asm__("$19");			\
+	register long _tmp_16 = (long) (arg1);			\
+								\
+	_sc_0 = name;						\
+	_sc_16 = _tmp_16;					\
+	__asm__ __volatile__					\
+	  ("callsys # %0 %1 <= %2 %3"				\
+	   : inline_syscall_r0_out_constraint (_sc_0),		\
+	     "=r"(_sc_19), "=r"(_sc_16)				\
+	   : "0"(_sc_0), "2"(_sc_16)				\
+	   : inline_syscall_clobbers,				\
+	     "$17", "$18", "$20", "$21");			\
+	_sc_ret = _sc_0, _sc_err = _sc_19;			\
+}
+
+#define inline_syscall2(name,arg1,arg2)				\
+{								\
+	register long _sc_0 inline_syscall_r0_asm;		\
+	register long _sc_16 __asm__("$16");			\
+	register long _sc_17 __asm__("$17");			\
+	register long _sc_19 __asm__("$19");			\
+	register long _tmp_16 = (long) (arg1);			\
+	register long _tmp_17 = (long) (arg2);			\
+								\
+	_sc_0 = name;						\
+	_sc_16 = _tmp_16;					\
+	_sc_17 = _tmp_17;					\
+	__asm__ __volatile__					\
+	  ("callsys # %0 %1 <= %2 %3 %4"			\
+	   : inline_syscall_r0_out_constraint (_sc_0),		\
+	     "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17)		\
+	   : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17)		\
+	   : inline_syscall_clobbers,				\
+	     "$18", "$20", "$21");				\
+	_sc_ret = _sc_0, _sc_err = _sc_19;			\
+}
+
+#define inline_syscall3(name,arg1,arg2,arg3)			\
+{								\
+	register long _sc_0 inline_syscall_r0_asm;		\
+	register long _sc_16 __asm__("$16");			\
+	register long _sc_17 __asm__("$17");			\
+	register long _sc_18 __asm__("$18");			\
+	register long _sc_19 __asm__("$19");			\
+	register long _tmp_16 = (long) (arg1);			\
+	register long _tmp_17 = (long) (arg2);			\
+	register long _tmp_18 = (long) (arg3);			\
+								\
+	_sc_0 = name;						\
+	_sc_16 = _tmp_16;					\
+	_sc_17 = _tmp_17;					\
+	_sc_18 = _tmp_18;					\
+	__asm__ __volatile__					\
+	  ("callsys # %0 %1 <= %2 %3 %4 %5"			\
+	   : inline_syscall_r0_out_constraint (_sc_0),		\
+	     "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17),		\
+	     "=r"(_sc_18)					\
+	   : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17),		\
+	     "4"(_sc_18)					\
+	   : inline_syscall_clobbers, "$20", "$21");		\
+	_sc_ret = _sc_0, _sc_err = _sc_19;			\
+}
+
+#define inline_syscall4(name,arg1,arg2,arg3,arg4)		\
+{								\
+	register long _sc_0 inline_syscall_r0_asm;		\
+	register long _sc_16 __asm__("$16");			\
+	register long _sc_17 __asm__("$17");			\
+	register long _sc_18 __asm__("$18");			\
+	register long _sc_19 __asm__("$19");			\
+	register long _tmp_16 = (long) (arg1);			\
+	register long _tmp_17 = (long) (arg2);			\
+	register long _tmp_18 = (long) (arg3);			\
+	register long _tmp_19 = (long) (arg4);			\
+								\
+	_sc_0 = name;						\
+	_sc_16 = _tmp_16;					\
+	_sc_17 = _tmp_17;					\
+	_sc_18 = _tmp_18;					\
+	_sc_19 = _tmp_19;					\
+	__asm__ __volatile__					\
+	  ("callsys # %0 %1 <= %2 %3 %4 %5 %6"			\
+	   : inline_syscall_r0_out_constraint (_sc_0),		\
+	     "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17),		\
+	     "=r"(_sc_18)					\
+	   : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17),		\
+	     "4"(_sc_18), "1"(_sc_19)				\
+	   : inline_syscall_clobbers, "$20", "$21");		\
+	_sc_ret = _sc_0, _sc_err = _sc_19;			\
+}
+
+#define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5)		\
+{								\
+	register long _sc_0 inline_syscall_r0_asm;		\
+	register long _sc_16 __asm__("$16");			\
+	register long _sc_17 __asm__("$17");			\
+	register long _sc_18 __asm__("$18");			\
+	register long _sc_19 __asm__("$19");			\
+	register long _sc_20 __asm__("$20");			\
+	register long _tmp_16 = (long) (arg1);			\
+	register long _tmp_17 = (long) (arg2);			\
+	register long _tmp_18 = (long) (arg3);			\
+	register long _tmp_19 = (long) (arg4);			\
+	register long _tmp_20 = (long) (arg5);			\
+								\
+	_sc_0 = name;						\
+	_sc_16 = _tmp_16;					\
+	_sc_17 = _tmp_17;					\
+	_sc_18 = _tmp_18;					\
+	_sc_19 = _tmp_19;					\
+	_sc_20 = _tmp_20;					\
+	__asm__ __volatile__					\
+	  ("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7"		\
+	   : inline_syscall_r0_out_constraint (_sc_0),		\
+	     "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17),		\
+	     "=r"(_sc_18), "=r"(_sc_20)				\
+	   : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17),		\
+	     "4"(_sc_18), "1"(_sc_19), "5"(_sc_20)		\
+	   : inline_syscall_clobbers, "$21");			\
+	_sc_ret = _sc_0, _sc_err = _sc_19;			\
+}
+
+#define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6)	\
+{								\
+	register long _sc_0 inline_syscall_r0_asm;		\
+	register long _sc_16 __asm__("$16");			\
+	register long _sc_17 __asm__("$17");			\
+	register long _sc_18 __asm__("$18");			\
+	register long _sc_19 __asm__("$19");			\
+	register long _sc_20 __asm__("$20");			\
+	register long _sc_21 __asm__("$21");			\
+	register long _tmp_16 = (long) (arg1);			\
+	register long _tmp_17 = (long) (arg2);			\
+	register long _tmp_18 = (long) (arg3);			\
+	register long _tmp_19 = (long) (arg4);			\
+	register long _tmp_20 = (long) (arg5);			\
+	register long _tmp_21 = (long) (arg6);			\
+								\
+	_sc_0 = name;						\
+	_sc_16 = _tmp_16;					\
+	_sc_17 = _tmp_17;					\
+	_sc_18 = _tmp_18;					\
+	_sc_19 = _tmp_19;					\
+	_sc_20 = _tmp_20;					\
+	_sc_21 = _tmp_21;					\
+	__asm__ __volatile__					\
+	  ("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7 %8"		\
+	   : inline_syscall_r0_out_constraint (_sc_0),		\
+	     "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17),		\
+	     "=r"(_sc_18), "=r"(_sc_20), "=r"(_sc_21)		\
+	   : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17), "4"(_sc_18),	\
+	     "1"(_sc_19), "5"(_sc_20), "6"(_sc_21)		\
+	   : inline_syscall_clobbers);				\
+	_sc_ret = _sc_0, _sc_err = _sc_19;			\
+}
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/termios.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/termios.h
new file mode 100644
index 0000000..966ccf9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/termios.h
@@ -0,0 +1,226 @@
+/* termios type and macro definitions.  Linux version.
+   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2003, 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.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char	cc_t;
+typedef unsigned int	speed_t;
+typedef unsigned int	tcflag_t;
+
+#define NCCS 32
+struct termios
+  {
+    tcflag_t c_iflag;		/* input mode flags */
+    tcflag_t c_oflag;		/* output mode flags */
+    tcflag_t c_cflag;		/* control mode flags */
+    tcflag_t c_lflag;		/* local mode flags */
+    cc_t c_cc[NCCS];		/* control characters */
+    cc_t c_line;		/* line discipline (== c_cc[33]) */
+    speed_t c_ispeed;		/* input speed */
+    speed_t c_ospeed;		/* output speed */
+#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
+#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
+  };
+
+/* c_cc characters */
+#define VEOF 0
+#define VEOL 1
+#define VEOL2 2
+#define VERASE 3
+#define VWERASE 4
+#define VKILL 5
+#define VREPRINT 6
+#define VSWTC 7
+#define VINTR 8
+#define VQUIT 9
+#define VSUSP 10
+#define VSTART 12
+#define VSTOP 13
+#define VLNEXT 14
+#define VDISCARD 15
+#define VMIN 16
+#define VTIME 17
+
+/* c_iflag bits */
+#define IGNBRK	0000001
+#define BRKINT	0000002
+#define IGNPAR	0000004
+#define PARMRK	0000010
+#define INPCK	0000020
+#define ISTRIP	0000040
+#define INLCR	0000100
+#define IGNCR	0000200
+#define ICRNL	0000400
+#define IXON	0001000
+#define IXOFF	0002000
+#ifdef __USE_BSD
+  /* POSIX.1 doesn't want these... */
+# define IXANY		0004000
+# define IUCLC		0010000
+# define IMAXBEL	0020000
+# define IUTF8		0040000
+#endif
+
+/* c_oflag bits */
+#define OPOST	0000001
+#define ONLCR	0000002
+#define OLCUC	0000004
+
+#define OCRNL	0000010
+#define ONOCR	0000020
+#define ONLRET	0000040
+
+#define OFILL	00000100
+#define OFDEL	00000200
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY	00001400
+# define   NL0	00000000
+# define   NL1	00000400
+# define   NL2	00001000
+# define   NL3	00001400
+# define TABDLY	00006000
+# define   TAB0	00000000
+# define   TAB1	00002000
+# define   TAB2	00004000
+# define   TAB3	00006000
+# define CRDLY	00030000
+# define   CR0	00000000
+# define   CR1	00010000
+# define   CR2	00020000
+# define   CR3	00030000
+# define FFDLY	00040000
+# define   FF0	00000000
+# define   FF1	00040000
+# define BSDLY	00100000
+# define   BS0	00000000
+# define   BS1	00100000
+#endif
+
+#define VTDLY	00200000
+#define   VT0	00000000
+#define   VT1	00200000
+
+#ifdef __USE_MISC
+# define XTABS	01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
+#endif
+
+/* c_cflag bit meaning */
+#ifdef __USE_MISC
+# define CBAUD	0000037
+#endif
+#define  B0	0000000		/* hang up */
+#define  B50	0000001
+#define  B75	0000002
+#define  B110	0000003
+#define  B134	0000004
+#define  B150	0000005
+#define  B200	0000006
+#define  B300	0000007
+#define  B600	0000010
+#define  B1200	0000011
+#define  B1800	0000012
+#define  B2400	0000013
+#define  B4800	0000014
+#define  B9600	0000015
+#define  B19200	0000016
+#define  B38400	0000017
+#ifdef __USE_MISC
+# define EXTA B19200
+# define EXTB B38400
+# define CBAUDEX 0000000
+#endif
+#define  B57600   00020
+#define  B115200  00021
+#define  B230400  00022
+#define  B460800  00023
+#define  B500000  00024
+#define  B576000  00025
+#define  B921600  00026
+#define  B1000000 00027
+#define  B1152000 00030
+#define  B1500000 00031
+#define  B2000000 00032
+#define  B2500000 00033
+#define  B3000000 00034
+#define  B3500000 00035
+#define  B4000000 00036
+
+#define __MAX_BAUD B4000000
+
+#define CSIZE	00001400
+#define   CS5	00000000
+#define   CS6	00000400
+#define   CS7	00001000
+#define   CS8	00001400
+
+#define CSTOPB	00002000
+#define CREAD	00004000
+#define PARENB	00010000
+#define PARODD	00020000
+#define HUPCL	00040000
+
+#define CLOCAL	00100000
+#ifdef __USE_MISC
+# define CMSPAR	  010000000000		/* mark or space (stick) parity */
+# define CRTSCTS  020000000000		/* flow control */
+#endif
+
+/* c_lflag bits */
+#define ISIG	0x00000080
+#define ICANON	0x00000100
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE	0x00004000
+#endif
+#define ECHO	0x00000008
+#define ECHOE	0x00000002
+#define ECHOK	0x00000004
+#define ECHONL	0x00000010
+#define NOFLSH	0x80000000
+#define TOSTOP	0x00400000
+#ifdef __USE_MISC
+# define ECHOCTL	0x00000040
+# define ECHOPRT	0x00000020
+# define ECHOKE	0x00000001
+# define FLUSHO	0x00800000
+# define PENDIN	0x20000000
+#endif
+#define IEXTEN	0x00000400
+
+/* Values for the ACTION argument to `tcflow'.  */
+#define	TCOOFF		0
+#define	TCOON		1
+#define	TCIOFF		2
+#define	TCION		3
+
+/* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
+#define	TCIFLUSH	0
+#define	TCOFLUSH	1
+#define	TCIOFLUSH	2
+
+/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */
+#define	TCSANOW		0
+#define	TCSADRAIN	1
+#define	TCSAFLUSH	2
+
+
+#define _IOT_termios /* Hurd ioctl type field.  */ \
+  _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/timerfd.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/timerfd.h
new file mode 100644
index 0000000..f04833d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/timerfd.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2008-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_TIMERFD_H
+# error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead."
+#endif
+
+/* Bits to be set in the FLAGS parameter of `timerfd_create'.  */
+enum
+  {
+    TFD_CLOEXEC  = 010000000,
+#define TFD_CLOEXEC TFD_CLOEXEC
+    TFD_NONBLOCK = 000000004
+#define TFD_NONBLOCK TFD_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/typesizes.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/typesizes.h
new file mode 100644
index 0000000..201585a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/typesizes.h
@@ -0,0 +1,66 @@
+/* bits/typesizes.h -- underlying types for *_t.  Linux/Alpha version.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef	_BITS_TYPESIZES_H
+#define	_BITS_TYPESIZES_H	1
+
+/* See <bits/types.h> for the meaning of these macros.  This file exists so
+   that <bits/types.h> need not vary across different GNU platforms.  */
+
+#define __DEV_T_TYPE		__U64_TYPE
+#define __UID_T_TYPE		__U32_TYPE
+#define __GID_T_TYPE		__U32_TYPE
+#define __INO_T_TYPE		__U32_TYPE
+#define __INO64_T_TYPE		__U64_TYPE
+#define __MODE_T_TYPE		__U32_TYPE
+#define __NLINK_T_TYPE		__U32_TYPE
+#define __OFF_T_TYPE		__SLONGWORD_TYPE
+#define __OFF64_T_TYPE		__S64_TYPE
+#define __PID_T_TYPE		__S32_TYPE
+#define __RLIM_T_TYPE		__ULONGWORD_TYPE
+#define __RLIM64_T_TYPE		__U64_TYPE
+#define	__BLKCNT_T_TYPE		__U32_TYPE
+#define	__BLKCNT64_T_TYPE	__U64_TYPE
+#define	__FSBLKCNT_T_TYPE	__S32_TYPE
+#define	__FSBLKCNT64_T_TYPE	__S64_TYPE
+#define	__FSFILCNT_T_TYPE	__U32_TYPE
+#define	__FSFILCNT64_T_TYPE	__U64_TYPE
+#define	__ID_T_TYPE		__U32_TYPE
+#define __CLOCK_T_TYPE		__SLONGWORD_TYPE
+#define __TIME_T_TYPE		__SLONGWORD_TYPE
+#define __USECONDS_T_TYPE	__U32_TYPE
+#define __SUSECONDS_T_TYPE	__S64_TYPE
+#define __DADDR_T_TYPE		__S32_TYPE
+#define __SWBLK_T_TYPE		__SLONGWORD_TYPE
+#define __KEY_T_TYPE		__S32_TYPE
+#define __CLOCKID_T_TYPE	__S32_TYPE
+#define __TIMER_T_TYPE		void *
+#define __BLKSIZE_T_TYPE	__U32_TYPE
+#define __FSID_T_TYPE		struct { int __val[2]; }
+#define __SSIZE_T_TYPE		__SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'.  */
+#define	__FD_SETSIZE		1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..e106d12
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/uClibc_arch_features.h
@@ -0,0 +1,47 @@
+/*
+ * 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__ "call_pal 0"
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#define __UCLIBC_SLIGHTLY_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 ? */
+#undef __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/alpha/bits/uClibc_clk_tck.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/uClibc_clk_tck.h
new file mode 100644
index 0000000..f7cd69a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/uClibc_clk_tck.h
@@ -0,0 +1,8 @@
+/* Follow glibc's example and use 1024 for CLK_TCK to implement sysconf and
+ * clock.c instead of the normal default of 100.
+ *
+ * WARNING: It is assumed that this is a constant integer value usable in
+ * preprocessor conditionals!!!
+ */
+
+#define __UCLIBC_CLK_TCK_CONST		1024
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/uClibc_page.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/uClibc_page.h
new file mode 100644
index 0000000..8219a19
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/uClibc_page.h
@@ -0,0 +1,28 @@
+/*  Copyright (C) 2004     Erik Andersen
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supply an architecture specific value for PAGE_SIZE and friends.  */
+
+#ifndef _UCLIBC_PAGE_H
+#define _UCLIBC_PAGE_H
+
+/* PAGE_SHIFT determines the page size -- in this case 8192 */
+#define PAGE_SHIFT	13
+#define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#define PAGE_MASK	(~(PAGE_SIZE-1))
+
+#endif /* _UCLIBC_PAGE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/wordsize.h
new file mode 100644
index 0000000..22fc641
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bits/wordsize.h
@@ -0,0 +1,30 @@
+/* Copyright (C) 1999, 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.  */
+
+#define __WORDSIZE	64
+
+#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
+
+/* Signal that we didn't used to have a `long double'. The changes all
+   the `long double' function variants to be redirects to the double
+   functions.  */
+# define __LONG_DOUBLE_MATH_OPTIONAL	1
+# ifndef __LONG_DOUBLE_128__
+#  define __NO_LONG_DOUBLE_MATH		1
+# endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/brk.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/brk.S
new file mode 100644
index 0000000..42c7368
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/brk.S
@@ -0,0 +1,82 @@
+/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Brendan Kehoe <brendan@zen.org>, 1993.
+
+   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.  */
+
+/* __brk is a special syscall under Linux since it never returns an
+   error.  Instead, the error condition is indicated by returning the old
+   break value (instead of the new, requested one).  */
+
+#include <features.h>
+#define _ERRNO_H
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+#ifdef __PIC__
+.section .bss
+	.align 3
+	.globl __curbrk
+	.hidden __curbrk
+__curbrk: .skip 8
+	.type __curbrk,@object
+	.size __curbrk,8
+#else
+.comm __curbrk, 8
+#endif
+
+	.text
+.globl  brk;
+.align 3;
+.ent  brk , 0;
+
+brk:
+    .frame $30 ,   8 , $26
+	ldgp	$29, 0($27)
+	subq	$30, 8, $30
+	.prologue 1
+
+	/* Save the requested brk across the system call.  */
+	stq	$16, 0($30)
+
+	ldiq	$0, __NR_brk
+	call_pal 131
+
+	ldq	$16, 0($30)
+
+	/* Be prepared for an OSF-style brk.  */
+	bne	$19, $err1
+	beq	$0, $ok
+
+	/* Correctly handle the brk(0) query case.  */
+	cmoveq	$16, $0, $16
+	xor	$16, $0, $1
+	bne	$1, $err0
+
+	/* Update __curbrk and return cleanly.  */
+	mov	$31, $0
+$ok:	stq	$16, __curbrk
+	addq	$30, 8, $30
+	ret
+
+	/* What a horrible way to die.  */
+$err0:	ldi	$0, ENOMEM
+$err1:	addq	$30, 8, $30
+	jmp	$31, __syscall_error
+
+	.end brk
+
+libc_hidden_def(brk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/bsd-_setjmp.S
new file mode 100644
index 0000000..4e6a2da
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bsd-_setjmp.S
@@ -0,0 +1 @@
+/* _setjmp is in setjmp.S  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/bsd-setjmp.S
new file mode 100644
index 0000000..1da848d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/bsd-setjmp.S
@@ -0,0 +1 @@
+/* setjmp is in setjmp.S  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/clone.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/clone.S
new file mode 100644
index 0000000..79d4511
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/clone.S
@@ -0,0 +1,95 @@
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1996.
+
+   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.  */
+
+#include <features.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+#include <sys/syscall.h>
+#include <sys/regdef.h>
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
+
+.text
+.globl  clone;
+.align 3;
+.ent  clone , 0;
+
+clone:
+	.frame $30 , 0, $26
+	.prologue 0
+
+	/* Sanity check arguments.  */
+	ldiq	v0,EINVAL
+	beq	a0,$error		/* no NULL function pointers */
+	beq	a1,$error		/* no NULL stack pointers */
+
+	/* Save the fn ptr and arg on the new stack.  */
+	subq	a1,16,a1
+	stq	a0,0(a1)
+	stq	a3,8(a1)
+
+	/* Do the system call */
+	mov	a2,a0
+	ldiq	v0,__NR_clone
+	call_pal 131
+
+	bne	a3,$error
+	beq	v0,thread_start
+
+	/* Successful return from the parent */
+	ret
+
+	/* Something bad happened -- no child created */
+$error:
+	br	gp,1f
+1:	ldgp	gp,0(gp)
+	jmp	zero,__syscall_error
+
+.end clone
+
+/* Load up the arguments to the function.  Put this block of code in
+   its own function so that we can terminate the stack trace with our
+   debug info.  */
+
+	.ent thread_start
+thread_start:
+	.frame fp,0,zero,0
+	mov	zero,fp
+	.prologue 0
+
+	/* Load up the arguments.  */
+	ldq	pv,0($30)
+	ldq	a0,8($30)
+	addq	$30,16,$30
+
+	/* Call the user's function */
+	jsr	ra,(pv)
+	ldgp	gp,0(ra)
+
+	/* Call _exit rather than doing it inline for breakpoint purposes */
+	mov	v0,a0
+	jsr	ra,HIDDEN_JUMPTARGET(_exit)
+
+	/* Die horribly.  */
+	halt
+
+	.end thread_start
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/crt1.S
new file mode 100644
index 0000000..0bf7124
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/crt1.S
@@ -0,0 +1,97 @@
+/* Startup code for Alpha/ELF.
+   Copyright (C) 1993, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>
+
+   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 <features.h>
+#include <sys/regdef.h>
+
+	.text
+	.align 3
+	.globl _start
+	.ent _start, 0
+	.type _start,@function
+#if defined(__UCLIBC_CTOR_DTOR__)
+	.type _init,%function
+	.type _fini,%function
+#else
+	.weak _init
+	.weak _fini
+#endif
+	.type __uClibc_main,%function
+
+_start:
+	.frame	$15, 0, $15
+	br	gp, 1f
+1:	ldgp	gp, 0(gp)
+	subq	sp, 16, sp
+	mov	0, $15
+	.prologue 0
+
+  /* Load address of the user's main function.  */
+	lda	a0, main
+
+	ldl	a1, 16(sp)	/* get argc */
+	lda	a2, 24(sp)	/* get argv */
+
+  /* Load address of our own entry points to .fini and .init.  */
+	lda	a3, _init
+	lda	a4, _fini
+
+  /* Store address of the shared library termination function.  */
+	mov	v0, a5
+
+  /* Provide the highest stack address to the user code.  */
+	stq	sp, 0(sp)
+
+  /* Call the user's main function, and exit with its value.
+     But let the libc call main.  */
+	jsr	ra, __uClibc_main
+
+  /* Die very horribly if exit returns.  Call_pal hlt is callable from
+     kernel mode only; this will result in an illegal instruction trap.  */
+	call_pal 0
+	.end _start
+
+/* For ECOFF backwards compatibility. */
+/*weak_alias (_start, __start)*/
+
+/* Define a symbol for the first piece of initialized data.  */
+	.data
+	.globl __data_start
+__data_start:
+	.weak data_start
+	data_start = __data_start
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/crti.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/crti.S
new file mode 100644
index 0000000..5c25539
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/crti.S
@@ -0,0 +1,43 @@
+	.set noat
+	.set noreorder
+	.set nomacro
+	.set	macro
+	
+	.section .init
+	.set	nomacro
+	.align 2
+	.globl _init
+	.ent _init
+_init:
+	.frame $30,0,$26,0
+	.mask 0x4000000,0
+	ldah $29,0($27)		!gpdisp!3
+	lda $29,0($29)		!gpdisp!3
+$_init..ng:
+	lda $30,-16($30)
+	stq $26,0($30)
+	.prologue 1
+	.set	macro
+	
+	.align 2
+	.end _init
+	
+	.section .fini
+	.set	nomacro
+	.align 2
+	.globl _fini
+	.ent _fini
+_fini:
+	.frame $30,0,$26,0
+	.mask 0x4000000,0
+	ldah $29,0($27)		!gpdisp!6
+	lda $29,0($29)		!gpdisp!6
+$_fini..ng:
+	lda $30,-16($30)
+	stq $26,0($30)
+	.prologue 1
+	.set	macro
+	.align 2
+	.end _fini
+	
+	.ident	"GCC: (GNU) 3.3.2"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/crtn.S
new file mode 100644
index 0000000..bf847ab
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/crtn.S
@@ -0,0 +1,13 @@
+	.section .init
+	.align 2
+	.globl _init
+	ldq $26,0($30)
+	lda $30,16($30)
+	ret $31,($26),1
+
+	.section .fini
+	.align 2
+	.globl _fini
+	ldq $26,0($30)
+	lda $30,16($30)
+	ret $31,($26),1
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/divl.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/divl.S
new file mode 100644
index 0000000..fdf053f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/divl.S
@@ -0,0 +1,6 @@
+#define IS_REM		0
+#define SIZE		4
+#define UFUNC_NAME	__divlu
+#define SFUNC_NAME	__divl
+
+#include "divrem.h"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/divq.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/divq.S
new file mode 100644
index 0000000..8c88af9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/divq.S
@@ -0,0 +1,6 @@
+#define IS_REM		0
+#define SIZE		8
+#define UFUNC_NAME	__divqu
+#define SFUNC_NAME	__divq
+
+#include "divrem.h"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/divrem.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/divrem.h
new file mode 100644
index 0000000..bd4e2d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/divrem.h
@@ -0,0 +1,198 @@
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Contributed by David Mosberger (davidm@cs.arizona.edu).
+   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 current Alpha chips don't provide hardware for integer
+   division.  The C compiler expects the functions
+
+	__divqu: 64-bit unsigned long divide
+	__remqu: 64-bit unsigned long remainder
+	__divqs/__remqs: signed 64-bit
+	__divlu/__remlu: unsigned 32-bit
+	__divls/__remls: signed 32-bit
+
+   These are not normal C functions: instead of the normal calling
+   sequence, these expect their arguments in registers t10 and t11, and
+   return the result in t12 (aka pv).  Register AT may be clobbered
+   (assembly temporary), anything else must be saved.  */
+
+#include <features.h>
+
+#include <sys/regdef.h>
+#ifdef __linux__
+# include <asm/gentrap.h>
+# include <asm/pal.h>
+#else
+# include <machine/pal.h>
+#endif
+
+#define mask			v0
+#define divisor			t0
+#define compare			AT
+#define tmp1			t2
+#define tmp2			t3
+#define retaddr			t9
+#define arg1			t10
+#define arg2			t11
+#define result			t12
+
+
+#if IS_REM
+# define DIV_ONLY(x,y...)
+# define REM_ONLY(x,y...)	x,##y
+# define modulus		result
+# define quotient		t1
+# define GETSIGN(x)		mov arg1, x
+# define STACK			32
+#else
+# define DIV_ONLY(x,y...)	x,##y
+# define REM_ONLY(x,y...)
+# define modulus		t1
+# define quotient		result
+# define GETSIGN(x)		xor arg1, arg2, x
+# define STACK			48
+#endif
+
+#if SIZE == 8
+# define LONGIFY(x,y)		mov x,y
+# define SLONGIFY(x,y)		mov x,y
+# define _SLONGIFY(x)
+# define NEG(x,y)		negq x,y
+#else
+# define LONGIFY(x,y)		zapnot x,15,y
+# define SLONGIFY(x,y)		sextl x,y
+# define _SLONGIFY(x)		sextl x,x
+# define NEG(x,y)		negl x,y
+#endif
+
+	.set noreorder
+	.set noat
+
+	.ent UFUNC_NAME
+	.globl UFUNC_NAME
+#ifndef IS_IN_rtld
+	.hidden UFUNC_NAME
+#endif
+
+	.align 3
+UFUNC_NAME:
+	lda	sp, -STACK(sp)
+	.frame	sp, STACK, retaddr, 0
+	.prologue 0
+
+$udiv:
+	stq	t0, 0(sp)
+	LONGIFY	(arg2, divisor)
+	stq	t1, 8(sp)
+	LONGIFY	(arg1, modulus)
+	stq	v0, 16(sp)
+	clr	quotient
+	stq	tmp1, 24(sp)
+	ldiq	mask, 1
+	DIV_ONLY(stq tmp2,32(sp))
+
+	beq	divisor, $divbyzero
+
+	.align 3
+#if SIZE == 8
+	/* Shift divisor left.  */
+1:	cmpult	divisor, modulus, compare
+	blt	divisor, 2f
+	addq	divisor, divisor, divisor
+	addq	mask, mask, mask
+	bne	compare, 1b
+	unop
+2:
+#else
+	/* Shift divisor left using 3-bit shifts as we can't overflow.
+	   This results in looping three times less here, but up to
+	   two more times later.  Thus using a large shift isn't worth it.  */
+1:	cmpult	divisor, modulus, compare
+	s8addq	divisor, zero, divisor
+	s8addq	mask, zero, mask
+	bne	compare, 1b
+#endif
+
+	/* Now go back to the right.  */
+3:	DIV_ONLY(addq quotient, mask, tmp2)
+	srl	mask, 1, mask
+	cmpule	divisor, modulus, compare
+	subq	modulus, divisor, tmp1
+	DIV_ONLY(cmovne compare, tmp2, quotient)
+	srl	divisor, 1, divisor
+	cmovne	compare, tmp1, modulus
+	bne	mask, 3b
+
+$done:	ldq	t0, 0(sp)
+	ldq	t1, 8(sp)
+	ldq	v0, 16(sp)
+	ldq	tmp1, 24(sp)
+	DIV_ONLY(ldq tmp2, 32(sp))
+	lda	sp, STACK(sp)
+	ret	zero, (retaddr), 1
+
+$divbyzero:
+	mov	a0, tmp1
+	ldiq	a0, GEN_INTDIV
+	call_pal PAL_gentrap
+	mov	tmp1, a0
+	clr	result			/* If trap returns, return zero.  */
+	br	$done
+
+	.end UFUNC_NAME
+
+	.ent SFUNC_NAME
+	.globl SFUNC_NAME
+
+	.align 3
+SFUNC_NAME:
+	lda	sp, -STACK(sp)
+	.frame	sp, STACK, retaddr, 0
+	.prologue 0
+
+	or	arg1, arg2, AT
+	_SLONGIFY(AT)
+	bge	AT, $udiv		/* don't need to mess with signs */
+
+	/* Save originals and find absolute values.  */
+	stq	arg1, 0(sp)
+	NEG	(arg1, AT)
+	stq	arg2, 8(sp)
+	cmovge	AT, AT, arg1
+	stq	retaddr, 16(sp)
+	NEG	(arg2, AT)
+	stq	tmp1, 24(sp)
+	cmovge	AT, AT, arg2
+
+	/* Do the unsigned division.  */
+	bsr	retaddr, UFUNC_NAME
+
+	/* Restore originals and adjust the sign of the result.  */
+	ldq	arg1, 0(sp)
+	ldq	arg2, 8(sp)
+	GETSIGN	(AT)
+	NEG	(result, tmp1)
+	_SLONGIFY(AT)
+	ldq	retaddr, 16(sp)
+	cmovlt	AT, tmp1, result
+	ldq	tmp1, 24(sp)
+
+	lda	sp, STACK(sp)
+	ret	zero, (retaddr), 1
+
+	.end	SFUNC_NAME
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/fpu_control.h
new file mode 100644
index 0000000..cdffcfb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/fpu_control.h
@@ -0,0 +1,108 @@
+/* FPU control word bits.  Alpha-mapped-to-Intel version.
+   Copyright (C) 1996, 1998, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Olaf Flebbe.
+
+   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 _ALPHA_FPU_CONTROL_H
+#define _ALPHA_FPU_CONTROL_H
+
+/*
+ * Since many programs seem to hardcode the values passed to __setfpucw()
+ * (rather than using the manifest constants) we emulate the x87 interface
+ * here (at least where this makes sense).
+ *
+ *     15-13    12  11-10  9-8     7-6     5    4    3    2    1    0
+ * | reserved | IC | RC  | PC | reserved | PM | UM | OM | ZM | DM | IM
+ *
+ * IM: Invalid operation mask
+ * DM: Denormalized operand mask
+ * ZM: Zero-divide mask
+ * OM: Overflow mask
+ * UM: Underflow mask
+ * PM: Precision (inexact result) mask
+ *
+ * Mask bit is 1 means no interrupt.
+ *
+ * PC: Precision control
+ * 11 - round to extended precision
+ * 10 - round to double precision
+ * 00 - round to single precision
+ *
+ * RC: Rounding control
+ * 00 - rounding to nearest
+ * 01 - rounding down (toward - infinity)
+ * 10 - rounding up (toward + infinity)
+ * 11 - rounding toward zero
+ *
+ * IC: Infinity control
+ * That is for 8087 and 80287 only.
+ *
+ * The hardware default is 0x037f. I choose 0x1372.
+ */
+
+#include <features.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_IM  0x01
+#define _FPU_MASK_DM  0x02
+#define _FPU_MASK_ZM  0x04
+#define _FPU_MASK_OM  0x08
+#define _FPU_MASK_UM  0x10
+#define _FPU_MASK_PM  0x20
+
+/* precision control -- without effect on Alpha */
+#define _FPU_EXTENDED 0x300   /* RECOMMENDED */
+#define _FPU_DOUBLE   0x200
+#define _FPU_SINGLE   0x0     /* DO NOT USE */
+
+/*
+ * rounding control---notice that on the Alpha this affects only
+ * instructions with the dynamic rounding mode qualifier (/d).
+ */
+#define _FPU_RC_NEAREST 0x000 /* RECOMMENDED */
+#define _FPU_RC_DOWN    0x400
+#define _FPU_RC_UP      0x800
+#define _FPU_RC_ZERO    0xC00
+
+#define _FPU_RESERVED 0xF0C0  /* Reserved bits in cw */
+
+
+/* Now two recommended cw */
+
+/* Linux default:
+     - extended precision
+     - rounding to positive infinity.  There is no /p instruction
+       qualifier.  By setting the dynamic rounding mode to +infinity,
+       one can use /d to get round to +infinity with no extra overhead
+       (so long as the default isn't changed, of course...)
+     - no exceptions enabled.  */
+
+#define _FPU_DEFAULT  0x137f
+
+/* IEEE:  same as above. */
+#define _FPU_IEEE     0x137f
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t;
+
+#if 0
+/* Default control word set at startup.  */
+extern fpu_control_t __fpu_control;
+#endif
+
+#endif	/* _ALPHA_FPU_CONTROL */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/pipe.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/pipe.S
new file mode 100644
index 0000000..8a9236b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/pipe.S
@@ -0,0 +1,48 @@
+/* Copyright (C) 1993, 1995, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Mosberger (davidm@cs.arizona.edu).
+
+   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 <sys/syscall.h>
+#include <sys/regdef.h>
+#include <asm/pal.h>
+
+/* __pipe is a special syscall since it returns two values.  */
+
+.globl pipe
+.align 4
+.ent pipe, 0
+pipe:
+	.frame sp, 0, ra
+	ldgp gp,0(pv)
+	.prologue 1
+	lda v0, __NR_pipe
+	call_pal PAL_callsys
+	bne a3, $syscall_error
+
+	stl	r0, 0(a0)
+	stl	r1, 4(a0)
+	mov	zero, v0
+	ret
+
+$syscall_error:
+	jmp	zero,__syscall_error
+
+.end pipe
+
+libc_hidden_def (pipe)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/reml.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/reml.S
new file mode 100644
index 0000000..8c00365
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/reml.S
@@ -0,0 +1,6 @@
+#define IS_REM		1
+#define SIZE		4
+#define UFUNC_NAME	__remlu
+#define SFUNC_NAME	__reml
+
+#include "divrem.h"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/remq.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/remq.S
new file mode 100644
index 0000000..cd1064a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/remq.S
@@ -0,0 +1,6 @@
+#define IS_REM		1
+#define SIZE		8
+#define UFUNC_NAME	__remqu
+#define SFUNC_NAME	__remq
+
+#include "divrem.h"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/setjmp.S
new file mode 100644
index 0000000..105cc82
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/setjmp.S
@@ -0,0 +1,91 @@
+/* Copyright (C) 1992, 1994, 1996, 1997 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 _ASM
+#define _SETJMP_H
+#define __ASSEMBLY__
+#include <bits/setjmp.h>
+
+#define a0  $16
+
+       .ent __sigsetjmp
+       .global __sigsetjmp
+__sigsetjmp:
+       ldgp    $29, 0($27)
+
+$sigsetjmp_local:
+       subq    $30, 16, $30
+       .frame  $26, 16, $26, 0
+       stq     $26, 0($30)
+       .mask   0x04000000, -16
+	.prologue 1
+
+	stq	$9, JB_S0*8(a0)
+	stq	$10, JB_S1*8(a0)
+	stq	$11, JB_S2*8(a0)
+	stq	$12, JB_S3*8(a0)
+	stq	$13, JB_S4*8(a0)
+	stq	$14, JB_S5*8(a0)
+	stq	$26, JB_PC*8(a0)
+	addq	$30, 16, $1
+	stq	$15, JB_FP*8(a0)
+	stq	$1, JB_SP*8(a0)
+	stt	$f2, JB_F2*8(a0)
+	stt	$f3, JB_F3*8(a0)
+	stt	$f4, JB_F4*8(a0)
+	stt	$f5, JB_F5*8(a0)
+	stt	$f6, JB_F6*8(a0)
+	stt	$f7, JB_F7*8(a0)
+	stt	$f8, JB_F8*8(a0)
+	stt	$f9, JB_F9*8(a0)
+
+	/* Call to C to (potentially) save our signal mask.  */
+	jsr	$26, __sigjmp_save
+
+	ldq	$26, 0($30)
+	addq	$30, 16, $30
+	ret
+
+.end __sigsetjmp
+
+/* Put these traditional entry points in the same file so that we can
+   elide much of the nonsense in trying to jmp to the real function.  */
+
+.globl  _setjmp;
+.align 3;
+.ent  _setjmp , 0;
+_setjmp:
+	.frame $30 , 0, $26
+	ldgp	$29, 0($27)
+	mov	0, $17
+	br	$sigsetjmp_local
+.end _setjmp
+
+.globl  setjmp;
+.align 3;
+.ent  setjmp , 0;
+setjmp:
+	.frame $30 , 0, $26
+	ldgp	$29, 0($27)
+	mov	1, $17
+	br	$sigsetjmp_local
+.end setjmp
+
+.weak   _setjmp
+.weak   setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/sigprocmask.c b/ap/build/uClibc/libc/sysdeps/linux/alpha/sigprocmask.c
new file mode 100644
index 0000000..9d611e2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/sigprocmask.c
@@ -0,0 +1,62 @@
+/* Copyright (C) 1993, 1995, 1997, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Mosberger (davidm@azstarnet.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.  */
+
+#include <features.h>
+#include <errno.h>
+#include <sys/syscall.h>
+#include <signal.h>
+#include <string.h>
+
+/* When there is kernel support for more than 64 signals, we'll have to
+   switch to a new system call convention here.  */
+
+static __inline__ _syscall2(int, osf_sigprocmask, int, how, unsigned long int, setval)
+
+int
+sigprocmask (int how, const sigset_t *set, sigset_t *oset)
+{
+  unsigned long int setval;
+  long result;
+
+  if (set)
+    setval = set->__val[0];
+  else
+    {
+      setval = 0;
+      how = SIG_BLOCK;	/* ensure blocked mask doesn't get changed */
+    }
+
+  result = osf_sigprocmask(how, setval);
+  if (result == -1)
+    /* If there are ever more than 64 signals, we need to recode this
+       in assembler since we wouldn't be able to distinguish a mask of
+       all 1s from -1, but for now, we're doing just fine... */
+    return result;
+
+  if (oset)
+    {
+      if (_SIGSET_NWORDS == 2) /* typical */
+        oset->__val[1] = 0;
+      if (_SIGSET_NWORDS > 2)
+        memset(oset, 0, sizeof(*oset));
+      oset->__val[0] = result;
+    }
+  return 0;
+}
+libc_hidden_def(sigprocmask)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/acct.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/acct.h
new file mode 100644
index 0000000..1e00006
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/acct.h
@@ -0,0 +1,66 @@
+/* Copyright (C) 1996, 1997, 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 _SYS_ACCT_H
+
+#define _SYS_ACCT_H	1
+#include <features.h>
+
+#define	__need_time_t
+#include <time.h>
+
+
+__BEGIN_DECLS
+
+#define ACCT_COMM 16
+
+struct acct
+  {
+    char ac_comm[ACCT_COMM];		/* Accounting command name.  */
+    time_t ac_utime;			/* Accounting user time.  */
+    time_t ac_stime;			/* Accounting system time.  */
+    time_t ac_etime;			/* Accounting elapsed time.  */
+    time_t ac_btime;			/* Beginning time.  */
+    unsigned int ac_uid;		/* Accounting user ID.  */
+    unsigned int ac_gid;		/* Accounting group ID.  */
+    unsigned int ac_tty;		/* Controlling tty.  */
+    /* Please note that the value of the `ac_tty' field, a device number,
+       is encoded differently in the kernel and for the libc dev_t type.  */
+    char ac_flag;			/* Accounting flag.  */
+    long int ac_minflt;			/* Accounting minor pagefaults.  */
+    long int ac_majflt;			/* Accounting major pagefaults.  */
+    long int ac_exitcode;		/* Accounting process exitcode.  */
+  };
+
+enum
+  {
+    AFORK = 0001,		/* Has executed fork, but no exec.  */
+    ASU = 0002,			/* Used super-user privileges.  */
+    ACORE = 0004,		/* Dumped core.  */
+    AXSIG = 0010		/* Killed by a signal.  */
+  };
+
+#define AHZ     100
+
+
+/* Switch process accounting on and off.  */
+extern int acct (__const char *__filename) __THROW;
+
+__END_DECLS
+
+#endif	/* sys/acct.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/io.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/io.h
new file mode 100644
index 0000000..9cb8d25
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/io.h
@@ -0,0 +1,96 @@
+/* Copyright (C) 1996, 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.
+
+   Portability note: not all Linux platforms support this call.  Most
+   platforms based on the PC I/O architecture probably will, however.
+   E.g., Linux/Alpha for Alpha PCs supports this.  */
+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>3, permission to
+   access any I/O port is granted.  This call requires root
+   privileges. */
+extern int iopl (int __level) __THROW;
+
+/* Return the physical address of the DENSE I/O memory or NULL if none
+   is available (e.g. on a jensen).  */
+extern unsigned long int _bus_base (void) __THROW __attribute__ ((const));
+extern unsigned long int bus_base (void) __THROW __attribute__ ((const));
+
+/* Return the physical address of the SPARSE I/O memory.  */
+extern unsigned long _bus_base_sparse (void) __THROW __attribute__ ((const));
+extern unsigned long bus_base_sparse (void) __THROW __attribute__ ((const));
+
+/* Return the HAE shift used by the SPARSE I/O memory.  */
+extern int _hae_shift (void) __THROW __attribute__ ((const));
+extern int hae_shift (void) __THROW __attribute__ ((const));
+
+/* Previous three are deprecated in favour of the following, which
+   knows about multiple PCI "hoses".  Provide the PCI bus and dfn
+   numbers just as to pciconfig_read/write.  */
+
+enum __pciconfig_iobase_which
+{
+  IOBASE_HOSE = 0,		/* Return hose index. */
+  IOBASE_SPARSE_MEM = 1,	/* Return physical memory addresses.  */
+  IOBASE_DENSE_MEM = 2,
+  IOBASE_SPARSE_IO = 3,
+  IOBASE_DENSE_IO = 4
+};
+
+extern long pciconfig_iobase(enum __pciconfig_iobase_which __which,
+			     unsigned long int __bus,
+			     unsigned long int __dfn)
+     __THROW __attribute__ ((const));
+
+/* Access PCI space protected from machine checks.  */
+extern int pciconfig_read (unsigned long int __bus,
+			   unsigned long int __dfn,
+			   unsigned long int __off,
+			   unsigned long int __len,
+			   unsigned char *__buf) __THROW;
+
+extern int pciconfig_write (unsigned long int __bus,
+			    unsigned long int __dfn,
+			    unsigned long int __off,
+			    unsigned long int __len,
+			    unsigned char *__buf) __THROW;
+
+/* Userspace declarations.  */
+extern unsigned int inb (unsigned long __port) __THROW;
+extern unsigned int inw (unsigned long __port) __THROW;
+extern unsigned int inl (unsigned long __port) __THROW;
+extern void outb (unsigned char __b, unsigned long __port) __THROW;
+extern void outw (unsigned short __w, unsigned long __port) __THROW;
+extern void outl (unsigned int __l, unsigned long __port) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_IO_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/procfs.h
new file mode 100644
index 0000000..2c9d119
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/procfs.h
@@ -0,0 +1,128 @@
+/* Copyright (C) 1996, 1997, 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_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+
+__BEGIN_DECLS
+
+/*
+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
+ * I have no idea why that is so.  For now, we just leave it at 33
+ * (32 general regs + processor status word).
+ */
+#define ELF_NGREG  33
+#define ELF_NFPREG 32
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef double elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+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.  Fields present but not used are
+   marked with "XXX".  */
+struct elf_prstatus
+  {
+#if 0
+    long int pr_flags;			/* XXX Process flags.  */
+    short int pr_why;			/* XXX Reason for process halt.  */
+    short int pr_what;			/* XXX More detailed reason.  */
+#endif
+    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.  */
+#if 0
+    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
+    struct sigaction pr_action;		/* Signal action for current sig.  */
+#endif
+    __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.  */
+#if 0
+    long int pr_instr;			/* Current instruction.  */
+#endif
+    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 int pr_uid;
+    unsigned 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.  */
+  };
+
+/* Addresses.  */
+typedef void *psaddr_t;
+
+/* Register sets.  Linux has different names.  */
+typedef gregset_t prgregset_t;
+typedef fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+   therefore habe only ine PID type.  */
+typedef __pid_t lwpid_t;
+
+
+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/alpha/sys/regdef.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/regdef.h
new file mode 100644
index 0000000..18fb0d5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/regdef.h
@@ -0,0 +1,47 @@
+#ifndef __alpha_regdef_h__
+#define __alpha_regdef_h__
+
+#define v0	$0	/* function return value */
+
+#define t0	$1	/* temporary registers (caller-saved) */
+#define t1	$2
+#define t2	$3
+#define t3	$4
+#define t4	$5
+#define t5	$6
+#define t6	$7
+#define t7	$8
+
+#define	s0	$9	/* saved-registers (callee-saved registers) */
+#define	s1	$10
+#define	s2	$11
+#define	s3	$12
+#define	s4	$13
+#define	s5	$14
+#define	s6	$15
+#define	fp	s6	/* frame-pointer (s6 in frame-less procedures) */
+
+#define a0	$16	/* argument registers (caller-saved) */
+#define a1	$17
+#define a2	$18
+#define a3	$19
+#define a4	$20
+#define a5	$21
+
+#define t8	$22	/* more temps (caller-saved) */
+#define t9	$23
+#define t10	$24
+#define t11	$25
+#define ra	$26	/* return address register */
+#define t12	$27
+
+#define pv	t12	/* procedure-variable register */
+#define AT	$at	/* assembler temporary */
+#define gp	$29	/* global pointer */
+#define sp	$30	/* stack pointer */
+#define zero	$31	/* reads as zero, writes are noops */
+
+#define r0	v0
+#define r1	a4
+
+#endif /* __alpha_regdef_h__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/ucontext.h
new file mode 100644
index 0000000..438293c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/ucontext.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 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_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+#include <bits/sigcontext.h>
+
+
+/* Type for general register.  */
+typedef long int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	33
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+/* Type for floating-point register.  */
+typedef long int fpreg_t;
+
+/* Number of general registers.  */
+#define NFPREG	32
+
+/* Container for all general registers.  */
+typedef fpreg_t fpregset_t[NFPREG];
+
+
+/* A machine context is exactly a sigcontext.  */
+typedef struct sigcontext mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    unsigned long __uc_osf_sigmask;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/user.h
new file mode 100644
index 0000000..f9beea0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/sys/user.h
@@ -0,0 +1,50 @@
+/* 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.  */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H	1
+
+/* The whole purpose of this file is for gdb/strace and gdb/strace
+   only. Don't read too much into it. Don't use it for anything other
+   than gdb/strace unless you know what you are doing. */
+
+#include <bits/uClibc_page.h>
+#include <asm/reg.h>
+
+struct user
+{
+  unsigned long	int regs[EF_SIZE / 8 + 32];	/* integer and fp regs */
+  size_t u_tsize;				/* text size (pages) */
+  size_t u_dsize;				/* data size (pages) */
+  size_t u_ssize;				/* stack size (pages) */
+  unsigned long	int start_code;			/* text starting address */
+  unsigned long	int start_data;			/* data starting address */
+  unsigned long	int start_stack;		/* stack starting address */
+  long int signal;				/* signal causing core dump */
+  struct regs *u_ar0;				/* help gdb find registers */
+  unsigned long	int magic;			/* identifies a core file */
+  char u_comm[32];				/* user command name */
+};
+
+#define NBPG			PAGE_SIZE
+#define UPAGES			1
+#define HOST_TEXT_START_ADDR	(u.start_code)
+#define HOST_DATA_START_ADDR	(u.start_data)
+#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
+
+#endif	/* sys/user.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/alpha/syscall.S b/ap/build/uClibc/libc/sysdeps/linux/alpha/syscall.S
new file mode 100644
index 0000000..89901d5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/alpha/syscall.S
@@ -0,0 +1,71 @@
+/* Copyright (C) 1996 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Mosberger <davidm@azstarnet.com>, 1996.
+
+   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 <sys/regdef.h>
+#include <asm/pal.h>
+
+/*
+ * This is for COMPATIBILITY with Linux/x86 only.  Linux/Alpha system
+ * calls return an error indication in a3.  This allows arbitrary 64bit 
+ * values to be returned in v0 (because negative values are not
+ * mistaken as error numbers).  However, C allows only one value to
+ * be returned, so the interface below folds the error indication passed in
+ * a3 back into v0: it sets v0 to -errno if an error occurs.  Thus,
+ * no negative 64bit numbers can be returned.  To avoid this problem,
+ * use assembly stubs wherever possible/convenient.
+ *
+ * Usage:
+ *
+ * long	syscall(syscall_number, arg1, arg2, arg3, arg4, arg5)
+ *
+ * syscall_number = the index of the system call we're invoking
+ * arg1-arg5 = up to 5 integer arguments to the system call
+ *
+ * We need to do some arg shifting: the kernel expects the
+ * syscall number in v0 and the first five args in a0-a4.
+ *
+ */
+
+.globl __syscall;
+.align 4;
+.ent __syscall, 0;
+__syscall:
+.frame sp, 0, ra
+	.prologue 0
+
+	mov	a0, v0		/* Syscall number -> v0 */
+	mov	a1, a0		/* arg1-arg5 -> a0-a4 */
+	mov	a2, a1
+	mov	a3, a2
+	mov	a4, a3
+	mov	a5, a4
+
+	call_pal PAL_callsys	/* Invoke system call */
+	bne	a3, $error
+	ret
+
+$error:
+	br	gp, 2f
+2:	ldgp	gp, 0(gp)
+	jmp	zero,__syscall_error
+
+.end __syscall
+
+weak_alias (__syscall, syscall)
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
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/Makefile b/ap/build/uClibc/libc/sysdeps/linux/avr32/Makefile
new file mode 100644
index 0000000..338abc0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/Makefile
@@ -0,0 +1,25 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org>
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Library General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+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/avr32/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/avr32/Makefile.arch
new file mode 100644
index 0000000..98b85a7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/Makefile.arch
@@ -0,0 +1,11 @@
+# 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 clone.c mmap.c prctl.c sigaction.c
+
+SSRC	:= __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S	\
+		sigrestorer.S syscall.S vfork.S
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/avr32/__longjmp.S
new file mode 100644
index 0000000..6154bb2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/__longjmp.S
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2004-2007 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+
+	.global	__longjmp
+	.type	__longjmp,"function"
+	.align	1
+__longjmp:
+	ldm	r12++, r0-r8,sp,lr
+	mustr	r8		/* restore status register (lower half) */
+	cp	r11, 0		/* can't return zero */
+	frs
+	moveq	r11, 1
+	retal	r11
+	.size	__longjmp, . - __longjmp
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/atomic.h
new file mode 100644
index 0000000..e6be41f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/atomic.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2007 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#ifndef _AVR32_BITS_ATOMIC_H
+#define _AVR32_BITS_ATOMIC_H 1
+
+#include <inttypes.h>
+
+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;
+
+#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval)	\
+	(abort(), 0)
+
+#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval)	\
+	(abort(), 0)
+
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval)	\
+	({								\
+		__typeof__(*(mem)) __prev;				\
+		__asm__ __volatile__(					\
+			"/* __arch_compare_and_exchange_val_32_acq */\n" \
+			"1:	ssrf	5\n"				\
+			"	ld.w	%[result], %[m]\n"		\
+			"	cp.w	%[result], %[old]\n"		\
+			"	brne	2f\n"				\
+			"	stcond	%[m], %[new]\n"			\
+			"	brne	1b\n"				\
+			"2:"						\
+			: [result] "=&r"(__result), [m] "=m"(*(mem))	\
+			: "m"(*(mem)), [old] "ir"(oldval),		\
+			  [new] "r"(newval)				\
+			: "memory", "cc");				\
+		__prev;							\
+	})
+
+#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval)	\
+	(abort(), 0)
+
+#define __arch_exchange_32_acq(mem, newval)				\
+	({								\
+		__typeof__(*(mem)) __oldval;				\
+		__asm__ __volatile__(					\
+			"/*__arch_exchange_32_acq */\n"			\
+			"	xchg	%[old], %[m], %[new]"		\
+			: [old] "=&r"(__oldval)				\
+			: [m] "r"(mem), [new] "r"(newval)		\
+			: "memory");					\
+		__oldval;						\
+	})
+
+#define __arch_atomic_exchange_and_add_32(mem, value)			\
+	({								\
+		__typeof__(*(mem)) __oldval, __tmp;			\
+		__asm__ __volatile__(					\
+			"/* __arch_atomic_exchange_and_add_32 */\n"	\
+			"1:	ssrf	5\n"				\
+			"	ld.w	%[old], %[m]\n"			\
+			"	add	%[tmp], %[old], %[val]\n"	\
+			"	stcond	%[m], %[tmp]\n"			\
+			"	brne	1b"				\
+			: [old] "=&r"(__oldval), [tmp] "=&r"(__tmp),	\
+			  [m] "=m"(*(mem))				\
+			: "m"(*(mem)), [val] "r"(value)			\
+			: "memory", "cc");				\
+		__oldval;						\
+	})
+
+#define __arch_atomic_decrement_if_positive_32(mem)			\
+	({								\
+		__typeof__(*(mem)) __oldval, __tmp;			\
+		__asm__ __volatile__(					\
+			"/* __arch_atomic_decrement_if_positive_32 */\n" \
+			"1:	ssrf	5\n"				\
+			"	ld.w	%[old], %[m]\n"			\
+			"	sub	%[tmp], %[old], 1\n"		\
+			"	brlt	2f\n"				\
+			"	stcond	%[m], %[tmp]\n"			\
+			"	brne	1b"				\
+			"2:"						\
+			: [old] "=&r"(__oldval), [tmp] "=&r"(__tmp),	\
+			  [m] "=m"(*(mem))				\
+			: "m"(*(mem))					\
+			: "memory", "cc");				\
+		__oldval;						\
+	})
+
+#define atomic_exchange_acq(mem, newval)				\
+	({								\
+		if (sizeof(*(mem)) != 4)				\
+			abort();					\
+		__arch_exchange_32_acq(mem, newval);			\
+	})
+
+#define atomic_exchange_and_add(mem, newval)				\
+	({								\
+		if (sizeof(*(mem)) != 4)				\
+			abort();					\
+		__arch_atomic_exchange_and_add_32(mem, newval);		\
+	})
+
+#define atomic_decrement_if_positive(mem)				\
+	({								\
+		if (sizeof(*(mem)) != 4)				\
+			abort();					\
+		__arch_atomic_decrement_if_positive_32(mem);		\
+	})
+
+#endif /* _AVR32_BITS_ATOMIC_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/endian.h
new file mode 100644
index 0000000..7bb6358
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/endian.h
@@ -0,0 +1,7 @@
+/* AVR32 is big-endian */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __BIG_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/fcntl.h
new file mode 100644
index 0000000..767243e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/fcntl.h
@@ -0,0 +1,215 @@
+#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	00000003
+#define O_RDONLY	00000000
+#define O_WRONLY	00000001
+#define O_RDWR		00000002
+#define O_CREAT		00000100	/* not fcntl */
+#define O_EXCL		00000200	/* not fcntl */
+#define O_NOCTTY	00000400	/* not fcntl */
+#define O_TRUNC		00001000	/* not fcntl */
+#define O_APPEND	00002000
+#define O_NONBLOCK	00004000
+#define O_NDELAY	O_NONBLOCK
+#define O_SYNC		00010000
+#define O_ASYNC		00020000
+
+#ifdef __USE_GNU
+# define O_DIRECT	00040000	/* must be a directory */
+# define O_DIRECTORY	00200000	/* direct disk access */
+# define O_NOFOLLOW	00400000	/* don't follow links */
+# define O_NOATIME	01000000	/* don't set atime */
+# define O_CLOEXEC	02000000	/* set close_on_exec */
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE	00100000
+#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
+
+#define F_DUPFD		0	/* dup */
+#define F_GETFD		1	/* get close_on_exec */
+#define F_SETFD		2	/* set/clear close_on_exec */
+#define F_GETFL		3	/* get file->f_flags */
+#define F_SETFL		4	/* set file->f_flags */
+
+#ifndef __USE_FILE_OFFSET64
+# define F_GETLK	5
+# define F_SETLK	6
+# define F_SETLKW	7
+#else
+# define F_GETLK	F_GETLK64
+# define F_SETLK	F_SETLK64
+# define F_SETLKW	F_SETLKW64
+#endif
+#define F_GETLK64	12	/*  using 'struct flock64' */
+#define F_SETLK64	13
+#define F_SETLKW64	14
+
+#if defined __USE_BSD || defined __USE_XOPEN2K
+# define F_SETOWN	8	/*  for sockets. */
+# define F_GETOWN	9	/*  for sockets. */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG	10	/*  for sockets. */
+# define F_GETSIG	11	/*  for sockets. */
+#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.	 */
+#endif
+
+/* for F_[GET|SET]FL */
+#define FD_CLOEXEC	1	/* actually anything with low bit set goes */
+
+/* for posix fcntl() and lockf() */
+#define F_RDLCK		0
+#define F_WRLCK		1
+#define F_UNLCK		2
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK		4	/* or 3 */
+#define F_SHLCK		8	/* or 4 */
+
+/* for leases */
+#define F_INPROGRESS	16
+
+#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 ops */
+#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		l_type;
+	short		l_whence;
+#ifndef __USE_FILE_OFFSET64
+	__off_t		l_start;
+	__off_t		l_len;
+#else
+	__off64_t	l_start;
+	__off64_t	l_len;
+#endif
+	__pid_t		l_pid;
+};
+
+#ifdef __USE_LARGEFILE64
+struct flock64 {
+	short		l_type;
+	short		l_whence;
+	__off64_t	l_start;
+	__off64_t	l_len;
+	__pid_t		l_pid;
+};
+#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 */
+
+__BEGIN_DECLS
+
+/* 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);
+
+__END_DECLS
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/kernel_stat.h
new file mode 100644
index 0000000..d98c6cf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/kernel_stat.h
@@ -0,0 +1,53 @@
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+/*
+ * This file provides struct stat, taken from kernel 2.6.4. Verified
+ * to match kernel 2.6.22.
+ */
+
+struct kernel_stat {
+        unsigned long		st_dev;
+        unsigned long		st_ino;
+        unsigned short		st_mode;
+        unsigned short		st_nlink;
+        unsigned short		st_uid;
+        unsigned short		st_gid;
+        unsigned long		st_rdev;
+        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 long long	st_ino;
+	unsigned int		st_mode;
+	unsigned int		st_nlink;
+
+	unsigned long		st_uid;
+	unsigned long		st_gid;
+
+	unsigned long long	st_rdev;
+
+	long long		st_size;
+	unsigned long		__pad1;
+	unsigned long		st_blksize;
+
+	unsigned long long	st_blocks;
+
+	struct timespec		st_atim;
+	struct timespec		st_mtim;
+	struct timespec		st_ctim;
+
+	unsigned long		__unused1;
+	unsigned long		__unused2;
+};
+
+#endif /* _BITS_STAT_STRUCT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/kernel_types.h
new file mode 100644
index 0000000..c551d57
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/kernel_types.h
@@ -0,0 +1,57 @@
+/* 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 __ASM_AVR32_POSIX_TYPES_H
+#define __ASM_AVR32_POSIX_TYPES_H
+
+/*
+ * This file is generally used by user-level software, so you need to
+ * be a little careful about namespace pollution etc.  Also, we cannot
+ * assume GCC is being used.
+ */
+
+typedef unsigned long		__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 int		__kernel_uid_t;
+typedef unsigned int		__kernel_gid_t;
+typedef unsigned long		__kernel_size_t;
+typedef long			__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_timer_t;
+typedef int			__kernel_clockid_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 unsigned short		__kernel_old_dev_t;
+typedef long			__kernel_long_t;
+typedef unsigned long		__kernel_ulong_t;
+
+#ifdef __GNUC__
+typedef long long		__kernel_loff_t;
+#endif
+
+typedef struct {
+#if defined(__USE_ALL)
+	int	val[2];
+#else
+	int	__val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* __ASM_AVR32_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/setjmp.h
new file mode 100644
index 0000000..78348a3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/setjmp.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2004-2005 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#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
+/*
+ * The jump buffer contains r0-r7, sr, sp and lr. Other registers are
+ * not saved.
+ */
+typedef int __jmp_buf[11];
+#endif
+
+#define __JMP_BUF_SP	4
+
+/* 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/avr32/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/stackinfo.h
new file mode 100644
index 0000000..2c17d30
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On AVR32 the stack grows down. */
+#define _STACK_GROWS_DOWN	1
+
+#endif /* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/syscalls.h
new file mode 100644
index 0000000..70dc1d9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/syscalls.h
@@ -0,0 +1,55 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\
+(__extension__ \
+	({								\
+		register int __a1 __asm__("r12");			\
+		register int _scno __asm__("r8") = name;		\
+		LOAD_ARGS_##nr (args);					\
+		__asm__ __volatile__("scall	/* syscall " #name " */" \
+			      : "=r" (__a1)				\
+			      : "r"(_scno) ASM_ARGS_##nr		\
+			      : "cc", "memory");			\
+		__a1;							\
+	}) \
+)
+#define INTERNAL_SYSCALL_ERROR_P(val, err)		\
+	((unsigned int)(val) >= 0xfffff001U)
+
+#define LOAD_ARGS_0() do { } while(0)
+#define ASM_ARGS_0
+#define LOAD_ARGS_1(a1)					\
+	__a1 = (int) (a1);				\
+	LOAD_ARGS_0()
+#define ASM_ARGS_1	ASM_ARGS_0, "r"(__a1)
+#define LOAD_ARGS_2(a1, a2)				\
+	register int __a2 __asm__("r11") = (int)(a2);	\
+	LOAD_ARGS_1(a1)
+#define ASM_ARGS_2	ASM_ARGS_1, "r"(__a2)
+#define LOAD_ARGS_3(a1, a2, a3)				\
+	register int __a3 __asm__("r10") = (int)(a3);	\
+	LOAD_ARGS_2(a1, a2)
+#define ASM_ARGS_3	ASM_ARGS_2, "r"(__a3)
+#define LOAD_ARGS_4(a1, a2, a3, a4)			\
+	register int __a4 __asm__("r9") = (int)(a4);	\
+	LOAD_ARGS_3(a1, a2, a3)
+#define ASM_ARGS_4	ASM_ARGS_3, "r"(__a4)
+#define LOAD_ARGS_5(a1, a2, a3, a4, a5)			\
+	register int __a5 __asm__("r5") = (int)(a5);	\
+	LOAD_ARGS_4(a1, a2, a3, a4)
+#define ASM_ARGS_5	ASM_ARGS_4, "r"(__a5)
+#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6)		\
+	register int __a6 __asm__("r3") = (int)(a6);	\
+	LOAD_ARGS_5(a1, a2, a3, a4, a5)
+#define ASM_ARGS_6	ASM_ARGS_5, "r"(__a6)
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..c306577
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/uClibc_arch_features.h
@@ -0,0 +1,48 @@
+/*
+ * 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 */
+/* trigger illegal instruction exception, same as BUG in Linux */
+#define __UCLIBC_ABORT_INSTRUCTION__ ".short 0x5df0"
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/avr32/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/wordsize.h
new file mode 100644
index 0000000..1b5842a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bits/wordsize.h
@@ -0,0 +1 @@
+#define __WORDSIZE	32
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/brk.c b/ap/build/uClibc/libc/sysdeps/linux/avr32/brk.c
new file mode 100644
index 0000000..58f04f9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/brk.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2004-2007 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+
+void *__curbrk attribute_hidden = 0;
+
+int brk (void *addr)
+{
+	void *newbrk;
+
+	newbrk = (void *)INLINE_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/avr32/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/avr32/bsd-_setjmp.S
new file mode 100644
index 0000000..f23e73b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bsd-_setjmp.S
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2004-2007 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+
+	/* This just does a tail-call to __sigsetjmp(env, 0) */
+	.global	_setjmp
+	.type	_setjmp,"function"
+	.align	1
+_setjmp:
+	mov	r11, 0
+	bral	HIDDEN_JUMPTARGET(__sigsetjmp)
+	.size	_setjmp, . - _setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/avr32/bsd-setjmp.S
new file mode 100644
index 0000000..5247ec3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/bsd-setjmp.S
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2004-2007 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+
+	/* This just does a tail-call to __sigsetjmp(env, 1) */
+	.global	setjmp
+	.type	setjmp,"function"
+	.align	1
+setjmp:
+	mov	r11, 1
+	bral	HIDDEN_JUMPTARGET(__sigsetjmp)
+	.size	setjmp, . - setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/clone.c b/ap/build/uClibc/libc/sysdeps/linux/avr32/clone.c
new file mode 100644
index 0000000..06e3388
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/clone.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2004 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#include <sched.h>
+#include <errno.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+/*
+ * I don't know if we can be absolutely certain that the fn and arg
+ * parameters are preserved when returning as the child. If the
+ * compiler stores them in registers (r0-r7), they should be.
+ */
+int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, ...)
+{
+	register int (*_fn)(void *arg) = fn;
+	register void *_arg = arg;
+	int err;
+
+	/* Sanity check the arguments */
+	err = -EINVAL;
+	if (!fn)
+		goto syscall_error;
+	if (!child_stack)
+		goto syscall_error;
+
+	err = INLINE_SYSCALL(clone, 2, flags, child_stack);
+	if (err < 0)
+		goto syscall_error;
+	else if (err != 0)
+		return err;
+
+	_exit(_fn(_arg));
+
+syscall_error:
+	__set_errno (-err);
+	return -1;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/avr32/crt1.S
new file mode 100644
index 0000000..ca1fa7a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/crt1.S
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2004-2007 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ *
+ * When we enter _start, the stack looks like this:
+ *	argc		argument counter
+ *	argv[0]		pointer to program name
+ *	argv[1..argc-1]	pointers to program args
+ *	NULL
+ *	env[0..N]	pointers to environment variables
+ *	NULL
+ *
+ * r12 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.
+ *
+ * We're going to call the following function:
+ * __uClibc_main(int (*main)(int, char **, char **), int argc,
+ *		 char **argv, void (*app_init)(void), void (*app_fini)(void),
+ *		 void (*rtld_fini)(void), void *stack_end)
+ *
+ * So we need to set up things as follows:
+ *	r12 = address of main
+ *	r11 = argc
+ *	r10 = &argv[0]
+ *	r9  = address of _init
+ *	r8  = address of _fini
+ *	sp[0] = whatever we got passed in r12
+ */
+
+#include <features.h>
+
+	.text
+	.global _start
+	.type	_start, @function
+_start:
+	/* Clear the frame pointer and link register since this is the outermost frame.  */
+	mov	r7, 0
+	mov	lr, 0
+
+	ld.w	r11, sp++		/* argc		*/
+	mov	r10, sp			/* &argv[0]	*/
+
+	st.w	--sp, r10		/* stack_end */
+	st.w	--sp, r12		/* rtld_fini */
+
+#ifdef __PIC__
+	lddpc	r6, .L_GOT
+.L_RGOT:
+	rsub	r6, pc
+	lda.w	r9, _init
+	lda.w	r8, _fini
+	lda.w	r12, main
+
+	/* Ok, now run uClibc's main() -- should not return */
+	call	__uClibc_main
+
+	.align	2
+.L_GOT:
+	.long	.L_RGOT - _GLOBAL_OFFSET_TABLE_
+#else
+	lddpc	r9, __init_addr		/* app_init */
+	lddpc	r8, __fini_addr		/* app_fini */
+	lddpc	r12, __main_addr	/* main */
+
+	/* Ok, now run uClibc's main() -- should not return */
+	lddpc	pc, ___uClibc_main_addr
+
+	.align	2
+__init_addr:
+	.long	_init
+__fini_addr:
+	.long	_fini
+__main_addr:
+	.long	main
+___uClibc_main_addr:
+	.long	__uClibc_main
+#endif
+	.size	_start, . - _start
+
+	/*
+	 * The LSB says we need this.
+	 */
+	.section ".note.ABI-tag", "a"
+	.align	4
+	.long	2f - 1f		/* namesz */
+	.long	4f - 3f		/* descsz */
+	.long	1		/* type   */
+1:	.asciz	"GNU"		/* name */
+2:	.align	4
+3:	.long	0		/* Linux executable */
+	.long	2,6,0		/* Earliest compatible kernel */
+4:	.align	4
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/crti.S b/ap/build/uClibc/libc/sysdeps/linux/avr32/crti.S
new file mode 100644
index 0000000..660f47c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/crti.S
@@ -0,0 +1,26 @@
+
+	.section .init
+	.align	2
+	.global	_init
+	.type	_init, @function
+_init:
+	stm	--sp, r6, lr
+	lddpc	r6, 2f
+1:	rsub	r6, pc
+	rjmp	3f
+	.align	2
+2:	.long	1b - _GLOBAL_OFFSET_TABLE_
+3:
+
+	.section .fini
+	.align	2
+	.global	_fini
+	.type	_fini, @function
+_fini:
+	stm	--sp, r6, lr
+	lddpc	r6, 2f
+1:	rsub	r6, pc
+	rjmp	3f
+	.align	2
+2:	.long	1b - _GLOBAL_OFFSET_TABLE_
+3:
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/avr32/crtn.S
new file mode 100644
index 0000000..c37f7d2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/crtn.S
@@ -0,0 +1,12 @@
+
+	.section .init
+	.align	2
+	.global	_init
+	.type	_init, @function
+	ldm	sp++, r6, pc
+
+	.section .fini
+	.align	2
+	.global _fini
+	.type	_fini, @function
+	ldm	sp++, r6, pc
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/avr32/mmap.c
new file mode 100644
index 0000000..dee88aa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/mmap.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2004-2007 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+
+static _syscall6(__ptr_t, mmap2, __ptr_t, addr, size_t, len, int, prot,
+		 int, flags, int, fd, __off_t, pgoff)
+
+__ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
+{
+	unsigned long page_size = sysconf(_SC_PAGESIZE);
+	unsigned long pgoff;
+
+	if (offset & (page_size - 1)) {
+		__set_errno(EINVAL);
+		return MAP_FAILED;
+	}
+
+	pgoff = (unsigned long)offset >> (31 - __builtin_clz(page_size));
+
+	return mmap2(addr, len, prot, flags, fd, pgoff);
+}
+libc_hidden_def(mmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/prctl.c b/ap/build/uClibc/libc/sysdeps/linux/avr32/prctl.c
new file mode 100644
index 0000000..4e146e3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/prctl.c
@@ -0,0 +1,36 @@
+/*
+ * prctl syscall for AVR32 Linux.
+ *
+ * Copyright (C) 2010 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#include <sys/syscall.h>
+#include <sys/prctl.h>
+#include <stdarg.h>
+
+#ifdef __NR_prctl
+#define __NR___syscall_prctl	__NR_prctl
+static inline _syscall5(int, __syscall_prctl, int, option, long, arg2,
+		long, arg3, long, arg4, long, arg5);
+
+int prctl(int __option, ...)
+{
+	long arg2;
+	long arg3;
+	long arg4;
+	long arg5;
+	va_list ap;
+
+	va_start(ap, __option);
+	arg2 = va_arg(ap, long);
+	arg3 = va_arg(ap, long);
+	arg4 = va_arg(ap, long);
+	arg5 = va_arg(ap, long);
+	va_end(ap);
+
+	return INLINE_SYSCALL(prctl, 5, __option, arg2, arg3, arg4, arg5);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/avr32/setjmp.S
new file mode 100644
index 0000000..7d0354b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/setjmp.S
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2004-2007 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+	.text
+
+	.global	__sigsetjmp
+	.type	__sigsetjmp,"function"
+
+	.align	1
+__sigsetjmp:
+	mustr	r8
+	stm	r12, r0,r1,r2,r3,r4,r5,r6,r7,r8,sp,lr
+
+	/*
+	 * Make a tail call to __sigjmp_save; it takes the same args
+	 * and is hidden so we don't need to mess around with the GOT.
+	 */
+	rjmp	__sigjmp_save
+	.size	__sigsetjmp, . - __sigsetjmp
+
+libc_hidden_def(__sigsetjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/avr32/sigaction.c
new file mode 100644
index 0000000..f5e586c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/sigaction.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2004-2007 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#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_rt_sa_restorer(void);
+
+extern __typeof(sigaction) __libc_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 = __default_rt_sa_restorer;
+		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));
+}
+
+#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/avr32/sigrestorer.S b/ap/build/uClibc/libc/sysdeps/linux/avr32/sigrestorer.S
new file mode 100644
index 0000000..df6a1ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/sigrestorer.S
@@ -0,0 +1,15 @@
+/*
+ * Copyright (C) 2004 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#include <sys/syscall.h>
+
+	.global	__default_rt_sa_restorer
+	.type	__default_rt_sa_restorer,"function"
+	.align	1
+__default_rt_sa_restorer:
+	mov	r8, __NR_rt_sigreturn
+	scall
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/sys/elf.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/sys/elf.h
new file mode 100644
index 0000000..faa7310
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/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/avr32/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/sys/procfs.h
new file mode 100644
index 0000000..3b37363
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/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/avr32/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/sys/ucontext.h
new file mode 100644
index 0000000..82c7fe2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/sys/ucontext.h
@@ -0,0 +1,90 @@
+/* Copyright (C) 1998, 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.  */
+
+/* Linux/AVR32 ABI compliant context switching support.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+#include <sys/procfs.h>
+#include <bits/sigcontext.h>
+
+typedef int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	16
+
+/* 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.  */
+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;   /* mask last for extensibility */
+} ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/avr32/sys/user.h
new file mode 100644
index 0000000..c0b3d38
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/sys/user.h
@@ -0,0 +1,46 @@
+#ifndef _SYS_USER_H
+#define _SYS_USER_H
+
+struct user_fpregs
+{
+
+};
+
+struct user_regs
+{
+	unsigned long sr;
+	unsigned long pc;
+	unsigned long lr;
+	unsigned long sp;
+	unsigned long r12;
+	unsigned long r11;
+	unsigned long r10;
+	unsigned long r9;
+	unsigned long r8;
+	unsigned long r7;
+	unsigned long r6;
+	unsigned long r5;
+	unsigned long r4;
+	unsigned long r3;
+	unsigned long r2;
+	unsigned long r1;
+	unsigned long r0;
+	unsigned long r12_orig;
+};
+
+struct user
+{
+	struct user_regs	regs;		/* general registers */
+	size_t			u_tsize;	/* text size (pages) */
+	size_t			u_dsize;	/* data size (pages) */
+	size_t			u_ssize;	/* stack size (pages) */
+	unsigned long		start_code;	/* text starting address */
+	unsigned long		start_data;	/* data starting address */
+	unsigned long		start_stack;	/* stack starting address */
+	long int		signal;		/* signal causing core dump */
+	struct user_regs *	u_ar0;		/* help gdb find registers */
+	unsigned long		magic;		/* identifies a core file */
+	char			u_comm[32];	/* user command name */
+};
+
+#endif /* _SYS_USER_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/syscall.S b/ap/build/uClibc/libc/sysdeps/linux/avr32/syscall.S
new file mode 100644
index 0000000..55c1b1f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/syscall.S
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2004-2007 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#include <features.h>
+
+	.text
+
+	/*
+	 * long int syscall(long int sysno, ...)
+	 */
+	.global	syscall
+	.type	syscall, @function
+	.align	2
+syscall:
+	stm	--sp, r3,r5,r6,lr
+	sub	lr, sp, -16
+	mov	r8, r12
+	ldm	lr, r3,r5,r9-r12
+	scall
+	cp.w	r12, -4095
+	brlo	.Ldone
+
+#ifdef __PIC__
+	lddpc	r6, .Lgot
+.Lgotcalc:
+	rsub	r6, pc
+# ifdef __UCLIBC_HAS_THREADS__
+	rsub	r3, r12, 0
+	mcall	r6[__errno_location@got]
+	st.w	r12[0], r3
+# else
+	ld.w	r3, r6[errno@got]
+	neg	r12
+	st.w	r3[0], r12
+# endif
+#else
+# ifdef __UCLIBC_HAS_THREADS__
+	rsub	r3, r12, 0
+	mcall	.Lerrno_location
+	st.w	r12[0], r3
+# else
+	lddpc	r3, .Lerrno
+	neg	r12
+	st.w	r3[0], r12
+# endif
+#endif
+	mov	r12, -1
+
+.Ldone:
+	ldm	sp++, r3,r5,r6,pc
+
+	.align	2
+#ifdef __PIC__
+.Lgot:
+	.long	.Lgotcalc - _GLOBAL_OFFSET_TABLE_
+#else
+# ifdef __UCLIBC_HAS_THREADS__
+.Lerrno_location:
+	.long	__errno_location
+# else
+.Lerrno:
+	.long	errno
+# endif
+#endif
+
+
+	.size	syscall, . - syscall
diff --git a/ap/build/uClibc/libc/sysdeps/linux/avr32/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/avr32/vfork.S
new file mode 100644
index 0000000..03ca99f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/avr32/vfork.S
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2005 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+
+/*
+ * Clone the process without copying the address space.  The
+ * calling process is suspended until the child either exits
+ * or calls execve.
+ *
+ * This all means that we cannot rely on the stack to store
+ * away registers, since they will be overwritten by the child
+ * as soon as it makes another function call (e.g. execve()).
+ * Fortunately, the Linux kernel preserves LR across system calls.
+ */
+
+#include <features.h>
+#include <sys/syscall.h>
+
+	.global	__vfork
+	.type	__vfork,@function
+	.align	1
+__vfork:
+	mov	r8, __NR_vfork
+	scall
+	cp.w	r12, -4096
+	retls	r12
+
+	/* vfork failed, so we may use the stack freely */
+	pushm	r4-r7,lr
+#ifdef __PIC__
+	lddpc	r6, .L_GOT
+	rsub	r4, r12, 0
+.L_RGOT:
+	rsub	r6, pc
+	mcall	r6[__errno_location@got]
+#else
+	rsub	r4, r12, 0
+	mcall	.L__errno_location
+#endif
+	st.w	r12[0], r4
+	popm	r4-r7,pc,r12=-1
+
+	.align	2
+#ifdef __PIC__
+.L_GOT:
+	.long	.L_RGOT - _GLOBAL_OFFSET_TABLE_
+#else
+.L__errno_location:
+	.long	__errno_location
+#endif
+	.size	__vfork, . - __vfork
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/Makefile b/ap/build/uClibc/libc/sysdeps/linux/bfin/Makefile
new file mode 100644
index 0000000..3970f62
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/Makefile
@@ -0,0 +1,13 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2006 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/bfin/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/bfin/Makefile.arch
new file mode 100644
index 0000000..425a688
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/Makefile.arch
@@ -0,0 +1,13 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+CSRC := bsdsetjmp.c clone.c \
+	sram-alloc.c sram-free.c dma-memcpy.c cacheflush.c
+
+SSRC := __longjmp.S setjmp.S bsd-_setjmp.S
+
+ARCH_HEADERS := bfin_fixed_code.h bfin_l1layout.h bfin_sram.h
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/bfin/__longjmp.S
new file mode 100644
index 0000000..b2fafbb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/__longjmp.S
@@ -0,0 +1,109 @@
+/* longjmp for the Blackfin project
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2004 Metrowerks
+ * Based on code from Analog Devices.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+.text
+.global ___longjmp;
+.type	___longjmp,STT_FUNC;
+.align 4;
+
+___longjmp:
+	P0 = R0;
+	R0 = [P0 + 0x00];
+	[--SP] = R0;		/* Put P0 on the stack */
+
+	P1 = [P0 + 0x04];
+	P2 = [P0 + 0x08];
+	P3 = [P0 + 0x0C];
+	P4 = [P0 + 0x10];
+	P5 = [P0 + 0x14];
+
+	FP = [P0 + 0x18];
+	R0 = [SP++];		/* Grab P0 from old stack */
+	SP = [P0 + 0x1C];	/* Update Stack Pointer */
+	[--SP] = R0;		/* Put P0 on new stack */
+	[--SP] = R1;		/* Put VAL arg on new stack */
+
+	R0 = [P0 + 0x20];	/* Data Registers */
+	R1 = [P0 + 0x24];
+	R2 = [P0 + 0x28];
+	R3 = [P0 + 0x2C];
+	R4 = [P0 + 0x30];
+	R5 = [P0 + 0x34];
+	R6 = [P0 + 0x38];
+	R7 = [P0 + 0x3C];
+
+	R0 = [P0 + 0x40];
+	ASTAT = R0;
+
+	R0 = [P0 + 0x44];	/* Loop Counters */
+	LC0 = R0;
+	R0 = [P0 + 0x48];
+	LC1 = R0;
+
+	R0 = [P0 + 0x4C];	/* Accumulators */
+	A0.W = R0;
+	R0 = [P0 + 0x50];
+	A0.X = R0;
+	R0 = [P0 + 0x54];
+	A1.W = R0;
+	R0 = [P0 + 0x58];
+	A1.X = R0;
+
+	R0 = [P0 + 0x5C];	/* Index Registers */
+	I0 = R0;
+	R0 = [P0 + 0x60];
+	I1 = R0;
+	R0 = [P0 + 0x64];
+	I2 = R0;
+	R0 = [P0 + 0x68];
+	I3 = R0;
+
+	R0 = [P0 + 0x6C];	/* Modifier Registers */
+	M0 = R0;
+	R0 = [P0 + 0x70];
+	M1 = R0;
+	R0 = [P0 + 0x74];
+	M2 = R0;
+	R0 = [P0 + 0x78];
+	M3 = R0;
+
+	R0 = [P0 + 0x7C];	/* Length Registers */
+	L0 = R0;
+	R0 = [P0 + 0x80];
+	L1 = R0;
+	R0 = [P0 + 0x84];
+	L2 = R0;
+	R0 = [P0 + 0x88];
+	L3 = R0;
+
+	R0 = [P0 + 0x8C];	/* Base Registers */
+	B0 = R0;
+	R0 = [P0 + 0x90];
+	B1 = R0;
+	R0 = [P0 + 0x94];
+	B2 = R0;
+	R0 = [P0 + 0x98];
+	B3 = R0;
+
+	R0 = [P0 + 0x9C];	/* Return Address (PC) */
+	RETS = R0;
+
+	R0 = [SP++];
+	P0 = [SP++];
+
+	CC = R0 == 0;
+	IF !CC JUMP .Lfinished;
+	R0 = 1;
+.Lfinished:
+	RTS;
+.size ___longjmp,.-___longjmp
+
+libc_hidden_def(__longjmp)
+
+.section .note.GNU-stack,"",%progbits
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bfin_fixed_code.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bfin_fixed_code.h
new file mode 100644
index 0000000..9142571
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bfin_fixed_code.h
@@ -0,0 +1,155 @@
+/* Atomic instructions for userspace.
+ *
+ * The actual implementations can be found in the kernel.
+ *
+ * Copyright (c) 2008 Analog Devices, Inc.
+ *
+ * Licensed under the LGPL v2.1.
+ */
+
+#ifndef __BFIN_FIXED_CODE_H__
+#define __BFIN_FIXED_CODE_H__
+
+#include <stdint.h>
+
+#include <asm/fixed_code.h>
+
+#ifndef __ASSEMBLY__
+
+static inline
+uint32_t bfin_atomic_xchg32(uint32_t *__bfin_ptr, uint32_t __bfin_newval)
+{
+	uint32_t __bfin_ret;
+	/* Input:    P0: memory address to use
+	 *           R1: value to store
+	 * Output:   R0: old contents of the memory address
+	 */
+	__asm__ __volatile__(
+		"CALL (%[__bfin_func])"
+		: "=q0" (__bfin_ret), "=m" (*__bfin_ptr)
+		: [__bfin_func] "a" (ATOMIC_XCHG32), "q1" (__bfin_newval),
+		  "qA" (__bfin_ptr), "m" (*__bfin_ptr)
+		: "RETS", "memory"
+	);
+	return __bfin_ret;
+}
+
+static inline
+uint32_t bfin_atomic_cas32(uint32_t *__bfin_ptr, uint32_t __bfin_exp, uint32_t __bfin_newval)
+{
+	uint32_t __bfin_ret;
+	/* Input:    P0: memory address to use
+	 *           R1: compare value
+	 *           R2: new value to store
+	 * Output:   R0: old contents of the memory address
+	 */
+	__asm__ __volatile__(
+		"CALL (%[__bfin_func])"
+		: "=q0" (__bfin_ret), "=m" (*__bfin_ptr)
+		: [__bfin_func] "a" (ATOMIC_CAS32), "q1" (__bfin_exp), "q2" (__bfin_newval),
+		  "qA" (__bfin_ptr), "m" (*__bfin_ptr)
+		: "RETS", "memory"
+	);
+	return __bfin_ret;
+}
+
+static inline
+uint32_t bfin_atomic_add32(uint32_t *__bfin_ptr, uint32_t __bfin_inc)
+{
+	uint32_t __bfin_ret;
+	/* Input:    P0: memory address to use
+	 *           R0: value to add
+	 * Output:   R0: new contents of the memory address
+	 *           R1: previous contents of the memory address
+	 */
+	__asm__ __volatile__(
+		"CALL (%[__bfin_func])"
+		: "=q0" (__bfin_ret), "=m" (*__bfin_ptr)
+		: [__bfin_func] "a" (ATOMIC_ADD32), "q0" (__bfin_inc),
+		  "qA" (__bfin_ptr), "m" (*__bfin_ptr)
+		: "R1", "RETS", "memory"
+	);
+	return __bfin_ret;
+}
+#define bfin_atomic_inc32(ptr) bfin_atomic_add32(ptr, 1)
+
+static inline
+uint32_t bfin_atomic_sub32(uint32_t *__bfin_ptr, uint32_t __bfin_dec)
+{
+	uint32_t __bfin_ret;
+	/* Input:    P0: memory address to use
+	 *           R0: value to subtract
+	 * Output:   R0: new contents of the memory address
+	 *           R1: previous contents of the memory address
+	 */
+	__asm__ __volatile__(
+		"CALL (%[__bfin_func])"
+		: "=q0" (__bfin_ret), "=m" (*__bfin_ptr)
+		: [__bfin_func] "a" (ATOMIC_SUB32), "q0" (__bfin_dec),
+		  "qA" (__bfin_ptr), "m" (*__bfin_ptr)
+		: "R1", "RETS", "memory"
+	);
+	return __bfin_ret;
+}
+#define bfin_atomic_dec32(ptr)        bfin_atomic_sub32(ptr, 1)
+
+static inline
+uint32_t bfin_atomic_ior32(uint32_t *__bfin_ptr, uint32_t __bfin_ior)
+{
+	uint32_t __bfin_ret;
+	/* Input:    P0: memory address to use
+	 *           R0: value to ior
+	 * Output:   R0: new contents of the memory address
+	 *           R1: previous contents of the memory address
+	 */
+	__asm__ __volatile__(
+		"CALL (%[__bfin_func])"
+		: "=q0" (__bfin_ret), "=m" (*__bfin_ptr)
+		: [__bfin_func] "a" (ATOMIC_IOR32), "q0" (__bfin_ior),
+		  "qA" (__bfin_ptr), "m" (*__bfin_ptr)
+		: "R1", "RETS", "memory"
+	);
+	return __bfin_ret;
+}
+
+static inline
+uint32_t bfin_atomic_and32(uint32_t *__bfin_ptr, uint32_t __bfin_and)
+{
+	uint32_t __bfin_ret;
+	/* Input:    P0: memory address to use
+	 *           R0: value to and
+	 * Output:   R0: new contents of the memory address
+	 *           R1: previous contents of the memory address
+	 */
+	__asm__ __volatile__(
+		"CALL (%[__bfin_func])"
+		: "=q0" (__bfin_ret), "=m" (*__bfin_ptr)
+		: [__bfin_func] "a" (ATOMIC_AND32), "q0" (__bfin_and),
+		  "qA" (__bfin_ptr), "m" (*__bfin_ptr)
+		: "R1", "RETS", "memory"
+	);
+	return __bfin_ret;
+}
+
+static inline
+uint32_t bfin_atomic_xor32(uint32_t *__bfin_ptr, uint32_t __bfin_xor)
+{
+	uint32_t __bfin_ret;
+	/* Input:    P0: memory address to use
+	 *           R0: value to xor
+	 * Output:   R0: new contents of the memory address
+	 *           R1: previous contents of the memory address
+	 */
+	__asm__ __volatile__(
+		"CALL (%[__bfin_func])"
+		: "=q0" (__bfin_ret), "=m" (*__bfin_ptr)
+		: [__bfin_func] "a" (ATOMIC_XOR32), "q0" (__bfin_xor),
+		  "qA" (__bfin_ptr), "m" (*__bfin_ptr)
+		: "R1", "RETS", "memory"
+	);
+	return __bfin_ret;
+}
+
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bfin_l1layout.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bfin_l1layout.h
new file mode 100644
index 0000000..00efd23
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bfin_l1layout.h
@@ -0,0 +1,17 @@
+#define L1_SCRATCH_START	0xFFB00000
+
+/* Data that is "mapped" into the process VM at the start of the L1 scratch
+   memory, so that each process can access it at a fixed address.  Used for
+   stack checking.  */
+struct l1_scratch_task_info
+{
+	/* Points to the start of the stack.  */
+	void *stack_start;
+	/* Not updated by the kernel; a user process can modify this to
+	   keep track of the lowest address of the stack pointer during its
+	   runtime.  */
+	void *lowest_sp;
+};
+
+/* A pointer to the structure in memory.  */
+#define L1_SCRATCH_TASK_INFO ((struct l1_scratch_task_info *)L1_SCRATCH_START)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bfin_sram.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bfin_sram.h
new file mode 100644
index 0000000..278514d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bfin_sram.h
@@ -0,0 +1,31 @@
+/*
+ * bfin_sram.h - userspace interface to L1 memory allocator
+ *
+ * Copyright (c) 2007 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __BFIN_SRAM_H__
+#define __BFIN_SRAM_H__
+
+#include <features.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+#define L1_INST_SRAM            0x00000001
+#define L1_DATA_A_SRAM          0x00000002
+#define L1_DATA_B_SRAM          0x00000004
+#define L1_DATA_SRAM            0x00000006
+#define L2_SRAM			0x00000008
+
+extern void *sram_alloc(size_t size, unsigned long flags)
+	__attribute_malloc__ __attribute_warn_unused_result__;
+extern int sram_free(const void *addr);
+extern void *dma_memcpy(void *dest, const void *src, size_t len)
+	__nonnull((1, 2));
+
+__END_DECLS
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/byteswap.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/byteswap.h
new file mode 100644
index 0000000..a727002
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/byteswap.h
@@ -0,0 +1,34 @@
+/* File: libc/sysdeps/linux/bfin/bits/byteswap.h
+ *
+ * Copyright 2004-2006 Analog Devices Inc.
+ *
+ * Enter bugs at http://blackfin.uclinux.org/
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef _ASM_BITS_BYTESWAP_H
+#define _ASM_BITS_BYTESWAP_H 1
+
+#define __bswap_non_constant_16(x) \
+     (__extension__							      \
+      ({ register unsigned short int __v;				      \
+	 __asm__ ("%0 = PACK (%1.L, %1.L);"				      \
+		  "%0 >>= 8;"						      \
+		  : "=d" (__v)						      \
+		  : "d" (x));						      \
+	 __v; }))
+
+#define __bswap_non_constant_32(x) \
+     (__extension__							      \
+      ({ register unsigned int __v;					      \
+	 __asm__ ("%1 = %0 >> 8 (V);"					      \
+		  "%0 = %0 << 8 (V);"					      \
+		  "%0 = %0 | %1;"					      \
+		  "%1 = PACK(%0.L, %0.H);"				      \
+		  : "+d"(x), "=&d"(__v));				      \
+	 __v; }))
+
+#endif
+
+#include <bits/byteswap-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/elf-fdpic.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/elf-fdpic.h
new file mode 100644
index 0000000..b7e87b8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/elf-fdpic.h
@@ -0,0 +1,115 @@
+/* Copyright 2003, 2004 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+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.)
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#ifndef _BITS_ELF_FDPIC_H
+#define _BITS_ELF_FDPIC_H
+
+/* These data structures are described in the FDPIC ABI extension.
+   The kernel passes a process a memory map, such that for every LOAD
+   segment there is an elf32_fdpic_loadseg entry.  A pointer to an
+   elf32_fdpic_loadmap is passed in GR8 at start-up, and a pointer to
+   an additional such map is passed in GR9 for the interpreter, when
+   there is one.  */
+
+#include <elf.h>
+
+/* This data structure represents a PT_LOAD segment.  */
+struct elf32_fdpic_loadseg
+{
+  /* Core address to which the segment is mapped.  */
+  Elf32_Addr addr;
+  /* VMA recorded in the program header.  */
+  Elf32_Addr p_vaddr;
+  /* Size of this segment in memory.  */
+  Elf32_Word p_memsz;
+};
+
+struct elf32_fdpic_loadmap {
+  /* Protocol version number, must be zero.  */
+  Elf32_Half version;
+  /* Number of segments in this map.  */
+  Elf32_Half nsegs;
+  /* The actual memory map.  */
+  struct elf32_fdpic_loadseg segs[/*nsegs*/];
+};
+
+struct elf32_fdpic_loadaddr {
+  struct elf32_fdpic_loadmap *map;
+  void *got_value;
+};
+
+/* Map a pointer's VMA to its corresponding address according to the
+   load map.  */
+static __always_inline void *
+__reloc_pointer (void *p,
+		 const struct elf32_fdpic_loadmap *map)
+{
+  int c;
+
+#if 0
+  if (map->version != 0)
+    /* Crash.  */
+    ((void(*)())0)();
+#endif
+
+  /* No special provision is made for NULL.  We don't want NULL
+     addresses to go through relocation, so they shouldn't be in
+     .rofixup sections, and, if they're present in dynamic
+     relocations, they shall be mapped to the NULL address without
+     undergoing relocations.  */
+
+  for (c = 0;
+       /* Take advantage of the fact that the loadmap is ordered by
+	  virtual addresses.  In general there will only be 2 entries,
+	  so it's not profitable to do a binary search.  */
+       c < map->nsegs && p >= (void*)map->segs[c].p_vaddr;
+       c++)
+    {
+      /* This should be computed as part of the pointer comparison
+	 above, but we want to use the carry in the comparison, so we
+	 can't convert it to an integer type beforehand.  */
+      unsigned long offset = p - (void*)map->segs[c].p_vaddr;
+      /* We only check for one-past-the-end for the last segment,
+	 assumed to be the data segment, because other cases are
+	 ambiguous in the absence of padding between segments, and
+	 rofixup already serves as padding between text and data.
+	 Unfortunately, unless we special-case the last segment, we
+	 fail to relocate the _end symbol.  */
+      if (offset < map->segs[c].p_memsz
+	  || (offset == map->segs[c].p_memsz && c + 1 == map->nsegs))
+	return (char*)map->segs[c].addr + offset;
+    }
+
+  /* We might want to crash instead.  */
+  return (void*)-1;
+}
+
+# define __RELOC_POINTER(ptr, loadaddr) \
+  (__reloc_pointer ((void*)(ptr), \
+		    (loadaddr).map))
+
+#endif /* _BITS_ELF_FDPIC_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/endian.h
new file mode 100644
index 0000000..8a36cf7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/endian.h
@@ -0,0 +1,7 @@
+/* Blackfin is Little-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/fcntl.h
new file mode 100644
index 0000000..f019b71
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/fcntl.h
@@ -0,0 +1,238 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   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.  */
+
+#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	/* don't 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_XOPEN2K
+# 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]FL.  */
+#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/bfin/bits/huge_val.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/huge_val.h
new file mode 100644
index 0000000..9c8b721
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/huge_val.h
@@ -0,0 +1,56 @@
+/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity).
+   Used by <stdlib.h> and <math.h> functions for overflow.
+   Blackfin 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__
+
+# define HUGE_VAL \
+  (__extension__							      \
+   ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
+    { __l: 0x000000007ff00000ULL }).__d)
+
+#else /* not GCC */
+
+# include <endian.h>
+
+typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
+
+# 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
+
+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/bfin/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/kernel_stat.h
new file mode 100644
index 0000000..7700d61
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/kernel_stat.h
@@ -0,0 +1,49 @@
+#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 {
+	unsigned short st_dev;
+	unsigned short __pad1;
+	unsigned long st_ino;
+	unsigned short st_mode;
+	unsigned short st_nlink;
+	unsigned short st_uid;
+	unsigned short st_gid;
+	unsigned short st_rdev;
+	unsigned short __pad2;
+	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 short	st_dev;
+	unsigned char	__pad0[10];
+#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 short	st_rdev;
+	unsigned char	__pad3[10];
+	long long	st_size;
+	unsigned long	st_blksize;
+	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
+	unsigned long	__pad4;		/* future possible st_blocks high bits */
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned long long	st_ino;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/kernel_types.h
new file mode 100644
index 0000000..9fec595
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/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_BFIN_POSIX_TYPES_H
+#define __ARCH_BFIN_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 int	__kernel_ipc_pid_t;
+typedef unsigned int	__kernel_uid_t;
+typedef unsigned int	__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_BFIN_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/setjmp.h
new file mode 100644
index 0000000..adb9c23
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/setjmp.h
@@ -0,0 +1,57 @@
+/* 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'.  bfin version.  Lineo, Inc. 2001*/
+#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 r7-r4, p5-p3, fp, sp and pc.  Other registers are not saved.  */
+typedef struct
+{
+	unsigned long __pregs[6];
+	unsigned long fp;
+	unsigned long sp;
+	unsigned long __rregs[8];
+	unsigned long astat;
+	unsigned long __lcregs[2];
+	unsigned long a0w;
+	unsigned long a0x;
+	unsigned long a1w;
+	unsigned long a1x;
+	unsigned long __iregs[4];
+	unsigned long __mregs[4];
+	unsigned long __lregs[4];
+	unsigned long __bregs[4];
+	unsigned long pc;
+}__jmp_buf[1];
+
+#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)->fp)
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/sigcontextinfo.h
new file mode 100644
index 0000000..b7e08cf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/sigcontextinfo.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>, 1998.
+
+   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 SIGCONTEXT int _code, struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS _code,
+#define GET_PC(ctx)	((void *) (ctx)->sc_pc)
+#define GET_FRAME(ctx)	((void *) __builtin_frame_address (1))
+#define GET_STACK(ctx)	((void *) (ctx)->sc_usp)
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/stackinfo.h
new file mode 100644
index 0000000..9e26de1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On blackfin the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/syscalls.h
new file mode 100644
index 0000000..da549ff
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/syscalls.h
@@ -0,0 +1,47 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\
+(__extension__ \
+ ({							\
+	long __res;					\
+	__asm__ __volatile__ (				\
+		"excpt 0;\n\t"				\
+		: "=q0" (__res)				\
+		: "qA"  (name) ASMFMT_##nr(args)	\
+		: "memory","CC");			\
+	__res;						\
+  }) \
+)
+#define ASMFMT_0()
+
+#define ASMFMT_1(arg1) \
+	, "q0" ((long)(arg1))
+
+#define ASMFMT_2(arg1, arg2) \
+	ASMFMT_1(arg1) \
+	, "q1" ((long)(arg2))
+
+#define ASMFMT_3(arg1, arg2, arg3) \
+	ASMFMT_2(arg1, arg2) \
+	, "q2" ((long)(arg3))
+
+#define ASMFMT_4(arg1, arg2, arg3, arg4) \
+	ASMFMT_3(arg1, arg2, arg3) \
+	, "q3" ((long)(arg4))
+
+#define ASMFMT_5(arg1, arg2, arg3, arg4, arg5) \
+	ASMFMT_4(arg1, arg2, arg3, arg4) \
+	, "q4" ((long)(arg5))
+
+#define ASMFMT_6(arg1, arg2, arg3, arg4, arg5, arg6) \
+	ASMFMT_5(arg1, arg2, arg3, arg4, arg5) \
+	, "q5" ((long)(arg6))
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/typesizes.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/typesizes.h
new file mode 100644
index 0000000..eb61fc9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/typesizes.h
@@ -0,0 +1,66 @@
+/* bits/typesizes.h -- underlying types for *_t.  Generic version.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef	_BITS_TYPESIZES_H
+#define	_BITS_TYPESIZES_H	1
+
+/* See <bits/types.h> for the meaning of these macros.  This file exists so
+   that <bits/types.h> need not vary across different GNU platforms.  */
+
+#define __DEV_T_TYPE		__UQUAD_TYPE
+#define __UID_T_TYPE		__U32_TYPE
+#define __GID_T_TYPE		__U32_TYPE
+#define __INO_T_TYPE		__ULONGWORD_TYPE
+#define __INO64_T_TYPE		__UQUAD_TYPE
+#define __MODE_T_TYPE		__U32_TYPE
+#define __NLINK_T_TYPE		__UWORD_TYPE
+#define __OFF_T_TYPE		__SLONGWORD_TYPE
+#define __OFF64_T_TYPE		__SQUAD_TYPE
+#define __PID_T_TYPE		__S32_TYPE
+#define __RLIM_T_TYPE		__ULONGWORD_TYPE
+#define __RLIM64_T_TYPE		__UQUAD_TYPE
+#define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
+#define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
+#define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
+#define	__ID_T_TYPE		__U32_TYPE
+#define __CLOCK_T_TYPE		__SLONGWORD_TYPE
+#define __TIME_T_TYPE		__SLONGWORD_TYPE
+#define __USECONDS_T_TYPE	__U32_TYPE
+#define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
+#define __DADDR_T_TYPE		__S32_TYPE
+#define __SWBLK_T_TYPE		__SLONGWORD_TYPE
+#define __KEY_T_TYPE		__S32_TYPE
+#define __CLOCKID_T_TYPE	__S32_TYPE
+#define __TIMER_T_TYPE		void *
+#define __BLKSIZE_T_TYPE	__SLONGWORD_TYPE
+#define __FSID_T_TYPE		struct { int __val[2]; }
+#define __SSIZE_T_TYPE		__SLONGWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'.  */
+#define	__FD_SETSIZE		1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..ce63c80
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/uClibc_arch_features.h
@@ -0,0 +1,47 @@
+/*
+ * 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__ ".short 2"	/* invalid 116bit insn */
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/bfin/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/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/bfin/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/bfin/bsd-_setjmp.S
new file mode 100644
index 0000000..c365b4e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bsd-_setjmp.S
@@ -0,0 +1,99 @@
+/* __setjmp for the Blackfin project
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2002, David McCullough <davidm@snapgear.com>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+.text
+.global __setjmp;
+.type	__setjmp,STT_FUNC;
+.align 4;
+
+__setjmp:
+	[--SP] = P0;	/* Save P0 */
+	P0 = R0;
+	R0 = [SP++];
+	[P0 + 0x00] = R0;	/* Save saved P0 */
+	[P0 + 0x04] = P1;
+	[P0 + 0x08] = P2;
+	[P0 + 0x0C] = P3;
+	[P0 + 0x10] = P4;
+	[P0 + 0x14] = P5;
+
+	[P0 + 0x18] = FP;	/* Frame Pointer */
+	[P0 + 0x1C] = SP;	/* Stack Pointer */
+
+	[P0 + 0x20] = P0;	/* Data Registers */
+	[P0 + 0x24] = R1;
+	[P0 + 0x28] = R2;
+	[P0 + 0x2C] = R3;
+	[P0 + 0x30] = R4;
+	[P0 + 0x34] = R5;
+	[P0 + 0x38] = R6;
+	[P0 + 0x3C] = R7;
+
+	R0 = ASTAT;
+	[P0 + 0x40] = R0;
+
+	R0 = LC0;		/* Loop Counters */
+	[P0 + 0x44] = R0;
+	R0 = LC1;
+	[P0 + 0x48] = R0;
+
+	R0 = A0.W;		/* Accumulators */
+	[P0 + 0x4C] = R0;
+	R0 = A0.X;
+	[P0 + 0x50] = R0;
+	R0 = A1.W;
+	[P0 + 0x54] = R0;
+	R0 = A1.X;
+	[P0 + 0x58] = R0;
+
+	R0 = I0;		/* Index Registers */
+	[P0 + 0x5C] = R0;
+	R0 = I1;
+	[P0 + 0x60] = R0;
+	R0 = I2;
+	[P0 + 0x64] = R0;
+	R0 = I3;
+	[P0 + 0x68] = R0;
+
+	R0 = M0;		/* Modifier Registers */
+	[P0 + 0x6C] = R0;
+	R0 = M1;
+	[P0 + 0x70] = R0;
+	R0 = M2;
+	[P0 + 0x74] = R0;
+	R0 = M3;
+	[P0 + 0x78] = R0;
+
+	R0 = L0;		/* Length Registers */
+	[P0 + 0x7c] = R0;
+	R0 = L1;
+	[P0 + 0x80] = R0;
+	R0 = L2;
+	[P0 + 0x84] = R0;
+	R0 = L3;
+	[P0 + 0x88] = R0;
+
+	R0 = B0;		/* Base Registers */
+	[P0 + 0x8C] = R0;
+	R0 = B1;
+	[P0 + 0x90] = R0;
+	R0 = B2;
+	[P0 + 0x94] = R0;
+	R0 = B3;
+	[P0 + 0x98] = R0;
+
+	R0 = RETS;
+	[P0 + 0x9C] = R0;
+
+	R0 = [P0 + 0x20];
+	R1 = 0;
+	JUMP.L ___sigjmp_save;
+
+.size __setjmp,.-__setjmp
+
+.section .note.GNU-stack,"",%progbits
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/bsdsetjmp.c b/ap/build/uClibc/libc/sysdeps/linux/bfin/bsdsetjmp.c
new file mode 100644
index 0000000..0a57d34
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/bsdsetjmp.c
@@ -0,0 +1,103 @@
+/* setjmp for the Blackfin project
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2003 Metrowerks
+ * Based on code from Analog Devices.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <setjmp.h>
+
+#undef setjmp
+
+int setjmp(jmp_buf env)
+{
+	__asm__ __volatile__(
+		"[--SP] = p0;\n\t"
+		"p0 = r0;\n\t"
+		"r0 = [SP++];\n\t"
+
+		"[p0++] = r0;\n\t"       /* GP address registers */
+		"[p0++] = p1;\n\t"
+		"[p0++] = p2;\n\t"
+		"[p0++] = p3;\n\t"
+		"[p0++] = p4;\n\t"
+		"[p0++] = p5;\n\t"
+
+		"[p0++] = FP;\n\t"       /* frame pointer */
+		"[p0++] = SP;\n\t"       /* stack pointer */
+
+		"[p0++] = p0;\n\t"       /* data regs */
+		"[p0++] = r1;\n\t"
+		"[p0++] = r2;\n\t"
+		"[p0++] = r3;\n\t"
+		"[p0++] = r4;\n\t"
+		"[p0++] = r5;\n\t"
+		"[p0++] = r6;\n\t"
+		"[p0++] = r7;\n\t"
+
+		"r0 = ASTAT;\n\t"
+		"[p0++] = r0;\n\t"
+
+		"r0 = LC0;\n\t"          /* loop counters */
+		"[p0++] = r0;\n\t"
+		"r0 = LC1;\n\t"
+		"[p0++] = r0;\n\t"
+
+		"r0 = A0.w;\n\t"
+		"[p0++] = r0;\n\t"
+		"r0.l = A0.x;\n\t"
+		"[p0++] = r0;\n\t"
+		"r0 = A1.w;\n\t"
+		"[p0++] = r0;\n\t"
+		"r0.l = A1.x;\n\t"
+		"[p0++] = r0;\n\t"
+
+                                 /* Dag regs */
+		"r0 = i0;\n\t"           /* index registers */
+		"[p0++] = r0;\n\t"
+		"r0 = i1;\n\t"
+		"[p0++] = r0;\n\t"
+		"r0 = i2;\n\t"
+		"[p0++] = r0;\n\t"
+		"r0 = i3;\n\t"
+		"[p0++] = r0;\n\t"
+
+		"r0 = m0;\n\t"           /* modifier registers */
+		"[p0++] = r0;\n\t"
+		"r0 = m1;\n\t"
+		"[p0++] = r0;\n\t"
+		"r0 = m2;\n\t"
+		"[p0++] = r0;\n\t"
+		"r0 = m3;\n\t"
+		"[p0++] = r0;\n\t"
+
+		"r0 = l0;\n\t"           /* length registers */
+		"[p0++] = r0;\n\t"
+		"r0 = l1;\n\t"
+		"[p0++] = r0;\n\t"
+		"r0 = l2;\n\t"
+		"[p0++] = r0;\n\t"
+		"r0 = l3;\n\t"
+		"[p0++] = r0;\n\t"
+
+		"r0 = b0;\n\t"           /* base registers */
+		"[p0++] = r0;\n\t"
+		"r0 = b1;\n\t"
+		"[p0++] = r0;\n\t"
+		"r0 = b2;\n\t"
+		"[p0++] = r0;\n\t"
+		"r0 = b3;\n\t"
+		"[p0++] = r0;\n\t"
+
+		"r0 = RETS;\n\t"         /* store return address */
+		"[p0++] = r0;\n\t"
+
+		"r0 = 0;\n\t"
+		:
+		:
+	);
+
+	return 0;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/cacheflush.c b/ap/build/uClibc/libc/sysdeps/linux/bfin/cacheflush.c
new file mode 100644
index 0000000..a8d81c4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/cacheflush.c
@@ -0,0 +1,14 @@
+/*
+ * cacheflush.c - Cache control functions for Blackfin.
+ *
+ * Copyright (C) 2010 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <errno.h>
+#include <sys/syscall.h>
+#include <sys/cachectl.h>
+
+_syscall3 (int, cacheflush, void *, start, const int, nbytes, const int, flags)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/clone.c b/ap/build/uClibc/libc/sysdeps/linux/bfin/clone.c
new file mode 100644
index 0000000..067fdc7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/clone.c
@@ -0,0 +1,45 @@
+/*
+ * libc/sysdeps/linux/bfin/clone.c -- `clone' syscall for linux/blackfin
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sched.h>
+#include <errno.h>
+#include <sys/syscall.h>
+
+int
+clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg, ...)
+{
+	long rval = -1;
+
+	if (fn && child_stack) {
+
+		__asm__ __volatile__ (
+			"excpt 0;"	/* Call sys_clone */
+			"cc = r0 == 0;"
+			"if !cc jump 1f;"	/* if (rval != 0) skip to parent */
+			"r0 = %4;"
+			"p0 = %5;"
+			"fp = 0;"
+#ifdef __BFIN_FDPIC__
+			"p1 = [p0];"
+			"p3 = [p0 + 4];"
+			"call (p1);"	/* Call cloned function */
+#else
+			"call (p0);"	/* Call cloned function */
+#endif
+			"p0 = %6;"
+			"excpt 0;"	/* Call sys_exit */
+			"1: nop;"
+			: "=q0" (rval)
+			: "qA" (__NR_clone), "q1" (child_stack), "q0" (flags), "a" (arg), "a" (fn), "i" (__NR_exit)
+			: "CC");
+
+	} else
+		__set_errno(EINVAL);
+
+	return rval;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/bfin/crt1.S
new file mode 100644
index 0000000..22b2b76
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/crt1.S
@@ -0,0 +1,168 @@
+/* Copyright (C) 1991, 1992 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 Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+
+/* When we enter this piece of code, the user stack looks like this:
+*      argc            argument counter (integer)
+*      argv[0]         program name (pointer)
+*      argv[1...N]     program args (pointers)
+*      NULL
+*      env[0...N]      environment variables (pointers)
+*      NULL
+	
+*   When we are done here, we want
+*	R0=argc
+*	R1=*argv[0]
+*	R2=*envp[0]  
+*/
+
+#include <features.h>
+
+#undef USE_GOT
+#if defined (__UCLIBC_FORMAT_SHARED_FLAT__) || defined (__UCLIBC_FORMAT_FLAT_SEP_DATA__)
+#define USE_GOT
+#endif
+
+#if !(defined L_Scrt1 && defined __UCLIBC_FORMAT_SHARED_FLAT__)
+
+.text
+.align 2
+.global __start;
+.type	__start,STT_FUNC;
+.weak	__init;
+.weak	__fini;
+.global	___uClibc_main;
+.type	___uClibc_main,STT_FUNC;
+
+/* Stick in a dummy reference to main(), so that if an application
+ * is linking when the main() function is in a static library (.a)
+ * we can be sure that main() actually gets linked in */
+
+.type	_main,STT_FUNC;
+
+__start:
+
+#if defined(__BFIN_FDPIC__) && !defined(L_Scrt1)
+	/* P0 contains a pointer to the program's load map.  */
+	call	.Lcall;
+.Lcall:
+	R4 = RETS;
+	SP += -12;
+	R0.L = .Lcall;
+	R0.H = .Lcall;
+	R1.L = __ROFIXUP_LIST__;
+	R1.H = __ROFIXUP_LIST__;
+	R2.L = __ROFIXUP_END__;
+	R2.H = __ROFIXUP_END__;
+	R1 = R1 - R0;
+	R1 = R1 + R4;
+	R2 = R2 - R0;
+	R2 = R2 + R4;
+	R0 = P0;
+	CALL	___self_reloc;
+	SP += 12;
+	P3 = R0;
+#endif
+
+/*	clear the frame pointer and the L registers.  */
+	FP = 0;
+	L0 = 0;
+	L1 = 0;
+	L2 = 0;
+	L3 = 0;
+
+#ifdef __ID_SHARED_LIB__
+	/* We know we have a local copy, so we can avoid the GOT.  */
+	CALL ___shared_flat_add_library;
+#endif
+/*	Load register R1 (argc) from the stack to its final resting place */
+	P0 = SP;
+	R1 = [P0++];
+
+/*	Copy argv pointer into R2 -- which its final resting place */
+	R2 = P0;
+
+	SP += -28;
+
+#ifndef __BFIN_FDPIC__
+	R7 = 0;
+#endif
+	/* Pass highest stack pointer to the app.  */
+	[SP + 24] = P2;
+	/* Store the pointer to ld.so's fini that we got in P1.  */
+	[SP + 20] = R7;
+
+/*	Ok, now run uClibc's main() -- shouldn't return */
+#if (defined L_crt1 || defined L_Scrt1) && defined __UCLIBC_CTOR_DTOR__
+
+#ifdef __BFIN_FDPIC__
+	R3 = [P3 + __init@FUNCDESC_GOT17M4];
+#elif defined USE_GOT
+	R3 = [P5 + ___shared_flat_init@GOT];
+#else
+	R3.H = __init;
+	R3.L = __init;
+#endif
+	[SP+12] = R3;
+
+
+#ifdef __BFIN_FDPIC__
+	R3 = [P3 + __fini@FUNCDESC_GOT17M4];
+#elif defined USE_GOT
+	R3 = [P5 + ___shared_flat_fini@GOT];
+#else	
+	R3.H = __fini;
+	R3.L = __fini;
+#endif
+	[SP+16] = R3;
+#else /* no ctor/dtor handling */
+	R3 = 0;
+	[SP + 12] = R3;
+	[SP + 16] = R3;
+#endif
+
+#ifdef __BFIN_FDPIC__
+	R0 = [P3 + _main@FUNCDESC_GOT17M4];
+#elif defined USE_GOT
+	R0 = [P5 + _main@GOT];
+#else
+	R0.H = _main;
+	R0.L = _main;
+#endif
+#ifdef USE_GOT
+	P0 = [P5 + ___uClibc_main@GOT];
+	jump (P0)
+#else
+	jump.l	___uClibc_main;
+#endif
+
+#else
+	.text
+	.global lib_main
+	.hidden lib_main
+	.type lib_main,@function
+lib_main:
+	RETS = [SP++];
+	/* We know we have a local copy, so we can avoid the GOT.  */
+	JUMP.L ___shared_flat_add_library;
+
+	.hidden _current_shared_library_p5_offset_
+#endif
+
+.section .note.GNU-stack,"",%progbits
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/crti.S b/ap/build/uClibc/libc/sysdeps/linux/bfin/crti.S
new file mode 100644
index 0000000..f2831cc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/crti.S
@@ -0,0 +1,64 @@
+/* Specialized code needed to support construction and destruction of
+   file-scope objects in C++ and Java code, and to support exception handling.
+   Copyright (C) 1999 Free Software Foundation, Inc.
+   Contributed by Charles-Antoine Gauthier (charles.gauthier@iit.nrc.ca).
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, if you link this library with files
+   compiled with GCC to produce an executable, this does not cause
+   the resulting executable to be covered by the GNU General Public License.
+   This exception does not however invalidate any other reasons why
+   the executable file might be covered by the GNU General Public License.  */
+
+/*
+ * This file just supplies function prologues for the .init and .fini
+ * sections.  It is linked in before crtbegin.o.
+ */
+
+	.file   "crti.o"
+	.ident  "GNU C crti.o"
+
+	.section .init
+	.globl  __init
+	.type   __init,@function
+__init:
+#if defined __ID_SHARED_LIB__
+	[--SP] = P5;
+#elif defined __BFIN_FDPIC__
+	[--SP] = P3; 
+#endif
+	LINK 12;
+#if defined __ID_SHARED_LIB__
+	P5 = [P5 + _current_shared_library_p5_offset_]
+#endif	
+	.section .fini
+	.globl  __fini
+	.type   __fini,@function
+__fini:
+#if defined __ID_SHARED_LIB__
+	[--SP] = P5; 
+#elif defined __BFIN_FDPIC__
+	[--SP] = P3; 
+#endif
+	LINK 12; 
+#if defined __ID_SHARED_LIB__
+	P5 = [P5 + _current_shared_library_p5_offset_]
+#endif	
+
+.section .note.GNU-stack,"",%progbits
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/bfin/crtn.S
new file mode 100644
index 0000000..a35ebe0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/crtn.S
@@ -0,0 +1,55 @@
+/* Specialized code needed to support construction and destruction of
+   file-scope objects in C++ and Java code, and to support exception handling.
+   Copyright (C) 1999 Free Software Foundation, Inc.
+   Contributed by Charles-Antoine Gauthier (charles.gauthier@iit.nrc.ca).
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, if you link this library with files
+   compiled with GCC to produce an executable, this does not cause
+   the resulting executable to be covered by the GNU General Public License.
+   This exception does not however invalidate any other reasons why
+   the executable file might be covered by the GNU General Public License.  */
+
+/*
+ * This file supplies function epilogues for the .init and .fini sections.
+ * It is linked in after all other files.
+ */
+
+	.file   "crtn.o"
+	.ident  "GNU C crtn.o"
+
+	.section .init
+	unlink; 
+#if defined __ID_SHARED_LIB__
+	P5 = [SP++];
+#elif defined __BFIN_FDPIC__
+	P3 = [SP++];
+#endif
+	rts;
+
+	.section .fini
+	unlink;
+#if defined __ID_SHARED_LIB__
+	P5 = [SP++];
+#elif defined __BFIN_FDPIC__
+	P3 = [SP++];
+#endif
+	rts;
+
+.section .note.GNU-stack,"",%progbits
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/crtreloc.c b/ap/build/uClibc/libc/sysdeps/linux/bfin/crtreloc.c
new file mode 100644
index 0000000..a44b50b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/crtreloc.c
@@ -0,0 +1,145 @@
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   written by Alexandre Oliva <aoliva@redhat.com>
+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.)
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#ifdef __BFIN_FDPIC__
+
+#include <sys/types.h>
+#include <link.h>
+
+/* This file is to be compiled into crt object files, to enable
+   executables to easily self-relocate.  */
+
+union word {
+    char c[4];
+    void *v;
+};
+
+/* Compute the runtime address of pointer in the range [p,e), and then
+   map the pointer pointed by it.  */
+static __always_inline void ***
+reloc_range_indirect (void ***p, void ***e,
+		      const struct elf32_fdpic_loadmap *map)
+{
+  while (p < e)
+    {
+      if (*p != (void **)-1)
+	{
+	  void *ptr = __reloc_pointer (*p, map);
+	  if (ptr != (void *)-1)
+	    {
+	      void *pt;
+	      if ((long)ptr & 3)
+		{
+		  unsigned char *c = ptr;
+		  int i;
+		  unsigned long v = 0;
+		  for (i = 0; i < 4; i++)
+		    v |= c[i] << 8 * i;
+		  pt = (void *)v;
+		}
+	      else
+		pt = *(void**)ptr;
+	      pt = __reloc_pointer (pt, map);
+	      if ((long)ptr & 3)
+		{
+		  unsigned char *c = ptr;
+		  int i;
+		  unsigned long v = (unsigned long)pt;
+		  for (i = 0; i < 4; i++, v >>= 8)
+		    c[i] = v;
+		}
+	      else
+		*(void**)ptr = pt;
+	    }
+	}
+      p++;
+    }
+  return p;
+}
+
+/* Call __reloc_range_indirect for the given range except for the last
+   entry, whose contents are only relocated.  It's expected to hold
+   the GOT value.  */
+attribute_hidden void*
+__self_reloc (const struct elf32_fdpic_loadmap *map,
+	      void ***p, void ***e)
+{
+  p = reloc_range_indirect (p, e-1, map);
+
+  if (p >= e)
+    return (void*)-1;
+
+  return __reloc_pointer (*p, map);
+}
+
+#if 0
+/* These are other functions that might be useful, but that we don't
+   need.  */
+
+/* Remap pointers in [p,e).  */
+static __always_inline void**
+reloc_range (void **p, void **e,
+	     const struct elf32_fdpic_loadmap *map)
+{
+  while (p < e)
+    {
+      *p = __reloc_pointer (*p, map);
+      p++;
+    }
+  return p;
+}
+
+/* Remap p, adjust e by the same offset, then map the pointers in the
+   range determined by them.  */
+void attribute_hidden
+__reloc_range (const struct elf32_fdpic_loadmap *map,
+	       void **p, void **e)
+{
+  void **old = p;
+
+  p = __reloc_pointer (p, map);
+  e += p - old;
+  reloc_range (p, e, map);
+}
+
+/* Remap p, adjust e by the same offset, then map pointers referenced
+   by the (unadjusted) pointers in the range.  Return the relocated
+   value of the last pointer in the range.  */
+void* attribute_hidden
+__reloc_range_indirect (const struct elf32_fdpic_loadmap *map,
+			void ***p, void ***e)
+{
+  void ***old = p;
+
+  p = __reloc_pointer (p, map);
+  e += p - old;
+  return reloc_range_indirect (p, e, map);
+}
+#endif
+
+#endif /* __BFIN_FDPIC__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/dma-memcpy.c b/ap/build/uClibc/libc/sysdeps/linux/bfin/dma-memcpy.c
new file mode 100644
index 0000000..b715aeb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/dma-memcpy.c
@@ -0,0 +1,6 @@
+#include <unistd.h>
+#include <errno.h>
+#include <sys/syscall.h>
+#include <bfin_sram.h>
+
+_syscall3 (void *, dma_memcpy, void *, dest, const void *, src, size_t, len)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/bfin/setjmp.S
new file mode 100644
index 0000000..a2b6176
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/setjmp.S
@@ -0,0 +1,98 @@
+/* setjmp for the Blackfin project
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2003 Metrowerks
+ * Based on code from Analog Devices.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+.text
+.global ___sigsetjmp;
+.type	___sigsetjmp,STT_FUNC;
+.align 4;
+
+___sigsetjmp:
+	[--SP] = P0;	/* Save P0 */
+	P0 = R0;
+	R0 = [SP++];
+	[P0 + 0x00] = R0;	/* Save saved P0 */
+	[P0 + 0x04] = P1;
+	[P0 + 0x08] = P2;
+	[P0 + 0x0C] = P3;
+	[P0 + 0x10] = P4;
+	[P0 + 0x14] = P5;
+
+	[P0 + 0x18] = FP;	/* Frame Pointer */
+	[P0 + 0x1C] = SP;	/* Stack Pointer */
+
+	[P0 + 0x20] = P0;	/* Data Registers */
+	[P0 + 0x24] = R1;
+	[P0 + 0x28] = R2;
+	[P0 + 0x2C] = R3;
+	[P0 + 0x30] = R4;
+	[P0 + 0x34] = R5;
+	[P0 + 0x38] = R6;
+	[P0 + 0x3C] = R7;
+
+	R0 = ASTAT;
+	[P0 + 0x40] = R0;
+
+	R0 = LC0;		/* Loop Counters */
+	[P0 + 0x44] = R0;
+	R0 = LC1;
+	[P0 + 0x48] = R0;
+
+	R0 = A0.W;		/* Accumulators */
+	[P0 + 0x4C] = R0;
+	R0 = A0.X;
+	[P0 + 0x50] = R0;
+	R0 = A1.W;
+	[P0 + 0x54] = R0;
+	R0 = A1.X;
+	[P0 + 0x58] = R0;
+
+	R0 = I0;		/* Index Registers */
+	[P0 + 0x5C] = R0;
+	R0 = I1;
+	[P0 + 0x60] = R0;
+	R0 = I2;
+	[P0 + 0x64] = R0;
+	R0 = I3;
+	[P0 + 0x68] = R0;
+
+	R0 = M0;		/* Modifier Registers */
+	[P0 + 0x6C] = R0;
+	R0 = M1;
+	[P0 + 0x70] = R0;
+	R0 = M2;
+	[P0 + 0x74] = R0;
+	R0 = M3;
+	[P0 + 0x78] = R0;
+
+	R0 = L0;		/* Length Registers */
+	[P0 + 0x7c] = R0;
+	R0 = L1;
+	[P0 + 0x80] = R0;
+	R0 = L2;
+	[P0 + 0x84] = R0;
+	R0 = L3;
+	[P0 + 0x88] = R0;
+
+	R0 = B0;		/* Base Registers */
+	[P0 + 0x8C] = R0;
+	R0 = B1;
+	[P0 + 0x90] = R0;
+	R0 = B2;
+	[P0 + 0x94] = R0;
+	R0 = B3;
+	[P0 + 0x98] = R0;
+
+	R0 = RETS;
+	[P0 + 0x9C] = R0;
+
+	R0 = [P0 + 0x20];
+	JUMP.L ___sigjmp_save; 
+.size ___sigsetjmp, .-___sigsetjmp
+
+.section .note.GNU-stack,"",%progbits
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/sram-alloc.c b/ap/build/uClibc/libc/sysdeps/linux/bfin/sram-alloc.c
new file mode 100644
index 0000000..8518119
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/sram-alloc.c
@@ -0,0 +1,6 @@
+#include <unistd.h>
+#include <errno.h>
+#include <sys/syscall.h>
+#include <bfin_sram.h>
+
+_syscall2 (__ptr_t, sram_alloc, size_t, len, unsigned long, flags)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/sram-free.c b/ap/build/uClibc/libc/sysdeps/linux/bfin/sram-free.c
new file mode 100644
index 0000000..8260eb6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/sram-free.c
@@ -0,0 +1,6 @@
+#include <unistd.h>
+#include <errno.h>
+#include <sys/syscall.h>
+#include <bfin_sram.h>
+
+_syscall1 (int, sram_free, const void *, addr)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/cachectl.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/cachectl.h
new file mode 100644
index 0000000..ee4c031
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/cachectl.h
@@ -0,0 +1,25 @@
+/*
+ * cachectl.h - Functions for cache control on Blackfin.
+ *
+ * Copyright (C) 2010 Analog Devices, Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#ifndef _SYS_CACHECTL_H
+#define _SYS_CACHECTL_H	1
+
+#include <features.h>
+
+/*
+ * Get the kernel definition for the flag bits
+ */
+#include <asm/cachectl.h>
+
+__BEGIN_DECLS
+
+extern int cacheflush (void *addr, __const int nbytes, __const int flags);
+
+__END_DECLS
+
+#endif	/* sys/cachectl.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/elf.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/elf.h
new file mode 100644
index 0000000..d959cdc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/elf.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 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 _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/bfin/sys/io.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/io.h
new file mode 100644
index 0000000..81762be
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/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/bfin/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/procfs.h
new file mode 100644
index 0000000..45a65f3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/procfs.h
@@ -0,0 +1,125 @@
+/* Copyright (C) 1996, 1997, 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_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_struct' 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_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers.  Empty on the Blackfin.  */
+typedef struct { } 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/bfin/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/ucontext.h
new file mode 100644
index 0000000..ac2ef94
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/ucontext.h
@@ -0,0 +1,152 @@
+/* Copyright (C) 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.  */
+
+/* System V/blackfin ABI compliant context switching support.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* Type for general register.  */
+typedef int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	47
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+/* Number of each register is the `gregset_t' array.  */
+enum
+{
+  REG_R0 = 0,
+#define REG_R0	REG_R0
+  REG_R1 = 1,
+#define REG_R1	REG_R1
+  REG_R2 = 2,
+#define REG_R2	REG_R2
+  REG_R3 = 3,
+#define REG_R3	REG_R3
+  REG_R4 = 4,
+#define REG_R4	REG_R4
+  REG_R5 = 5,
+#define REG_R5	REG_R5
+  REG_R6 = 6,
+#define REG_R6	REG_R6
+  REG_R7 = 7,
+#define REG_R7	REG_R7
+  REG_P0 = 8,
+#define REG_P0	REG_P0
+  REG_P1 = 9,
+#define REG_P1	REG_P1
+  REG_P2 = 10,
+#define REG_P2	REG_P2
+  REG_P3 = 11,
+#define REG_P3	REG_P3
+  REG_P4 = 12,
+#define REG_P4	REG_P4
+  REG_P5 = 13,
+#define REG_P5	REG_P5
+  REG_USP = 14,
+#define REG_USP	REG_USP
+  REG_A0W = 15,
+#define REG_A0W	REG_A0W
+  REG_A1W = 16,
+#define REG_A1W	REG_A1W
+  REG_A0X = 17,
+#define REG_A0X	REG_A0X
+  REG_A1X = 18,
+#define REG_A1X	REG_A1X
+  REG_ASTAT = 19,
+#define REG_ASTAT	REG_ASTAT
+  REG_RETS = 20,
+#define REG_RETS	REG_RETS
+  REG_PC= 21,
+#define REG_PC	REG_PC
+  REG_RETX = 22,
+#define REG_RETX	REG_RETX
+  REG_FP = 23,
+#define REG_FP	REG_FP
+  REG_I0 = 24,
+#define REG_I0	REG_I0
+  REG_I1 = 25,
+#define REG_I1	REG_I1
+  REG_I2 = 26,
+#define REG_I2	REG_I2
+  REG_I3 = 27,
+#define REG_I3	REG_I3
+  REG_M0 = 28,
+#define REG_M0	REG_M0
+  REG_M1 = 29,
+#define REG_M1	REG_M1
+  REG_M2 = 30,
+#define REG_M2	REG_M2
+  REG_M3 = 31,
+#define REG_M3	REG_M3
+  REG_L0 = 32,
+#define REG_L0	REG_L0
+  REG_L1 = 33,
+#define REG_L1	REG_L1
+  REG_L2 = 34,
+#define REG_L2	REG_L2
+  REG_L3 = 35,
+#define REG_L3	REG_L3
+  REG_B_0 = 36,
+#define REG_B0	REG_B0
+  REG_B1 = 37,
+#define REG_B1	REG_B1
+  REG_B2 = 38,
+#define REG_B2	REG_B2
+  REG_B3 = 39,
+#define REG_B3	REG_B3
+  REG_LC0 = 40,
+#define REG_LC0	REG_LC0
+  REG_LC1 = 41,
+#define REG_LC1	REG_LC1
+  REG_LT0 = 42,
+#define REG_LT0	REG_LT0
+  REG_LT1 = 43,
+#define REG_LT1	REG_LT1
+  REG_LB0 = 44,
+#define REG_LB0	REG_LB0
+  REG_LB1 = 45,
+#define REG_LB1	REG_LB1
+  REG_SEQSTAT = 46
+#define	REG_SEQSTAT	REG_SEQSTAT
+};
+
+/* Context to describe whole processor state.  */
+typedef struct
+{
+  gregset_t gregs;
+} mcontext_t;
+
+
+/* Userlevel context.  */
+typedef struct ucontext
+{
+  unsigned long int uc_flags;
+  struct ucontext *uc_link;
+  stack_t uc_stack;
+  mcontext_t uc_mcontext;
+  __sigset_t uc_sigmask;
+} ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/user.h
new file mode 100644
index 0000000..558abd6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/sys/user.h
@@ -0,0 +1,57 @@
+#ifndef _SYS_USER_H
+#define _SYS_USER_H
+
+struct user_bfinfp_struct {
+};
+
+/* This is the old layout of "struct pt_regs" as of Linux 1.x, and
+   is still the layout used by user (the new pt_regs doesn't have
+   all registers). */
+struct user_regs_struct {
+	long r0, r1, r2, r3, r4, r5, r6, r7;
+	long p0, p1, p2, p3, p4, p5, usp, fp;
+	long i0, i1, i2, i3;
+	long l0, l1, l2, l3;
+	long b0, b1, b2, b3;
+	long m0, m1, m2, m3;
+	long a0w, a1w;
+	long a0x, a1x;
+	unsigned long rets;
+	unsigned long astat;
+	unsigned long pc;
+	unsigned long orig_p0;
+};
+
+/* When the kernel dumps core, it starts by dumping the user struct -
+   this will be used by gdb to figure out where the data and stack segments
+   are within the file, and what virtual addresses to use. */
+
+struct user {
+/* We start with the registers, to mimic the way that "memory" is returned
+   from the ptrace(3,...) function.  */
+
+	struct user_regs_struct regs;	/* Where the registers are actually stored */
+
+/* The rest of this junk is to help gdb figure out what goes where */
+	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 area.
+					   This is actually the bottom of the stack,
+					   the top of the stack is always found in the
+					   esp register.  */
+	long int signal;	/* Signal that caused the core dump. */
+	int reserved;		/* No longer used */
+	unsigned long u_ar0;
+	/* Used by gdb to help find the values for */
+	/* the registers. */
+	unsigned long magic;	/* To uniquely identify a core file */
+	char u_comm[32];	/* User command that was responsible */
+};
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/bfin/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/bfin/sysdep.h
new file mode 100644
index 0000000..352fbf4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/bfin/sysdep.h
@@ -0,0 +1,21 @@
+/*
+ * libc/sysdeps/linux/bfin/sysdep.h
+ *
+ * Copyright (C) 2007 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#ifndef __BFIN_SYSDEP_H__
+#define __BFIN_SYSDEP_H__
+
+#include <common/sysdep.h>
+
+#ifdef __ASSEMBLER__
+
+#define ENTRY(sym) .global sym; .type sym, STT_FUNC; sym:
+#define ENDPROC(sym) .size sym, . - sym
+
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/Makefile b/ap/build/uClibc/libc/sysdeps/linux/c6x/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/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/c6x/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/c6x/Makefile.arch
new file mode 100644
index 0000000..6bb44f2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/Makefile.arch
@@ -0,0 +1,10 @@
+# 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 pread_write.c syscall.c prctl.c
+
+SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S _vfork.S
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/c6x/__longjmp.S
new file mode 100644
index 0000000..b9d9f9d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/__longjmp.S
@@ -0,0 +1,47 @@
+ ;
+ ; Port of uClibc for TMS320C6000 DSP architecture
+ ; Copyright (C) 2004 Texas Instruments Incorporated
+ ; Author of TMS320C6000 port: Aurelien Jacquiot
+ ;
+ ; This program is free software; you can redistribute it and/or modify it
+ ; under the terms of the GNU Library General Public License as published by
+ ; the Free Software Foundation; either version 2 of the License, or (at your
+ ; option) any later version.
+ ;
+ ; This program is distributed in the hope that it will be useful, but WITHOUT
+ ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ ; for more details.
+ ;
+ ; You should have received a copy of the GNU Library General Public License
+ ; along with this program; if not, write to the Free Software Foundation,
+ ; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ ;
+
+	.global __longjmp
+
+__longjmp:
+	LDW .D1T1    *+A4(48),A3	; return address
+	MV .D2X     A4,B6		; jmp_buf pointer
+||	MV .D1     A4,A6
+||	MV .S2     B4,B2		; val
+
+	LDW .D1T1    *+A6(0),A10
+||	LDW .D2T2    *+B6(4),B10
+|| [B2]	MV .S1X     B4,A4
+||[!B2]	MVK .L1    1,A4			;  return val or 1
+
+	LDW .D1T1    *+A6(8),A11
+||	LDW .D2T2    *+B6(12),B11
+	LDW .D1T1    *+A6(16),A12
+||	LDW .D2T2    *+B6(20),B12
+	LDW .D1T1    *+A6(24),A13
+||	LDW .D2T2    *+B6(28),B13
+	LDW .D1T1    *+A6(32),A14
+||	LDW .D2T2    *+B6(36),B14
+	LDW .D1T1    *+A6(40),A15
+||	LDW .D2T2    *+B6(44),B15
+||	B .S2X	A3
+	NOP    5
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/_vfork.S b/ap/build/uClibc/libc/sysdeps/linux/c6x/_vfork.S
new file mode 100644
index 0000000..d64dc50
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/_vfork.S
@@ -0,0 +1,66 @@
+/*
+ * Port of uClibc for TMS320C6000 DSP architecture
+ * Copyright (C) 2004, 2011 Texas Instruments Incorporated
+ * Author of TMS320C6000 port: Aurelien Jacquiot
+ *
+ *   Use clone syscall: Mark Salter <msalter@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#define __ASSEMBLY__
+
+#include <asm/errno.h>
+#include <sys/syscall.h>
+#include <linux/sched.h>
+#include <asm/signal.h>
+
+#define CLONE_FLAGS (CLONE_VFORK | CLONE_VM | SIGCHLD)
+	
+	.global __vfork
+__vfork:
+	MVK	.S2	SYS_clone,B0
+ ||	MVKL	.S1	CLONE_FLAGS,A4
+	MVKH	.S1	CLONE_FLAGS,A4
+ ||	MVK	.L2	0,B4
+#ifndef	_TMS320C6400_PLUS
+	MVC	.S2	CSR,B2
+	CLR	.S2	B2,0,0,B1
+	MVC	.S2	B1,CSR
+	MVC	.S2	IFR,B1
+	SET	.S2	B1,6,6,B1
+	MVC	.S2	B1,ISR
+	MVC	.S2	B2,CSR
+	NOP
+#else
+	SWE
+#endif
+
+	MVK	.S2	-4096,B4
+	CMPGTU	.L2X	B4,A4,B2	; check error
+  [B2]	BNOP	.S2	B3,5
+
+	NEG	.S1	A4,A4
+	STW	.D2T1	A4,*B15--[2]
+	STW	.D2T2	B3,*+B15[1]
+	CALLP	.S2	__errno_location,B3
+	LDW	.D2T2	*+B15[1],B3
+	LDW	.D2T1	*++B15[2],A5
+	NOP	3
+	BNOP	.S2	B3,3
+	STW	.D1T1	A5,*A4
+	MVK	.L1	-1,A4
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/byteswap.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/byteswap.h
new file mode 100644
index 0000000..eff26d5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/byteswap.h
@@ -0,0 +1,35 @@
+/*
+ * Port of uClibc for TMS320C6000 DSP architecture
+ * Copyright (C) 2004 Texas Instruments Incorporated
+ * Author of TMS320C6000 port: Aurelien Jacquiot
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef _ASM_BITS_BYTESWAP_H
+#define _ASM_BITS_BYTESWAP_H 1
+
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
+
+#ifdef __GNUC__
+#define __bswap_non_constant_32(x) __builtin_bswap32(x)
+#endif
+
+#include <bits/byteswap-common.h>
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/elf-dsbt.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/elf-dsbt.h
new file mode 100644
index 0000000..ff8b24b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/elf-dsbt.h
@@ -0,0 +1,123 @@
+/* Copyright (C) 2010 Texas Instruments Incorporated
+
+Borrowed heavily from frv arch:
+Copyright 2003, 2004 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+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.)
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#ifndef _BITS_ELF_DSBT_H
+#define _BITS_ELF_DSBT_H
+
+/* These data structures are described in the DSBT ABI.
+   The kernel passes a process a memory map of logical
+   load segments. For PIC code to work, all code segments
+   must be combined into a single mapping while maintaining
+   their relationship to one another. The same is true for
+   RW data segments.
+
+   Furthermore, 
+   segment there is an elf32_dsbt_loadseg entry.  A pointer to an
+   elf32_dsbt_loadmap is passed in GR8 at start-up, and a pointer to
+   an additional such map is passed in GR9 for the interpreter, when
+   there is one.  */
+
+#include <elf.h>
+
+/* This data structure represents a PT_LOAD segment.  */
+struct elf32_dsbt_loadseg
+{
+	/* Core address to which the segment is mapped.  */
+	Elf32_Addr addr;
+	/* VMA recorded in the program header.  */
+	Elf32_Addr p_vaddr;
+	/* Size of this segment in memory.  */
+	Elf32_Word p_memsz;
+};
+
+struct elf32_dsbt_loadmap {
+	/* Protocol version number, must be zero.  */
+	Elf32_Word version;
+
+	/* Pointer to DSBT */
+	unsigned   *dsbt_table;
+	unsigned   dsbt_size;
+	unsigned   dsbt_index;
+
+	/* number of segments */
+	Elf32_Word nsegs;
+
+	/* The actual memory map.  */
+	struct elf32_dsbt_loadseg segs[0];
+};
+
+struct elf32_dsbt_loadaddr {
+  struct elf32_dsbt_loadmap *map;
+};
+
+
+/* Map a pointer's VMA to its corresponding address according to the
+   load map.  */
+static __always_inline void *
+__reloc_pointer (void *p,
+		 const struct elf32_dsbt_loadmap *map)
+{
+  int c;
+
+#if 0
+  if (map->version != 0)
+    /* Crash.  */
+    ((void(*)())0)();
+#endif
+
+  /* No special provision is made for NULL.  We don't want NULL
+     addresses to go through relocation, so they shouldn't be in
+     .rofixup sections, and, if they're present in dynamic
+     relocations, they shall be mapped to the NULL address without
+     undergoing relocations.  */
+
+  for (c = 0; c < map->nsegs; c++)
+    {
+      unsigned long offset = p - (void*)map->segs[c].p_vaddr;
+      /* We only check for one-past-the-end for the second segment,
+	 assumed to be the data segment, because other cases are
+	 ambiguous in the absence of padding between segments, and
+	 rofixup already serves as padding between text and data.
+	 Unfortunately, unless we special-case the second segment,
+	 we fail to relocate the _end symbol.  */
+      if (offset < map->segs[c].p_memsz
+	  || (offset == map->segs[c].p_memsz && c == 1))
+	return (char*)map->segs[c].addr + offset;
+    }
+
+  /* We might want to crash instead.  */
+  return (void*)-1;
+}
+
+# define __RELOC_POINTER(ptr, loadaddr) \
+  (__reloc_pointer ((void*)(ptr), \
+		    (loadaddr).map))
+
+#endif /* _BITS_ELF_DSBT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/endian.h
new file mode 100644
index 0000000..7297f9e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/endian.h
@@ -0,0 +1,11 @@
+/* c6x is little-endian by default.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#ifdef _BIG_ENDIAN
+#define __BYTE_ORDER __BIG_ENDIAN
+#else
+#define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/fcntl.h
new file mode 100644
index 0000000..6c0d564
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/fcntl.h
@@ -0,0 +1,235 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   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.  */
+
+#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
+#define O_DIRECT	 040000
+
+#ifdef __USE_GNU
+# define O_LARGEFILE	0100000
+# define O_DIRECTORY	0200000	/* Must be a directory.	 */
+# define O_NOFOLLOW	0400000	/* don't follow links */
+# define O_NOATIME      01000000
+# 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	0100000
+#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_XOPEN2K
+# 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.	 */
+#endif
+
+/* For F_[GET|SET]FL.  */
+#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/c6x/bits/ipc.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/ipc.h
new file mode 100644
index 0000000..6bf2965
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/ipc.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 1995-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.  */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#ifdef __USE_GNU
+# define IPC_INFO	3		/* See ipcs.  */
+#endif
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;			/* Key.  */
+    __uid_t uid;			/* Owner's user ID.  */
+    __gid_t gid;			/* Owner's group ID.  */
+    __uid_t cuid;			/* Creator's user ID.  */
+    __gid_t cgid;			/* Creator's group ID.  */
+    __mode_t mode;                      /* Read/write permission.  */
+    unsigned short int __seq;		/* Sequence number.  */
+    unsigned short int __pad2;
+    unsigned long int __unused1;
+    unsigned long int __unused2;
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/kernel_stat.h
new file mode 100644
index 0000000..f8381c7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/kernel_stat.h
@@ -0,0 +1,49 @@
+#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 {
+	unsigned long	st_dev;		/* Device.  */
+	unsigned long	st_ino;		/* File serial number.  */
+	unsigned int	st_mode;	/* File mode.  */
+	unsigned int	st_nlink;	/* Link count.  */
+	unsigned int	st_uid;		/* User ID of the file's owner.  */
+	unsigned int	st_gid;		/* Group ID of the file's group. */
+	unsigned long	st_rdev;	/* Device number, if device.  */
+	unsigned long	__pad1;
+	long		st_size;	/* Size of file, in bytes.  */
+	int		st_blksize;	/* Optimal block size for I/O.  */
+	int		__pad2;
+	long		st_blocks;	/* Number 512-byte blocks allocated. */
+	struct timespec st_atim;
+	struct timespec st_mtim;
+	struct timespec st_ctim;
+	unsigned int	__unused4;
+	unsigned int	__unused5;
+};
+
+struct kernel_stat64 {
+	unsigned long long st_dev;	/* Device.  */
+	unsigned long long st_ino;	/* File serial number.  */
+	unsigned int	st_mode;	/* File mode.  */
+	unsigned int	st_nlink;	/* Link count.  */
+	unsigned int	st_uid;		/* User ID of the file's owner.  */
+	unsigned int	st_gid;		/* Group ID of the file's group. */
+	unsigned long long st_rdev;	/* Device number, if device.  */
+	unsigned long long __pad1;
+	long long	st_size;	/* Size of file, in bytes.  */
+	int		st_blksize;	/* Optimal block size for I/O.  */
+	int		__pad2;
+	long long	st_blocks;	/* Number 512-byte blocks allocated. */
+	struct timespec st_atim;
+	struct timespec st_mtim;
+	struct timespec st_ctim;
+	unsigned int	__unused4;
+	unsigned int	__unused5;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/kernel_types.h
new file mode 100644
index 0000000..2c363a8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/kernel_types.h
@@ -0,0 +1,48 @@
+/* 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 __ASM_GENERIC_POSIX_TYPES_H
+#define __ASM_GENERIC_POSIX_TYPES_H
+
+typedef unsigned int	__kernel_dev_t;
+typedef unsigned long	__kernel_ino_t;
+typedef unsigned int	__kernel_mode_t;
+typedef unsigned long	__kernel_nlink_t;
+typedef int		__kernel_pid_t;
+typedef int		__kernel_ipc_pid_t;
+typedef unsigned int	__kernel_uid_t;
+typedef unsigned int	__kernel_gid_t;
+typedef long		__kernel_suseconds_t;
+typedef int		__kernel_daddr_t;
+typedef unsigned int	__kernel_uid32_t;
+typedef unsigned int	__kernel_gid32_t;
+typedef unsigned int	__kernel_old_uid_t;
+typedef unsigned int	__kernel_old_gid_t;
+typedef unsigned int	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+typedef unsigned int	__kernel_size_t;
+typedef int		__kernel_ssize_t;
+typedef int		__kernel_ptrdiff_t;
+typedef long		__kernel_off_t;
+typedef long long	__kernel_loff_t;
+typedef long		__kernel_time_t;
+typedef long		__kernel_clock_t;
+typedef int		__kernel_timer_t;
+typedef int		__kernel_clockid_t;
+typedef char *		__kernel_caddr_t;
+typedef unsigned short	__kernel_uid16_t;
+typedef unsigned short	__kernel_gid16_t;
+
+typedef struct {
+#ifdef __USE_ALL
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* __ASM_GENERIC_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/mathdef.h
new file mode 100644
index 0000000..df12adf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/mathdef.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 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.  */
+
+#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
+
+typedef float  float_t;
+typedef double double_t;
+
+/* The values returned by `ilogb' for 0 and NaN respectively.  */
+# define FP_ILOGB0	(-2147483647 - 1)
+# 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.  */
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/nan.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/nan.h
new file mode 100644
index 0000000..85225da
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/nan.h
@@ -0,0 +1,57 @@
+/* `NAN' constant for IEEE 754 machines.
+   Copyright (C) 1992,1996,1997,1999,2004,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.  */
+
+#ifndef _MATH_H
+# error "Never use <bits/nan.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE Not A Number.  */
+
+/*
+ * Copied from the common code and modified for TI tool wrapper.
+ * Copyright (C) 2010 Texas Instruments Incorporated
+ */
+
+#if __GNUC_PREREQ(3,3)
+
+# define NAN	(__builtin_nanf (""))
+
+#elif defined __GNUC__ && ! defined __TI_TOOL_WRAPPER__
+
+# define NAN \
+  (__extension__							      \
+   ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; })  \
+    { __l: 0x7fc00000UL }).__d)
+
+#else
+
+# include <endian.h>
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+#  define __nan_bytes		{ 0x7f, 0xc0, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+#  define __nan_bytes		{ 0, 0, 0xc0, 0x7f }
+# endif
+
+static union { unsigned char __c[4]; float __d; } __nan_union
+    = { __nan_bytes };
+# define NAN	(__nan_union.__d)
+
+#endif	/* GCC.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/poll.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/poll.h
new file mode 100644
index 0000000..f7a7393
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/poll.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1997, 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_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for.  These bits may be set in `events'
+   to indicate the interesting event types; they will appear in `revents'
+   to indicate the status of the file descriptor.  */
+#define POLLIN		0x001		/* There is data to read.  */
+#define POLLPRI		0x002		/* There is urgent data to read.  */
+#define POLLOUT		0x004		/* Writing now will not block.  */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2.  */
+# define POLLRDNORM	0x040		/* Normal data may be read.  */
+# define POLLRDBAND	0x080		/* Priority data may be read.  */
+# define POLLWRNORM	POLLOUT		/* Writing now will not block.  */
+# define POLLWRBAND	0x100		/* Priority data may be written.  */
+#endif
+
+/* Event types always implicitly polled for.  These bits need not be set in
+   `events', but they will appear in `revents' to indicate the status of
+   the file descriptor.  */
+#define POLLERR		0x008		/* Error condition.  */
+#define POLLHUP		0x010		/* Hung up.  */
+#define POLLNVAL	0x020		/* Invalid polling request.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/resource.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/resource.h
new file mode 100644
index 0000000..57d1782
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/resource.h
@@ -0,0 +1,209 @@
+/* Bit values & structures for resource limits.  Linux/m68k version.
+   Copyright (C) 1994,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_RESOURCE_H
+# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Transmute defines to enumerations.  The macro re-definitions are
+   necessary because some programs want to test for operating system
+   features with #ifdef RUSAGE_SELF.  In ISO C the reflexive
+   definition is a no-op.  */
+
+/* Kinds of resource limit.  */
+enum __rlimit_resource
+{
+  /* Per-process CPU limit, in seconds.  */
+  RLIMIT_CPU = 0,
+#define RLIMIT_CPU RLIMIT_CPU
+
+  /* Largest file that can be created, in bytes.  */
+  RLIMIT_FSIZE = 1,
+#define	RLIMIT_FSIZE RLIMIT_FSIZE
+
+  /* Maximum size of data segment, in bytes.  */
+  RLIMIT_DATA = 2,
+#define	RLIMIT_DATA RLIMIT_DATA
+
+  /* Maximum size of stack segment, in bytes.  */
+  RLIMIT_STACK = 3,
+#define	RLIMIT_STACK RLIMIT_STACK
+
+  /* Largest core file that can be created, in bytes.  */
+  RLIMIT_CORE = 4,
+#define	RLIMIT_CORE RLIMIT_CORE
+
+  /* Largest resident set size, in bytes.
+     This affects swapping; processes that are exceeding their
+     resident set size will be more likely to have physical memory
+     taken from them.  */
+  RLIMIT_RSS = 5,
+#define	RLIMIT_RSS RLIMIT_RSS
+
+  /* Number of open files.  */
+  RLIMIT_NOFILE = 7,
+  RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same.  */
+#define RLIMIT_NOFILE RLIMIT_NOFILE
+#define RLIMIT_OFILE RLIMIT_OFILE
+
+  /* Address space limit.  */
+  RLIMIT_AS = 9,
+#define RLIMIT_AS RLIMIT_AS
+
+  /* Number of processes.  */
+  RLIMIT_NPROC = 6,
+#define RLIMIT_NPROC RLIMIT_NPROC
+
+  /* Locked-in-memory address space.  */
+  RLIMIT_MEMLOCK = 8,
+#define RLIMIT_MEMLOCK RLIMIT_MEMLOCK
+
+  /* Maximum number of file locks.  */
+  RLIMIT_LOCKS = 10,
+#define RLIMIT_LOCKS RLIMIT_LOCKS
+
+  RLIMIT_NLIMITS = 11,
+  RLIM_NLIMITS = RLIMIT_NLIMITS
+#define RLIMIT_NLIMITS RLIMIT_NLIMITS
+#define RLIM_NLIMITS RLIM_NLIMITS
+};
+
+/* Value to indicate that there is no limit.  */
+#ifndef __USE_FILE_OFFSET64
+# define RLIM_INFINITY ((unsigned long)(~0UL))
+#else
+# define RLIM_INFINITY 0xffffffffffffffffuLL
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define RLIM64_INFINITY 0xffffffffffffffffuLL
+#endif
+
+/* We can represent all limits.  */
+#define RLIM_SAVED_MAX	RLIM_INFINITY
+#define RLIM_SAVED_CUR	RLIM_INFINITY
+
+
+/* Type for resource quantity measurement.  */
+#ifndef __USE_FILE_OFFSET64
+typedef __rlim_t rlim_t;
+#else
+typedef __rlim64_t rlim_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef __rlim64_t rlim64_t;
+#endif
+
+struct rlimit
+  {
+    /* The current (soft) limit.  */
+    rlim_t rlim_cur;
+    /* The hard limit.  */
+    rlim_t rlim_max;
+  };
+
+#ifdef __USE_LARGEFILE64
+struct rlimit64
+  {
+    /* The current (soft) limit.  */
+    rlim64_t rlim_cur;
+    /* The hard limit.  */
+    rlim64_t rlim_max;
+ };
+#endif
+
+/* Whose usage statistics do you want?  */
+enum __rusage_who
+{
+  /* The calling process.  */
+  RUSAGE_SELF = 0,
+#define RUSAGE_SELF RUSAGE_SELF
+
+  /* All of its terminated child processes.  */
+  RUSAGE_CHILDREN = -1,
+#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+
+  /* Both.  */
+  RUSAGE_BOTH = -2
+#define RUSAGE_BOTH RUSAGE_BOTH
+};
+
+#define __need_timeval
+#include <bits/time.h>		/* For `struct timeval'.  */
+
+/* Structure which says how much of each resource has been used.  */
+struct rusage
+  {
+    /* Total amount of user time used.  */
+    struct timeval ru_utime;
+    /* Total amount of system time used.  */
+    struct timeval ru_stime;
+    /* Maximum resident set size (in kilobytes).  */
+    long ru_maxrss;
+    /* Amount of sharing of text segment memory
+       with other processes (kilobyte-seconds).  */
+    long ru_ixrss;
+    /* Amount of data segment memory used (kilobyte-seconds).  */
+    long ru_idrss;
+    /* Amount of stack memory used (kilobyte-seconds).  */
+    long ru_isrss;
+    /* Number of soft page faults (i.e. those serviced by reclaiming
+       a page from the list of pages awaiting reallocation.  */
+    long ru_minflt;
+    /* Number of hard page faults (i.e. those that required I/O).  */
+    long ru_majflt;
+    /* Number of times a process was swapped out of physical memory.  */
+    long ru_nswap;
+    /* Number of input operations via the file system.  Note: This
+       and `ru_oublock' do not include operations with the cache.  */
+    long ru_inblock;
+    /* Number of output operations via the file system.  */
+    long ru_oublock;
+    /* Number of IPC messages sent.  */
+    long ru_msgsnd;
+    /* Number of IPC messages received.  */
+    long ru_msgrcv;
+    /* Number of signals delivered.  */
+    long ru_nsignals;
+    /* Number of voluntary context switches, i.e. because the process
+       gave up the process before it had to (usually to wait for some
+       resource to be available).  */
+    long ru_nvcsw;
+    /* Number of involuntary context switches, i.e. a higher priority process
+       became runnable or the current process used up its time slice.  */
+    long ru_nivcsw;
+  };
+
+/* Priority limits.  */
+#define PRIO_MIN	-20	/* Minimum priority a process can have.  */
+#define PRIO_MAX	20	/* Maximum priority a process can have.  */
+
+/* The type of the WHICH argument to `getpriority' and `setpriority',
+   indicating what flavor of entity the WHO argument specifies.  */
+enum __priority_which
+{
+  PRIO_PROCESS = 0,		/* WHO is a process ID.  */
+#define PRIO_PROCESS PRIO_PROCESS
+  PRIO_PGRP = 1,		/* WHO is a process group ID.  */
+#define PRIO_PGRP PRIO_PGRP
+  PRIO_USER = 2			/* WHO is a user ID.  */
+#define PRIO_USER PRIO_USER
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/setjmp.h
new file mode 100644
index 0000000..259e23b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/setjmp.h
@@ -0,0 +1,39 @@
+/*
+ * Port of uClibc for TMS320C6000 DSP architecture 
+ * Copyright (C) 2004 Texas Instruments Incorporated
+ * Author of TMS320C6000 port: Aurelien Jacquiot 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+typedef struct {
+	unsigned long __regs[12]; /* save A10,B10... A15,B15*/
+	unsigned long __pc;       /* the return address */
+} __jmp_buf[1];
+
+/* the stack pointer (B15) */
+#define JP_SP 11 
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)->__regs[JP_SP])
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/sigcontextinfo.h
new file mode 100644
index 0000000..b7e08cf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/sigcontextinfo.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>, 1998.
+
+   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 SIGCONTEXT int _code, struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS _code,
+#define GET_PC(ctx)	((void *) (ctx)->sc_pc)
+#define GET_FRAME(ctx)	((void *) __builtin_frame_address (1))
+#define GET_STACK(ctx)	((void *) (ctx)->sc_usp)
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/stackinfo.h
new file mode 100644
index 0000000..9dbf06a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On c6x the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/syscalls.h
new file mode 100644
index 0000000..504d0c3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/syscalls.h
@@ -0,0 +1,184 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+#define SYS_ify(syscall_name)  (__NR_##syscall_name)
+
+#undef __SYSCALL_STRING
+# define __SYSCALL_STRING			\
+		"swe\n\t" \
+		"nop\n\t"
+
+# define __SYSCALL_RES_CHECK (__res < -255 || __res >= 0)
+
+#define __SYSCALL_CLOBBERS "cc", "memory"
+
+#define __SYSCALL_RETURN(type) \
+	if (__SYSCALL_RES_CHECK) \
+		return (type) __res; \
+	__set_errno (-__res); \
+	return (type) -1;
+
+#ifndef NOT_IN_libc
+#define DEBUG_SYSCALL(name) { \
+      char d[64];\
+      write( 2, d, snprintf( d, 64, "syscall %d error %d\n", __NR_##name, _inline_sys_result)); \
+}
+#else
+#define DEBUG_SYSCALL(name) do{} while(0)
+#endif
+
+#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 INLINE_SYSCALL_NOERR
+#define INLINE_SYSCALL_NOERR(name, nr, args...)				\
+  ({ unsigned int _inline_sys_result = INTERNAL_SYSCALL (name, , nr, args);	\
+     (int) _inline_sys_result; })
+
+#undef INTERNAL_SYSCALL_DECL
+#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
+
+
+#define INTERNAL_SYSCALL( name, err, nr, args...) \
+    INTERNAL_SYSCALL_NCS( __NR_##name, err, nr, args )
+
+
+#define INTERNAL_SYSCALL_NCS(sys_num, err, nr, args...) \
+(__extension__ \
+    ({                                                      \
+	register long __A4 __asm__("A4");		    \
+	register long __b0 __asm__("B0") = sys_num;	    \
+	LOAD_ARGS_##nr(args)				    \
+	__asm__ __volatile__(__SYSCALL_STRING		    \
+			     : "=a" (__A4)				\
+			     : "b" (__b0) ASM_ARGS_##nr			\
+			     : __SYSCALL_CLOBBERS );			\
+	(int)__A4;							\
+    }) \
+)
+#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 0
+# define CALL_ERRNO_LOCATION "call   __errno_location;"
+#define __CLONE_SYSCALL_STRING						\
+	"ta	0x10;"							\
+	"bcs	2f;"							\
+	" sub	%%o1, 1, %%o1;"						\
+	"and	%%A4, %%o1, %%A4;"					\
+	"1:"								\
+	".subsection 2;"						\
+	"2:"								\
+	"save	%%sp, -192, %%sp;"					\
+	CALL_ERRNO_LOCATION						\
+	" nop;"								\
+	"st	%%i0, [%%A4];"						\
+	"ba	1b;"							\
+	" restore %%g0, -1, %%A4;"					\
+	".previous;"
+
+#define INLINE_CLONE_SYSCALL(arg1,arg2,arg3,arg4,arg5)			\
+({									\
+	register long __A4 __asm__ ("A4") = (long)(arg1);		\
+	register long __B4 __asm__ ("B4") = (long)(arg2);		\
+	register long __A6 __asm__ ("A6") = (long)(arg3);		\
+	register long __B6 __asm__ ("B6") = (long)(arg4);		\
+	register long __A8 __asm__ ("A8") = (long)(arg5);		\
+	register long __g1 __asm__ ("g1") = __NR_clone;			\
+	__asm __volatile (__CLONE_SYSCALL_STRING :			\
+			  "=r" (__g1), "=r" (__A4), "=r" (__B4)	:	\
+			  "0" (__g1), "1" (__A4), "2" (__B4),		\
+			  "r" (__A6), "r" (__B6), "r" (__A8) :		\
+			  __SYSCALL_CLOBBERS);				\
+	__A4;								\
+})
+#endif
+
+#define LOAD_ARGS_0()
+#define ASM_ARGS_0
+#define LOAD_ARGS_1(A4) \
+    __A4 = (int)A4;     \
+    LOAD_ARGS_0()
+#define ASM_ARGS_1 ASM_ARGS_0, "a" (__A4)
+#define LOAD_ARGS_2(A4, B4)			\
+  register int __B4 __asm__ ("B4") = (int) (B4);	\
+  LOAD_ARGS_1 (A4)
+#define ASM_ARGS_2	ASM_ARGS_1, "b" (__B4)
+#define LOAD_ARGS_3(A4, B4, A6)			\
+  register int __A6 __asm__ ("A6") = (int) (A6);	\
+  LOAD_ARGS_2 (A4, B4)
+#define ASM_ARGS_3	ASM_ARGS_2, "a" (__A6)
+#define LOAD_ARGS_4(A4, B4, A6, B6)		\
+  register int __B6 __asm__ ("B6") = (int) (B6);	\
+  LOAD_ARGS_3 (A4, B4, A6)
+#define ASM_ARGS_4	ASM_ARGS_3, "b" (__B6)
+#define LOAD_ARGS_5(A4, B4, A6, B6, A8)		\
+  register int __A8 __asm__ ("A8") = (int) (A8);	\
+  LOAD_ARGS_4 (A4, B4, A6, B6)
+#define ASM_ARGS_5	ASM_ARGS_4, "a" (__A8)
+#define LOAD_ARGS_6(A4, B4, A6, B6, A8, B8)	\
+  register int __B8 __asm__ ("B8") = (int) (B8);	\
+  LOAD_ARGS_5 (A4, B4, A6, B6, A8)
+#define ASM_ARGS_6	ASM_ARGS_5, "b" (__B8)
+
+#ifndef _syscall0
+
+#define C_DECL_ARGS_0()			void
+#define C_DECL_ARGS_1(t, v)		t v
+#define C_DECL_ARGS_2(t, v, args...)	t v, C_DECL_ARGS_1(args)
+#define C_DECL_ARGS_3(t, v, args...)	t v, C_DECL_ARGS_2(args)
+#define C_DECL_ARGS_4(t, v, args...)	t v, C_DECL_ARGS_3(args)
+#define C_DECL_ARGS_5(t, v, args...)	t v, C_DECL_ARGS_4(args)
+#define C_DECL_ARGS_6(t, v, args...)	t v, C_DECL_ARGS_5(args)
+
+#define C_ARGS_0()
+#define C_ARGS_1(t, v)			v
+#define C_ARGS_2(t, v, args...)		v, C_ARGS_1(args)
+#define C_ARGS_3(t, v, args...)		v, C_ARGS_2(args)
+#define C_ARGS_4(t, v, args...)		v, C_ARGS_3(args)
+#define C_ARGS_5(t, v, args...)		v, C_ARGS_4(args)
+#define C_ARGS_6(t, v, args...)		v, C_ARGS_5(args)
+
+#define SYSCALL_FUNC(nargs, type, name, args...)			\
+type name(C_DECL_ARGS_##nargs(args)) {					\
+	return (type)INLINE_SYSCALL(name, nargs, C_ARGS_##nargs(args));	\
+}
+
+#define SYSCALL_NOERR_FUNC(nargs, type, name, args...)			\
+type name(C_DECL_ARGS_##nargs(args)) {					\
+	return (type)INLINE_SYSCALL_NOERR(name, nargs, C_ARGS_##nargs(args));	\
+}
+
+#define _syscall0(args...)		SYSCALL_FUNC(0, args)
+#define _syscall_noerr0(args...)	SYSCALL_NOERR_FUNC(0, args)
+#define _syscall1(args...)		SYSCALL_FUNC(1, args)
+#define _syscall_noerr1(args...)	SYSCALL_NOERR_FUNC(1, args)
+#define _syscall2(args...)		SYSCALL_FUNC(2, args)
+#define _syscall3(args...)		SYSCALL_FUNC(3, args)
+#define _syscall4(args...)		SYSCALL_FUNC(4, args)
+#define _syscall5(args...)		SYSCALL_FUNC(5, args)
+#define _syscall6(args...)		SYSCALL_FUNC(6, args)
+
+#endif /* _syscall0 */
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..59e7de9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/uClibc_arch_features.h
@@ -0,0 +1,48 @@
+/*
+ * 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__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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 */
+#define __UCLIBC_ASM_LINE_SEP__ @
+
+#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/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/c6x/brk.c b/ap/build/uClibc/libc/sysdeps/linux/c6x/brk.c
new file mode 100644
index 0000000..7eb4863
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/brk.c
@@ -0,0 +1,54 @@
+/*
+ * Port of uClibc for TMS320C6000 DSP architecture
+ * Copyright (C) 2004 Texas Instruments Incorporated
+ * Author of TMS320C6000 port: Aurelien Jacquiot
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <errno.h>
+
+libc_hidden_proto(brk)
+
+/* This must be initialized data because commons can't have aliases.  */
+void * __curbrk attribute_hidden = 0;
+
+int brk (void *addr)
+{
+	void *newbrk;
+
+	__asm__ __volatile__ ( \
+		"mv .d1	%2, A4\n\t" \
+		"mvk .s2	%1, B0\n\t" \
+		"swe\n\t" \
+		"nop\n\t" \
+		"mv .d2	B0, %0" \
+		: "=b" (newbrk) \
+		: "i" (__NR_brk), \
+		  "a" (addr) \
+		: "memory", "cc", "B0", "A4"); \
+
+	__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/c6x/bsd-_setjmp.s b/ap/build/uClibc/libc/sysdeps/linux/c6x/bsd-_setjmp.s
new file mode 100644
index 0000000..566318a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bsd-_setjmp.s
@@ -0,0 +1,48 @@
+ ;
+ ; Port of uClibc for TMS320C6000 DSP architecture 
+ ; Copyright (C) 2004 Texas Instruments Incorporated
+ ; Author of TMS320C6000 port: Aurelien Jacquiot 
+ ;
+ ; This program is free software; you can redistribute it and/or modify it
+ ; under the terms of the GNU Library General Public License as published by
+ ; the Free Software Foundation; either version 2 of the License, or (at your
+ ; option) any later version.
+ ;
+ ; This program is distributed in the hope that it will be useful, but WITHOUT
+ ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ ; for more details.
+ ;
+ ; You should have received a copy of the GNU Library General Public License
+ ; along with this program; if not, write to the Free Software Foundation,
+ ; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ ;
+
+	.global _setjmp
+
+_setjmp:
+	MV .D2X	A4,B4		; jmp_buf address
+||	STW .D1T2	B3,*+A4(48)	; return address
+
+	STW .D1T1	A10,*+A4(0)
+||	STW .D2T2	B10,*+B4(4)
+||	ZERO .L1	A6
+	
+	STW .D1T1	A6,*+A4(52)	; no signal mask set
+||	B .S2	B3		; returns in 5 cycles
+
+	STW .D1T1	A11,*+A4(8)
+||	STW .D2T2	B11,*+B4(12)
+	STW .D1T1	A12,*+A4(16)
+||	STW .D2T2	B12,*+B4(20)
+	STW .D1T1	A13,*+A4(24)
+||	STW .D2T2	B13,*+B4(28)
+	STW .D1T1	A14,*+A4(32)
+||	STW .D2T2	B14,*+B4(36)
+	STW .D1T1	A15,*+A4(40)
+||	STW .D2T2	B15,*+B4(44)
+||	ZERO .L1	A4		; return values
+
+
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/c6x/bsd-setjmp.S
new file mode 100644
index 0000000..3ab597d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/bsd-setjmp.S
@@ -0,0 +1,67 @@
+ ;
+ ; Port of uClibc for TMS320C6000 DSP architecture
+ ; Copyright (C) 2004 Texas Instruments Incorporated
+ ; Author of TMS320C6000 port: Aurelien Jacquiot
+ ;
+ ; This program is free software; you can redistribute it and/or modify it
+ ; under the terms of the GNU Library General Public License as published by
+ ; the Free Software Foundation; either version 2 of the License, or (at your
+ ; option) any later version.
+ ;
+ ; This program is distributed in the hope that it will be useful, but WITHOUT
+ ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ ; for more details.
+ ;
+ ; You should have received a copy of the GNU Library General Public License
+ ; along with this program; if not, write to the Free Software Foundation,
+ ; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ ;
+
+	.global setjmp
+setjmp:
+#if 0
+.if 1 /* was: .if (CONFIG_UCLIBC_SHARED == 0) */
+
+	MVKL .S1	___curr_eh_stack_entry,A6
+||	SUB .D1X	A4,B15,A3
+	MVKH .S1	___curr_eh_stack_entry,A6
+||	CMPGT .L1	A3,4,A0		; A0 set if C++ exceptions case
+
+	LDW .D1T1	*A6,A2
+.else
+	MVKL .S2	(___curr_eh_stack_entry - $bss)/4,B6
+||	SUB .D1X	A4,B15,A3
+	MVKH .S2	(___curr_eh_stack_entry - $bss)/4,B6
+||	CMPGT .L1	A3,4,A0		; A0 set if C++ exceptions case
+
+	LDW .D2T1	*+B14[B6],A2
+.endif
+	NOP
+#else
+	MVK .S1		0, A0
+#endif
+
+	MVK .L2	1,B4		; indicate to ___sigjmp_save to save signal mask
+||	MV .D2X	A4,B6		; jmp_buf address
+||	STW .D1T2	B3,*+A4(48)	; return address
+
+	ADDAW .D1	A2,2,A2
+ [A0]	CMPEQ .L1	A4,A2,A0	; A0 set if C++ exceptions case
+
+	STW .D1T1	A10,*+A4(0)
+||	STW .D2T2	B10,*+B6(4)
+||[!A0]	B .S1		__sigjmp_save		; branch to ___sigjmp_save in 5 cycles
+||[A0]	B .S2		B3
+
+	STW .D1T1	A11,*+A4(8)
+||	STW .D2T2	B11,*+B6(12)
+	STW .D1T1	A12,*+A4(16)
+||	STW .D2T2	B12,*+B6(20)
+	STW .D1T1	A13,*+A4(24)
+||	STW .D2T2	B13,*+B6(28)
+	STW .D1T1	A14,*+A4(32)
+||	STW .D2T2	B14,*+B6(36)
+	STW .D1T1	A15,*+A4(40)
+||	STW .D2T2	B15,*+B6(44)
+||[A0]	ZERO .L1	A4		; returns 0 for the C++ case
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/clone.S b/ap/build/uClibc/libc/sysdeps/linux/c6x/clone.S
new file mode 100644
index 0000000..6fba5bb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/clone.S
@@ -0,0 +1,98 @@
+ ;
+ ; Port of uClibc for TMS320C6000 DSP architecture
+ ; Copyright (C) 2004 Texas Instruments Incorporated
+ ; Author of TMS320C6000 port: Aurelien Jacquiot
+ ;
+ ; This program is free software; you can redistribute it and/or modify it
+ ; under the terms of the GNU Library General Public License as published by
+ ; the Free Software Foundation; either version 2 of the License, or (at your
+ ; option) any later version.
+ ;
+ ; This program is distributed in the hope that it will be useful, but WITHOUT
+ ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ ; for more details.
+ ;
+ ; You should have received a copy of the GNU Library General Public License
+ ; along with this program; if not, write to the Free Software Foundation,
+ ; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ ;
+#define __ASSEMBLY__
+
+	; int _clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg);
+
+#include <asm/errno.h>
+#include <sys/syscall.h>
+
+	.global __clone
+	.global	clone
+	.global	__errno_location
+
+ ;Currently supports only
+ ;int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg)
+ ;
+ ;Requires update for supporting
+ ; int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
+ ;	    int *parent_tidptr, struct user_desc *newtls, int *child_pidptr)
+
+__clone:
+	; index 1 points to the forth argument and is to be moved to B6
+	LDW .D2T2	*+B15[1],B5
+	NOP     4
+	OR .D2X	B4,A4,B2	; sanity check arguments, no NULL function or stack pointers
+||	MV .S2	B4,B9
+||	MV .D1	A4,A9		; backup fn and child_stack pointers
+
+  [!B2]	B .S2	__syscall_error
+||[!B2] MVK .S1	EINVAL,A4
+	NOP	4
+
+	MV .D1	A6,A4		; get flags as arg0, arg1 is the new stack
+||	AND .D2	~7,B4,B4
+
+	; do the system call
+||	MVK .S2	__NR_clone,B0
+||	MV .L2  B5,B6
+0:
+#ifndef	_TMS320C6400_PLUS
+  	MVC .S2     CSR,B2
+	CLR .S2     B2,0,0,B1
+	MVC .S2     B1,CSR
+	MVC .S2     IFR,B1
+	SET .S2     B1,6,6,B1
+	MVC .S2     B1,ISR
+	MVC .S2     B2,CSR
+	NOP
+#else
+	SWE
+#endif
+
+	MV .D2	B9,B4		; restore child stack
+
+||	CMPEQ .L1	0,A4,A2
+||	CMPLT .L2X	A4,0,B2
+
+   [B2]	B .S2	__syscall_error	; if syscall < 0, it is an error
+	NOP	5
+   [A2] B .S2X	A9		; branch to function
+|| [A2] MV .D1X	B6,A4		; set arg (B6 is preserved by syscall)
+  [!A2] B .S2	B3		; otherwise (syscall result > 0) returns directly
+   [A2]	ADDKPC .S2	__return_thread,B3, 4
+
+__return_thread:
+	b	.s2	HIDDEN_JUMPTARGET(_exit)
+	nop	5
+
+__syscall_error:
+	NEG .S1	A4,A4
+	STW .D2T1	A4,*B15--[2]
+	STW .D2T2	B3,*+B15[1]
+	CALLP .S2	__errno_location,B3
+	LDW .D2T2	*+B15[1],B3
+	LDW .D2T1	*++B15[2],A5
+	NOP	3
+	BNOP .S2	B3,3
+	STW .D1T1	A5,*A4
+	MVK .L1	-1,A4
+
+.set clone, __clone
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/c6x/crt1.S
new file mode 100644
index 0000000..810f395
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/crt1.S
@@ -0,0 +1,67 @@
+;
+; Port of uClibc for TMS320C6000 DSP architecture
+; 
+; Copyright (C) 2010 Texas Instruments Incorporated
+; Mark Salter <msalter@redhat.com>
+;
+; This program is free software; you can redistribute it and/or modify it
+; under the terms of the GNU Library General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or (at your
+; option) any later version.
+;
+; This program is distributed in the hope that it will be useful, but WITHOUT
+; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+; for more details.
+;
+; You should have received a copy of the GNU Library General Public License
+; along with this program; if not, write to the Free Software Foundation,
+; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+;
+
+       .text
+
+	;; On entry, the dynamic linker
+	;;
+	;;	0(sp)			pad0
+	;;	4(sp)			pad1
+	;;	8(sp)			argc
+	;;	12(sp)			argv[0]
+	;;	...
+	;;	(4*(argc+3))(sp)	NULL
+	;;	(4*(argc+4))(sp)	envp[0]
+	;;	...
+	;;				NULL
+
+	;; Register values are unspecified, except:
+	;;
+	;;	A4  --> pointer to rtld fini rountine
+	;;	B14 --> pointer to application DSBT table
+
+	.global	_start
+_start:
+	.global _c_int00
+_c_int00:
+	;; Things to do:
+	;;
+	;; 	* call __uClibc_main(
+	;; 		int (*main)(int, char **, char **),	A4
+	;; 		int argc,				B4
+	;;		char **argv,			   	A6
+	;; 		void (*app_init)(void),		   	B6
+	;; 		void (*app_fini)(void),		   	A8
+	;;		void (*rtld_fini)(void),		B8
+	;; 		void *stack_end)			A10
+
+	MV .D2X	A4,B8		; rtld_fini
+
+	LDW .D2T1	*+B14($GOT(main)), A4
+	LDW .D2T2	*+B14($GOT(_init)), B6
+	B .S2		__uClibc_main
+||	LDW .D2T1	*+B14($GOT(_fini)), A8
+
+	LDW .D2T2	*+B15(8),B4	; argc
+	ADDAW .D1X	B15,3,A6	; **argv
+	MV .D1X		B15,A10		; stack_end
+||	ZERO .L1	A15		; clear FP
+	NOP		2
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/crti.S b/ap/build/uClibc/libc/sysdeps/linux/c6x/crti.S
new file mode 100644
index 0000000..e689a04
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/crti.S
@@ -0,0 +1,17 @@
+/*
+ * This file just supplies function prologues for the .init and .fini
+ * sections.  It is linked in before crtbegin.o.
+ */
+
+	.section .init
+	.globl  _init
+	.type   _init,@function
+_init:
+	add	.l2	-8, B15, B15
+	stw	.d2t2	B3,*+B15(4)
+	.section .fini
+	.globl  _fini
+	.type   _fini,@function
+_fini:
+	add	.l2	-8, B15, B15
+	stw	.d2t2	B3,*+B15(4)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/c6x/crtn.S
new file mode 100644
index 0000000..37e799d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/crtn.S
@@ -0,0 +1,19 @@
+/*
+ * This file supplies function epilogues for the .init and .fini sections.
+ * It is linked in after all other files.
+ */
+
+	.section .init
+	ldw .d2t2	*+B15(4), B3
+	add .d2		B15, 8, B15
+	nop		3
+	ret .s2		B3
+	nop		5
+
+	.section .fini
+	ldw .d2t2	*+B15(4), B3
+	add .d2		B15, 8, B15
+	nop		3
+	ret .s2		B3
+	nop		5
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/prctl.c b/ap/build/uClibc/libc/sysdeps/linux/c6x/prctl.c
new file mode 100644
index 0000000..fcf1f9d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/prctl.c
@@ -0,0 +1,43 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * prctl() for uClibc
+ *
+ * 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 <stdarg.h>
+/* psm: including sys/prctl.h would depend on kernel headers */
+
+#ifdef __NR_prctl
+extern int prctl (int __option, ...);
+int prctl (int __option, ...)
+{
+	register long no __asm__("B0");
+	register long a __asm__("A4");
+	register long b __asm__("B4");
+	register long c __asm__("A6");
+	register long d __asm__("B6");
+	register long e __asm__("A8");
+	int __res;
+	va_list ap;
+
+	va_start( ap, __option);
+	a = __option;
+	b = va_arg( ap, long);
+	c = va_arg( ap, long);
+	d = va_arg( ap, long);
+	e = va_arg( ap, long);
+	va_end( ap );
+
+	no = __NR_prctl;
+
+	__asm__ __volatile__ ("SWE" : "=a" (a) : "a" (a), "b" (b), "a" (c), "b" (d), "a" (e), "b" (no)
+			      : "memory", "cc");
+
+	__res = a;
+	__SYSCALL_RETURN (int);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/pread_write.c b/ap/build/uClibc/libc/sysdeps/linux/c6x/pread_write.c
new file mode 100644
index 0000000..f985b43
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/pread_write.c
@@ -0,0 +1,103 @@
+/* vi: set sw=4 ts=4:
+ *
+ * Copyright (C) 2002 by Erik Andersen <andersen@uclibc.org>
+ * Based in part on the files
+ *		./sysdeps/unix/sysv/linux/pwrite.c,
+ *		./sysdeps/unix/sysv/linux/pread.c,
+ *		sysdeps/posix/pread.c
+ *		sysdeps/posix/pwrite.c
+ * from GNU libc 2.2.5, but reworked considerably...
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#define _LARGEFILE64_SOURCE
+#include <features.h>
+#undef __OPTIMIZE__
+/* We absolutely do _NOT_ want interfaces silently
+ *  *  * renamed under us or very bad things will happen... */
+#ifdef __USE_FILE_OFFSET64
+# undef __USE_FILE_OFFSET64
+#endif
+
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <stdint.h>
+
+extern __typeof(pread) __libc_pread;
+extern __typeof(pwrite) __libc_pwrite;
+#ifdef __UCLIBC_HAS_LFS__
+extern __typeof(pread64) __libc_pread64;
+extern __typeof(pwrite64) __libc_pwrite64;
+#endif
+
+#ifdef __NR_pread64             /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pread
+#  error "__NR_pread and __NR_pread64 both defined???"
+# endif
+# define __NR_pread __NR_pread64
+#endif
+
+#define __NR___syscall_pread __NR_pread
+static inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
+		size_t, count, off_t, offset_hi, off_t, offset_lo);
+
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return(__syscall_pread(fd,buf,count,offset,offset >> 31));
+}
+weak_alias (__libc_pread, pread)
+
+#if defined __UCLIBC_HAS_LFS__
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
+{
+    uint32_t low = offset & 0xffffffff;
+    uint32_t high = offset >> 32;
+	return(__syscall_pread(fd, buf, count, low, high));
+}
+weak_alias (__libc_pread64, pread64)
+#endif /* __UCLIBC_HAS_LFS__  */
+
+
+#ifdef __NR_pwrite64            /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pwrite
+#  error "__NR_pwrite and __NR_pwrite64 both defined???"
+# endif
+# define __NR_pwrite __NR_pwrite64
+#endif
+
+#define __NR___syscall_pwrite __NR_pwrite
+static inline _syscall5(ssize_t, __syscall_pwrite, int, fd, const void *, buf,
+		size_t, count, off_t, offset_hi, off_t, offset_lo);
+
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+	return(__syscall_pwrite(fd,buf,count,offset,offset >> 31));
+}
+weak_alias (__libc_pwrite, pwrite)
+
+#if defined __UCLIBC_HAS_LFS__
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
+{
+    uint32_t low = offset & 0xffffffff;
+    uint32_t high = offset >> 32;
+	return(__syscall_pwrite(fd, buf, count, low, high));
+}
+weak_alias (__libc_pwrite64, pwrite64)
+#endif /* __UCLIBC_HAS_LFS__  */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/setjmp.s b/ap/build/uClibc/libc/sysdeps/linux/c6x/setjmp.s
new file mode 100644
index 0000000..28a4f03
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/setjmp.s
@@ -0,0 +1,43 @@
+ ;
+ ; Port of uClibc for TMS320C6000 DSP architecture
+ ; Copyright (C) 2004 Texas Instruments Incorporated
+ ; Author of TMS320C6000 port: Aurelien Jacquiot
+ ;
+ ; This program is free software; you can redistribute it and/or modify it
+ ; under the terms of the GNU Library General Public License as published by
+ ; the Free Software Foundation; either version 2 of the License, or (at your
+ ; option) any later version.
+ ;
+ ; This program is distributed in the hope that it will be useful, but WITHOUT
+ ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ ; for more details.
+ ;
+ ; You should have received a copy of the GNU Library General Public License
+ ; along with this program; if not, write to the Free Software Foundation,
+ ; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ ;
+
+	.global __sigsetjmp
+;	.ref	__sigjmp_save
+
+__sigsetjmp:
+        MV .D2X	A4,B6		; jmp_buf address
+||	STW .D1T2	B3,*+A4(48)	; return address
+
+        STW .D1T1	A10,*+A4(0)
+||	STW .D2T2	B10,*+B6(4)
+||	B .S2		__sigjmp_save	; branch to ___sigjmp_save in 5 cycles
+
+        STW .D1T1	A11,*+A4(8)
+||	STW .D2T2	B11,*+B6(12)
+        STW .D1T1	A12,*+A4(16)
+||	STW .D2T2	B12,*+B6(20)
+        STW .D1T1	A13,*+A4(24)
+||	STW .D2T2	B13,*+B6(28)
+        STW .D1T1	A14,*+A4(32)
+||	STW .D2T2	B14,*+B6(36)
+        STW .D1T1	A15,*+A4(40)
+||	STW .D2T2	B15,*+B6(44)
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/c6x/sigaction.c
new file mode 100644
index 0000000..ed90f05
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/sigaction.c
@@ -0,0 +1,124 @@
+/*
+   Copyright (C) 2010 Texas Instruments Incorporated
+   Adapted from i386 version by Mark Salter <msalter@redhat.com>
+
+   Copyright (C) 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+
+   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>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# include <pthreadP.h>	/* SIGCANCEL */
+#endif
+
+#define SA_RESTORER	0x04000000
+
+extern __typeof(sigaction) __libc_sigaction;
+
+extern void restore_rt(void) __asm__ ("__restore_rt") attribute_hidden;
+extern void restore(void) __asm__ ("__restore") attribute_hidden;
+
+/* 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 kernel_sigaction kact, koact;
+
+#ifdef SIGCANCEL
+    if (sig == SIGCANCEL) {
+	__set_errno (EINVAL);
+	return -1;
+    }
+#endif
+
+    if (act) {
+	kact.k_sa_handler = act->sa_handler;
+	memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask));
+	kact.sa_flags = act->sa_flags;
+
+	kact.sa_flags = act->sa_flags | SA_RESTORER;
+	kact.sa_restorer = ((act->sa_flags & SA_SIGINFO)
+		? &restore_rt : &restore);
+    }
+
+    /* XXX The size argument hopefully will have to be changed to the
+       real size of the user-level sigset_t.  */
+    result = __syscall_rt_sigaction(sig, act ? __ptrvalue (&kact) : NULL,
+	    oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
+
+    if (oact && result >= 0) {
+	oact->sa_handler = koact.k_sa_handler;
+	memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask));
+	oact->sa_flags = koact.sa_flags;
+	oact->sa_restorer = koact.sa_restorer;
+    }
+    return result;
+}
+
+#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
+
+
+/* NOTE: Please think twice before making any changes to the bits of
+   code below.  GDB needs some intimate knowledge about it to
+   recognize them as signal trampolines, and make backtraces through
+   signal handlers work right.  Important are both the names
+   (__restore and __restore_rt) and the exact instruction sequence.
+   If you ever feel the need to make any changes, please notify the
+   appropriate GDB maintainer.  */
+
+#define RESTORE(name, syscall) RESTORE2 (name, syscall)
+#define RESTORE2(name, syscall) \
+__asm__						\
+  (						\
+   "    .text\n"				\
+   "    .global " #name "\n"			\
+   "__" #name ":\n"				\
+   "	MVK " #syscall ",B0\n"			\
+   "	SWE\n"					\
+   "	NOP\n"					\
+   "	NOP\n"					\
+   "	NOP\n"					\
+   "	NOP\n"					\
+   "	NOP\n"					\
+   "	NOP\n"					\
+   );
+
+#ifdef __NR_rt_sigaction
+/* The return code for realtime-signals.  */
+RESTORE (restore_rt, __NR_rt_sigreturn)
+#endif
+
+#ifdef __NR_sigreturn
+/* For the boring old signals.  */
+RESTORE (restore, __NR_sigreturn)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/procfs.h
new file mode 100644
index 0000000..41c2d08
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/procfs.h
@@ -0,0 +1,122 @@
+/* Copyright (C) 1996, 1997, 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_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_struct' 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 20
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* 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_gregset_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/c6x/sys/ptrace.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/ptrace.h
new file mode 100644
index 0000000..b8a7a49
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/ptrace.h
@@ -0,0 +1,176 @@
+/* `ptrace' debugger support interface.  Linux version.
+   Copyright (C) 1996-1999,2000,2006,2007 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_PTRACE_H
+#define _SYS_PTRACE_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.'  */
+enum __ptrace_request
+{
+  /* Indicate that the process making this request should be traced.
+     All signals received by this process can be intercepted by its
+     parent, and its parent can use the other `ptrace' requests.  */
+  PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+  /* Return the word in the process's text space at address ADDR.  */
+  PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+  /* Return the word in the process's data space at address ADDR.  */
+  PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+  /* Return the word in the process's user area at offset ADDR.  */
+  PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+  /* Write the word DATA into the process's text space at address ADDR.  */
+  PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+  /* Write the word DATA into the process's data space at address ADDR.  */
+  PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+  /* Write the word DATA into the process's user area at offset ADDR.  */
+  PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+  /* Continue the process.  */
+  PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+  /* Kill the process.  */
+  PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+  /* Single step the process.
+     This is not supported on all machines.  */
+  PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+  /* Get all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+  /* Set all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+  /* Get all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+  /* Set all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
+  /* Attach to a process that is already running. */
+  PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+  /* Detach from a process attached to with PTRACE_ATTACH.  */
+  PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+  /* Get all extended floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETFPXREGS = 18,
+#define PT_GETFPXREGS PTRACE_GETFPXREGS
+
+  /* Set all extended floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETFPXREGS = 19,
+#define PT_SETFPXREGS PTRACE_SETFPXREGS
+
+  /* Continue and stop at the next (return from) syscall.  */
+  PTRACE_SYSCALL = 24,
+#define PT_SYSCALL PTRACE_SYSCALL
+
+  /* Obtain the load map of the main program or the interpreter of the
+     ptraced process, depending on whether the addr argument is
+     (void*)0 or (void*)1, respectively.  */
+  PTRACE_GETDSBT = 31,
+#define PT_GETDSBT PTRACE_GETDSBT
+
+  /* Set ptrace filter options.  */
+  PTRACE_SETOPTIONS = 0x4200,
+#define PT_SETOPTIONS PTRACE_SETOPTIONS
+
+  /* Get last ptrace message.  */
+  PTRACE_GETEVENTMSG = 0x4201,
+#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
+
+  /* Get siginfo for process.  */
+  PTRACE_GETSIGINFO = 0x4202,
+#define PT_GETSIGINFO PTRACE_GETSIGINFO
+
+  /* Set new siginfo for process.  */
+  PTRACE_SETSIGINFO = 0x4203
+#define PT_SETSIGINFO PTRACE_SETSIGINFO
+};
+
+#define PTRACE_GETDSBT_EXEC      ((void*)0)	/* [addr] request the executable loadmap */
+#define PTRACE_GETDSBT_INTERP    ((void*)1)	/* [addr] request the interpreter loadmap */
+
+/* Options set using PTRACE_SETOPTIONS.  */
+enum __ptrace_setoptions {
+  PTRACE_O_TRACESYSGOOD	= 0x00000001,
+  PTRACE_O_TRACEFORK	= 0x00000002,
+  PTRACE_O_TRACEVFORK   = 0x00000004,
+  PTRACE_O_TRACECLONE	= 0x00000008,
+  PTRACE_O_TRACEEXEC	= 0x00000010,
+  PTRACE_O_TRACEVFORKDONE = 0x00000020,
+  PTRACE_O_TRACEEXIT	= 0x00000040,
+  PTRACE_O_MASK		= 0x0000007f
+};
+
+/* Wait extended result codes for the above trace options.  */
+enum __ptrace_eventcodes {
+  PTRACE_EVENT_FORK	= 1,
+  PTRACE_EVENT_VFORK	= 2,
+  PTRACE_EVENT_CLONE	= 3,
+  PTRACE_EVENT_EXEC	= 4,
+  PTRACE_EVENT_VFORK_DONE = 5,
+  PTRACE_EVENT_EXIT	= 6
+};
+
+/* Perform process tracing functions.  REQUEST is one of the values
+   above, and determines the action to be taken.
+   For all requests except PTRACE_TRACEME, PID specifies the process to be
+   traced.
+
+   PID and the other arguments described above for the various requests should
+   appear (those that are used for the particular request) as:
+     pid_t PID, void *ADDR, int DATA, void *ADDR2
+   after REQUEST.  */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/reg.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/reg.h
new file mode 100644
index 0000000..46857ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/reg.h
@@ -0,0 +1,26 @@
+/*
+ * Port of uClibc for TMS320C6000 DSP architecture 
+ * Copyright (C) 2004 Texas Instruments Incorporated
+ * Author of TMS320C6000 port: Aurelien Jacquiot 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+#ifndef _SYS_REG_H
+#define _SYS_REG_H	1
+
+#include <asm/ptrace.h>
+
+#endif /* _SYS_REG_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/ucontext.h
new file mode 100644
index 0000000..9a3922a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/ucontext.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 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_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+#include <bits/sigcontext.h>
+
+/* A machine context is exactly a sigcontext.  */
+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;
+} ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/user.h
new file mode 100644
index 0000000..8c0a99d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/sys/user.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2010 Texas Instruments Incorporated
+   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.  */
+
+/* Left blank as a placeholder for now */
+
+#endif  /* sys/user.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/c6x/syscall.c b/ap/build/uClibc/libc/sysdeps/linux/c6x/syscall.c
new file mode 100644
index 0000000..ea947b2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/c6x/syscall.c
@@ -0,0 +1,49 @@
+/*
+ *  syscall.c
+ *
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2006, 2010 Texas Instruments Incorporated
+ *  Author: Thomas Charleux (thomas.charleux@jaluna.com)
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <features.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <stdarg.h>
+
+long int syscall (long int __sysno, ...)
+{
+	register long no __asm__("B0");
+	register long a __asm__("A4");
+	register long b __asm__("B4");
+	register long c __asm__("A6");
+	register long d __asm__("B6");
+	register long e __asm__("A8");
+	register long f __asm__("B8");
+	long __res;
+	va_list ap;
+
+	va_start( ap, __sysno);
+	a = va_arg( ap, long);
+	b = va_arg( ap, long);
+	c = va_arg( ap, long);
+	d = va_arg( ap, long);
+	e = va_arg( ap, long);
+	f = va_arg( ap, long);
+	va_end( ap );
+
+	no = __sysno;
+
+	__asm__ __volatile__ ("SWE" : "=a" (a) : "a" (a), "b" (b), "a" (c), "b" (d), "a" (e), "b" (f), "b" (no)
+			      : "memory", "cc");
+
+	__res = a;
+	__SYSCALL_RETURN (long);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/.indent.pro b/ap/build/uClibc/libc/sysdeps/linux/common/.indent.pro
new file mode 100644
index 0000000..492ecf1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/.indent.pro
@@ -0,0 +1,33 @@
+--blank-lines-after-declarations
+--blank-lines-after-procedures
+--break-before-boolean-operator
+--no-blank-lines-after-commas
+--braces-on-if-line
+--braces-on-struct-decl-line
+--comment-indentation25
+--declaration-comment-column25
+--no-comment-delimiters-on-blank-lines
+--cuddle-else
+--continuation-indentation4
+--case-indentation0
+--else-endif-column33
+--space-after-cast
+--line-comments-indentation0
+--declaration-indentation1
+--dont-format-first-column-comments
+--dont-format-comments
+--honour-newlines
+--indent-level4
+/* changed from 0 to 4 */
+--parameter-indentation4
+--line-length78 /* changed from 75 */
+--continue-at-parentheses
+--no-space-after-function-call-names
+--dont-break-procedure-type
+--dont-star-comments
+--leave-optional-blank-lines
+--dont-space-special-semicolon
+--tab-size4
+/* additions by Mark */
+--case-brace-indentation0
+--leave-preprocessor-space
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/Makefile b/ap/build/uClibc/libc/sysdeps/linux/common/Makefile
new file mode 100644
index 0000000..3ed177a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/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.in
+include $(top_srcdir)Makerules
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/Makefile.in b/ap/build/uClibc/libc/sysdeps/linux/common/Makefile.in
new file mode 100644
index 0000000..3b5763c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/Makefile.in
@@ -0,0 +1,125 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+COMMON_DIR := $(top_srcdir)libc/sysdeps/linux/common
+COMMON_OUT := $(top_builddir)libc/sysdeps/linux/common
+
+CSRC-y := $(notdir $(wildcard $(COMMON_DIR)/*.c))
+CSRC-  := ssp-local.c
+
+CSRC_LFS := $(notdir $(wildcard $(COMMON_DIR)/*64.c))
+CSRC-y := $(filter-out llseek.c $(CSRC_LFS),$(CSRC-y))
+CSRC-$(UCLIBC_HAS_LFS) += llseek.c $(CSRC_LFS)
+CSRC-$(findstring y,$(UCLIBC_HAS_SSP)$(UCLIBC_HAS_FORTIFY)) += ssp.c
+CSRC-$(UCLIBC_LINUX_MODULE_26) += delete_module.c init_module.c
+CSRC-$(UCLIBC_LINUX_MODULE_24) += create_module.c query_module.c \
+	get_kernel_syms.c
+# we need these internally: fstatfs.c statfs.c
+CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
+	bdflush.c \
+	capget.c \
+	capset.c \
+	eventfd.c \
+	inotify.c \
+	ioperm.c \
+	iopl.c \
+	modify_ldt.c \
+	personality.c \
+	pipe2.c \
+	ppoll.c \
+	prctl.c \
+	readahead.c \
+	reboot.c \
+	remap_file_pages.c \
+	sched_cpucount.c \
+	sched_getaffinity.c \
+	sched_getcpu.c \
+	sched_setaffinity.c \
+	sendfile.c \
+	setfsgid.c \
+	setfsuid.c \
+	setresgid.c \
+	setresuid.c \
+	signalfd.c \
+	splice.c \
+	swapoff.c \
+	swapon.c \
+	sync_file_range.c \
+	sysctl.c \
+	sysinfo.c \
+	tee.c \
+	timerfd.c \
+	umount2.c \
+	umount.c \
+	unshare.c \
+	uselib.c \
+	vhangup.c \
+	vmsplice.c
+CSRC-$(if $(findstring yy,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_LFS)),y) += \
+	sendfile64.c
+# NPTL needs these internally: madvise.c
+CSRC-$(findstring y,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_THREADS_NATIVE)) += madvise.c
+ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+CSRC- += fork.c getpid.c raise.c open.c close.c read.c write.c
+CSRC- += $(if $(findstring =arm=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =x86_64=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =mips=y=,=$(TARGET_ARCH)=$(CONFIG_MIPS_O32_ABI)=),waitpid.c)
+endif
+# stubbed out in mman.h
+CSRC-$(ARCH_USE_MMU) += msync.c
+# we need these internally: getdomainname.c
+CSRC-$(UCLIBC_BSD_SPECIFIC) += mincore.c setdomainname.c
+CSRC-$(UCLIBC_NTP_LEGACY) += ntp_gettime.c
+# aio_cancel|aio_error|aio_fsync|aio_read|aio_return|aio_suspend|aio_write|clock_getres|clock_gettime|clock_settime|clock_settime|fdatasync|lio_listio|mlockall|munlockall|mlock|munlock|mq_close|mq_getattr|mq_notify|mq_open|mq_receive|mq_timedreceive|mq_send|mq_timedsend|mq_setattr|mq_unlink|nanosleep|sched_getparam|sched_get_priority_max|sched_get_priority_min|sched_getscheduler|sched_rr_get_interval|sched_setparam|sched_setscheduler|sem_close|sem_destroy|sem_getvalue|sem_init|sem_open|sem_post|sem_trywait|sem_wait|sem_unlink|sem_wait|shm_open|shm_unlink|sigqueue|sigtimedwait|sigwaitinfo|sigwaitinfo|timer_create|timer_delete|timer_getoverrun|timer_gettime|timer_settime
+CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.c \
+	fdatasync.c mlockall.c mlock.c munlockall.c munlock.c \
+	nanosleep.c __rt_sigtimedwait.c __rt_sigwaitinfo.c sched_getparam.c \
+	sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c \
+	sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c
+# clock_getcpuclockid|clock_nanosleep|mq_timedreceive|mq_timedsend|posix_fadvise|posix_fallocate|posix_madvise|posix_memalign|posix_mem_offset|posix_spawnattr_destroy|posix_spawnattr_init|posix_spawnattr_getflags|posix_spawnattr_setflags|posix_spawnattr_getpgroup|posix_spawnattr_setpgroup|posix_spawnattr_getschedparam|posix_spawnattr_setschedparam|posix_spawnattr_getschedpolicy|posix_spawnattr_setschedpolicy|posix_spawnattr_getsigdefault|posix_spawnattr_setsigdefault|posix_spawnattr_getsigmask|posix_spawnattr_setsigmask|posix_spawnattr_init|posix_spawnattr_setflags|posix_spawnattr_setpgroup|posix_spawnattr_setschedparam|posix_spawnattr_setschedpolicy|posix_spawnattr_setsigdefault|posix_spawnattr_setsigmask|posix_spawn_file_actions_addclose|posix_spawn_file_actions_addopen|posix_spawn_file_actions_adddup2|posix_spawn_file_actions_addopen|posix_spawn_file_actions_destroy|posix_spawn_file_actions_init|posix_spawn_file_actions_init|posix_spawn|posix_spawnp|posix_spawnp|posix_typed_mem_get_info|pthread_mutex_timedlock|sem_timedwait
+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c
+CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
+CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
+CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
+CSRC-$(UCLIBC_HAS_PROFILING) += noophooks.c #pcprofile.c
+CSRC-$(UCLIBC_SV4_DEPRECATED) += ustat.c
+CSRC- += $(if $(findstring =c6x=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =sh=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =sparc=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =i386=,=$(TARGET_ARCH)=),vfork.c)
+
+CSRC-y := $(filter-out $(CSRC-),$(CSRC-y))
+
+# provided via pthreads builddir
+CSRC-y := $(filter-out $(libc_a_CSRC) $(notdir $(libpthread_libc_OBJS:.o=.c)),$(CSRC-y))
+SSRC := $(filter-out $(libc_a_SSRC) $(notdir $(libpthread_libc_OBJS:.o=.S)),$(SSRC))
+
+# fails for some reason
+ifneq ($(strip $(ARCH_OBJS)),)
+CSRC-y := $(filter-out $(notdir $(ARCH_OBJS:.o=.c)) $(ARCH_OBJ_FILTEROUT),$(CSRC-y))
+endif
+
+CFLAGS-ssp.c := $(SSP_DISABLE_FLAGS)
+CFLAGS-ssp-local.c := $(SSP_DISABLE_FLAGS)
+
+COMMON_SRC := $(patsubst %.c,$(COMMON_DIR)/%.c,$(CSRC-y))
+COMMON_OBJ := $(patsubst %.c,$(COMMON_OUT)/%.o,$(CSRC-y))
+
+libc-y += $(COMMON_OBJ)
+libc-static-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp-local.o
+libc-nonshared-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp-local.os
+
+libc-nomulti-y += $(COMMON_OUT)/__syscall_rt_sigaction.o \
+	$(COMMON_OUT)/__syscall_sigaction.o \
+	$(COMMON_OUT)/mremap.o \
+	$(COMMON_OUT)/stat.o
+libc-nomulti-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp.o
+
+objclean-y += CLEAN_libc/sysdeps/linux/common
+
+CLEAN_libc/sysdeps/linux/common:
+	$(do_rm) $(addprefix $(COMMON_OUT)/*., o os oS)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigtimedwait.c b/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigtimedwait.c
new file mode 100644
index 0000000..d9f3260
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigtimedwait.c
@@ -0,0 +1,92 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __rt_sigtimedwait() for uClibc
+ *
+ * Copyright (C) 2006 by Steven Hill <sjhill@realitydiluted.com>
+ * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ */
+
+#include <sys/syscall.h>
+#include <signal.h>
+#include <string.h>
+
+#ifdef __NR_rt_sigtimedwait
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#  include <sysdep-cancel.h>
+#  include <pthreadP.h>	/* SIGCANCEL */
+
+static int do_sigtimedwait(const sigset_t *set, siginfo_t *info,
+						   const struct timespec *timeout)
+{
+#  ifdef SIGCANCEL
+	sigset_t tmpset;
+
+	if (set != NULL && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+#   ifdef SIGSETXID
+		|| __builtin_expect (__sigismember (set, SIGSETXID), 0)
+#   endif
+		))
+	{
+		/* Create a temporary mask without the bit for SIGCANCEL set.  */
+		// We are not copying more than we have to.
+		memcpy (&tmpset, set, _NSIG / 8);
+		__sigdelset (&tmpset, SIGCANCEL);
+#   ifdef SIGSETXID
+		__sigdelset (&tmpset, SIGSETXID);
+#   endif
+		set = &tmpset;
+	}
+#  endif
+
+	/* XXX The size argument hopefully will have to be changed to the
+	   real size of the user-level sigset_t.  */
+	int result = INLINE_SYSCALL (rt_sigtimedwait, 4, set, info,
+								 timeout, _NSIG / 8);
+
+	/* The kernel generates a SI_TKILL code in si_code in case tkill is
+	   used.  tkill is transparently used in raise().  Since having
+	   SI_TKILL as a code is useful in general we fold the results
+	   here.  */
+	if (result != -1 && info != NULL && info->si_code == SI_TKILL)
+		info->si_code = SI_USER;
+
+	return result;
+}
+
+/* Return any pending signal or wait for one for the given time.  */
+int attribute_hidden __sigtimedwait(const sigset_t *set, siginfo_t *info,
+				    const struct timespec *timeout)
+{
+	if(SINGLE_THREAD_P)
+		return do_sigtimedwait(set, info, timeout);
+
+	int oldtype = LIBC_CANCEL_ASYNC();
+
+	/* XXX The size argument hopefully will have to be changed to the
+	   real size of the user-level sigset_t.  */
+	int result = do_sigtimedwait(set, info, timeout);
+
+	LIBC_CANCEL_RESET(oldtype);
+
+	return result;
+}
+# else
+#  define __need_NULL
+#  include <stddef.h>
+#  define __NR___rt_sigtimedwait __NR_rt_sigtimedwait
+static _syscall4(int, __rt_sigtimedwait, const sigset_t *, set,
+				 siginfo_t *, info, const struct timespec *, timeout,
+				 size_t, setsize);
+
+int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info,
+									const struct timespec *timeout)
+{
+	return __rt_sigtimedwait(set, info, timeout, _NSIG / 8);
+}
+# endif /* !__UCLIBC_HAS_THREADS_NATIVE__ */
+weak_alias(__sigtimedwait,sigtimedwait)
+libc_hidden_weak(sigtimedwait)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigwaitinfo.c b/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigwaitinfo.c
new file mode 100644
index 0000000..6b43327
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigwaitinfo.c
@@ -0,0 +1,89 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __rt_sigwaitinfo() for uClibc
+ *
+ * Copyright (C) 2006 by Steven Hill <sjhill@realitydiluted.com>
+ * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ */
+
+#include <sys/syscall.h>
+#include <signal.h>
+#include <string.h>
+
+#ifdef __NR_rt_sigtimedwait
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#  include <sysdep-cancel.h>
+
+static int do_sigwaitinfo(const sigset_t *set, siginfo_t *info)
+{
+#  ifdef SIGCANCEL
+	sigset_t tmpset;
+
+	if (set != NULL && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+#   ifdef SIGSETXID
+		|| __builtin_expect (__sigismember (set, SIGSETXID), 0)
+#   endif
+		))
+	{
+		/* Create a temporary mask without the bit for SIGCANCEL set.  */
+		// We are not copying more than we have to.
+		memcpy (&tmpset, set, _NSIG / 8);
+		__sigdelset (&tmpset, SIGCANCEL);
+#   ifdef SIGSETXID
+		__sigdelset (&tmpset, SIGSETXID);
+#   endif
+		set = &tmpset;
+	}
+#  endif
+
+	/* XXX The size argument hopefully will have to be changed to the
+	   real size of the user-level sigset_t.  */
+	int result = INLINE_SYSCALL (rt_sigtimedwait, 4, set, info,
+								 NULL, _NSIG / 8);
+
+	/* The kernel generates a SI_TKILL code in si_code in case tkill is
+	   used.  tkill is transparently used in raise().  Since having
+	   SI_TKILL as a code is useful in general we fold the results
+	   here.  */
+	if (result != -1 && info != NULL && info->si_code == SI_TKILL)
+		info->si_code = SI_USER;
+
+	return result;
+}
+
+/* Return any pending signal or wait for one for the given time.  */
+int __sigwaitinfo(const sigset_t *set, siginfo_t *info)
+{
+	if(SINGLE_THREAD_P)
+		return do_sigwaitinfo(set, info);
+
+	int oldtype = LIBC_CANCEL_ASYNC();
+
+	/* XXX The size argument hopefully will have to be changed to the
+	   real size of the user-level sigset_t.  */
+	int result = do_sigwaitinfo(set, info);
+
+	LIBC_CANCEL_RESET(oldtype);
+
+	return result;
+}
+# else
+#  define __need_NULL
+#  include <stddef.h>
+#  define __NR___rt_sigwaitinfo __NR_rt_sigtimedwait
+static _syscall4(int, __rt_sigwaitinfo, const sigset_t *, set,
+				 siginfo_t *, info, const struct timespec *, timeout,
+				 size_t, setsize);
+
+int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info)
+{
+	return __rt_sigwaitinfo(set, info, NULL, _NSIG / 8);
+}
+# endif
+libc_hidden_proto(sigwaitinfo)
+weak_alias (__sigwaitinfo, sigwaitinfo)
+libc_hidden_weak(sigwaitinfo)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__socketcall.c b/ap/build/uClibc/libc/sysdeps/linux/common/__socketcall.c
new file mode 100644
index 0000000..e49fb21
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__socketcall.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __socketcall() for uClibc
+ *
+ * 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>
+#ifdef __NR_socketcall
+#define __NR___socketcall __NR_socketcall
+int __socketcall(int __call, unsigned long *__args) attribute_hidden;
+_syscall2(int, __socketcall, int, call, unsigned long *, args)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl.c b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl.c
new file mode 100644
index 0000000..6d4c339
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl.c
@@ -0,0 +1,91 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __syscall_fcntl() for uClibc
+ *
+ * Copyright (C) 2006 Steven J. Hill <sjhill@realitydiluted.com>
+ * 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 <stdarg.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>	/* Must come before <fcntl.h>.  */
+#endif
+#include <fcntl.h>
+#include <bits/wordsize.h>
+
+extern __typeof(fcntl) __libc_fcntl;
+libc_hidden_proto(__libc_fcntl)
+
+int __fcntl_nocancel (int fd, int cmd, ...)
+{
+	va_list ap;
+	void *arg;
+
+	va_start (ap, cmd);
+	arg = va_arg (ap, void *);
+	va_end (ap);
+
+# if __WORDSIZE == 32
+	if (cmd == F_GETLK64 || cmd == F_SETLK64 || cmd == F_SETLKW64) {
+#  if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
+		return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
+#  else
+		__set_errno(ENOSYS);
+		return -1;
+#  endif
+	}
+# endif
+	return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+}
+libc_hidden_def(__fcntl_nocancel)
+
+int __libc_fcntl (int fd, int cmd, ...)
+{
+	va_list ap;
+	void *arg;
+
+	va_start (ap, cmd);
+	arg = va_arg (ap, void *);
+	va_end (ap);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	if (SINGLE_THREAD_P || (cmd != F_SETLKW && cmd != F_SETLKW64))
+# if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
+		return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
+# else
+		return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+# endif
+
+	int oldtype = LIBC_CANCEL_ASYNC ();
+
+# if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
+	int result = INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
+# else
+	int result = INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+# endif
+
+	LIBC_CANCEL_RESET (oldtype);
+
+	return result;
+#else
+# if __WORDSIZE == 32
+	if (cmd == F_GETLK64 || cmd == F_SETLK64 || cmd == F_SETLKW64) {
+#  if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
+		return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
+#  else
+		__set_errno(ENOSYS);
+		return -1;
+#  endif
+	}
+# endif
+	return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+#endif
+}
+libc_hidden_def(__libc_fcntl)
+
+libc_hidden_proto(fcntl)
+weak_alias(__libc_fcntl,fcntl)
+libc_hidden_weak(fcntl)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl64.c b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl64.c
new file mode 100644
index 0000000..e8782e9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl64.c
@@ -0,0 +1,30 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __syscall_fcntl64() for uClibc
+ *
+ * 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 <stdarg.h>
+#include <fcntl.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
+
+#define __NR___syscall_fcntl64 __NR_fcntl64
+static __inline__ _syscall3(int, __syscall_fcntl64, int, fd, int, cmd, long, arg)
+int fcntl64(int fd, int cmd, ...)
+{
+	long arg;
+	va_list list;
+
+	va_start(list, cmd);
+	arg = va_arg(list, long);
+	va_end(list);
+
+	return (__syscall_fcntl64(fd, cmd, arg));
+}
+libc_hidden_def(fcntl64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_rt_sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_rt_sigaction.c
new file mode 100644
index 0000000..006b38a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_rt_sigaction.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __syscall_rt_sigaction() for uClibc
+ *
+ * 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>
+
+#ifdef __NR_rt_sigaction
+#include <signal.h>
+
+int __syscall_rt_sigaction (int __signum, const struct sigaction *__act,
+							struct sigaction *__oldact, size_t __size);
+
+#define __NR___syscall_rt_sigaction __NR_rt_sigaction
+_syscall4(int, __syscall_rt_sigaction, int, signum,
+		  const struct sigaction *, act, struct sigaction *, oldact,
+		  size_t, size)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_sigaction.c
new file mode 100644
index 0000000..ae0f01e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_sigaction.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __syscall_sigaction() for uClibc
+ *
+ * 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>
+
+#ifndef __NR_rt_sigaction
+#define __NR___syscall_sigaction __NR_sigaction
+#include <signal.h>
+int __syscall_sigaction (int __signum, const struct sigaction *__act, struct sigaction *__oldact) attribute_hidden;
+_syscall3(int, __syscall_sigaction, int, signum, const struct sigaction *,
+		  act, struct sigaction *, oldact)
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/_exit.c b/ap/build/uClibc/libc/sysdeps/linux/common/_exit.c
new file mode 100644
index 0000000..51117d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/_exit.c
@@ -0,0 +1,34 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * exit syscall for uClibc
+ *
+ * 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 <errno.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep.h>
+#endif
+
+
+void attribute_noreturn _exit(int status)
+{
+	/* The loop is added only to keep gcc happy. */
+	while(1)
+	{
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# ifdef __NR_exit_group
+		INLINE_SYSCALL(exit_group, 1, status);
+# endif
+#endif
+		INLINE_SYSCALL(exit, 1, status);
+	}
+}
+libc_hidden_def(_exit)
+weak_alias(_exit,_Exit)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/access.c b/ap/build/uClibc/libc/sysdeps/linux/common/access.c
new file mode 100644
index 0000000..a075d42
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/access.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * access() for uClibc
+ *
+ * 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 <unistd.h>
+_syscall2(int, access, const char *, pathname, int, mode)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/acct.c b/ap/build/uClibc/libc/sysdeps/linux/common/acct.c
new file mode 100644
index 0000000..e0a4320
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/acct.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * acct() for uClibc
+ *
+ * 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 <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+_syscall1(int, acct, const char *, filename)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/adjtimex.c b/ap/build/uClibc/libc/sysdeps/linux/common/adjtimex.c
new file mode 100644
index 0000000..45cb384
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/adjtimex.c
@@ -0,0 +1,18 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * adjtimex() for uClibc
+ *
+ * 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 <sys/timex.h>
+
+
+_syscall1(int, adjtimex, struct timex *, buf)
+libc_hidden_def(adjtimex)
+#if defined __UCLIBC_NTP_LEGACY__
+strong_alias(adjtimex,ntp_adjtime)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/alarm.c b/ap/build/uClibc/libc/sysdeps/linux/common/alarm.c
new file mode 100644
index 0000000..cfd68fe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/alarm.c
@@ -0,0 +1,39 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * alarm() for uClibc
+ *
+ * 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 <unistd.h>
+
+
+#ifdef __NR_alarm
+_syscall1(unsigned int, alarm, unsigned int, seconds)
+#else
+#include <sys/time.h>
+
+
+unsigned int alarm(unsigned int seconds)
+{
+	struct itimerval old, new;
+	unsigned int retval;
+
+	new.it_value.tv_usec = 0;
+	new.it_interval.tv_sec = 0;
+	new.it_interval.tv_usec = 0;
+	new.it_value.tv_sec = (long int) seconds;
+	if (setitimer(ITIMER_REAL, &new, &old) < 0) {
+		return 0;
+	}
+	retval = old.it_value.tv_sec;
+	if (old.it_value.tv_usec) {
+		++retval;
+	}
+	return retval;
+}
+#endif
+libc_hidden_def(alarm)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/arch_prctl.c b/ap/build/uClibc/libc/sysdeps/linux/common/arch_prctl.c
new file mode 100644
index 0000000..5816f53
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/arch_prctl.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * arch_prctl() for uClibc
+ *
+ * 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>
+
+#ifdef __NR_arch_prctl
+extern int arch_prctl(int code, unsigned long addr);
+_syscall2(int, arch_prctl, int, code, unsigned long, addr)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bdflush.c b/ap/build/uClibc/libc/sysdeps/linux/common/bdflush.c
new file mode 100644
index 0000000..c2a05ed
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bdflush.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * bdflush() for uClibc
+ *
+ * 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 <sys/kdaemon.h>
+
+#ifdef __NR_bdflush
+_syscall2(int, bdflush, int, __func, long int, __data)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/atomic.h
new file mode 100644
index 0000000..6245130
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/atomic.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_ATOMIC_H
+#define _BITS_ATOMIC_H	1
+
+/* We have by default no support for atomic operations.  So define
+   them non-atomic.  If this is a problem somebody will have to come
+   up with real definitions.  */
+
+/* The only basic operation needed is compare and exchange.  */
+#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+  ({ __typeof (mem) __gmemp = (mem);				      \
+     __typeof (*mem) __gret = *__gmemp;				      \
+     __typeof (*mem) __gnewval = (newval);			      \
+								      \
+     if (__gret == (oldval))					      \
+       *__gmemp = __gnewval;					      \
+     __gret; })
+
+#define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+  ({ __typeof (mem) __gmemp = (mem);				      \
+     __typeof (*mem) __gnewval = (newval);			      \
+								      \
+     *__gmemp == (oldval) ? (*__gmemp = __gnewval, 0) : 1; })
+
+#endif	/* bits/atomic.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap-common.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap-common.h
new file mode 100644
index 0000000..8586ed0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap-common.h
@@ -0,0 +1,108 @@
+/* Macros to swap the order of bytes in integer values.
+   Copyright (C) 1997,1998,2000,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.
+
+   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 _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
+
+#ifndef _BITS_BYTESWAP_H
+#define _BITS_BYTESWAP_H 1
+
+/* Swap bytes in 16 bit value.  */
+#define __bswap_constant_16(x) \
+     ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
+
+#ifndef __bswap_non_constant_16
+# define __bswap_non_constant_16(x) __bswap_constant_16(x)
+#endif
+#ifdef __GNUC__
+# define __bswap_16(x) \
+    (__extension__							      \
+     ({ unsigned short int __bsv, __bsx = (x);				      \
+	if (__builtin_constant_p (__bsx))				      \
+	  __bsv = __bswap_constant_16 (__bsx);				      \
+	else								      \
+	  __bsv = __bswap_non_constant_16 (__bsx);			      \
+	__bsv; }))
+#else
+static __inline unsigned short int
+__bswap_16 (unsigned short int __bsx)
+{
+  return __bswap_constant_16 (__bsx);
+}
+#endif
+
+/* Swap bytes in 32 bit value.  */
+#define __bswap_constant_32(x) \
+     ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >>  8) |	      \
+      (((x) & 0x0000ff00u) <<  8) | (((x) & 0x000000ffu) << 24))
+
+#ifndef __bswap_non_constant_32
+# define __bswap_non_constant_32(x) __bswap_constant_32(x)
+#endif
+#ifdef __GNUC__
+# define __bswap_32(x) \
+    (__extension__							      \
+     ({ unsigned int __bsv, __bsx = (x);				      \
+	if (__builtin_constant_p (__bsx))				      \
+	  __bsv = __bswap_constant_32 (__bsx);				      \
+	else								      \
+	  __bsv = __bswap_non_constant_32 (__bsx);			      \
+	__bsv; }))
+#else
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+  return __bswap_constant_32 (__bsx);
+}
+#endif
+
+#if defined __GNUC__ && __GNUC__ >= 2
+/* Swap bytes in 64 bit value.  */
+# define __bswap_constant_64(x) \
+     ((((x) & 0xff00000000000000ull) >> 56)				      \
+      | (((x) & 0x00ff000000000000ull) >> 40)				      \
+      | (((x) & 0x0000ff0000000000ull) >> 24)				      \
+      | (((x) & 0x000000ff00000000ull) >> 8)				      \
+      | (((x) & 0x00000000ff000000ull) << 8)				      \
+      | (((x) & 0x0000000000ff0000ull) << 24)				      \
+      | (((x) & 0x000000000000ff00ull) << 40)				      \
+      | (((x) & 0x00000000000000ffull) << 56))
+
+# ifndef __bswap_non_constant_64
+#  define __bswap_non_constant_64(x) \
+     (__extension__							      \
+      ({ union { __extension__ unsigned long long int __ll;		      \
+		 unsigned int __l[2]; } __w, __r;			      \
+	 __w.__ll = (x);						      \
+	 __r.__l[0] = __bswap_non_constant_32 (__w.__l[1]);		      \
+	 __r.__l[1] = __bswap_non_constant_32 (__w.__l[0]);		      \
+	 __r.__ll; }))
+# endif
+# define __bswap_64(x) \
+     (__extension__							      \
+      ({ __extension__ unsigned long long int __ll;			      \
+         if (__builtin_constant_p (x))					      \
+	   __ll = __bswap_constant_64 (x);				      \
+	 else								      \
+	   __ll = __bswap_non_constant_64 (x);				      \
+	 __ll; }))
+#endif
+
+#endif /* _BITS_BYTESWAP_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap.h
new file mode 100644
index 0000000..3f02506
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap.h
@@ -0,0 +1 @@
+#include <bits/byteswap-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/cmathcalls.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/cmathcalls.h
new file mode 100644
index 0000000..762c1e3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/cmathcalls.h
@@ -0,0 +1,181 @@
+/* Prototype declarations for complex math functions;
+   helper file for <complex.h>.
+   Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* NOTE: Because of the special way this file is used by <complex.h>, this
+   file must NOT be protected from multiple inclusion as header files
+   usually are.
+
+   This file provides prototype declarations for the math functions.
+   Most functions are declared using the macro:
+
+   __MATHCALL (NAME, (ARGS...));
+
+   This means there is a function `NAME' returning `double' and a function
+   `NAMEf' returning `float'.  Each place `_Mdouble_' appears in the
+   prototype, that is actually `double' in the prototype for `NAME' and
+   `float' in the prototype for `NAMEf'.  Reentrant variant functions are
+   called `NAME_r' and `NAMEf_r'.
+
+   Functions returning other types like `int' are declared using the macro:
+
+   __MATHDECL (TYPE, NAME, (ARGS...));
+
+   This is just like __MATHCALL but for a function returning `TYPE'
+   instead of `_Mdouble_'.  In all of these cases, there is still
+   both a `NAME' and a `NAMEf' that takes `float' arguments.  */
+
+#ifndef _COMPLEX_H
+#error "Never use <bits/cmathcalls.h> directly; include <complex.h> instead."
+#endif
+
+#define _Mdouble_complex_ _Mdouble_ _Complex
+
+
+/* Trigonometric functions.  */
+
+/* Arc cosine of Z.  */
+__MATHCALL (cacos, (_Mdouble_complex_ __z));
+libm_hidden_proto(cacos)
+/* Arc sine of Z.  */
+__MATHCALL (casin, (_Mdouble_complex_ __z));
+libm_hidden_proto(casin)
+/* Arc tangent of Z.  */
+__MATHCALL (catan, (_Mdouble_complex_ __z));
+libm_hidden_proto(catan)
+
+/* Cosine of Z.  */
+__MATHCALL (ccos, (_Mdouble_complex_ __z));
+libm_hidden_proto(ccos)
+/* Sine of Z.  */
+__MATHCALL (csin, (_Mdouble_complex_ __z));
+libm_hidden_proto(csin)
+/* Tangent of Z.  */
+__MATHCALL (ctan, (_Mdouble_complex_ __z));
+libm_hidden_proto(ctan)
+
+
+/* Hyperbolic functions.  */
+
+/* Hyperbolic arc cosine of Z.  */
+__MATHCALL (cacosh, (_Mdouble_complex_ __z));
+libm_hidden_proto(cacosh)
+/* Hyperbolic arc sine of Z.  */
+__MATHCALL (casinh, (_Mdouble_complex_ __z));
+libm_hidden_proto(casinh)
+/* Hyperbolic arc tangent of Z.  */
+__MATHCALL (catanh, (_Mdouble_complex_ __z));
+libm_hidden_proto(catanh)
+
+/* Hyperbolic cosine of Z.  */
+__MATHCALL (ccosh, (_Mdouble_complex_ __z));
+libm_hidden_proto(ccosh)
+/* Hyperbolic sine of Z.  */
+__MATHCALL (csinh, (_Mdouble_complex_ __z));
+libm_hidden_proto(ccosh)
+/* Hyperbolic tangent of Z.  */
+__MATHCALL (ctanh, (_Mdouble_complex_ __z));
+libm_hidden_proto(ctanh)
+
+
+/* Exponential and logarithmic functions.  */
+
+/* Exponential function of Z.  */
+__MATHCALL (cexp, (_Mdouble_complex_ __z));
+libm_hidden_proto(cexp)
+
+/* Natural logarithm of Z.  */
+__MATHCALL (clog, (_Mdouble_complex_ __z));
+libm_hidden_proto(clog)
+
+#ifdef __USE_GNU
+/* The base 10 logarithm is not defined by the standard but to implement
+   the standard C++ library it is handy.  */
+__MATHCALL (clog10, (_Mdouble_complex_ __z));
+libm_hidden_proto(clog10)
+#endif
+
+/* Power functions.  */
+
+/* Return X to the Y power.  */
+__MATHCALL (cpow, (_Mdouble_complex_ __x, _Mdouble_complex_ __y));
+libm_hidden_proto(cpow)
+
+/* Return the square root of Z.  */
+__MATHCALL (csqrt, (_Mdouble_complex_ __z));
+libm_hidden_proto(csqrt)
+
+
+/* Absolute value, conjugates, and projection.  */
+
+/* Absolute value of Z.  */
+__MATHDECL (_Mdouble_,cabs, (_Mdouble_complex_ __z));
+libm_hidden_proto(cabs)
+
+/* Argument value of Z.  */
+__MATHDECL (_Mdouble_,carg, (_Mdouble_complex_ __z));
+libm_hidden_proto(carg)
+
+/* Complex conjugate of Z.  */
+__MATHCALL (conj, (_Mdouble_complex_ __z));
+libm_hidden_proto(conj)
+
+/* Projection of Z onto the Riemann sphere.  */
+__MATHCALL (cproj, (_Mdouble_complex_ __z));
+libm_hidden_proto(cproj)
+
+
+/* Decomposing complex values.  */
+
+/* Imaginary part of Z.  */
+__MATHDECL (_Mdouble_,cimag, (_Mdouble_complex_ __z));
+libm_hidden_proto(cimag)
+
+/* Real part of Z.  */
+__MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z));
+libm_hidden_proto(creal)
+
+
+/* Now some optimized versions.  GCC has handy notations for these
+   functions.  Recent GCC handles these as builtin functions so does
+   not need inlines.  */
+#if defined __GNUC__ && !__GNUC_PREREQ (2, 97) && defined __OPTIMIZE__
+
+/* Imaginary part of Z.  */
+__extern_inline _Mdouble_
+__MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) __THROW
+{
+  return __imag__ __z;
+}
+
+/* Real part of Z.  */
+__extern_inline _Mdouble_
+__MATH_PRECNAME(creal) (_Mdouble_complex_ __z) __THROW
+{
+  return __real__ __z;
+}
+
+/* Complex conjugate of Z.  */
+__extern_inline _Mdouble_complex_
+__MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW
+{
+  return __extension__ ~__z;
+}
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/confname.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/confname.h
new file mode 100644
index 0000000..97ddd47
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/confname.h
@@ -0,0 +1,681 @@
+/* `sysconf', `pathconf', and `confstr' NAME values.  Generic version.
+   Copyright (C) 1993,1995-1998,2000,2001,2003,2004,2007,2009
+   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 _UNISTD_H
+# error "Never use <bits/confname.h> directly; include <unistd.h> instead."
+#endif
+
+/* Values for the NAME argument to `pathconf' and `fpathconf'.  */
+enum
+  {
+    _PC_LINK_MAX,
+#define	_PC_LINK_MAX			_PC_LINK_MAX
+    _PC_MAX_CANON,
+#define	_PC_MAX_CANON			_PC_MAX_CANON
+    _PC_MAX_INPUT,
+#define	_PC_MAX_INPUT			_PC_MAX_INPUT
+    _PC_NAME_MAX,
+#define	_PC_NAME_MAX			_PC_NAME_MAX
+    _PC_PATH_MAX,
+#define	_PC_PATH_MAX			_PC_PATH_MAX
+    _PC_PIPE_BUF,
+#define	_PC_PIPE_BUF			_PC_PIPE_BUF
+    _PC_CHOWN_RESTRICTED,
+#define	_PC_CHOWN_RESTRICTED		_PC_CHOWN_RESTRICTED
+    _PC_NO_TRUNC,
+#define	_PC_NO_TRUNC			_PC_NO_TRUNC
+    _PC_VDISABLE,
+#define _PC_VDISABLE			_PC_VDISABLE
+    _PC_SYNC_IO,
+#define	_PC_SYNC_IO			_PC_SYNC_IO
+    _PC_ASYNC_IO,
+#define	_PC_ASYNC_IO			_PC_ASYNC_IO
+    _PC_PRIO_IO,
+#define	_PC_PRIO_IO			_PC_PRIO_IO
+    _PC_SOCK_MAXBUF,
+#define	_PC_SOCK_MAXBUF			_PC_SOCK_MAXBUF
+    _PC_FILESIZEBITS,
+#define _PC_FILESIZEBITS		_PC_FILESIZEBITS
+    _PC_REC_INCR_XFER_SIZE,
+#define _PC_REC_INCR_XFER_SIZE		_PC_REC_INCR_XFER_SIZE
+    _PC_REC_MAX_XFER_SIZE,
+#define _PC_REC_MAX_XFER_SIZE		_PC_REC_MAX_XFER_SIZE
+    _PC_REC_MIN_XFER_SIZE,
+#define _PC_REC_MIN_XFER_SIZE		_PC_REC_MIN_XFER_SIZE
+    _PC_REC_XFER_ALIGN,
+#define _PC_REC_XFER_ALIGN		_PC_REC_XFER_ALIGN
+    _PC_ALLOC_SIZE_MIN,
+#define _PC_ALLOC_SIZE_MIN		_PC_ALLOC_SIZE_MIN
+    _PC_SYMLINK_MAX,
+#define _PC_SYMLINK_MAX			_PC_SYMLINK_MAX
+    _PC_2_SYMLINKS
+#define _PC_2_SYMLINKS			_PC_2_SYMLINKS
+  };
+
+/* Values for the argument to `sysconf'.  */
+enum
+  {
+    _SC_ARG_MAX,
+#define	_SC_ARG_MAX			_SC_ARG_MAX
+    _SC_CHILD_MAX,
+#define	_SC_CHILD_MAX			_SC_CHILD_MAX
+    _SC_CLK_TCK,
+#define	_SC_CLK_TCK			_SC_CLK_TCK
+    _SC_NGROUPS_MAX,
+#define	_SC_NGROUPS_MAX			_SC_NGROUPS_MAX
+    _SC_OPEN_MAX,
+#define	_SC_OPEN_MAX			_SC_OPEN_MAX
+    _SC_STREAM_MAX,
+#define	_SC_STREAM_MAX			_SC_STREAM_MAX
+    _SC_TZNAME_MAX,
+#define	_SC_TZNAME_MAX			_SC_TZNAME_MAX
+    _SC_JOB_CONTROL,
+#define	_SC_JOB_CONTROL			_SC_JOB_CONTROL
+    _SC_SAVED_IDS,
+#define	_SC_SAVED_IDS			_SC_SAVED_IDS
+    _SC_REALTIME_SIGNALS,
+#define	_SC_REALTIME_SIGNALS		_SC_REALTIME_SIGNALS
+    _SC_PRIORITY_SCHEDULING,
+#define	_SC_PRIORITY_SCHEDULING		_SC_PRIORITY_SCHEDULING
+    _SC_TIMERS,
+#define	_SC_TIMERS			_SC_TIMERS
+    _SC_ASYNCHRONOUS_IO,
+#define	_SC_ASYNCHRONOUS_IO		_SC_ASYNCHRONOUS_IO
+    _SC_PRIORITIZED_IO,
+#define	_SC_PRIORITIZED_IO		_SC_PRIORITIZED_IO
+    _SC_SYNCHRONIZED_IO,
+#define	_SC_SYNCHRONIZED_IO		_SC_SYNCHRONIZED_IO
+    _SC_FSYNC,
+#define	_SC_FSYNC			_SC_FSYNC
+    _SC_MAPPED_FILES,
+#define	_SC_MAPPED_FILES		_SC_MAPPED_FILES
+    _SC_MEMLOCK,
+#define	_SC_MEMLOCK			_SC_MEMLOCK
+    _SC_MEMLOCK_RANGE,
+#define	_SC_MEMLOCK_RANGE		_SC_MEMLOCK_RANGE
+    _SC_MEMORY_PROTECTION,
+#define	_SC_MEMORY_PROTECTION		_SC_MEMORY_PROTECTION
+    _SC_MESSAGE_PASSING,
+#define	_SC_MESSAGE_PASSING		_SC_MESSAGE_PASSING
+    _SC_SEMAPHORES,
+#define	_SC_SEMAPHORES			_SC_SEMAPHORES
+    _SC_SHARED_MEMORY_OBJECTS,
+#define	_SC_SHARED_MEMORY_OBJECTS	_SC_SHARED_MEMORY_OBJECTS
+    _SC_AIO_LISTIO_MAX,
+#define	_SC_AIO_LISTIO_MAX		_SC_AIO_LISTIO_MAX
+    _SC_AIO_MAX,
+#define	_SC_AIO_MAX			_SC_AIO_MAX
+    _SC_AIO_PRIO_DELTA_MAX,
+#define	_SC_AIO_PRIO_DELTA_MAX		_SC_AIO_PRIO_DELTA_MAX
+    _SC_DELAYTIMER_MAX,
+#define	_SC_DELAYTIMER_MAX		_SC_DELAYTIMER_MAX
+    _SC_MQ_OPEN_MAX,
+#define	_SC_MQ_OPEN_MAX			_SC_MQ_OPEN_MAX
+    _SC_MQ_PRIO_MAX,
+#define	_SC_MQ_PRIO_MAX			_SC_MQ_PRIO_MAX
+    _SC_VERSION,
+#define	_SC_VERSION			_SC_VERSION
+    _SC_PAGESIZE,
+#define	_SC_PAGESIZE			_SC_PAGESIZE
+#define	_SC_PAGE_SIZE			_SC_PAGESIZE
+    _SC_RTSIG_MAX,
+#define	_SC_RTSIG_MAX			_SC_RTSIG_MAX
+    _SC_SEM_NSEMS_MAX,
+#define	_SC_SEM_NSEMS_MAX		_SC_SEM_NSEMS_MAX
+    _SC_SEM_VALUE_MAX,
+#define	_SC_SEM_VALUE_MAX		_SC_SEM_VALUE_MAX
+    _SC_SIGQUEUE_MAX,
+#define	_SC_SIGQUEUE_MAX		_SC_SIGQUEUE_MAX
+    _SC_TIMER_MAX,
+#define	_SC_TIMER_MAX			_SC_TIMER_MAX
+
+    /* Values for the argument to `sysconf'
+       corresponding to _POSIX2_* symbols.  */
+    _SC_BC_BASE_MAX,
+#define	_SC_BC_BASE_MAX			_SC_BC_BASE_MAX
+    _SC_BC_DIM_MAX,
+#define	_SC_BC_DIM_MAX			_SC_BC_DIM_MAX
+    _SC_BC_SCALE_MAX,
+#define	_SC_BC_SCALE_MAX		_SC_BC_SCALE_MAX
+    _SC_BC_STRING_MAX,
+#define	_SC_BC_STRING_MAX		_SC_BC_STRING_MAX
+    _SC_COLL_WEIGHTS_MAX,
+#define	_SC_COLL_WEIGHTS_MAX		_SC_COLL_WEIGHTS_MAX
+    _SC_EQUIV_CLASS_MAX,
+#define	_SC_EQUIV_CLASS_MAX		_SC_EQUIV_CLASS_MAX
+    _SC_EXPR_NEST_MAX,
+#define	_SC_EXPR_NEST_MAX		_SC_EXPR_NEST_MAX
+    _SC_LINE_MAX,
+#define	_SC_LINE_MAX			_SC_LINE_MAX
+    _SC_RE_DUP_MAX,
+#define	_SC_RE_DUP_MAX			_SC_RE_DUP_MAX
+    _SC_CHARCLASS_NAME_MAX,
+#define	_SC_CHARCLASS_NAME_MAX		_SC_CHARCLASS_NAME_MAX
+
+    _SC_2_VERSION,
+#define	_SC_2_VERSION			_SC_2_VERSION
+    _SC_2_C_BIND,
+#define	_SC_2_C_BIND			_SC_2_C_BIND
+    _SC_2_C_DEV,
+#define	_SC_2_C_DEV			_SC_2_C_DEV
+    _SC_2_FORT_DEV,
+#define	_SC_2_FORT_DEV			_SC_2_FORT_DEV
+    _SC_2_FORT_RUN,
+#define	_SC_2_FORT_RUN			_SC_2_FORT_RUN
+    _SC_2_SW_DEV,
+#define	_SC_2_SW_DEV			_SC_2_SW_DEV
+    _SC_2_LOCALEDEF,
+#define	_SC_2_LOCALEDEF			_SC_2_LOCALEDEF
+
+    _SC_PII,
+#define	_SC_PII				_SC_PII
+    _SC_PII_XTI,
+#define	_SC_PII_XTI			_SC_PII_XTI
+    _SC_PII_SOCKET,
+#define	_SC_PII_SOCKET			_SC_PII_SOCKET
+    _SC_PII_INTERNET,
+#define	_SC_PII_INTERNET		_SC_PII_INTERNET
+    _SC_PII_OSI,
+#define	_SC_PII_OSI			_SC_PII_OSI
+    _SC_POLL,
+#define	_SC_POLL			_SC_POLL
+    _SC_SELECT,
+#define	_SC_SELECT			_SC_SELECT
+    _SC_UIO_MAXIOV,
+#define	_SC_UIO_MAXIOV			_SC_UIO_MAXIOV
+    _SC_IOV_MAX = _SC_UIO_MAXIOV,
+#define _SC_IOV_MAX			_SC_IOV_MAX
+    _SC_PII_INTERNET_STREAM,
+#define	_SC_PII_INTERNET_STREAM		_SC_PII_INTERNET_STREAM
+    _SC_PII_INTERNET_DGRAM,
+#define	_SC_PII_INTERNET_DGRAM		_SC_PII_INTERNET_DGRAM
+    _SC_PII_OSI_COTS,
+#define	_SC_PII_OSI_COTS		_SC_PII_OSI_COTS
+    _SC_PII_OSI_CLTS,
+#define	_SC_PII_OSI_CLTS		_SC_PII_OSI_CLTS
+    _SC_PII_OSI_M,
+#define	_SC_PII_OSI_M			_SC_PII_OSI_M
+    _SC_T_IOV_MAX,
+#define	_SC_T_IOV_MAX			_SC_T_IOV_MAX
+
+    /* Values according to POSIX 1003.1c (POSIX threads).  */
+    _SC_THREADS,
+#define	_SC_THREADS			_SC_THREADS
+    _SC_THREAD_SAFE_FUNCTIONS,
+#define _SC_THREAD_SAFE_FUNCTIONS	_SC_THREAD_SAFE_FUNCTIONS
+    _SC_GETGR_R_SIZE_MAX,
+#define	_SC_GETGR_R_SIZE_MAX		_SC_GETGR_R_SIZE_MAX
+    _SC_GETPW_R_SIZE_MAX,
+#define	_SC_GETPW_R_SIZE_MAX		_SC_GETPW_R_SIZE_MAX
+    _SC_LOGIN_NAME_MAX,
+#define	_SC_LOGIN_NAME_MAX		_SC_LOGIN_NAME_MAX
+    _SC_TTY_NAME_MAX,
+#define	_SC_TTY_NAME_MAX		_SC_TTY_NAME_MAX
+    _SC_THREAD_DESTRUCTOR_ITERATIONS,
+#define	_SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS
+    _SC_THREAD_KEYS_MAX,
+#define	_SC_THREAD_KEYS_MAX		_SC_THREAD_KEYS_MAX
+    _SC_THREAD_STACK_MIN,
+#define	_SC_THREAD_STACK_MIN		_SC_THREAD_STACK_MIN
+    _SC_THREAD_THREADS_MAX,
+#define	_SC_THREAD_THREADS_MAX		_SC_THREAD_THREADS_MAX
+    _SC_THREAD_ATTR_STACKADDR,
+#define	_SC_THREAD_ATTR_STACKADDR	_SC_THREAD_ATTR_STACKADDR
+    _SC_THREAD_ATTR_STACKSIZE,
+#define	_SC_THREAD_ATTR_STACKSIZE	_SC_THREAD_ATTR_STACKSIZE
+    _SC_THREAD_PRIORITY_SCHEDULING,
+#define	_SC_THREAD_PRIORITY_SCHEDULING	_SC_THREAD_PRIORITY_SCHEDULING
+    _SC_THREAD_PRIO_INHERIT,
+#define	_SC_THREAD_PRIO_INHERIT		_SC_THREAD_PRIO_INHERIT
+    _SC_THREAD_PRIO_PROTECT,
+#define	_SC_THREAD_PRIO_PROTECT		_SC_THREAD_PRIO_PROTECT
+    _SC_THREAD_PROCESS_SHARED,
+#define	_SC_THREAD_PROCESS_SHARED	_SC_THREAD_PROCESS_SHARED
+
+    _SC_NPROCESSORS_CONF,
+#define _SC_NPROCESSORS_CONF		_SC_NPROCESSORS_CONF
+    _SC_NPROCESSORS_ONLN,
+#define _SC_NPROCESSORS_ONLN		_SC_NPROCESSORS_ONLN
+    _SC_PHYS_PAGES,
+#define _SC_PHYS_PAGES			_SC_PHYS_PAGES
+    _SC_AVPHYS_PAGES,
+#define _SC_AVPHYS_PAGES		_SC_AVPHYS_PAGES
+    _SC_ATEXIT_MAX,
+#define _SC_ATEXIT_MAX			_SC_ATEXIT_MAX
+    _SC_PASS_MAX,
+#define _SC_PASS_MAX			_SC_PASS_MAX
+
+    _SC_XOPEN_VERSION,
+#define _SC_XOPEN_VERSION		_SC_XOPEN_VERSION
+    _SC_XOPEN_XCU_VERSION,
+#define _SC_XOPEN_XCU_VERSION		_SC_XOPEN_XCU_VERSION
+    _SC_XOPEN_UNIX,
+#define _SC_XOPEN_UNIX			_SC_XOPEN_UNIX
+    _SC_XOPEN_CRYPT,
+#define _SC_XOPEN_CRYPT			_SC_XOPEN_CRYPT
+    _SC_XOPEN_ENH_I18N,
+#define _SC_XOPEN_ENH_I18N		_SC_XOPEN_ENH_I18N
+    _SC_XOPEN_SHM,
+#define _SC_XOPEN_SHM			_SC_XOPEN_SHM
+
+    _SC_2_CHAR_TERM,
+#define _SC_2_CHAR_TERM			_SC_2_CHAR_TERM
+    _SC_2_C_VERSION,
+#define _SC_2_C_VERSION			_SC_2_C_VERSION
+    _SC_2_UPE,
+#define _SC_2_UPE			_SC_2_UPE
+
+    _SC_XOPEN_XPG2,
+#define _SC_XOPEN_XPG2			_SC_XOPEN_XPG2
+    _SC_XOPEN_XPG3,
+#define _SC_XOPEN_XPG3			_SC_XOPEN_XPG3
+    _SC_XOPEN_XPG4,
+#define _SC_XOPEN_XPG4			_SC_XOPEN_XPG4
+
+    _SC_CHAR_BIT,
+#define	_SC_CHAR_BIT			_SC_CHAR_BIT
+    _SC_CHAR_MAX,
+#define	_SC_CHAR_MAX			_SC_CHAR_MAX
+    _SC_CHAR_MIN,
+#define	_SC_CHAR_MIN			_SC_CHAR_MIN
+    _SC_INT_MAX,
+#define	_SC_INT_MAX			_SC_INT_MAX
+    _SC_INT_MIN,
+#define	_SC_INT_MIN			_SC_INT_MIN
+    _SC_LONG_BIT,
+#define	_SC_LONG_BIT			_SC_LONG_BIT
+    _SC_WORD_BIT,
+#define	_SC_WORD_BIT			_SC_WORD_BIT
+    _SC_MB_LEN_MAX,
+#define	_SC_MB_LEN_MAX			_SC_MB_LEN_MAX
+    _SC_NZERO,
+#define	_SC_NZERO			_SC_NZERO
+    _SC_SSIZE_MAX,
+#define	_SC_SSIZE_MAX			_SC_SSIZE_MAX
+    _SC_SCHAR_MAX,
+#define	_SC_SCHAR_MAX			_SC_SCHAR_MAX
+    _SC_SCHAR_MIN,
+#define	_SC_SCHAR_MIN			_SC_SCHAR_MIN
+    _SC_SHRT_MAX,
+#define	_SC_SHRT_MAX			_SC_SHRT_MAX
+    _SC_SHRT_MIN,
+#define	_SC_SHRT_MIN			_SC_SHRT_MIN
+    _SC_UCHAR_MAX,
+#define	_SC_UCHAR_MAX			_SC_UCHAR_MAX
+    _SC_UINT_MAX,
+#define	_SC_UINT_MAX			_SC_UINT_MAX
+    _SC_ULONG_MAX,
+#define	_SC_ULONG_MAX			_SC_ULONG_MAX
+    _SC_USHRT_MAX,
+#define	_SC_USHRT_MAX			_SC_USHRT_MAX
+
+    _SC_NL_ARGMAX,
+#define	_SC_NL_ARGMAX			_SC_NL_ARGMAX
+    _SC_NL_LANGMAX,
+#define	_SC_NL_LANGMAX			_SC_NL_LANGMAX
+    _SC_NL_MSGMAX,
+#define	_SC_NL_MSGMAX			_SC_NL_MSGMAX
+    _SC_NL_NMAX,
+#define	_SC_NL_NMAX			_SC_NL_NMAX
+    _SC_NL_SETMAX,
+#define	_SC_NL_SETMAX			_SC_NL_SETMAX
+    _SC_NL_TEXTMAX,
+#define	_SC_NL_TEXTMAX			_SC_NL_TEXTMAX
+
+    _SC_XBS5_ILP32_OFF32,
+#define _SC_XBS5_ILP32_OFF32		_SC_XBS5_ILP32_OFF32
+    _SC_XBS5_ILP32_OFFBIG,
+#define _SC_XBS5_ILP32_OFFBIG		_SC_XBS5_ILP32_OFFBIG
+    _SC_XBS5_LP64_OFF64,
+#define _SC_XBS5_LP64_OFF64		_SC_XBS5_LP64_OFF64
+    _SC_XBS5_LPBIG_OFFBIG,
+#define _SC_XBS5_LPBIG_OFFBIG		_SC_XBS5_LPBIG_OFFBIG
+
+    _SC_XOPEN_LEGACY,
+#define _SC_XOPEN_LEGACY		_SC_XOPEN_LEGACY
+    _SC_XOPEN_REALTIME,
+#define _SC_XOPEN_REALTIME		_SC_XOPEN_REALTIME
+    _SC_XOPEN_REALTIME_THREADS,
+#define _SC_XOPEN_REALTIME_THREADS	_SC_XOPEN_REALTIME_THREADS
+
+    _SC_ADVISORY_INFO,
+#define _SC_ADVISORY_INFO		_SC_ADVISORY_INFO
+    _SC_BARRIERS,
+#define _SC_BARRIERS			_SC_BARRIERS
+    _SC_BASE,
+#define _SC_BASE			_SC_BASE
+    _SC_C_LANG_SUPPORT,
+#define _SC_C_LANG_SUPPORT		_SC_C_LANG_SUPPORT
+    _SC_C_LANG_SUPPORT_R,
+#define _SC_C_LANG_SUPPORT_R		_SC_C_LANG_SUPPORT_R
+    _SC_CLOCK_SELECTION,
+#define _SC_CLOCK_SELECTION		_SC_CLOCK_SELECTION
+    _SC_CPUTIME,
+#define _SC_CPUTIME			_SC_CPUTIME
+    _SC_THREAD_CPUTIME,
+#define _SC_THREAD_CPUTIME		_SC_THREAD_CPUTIME
+    _SC_DEVICE_IO,
+#define _SC_DEVICE_IO			_SC_DEVICE_IO
+    _SC_DEVICE_SPECIFIC,
+#define _SC_DEVICE_SPECIFIC		_SC_DEVICE_SPECIFIC
+    _SC_DEVICE_SPECIFIC_R,
+#define _SC_DEVICE_SPECIFIC_R		_SC_DEVICE_SPECIFIC_R
+    _SC_FD_MGMT,
+#define _SC_FD_MGMT			_SC_FD_MGMT
+    _SC_FIFO,
+#define _SC_FIFO			_SC_FIFO
+    _SC_PIPE,
+#define _SC_PIPE			_SC_PIPE
+    _SC_FILE_ATTRIBUTES,
+#define _SC_FILE_ATTRIBUTES		_SC_FILE_ATTRIBUTES
+    _SC_FILE_LOCKING,
+#define _SC_FILE_LOCKING		_SC_FILE_LOCKING
+    _SC_FILE_SYSTEM,
+#define _SC_FILE_SYSTEM			_SC_FILE_SYSTEM
+    _SC_MONOTONIC_CLOCK,
+#define _SC_MONOTONIC_CLOCK		_SC_MONOTONIC_CLOCK
+    _SC_MULTI_PROCESS,
+#define _SC_MULTI_PROCESS		_SC_MULTI_PROCESS
+    _SC_SINGLE_PROCESS,
+#define _SC_SINGLE_PROCESS		_SC_SINGLE_PROCESS
+    _SC_NETWORKING,
+#define _SC_NETWORKING			_SC_NETWORKING
+    _SC_READER_WRITER_LOCKS,
+#define _SC_READER_WRITER_LOCKS		_SC_READER_WRITER_LOCKS
+    _SC_SPIN_LOCKS,
+#define _SC_SPIN_LOCKS			_SC_SPIN_LOCKS
+    _SC_REGEXP,
+#define _SC_REGEXP			_SC_REGEXP
+    _SC_REGEX_VERSION,
+#define _SC_REGEX_VERSION		_SC_REGEX_VERSION
+    _SC_SHELL,
+#define _SC_SHELL			_SC_SHELL
+    _SC_SIGNALS,
+#define _SC_SIGNALS			_SC_SIGNALS
+    _SC_SPAWN,
+#define _SC_SPAWN			_SC_SPAWN
+    _SC_SPORADIC_SERVER,
+#define _SC_SPORADIC_SERVER		_SC_SPORADIC_SERVER
+    _SC_THREAD_SPORADIC_SERVER,
+#define _SC_THREAD_SPORADIC_SERVER	_SC_THREAD_SPORADIC_SERVER
+    _SC_SYSTEM_DATABASE,
+#define _SC_SYSTEM_DATABASE		_SC_SYSTEM_DATABASE
+    _SC_SYSTEM_DATABASE_R,
+#define _SC_SYSTEM_DATABASE_R		_SC_SYSTEM_DATABASE_R
+    _SC_TIMEOUTS,
+#define _SC_TIMEOUTS			_SC_TIMEOUTS
+    _SC_TYPED_MEMORY_OBJECTS,
+#define _SC_TYPED_MEMORY_OBJECTS	_SC_TYPED_MEMORY_OBJECTS
+    _SC_USER_GROUPS,
+#define _SC_USER_GROUPS			_SC_USER_GROUPS
+    _SC_USER_GROUPS_R,
+#define _SC_USER_GROUPS_R		_SC_USER_GROUPS_R
+    _SC_2_PBS,
+#define _SC_2_PBS			_SC_2_PBS
+    _SC_2_PBS_ACCOUNTING,
+#define _SC_2_PBS_ACCOUNTING		_SC_2_PBS_ACCOUNTING
+    _SC_2_PBS_LOCATE,
+#define _SC_2_PBS_LOCATE		_SC_2_PBS_LOCATE
+    _SC_2_PBS_MESSAGE,
+#define _SC_2_PBS_MESSAGE		_SC_2_PBS_MESSAGE
+    _SC_2_PBS_TRACK,
+#define _SC_2_PBS_TRACK			_SC_2_PBS_TRACK
+    _SC_SYMLOOP_MAX,
+#define _SC_SYMLOOP_MAX			_SC_SYMLOOP_MAX
+    _SC_STREAMS,
+#define _SC_STREAMS			_SC_STREAMS
+    _SC_2_PBS_CHECKPOINT,
+#define _SC_2_PBS_CHECKPOINT		_SC_2_PBS_CHECKPOINT
+
+    _SC_V6_ILP32_OFF32,
+#define _SC_V6_ILP32_OFF32		_SC_V6_ILP32_OFF32
+    _SC_V6_ILP32_OFFBIG,
+#define _SC_V6_ILP32_OFFBIG		_SC_V6_ILP32_OFFBIG
+    _SC_V6_LP64_OFF64,
+#define _SC_V6_LP64_OFF64		_SC_V6_LP64_OFF64
+    _SC_V6_LPBIG_OFFBIG,
+#define _SC_V6_LPBIG_OFFBIG		_SC_V6_LPBIG_OFFBIG
+
+    _SC_HOST_NAME_MAX,
+#define _SC_HOST_NAME_MAX		_SC_HOST_NAME_MAX
+    _SC_TRACE,
+#define _SC_TRACE			_SC_TRACE
+    _SC_TRACE_EVENT_FILTER,
+#define _SC_TRACE_EVENT_FILTER		_SC_TRACE_EVENT_FILTER
+    _SC_TRACE_INHERIT,
+#define _SC_TRACE_INHERIT		_SC_TRACE_INHERIT
+    _SC_TRACE_LOG,
+#define _SC_TRACE_LOG			_SC_TRACE_LOG
+
+    _SC_LEVEL1_ICACHE_SIZE,
+#define _SC_LEVEL1_ICACHE_SIZE		_SC_LEVEL1_ICACHE_SIZE
+    _SC_LEVEL1_ICACHE_ASSOC,
+#define _SC_LEVEL1_ICACHE_ASSOC		_SC_LEVEL1_ICACHE_ASSOC
+    _SC_LEVEL1_ICACHE_LINESIZE,
+#define _SC_LEVEL1_ICACHE_LINESIZE	_SC_LEVEL1_ICACHE_LINESIZE
+    _SC_LEVEL1_DCACHE_SIZE,
+#define _SC_LEVEL1_DCACHE_SIZE		_SC_LEVEL1_DCACHE_SIZE
+    _SC_LEVEL1_DCACHE_ASSOC,
+#define _SC_LEVEL1_DCACHE_ASSOC		_SC_LEVEL1_DCACHE_ASSOC
+    _SC_LEVEL1_DCACHE_LINESIZE,
+#define _SC_LEVEL1_DCACHE_LINESIZE	_SC_LEVEL1_DCACHE_LINESIZE
+    _SC_LEVEL2_CACHE_SIZE,
+#define _SC_LEVEL2_CACHE_SIZE		_SC_LEVEL2_CACHE_SIZE
+    _SC_LEVEL2_CACHE_ASSOC,
+#define _SC_LEVEL2_CACHE_ASSOC		_SC_LEVEL2_CACHE_ASSOC
+    _SC_LEVEL2_CACHE_LINESIZE,
+#define _SC_LEVEL2_CACHE_LINESIZE	_SC_LEVEL2_CACHE_LINESIZE
+    _SC_LEVEL3_CACHE_SIZE,
+#define _SC_LEVEL3_CACHE_SIZE		_SC_LEVEL3_CACHE_SIZE
+    _SC_LEVEL3_CACHE_ASSOC,
+#define _SC_LEVEL3_CACHE_ASSOC		_SC_LEVEL3_CACHE_ASSOC
+    _SC_LEVEL3_CACHE_LINESIZE,
+#define _SC_LEVEL3_CACHE_LINESIZE	_SC_LEVEL3_CACHE_LINESIZE
+    _SC_LEVEL4_CACHE_SIZE,
+#define _SC_LEVEL4_CACHE_SIZE		_SC_LEVEL4_CACHE_SIZE
+    _SC_LEVEL4_CACHE_ASSOC,
+#define _SC_LEVEL4_CACHE_ASSOC		_SC_LEVEL4_CACHE_ASSOC
+    _SC_LEVEL4_CACHE_LINESIZE,
+#define _SC_LEVEL4_CACHE_LINESIZE	_SC_LEVEL4_CACHE_LINESIZE
+    /* Leave room here, maybe we need a few more cache levels some day.  */
+
+    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
+#define _SC_IPV6			_SC_IPV6
+    _SC_RAW_SOCKETS,
+#define _SC_RAW_SOCKETS			_SC_RAW_SOCKETS
+
+    _SC_V7_ILP32_OFF32,
+#define _SC_V7_ILP32_OFF32		_SC_V7_ILP32_OFF32
+    _SC_V7_ILP32_OFFBIG,
+#define _SC_V7_ILP32_OFFBIG		_SC_V7_ILP32_OFFBIG
+    _SC_V7_LP64_OFF64,
+#define _SC_V7_LP64_OFF64		_SC_V7_LP64_OFF64
+    _SC_V7_LPBIG_OFFBIG,
+#define _SC_V7_LPBIG_OFFBIG		_SC_V7_LPBIG_OFFBIG
+
+    _SC_SS_REPL_MAX,
+#define _SC_SS_REPL_MAX			_SC_SS_REPL_MAX
+
+    _SC_TRACE_EVENT_NAME_MAX,
+#define _SC_TRACE_EVENT_NAME_MAX	_SC_TRACE_EVENT_NAME_MAX
+    _SC_TRACE_NAME_MAX,
+#define _SC_TRACE_NAME_MAX		_SC_TRACE_NAME_MAX
+    _SC_TRACE_SYS_MAX,
+#define _SC_TRACE_SYS_MAX		_SC_TRACE_SYS_MAX
+    _SC_TRACE_USER_EVENT_MAX,
+#define _SC_TRACE_USER_EVENT_MAX	_SC_TRACE_USER_EVENT_MAX
+
+    _SC_XOPEN_STREAMS,
+#define _SC_XOPEN_STREAMS		_SC_XOPEN_STREAMS
+
+    _SC_THREAD_ROBUST_PRIO_INHERIT,
+#define _SC_THREAD_ROBUST_PRIO_INHERIT	_SC_THREAD_ROBUST_PRIO_INHERIT
+    _SC_THREAD_ROBUST_PRIO_PROTECT
+#define _SC_THREAD_ROBUST_PRIO_PROTECT	_SC_THREAD_ROBUST_PRIO_PROTECT
+  };
+
+/* Values for the NAME argument to `confstr'.  */
+enum
+  {
+    _CS_PATH,			/* The default search path.  */
+#define _CS_PATH		_CS_PATH
+
+    _CS_V6_WIDTH_RESTRICTED_ENVS,
+#define _CS_V6_WIDTH_RESTRICTED_ENVS	_CS_V6_WIDTH_RESTRICTED_ENVS
+#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	_CS_V6_WIDTH_RESTRICTED_ENVS
+
+    _CS_GNU_LIBC_VERSION,
+#define _CS_GNU_LIBC_VERSION	_CS_GNU_LIBC_VERSION
+    _CS_GNU_LIBPTHREAD_VERSION,
+#define _CS_GNU_LIBPTHREAD_VERSION	_CS_GNU_LIBPTHREAD_VERSION
+
+    _CS_V5_WIDTH_RESTRICTED_ENVS,
+#define _CS_V5_WIDTH_RESTRICTED_ENVS	_CS_V5_WIDTH_RESTRICTED_ENVS
+#define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS	_CS_V5_WIDTH_RESTRICTED_ENVS
+
+    _CS_V7_WIDTH_RESTRICTED_ENVS,
+#define _CS_V7_WIDTH_RESTRICTED_ENVS	_CS_V7_WIDTH_RESTRICTED_ENVS
+#define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS	_CS_V7_WIDTH_RESTRICTED_ENVS
+
+# if (defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
+     || defined __USE_LARGEFILE)
+    _CS_LFS_CFLAGS = 1000,
+#define _CS_LFS_CFLAGS	_CS_LFS_CFLAGS
+    _CS_LFS_LDFLAGS,
+#define _CS_LFS_LDFLAGS	_CS_LFS_LDFLAGS
+    _CS_LFS_LIBS,
+#define _CS_LFS_LIBS		_CS_LFS_LIBS
+    _CS_LFS_LINTFLAGS,
+#define _CS_LFS_LINTFLAGS	_CS_LFS_LINTFLAGS
+    _CS_LFS64_CFLAGS,
+#define _CS_LFS64_CFLAGS	_CS_LFS64_CFLAGS
+    _CS_LFS64_LDFLAGS,
+#define _CS_LFS64_LDFLAGS	_CS_LFS64_LDFLAGS
+    _CS_LFS64_LIBS,
+#define _CS_LFS64_LIBS	_CS_LFS64_LIBS
+    _CS_LFS64_LINTFLAGS,
+#define _CS_LFS64_LINTFLAGS	_CS_LFS64_LINTFLAGS
+# endif
+
+# ifdef __USE_UNIX98
+    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
+#define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
+    _CS_XBS5_ILP32_OFF32_LDFLAGS,
+#define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
+    _CS_XBS5_ILP32_OFF32_LIBS,
+#define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
+    _CS_XBS5_ILP32_OFF32_LINTFLAGS,
+#define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
+    _CS_XBS5_ILP32_OFFBIG_CFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
+    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
+    _CS_XBS5_ILP32_OFFBIG_LIBS,
+#define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
+    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
+    _CS_XBS5_LP64_OFF64_CFLAGS,
+#define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
+    _CS_XBS5_LP64_OFF64_LDFLAGS,
+#define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
+    _CS_XBS5_LP64_OFF64_LIBS,
+#define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
+    _CS_XBS5_LP64_OFF64_LINTFLAGS,
+#define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
+    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
+    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
+    _CS_XBS5_LPBIG_OFFBIG_LIBS,
+#define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
+    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+# endif
+
+# ifdef __USE_XOPEN2K
+    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS
+    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
+    _CS_POSIX_V6_ILP32_OFF32_LIBS,
+#define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS
+    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS
+    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
+    _CS_POSIX_V6_LP64_OFF64_CFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS
+    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS
+    _CS_POSIX_V6_LP64_OFF64_LIBS,
+#define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS
+    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+# endif
+
+# ifdef __USE_XOPEN2K8
+    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,
+#define _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS
+    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
+#define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS
+    _CS_POSIX_V7_ILP32_OFF32_LIBS,
+#define _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS
+    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
+#define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS
+    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
+#define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS
+    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS
+    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,
+#define _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS
+    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
+#define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS
+    _CS_POSIX_V7_LP64_OFF64_CFLAGS,
+#define _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS
+    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,
+#define _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS
+    _CS_POSIX_V7_LP64_OFF64_LIBS,
+#define _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS
+    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
+#define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS
+    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
+#define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS
+    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS
+    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
+#define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS
+    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS
+#define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS
+# endif
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/dirent.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/dirent.h
new file mode 100644
index 0000000..76794b0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/dirent.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1996, 1997 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 _DIRENT_H
+# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
+#endif
+
+struct dirent
+  {
+#ifndef __USE_FILE_OFFSET64
+    __ino_t d_ino;
+    __off_t d_off;
+#else
+    __ino64_t d_ino;
+    __off64_t d_off;
+#endif
+    unsigned short int d_reclen;
+    unsigned char d_type;
+    char d_name[256];		/* We must not include limits.h! */
+  };
+
+#ifdef __USE_LARGEFILE64
+struct dirent64
+  {
+    __ino64_t d_ino;
+    __off64_t d_off;
+    unsigned short int d_reclen;
+    unsigned char d_type;
+    char d_name[256];		/* We must not include limits.h! */
+  };
+#endif
+
+#define d_fileno	d_ino	/* Backwards compatibility.  */
+
+#undef  _DIRENT_HAVE_D_NAMLEN
+#define _DIRENT_HAVE_D_RECLEN
+#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/dlfcn.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/dlfcn.h
new file mode 100644
index 0000000..47b42ad
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/dlfcn.h
@@ -0,0 +1,67 @@
+/* System dependent definitions for run-time dynamic loading.
+   Copyright (C) 1996-2001, 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 _DLFCN_H
+# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
+#endif
+
+/* The MODE argument to `dlopen' contains one of the following: */
+#define RTLD_LAZY	0x00001	/* Lazy function call binding.  */
+#define RTLD_NOW	0x00002	/* Immediate function call binding.  */
+#define RTLD_BINDING_MASK   0x3	/* Mask of binding time value.  */
+#define RTLD_NOLOAD	0x00004	/* Do not load the object.  */
+#if 0 /* uClibc doesnt support these */
+#define RTLD_DEEPBIND	0x00008	/* Use deep binding.  */
+#endif
+
+/* If the following bit is set in the MODE argument to `dlopen',
+   the symbols of the loaded object and its dependencies are made
+   visible as if the object were linked directly into the program.  */
+#define RTLD_GLOBAL	0x00100
+
+/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
+   The implementation does this by default and so we can define the
+   value to zero.  */
+#define RTLD_LOCAL	0
+
+/* Do not delete object when closed.  */
+#define RTLD_NODELETE	0x01000
+
+#if 0 /*def __USE_GNU*/
+/* To support profiling of shared objects it is a good idea to call
+   the function found using `dlsym' using the following macro since
+   these calls do not use the PLT.  But this would mean the dynamic
+   loader has no chance to find out when the function is called.  The
+   macro applies the necessary magic so that profiling is possible.
+   Rewrite
+	foo = (*fctp) (arg1, arg2);
+   into
+        foo = DL_CALL_FCT (fctp, (arg1, arg2));
+*/
+# define DL_CALL_FCT(fctp, args) \
+  (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args)
+
+__BEGIN_DECLS
+
+/* This function calls the profiling functions.  */
+extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW;
+
+__END_DECLS
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/elfclass.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/elfclass.h
new file mode 100644
index 0000000..180227d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/elfclass.h
@@ -0,0 +1,14 @@
+/* This file specifies the native word size of the machine, which indicates
+   the ELF file class used for executables and shared objects on this
+   machine.  */
+
+#ifndef _LINK_H
+# error "Never use <bits/elfclass.h> directly; include <link.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#define __ELF_NATIVE_CLASS __WORDSIZE
+
+/* The entries in the .hash table always have a size of 32 bits.  */
+typedef uint32_t Elf_Symndx;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/endian.h
new file mode 100644
index 0000000..0086a1c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/endian.h
@@ -0,0 +1,18 @@
+/* This file should define __BYTE_ORDER as appropriate for the machine
+   in question.  See string/endian.h for how to define it.
+
+   If only the stub bits/endian.h applies to a particular configuration,
+   bytesex.h is generated by running a program on the host machine.
+   So if cross-compiling to a machine with a different byte order,
+   the bits/endian.h file for that machine must exist.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#error Machine byte order unknown.
+
+#if 0
+#define __BYTE_ORDER __BIG_ENDIAN
+#define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/environments.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/environments.h
new file mode 100644
index 0000000..548ea7f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/environments.h
@@ -0,0 +1,88 @@
+/* Copyright (C) 1999, 2001, 2004, 2009 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 _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
+   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
+
+   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
+   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
+   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
+   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
+   used in previous versions of the Unix standard and are available
+   only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* We can never provide environments with 32-bit wide pointers.  */
+# define _POSIX_V7_ILP32_OFF32	-1
+# define _POSIX_V7_ILP32_OFFBIG	-1
+# define _POSIX_V6_ILP32_OFF32	-1
+# define _POSIX_V6_ILP32_OFFBIG	-1
+# define _XBS5_ILP32_OFF32	-1
+# define _XBS5_ILP32_OFFBIG	-1
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
+# define _POSIX_V7_LP64_OFF64	1
+# define _POSIX_V6_LP64_OFF64	1
+# define _XBS5_LP64_OFF64	1
+
+#else /* __WORDSIZE == 32 */
+
+/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
+   and all platforms support LFS.  */
+# define _POSIX_V7_ILP32_OFF32	1
+# define _POSIX_V7_ILP32_OFFBIG	1
+# define _POSIX_V6_ILP32_OFF32	1
+# define _POSIX_V6_ILP32_OFFBIG	1
+# define _XBS5_ILP32_OFF32	1
+# define _XBS5_ILP32_OFFBIG	1
+
+/* We optionally provide an environment with the above size but an 64-bit
+   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
+
+/* We can never provide environments with 64-bit wide pointers.  */
+# define _POSIX_V7_LP64_OFF64	-1
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LP64_OFF64	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LP64_OFF64	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* CFLAGS.  */
+#define __ILP32_OFFBIG_CFLAGS   "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+
+#endif /* __WORDSIZE == 32 */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/epoll.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/epoll.h
new file mode 100644
index 0000000..0a49b97
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/epoll.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_EPOLL_H
+# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+#endif
+
+/* Flags to be passed to epoll_create1.  */
+enum
+  {
+    EPOLL_CLOEXEC = 02000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 00004000
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/errno.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/errno.h
new file mode 100644
index 0000000..0bf6354
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/errno.h
@@ -0,0 +1,62 @@
+/* Error constants.  Linux specific version.
+   Copyright (C) 1996, 1997, 1998, 1999, 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.  */
+
+#ifdef _ERRNO_H
+
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+# include <linux/errno.h>
+
+/* Linux has no ENOTSUP error code.  */
+# ifndef ENOTSUP
+#  define ENOTSUP EOPNOTSUPP
+# endif
+
+/* Older Linux versions also had no ECANCELED error code.  */
+# ifndef ECANCELED
+#  define ECANCELED	125
+# endif
+
+/* Support for error codes to support robust mutexes was added later, too.  */
+# ifndef EOWNERDEAD
+#  define EOWNERDEAD		130
+#  define ENOTRECOVERABLE	131
+# endif
+
+# ifndef __ASSEMBLER__
+/* Function to get address of global `errno' variable.  */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+libc_hidden_proto(__errno_location)
+
+#  ifdef __UCLIBC_HAS_THREADS__
+/* When using threads, errno is a per-thread value.  */
+#   define errno (*__errno_location ())
+#  endif
+# endif /* !__ASSEMBLER__ */
+#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough.  We must
+   define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+   defined.  */
+# define EDOM	33	/* Math argument out of domain of function.  */
+# define EILSEQ	84	/* Illegal byte sequence.  */
+# define ERANGE	34	/* Math result not representable.  */
+#endif /* !_ERRNO_H && __need_Emath */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fcntl.h
new file mode 100644
index 0000000..be40350
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fcntl.h
@@ -0,0 +1,3 @@
+/* bits/fcntl.h is architecture specific.  */
+#error "This file must be supplied by every Linux architecture."
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenv.h
new file mode 100644
index 0000000..a9cb53b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenv.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Here should be the exception be defined:
+    FE_INVALID
+    FE_DIVBYZERO
+    FE_OVERFLOW
+    FE_UNDERFLOW
+    FE_INEXACT
+   We define no macro which signals no exception is supported.  */
+
+#define FE_ALL_EXCEPT 0
+
+
+/* Here should the rounding modes be defined:
+    FE_TONEAREST
+    FE_DOWNWARD
+    FE_UPWARD
+    FE_TOWARDZERO
+   We define no macro which signals no rounding mode is selectable.  */
+
+
+/* Type representing exception flags.  */
+typedef unsigned int fexcept_t;
+
+
+/* Type representing floating-point environment.  */
+typedef struct
+  {
+    fexcept_t __excepts;
+    /* XXX I don't know what else we should save.  */
+  }
+fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((__const fenv_t *) -1l)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenvinline.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenvinline.h
new file mode 100644
index 0000000..42f77b5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenvinline.h
@@ -0,0 +1,8 @@
+/* This file provides inline versions of floating-pint environment
+   handling functions.  If there were any.  */
+
+#ifndef __NO_MATH_INLINES
+
+/* Here is where the code would go.  */
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/getopt.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/getopt.h
new file mode 100644
index 0000000..89bd332
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/getopt.h
@@ -0,0 +1,183 @@
+/* Declarations for getopt.
+   Copyright (C) 1989-1994,1996-1999,2001,2003,2004
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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 _GETOPT_H
+
+#include <features.h>
+
+#ifndef __need_getopt
+# define _GETOPT_H 1
+#endif
+
+/* If __GNU_LIBRARY__ is not already defined, either we are being used
+   standalone, or this is the first header included in the source file.
+   If we are being used with glibc, we need to include <features.h>, but
+   that does not exist if we are standalone.  So: if __GNU_LIBRARY__ is
+   not defined, include <ctype.h>, which will pull in <features.h> for us
+   if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it
+   doesn't flood the namespace with stuff the way some other headers do.)  */
+#if !defined __GNU_LIBRARY__
+# include <ctype.h>
+#endif
+
+#ifndef __THROW
+# ifndef __GNUC_PREREQ
+#  define __GNUC_PREREQ(maj, min) (0)
+# endif
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
+#  define __THROW	throw ()
+# else
+#  define __THROW
+# endif
+#endif
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+   When `getopt' finds an option that takes an argument,
+   the argument value is returned here.
+   Also, when `ordering' is RETURN_IN_ORDER,
+   each non-option ARGV-element is returned here.  */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+   This is used for communication to and from the caller
+   and for communication between successive calls to `getopt'.
+
+   On entry to `getopt', zero means this is the first call; initialize.
+
+   When `getopt' returns -1, this is the index of the first of the
+   non-option elements that the caller should itself scan.
+
+   Otherwise, `optind' communicates from one call to the next
+   how much of ARGV has been scanned so far.  */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+   for unrecognized options.  */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized.  */
+
+extern int optopt;
+
+#ifndef __need_getopt
+/* Describe the long-named options requested by the application.
+   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+   of `struct option' terminated by an element containing a name which is
+   zero.
+
+   The field `has_arg' is:
+   no_argument		(or 0) if the option does not take an argument,
+   required_argument	(or 1) if the option requires an argument,
+   optional_argument	(or 2) if the option takes an optional argument.
+
+   If the field `flag' is not NULL, it points to a variable that is set
+   to the value given in the field `val' when the option is found, but
+   left unchanged if the option is not found.
+
+   To have a long-named option do something other than set an `int' to
+   a compiled-in constant, such as set a value from `optarg', set the
+   option's `flag' field to zero and its `val' field to a nonzero
+   value (the equivalent single-letter option character, if there is
+   one).  For long options that have a zero `flag' field, `getopt'
+   returns the contents of the `val' field.  */
+
+struct option
+{
+  const char *name;
+  /* has_arg can't be an enum because some compilers complain about
+     type mismatches in all the code that assumes it is an int.  */
+  int has_arg;
+  int *flag;
+  int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'.  */
+
+# define no_argument		0
+# define required_argument	1
+# define optional_argument	2
+#endif	/* need getopt */
+
+
+/* Get definitions and prototypes for functions to process the
+   arguments in ARGV (ARGC of them, minus the program name) for
+   options given in OPTS.
+
+   Return the option character from OPTS just read.  Return -1 when
+   there are no more options.  For unrecognized options, or options
+   missing arguments, `optopt' is set to the option letter, and '?' is
+   returned.
+
+   The OPTS string is a list of characters which are recognized option
+   letters, optionally followed by colons, specifying that that letter
+   takes an argument, to be placed in `optarg'.
+
+   If a letter in OPTS is followed by two colons, its argument is
+   optional.  This behavior is specific to the GNU `getopt'.
+
+   The argument `--' causes premature termination of argument
+   scanning, explicitly telling `getopt' that there are no more
+   options.
+
+   If OPTS begins with `--', then non-option arguments are treated as
+   arguments to the option '\0'.  This behavior is specific to the GNU
+   `getopt'.  */
+
+#if defined __GNU_LIBRARY__ || defined __UCLIBC__
+/* Many other libraries have conflicting prototypes for getopt, with
+   differences in the consts, in stdlib.h.  To avoid compilation
+   errors, only prototype getopt for the GNU C library.  */
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
+       __THROW;
+libc_hidden_proto(getopt)
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+libc_hidden_proto(getopt)
+#endif /* __GNU_LIBRARY__ */
+
+#if defined __UCLIBC_HAS_GNU_GETOPT__ || defined __UCLIBC_HAS_GETOPT_LONG__
+#ifndef __need_getopt
+extern int getopt_long (int ___argc, char *const *___argv,
+			const char *__shortopts,
+		        const struct option *__longopts, int *__longind)
+       __THROW;
+extern int getopt_long_only (int ___argc, char *const *___argv,
+			     const char *__shortopts,
+		             const struct option *__longopts, int *__longind)
+       __THROW;
+
+#endif
+#endif
+
+#ifdef	__cplusplus
+}
+#endif
+
+/* Make sure we later can get all the definitions and declarations.  */
+#undef __need_getopt
+
+#endif /* getopt.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_val.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_val.h
new file mode 100644
index 0000000..11ca11f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_val.h
@@ -0,0 +1,55 @@
+/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity).
+   Used by <stdlib.h> and <math.h> functions for overflow.
+   Copyright (C) 1992, 1995, 1996, 1997, 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.  */
+
+#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__
+
+# define HUGE_VAL \
+  (__extension__							      \
+   ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
+    { __l: 0x7ff0000000000000ULL }).__d)
+
+#else /* not GCC */
+
+# include <endian.h>
+
+typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
+
+# 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
+
+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/common/bits/huge_valf.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_valf.h
new file mode 100644
index 0000000..1785342
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_valf.h
@@ -0,0 +1,53 @@
+/* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity).
+   Used by <stdlib.h> and <math.h> functions for overflow.
+   Copyright (C) 1992, 1995, 1996, 1997, 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.  */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_valf.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity (-HUGE_VAL is negative infinity).  */
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VALF	(__builtin_huge_valf())
+#elif __GNUC_PREREQ(2,96)
+# define HUGE_VALF	(__extension__ 0x1.0p255f)
+#elif defined __GNUC__
+
+#   define HUGE_VALF \
+  (__extension__							      \
+   ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })    \
+    { __l: 0x7f800000UL }).__d)
+
+#else /* not GCC */
+
+typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+#  define __HUGE_VALF_bytes	{ 0x7f, 0x80, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+#  define __HUGE_VALF_bytes	{ 0, 0, 0x80, 0x7f }
+# endif
+
+static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
+# define HUGE_VALF	(__huge_valf.__f)
+
+#endif	/* GCC.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_vall.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_vall.h
new file mode 100644
index 0000000..d5e8e22
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_vall.h
@@ -0,0 +1,29 @@
+/* Default `HUGE_VALL' constant.
+   Used by <stdlib.h> and <math.h> functions for overflow.
+   Copyright (C) 1992, 1996, 1997, 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_vall.h> directly; include <math.h> instead."
+#endif
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VALL	(__builtin_huge_vall())
+#else
+# define HUGE_VALL	((long double) HUGE_VAL)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/in.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/in.h
new file mode 100644
index 0000000..1f2b817
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/in.h
@@ -0,0 +1,172 @@
+/* Copyright (C) 1991-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.  */
+
+/* Linux version.  */
+
+#ifndef _NETINET_IN_H
+# error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
+#endif
+
+/* Options for use with `getsockopt' and `setsockopt' at the IP level.
+   The first word in the comment at the right is the data type used;
+   "bool" means a boolean value stored in an `int'.  */
+#define        IP_OPTIONS      4       /* ip_opts; IP per-packet options.  */
+#define        IP_HDRINCL      3       /* int; Header is included with data.  */
+#define        IP_TOS          1       /* int; IP type of service and precedence.  */
+#define        IP_TTL          2       /* int; IP time to live.  */
+#define        IP_RECVOPTS     6       /* bool; Receive all IP options w/datagram.  */
+/* For BSD compatibility.  */
+#define        IP_RECVRETOPTS  IP_RETOPTS       /* bool; Receive IP options for response.  */
+#define        IP_RETOPTS      7       /* ip_opts; Set/get IP per-packet options.  */
+#define IP_MULTICAST_IF 32	/* in_addr; set/get IP multicast i/f */
+#define IP_MULTICAST_TTL 33	/* u_char; set/get IP multicast ttl */
+#define IP_MULTICAST_LOOP 34	/* i_char; set/get IP multicast loopback */
+#define IP_ADD_MEMBERSHIP 35	/* ip_mreq; add an IP group membership */
+#define IP_DROP_MEMBERSHIP 36	/* ip_mreq; drop an IP group membership */
+#define IP_UNBLOCK_SOURCE 37	/* ip_mreq_source: unblock data from source */
+#define IP_BLOCK_SOURCE 38	/* ip_mreq_source: block data from source */
+#define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */
+#define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */
+#define IP_MSFILTER 41
+#define MCAST_JOIN_GROUP 42	/* group_req: join any-source group */
+#define MCAST_BLOCK_SOURCE 43	/* group_source_req: block from given group */
+#define MCAST_UNBLOCK_SOURCE 44	/* group_source_req: unblock from given group*/
+#define MCAST_LEAVE_GROUP 45	/* group_req: leave any-source group */
+#define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */
+#define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr*/
+#define MCAST_MSFILTER 48
+
+#define MCAST_EXCLUDE   0
+#define MCAST_INCLUDE   1
+
+#define IP_ROUTER_ALERT    5	/* bool */
+#define IP_PKTINFO         8	/* bool */
+#define IP_PKTOPTIONS      9
+#define IP_PMTUDISC        10	/* obsolete name? */
+#define IP_MTU_DISCOVER    10	/* int; see below */
+#define IP_RECVERR         11	/* bool */
+#define IP_RECVTTL         12	/* bool */
+#define IP_RECVTOS         13	/* bool */
+
+
+/* IP_MTU_DISCOVER arguments.  */
+#define IP_PMTUDISC_DONT   0	/* Never send DF frames.  */
+#define IP_PMTUDISC_WANT   1	/* Use per route hints.  */
+#define IP_PMTUDISC_DO     2	/* Always DF.  */
+
+/* To select the IP level.  */
+#define SOL_IP	0
+
+#define IP_DEFAULT_MULTICAST_TTL        1
+#define IP_DEFAULT_MULTICAST_LOOP       1
+#define IP_MAX_MEMBERSHIPS              20
+
+/* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
+   The `ip_dst' field is used for the first-hop gateway when using a
+   source route (this gets put into the header proper).  */
+struct ip_opts
+  {
+    struct in_addr ip_dst;	/* First hop; zero without source route.  */
+    char ip_opts[40];		/* Actually variable in size.  */
+  };
+
+/* Like `struct ip_mreq' but including interface specification by index.  */
+struct ip_mreqn
+  {
+    struct in_addr imr_multiaddr;	/* IP multicast address of group */
+    struct in_addr imr_address;		/* local IP address of interface */
+    int	imr_ifindex;			/* Interface index */
+  };
+
+/* Structure used for IP_PKTINFO.  */
+struct in_pktinfo
+  {
+    int ipi_ifindex;			/* Interface index  */
+    struct in_addr ipi_spec_dst;	/* Routing destination address  */
+    struct in_addr ipi_addr;		/* Header destination address  */
+  };
+
+#ifdef __UCLIBC_HAS_IPV6__
+/* Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
+   The first word in the comment at the right is the data type used;
+   "bool" means a boolean value stored in an `int'.  */
+#define IPV6_ADDRFORM		1
+#define IPV6_2292PKTINFO	2
+#define IPV6_2292HOPOPTS	3
+#define IPV6_2292DSTOPTS	4
+#define IPV6_2292RTHDR		5
+#define IPV6_2292PKTOPTIONS	6
+#define IPV6_CHECKSUM		7
+#define IPV6_2292HOPLIMIT	8
+
+#define SCM_SRCRT		IPV6_RXSRCRT
+
+#define IPV6_NEXTHOP		9
+#define IPV6_AUTHHDR		10
+#define IPV6_UNICAST_HOPS	16
+#define IPV6_MULTICAST_IF	17
+#define IPV6_MULTICAST_HOPS	18
+#define IPV6_MULTICAST_LOOP	19
+#define IPV6_JOIN_GROUP		20
+#define IPV6_LEAVE_GROUP	21
+#define IPV6_ROUTER_ALERT	22
+#define IPV6_MTU_DISCOVER	23
+#define IPV6_MTU		24
+#define IPV6_RECVERR		25
+#define IPV6_V6ONLY		26
+#define IPV6_JOIN_ANYCAST	27
+#define IPV6_LEAVE_ANYCAST	28
+#define IPV6_IPSEC_POLICY	34
+#define IPV6_XFRM_POLICY	35
+
+#define IPV6_RECVPKTINFO	49
+#define IPV6_PKTINFO		50
+#define IPV6_RECVHOPLIMIT	51
+#define IPV6_HOPLIMIT		52
+#define IPV6_RECVHOPOPTS	53
+#define IPV6_HOPOPTS		54
+#define IPV6_RTHDRDSTOPTS	55
+#define IPV6_RECVRTHDR		56
+#define IPV6_RTHDR		57
+#define IPV6_RECVDSTOPTS	58
+#define IPV6_DSTOPTS		59
+
+#define IPV6_RECVTCLASS		66
+#define IPV6_TCLASS		67
+
+/* Obsolete synonyms for the above.  */
+#define IPV6_ADD_MEMBERSHIP	IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP	IPV6_LEAVE_GROUP
+#define IPV6_RXHOPOPTS		IPV6_HOPOPTS
+#define IPV6_RXDSTOPTS		IPV6_DSTOPTS
+
+/* IPV6_MTU_DISCOVER values.  */
+#define IPV6_PMTUDISC_DONT	0	/* Never send DF frames.  */
+#define IPV6_PMTUDISC_WANT	1	/* Use per route hints.  */
+#define IPV6_PMTUDISC_DO	2	/* Always DF.  */
+
+/* Socket level values for IPv6.  */
+#define SOL_IPV6        41
+#define SOL_ICMPV6      58
+
+/* Routing header options for IPv6.  */
+#define IPV6_RTHDR_LOOSE	0	/* Hop doesn't need to be neighbour. */
+#define IPV6_RTHDR_STRICT	1	/* Hop must be a neighbour.  */
+
+#define IPV6_RTHDR_TYPE_0	0	/* IPv6 Routing header type 0.  */
+#endif /* __UCLIBC_HAS_IPV6__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/inf.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/inf.h
new file mode 100644
index 0000000..1619f75
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/inf.h
@@ -0,0 +1,30 @@
+/* `INFINITY' constant for IEEE 754 machines.
+   Copyright (C) 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/inf.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity.  */
+
+#if __GNUC_PREREQ(3,3)
+# define INFINITY	(__builtin_inff())
+#else
+# define INFINITY	HUGE_VALF
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/initspin.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/initspin.h
new file mode 100644
index 0000000..a19ec07
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/initspin.h
@@ -0,0 +1,28 @@
+/* Generic definitions for spinlock initializers.
+   Copyright (C) 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; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* Initial value of a spinlock.  Most platforms should use zero,
+   unless they only implement a "test and clear" operation instead of
+   the usual "test and set". */
+#define __LT_SPINLOCK_INIT 0
+
+/* Macros for lock initializers, using the above definition. */
+#define __LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT }
+#define __ALT_LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT }
+#define __ATOMIC_INITIALIZER { 0, __LT_SPINLOCK_INIT }
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/inotify.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/inotify.h
new file mode 100644
index 0000000..291f008
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/inotify.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2005-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_INOTIFY_H
+# error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead."
+#endif
+
+/* Flags for the parameter of inotify_init1.  */
+enum
+  {
+    IN_CLOEXEC = 02000000,
+#define IN_CLOEXEC IN_CLOEXEC
+    IN_NONBLOCK = 00004000
+#define IN_NONBLOCK IN_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctl-types.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctl-types.h
new file mode 100644
index 0000000..e856a04
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctl-types.h
@@ -0,0 +1,78 @@
+/* Structure types for pre-termios terminal ioctls.  Linux version.
+   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_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Get definition of constants for use with `ioctl'.  */
+#include <asm/ioctls.h>
+
+
+struct winsize
+  {
+    unsigned short int ws_row;
+    unsigned short int ws_col;
+    unsigned short int ws_xpixel;
+    unsigned short int ws_ypixel;
+  };
+
+#define NCC 8
+struct termio
+  {
+    unsigned short int c_iflag;		/* input mode flags */
+    unsigned short int c_oflag;		/* output mode flags */
+    unsigned short int c_cflag;		/* control mode flags */
+    unsigned short int c_lflag;		/* local mode flags */
+    unsigned char c_line;		/* line discipline */
+    unsigned char c_cc[NCC];		/* control characters */
+};
+
+/* modem lines */
+#define TIOCM_LE	0x001
+#define TIOCM_DTR	0x002
+#define TIOCM_RTS	0x004
+#define TIOCM_ST	0x008
+#define TIOCM_SR	0x010
+#define TIOCM_CTS	0x020
+#define TIOCM_CAR	0x040
+#define TIOCM_RNG	0x080
+#define TIOCM_DSR	0x100
+#define TIOCM_CD	TIOCM_CAR
+#define TIOCM_RI	TIOCM_RNG
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+
+/* line disciplines */
+#define N_TTY		0
+#define N_SLIP		1
+#define N_MOUSE		2
+#define N_PPP		3
+#define N_STRIP		4
+#define N_AX25		5
+#define N_X25		6	/* X.25 async  */
+#define N_6PACK		7
+#define N_MASC		8	/* Mobitex module  */
+#define N_R3964		9	/* Simatic R3964 module  */
+#define N_PROFIBUS_FDL	10	/* Profibus  */
+#define N_IRDA		11	/* Linux IR  */
+#define N_SMSBLOCK	12	/* SMS block mode  */
+#define N_HDLC		13	/* synchronous HDLC  */
+#define N_SYNC_PPP	14	/* synchronous PPP  */
+#define	N_HCI		15	/* Bluetooth HCI UART  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctls.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctls.h
new file mode 100644
index 0000000..268c0e4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctls.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 1996, 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 _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Use the definitions from the kernel header files.  */
+#include <asm/ioctls.h>
+
+/* Routing table calls.  */
+#define SIOCADDRT	0x890B		/* add routing table entry	*/
+#define SIOCDELRT	0x890C		/* delete routing table entry	*/
+#define SIOCRTMSG	0x890D		/* call to routing system	*/
+
+/* Socket configuration controls. */
+#define SIOCGIFNAME	0x8910		/* get iface name		*/
+#define SIOCSIFLINK	0x8911		/* set iface channel		*/
+#define SIOCGIFCONF	0x8912		/* get iface list		*/
+#define SIOCGIFFLAGS	0x8913		/* get flags			*/
+#define SIOCSIFFLAGS	0x8914		/* set flags			*/
+#define SIOCGIFADDR	0x8915		/* get PA address		*/
+#define SIOCSIFADDR	0x8916		/* set PA address		*/
+#define SIOCGIFDSTADDR	0x8917		/* get remote PA address	*/
+#define SIOCSIFDSTADDR	0x8918		/* set remote PA address	*/
+#define SIOCGIFBRDADDR	0x8919		/* get broadcast PA address	*/
+#define SIOCSIFBRDADDR	0x891a		/* set broadcast PA address	*/
+#define SIOCGIFNETMASK	0x891b		/* get network PA mask		*/
+#define SIOCSIFNETMASK	0x891c		/* set network PA mask		*/
+#define SIOCGIFMETRIC	0x891d		/* get metric			*/
+#define SIOCSIFMETRIC	0x891e		/* set metric			*/
+#define SIOCGIFMEM	0x891f		/* get memory address (BSD)	*/
+#define SIOCSIFMEM	0x8920		/* set memory address (BSD)	*/
+#define SIOCGIFMTU	0x8921		/* get MTU size			*/
+#define SIOCSIFMTU	0x8922		/* set MTU size			*/
+#define SIOCSIFNAME	0x8923		/* set interface name		*/
+#define	SIOCSIFHWADDR	0x8924		/* set hardware address		*/
+#define SIOCGIFENCAP	0x8925		/* get/set encapsulations       */
+#define SIOCSIFENCAP	0x8926
+#define SIOCGIFHWADDR	0x8927		/* Get hardware address		*/
+#define SIOCGIFSLAVE	0x8929		/* Driver slaving support	*/
+#define SIOCSIFSLAVE	0x8930
+#define SIOCADDMULTI	0x8931		/* Multicast address lists	*/
+#define SIOCDELMULTI	0x8932
+#define SIOCGIFINDEX	0x8933		/* name -> if_index mapping	*/
+#define SIOGIFINDEX	SIOCGIFINDEX	/* misprint compatibility :-)	*/
+#define SIOCSIFPFLAGS	0x8934		/* set/get extended flags set	*/
+#define SIOCGIFPFLAGS	0x8935
+#define SIOCDIFADDR	0x8936		/* delete PA address		*/
+#define	SIOCSIFHWBROADCAST	0x8937	/* set hardware broadcast addr	*/
+#define SIOCGIFCOUNT	0x8938		/* get number of devices */
+
+#define SIOCGIFBR	0x8940		/* Bridging support		*/
+#define SIOCSIFBR	0x8941		/* Set bridging options		*/
+
+#define SIOCGIFTXQLEN	0x8942		/* Get the tx queue length	*/
+#define SIOCSIFTXQLEN	0x8943		/* Set the tx queue length	*/
+
+
+/* ARP cache control calls. */
+		    /*  0x8950 - 0x8952  * obsolete calls, don't re-use */
+#define SIOCDARP	0x8953		/* delete ARP table entry	*/
+#define SIOCGARP	0x8954		/* get ARP table entry		*/
+#define SIOCSARP	0x8955		/* set ARP table entry		*/
+
+/* RARP cache control calls. */
+#define SIOCDRARP	0x8960		/* delete RARP table entry	*/
+#define SIOCGRARP	0x8961		/* get RARP table entry		*/
+#define SIOCSRARP	0x8962		/* set RARP table entry		*/
+
+/* Driver configuration calls */
+
+#define SIOCGIFMAP	0x8970		/* Get device parameters	*/
+#define SIOCSIFMAP	0x8971		/* Set device parameters	*/
+
+/* DLCI configuration calls */
+
+#define SIOCADDDLCI	0x8980		/* Create new DLCI device	*/
+#define SIOCDELDLCI	0x8981		/* Delete DLCI device		*/
+
+/* Device private ioctl calls.  */
+
+/* These 16 ioctls are available to devices via the do_ioctl() device
+   vector.  Each device should include this file and redefine these
+   names as their own. Because these are device dependent it is a good
+   idea _NOT_ to issue them to random objects and hope.  */
+
+#define SIOCDEVPRIVATE	0x89F0	/* to 89FF */
+
+/*
+ *	These 16 ioctl calls are protocol private
+ */
+
+#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/ipc.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ipc.h
new file mode 100644
index 0000000..f1a043f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ipc.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 1995-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.  */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#ifdef __USE_GNU
+# define IPC_INFO	3		/* See ipcs.  */
+#endif
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;			/* Key.  */
+    __uid_t uid;			/* Owner's user ID.  */
+    __gid_t gid;			/* Owner's group ID.  */
+    __uid_t cuid;			/* Creator's user ID.  */
+    __gid_t cgid;			/* Creator's group ID.  */
+    unsigned short int mode;		/* Read/write permission.  */
+    unsigned short int __pad1;
+    unsigned short int __seq;		/* Sequence number.  */
+    unsigned short int __pad2;
+    unsigned long int __unused1;
+    unsigned long int __unused2;
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel-features.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel-features.h
new file mode 100644
index 0000000..5ea85d2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel-features.h
@@ -0,0 +1,500 @@
+/* Set flags signalling availability of kernel features based on given
+   kernel version number.
+   Copyright (C) 1999-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.  */
+
+/* This file must not contain any C code.  At least it must be protected
+   to allow using the file also in assembler files.  */
+
+#if defined __mips__
+# include <sgidefs.h>
+#endif
+
+#include <linux/version.h>
+#define __LINUX_KERNEL_VERSION		LINUX_VERSION_CODE
+
+/* We assume for __LINUX_KERNEL_VERSION the same encoding used in
+   linux/version.h.  I.e., the major, minor, and subminor all get a
+   byte with the major number being in the highest byte.  This means
+   we can do numeric comparisons.
+
+   In the following we will define certain symbols depending on
+   whether the describes kernel feature is available in the kernel
+   version given by __LINUX_KERNEL_VERSION.  We are not always exactly
+   recording the correct versions in which the features were
+   introduced.  If somebody cares these values can afterwards be
+   corrected.  Most of the numbers here are set corresponding to
+   2.2.0.  */
+
+/* `getcwd' system call.  */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_GETCWD_SYSCALL	1
+#endif
+
+/* When was `poll' introduced?  */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_POLL_SYSCALL          1
+#endif
+
+/* Real-time signal became usable in 2.1.70.  */
+#if __LINUX_KERNEL_VERSION >= 131398
+# define __ASSUME_REALTIME_SIGNALS	1
+#endif
+
+/* When were the `pread'/`pwrite' syscalls introduced?  */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_PREAD_SYSCALL		1
+# define __ASSUME_PWRITE_SYSCALL	1
+#endif
+
+/* When was `poll' introduced?  */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_POLL_SYSCALL		1
+#endif
+
+/* The `lchown' syscall was introduced in 2.1.80.  */
+#if __LINUX_KERNEL_VERSION >= 131408
+# define __ASSUME_LCHOWN_SYSCALL	1
+#endif
+
+/* When did the `setresuid' sysall became available?  */
+#if __LINUX_KERNEL_VERSION >= 131584 && !defined __sparc__
+# define __ASSUME_SETRESUID_SYSCALL	1
+#endif
+
+/* The SIOCGIFNAME ioctl is available starting with 2.1.50.  */
+#if __LINUX_KERNEL_VERSION >= 131408
+# define __ASSUME_SIOCGIFNAME		1
+#endif
+
+/* MSG_NOSIGNAL was at least available with Linux 2.2.0.  */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_MSG_NOSIGNAL		1
+#endif
+
+/* On x86 another `getrlimit' syscall was added in 2.3.25.  */
+#if __LINUX_KERNEL_VERSION >= 131865 && defined __i386__
+# define __ASSUME_NEW_GETRLIMIT_SYSCALL	1
+#endif
+
+/* On x86 the truncate64/ftruncate64 syscalls were introduced in 2.3.31.  */
+#if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+#endif
+
+/* On x86 the mmap2 syscall was introduced in 2.3.31.  */
+#if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__
+# define __ASSUME_MMAP2_SYSCALL	1
+#endif
+
+/* On x86 the stat64/lstat64/fstat64 syscalls were introduced in 2.3.34.  */
+#if __LINUX_KERNEL_VERSION >= 131874 && defined __i386__
+# define __ASSUME_STAT64_SYSCALL	1
+#endif
+
+/* On sparc and ARM the truncate64/ftruncate64/mmap2/stat64/lstat64/fstat64
+   syscalls were introduced in 2.3.35.  */
+#if __LINUX_KERNEL_VERSION >= 131875 && (defined __sparc__ || defined __arm__)
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_MMAP2_SYSCALL		1
+# define __ASSUME_STAT64_SYSCALL	1
+#endif
+
+/* I know for sure that getrlimit are in 2.3.35 on powerpc.  */
+#if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__
+# define __ASSUME_NEW_GETRLIMIT_SYSCALL	1
+#endif
+
+/* I know for sure that these are in 2.3.35 on powerpc. But PowerPC64 does not
+   support separate 64-bit syscalls, already 64-bit */
+#if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__ \
+    && !defined __powerpc64__
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_STAT64_SYSCALL	1
+#endif
+
+/* Linux 2.3.39 introduced 32bit UID/GIDs.  Some platforms had 32
+   bit type all along.  */
+#if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__ || defined __mips__
+# define __ASSUME_32BITUIDS		1
+#endif
+
+/* Linux 2.3.39 sparc added setresuid.  */
+#if __LINUX_KERNEL_VERSION >= 131879 && defined __sparc__
+# define __ASSUME_SETRESUID_SYSCALL	1
+#endif
+
+#if __LINUX_KERNEL_VERSION >= 131879
+# define __ASSUME_SETRESGID_SYSCALL	1
+#endif
+
+/* Linux 2.3.39 introduced IPC64.  Except for powerpc.  */
+#if __LINUX_KERNEL_VERSION >= 131879 && !defined __powerpc__
+# define __ASSUME_IPC64		1
+#endif
+
+/* MIPS platforms had IPC64 all along.  */
+#if defined __mips__
+# define __ASSUME_IPC64		1
+#endif
+
+/* We can use the LDTs for threading with Linux 2.3.99 and newer.  */
+#if __LINUX_KERNEL_VERSION >= 131939
+# define __ASSUME_LDT_WORKS		1
+#endif
+
+/* Linux 2.4.0 on PPC introduced a correct IPC64. But PowerPC64 does not
+   support a separate 64-bit sys call, already 64-bit */
+#if __LINUX_KERNEL_VERSION >= 132096 && defined __powerpc__ \
+    && !defined __powerpc64__
+# define __ASSUME_IPC64			1
+#endif
+
+/* SH kernels got stat64, mmap2, and truncate64 during 2.4.0-test.  */
+#if __LINUX_KERNEL_VERSION >= 132096 && defined __sh__
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_MMAP2_SYSCALL		1
+# define __ASSUME_STAT64_SYSCALL	1
+#endif
+
+/* The changed st_ino field appeared in 2.4.0-test6.  But we cannot
+   distinguish this version from other 2.4.0 releases.  Therefore play
+   save and assume it available is for 2.4.1 and up.  However, SH is lame,
+   and still does not have a 64-bit inode field.  */
+#if __LINUX_KERNEL_VERSION >= 132097 && !defined __alpha__ && !defined __sh__
+# define __ASSUME_ST_INO_64_BIT		1
+#endif
+
+/* To support locking of large files a new fcntl() syscall was introduced
+   in 2.4.0-test7.  We test for 2.4.1 for the earliest version we know
+   the syscall is available.  */
+#if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __sparc__)
+# define __ASSUME_FCNTL64		1
+#endif
+
+/* The AT_CLKTCK auxiliary vector entry was introduction in the 2.4.0
+   series.  */
+#if __LINUX_KERNEL_VERSION >= 132097
+# define __ASSUME_AT_CLKTCK		1
+#endif
+
+/* Arm got fcntl64 in 2.4.4, PowerPC and SH have it also in 2.4.4 (I
+   don't know when it got introduced).  But PowerPC64 does not support
+   separate FCNTL64 call, FCNTL is already 64-bit */
+#if __LINUX_KERNEL_VERSION >= 132100 \
+    && (defined __arm__ || defined __powerpc__ || defined __sh__) \
+    && !defined __powerpc64__
+# define __ASSUME_FCNTL64		1
+#endif
+
+/* The getdents64 syscall was introduced in 2.4.0-test7.  We test for
+   2.4.1 for the earliest version we know the syscall is available.  */
+#if __LINUX_KERNEL_VERSION >= 132097
+# define __ASSUME_GETDENTS64_SYSCALL	1
+#endif
+
+/* When did O_DIRECTORY became available?  Early in 2.3 but when?
+   Be safe, use 2.3.99.  */
+#if __LINUX_KERNEL_VERSION >= 131939
+# define __ASSUME_O_DIRECTORY		1
+#endif
+
+/* Starting with one of the 2.4.0 pre-releases the Linux kernel passes
+   up the page size information.  */
+#if __LINUX_KERNEL_VERSION >= 132097
+# define __ASSUME_AT_PAGESIZE		1
+#endif
+
+/* Starting with at least 2.4.0 the kernel passes the uid/gid unconditionally
+   up to the child.  */
+#if __LINUX_KERNEL_VERSION >= 132097
+# define __ASSUME_AT_XID		1
+#endif
+
+/* Starting with 2.4.5 kernels PPC passes the AUXV in the standard way
+   and the vfork syscall made it into the official kernel.  */
+#if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__
+# define __ASSUME_STD_AUXV		1
+# define __ASSUME_VFORK_SYSCALL		1
+#endif
+
+/* Starting with 2.4.5 kernels the mmap2 syscall made it into the official
+   kernel.  But PowerPC64 does not support a separate MMAP2 call.  */
+#if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__ \
+    && !defined __powerpc64__
+# define __ASSUME_MMAP2_SYSCALL		1
+#endif
+
+/* Starting with 2.4.21 PowerPC implements the new prctl syscall.
+   This allows applications to get/set the Floating Point Exception Mode.  */
+#if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc__
+# define __ASSUME_NEW_PRCTL_SYSCALL		1
+#endif
+
+/* Starting with 2.4.21 the PowerPC32 clone syscall works as expected.  */
+#if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc__ \
+    && !defined __powerpc64__
+# define __ASSUME_FIXED_CLONE_SYSCALL		1
+#endif
+
+/* Starting with 2.4.21 PowerPC64 implements the new rt_sigreturn syscall.
+   The new rt_sigreturn takes an ucontext pointer allowing rt_sigreturn
+   to be used in the set/swapcontext implementation.  */
+#if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc64__
+# define __ASSUME_NEW_RT_SIGRETURN_SYSCALL		1
+#endif
+
+/* On x86, the set_thread_area syscall was introduced in 2.5.29, but its
+   semantics was changed in 2.5.30, and again after 2.5.31.  */
+#if __LINUX_KERNEL_VERSION >= 132384 && defined __i386__
+# define __ASSUME_SET_THREAD_AREA_SYSCALL	1
+#endif
+
+/* The vfork syscall on x86 and arm was definitely available in 2.4.  */
+#if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __arm__)
+# define __ASSUME_VFORK_SYSCALL		1
+#endif
+
+/* There are an infinite number of PA-RISC kernel versions numbered
+   2.4.0.  But they've not really been released as such.  We require
+   and expect the final version here.  */
+#ifdef __hppa__
+# define __ASSUME_32BITUIDS		1
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_MMAP2_SYSCALL		1
+# define __ASSUME_STAT64_SYSCALL	1
+# define __ASSUME_IPC64			1
+# define __ASSUME_ST_INO_64_BIT		1
+# define __ASSUME_FCNTL64		1
+# define __ASSUME_GETDENTS64_SYSCALL	1
+#endif
+
+/* Alpha switched to a 64-bit timeval sometime before 2.2.0.  */
+#if __LINUX_KERNEL_VERSION >= 131584 && defined __alpha__
+# define __ASSUME_TIMEVAL64		1
+#endif
+
+#if defined __mips__ && _MIPS_SIM == _ABIN32
+# define __ASSUME_FCNTL64		1
+#endif
+
+/* The late 2.5 kernels saw a lot of new CLONE_* flags.  Summarize
+   their availability with one define.  The changes were made first
+   for i386 and the have to be done separately for the other archs.
+   For i386 we pick 2.5.50 as the first version with support.  */
+#if __LINUX_KERNEL_VERSION >= 132402 && defined __i386__
+# define __ASSUME_CLONE_THREAD_FLAGS	1
+#endif
+
+/* Support for various CLOEXEC and NONBLOCK flags was added for x86,
+   x86-64, PPC, IA-64, SPARC< and S390 in 2.6.23.  */
+#if __LINUX_KERNEL_VERSION >= 0x020617 \
+    && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
+	|| defined __ia64__ || defined __sparc__ || defined __s390__)
+# define __ASSUME_O_CLOEXEC 1
+#endif
+
+/* Support for various CLOEXEC and NONBLOCK flags was added for x86,
+ *    x86-64, PPC, IA-64, and SPARC in 2.6.27.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061b \
+    && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
+        || defined __ia64__ || defined __sparc__ || defined __s390__)
+/* # define __ASSUME_SOCK_CLOEXEC  1 */
+/* # define __ASSUME_IN_NONBLOCK   1 */
+# define __ASSUME_PIPE2         1
+/* # define __ASSUME_EVENTFD2      1 */
+/* # define __ASSUME_SIGNALFD4     1 */
+#endif
+
+
+/* These features were surely available with 2.4.12.  */
+#if __LINUX_KERNEL_VERSION >= 132108 && defined __mc68000__
+# define __ASSUME_MMAP2_SYSCALL		1
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_STAT64_SYSCALL	1
+# define __ASSUME_FCNTL64		1
+# define __ASSUME_VFORK_SYSCALL		1
+#endif
+
+/* Beginning with 2.5.63 support for realtime and monotonic clocks and
+   timers based on them is available.  */
+#if __LINUX_KERNEL_VERSION >= 132415
+# define __ASSUME_POSIX_TIMERS		1
+#endif
+
+/* Beginning with 2.6.12 the clock and timer supports CPU clocks.  */
+#if __LINUX_KERNEL_VERSION >= 0x2060c
+# define __ASSUME_POSIX_CPU_TIMERS      1
+#endif
+
+/* The late 2.5 kernels saw a lot of new CLONE_* flags.  Summarize
+   their availability with one define.  The changes were made first
+   for i386 and the have to be done separately for the other archs.
+   For ia64, s390*, PPC, x86-64 we pick 2.5.64 as the first version
+   with support.  */
+#if __LINUX_KERNEL_VERSION >= 132416 \
+    && (defined __ia64__ || defined __s390__ || defined __powerpc__ \
+	|| defined __x86_64__ || defined __sh__)
+# define __ASSUME_CLONE_THREAD_FLAGS	1
+#endif
+
+/* With kernel 2.4.17 we always have netlink support.  */
+#if __LINUX_KERNEL_VERSION >= (132096+17)
+# define __ASSUME_NETLINK_SUPPORT	1
+#endif
+
+/* The requeue futex functionality was introduced in 2.5.70.  */
+#if __LINUX_KERNEL_VERSION >= 132422
+# define __ASSUME_FUTEX_REQUEUE	1
+#endif
+
+/* The statfs64 syscalls are available in 2.5.74.  */
+#if __LINUX_KERNEL_VERSION >= 132426
+# define __ASSUME_STATFS64	1
+#endif
+
+/* Starting with at least 2.5.74 the kernel passes the setuid-like exec
+   flag unconditionally up to the child.  */
+#if __LINUX_KERNEL_VERSION >= 132426
+# define __ASSUME_AT_SECURE	1
+#endif
+
+/* Starting with the 2.5.75 kernel the kernel fills in the correct value
+   in the si_pid field passed as part of the siginfo_t struct to signal
+   handlers.  */
+#if __LINUX_KERNEL_VERSION >= 132427
+# define __ASSUME_CORRECT_SI_PID	1
+#endif
+
+/* The tgkill syscall was instroduced for i386 in 2.5.75.  For Alpha
+   it was introduced in 2.6.0-test1 which unfortunately cannot be
+   distinguished from 2.6.0.  On x86-64, ppc, and ppc64 it was
+   introduced in 2.6.0-test3. */
+#if (__LINUX_KERNEL_VERSION >= 132427 && defined __i386__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __alpha__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __x86_64__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __powerpc__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __sh__)
+# define __ASSUME_TGKILL	1
+#endif
+
+/* The utimes syscall has been available for some architectures
+   forever.  For x86 it was introduced after 2.5.75, for x86-64,
+   ppc, and ppc64 it was introduced in 2.6.0-test3.  */
+#if defined __alpha__ || defined __ia64__ || defined __hppa__ \
+    || defined __sparc__ \
+    || (__LINUX_KERNEL_VERSION > 132427 && defined __i386__) \
+    || (__LINUX_KERNEL_VERSION > 132609 && defined __x86_64__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __powerpc__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __sh__)
+# define __ASSUME_UTIMES	1
+#endif
+
+// XXX Disabled for now since the semantics we want is not achieved.
+#if 0
+/* The CLONE_STOPPED flag was introduced in the 2.6.0-test1 series.  */
+#if __LINUX_KERNEL_VERSION >= 132609
+# define __ASSUME_CLONE_STOPPED	1
+#endif
+#endif
+
+/* The fixed version of the posix_fadvise64 syscall appeared in
+   2.6.0-test3.  At least for x86.  Powerpc support appeared in
+   2.6.2, but for 32-bit userspace only.  */
+#if (__LINUX_KERNEL_VERSION >= 132609 && defined __i386__) \
+    || (__LINUX_KERNEL_VERSION >= 132610 && defined __powerpc__ \
+       && !defined __powerpc64__)
+# define __ASSUME_FADVISE64_64_SYSCALL	1
+#endif
+
+/* The PROT_GROWSDOWN/PROT_GROWSUP flags were introduced in the 2.6.0-test
+   series.  */
+#if __LINUX_KERNEL_VERSION >= 132609
+# define __ASSUME_PROT_GROWSUPDOWN	1
+#endif
+
+/* Starting with 2.6.0 PowerPC adds signal/swapcontext support for Vector
+   SIMD (AKA Altivec, VMX) instructions and register state.  This changes
+   the overall size of the sigcontext and adds the swapcontext syscall.  */
+#if __LINUX_KERNEL_VERSION >= 132608 && defined __powerpc__
+# define __ASSUME_SWAPCONTEXT_SYSCALL	1
+#endif
+
+/* The CLONE_DETACHED flag is not necessary in 2.6.2 kernels, it is
+   implied.  */
+#if __LINUX_KERNEL_VERSION >= 132610
+# define __ASSUME_NO_CLONE_DETACHED	1
+#endif
+
+/* Starting with version 2.6.4-rc1 the getdents syscall returns d_type
+   information as well and in between 2.6.5 and 2.6.8 most compat wrappers
+   were fixed too.  Except s390{,x} which was fixed in 2.6.11.  */
+#if (__LINUX_KERNEL_VERSION >= 0x020608 && !defined __s390__) \
+    || (__LINUX_KERNEL_VERSION >= 0x02060b && defined __s390__)
+# define __ASSUME_GETDENTS32_D_TYPE	1
+#endif
+
+/* Starting with version 2.5.3, the initial location returned by `brk'
+   after exec is always rounded up to the next page.  */
+#if __LINUX_KERNEL_VERSION >= 132355
+# define __ASSUME_BRK_PAGE_ROUNDED	1
+#endif
+
+/* Starting with version 2.6.9, the waitid system call is available.
+   Except for powerpc and powerpc64, where it is available in 2.6.12.  */
+#if (__LINUX_KERNEL_VERSION >= 0x020609 && !defined __powerpc__) \
+    || (__LINUX_KERNEL_VERSION >= 0x02060c && defined __powerpc__)
+# define __ASSUME_WAITID_SYSCALL	1
+#endif
+
+/* Starting with version 2.6.9, SSI_IEEE_RAISE_EXCEPTION exists.  */
+#if __LINUX_KERNEL_VERSION >= 0x020609 && defined __alpha__
+#define __ASSUME_IEEE_RAISE_EXCEPTION	1
+#endif
+
+/* Support for the accept4 syscall was added in 2.6.28.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061c \
+    && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
+        || defined __sparc__ || defined __s390__)
+# define __ASSUME_ACCEPT4       1
+#endif
+
+/* Support for the accept4 syscall for alpha was added after 2.6.33-rc1.  */
+#if __LINUX_KERNEL_VERSION >= 0x020621 && defined __alpha__
+# define __ASSUME_ACCEPT4       1
+#endif
+
+/* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061d
+# define __ASSUME_FUTEX_CLOCK_REALTIME	1
+#endif
+
+/* Support for PI futexes was added in 2.6.18.  */
+#if __LINUX_KERNEL_VERSION >= 0x020612
+# define __ASSUME_FUTEX_LOCK_PI	1
+#endif
+
+/* Support for private futexes was added in 2.6.22.  */
+#if __LINUX_KERNEL_VERSION >= 0x020616
+# define __ASSUME_PRIVATE_FUTEX	1
+#endif
+
+/* getcpu is a syscall for x86-64 since 3.1.  */
+#if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100
+# define __ASSUME_GETCPU_SYSCALL        1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_sigaction.h
new file mode 100644
index 0000000..0a35ac8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_sigaction.h
@@ -0,0 +1,36 @@
+#ifndef _BITS_SIGACTION_STRUCT_H
+#define _BITS_SIGACTION_STRUCT_H
+
+/* This file provides whatever this particular arch's kernel thinks
+ * the sigaction struct should look like... */
+
+
+#if defined(__ia64__)
+
+#undef HAVE_SA_RESTORER
+
+#else
+
+#define HAVE_SA_RESTORER
+/* This is the sigaction structure from the Linux 2.1.20 kernel.  */
+struct old_kernel_sigaction {
+	__sighandler_t k_sa_handler;
+	unsigned long sa_mask;
+	unsigned long sa_flags;
+	void (*sa_restorer)(void);
+};
+/* In uclibc, userspace struct sigaction is identical to
+ * "new" struct kernel_sigaction (one from the Linux 2.1.68 kernel).
+ * See sigaction.h
+ */
+
+extern int __syscall_sigaction(int, const struct old_kernel_sigaction *,
+	struct old_kernel_sigaction *);
+
+#endif
+
+
+extern int __syscall_rt_sigaction(int, const struct sigaction *,
+	struct sigaction *, size_t);
+
+#endif /* _BITS_SIGACTION_STRUCT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_stat.h
new file mode 100644
index 0000000..571c08f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_stat.h
@@ -0,0 +1,2 @@
+/* bits/kernel_stat.h is architecture specific.  */
+#error "This file must be supplied by every Linux architecture."
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_types.h
new file mode 100644
index 0000000..1c23ebf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_types.h
@@ -0,0 +1,20 @@
+#ifndef _BITS_KERNEL_TYPES_H
+#define _BITS_KERNEL_TYPES_H
+
+/* Sigh.  We need to carefully wrap this one...  No guarantees
+ * that the asm/posix_types.h kernel header is working.  Many
+ * arches have broken headers that introduce tons of gratuitous
+ * conflicts with uClibc's namespace.   See bits/kernel_types.h
+ * for i386, arm, etc for examples... */
+#warning You really should include a proper bits/kernel_types.h for your architecture
+
+#ifndef __GLIBC__
+#define __GLIBC__ 2
+#include <asm/posix_types.h>
+#undef __GLIBC__
+#else
+#include <asm/posix_types.h>
+#endif
+
+
+#endif /* _BITS_KERNEL_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/local_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/local_lim.h
new file mode 100644
index 0000000..a263b5d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/local_lim.h
@@ -0,0 +1,95 @@
+/* Minimum guaranteed maximum values for system limits.  Linux version.
+   Copyright (C) 1993-1998,2000,2002-2004,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; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* The kernel header pollutes the namespace with the NR_OPEN symbol
+   and defines LINK_MAX although filesystems have different maxima.  A
+   similar thing is true for OPEN_MAX: the limit can be changed at
+   runtime and therefore the macro must not be defined.  Remove this
+   after including the header if necessary.  */
+#ifndef NR_OPEN
+# define __undef_NR_OPEN
+#endif
+#ifndef LINK_MAX
+# define __undef_LINK_MAX
+#endif
+#ifndef OPEN_MAX
+# define __undef_OPEN_MAX
+#endif
+#ifndef ARG_MAX
+# define __undef_ARG_MAX
+#endif
+
+/* The kernel sources contain a file with all the needed information.  */
+#include <linux/limits.h>
+
+/* Have to remove NR_OPEN?  */
+#ifdef __undef_NR_OPEN
+# undef NR_OPEN
+# undef __undef_NR_OPEN
+#endif
+/* Have to remove LINK_MAX?  */
+#ifdef __undef_LINK_MAX
+# undef LINK_MAX
+# undef __undef_LINK_MAX
+#endif
+/* Have to remove OPEN_MAX?  */
+#ifdef __undef_OPEN_MAX
+# undef OPEN_MAX
+# undef __undef_OPEN_MAX
+#endif
+/* Have to remove ARG_MAX?  */
+#ifdef __undef_ARG_MAX
+# undef ARG_MAX
+# undef __undef_ARG_MAX
+#endif
+
+/* The number of data keys per process.  */
+#define _POSIX_THREAD_KEYS_MAX	128
+/* This is the value this implementation supports.  */
+#define PTHREAD_KEYS_MAX	1024
+
+/* Controlling the iterations of destructors for thread-specific data.  */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4
+/* Number of iterations this implementation does.  */
+#define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process.  */
+#define _POSIX_THREAD_THREADS_MAX	64
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+   priority level.  */
+#define AIO_PRIO_DELTA_MAX	20
+
+/* Minimum size for a thread.  We are free to choose a reasonable value.  */
+#define PTHREAD_STACK_MIN	16384
+
+/* Maximum number of timer expiration overruns.  */
+#define DELAYTIMER_MAX	2147483647
+
+/* Maximum tty name length.  */
+#define TTY_NAME_MAX		32
+
+/* Maximum login name length.  This is arbitrary.  */
+#define LOGIN_NAME_MAX		256
+
+/* Maximum host name length.  */
+#define HOST_NAME_MAX		64
+
+/* Maximum message queue priority level.  */
+#define MQ_PRIO_MAX		32768
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/locale.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/locale.h
new file mode 100644
index 0000000..50064b5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/locale.h
@@ -0,0 +1,44 @@
+/* Definition of locale category symbol values.
+   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.  */
+
+#if !defined _LOCALE_H && !defined _LANGINFO_H
+# error "Never use <bits/locale.h> directly; include <locale.h> instead."
+#endif
+
+#ifndef _BITS_LOCALE_H
+#define _BITS_LOCALE_H	1
+
+enum
+{
+  __LC_CTYPE = 0,
+  __LC_NUMERIC = 1,
+  __LC_TIME = 2,
+  __LC_COLLATE = 3,
+  __LC_MONETARY = 4,
+  __LC_MESSAGES = 5,
+  __LC_ALL = 6,
+  __LC_PAPER = 7,
+  __LC_NAME = 8,
+  __LC_ADDRESS = 9,
+  __LC_TELEPHONE = 10,
+  __LC_MEASUREMENT = 11,
+  __LC_IDENTIFICATION = 12
+};
+
+#endif	/* bits/locale.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathcalls.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathcalls.h
new file mode 100644
index 0000000..013d2b2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathcalls.h
@@ -0,0 +1,380 @@
+/* Prototype declarations for math functions; helper file for <math.h>.
+   Copyright (C) 1996-2002, 2003, 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.  */
+
+/* NOTE: Because of the special way this file is used by <math.h>, this
+   file must NOT be protected from multiple inclusion as header files
+   usually are.
+
+   This file provides prototype declarations for the math functions.
+   Most functions are declared using the macro:
+
+   __MATHCALL (NAME,[_r], (ARGS...))
+
+   This means there is a function `NAME' returning `double' and a function
+   `NAMEf' returning `float'.  Each place `_Mdouble_' appears in the
+   prototype, that is actually `double' in the prototype for `NAME' and
+   `float' in the prototype for `NAMEf'.  Reentrant variant functions are
+   called `NAME_r' and `NAMEf_r'.
+
+   Functions returning other types like `int' are declared using the macro:
+
+   __MATHDECL (TYPE, NAME,[_r], (ARGS...))
+
+   This is just like __MATHCALL but for a function returning `TYPE'
+   instead of `_Mdouble_'.  In all of these cases, there is still
+   both a `NAME' and a `NAMEf' that takes `float' arguments.
+
+   Note that there must be no whitespace before the argument passed for
+   NAME, to make token pasting work with -traditional.  */
+
+#ifndef _MATH_H
+# error "Never include <bits/mathcalls.h> directly; include <math.h> instead."
+#endif
+
+
+/* __MATHCALLX(type,function,[suffix],args,attrib) and
+ * __MATHCALLI(type,function,[suffix],args) include libm_hidden_def
+ * (for "double" versions only, xxxf and xxxl do not get this treatment).
+ *
+ * __MATHDECL(type,function,[suffix],args) does not.
+ * __MATHCALL(function,[suffix],args) also does not
+ * (it is just a shortcut to __MATHDECL(_Mdouble_,function,[suffix],args)).
+ *
+ * __MATHDECL_PRIV(type,function,[suffix],args,attrib)
+ * includes libm_hidden_def (always) and declares __foo, not foo.
+ */
+
+
+/* Trigonometric functions.  */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Arc cosine of X.  */
+__MATHCALLI (acos,, (_Mdouble_ __x))
+/* Arc sine of X.  */
+__MATHCALLI (asin,, (_Mdouble_ __x))
+/* Arc tangent of X.  */
+__MATHCALLI (atan,, (_Mdouble_ __x))
+/* Arc tangent of Y/X.  */
+__MATHCALLI (atan2,, (_Mdouble_ __y, _Mdouble_ __x))
+
+/* Cosine of X.  */
+__MATHCALLI (cos,, (_Mdouble_ __x))
+/* Sine of X.  */
+__MATHCALLI (sin,, (_Mdouble_ __x))
+/* Tangent of X.  */
+__MATHCALLI (tan,, (_Mdouble_ __x))
+
+/* Hyperbolic functions.  */
+
+/* Hyperbolic cosine of X.  */
+__MATHCALLI (cosh,, (_Mdouble_ __x))
+/* Hyperbolic sine of X.  */
+__MATHCALLI (sinh,, (_Mdouble_ __x))
+/* Hyperbolic tangent of X.  */
+__MATHCALLI (tanh,, (_Mdouble_ __x))
+_Mdouble_END_NAMESPACE
+
+#if defined __USE_GNU
+/* Cosine and sine of X.  */
+__MATHDECL (void,sincos,,
+	    (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx))
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Hyperbolic arc cosine of X.  */
+__MATHCALLI (acosh,, (_Mdouble_ __x))
+/* Hyperbolic arc sine of X.  */
+__MATHCALLI (asinh,, (_Mdouble_ __x))
+/* Hyperbolic arc tangent of X.  */
+__MATHCALLI (atanh,, (_Mdouble_ __x))
+__END_NAMESPACE_C99
+#endif
+
+/* Exponential and logarithmic functions.  */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Exponential function of X.  */
+__MATHCALLI (exp,, (_Mdouble_ __x))
+
+/* Break VALUE into a normalized fraction and an integral power of 2.  */
+__MATHCALLI (frexp,, (_Mdouble_ __x, int *__exponent))
+
+/* X times (two to the EXP power).  */
+__MATHCALLI (ldexp,, (_Mdouble_ __x, int __exponent))
+
+/* Natural logarithm of X.  */
+__MATHCALLI (log,, (_Mdouble_ __x))
+
+/* Base-ten logarithm of X.  */
+__MATHCALLI (log10,, (_Mdouble_ __x))
+
+/* Break VALUE into integral and fractional parts.  */
+__MATHCALLI (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr))
+_Mdouble_END_NAMESPACE
+
+#if 0 /*def __USE_GNU*/
+/* A function missing in all standards: compute exponent to base ten.  */
+__MATHCALL (exp10,, (_Mdouble_ __x))
+/* Another name occasionally used.  */
+__MATHCALL (pow10,, (_Mdouble_ __x))
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return exp(X) - 1.  */
+__MATHCALLI (expm1,, (_Mdouble_ __x))
+
+/* Return log(1 + X).  */
+__MATHCALLI (log1p,, (_Mdouble_ __x))
+
+/* Return the base 2 signed integral exponent of X.  */
+__MATHCALLI (logb,, (_Mdouble_ __x))
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Compute base-2 exponential of X.  */
+__MATHCALLI (exp2,, (_Mdouble_ __x))
+
+/* Compute base-2 logarithm of X.  */
+__MATHCALL (log2,, (_Mdouble_ __x))
+__END_NAMESPACE_C99
+#endif
+
+
+/* Power functions.  */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Return X to the Y power.  */
+__MATHCALLI (pow,, (_Mdouble_ __x, _Mdouble_ __y))
+
+/* Return the square root of X.  */
+__MATHCALLI (sqrt,, (_Mdouble_ __x))
+_Mdouble_END_NAMESPACE
+
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return `sqrt(X*X + Y*Y)'.  */
+__MATHCALLI (hypot,, (_Mdouble_ __x, _Mdouble_ __y))
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return the cube root of X.  */
+__MATHCALLI (cbrt,, (_Mdouble_ __x))
+__END_NAMESPACE_C99
+#endif
+
+
+/* Nearest integer, absolute value, and remainder functions.  */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Smallest integral value not less than X.  */
+__MATHCALLX (ceil,, (_Mdouble_ __x), (__const__))
+
+/* Absolute value of X.  */
+__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__))
+
+/* Largest integer not greater than X.  */
+__MATHCALLX (floor,, (_Mdouble_ __x), (__const__))
+
+/* Floating-point modulo remainder of X/Y.  */
+__MATHCALLI (fmod,, (_Mdouble_ __x, _Mdouble_ __y))
+
+
+/* Return 0 if VALUE is finite or NaN, +1 if it
+   is +Infinity, -1 if it is -Infinity.  */
+__MATHDECL_PRIV (int,isinf,, (_Mdouble_ __value), (__const__))
+
+/* Return nonzero if VALUE is finite and not NaN.  */
+__MATHDECL_PRIV (int,finite,, (_Mdouble_ __value), (__const__))
+_Mdouble_END_NAMESPACE
+
+#ifdef __USE_MISC
+#if 0
+/* Return 0 if VALUE is finite or NaN, +1 if it
+   is +Infinity, -1 if it is -Infinity.  */
+__MATHDECL_PRIV (int,isinf,, (_Mdouble_ __value), (__const__))
+
+/* Return nonzero if VALUE is finite and not NaN.  */
+__MATHDECL_PRIV (int,finite,, (_Mdouble_ __value), (__const__))
+#endif
+/* Return the remainder of X/Y.  */
+__MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y))
+
+
+/* Return the fractional part of X after dividing out `ilogb (X)'.  */
+__MATHCALL (significand,, (_Mdouble_ __x))
+#endif /* Use misc.  */
+
+#if defined __USE_MISC || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return X with its signed changed to Y's.  */
+__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__))
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return representation of NaN for double type.  */
+__MATHCALLX (nan,, (__const char *__tagb), (__const__))
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+/* Return nonzero if VALUE is not a number.  */
+__BEGIN_NAMESPACE_C99
+__MATHDECL_PRIV (int,isnan,, (_Mdouble_ __value), (__const__))
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN
+# ifdef __DO_XSI_MATH__
+/* Bessel functions.  */
+__MATHCALL (j0,, (_Mdouble_))
+__MATHCALL (j1,, (_Mdouble_))
+__MATHCALL (jn,, (int, _Mdouble_))
+__MATHCALL (y0,, (_Mdouble_))
+__MATHCALL (y1,, (_Mdouble_))
+__MATHCALL (yn,, (int, _Mdouble_))
+# endif
+#endif
+
+
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Error and gamma functions.  */
+__MATHCALLI (erf,, (_Mdouble_))
+__MATHCALLI (erfc,, (_Mdouble_))
+__MATHCALLI (lgamma,, (_Mdouble_))
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* True gamma function.  */
+__MATHCALLI (tgamma,, (_Mdouble_))
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* Obsolete alias for `lgamma'.  */
+__MATHCALL (gamma,, (_Mdouble_))
+#endif
+
+#ifdef __USE_MISC
+/* Reentrant version of lgamma.  This function uses the global variable
+   `signgam'.  The reentrant version instead takes a pointer and stores
+   the value through it.  */
+__MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp))
+#endif
+
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return the integer nearest X in the direction of the
+   prevailing rounding mode.  */
+__MATHCALLI (rint,, (_Mdouble_ __x))
+
+/* Return X + epsilon if X < Y, X - epsilon if X > Y.  */
+__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__))
+# if defined __USE_ISOC99 && !defined __LDBL_COMPAT
+__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__))
+# endif
+
+/* Return the remainder of integer divison X / Y with infinite precision.  */
+__MATHCALLI (remainder,, (_Mdouble_ __x, _Mdouble_ __y))
+
+# if defined __USE_MISC || defined __USE_ISOC99
+/* Return X times (2 to the Nth power).  */
+__MATHCALLI (scalbn,, (_Mdouble_ __x, int __n))
+# endif
+
+/* Return the binary exponent of X, which must be nonzero.  */
+__MATHDECLI (int,ilogb,, (_Mdouble_ __x))
+#endif
+
+#ifdef __USE_ISOC99
+/* Return X times (2 to the Nth power).  */
+__MATHCALLI (scalbln,, (_Mdouble_ __x, long int __n))
+
+/* Round X to integral value in floating-point format using current
+   rounding direction, but do not raise inexact exception.  */
+__MATHCALLI (nearbyint,, (_Mdouble_ __x))
+
+/* Round X to nearest integral value, rounding halfway cases away from
+   zero.  */
+__MATHCALLX (round,, (_Mdouble_ __x), (__const__))
+
+/* Round X to the integral value in floating-point format nearest but
+   not larger in magnitude.  */
+__MATHCALLX (trunc,, (_Mdouble_ __x), (__const__))
+
+/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
+   and magnitude congruent `mod 2^n' to the magnitude of the integral
+   quotient x/y, with n >= 3.  */
+__MATHCALLI (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo))
+
+
+/* Conversion functions.  */
+
+/* Round X to nearest integral value according to current rounding
+   direction.  */
+__MATHDECLI (long int,lrint,, (_Mdouble_ __x))
+__MATHDECLI (long long int,llrint,, (_Mdouble_ __x))
+
+/* Round X to nearest integral value, rounding halfway cases away from
+   zero.  */
+__MATHDECLI (long int,lround,, (_Mdouble_ __x))
+__MATHDECLI (long long int,llround,, (_Mdouble_ __x))
+
+
+/* Return positive difference between X and Y.  */
+__MATHCALLI (fdim,, (_Mdouble_ __x, _Mdouble_ __y))
+
+/* Return maximum numeric value from X and Y.  */
+__MATHCALLI (fmax,, (_Mdouble_ __x, _Mdouble_ __y))
+
+/* Return minimum numeric value from X and Y.  */
+__MATHCALLI (fmin,, (_Mdouble_ __x, _Mdouble_ __y))
+
+
+/* Classify given number.  */
+__MATHDECL_PRIV (int, fpclassify,, (_Mdouble_ __value), (__const__))
+
+/* Test for negative number.  */
+__MATHDECL_PRIV (int, signbit,, (_Mdouble_ __value), (__const__))
+
+
+/* Multiply-add function computed as a ternary operation.  */
+__MATHCALLI (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z))
+#endif /* Use ISO C99.  */
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__END_NAMESPACE_C99
+#endif
+
+#if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) \
+	&& defined __UCLIBC_SUSV3_LEGACY__
+/* Return X times (2 to the Nth power).  */
+__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n))
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathdef.h
new file mode 100644
index 0000000..00c6724
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathdef.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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
+
+/* Normally, there is no long double type and the `float' and `double'
+   expressions are evaluated as `double'.  */
+typedef double float_t;		/* `float' expressions are evaluated as
+				   `double'.  */
+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'.  The disables the
+   declaration of all the `long double' function variants.  */
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathinline.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathinline.h
new file mode 100644
index 0000000..5498af6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathinline.h
@@ -0,0 +1,12 @@
+/* This file should provide inline versions of math functions.
+
+   Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
+
+   This file should define __MATH_INLINES if functions are actually defined as
+   inlines.  */
+
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+
+/* Here goes the real code.  */
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman-common.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman-common.h
new file mode 100644
index 0000000..f00cb1a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman-common.h
@@ -0,0 +1,109 @@
+/* Definitions for POSIX memory map interface.  Linux/generic version.
+   Copyright (C) 1997,2000,2003,2005,2006,2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+   But the kernel header is not namespace clean.  */
+
+
+/* Protections are chosen from these bits, OR'd together.  The
+   implementation does not necessarily support PROT_EXEC or PROT_WRITE
+   without PROT_READ.  The only guarantees are that no writing will be
+   allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ	0x1		/* Page can be read.  */
+#define PROT_WRITE	0x2		/* Page can be written.  */
+#define PROT_EXEC	0x4		/* Page can be executed.  */
+#define PROT_NONE	0x0		/* Page can not be accessed.  */
+#define PROT_GROWSDOWN	0x01000000	/* Extend change to start of
+					   growsdown vma (mprotect only).  */
+#define PROT_GROWSUP	0x02000000	/* Extend change to start of
+					   growsup vma (mprotect only).  */
+
+/* Sharing types (must choose one and only one of these).  */
+#define MAP_SHARED	0x01		/* Share changes.  */
+#define MAP_PRIVATE	0x02		/* Changes are private.  */
+#ifdef __USE_MISC
+# define MAP_TYPE	0x0f		/* Mask for type of mapping.  */
+#endif
+
+/* Other flags.  */
+#define MAP_FIXED	0x10		/* Interpret addr exactly.  */
+#ifdef __USE_MISC
+# define MAP_FILE	0
+# define MAP_ANONYMOUS	0x20		/* Don't use a file.  */
+# define MAP_ANON	MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific.  */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN	0x00100		/* Stack-like segment.  */
+# define MAP_DENYWRITE	0x00800		/* ETXTBSY */
+# define MAP_EXECUTABLE	0x01000		/* Mark it as an executable.  */
+# define MAP_LOCKED	0x02000		/* Lock the mapping.  */
+# define MAP_NORESERVE	0x04000		/* Don't check for reservations.  */
+# define MAP_POPULATE	0x08000		/* Populate (prefault) pagetables.  */
+# define MAP_NONBLOCK	0x10000		/* Do not block on IO.  */
+# define MAP_STACK	0x20000		/* Allocation is for a stack.  */
+# define MAP_UNINITIALIZE 0x4000000     /* For anonymous mmap, memory could
+					   be uninitialized. */
+#endif
+
+/* Flags to `msync'.  */
+#define MS_ASYNC	1		/* Sync memory asynchronously.  */
+#define MS_SYNC		4		/* Synchronous memory sync.  */
+#define MS_INVALIDATE	2		/* Invalidate the caches.  */
+
+/* Flags for `mlockall'.  */
+#define MCL_CURRENT	1		/* Lock all currently mapped pages.  */
+#define MCL_FUTURE	2		/* Lock all additions to address
+					   space.  */
+
+/* Flags for `mremap'.  */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE	1
+# define MREMAP_FIXED	2
+#endif
+
+/* Advice to `madvise'.  */
+#ifdef __USE_BSD
+# define MADV_NORMAL	  0	/* No further special treatment.  */
+# define MADV_RANDOM	  1	/* Expect random page references.  */
+# define MADV_SEQUENTIAL  2	/* Expect sequential page references.  */
+# define MADV_WILLNEED	  3	/* Will need these pages.  */
+# define MADV_DONTNEED	  4	/* Don't need these pages.  */
+# define MADV_REMOVE	  9	/* Remove these pages and resources.  */
+# define MADV_DONTFORK	  10	/* Do not inherit across fork.  */
+# define MADV_DOFORK	  11	/* Do inherit across fork.  */
+# define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+# define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
+# define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+#endif
+
+/* The POSIX people had to invent similar names for the same things.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_MADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_MADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+# define POSIX_MADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_MADV_DONTNEED	4 /* Don't need these pages.  */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman.h
new file mode 100644
index 0000000..11b8e2a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman.h
@@ -0,0 +1 @@
+#include <bits/mman-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mqueue.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mqueue.h
new file mode 100644
index 0000000..df528f8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mqueue.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 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 _MQUEUE_H
+# error "Never use <bits/mqueue.h> directly; include <mqueue.h> instead."
+#endif
+
+typedef int mqd_t;
+
+struct mq_attr
+{
+  long int mq_flags;	/* Message queue flags.  */
+  long int mq_maxmsg;	/* Maximum number of messages.  */
+  long int mq_msgsize;	/* Maximum message size.  */
+  long int mq_curmsgs;	/* Number of messages currently queued.  */
+  long int __pad[4];
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/msq.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/msq.h
new file mode 100644
index 0000000..32a49b5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/msq.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 1995, 1996, 1997, 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 _SYS_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Define options for message queue functions.  */
+#define MSG_NOERROR	010000	/* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT	020000	/* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition.  */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+
+/* Structure of record for one message inside the kernel.
+   The type `struct msg' is opaque.  */
+struct msqid_ds
+{
+  struct ipc_perm msg_perm;	/* structure describing operation permission */
+  __time_t msg_stime;		/* time of last msgsnd command */
+  unsigned long int __unused1;
+  __time_t msg_rtime;		/* time of last msgrcv command */
+  unsigned long int __unused2;
+  __time_t msg_ctime;		/* time of last change */
+  unsigned long int __unused3;
+  unsigned long int __msg_cbytes; /* current number of bytes on queue */
+  msgqnum_t msg_qnum;		/* number of messages currently on queue */
+  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
+  __pid_t msg_lspid;		/* pid of last msgsnd() */
+  __pid_t msg_lrpid;		/* pid of last msgrcv() */
+  unsigned long int __unused4;
+  unsigned long int __unused5;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes	__msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+  {
+    int msgpool;
+    int msgmap;
+    int msgmax;
+    int msgmnb;
+    int msgmni;
+    int msgssz;
+    int msgtql;
+    unsigned short int msgseg;
+  };
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/nan.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/nan.h
new file mode 100644
index 0000000..bae97f2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/nan.h
@@ -0,0 +1,53 @@
+/* `NAN' constant for IEEE 754 machines.
+   Copyright (C) 1992,1996,1997,1999,2004,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.  */
+
+#ifndef _MATH_H
+# error "Never use <bits/nan.h> directly; include <math.h> instead."
+#endif
+
+
+/* IEEE Not A Number.  */
+
+#if __GNUC_PREREQ(3,3)
+
+# define NAN	(__builtin_nanf (""))
+
+#elif defined __GNUC__
+
+# define NAN \
+  (__extension__							      \
+   ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; })  \
+    { __l: 0x7fc00000UL }).__d)
+
+#else
+
+# include <endian.h>
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+#  define __nan_bytes		{ 0x7f, 0xc0, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+#  define __nan_bytes		{ 0, 0, 0xc0, 0x7f }
+# endif
+
+static union { unsigned char __c[4]; float __d; } __nan_union
+    __attribute_used__ = { __nan_bytes };
+# define NAN	(__nan_union.__d)
+
+#endif	/* GCC.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/netdb.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/netdb.h
new file mode 100644
index 0000000..41dc731
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/netdb.h
@@ -0,0 +1,33 @@
+/* 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.  */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network.  NOTE: here a
+   poor assumption is made.  The network number is expected to fit
+   into an unsigned long int variable.  */
+struct netent
+{
+  char *n_name;			/* Official name of network.  */
+  char **n_aliases;		/* Alias list.  */
+  int n_addrtype;		/* Net address type.  */
+  uint32_t n_net;		/* Network number.  */
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/poll.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/poll.h
new file mode 100644
index 0000000..d7996b4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/poll.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1997, 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.  */
+
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for.  These bits may be set in `events'
+   to indicate the interesting event types; they will appear in `revents'
+   to indicate the status of the file descriptor.  */
+#define POLLIN		0x001		/* There is data to read.  */
+#define POLLPRI		0x002		/* There is urgent data to read.  */
+#define POLLOUT		0x004		/* Writing now will not block.  */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2.  */
+# define POLLRDNORM	0x040		/* Normal data may be read.  */
+# define POLLRDBAND	0x080		/* Priority data may be read.  */
+# define POLLWRNORM	0x100		/* Writing now will not block.  */
+# define POLLWRBAND	0x200		/* Priority data may be written.  */
+#endif
+
+#ifdef __USE_GNU
+/* These are extensions for Linux.  */
+# define POLLMSG	0x400
+# define POLLREMOVE	0x1000
+# define POLLRDHUP	0x2000
+#endif
+
+/* Event types always implicitly polled for.  These bits need not be set in
+   `events', but they will appear in `revents' to indicate the status of
+   the file descriptor.  */
+#define POLLERR		0x008		/* Error condition.  */
+#define POLLHUP		0x010		/* Hung up.  */
+#define POLLNVAL	0x020		/* Invalid polling request.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix1_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix1_lim.h
new file mode 100644
index 0000000..3c86dce
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix1_lim.h
@@ -0,0 +1,169 @@
+/* Copyright (C) 1991-1993,96,98,2000-2003,2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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.  */
+
+/*
+ *	POSIX Standard: 2.9.2 Minimum Values	Added to <limits.h>
+ *
+ *	Never include this file directly; use <limits.h> instead.
+ */
+
+#ifndef	_BITS_POSIX1_LIM_H
+#define	_BITS_POSIX1_LIM_H	1
+
+
+/* These are the standard-mandated minimum values.  */
+
+/* Minimum number of operations in one list I/O call.  */
+#define _POSIX_AIO_LISTIO_MAX	2
+
+/* Minimal number of outstanding asynchronous I/O operations.  */
+#define _POSIX_AIO_MAX		1
+
+/* Maximum length of arguments to `execve', including environment.  */
+#define	_POSIX_ARG_MAX		4096
+
+/* Maximum simultaneous processes per real user ID.  */
+#ifdef __USE_XOPEN2K
+# define _POSIX_CHILD_MAX	25
+#else
+# define _POSIX_CHILD_MAX	6
+#endif
+
+/* Minimal number of timer expiration overruns.  */
+#define _POSIX_DELAYTIMER_MAX	32
+
+/* Maximum length of a host name (not including the terminating null)
+   as returned from the GETHOSTNAME function.  */
+#define _POSIX_HOST_NAME_MAX	255
+
+/* Maximum link count of a file.  */
+#define	_POSIX_LINK_MAX		8
+
+/* Maximum length of login name.  */
+#define	_POSIX_LOGIN_NAME_MAX	9
+
+/* Number of bytes in a terminal canonical input queue.  */
+#define	_POSIX_MAX_CANON	255
+
+/* Number of bytes for which space will be
+   available in a terminal input queue.  */
+#define	_POSIX_MAX_INPUT	255
+
+/* Maximum number of message queues open for a process.  */
+#define _POSIX_MQ_OPEN_MAX	8
+
+/* Maximum number of supported message priorities.  */
+#define _POSIX_MQ_PRIO_MAX	32
+
+/* Number of bytes in a filename.  */
+#define	_POSIX_NAME_MAX		14
+
+/* Number of simultaneous supplementary group IDs per process.  */
+#ifdef __USE_XOPEN2K
+# define _POSIX_NGROUPS_MAX	8
+#else
+# define _POSIX_NGROUPS_MAX	0
+#endif
+
+/* Number of files one process can have open at once.  */
+#ifdef __USE_XOPEN2K
+# define _POSIX_OPEN_MAX	20
+#else
+# define _POSIX_OPEN_MAX	16
+#endif
+
+/* Number of descriptors that a process may examine with `pselect' or
+   `select'.  */
+#define	_POSIX_FD_SETSIZE	_POSIX_OPEN_MAX
+
+/* Number of bytes in a pathname.  */
+#define	_POSIX_PATH_MAX		256
+
+/* Number of bytes than can be written atomically to a pipe.  */
+#define	_POSIX_PIPE_BUF		512
+
+/* The number of repeated occurrences of a BRE permitted by the
+   REGEXEC and REGCOMP functions when using the interval notation.  */
+#define _POSIX_RE_DUP_MAX	255
+
+/* Minimal number of realtime signals reserved for the application.  */
+#define _POSIX_RTSIG_MAX	8
+
+/* Number of semaphores a process can have.  */
+#define _POSIX_SEM_NSEMS_MAX	256
+
+/* Maximal value of a semaphore.  */
+#define _POSIX_SEM_VALUE_MAX	32767
+
+/* Number of pending realtime signals.  */
+#define _POSIX_SIGQUEUE_MAX	32
+
+/* Largest value of a `ssize_t'.  */
+#define	_POSIX_SSIZE_MAX	32767
+
+/* Number of streams a process can have open at once.  */
+#define	_POSIX_STREAM_MAX	8
+
+/* The number of bytes in a symbolic link.  */
+#define _POSIX_SYMLINK_MAX	255
+
+/* The number of symbolic links that can be traversed in the
+   resolution of a pathname in the absence of a loop.  */
+#define _POSIX_SYMLOOP_MAX	8
+
+/* Number of timer for a process.  */
+#define _POSIX_TIMER_MAX	32
+
+/* Maximum number of characters in a tty name.  */
+#define	_POSIX_TTY_NAME_MAX	9
+
+/* Maximum length of a timezone name (element of `tzname').  */
+#define	_POSIX_TZNAME_MAX	6
+
+/* Maximum number of connections that can be queued on a socket.  */
+#define	_POSIX_QLIMIT		1
+
+/* Maximum number of bytes that can be buffered on a socket for send
+   or receive.  */
+#define	_POSIX_HIWAT		_POSIX_PIPE_BUF
+
+/* Maximum number of elements in an `iovec' array.  */
+#define	_POSIX_UIO_MAXIOV	16
+
+/* Maximum clock resolution in nanoseconds.  */
+#define _POSIX_CLOCKRES_MIN	20000000
+
+
+/* Get the implementation-specific values for the above.  */
+#include <bits/local_lim.h>
+#include <bits/uClibc_local_lim.h>
+
+
+#ifndef	SSIZE_MAX
+# define SSIZE_MAX	LONG_MAX
+#endif
+
+
+/* This value is a guaranteed minimum maximum.
+   The current maximum can be got from `sysconf'.  */
+
+#ifndef	NGROUPS_MAX
+# define NGROUPS_MAX	8
+#endif
+
+#endif	/* bits/posix1_lim.h  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix2_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix2_lim.h
new file mode 100644
index 0000000..24483a0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix2_lim.h
@@ -0,0 +1,91 @@
+/* Copyright (C) 1991, 1996, 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.  */
+
+/*
+ * Never include this file directly; include <limits.h> instead.
+ */
+
+#ifndef	_BITS_POSIX2_LIM_H
+#define	_BITS_POSIX2_LIM_H	1
+
+
+/* The maximum `ibase' and `obase' values allowed by the `bc' utility.  */
+#define	_POSIX2_BC_BASE_MAX		99
+
+/* The maximum number of elements allowed in an array by the `bc' utility.  */
+#define	_POSIX2_BC_DIM_MAX		2048
+
+/* The maximum `scale' value allowed by the `bc' utility.  */
+#define	_POSIX2_BC_SCALE_MAX		99
+
+/* The maximum length of a string constant accepted by the `bc' utility.  */
+#define	_POSIX2_BC_STRING_MAX		1000
+
+/* The maximum number of weights that can be assigned to an entry of
+   the LC_COLLATE `order' keyword in the locale definition file.  */
+#define	_POSIX2_COLL_WEIGHTS_MAX	2
+
+/* The maximum number of expressions that can be nested
+   within parentheses by the `expr' utility.  */
+#define	_POSIX2_EXPR_NEST_MAX		32
+
+/* The maximum length, in bytes, of an input line.  */
+#define	_POSIX2_LINE_MAX		2048
+
+/* The maximum number of repeated occurrences of a regular expression
+   permitted when using the interval notation `\{M,N\}'.  */
+#define	_POSIX2_RE_DUP_MAX		255
+
+/* The maximum number of bytes in a character class name.  We have no
+   fixed limit, 2048 is a high number.  */
+#define	_POSIX2_CHARCLASS_NAME_MAX	14
+
+
+/* These values are implementation-specific,
+   and may vary within the implementation.
+   Their precise values can be obtained from sysconf.  */
+
+#ifndef	BC_BASE_MAX
+#define	BC_BASE_MAX		_POSIX2_BC_BASE_MAX
+#endif
+#ifndef	BC_DIM_MAX
+#define	BC_DIM_MAX		_POSIX2_BC_DIM_MAX
+#endif
+#ifndef	BC_SCALE_MAX
+#define	BC_SCALE_MAX		_POSIX2_BC_SCALE_MAX
+#endif
+#ifndef	BC_STRING_MAX
+#define	BC_STRING_MAX		_POSIX2_BC_STRING_MAX
+#endif
+#ifndef	COLL_WEIGHTS_MAX
+#define	COLL_WEIGHTS_MAX	255
+#endif
+#ifndef	EXPR_NEST_MAX
+#define	EXPR_NEST_MAX		_POSIX2_EXPR_NEST_MAX
+#endif
+#ifndef	LINE_MAX
+#define	LINE_MAX		_POSIX2_LINE_MAX
+#endif
+#ifndef	CHARCLASS_NAME_MAX
+#define	CHARCLASS_NAME_MAX	2048
+#endif
+
+/* This value is defined like this in regex.h.  */
+#define	RE_DUP_MAX (0x7fff)
+
+#endif	/* bits/posix2_lim.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix_opt.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix_opt.h
new file mode 100644
index 0000000..aa40eae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix_opt.h
@@ -0,0 +1,190 @@
+/* Define POSIX options for Linux.
+   Copyright (C) 1996-2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef	_POSIX_OPT_H
+#define	_POSIX_OPT_H	1
+
+/* Job control is supported.  */
+#define	_POSIX_JOB_CONTROL	1
+
+/* Processes have a saved set-user-ID and a saved set-group-ID.  */
+#define	_POSIX_SAVED_IDS	1
+
+/* Priority scheduling is supported.  */
+#define	_POSIX_PRIORITY_SCHEDULING	200112L
+
+/* Synchronizing file data is supported.  */
+#define	_POSIX_SYNCHRONIZED_IO	200112L
+
+/* The fsync function is present.  */
+#define	_POSIX_FSYNC	200112L
+
+/* Mapping of files to memory is supported.  */
+#define	_POSIX_MAPPED_FILES	200112L
+
+/* Locking of all memory is supported.  */
+#define	_POSIX_MEMLOCK	200112L
+
+/* Locking of ranges of memory is supported.  */
+#define	_POSIX_MEMLOCK_RANGE	200112L
+
+/* Setting of memory protections is supported.  */
+#define	_POSIX_MEMORY_PROTECTION	200112L
+
+/* Only root can change owner of file.  */
+#define	_POSIX_CHOWN_RESTRICTED	1
+
+/* `c_cc' member of 'struct termios' structure can be disabled by
+   using the value _POSIX_VDISABLE.  */
+#define	_POSIX_VDISABLE	'\0'
+
+/* Filenames are not silently truncated.  */
+#define	_POSIX_NO_TRUNC	1
+
+/* X/Open realtime support is available.  */
+#define _XOPEN_REALTIME	1
+
+/* XPG4.2 shared memory is supported.  */
+#define	_XOPEN_SHM	1
+
+/* Tell we have POSIX threads.  */
+#define _POSIX_THREADS	200112L
+
+/* We have the reentrant functions described in POSIX.  */
+#define _POSIX_REENTRANT_FUNCTIONS      1
+#define _POSIX_THREAD_SAFE_FUNCTIONS	200112L
+
+/* We provide priority scheduling for threads.  */
+#define _POSIX_THREAD_PRIORITY_SCHEDULING	200112L
+
+/* We support user-defined stack sizes.  */
+#define _POSIX_THREAD_ATTR_STACKSIZE	200112L
+
+/* We support user-defined stacks.  */
+#define _POSIX_THREAD_ATTR_STACKADDR	200112L
+
+#ifdef __UCLIBC_HAS_REALTIME__
+/* We support POSIX.1b semaphores.  */
+#define _POSIX_SEMAPHORES	200112L
+#endif
+
+/* Real-time signals are supported.  */
+#define _POSIX_REALTIME_SIGNALS	200112L
+
+/* We support asynchronous I/O.  */
+#define _POSIX_ASYNCHRONOUS_IO	200112L
+#define _POSIX_ASYNC_IO		1
+/* Alternative name for Unix98.  */
+#define _LFS_ASYNCHRONOUS_IO	1
+/* Support for prioritization is also available.  */
+#define _POSIX_PRIORITIZED_IO	200112L
+
+/* The LFS support in asynchronous I/O is also available.  */
+#define _LFS64_ASYNCHRONOUS_IO	1
+
+#ifdef __UCLIBC_HAS_LFS__
+/* The rest of the LFS is also available.  */
+#define _LFS_LARGEFILE		1
+#define _LFS64_LARGEFILE	1
+#define _LFS64_STDIO		1
+#endif
+
+/* POSIX shared memory objects are implemented.  */
+#define _POSIX_SHARED_MEMORY_OBJECTS	200112L
+
+/* CPU-time clocks support needs to be checked at runtime.  */
+#define _POSIX_CPUTIME	0
+
+/* Clock support in threads must be also checked at runtime.  */
+#define _POSIX_THREAD_CPUTIME	0
+
+#ifdef __UCLIBC_HAS_REGEX__
+/* GNU libc provides regular expression handling.  */
+#define _POSIX_REGEXP	1
+#endif
+
+/* Reader/Writer locks are available.  */
+#define _POSIX_READER_WRITER_LOCKS	200112L
+
+/* We have a POSIX shell.  */
+#define _POSIX_SHELL	1
+
+/* We support the Timeouts option.  */
+#define _POSIX_TIMEOUTS	200112L
+
+/* We support spinlocks.  */
+#define _POSIX_SPIN_LOCKS	200112L
+
+/* The `spawn' function family is supported.  */
+#if 0 /* no support in uClibc (yet) */
+#define _POSIX_SPAWN	200112L
+#endif
+
+/* We have POSIX timers.  */
+#define _POSIX_TIMERS	200112L
+
+/* The barrier functions are available.  */
+#define _POSIX_BARRIERS	200112L
+
+/* POSIX message queues are available.  */
+#define	_POSIX_MESSAGE_PASSING	200112L
+
+/* Thread process-shared synchronization is supported.  */
+#define _POSIX_THREAD_PROCESS_SHARED	200112L
+
+/* The monotonic clock might be available.  */
+#define _POSIX_MONOTONIC_CLOCK	0
+
+/* The clock selection interfaces are available.  */
+#define _POSIX_CLOCK_SELECTION	200112L
+
+/* Advisory information interfaces are available.  */
+#define _POSIX_ADVISORY_INFO	200112L
+
+#ifdef __UCLIBC_HAS_IPV6__
+/* IPv6 support is available.  */
+#define _POSIX_IPV6	200112L
+#endif
+
+#ifdef __UCLIBC_HAS_SOCKET__
+/* Raw socket support is available.  */
+#define _POSIX_RAW_SOCKETS	200112L
+#endif
+
+/* We have at least one terminal.  */
+#define _POSIX2_CHAR_TERM	200112L
+
+/* Neither process nor thread sporadic server interfaces is available.  */
+#define _POSIX_SPORADIC_SERVER	-1
+#define _POSIX_THREAD_SPORADIC_SERVER	-1
+
+/* trace.h is not available.  */
+#define _POSIX_TRACE	-1
+#define _POSIX_TRACE_EVENT_FILTER	-1
+#define _POSIX_TRACE_INHERIT	-1
+#define _POSIX_TRACE_LOG	-1
+
+/* Typed memory objects are not available.  */
+#define _POSIX_TYPED_MEMORY_OBJECTS	-1
+
+/* No support for priority inheritance or protection so far.  */
+#define _POSIX_THREAD_PRIO_INHERIT	-1
+#define _POSIX_THREAD_PRIO_PROTECT	-1
+
+#endif /* posix_opt.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/resource.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/resource.h
new file mode 100644
index 0000000..526cdaf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/resource.h
@@ -0,0 +1,225 @@
+/* Bit values & structures for resource limits.  Linux version.
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 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.  */
+
+#ifndef _SYS_RESOURCE_H
+# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Transmute defines to enumerations.  The macro re-definitions are
+   necessary because some programs want to test for operating system
+   features with #ifdef RUSAGE_SELF.  In ISO C the reflexive
+   definition is a no-op.  */
+
+/* Kinds of resource limit.  */
+enum __rlimit_resource
+{
+  /* Per-process CPU limit, in seconds.  */
+  RLIMIT_CPU = 0,
+#define RLIMIT_CPU RLIMIT_CPU
+
+  /* Largest file that can be created, in bytes.  */
+  RLIMIT_FSIZE = 1,
+#define	RLIMIT_FSIZE RLIMIT_FSIZE
+
+  /* Maximum size of data segment, in bytes.  */
+  RLIMIT_DATA = 2,
+#define	RLIMIT_DATA RLIMIT_DATA
+
+  /* Maximum size of stack segment, in bytes.  */
+  RLIMIT_STACK = 3,
+#define	RLIMIT_STACK RLIMIT_STACK
+
+  /* Largest core file that can be created, in bytes.  */
+  RLIMIT_CORE = 4,
+#define	RLIMIT_CORE RLIMIT_CORE
+
+  /* Largest resident set size, in bytes.
+     This affects swapping; processes that are exceeding their
+     resident set size will be more likely to have physical memory
+     taken from them.  */
+  __RLIMIT_RSS = 5,
+#define	RLIMIT_RSS __RLIMIT_RSS
+
+  /* Number of open files.  */
+  RLIMIT_NOFILE = 7,
+  __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same.  */
+#define RLIMIT_NOFILE RLIMIT_NOFILE
+#define RLIMIT_OFILE __RLIMIT_OFILE
+
+  /* Address space limit.  */
+  RLIMIT_AS = 9,
+#define RLIMIT_AS RLIMIT_AS
+
+  /* Number of processes.  */
+  __RLIMIT_NPROC = 6,
+#define RLIMIT_NPROC __RLIMIT_NPROC
+
+  /* Locked-in-memory address space.  */
+  __RLIMIT_MEMLOCK = 8,
+#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK
+
+  /* Maximum number of file locks.  */
+  __RLIMIT_LOCKS = 10,
+#define RLIMIT_LOCKS __RLIMIT_LOCKS
+
+  /* Maximum number of pending signals.  */
+  __RLIMIT_SIGPENDING = 11,
+#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING
+
+  /* Maximum bytes in POSIX message queues.  */
+  __RLIMIT_MSGQUEUE = 12,
+#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
+
+  /* Maximum nice priority allowed to raise to.
+     Nice levels 19 .. -20 correspond to 0 .. 39
+     values of this resource limit.  */
+  __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+  /* Maximum realtime priority allowed for non-priviledged
+     processes.  */
+  __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
+
+  __RLIMIT_NLIMITS = 15,
+  __RLIM_NLIMITS = __RLIMIT_NLIMITS
+#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
+#define RLIM_NLIMITS __RLIM_NLIMITS
+};
+
+/* Value to indicate that there is no limit.  */
+#ifndef __USE_FILE_OFFSET64
+# define RLIM_INFINITY ((unsigned long int)(~0UL))
+#else
+# define RLIM_INFINITY 0xffffffffffffffffuLL
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define RLIM64_INFINITY 0xffffffffffffffffuLL
+#endif
+
+/* We can represent all limits.  */
+#define RLIM_SAVED_MAX	RLIM_INFINITY
+#define RLIM_SAVED_CUR	RLIM_INFINITY
+
+
+/* Type for resource quantity measurement.  */
+#ifndef __USE_FILE_OFFSET64
+typedef __rlim_t rlim_t;
+#else
+typedef __rlim64_t rlim_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef __rlim64_t rlim64_t;
+#endif
+
+struct rlimit
+  {
+    /* The current (soft) limit.  */
+    rlim_t rlim_cur;
+    /* The hard limit.  */
+    rlim_t rlim_max;
+  };
+
+#ifdef __USE_LARGEFILE64
+struct rlimit64
+  {
+    /* The current (soft) limit.  */
+    rlim64_t rlim_cur;
+    /* The hard limit.  */
+    rlim64_t rlim_max;
+ };
+#endif
+
+/* Whose usage statistics do you want?  */
+enum __rusage_who
+{
+  /* The calling process.  */
+  RUSAGE_SELF = 0,
+#define RUSAGE_SELF RUSAGE_SELF
+
+  /* All of its terminated child processes.  */
+  RUSAGE_CHILDREN = -1
+#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+};
+
+#define __need_timeval
+#include <bits/time.h>		/* For `struct timeval'.  */
+
+/* Structure which says how much of each resource has been used.  */
+struct rusage
+  {
+    /* Total amount of user time used.  */
+    struct timeval ru_utime;
+    /* Total amount of system time used.  */
+    struct timeval ru_stime;
+    /* Maximum resident set size (in kilobytes).  */
+    long int ru_maxrss;
+    /* Amount of sharing of text segment memory
+       with other processes (kilobyte-seconds).  */
+    long int ru_ixrss;
+    /* Amount of data segment memory used (kilobyte-seconds).  */
+    long int ru_idrss;
+    /* Amount of stack memory used (kilobyte-seconds).  */
+    long int ru_isrss;
+    /* Number of soft page faults (i.e. those serviced by reclaiming
+       a page from the list of pages awaiting reallocation.  */
+    long int ru_minflt;
+    /* Number of hard page faults (i.e. those that required I/O).  */
+    long int ru_majflt;
+    /* Number of times a process was swapped out of physical memory.  */
+    long int ru_nswap;
+    /* Number of input operations via the file system.  Note: This
+       and `ru_oublock' do not include operations with the cache.  */
+    long int ru_inblock;
+    /* Number of output operations via the file system.  */
+    long int ru_oublock;
+    /* Number of IPC messages sent.  */
+    long int ru_msgsnd;
+    /* Number of IPC messages received.  */
+    long int ru_msgrcv;
+    /* Number of signals delivered.  */
+    long int ru_nsignals;
+    /* Number of voluntary context switches, i.e. because the process
+       gave up the process before it had to (usually to wait for some
+       resource to be available).  */
+    long int ru_nvcsw;
+    /* Number of involuntary context switches, i.e. a higher priority process
+       became runnable or the current process used up its time slice.  */
+    long int ru_nivcsw;
+  };
+
+/* Priority limits.  */
+#define PRIO_MIN	-20	/* Minimum priority a process can have.  */
+#define PRIO_MAX	20	/* Maximum priority a process can have.  */
+
+/* The type of the WHICH argument to `getpriority' and `setpriority',
+   indicating what flavor of entity the WHO argument specifies.  */
+enum __priority_which
+{
+  PRIO_PROCESS = 0,		/* WHO is a process ID.  */
+#define PRIO_PROCESS PRIO_PROCESS
+  PRIO_PGRP = 1,		/* WHO is a process group ID.  */
+#define PRIO_PGRP PRIO_PGRP
+  PRIO_USER = 2			/* WHO is a user ID.  */
+#define PRIO_USER PRIO_USER
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sched.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sched.h
new file mode 100644
index 0000000..7d6273f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sched.h
@@ -0,0 +1,200 @@
+/* Definitions of constants and data structure for POSIX 1003.1b-1993
+   scheduling interface.
+   Copyright (C) 1996-1999,2001-2003,2005,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 __need_schedparam
+
+#ifndef _SCHED_H
+# error "Never include <bits/sched.h> directly; use <sched.h> instead."
+#endif
+
+
+/* Scheduling algorithms.  */
+#define SCHED_OTHER	0
+#define SCHED_FIFO	1
+#define SCHED_RR	2
+#ifdef __USE_GNU
+# define SCHED_BATCH	3
+#endif
+
+#ifdef __USE_MISC
+/* Cloning flags.  */
+# define CSIGNAL       0x000000ff /* Signal mask to be sent at exit.  */
+# define CLONE_VM      0x00000100 /* Set if VM shared between processes.  */
+# define CLONE_FS      0x00000200 /* Set if fs info shared between processes.  */
+# define CLONE_FILES   0x00000400 /* Set if open files shared between processes.  */
+# define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared.  */
+# define CLONE_PTRACE  0x00002000 /* Set if tracing continues on the child.  */
+# define CLONE_VFORK   0x00004000 /* Set if the parent wants the child to
+				     wake it up on mm_release.  */
+# define CLONE_PARENT  0x00008000 /* Set if we want to have the same
+				     parent as the cloner.  */
+# define CLONE_THREAD  0x00010000 /* Set to add to same thread group.  */
+# define CLONE_NEWNS   0x00020000 /* Set to create new namespace.  */
+# define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics.  */
+# define CLONE_SETTLS  0x00080000 /* Set TLS info.  */
+# define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer
+					   before MM copy.  */
+# define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory
+					    location to clear.  */
+# define CLONE_DETACHED 0x00400000 /* Create clone detached.  */
+# define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't
+				      force CLONE_PTRACE on this clone.  */
+# define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in
+					  the child.  */
+# define CLONE_STOPPED 0x02000000 /* Start in stopped state.  */
+# define CLONE_NEWUTS	0x04000000	/* New utsname group.  */
+# define CLONE_NEWIPC	0x08000000	/* New ipcs.  */
+# define CLONE_NEWUSER	0x10000000	/* New user namespace.  */
+# define CLONE_NEWPID	0x20000000	/* New pid namespace.  */
+# define CLONE_NEWNET	0x40000000	/* New network namespace.  */
+# define CLONE_IO	0x80000000	/* Clone I/O context.  */
+#endif
+
+/* The official definition.  */
+struct sched_param
+  {
+    int __sched_priority;
+  };
+
+__BEGIN_DECLS
+
+#ifdef __USE_MISC
+/* Clone current process.  */
+extern int clone (int (*__fn) (void *__arg), void *__child_stack,
+		  int __flags, void *__arg, ...) __THROW;
+
+/* Unshare the specified resources.  */
+extern int unshare (int __flags) __THROW;
+
+/* Get index of currently used CPU.  */
+extern int sched_getcpu (void) __THROW;
+#endif
+
+__END_DECLS
+
+#endif	/* need schedparam */
+
+#if !defined __defined_schedparam \
+    && (defined __need_schedparam || defined _SCHED_H)
+# define __defined_schedparam	1
+/* Data structure to describe a process' schedulability.  */
+struct __sched_param
+  {
+    int __sched_priority;
+  };
+# undef __need_schedparam
+#endif
+
+
+#if defined _SCHED_H && !defined __cpu_set_t_defined
+# define __cpu_set_t_defined
+/* Size definition for CPU sets.  */
+# define __CPU_SETSIZE	1024
+# define __NCPUBITS	(8 * sizeof (__cpu_mask))
+
+/* Type for array elements in 'cpu_set_t'.  */
+typedef unsigned long int __cpu_mask;
+
+/* Basic access functions.  */
+# define __CPUELT(cpu)	((cpu) / __NCPUBITS)
+# define __CPUMASK(cpu)	((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
+
+/* Data structure to describe CPU mask.  */
+typedef struct
+{
+  __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
+} cpu_set_t;
+
+/* Access functions for CPU masks.  */
+# define __CPU_ZERO_S(setsize, cpusetp) \
+  do {									      \
+    size_t __i;								      \
+    size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
+    __cpu_mask *__bits = (cpusetp)->__bits;				      \
+    for (__i = 0; __i < __imax; ++__i)					      \
+      __bits[__i] = 0;							      \
+  } while (0)
+# define __CPU_SET_S(cpu, setsize, cpusetp) \
+  (__extension__							      \
+   ({ size_t __cpu = (cpu);						      \
+      __cpu < 8 * (setsize)						      \
+      ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
+	 |= __CPUMASK (__cpu))						      \
+      : 0; }))
+# define __CPU_CLR_S(cpu, setsize, cpusetp) \
+  (__extension__							      \
+   ({ size_t __cpu = (cpu);						      \
+      __cpu < 8 * (setsize)						      \
+      ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
+	 &= ~__CPUMASK (__cpu))						      \
+      : 0; }))
+# define __CPU_ISSET_S(cpu, setsize, cpusetp) \
+  (__extension__							      \
+   ({ size_t __cpu = (cpu);						      \
+      __cpu < 8 * (setsize)						      \
+      ? ((((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]	      \
+	  & __CPUMASK (__cpu))) != 0					      \
+      : 0; }))
+
+# define __CPU_COUNT_S(setsize, cpusetp) \
+  __sched_cpucount (setsize, cpusetp)
+
+# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
+  (__extension__							      \
+   ({ __cpu_mask *__arr1 = (cpusetp1)->__bits;				      \
+      __cpu_mask *__arr2 = (cpusetp2)->__bits;				      \
+      size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
+      size_t __i;							      \
+      for (__i = 0; __i < __imax; ++__i)				      \
+	if (__arr1[__i] != __arr2[__i])					      \
+	  break;							      \
+      __i == __imax; }))
+
+# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
+  (__extension__							      \
+   ({ cpu_set_t *__dest = (destset);					      \
+      __cpu_mask *__arr1 = (srcset1)->__bits;				      \
+      __cpu_mask *__arr2 = (srcset2)->__bits;				      \
+      size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
+      size_t __i;							      \
+      for (__i = 0; __i < __imax; ++__i)				      \
+	((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i];    \
+      __dest; }))
+
+# define __CPU_ALLOC_SIZE(count) \
+  ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask))
+# define __CPU_ALLOC(count) __sched_cpualloc (count)
+# define __CPU_FREE(cpuset) __sched_cpufree (cpuset)
+
+__BEGIN_DECLS
+
+extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
+  __THROW;
+#if 0 /* in uClibc we use macros */
+extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur;
+extern void __sched_cpufree (cpu_set_t *__set) __THROW;
+#else
+# define __sched_cpualloc(cnt) ((cpu_set_t *)malloc(__CPU_ALLOC_SIZE(cnt)))
+# define __sched_cpufree(__set) free(__set)
+#endif
+__END_DECLS
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/select.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/select.h
new file mode 100644
index 0000000..47e7ded
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/select.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1997, 1998, 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_SELECT_H
+# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
+#endif
+
+
+/* We don't use `memset' because this would require a prototype and
+   the array isn't too big.  */
+#define __FD_ZERO(s) \
+  do {									      \
+    unsigned int __i;							      \
+    fd_set *__arr = (s);						      \
+    for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i)	      \
+      __FDS_BITS (__arr)[__i] = 0;					      \
+  } while (0)
+#define __FD_SET(d, s)     (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
+#define __FD_CLR(d, s)     (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
+#define __FD_ISSET(d, s)   ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sem.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sem.h
new file mode 100644
index 0000000..6193501
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sem.h
@@ -0,0 +1,87 @@
+/* Copyright (C) 1995, 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 _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'.  */
+#define SEM_UNDO	0x1000		/* undo the operation on exit */
+
+/* Commands for `semctl'.  */
+#define GETPID		11		/* get sempid */
+#define GETVAL		12		/* get semval */
+#define GETALL		13		/* get all semval's */
+#define GETNCNT		14		/* get semncnt */
+#define GETZCNT		15		/* get semzcnt */
+#define SETVAL		16		/* set semval */
+#define SETALL		17		/* set all semval's */
+
+
+/* Data structure describing a set of semaphores.  */
+struct semid_ds
+{
+  struct ipc_perm sem_perm;		/* operation permission struct */
+  __time_t sem_otime;			/* last semop() time */
+  unsigned long int __unused1;
+  __time_t sem_ctime;			/* last time changed by semctl() */
+  unsigned long int __unused2;
+  unsigned long int sem_nsems;		/* number of semaphores in set */
+  unsigned long int __unused3;
+  unsigned long int __unused4;
+};
+
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;				<= value for SETVAL
+     struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;		<= array for GETALL & SETALL
+     struct seminfo *__buf;		<= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED	1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct  seminfo
+{
+  int semmap;
+  int semmni;
+  int semmns;
+  int semmnu;
+  int semmsl;
+  int semopm;
+  int semume;
+  int semusz;
+  int semvmx;
+  int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/setjmp.h
new file mode 100644
index 0000000..ad9f04d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/setjmp.h
@@ -0,0 +1,2 @@
+/* bits/setjmp.h is architecture specific.  */
+#error "This file must be supplied by every Linux architecture."
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/shm.h
new file mode 100644
index 0000000..87ccd0f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/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 ())
+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/common/bits/sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigaction.h
new file mode 100644
index 0000000..7489aa8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigaction.h
@@ -0,0 +1,69 @@
+/* The proper definitions for Linux's sigaction.
+   Copyright (C) 1993-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.  */
+
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives.
+ * In uclibc, it is identical to "new" struct kernel_sigaction
+ * (one from the Linux 2.1.68 kernel).
+ * This minimizes amount of translation in sigaction().
+ */
+struct sigaction {
+#ifdef __USE_POSIX199309
+	union {
+		__sighandler_t sa_handler;
+		void (*sa_sigaction)(int, siginfo_t *, void *);
+	} __sigaction_handler;
+# define sa_handler     __sigaction_handler.sa_handler
+# define sa_sigaction   __sigaction_handler.sa_sigaction
+#else
+	__sighandler_t  sa_handler;
+#endif
+	unsigned long   sa_flags;
+	void            (*sa_restorer)(void);
+	sigset_t        sa_mask;
+};
+
+/* Bits in `sa_flags'.  */
+#define	SA_NOCLDSTOP  1		 /* Don't send SIGCHLD when children stop.  */
+#define SA_NOCLDWAIT  2		 /* Don't create zombie on child death.  */
+#define SA_SIGINFO    4		 /* Invoke signal-catching function with
+				    three arguments instead of one.  */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK   0x08000000 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
+# define SA_NODEFER   0x40000000 /* Don't automatically block the signal when
+				    its handler is being executed.  */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler.  */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historical no-op.  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
+# define SA_STACK     SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'.  */
+#define	SIG_BLOCK     0		 /* Block signals.  */
+#define	SIG_UNBLOCK   1		 /* Unblock signals.  */
+#define	SIG_SETMASK   2		 /* Set the set of blocked signals.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontext.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontext.h
new file mode 100644
index 0000000..35bf5bc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontext.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996, 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.  */
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#ifndef sigcontext_struct
+/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
+   we need sigcontext.  */
+# define sigcontext_struct sigcontext
+
+# ifndef __user
+# define __user
+# endif
+# include <asm/sigcontext.h>
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontextinfo.h
new file mode 100644
index 0000000..40305b4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontextinfo.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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.  */
+
+/* In general we cannot provide any information.  */
+#define SIGCONTEXT struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS
+#define GET_PC(ctx)	((void *) 0)
+#define GET_FRAME(ctx)	((void *) 0)
+#define GET_STACK(ctx)	((void *) 0)
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/siginfo.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/siginfo.h
new file mode 100644
index 0000000..4ce319d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/siginfo.h
@@ -0,0 +1,313 @@
+/* siginfo_t, sigevent and constants.  Linux version.
+   Copyright (C) 1997-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.  */
+
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+    && !defined __need_sigevent_t
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+#if (!defined __have_sigval_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t \
+	 || defined __need_sigevent_t))
+# define __have_sigval_t	1
+
+/* Type for data associated with a signal.  */
+typedef union sigval
+  {
+    int sival_int;
+    void *sival_ptr;
+  } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t	1
+
+# define __SI_MAX_SIZE     128
+# if __WORDSIZE == 64
+#  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+typedef struct siginfo
+  {
+    int si_signo;		/* Signal number.  */
+    int si_errno;		/* If non-zero, an errno value associated with
+				   this signal, as defined in <errno.h>.  */
+    int si_code;		/* Signal code.  */
+
+    union
+      {
+	int _pad[__SI_PAD_SIZE];
+
+	 /* kill().  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	  } _kill;
+
+	/* POSIX.1b timers.  */
+	struct
+	  {
+	    int si_tid;		/* Timer ID.  */
+	    int si_overrun;	/* Overrun count.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _timer;
+
+	/* POSIX.1b signals.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _rt;
+
+	/* SIGCHLD.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Which child.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    int si_status;	/* Exit value or signal.  */
+	    __clock_t si_utime;
+	    __clock_t si_stime;
+	  } _sigchld;
+
+	/* SIGILL, SIGFPE, SIGSEGV, SIGBUS.  */
+	struct
+	  {
+	    void *si_addr;	/* Faulting insn/memory ref.  */
+	  } _sigfault;
+
+	/* SIGPOLL.  */
+	struct
+	  {
+	    long int si_band;	/* Band event for SIGPOLL.  */
+	    int si_fd;
+	  } _sigpoll;
+      } _sifields;
+  } siginfo_t;
+
+
+/* X/Open requires some more fields with fixed names.  */
+# define si_pid		_sifields._kill.si_pid
+# define si_uid		_sifields._kill.si_uid
+# define si_timerid	_sifields._timer.si_tid
+# define si_overrun	_sifields._timer.si_overrun
+# define si_status	_sifields._sigchld.si_status
+# define si_utime	_sifields._sigchld.si_utime
+# define si_stime	_sifields._sigchld.si_stime
+# define si_value	_sifields._rt.si_sigval
+# define si_int		_sifields._rt.si_sigval.sival_int
+# define si_ptr		_sifields._rt.si_sigval.sival_ptr
+# define si_addr	_sifields._sigfault.si_addr
+# define si_band	_sifields._sigpoll.si_band
+# define si_fd		_sifields._sigpoll.si_fd
+
+
+/* Values for `si_code'.  Positive values are reserved for kernel-generated
+   signals.  */
+enum
+{
+  SI_ASYNCNL = -60,		/* Sent by asynch name lookup completion.  */
+# define SI_ASYNCNL	SI_ASYNCNL
+  SI_TKILL = -6,		/* Sent by tkill.  */
+# define SI_TKILL	SI_TKILL
+  SI_SIGIO,			/* Sent by queued SIGIO. */
+# define SI_SIGIO	SI_SIGIO
+  SI_ASYNCIO,			/* Sent by AIO completion.  */
+# define SI_ASYNCIO	SI_ASYNCIO
+  SI_MESGQ,			/* Sent by real time mesq state change.  */
+# define SI_MESGQ	SI_MESGQ
+  SI_TIMER,			/* Sent by timer expiration.  */
+# define SI_TIMER	SI_TIMER
+  SI_QUEUE,			/* Sent by sigqueue.  */
+# define SI_QUEUE	SI_QUEUE
+  SI_USER,			/* Sent by kill, sigsend, raise.  */
+# define SI_USER	SI_USER
+  SI_KERNEL = 0x80		/* Send by kernel.  */
+#define SI_KERNEL	SI_KERNEL
+};
+
+
+/* `si_code' values for SIGILL signal.  */
+enum
+{
+  ILL_ILLOPC = 1,		/* Illegal opcode.  */
+# define ILL_ILLOPC	ILL_ILLOPC
+  ILL_ILLOPN,			/* Illegal operand.  */
+# define ILL_ILLOPN	ILL_ILLOPN
+  ILL_ILLADR,			/* Illegal addressing mode.  */
+# define ILL_ILLADR	ILL_ILLADR
+  ILL_ILLTRP,			/* Illegal trap. */
+# define ILL_ILLTRP	ILL_ILLTRP
+  ILL_PRVOPC,			/* Privileged opcode.  */
+# define ILL_PRVOPC	ILL_PRVOPC
+  ILL_PRVREG,			/* Privileged register.  */
+# define ILL_PRVREG	ILL_PRVREG
+  ILL_COPROC,			/* Coprocessor error.  */
+# define ILL_COPROC	ILL_COPROC
+  ILL_BADSTK			/* Internal stack error.  */
+# define ILL_BADSTK	ILL_BADSTK
+};
+
+/* `si_code' values for SIGFPE signal.  */
+enum
+{
+  FPE_INTDIV = 1,		/* Integer divide by zero.  */
+# define FPE_INTDIV	FPE_INTDIV
+  FPE_INTOVF,			/* Integer overflow.  */
+# define FPE_INTOVF	FPE_INTOVF
+  FPE_FLTDIV,			/* Floating point divide by zero.  */
+# define FPE_FLTDIV	FPE_FLTDIV
+  FPE_FLTOVF,			/* Floating point overflow.  */
+# define FPE_FLTOVF	FPE_FLTOVF
+  FPE_FLTUND,			/* Floating point underflow.  */
+# define FPE_FLTUND	FPE_FLTUND
+  FPE_FLTRES,			/* Floating point inexact result.  */
+# define FPE_FLTRES	FPE_FLTRES
+  FPE_FLTINV,			/* Floating point invalid operation.  */
+# define FPE_FLTINV	FPE_FLTINV
+  FPE_FLTSUB			/* Subscript out of range.  */
+# define FPE_FLTSUB	FPE_FLTSUB
+};
+
+/* `si_code' values for SIGSEGV signal.  */
+enum
+{
+  SEGV_MAPERR = 1,		/* Address not mapped to object.  */
+# define SEGV_MAPERR	SEGV_MAPERR
+  SEGV_ACCERR			/* Invalid permissions for mapped object.  */
+# define SEGV_ACCERR	SEGV_ACCERR
+};
+
+/* `si_code' values for SIGBUS signal.  */
+enum
+{
+  BUS_ADRALN = 1,		/* Invalid address alignment.  */
+# define BUS_ADRALN	BUS_ADRALN
+  BUS_ADRERR,			/* Non-existant physical address.  */
+# define BUS_ADRERR	BUS_ADRERR
+  BUS_OBJERR			/* Object specific hardware error.  */
+# define BUS_OBJERR	BUS_OBJERR
+};
+
+/* `si_code' values for SIGTRAP signal.  */
+enum
+{
+  TRAP_BRKPT = 1,		/* Process breakpoint.  */
+# define TRAP_BRKPT	TRAP_BRKPT
+  TRAP_TRACE			/* Process trace trap.  */
+# define TRAP_TRACE	TRAP_TRACE
+};
+
+/* `si_code' values for SIGCHLD signal.  */
+enum
+{
+  CLD_EXITED = 1,		/* Child has exited.  */
+# define CLD_EXITED	CLD_EXITED
+  CLD_KILLED,			/* Child was killed.  */
+# define CLD_KILLED	CLD_KILLED
+  CLD_DUMPED,			/* Child terminated abnormally.  */
+# define CLD_DUMPED	CLD_DUMPED
+  CLD_TRAPPED,			/* Traced child has trapped.  */
+# define CLD_TRAPPED	CLD_TRAPPED
+  CLD_STOPPED,			/* Child has stopped.  */
+# define CLD_STOPPED	CLD_STOPPED
+  CLD_CONTINUED			/* Stopped child has continued.  */
+# define CLD_CONTINUED	CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal.  */
+enum
+{
+  POLL_IN = 1,			/* Data input available.  */
+# define POLL_IN	POLL_IN
+  POLL_OUT,			/* Output buffers available.  */
+# define POLL_OUT	POLL_OUT
+  POLL_MSG,			/* Input message available.   */
+# define POLL_MSG	POLL_MSG
+  POLL_ERR,			/* I/O error.  */
+# define POLL_ERR	POLL_ERR
+  POLL_PRI,			/* High priority input available.  */
+# define POLL_PRI	POLL_PRI
+  POLL_HUP			/* Device disconnected.  */
+# define POLL_HUP	POLL_HUP
+};
+
+# undef __need_siginfo_t
+#endif	/* !have siginfo_t && (have _SIGNAL_H || need siginfo_t).  */
+
+
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+    && !defined __have_sigevent_t
+# define __have_sigevent_t	1
+
+/* Structure to transport application-defined values with signals.  */
+# define __SIGEV_MAX_SIZE	64
+# if __WORDSIZE == 64
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+typedef struct sigevent
+  {
+    sigval_t sigev_value;
+    int sigev_signo;
+    int sigev_notify;
+
+    union
+      {
+	int _pad[__SIGEV_PAD_SIZE];
+
+	/* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+	   thread to receive the signal.  */
+	__pid_t _tid;
+
+	struct
+	  {
+	    void (*_function) (sigval_t);	/* Function to start.  */
+	    void *_attribute;			/* Really pthread_attr_t.  */
+	  } _sigev_thread;
+      } _sigev_un;
+  } sigevent_t;
+
+/* POSIX names to access some of the members.  */
+# define sigev_notify_function   _sigev_un._sigev_thread._function
+# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+/* `sigev_notify' values.  */
+enum
+{
+  SIGEV_SIGNAL = 0,		/* Notify via signal.  */
+# define SIGEV_SIGNAL	SIGEV_SIGNAL
+  SIGEV_NONE,			/* Other notification: meaningless.  */
+# define SIGEV_NONE	SIGEV_NONE
+  SIGEV_THREAD,			/* Deliver via thread creation.  */
+# define SIGEV_THREAD	SIGEV_THREAD
+
+  SIGEV_THREAD_ID = 4		/* Send signal to specific thread.  */
+#define SIGEV_THREAD_ID	SIGEV_THREAD_ID
+};
+
+#endif	/* have _SIGNAL_H.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/signalfd.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/signalfd.h
new file mode 100644
index 0000000..f2c0dde
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/signalfd.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2007-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_SIGNALFD_H
+# error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead."
+#endif
+
+/* Flags for signalfd.  */
+enum
+  {
+    SFD_CLOEXEC = 02000000,
+#define SFD_CLOEXEC SFD_CLOEXEC
+    SFD_NONBLOCK = 00004000
+#define SFD_NONBLOCK SFD_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/signum.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/signum.h
new file mode 100644
index 0000000..81d38f5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/signum.h
@@ -0,0 +1,58 @@
+/* Signal number definitions.  Linux version.
+   Copyright (C) 1995,1996,1997,1998,1999,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.  */
+
+#ifdef	_SIGNAL_H
+
+#define	SIGHUP		1	/* Hangup (POSIX).  */
+#define	SIGINT		2	/* Interrupt (ANSI).  */
+#define	SIGQUIT		3	/* Quit (POSIX).  */
+#define	SIGILL		4	/* Illegal instruction (ANSI).  */
+#define	SIGTRAP		5	/* Trace trap (POSIX).  */
+#define	SIGABRT		6	/* Abort (ANSI).  */
+#define	SIGIOT		6	/* IOT trap (4.2 BSD).  */
+#define	SIGBUS		7	/* BUS error (4.2 BSD).  */
+#define	SIGFPE		8	/* Floating-point exception (ANSI).  */
+#define	SIGKILL		9	/* Kill, unblockable (POSIX).  */
+#define	SIGUSR1		10	/* User-defined signal 1 (POSIX).  */
+#define	SIGSEGV		11	/* Segmentation violation (ANSI).  */
+#define	SIGUSR2		12	/* User-defined signal 2 (POSIX).  */
+#define	SIGPIPE		13	/* Broken pipe (POSIX).  */
+#define	SIGALRM		14	/* Alarm clock (POSIX).  */
+#define	SIGTERM		15	/* Termination (ANSI).  */
+#define	SIGSTKFLT	16	/* Stack fault.  */
+#define	SIGCLD		SIGCHLD	/* Same as SIGCHLD (System V).  */
+#define	SIGCHLD		17	/* Child status has changed (POSIX).  */
+#define	SIGCONT		18	/* Continue (POSIX).  */
+#define	SIGSTOP		19	/* Stop, unblockable (POSIX).  */
+#define	SIGTSTP		20	/* Keyboard stop (POSIX).  */
+#define	SIGTTIN		21	/* Background read from tty (POSIX).  */
+#define	SIGTTOU		22	/* Background write to tty (POSIX).  */
+#define	SIGURG		23	/* Urgent condition on socket (4.2 BSD).  */
+#define	SIGXCPU		24	/* CPU limit exceeded (4.2 BSD).  */
+#define	SIGXFSZ		25	/* File size limit exceeded (4.2 BSD).  */
+#define	SIGVTALRM	26	/* Virtual alarm clock (4.2 BSD).  */
+#define	SIGPROF		27	/* Profiling alarm clock (4.2 BSD).  */
+#define	SIGWINCH	28	/* Window size change (4.3 BSD, Sun).  */
+#define	SIGPOLL		SIGIO	/* Pollable event occurred (System V).  */
+#define	SIGIO		29	/* I/O now possible (4.2 BSD).  */
+#define	SIGPWR		30	/* Power failure restart (System V).  */
+#define SIGSYS		31	/* Bad system call.  */
+#define SIGUNUSED	31
+
+#endif	/* <signal.h> included.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigset.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigset.h
new file mode 100644
index 0000000..4ef2231
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigset.h
@@ -0,0 +1,223 @@
+/* __sig_atomic_t, __sigset_t, and related definitions.  Linux version.
+   Copyright (C) 1991, 1992, 1994, 1996, 1997 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	_SIGSET_H_types
+# define _SIGSET_H_types	1
+
+typedef int __sig_atomic_t;
+
+/* A 'sigset_t' has a bit for each signal.
+ * glibc has space for 1024 signals (!), but most arches supported
+ * by Linux have 64 signals, and only MIPS has 128.
+ * There seems to be some historical baggage in sparc[64]
+ * where they might have (or had in the past) 32 signals only,
+ * I hope it's irrelevant now.
+ * Signal 0 does not exist, so we have signals 1..64, not 0..63.
+ * In uclibc, kernel and userspace sigset_t is always the same.
+ * BTW, struct sigaction is also the same on kernel and userspace side.
+ */
+#if defined(__mips__)
+# define _SIGSET_NWORDS	(128 / (8 * sizeof (unsigned long)))
+#else
+# define _SIGSET_NWORDS	(64 / (8 * sizeof (unsigned long)))
+#endif
+typedef struct {
+	unsigned long __val[_SIGSET_NWORDS];
+} __sigset_t;
+
+#endif
+
+
+/* We only want to define these functions if <signal.h> was actually
+   included; otherwise we were included just to define the types.  Since we
+   are namespace-clean, it wouldn't hurt to define extra macros.  But
+   trouble can be caused by functions being defined (e.g., any global
+   register vars declared later will cause compilation errors).  */
+
+#if !defined _SIGSET_H_fns && defined _SIGNAL_H
+# define _SIGSET_H_fns 1
+
+/* Return a mask that includes the bit for SIG only.  */
+/* Unsigned cast ensures shift/mask insns are used.  */
+# define __sigmask(sig) \
+  (((unsigned long) 1) << ((unsigned)((sig) - 1) % (8 * sizeof (unsigned long))))
+
+/* Return the word index for SIG.  */
+# define __sigword(sig)	((unsigned)((sig) - 1) / (8 * sizeof (unsigned long)))
+
+/* gcc 4.3.1 is not clever enough to optimize for _SIGSET_NWORDS == 1 and 2,
+ * which are about the only values which can be there */
+
+# if defined __GNUC__ && __GNUC__ >= 2
+#  define __sigemptyset(set) \
+(__extension__ ({ \
+	sigset_t *__set = (set);					\
+	if (_SIGSET_NWORDS <= 2) {					\
+		__set->__val[0] = 0;					\
+		if (_SIGSET_NWORDS == 2)				\
+			__set->__val[1] = 0;				\
+	} else {							\
+		int __cnt = _SIGSET_NWORDS;				\
+		while (--__cnt >= 0) __set->__val[__cnt] = 0;		\
+	}								\
+	0;								\
+}))
+#  define __sigfillset(set) \
+(__extension__ ({ \
+	sigset_t *__set = (set);					\
+	if (_SIGSET_NWORDS <= 2) {					\
+		__set->__val[0] = ~0UL;					\
+		if (_SIGSET_NWORDS == 2)				\
+			__set->__val[1] = ~0UL;				\
+	} else {							\
+		int __cnt = _SIGSET_NWORDS;				\
+		while (--__cnt >= 0) __set->__val[__cnt] = ~0UL;	\
+	}								\
+	0;								\
+}))
+
+#  ifdef __USE_GNU
+/* The POSIX does not specify for handling the whole signal set in one
+   command.  This is often wanted and so we define three more functions
+   here.  */
+#   define __sigisemptyset(set) \
+(__extension__ ({ \
+	long __ret;							\
+	const sigset_t *__set = (set);					\
+	if (_SIGSET_NWORDS == 1) {					\
+		__ret = __set->__val[0];				\
+	} else if (_SIGSET_NWORDS == 2) {				\
+		__ret = __set->__val[0] | __set->__val[1];		\
+	} else {							\
+		int __cnt = _SIGSET_NWORDS;				\
+		__ret = __set->__val[--__cnt];				\
+		while (!__ret && --__cnt >= 0)				\
+			__ret = __set->__val[__cnt];			\
+	}								\
+	__ret == 0;							\
+}))
+#   define __sigandset(dest, left, right) \
+(__extension__ ({ \
+	sigset_t *__dest = (dest);					\
+	const sigset_t *__left = (left);				\
+	const sigset_t *__right = (right);				\
+	if (_SIGSET_NWORDS <= 2) {					\
+		__dest->__val[0] = __left->__val[0] & __right->__val[0];\
+		if (_SIGSET_NWORDS == 2)				\
+			__dest->__val[1] = __left->__val[1] & __right->__val[1];\
+	} else {							\
+		int __cnt = _SIGSET_NWORDS;				\
+		while (--__cnt >= 0)					\
+			__dest->__val[__cnt] = (__left->__val[__cnt]	\
+					& __right->__val[__cnt]);	\
+	}								\
+	0;								\
+}))
+#   define __sigorset(dest, left, right) \
+(__extension__ ({ \
+	sigset_t *__dest = (dest);					\
+	const sigset_t *__left = (left);				\
+	const sigset_t *__right = (right);				\
+	if (_SIGSET_NWORDS <= 2) {					\
+		__dest->__val[0] = __left->__val[0] | __right->__val[0];\
+		if (_SIGSET_NWORDS == 2)				\
+			__dest->__val[1] = __left->__val[1] | __right->__val[1];\
+	} else {							\
+		int __cnt = _SIGSET_NWORDS;				\
+		while (--__cnt >= 0)					\
+			__dest->__val[__cnt] = (__left->__val[__cnt]	\
+					| __right->__val[__cnt]);	\
+	}								\
+	0;								\
+}))
+#  endif
+# endif
+
+/* These functions needn't check for a bogus signal number -- error
+   checking is done in the non __ versions.  */
+
+# if !defined __USE_EXTERN_INLINES || defined __PROVIDE_OUT_OF_LINE_SIGSETFN
+extern int __sigismember (__const __sigset_t *, int);
+libc_hidden_proto(__sigismember)
+extern int __sigaddset (__sigset_t *, int);
+libc_hidden_proto(__sigaddset)
+extern int __sigdelset (__sigset_t *, int);
+libc_hidden_proto(__sigdelset)
+# endif
+
+# ifdef __USE_EXTERN_INLINES
+#  undef _EXTERN_INLINE
+#  ifdef __PROVIDE_OUT_OF_LINE_SIGSETFN
+#   define _EXTERN_INLINE
+#  else /* normal case */
+    /* dropped extern below: otherwise every module with __USE_EXTERN_INLINES
+     * will have its own copy of out-of line function emitted. */
+#   define _EXTERN_INLINE /*extern*/ __always_inline
+#  endif
+#  define __SIGSETFN(NAME, BODY, CONST)					\
+_EXTERN_INLINE int							\
+NAME (CONST __sigset_t *__set, int __sig)				\
+{									\
+	unsigned long __mask = __sigmask (__sig);			\
+	unsigned __word = __sigword (__sig);				\
+	return BODY;							\
+}
+
+__SIGSETFN (__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, __const)
+__SIGSETFN (__sigaddset, ((__set->__val[__word] |= __mask), 0), )
+__SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), )
+
+#  undef __SIGSETFN
+# endif
+
+# ifdef _LIBC
+/* It's far too much PITA to __USE_EXTERN_INLINES from within libc.
+ * Especially since we want to inline only calls with const sig,
+ * but __USE_EXTERN_INLINES will inline all calls!
+ */
+static __always_inline unsigned long
+const_sigismember(const __sigset_t *set, int sig)
+{
+	unsigned long mask = __sigmask(sig);
+	unsigned word = __sigword(sig);
+	return (set->__val[word] & mask);
+}
+#  define __sigismember(set, sig) \
+	(__builtin_constant_p(sig) ? (const_sigismember(set, sig) != 0) : __sigismember(set, sig))
+static __always_inline void
+const_sigaddset(__sigset_t *set, int sig)
+{
+	unsigned long mask = __sigmask(sig);
+	unsigned word = __sigword(sig);
+	set->__val[word] |= mask;
+}
+#  define __sigaddset(set, sig) \
+	(__builtin_constant_p(sig) ? (const_sigaddset(set, sig), 0)  : __sigaddset(set, sig))
+static __always_inline void
+const_sigdelset(__sigset_t *set, int sig)
+{
+	unsigned long mask = __sigmask(sig);
+	unsigned word = __sigword(sig);
+	set->__val[word] &= ~mask;
+}
+#  define __sigdelset(set, sig) \
+	(__builtin_constant_p(sig) ? (const_sigdelset(set, sig), 0) : __sigdelset(set, sig))
+# endif
+
+#endif /* ! _SIGSET_H_fns.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigstack.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigstack.h
new file mode 100644
index 0000000..2b3b321
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigstack.h
@@ -0,0 +1,57 @@
+/* sigstack, sigaltstack definitions.
+   Copyright (C) 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 _SIGNAL_H
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+
+#if defined __UCLIBC_SUSV4_LEGACY__ || !defined __UCLIBC_STRICT_HEADERS__
+/* Structure describing a signal stack (obsolete).  */
+struct sigstack
+  {
+    void *ss_sp;		/* Signal stack pointer.  */
+    int ss_onstack;		/* Nonzero if executing on this stack.  */
+  };
+#endif
+
+
+/* Possible values for `ss_flags.'.  */
+enum
+{
+  SS_ONSTACK = 1,
+#define SS_ONSTACK	SS_ONSTACK
+  SS_DISABLE
+#define SS_DISABLE	SS_DISABLE
+};
+
+/* Minimum stack size for a signal handler.  */
+#define MINSIGSTKSZ	2048
+
+/* System default stack size.  */
+#define SIGSTKSZ	8192
+
+
+/* Alternate, preferred interface.  */
+typedef struct sigaltstack
+  {
+    void *ss_sp;
+    int ss_flags;
+    size_t ss_size;
+  } stack_t;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigthread.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigthread.h
new file mode 100644
index 0000000..4f14b9f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigthread.h
@@ -0,0 +1,44 @@
+/* Signal handling function for threaded programs.
+   Copyright (C) 1998, 1999, 2000, 2002, 2009 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; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _BITS_SIGTHREAD_H
+#define _BITS_SIGTHREAD_H	1
+
+#if !defined _SIGNAL_H && !defined _PTHREAD_H
+# error "Never include this file directly.  Use <pthread.h> instead"
+#endif
+
+/* Functions for handling signals. */
+
+/* Modify the signal mask for the calling thread.  The arguments have
+   the same meaning as for sigprocmask(2). */
+extern int pthread_sigmask (int __how,
+			    __const __sigset_t *__restrict __newmask,
+			    __sigset_t *__restrict __oldmask)__THROW;
+
+/* Send signal SIGNO to the given thread. */
+extern int pthread_kill (pthread_t __threadid, int __signo) __THROW;
+
+#if defined __USE_GNU && defined __UCLIBC_HAS_THREADS_NATIVE__
+/* Queue signal and data to a thread.  */
+extern int pthread_sigqueue (pthread_t __threadid, int __signo,
+			     const union sigval __value) __THROW;
+#endif
+
+#endif	/* bits/sigthread.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sockaddr.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sockaddr.h
new file mode 100644
index 0000000..3e1d131
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sockaddr.h
@@ -0,0 +1,40 @@
+/* Definition of `struct sockaddr_*' common members.  Generic/4.2 BSD version.
+   Copyright (C) 1995,1996,1997,1998,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.  */
+
+/*
+ * Never include this file directly; use <sys/socket.h> instead.
+ */
+
+#ifndef _BITS_SOCKADDR_H
+#define _BITS_SOCKADDR_H	1
+
+
+/* POSIX.1g specifies this type name for the `sa_family' member.  */
+typedef unsigned short int sa_family_t;
+
+/* This macro is used to declare the initial common members
+   of the data types used for socket addresses, `struct sockaddr',
+   `struct sockaddr_in', `struct sockaddr_un', etc.  */
+
+#define	__SOCKADDR_COMMON(sa_prefix) \
+  sa_family_t sa_prefix##family
+
+#define __SOCKADDR_COMMON_SIZE	(sizeof (unsigned short int))
+
+#endif	/* bits/sockaddr.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/socket.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/socket.h
new file mode 100644
index 0000000..7e12733
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/socket.h
@@ -0,0 +1,364 @@
+/* System-specific socket constants and types.  Linux version.
+   Copyright (C) 1991,1992,1994-2001,2004,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.  */
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H
+
+#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+#define	__need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#include <limits.h>
+#include <sys/types.h>
+
+/* Type for length arguments in socket calls.  */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+/* Types of sockets.  */
+enum __socket_type
+{
+  SOCK_STREAM = 1,		/* Sequenced, reliable, connection-based
+				   byte streams.  */
+#define SOCK_STREAM SOCK_STREAM
+  SOCK_DGRAM = 2,		/* Connectionless, unreliable datagrams
+				   of fixed maximum length.  */
+#define SOCK_DGRAM SOCK_DGRAM
+  SOCK_RAW = 3,			/* Raw protocol interface.  */
+#define SOCK_RAW SOCK_RAW
+  SOCK_RDM = 4,			/* Reliably-delivered messages.  */
+#define SOCK_RDM SOCK_RDM
+  SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based,
+				   datagrams of fixed maximum length.  */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+  SOCK_PACKET = 10,		/* Linux specific way of getting packets
+				   at the dev level.  For writing rarp and
+				   other similar things on the user level. */
+#define SOCK_PACKET SOCK_PACKET
+
+  /* Flags to be ORed into the type parameter of socket and socketpair and
+     used for the flags parameter of paccept.  */
+
+  SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the
+				   new descriptor(s).  */
+#define SOCK_CLOEXEC SOCK_CLOEXEC
+  SOCK_NONBLOCK = 04000		/* Atomically mark descriptor(s) as
+				   non-blocking.  */
+#define SOCK_NONBLOCK SOCK_NONBLOCK
+};
+
+/* Protocol families.  */
+#define	PF_UNSPEC	0	/* Unspecified.  */
+#define	PF_LOCAL	1	/* Local to host (pipes and file-domain).  */
+#define	PF_UNIX		PF_LOCAL /* Old BSD name for PF_LOCAL.  */
+#define	PF_FILE		PF_LOCAL /* Another non-standard name for PF_LOCAL.  */
+#define	PF_INET		2	/* IP protocol family.  */
+#define	PF_AX25		3	/* Amateur Radio AX.25.  */
+#define	PF_IPX		4	/* Novell Internet Protocol.  */
+#define	PF_APPLETALK	5	/* Appletalk DDP.  */
+#define	PF_NETROM	6	/* Amateur radio NetROM.  */
+#define	PF_BRIDGE	7	/* Multiprotocol bridge.  */
+#define	PF_ATMPVC	8	/* ATM PVCs.  */
+#define	PF_X25		9	/* Reserved for X.25 project.  */
+#define	PF_INET6	10	/* IP version 6.  */
+#define	PF_ROSE		11	/* Amateur Radio X.25 PLP.  */
+#define	PF_DECnet	12	/* Reserved for DECnet project.  */
+#define	PF_NETBEUI	13	/* Reserved for 802.2LLC project.  */
+#define	PF_SECURITY	14	/* Security callback pseudo AF.  */
+#define	PF_KEY		15	/* PF_KEY key management API.  */
+#define	PF_NETLINK	16
+#define	PF_ROUTE	PF_NETLINK /* Alias to emulate 4.4BSD.  */
+#define	PF_PACKET	17	/* Packet family.  */
+#define	PF_ASH		18	/* Ash.  */
+#define	PF_ECONET	19	/* Acorn Econet.  */
+#define	PF_ATMSVC	20	/* ATM SVCs.  */
+#define	PF_SNA		22	/* Linux SNA Project */
+#define	PF_IRDA		23	/* IRDA sockets.  */
+#define	PF_PPPOX	24	/* PPPoX sockets.  */
+#define	PF_WANPIPE	25	/* Wanpipe API sockets.  */
+#define	PF_LLC		26	/* Linux LLC.  */
+#define	PF_CAN		29	/* Controller Area Network.  */
+#define	PF_TIPC		30	/* TIPC sockets.  */
+#define	PF_BLUETOOTH	31	/* Bluetooth sockets.  */
+#define	PF_IUCV		32	/* IUCV sockets.  */
+#define	PF_RXRPC	33	/* RxRPC sockets.  */
+#define	PF_ISDN		34	/* mISDN sockets.  */
+#define	PF_PHONET	35	/* Phonet sockets.  */
+#define	PF_IEEE802154	36	/* IEEE 802.15.4 sockets.  */
+#define	PF_CAIF		37	/* CAIF sockets.  */
+#define	PF_ALG		38	/* Algorithm sockets.  */
+#define	PF_MAX		39	/* For now..  */
+
+/* Address families.  */
+#define	AF_UNSPEC	PF_UNSPEC
+#define	AF_LOCAL	PF_LOCAL
+#define	AF_UNIX		PF_UNIX
+#define	AF_FILE		PF_FILE
+#define	AF_INET		PF_INET
+#define	AF_AX25		PF_AX25
+#define	AF_IPX		PF_IPX
+#define	AF_APPLETALK	PF_APPLETALK
+#define	AF_NETROM	PF_NETROM
+#define	AF_BRIDGE	PF_BRIDGE
+#define	AF_ATMPVC	PF_ATMPVC
+#define	AF_X25		PF_X25
+#define	AF_INET6	PF_INET6
+#define	AF_ROSE		PF_ROSE
+#define	AF_DECnet	PF_DECnet
+#define	AF_NETBEUI	PF_NETBEUI
+#define	AF_SECURITY	PF_SECURITY
+#define	AF_KEY		PF_KEY
+#define	AF_NETLINK	PF_NETLINK
+#define	AF_ROUTE	PF_ROUTE
+#define	AF_PACKET	PF_PACKET
+#define	AF_ASH		PF_ASH
+#define	AF_ECONET	PF_ECONET
+#define	AF_ATMSVC	PF_ATMSVC
+#define	AF_SNA		PF_SNA
+#define	AF_IRDA		PF_IRDA
+#define	AF_PPPOX	PF_PPPOX
+#define	AF_WANPIPE	PF_WANPIPE
+#define	AF_LLC		PF_LLC
+#define	AF_CAN		PF_CAN
+#define	AF_TIPC		PF_TIPC
+#define	AF_BLUETOOTH	PF_BLUETOOTH
+#define	AF_IUCV		PF_IUCV
+#define	AF_RXRPC	PF_RXRPC
+#define	AF_ISDN		PF_ISDN
+#define	AF_PHONET	PF_PHONET
+#define	AF_IEEE802154	PF_IEEE802154
+#define	AF_CAIF		PF_CAIF
+#define	AF_ALG		PF_ALG
+#define	AF_MAX		PF_MAX
+
+/* Socket level values.  Others are defined in the appropriate headers.
+
+   XXX These definitions also should go into the appropriate headers as
+   far as they are available.  */
+#define SOL_RAW		255
+#define SOL_DECNET      261
+#define SOL_X25         262
+#define SOL_PACKET	263
+#define SOL_ATM		264	/* ATM layer (cell level).  */
+#define SOL_AAL		265	/* ATM Adaption Layer (packet level).  */
+#define SOL_IRDA	266
+
+/* Maximum queue length specifiable by listen.  */
+#define SOMAXCONN	128
+
+/* Get the definition of the macro to define the common sockaddr members.  */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address.  */
+struct sockaddr
+  {
+    __SOCKADDR_COMMON (sa_);	/* Common data: address family and length.  */
+    char sa_data[14];		/* Address data.  */
+  };
+
+
+/* Structure large enough to hold any socket address (with the historical
+   exception of AF_UNIX).  We reserve 128 bytes.  */
+#if ULONG_MAX > 0xffffffff
+# define __ss_aligntype	__uint64_t
+#else
+# define __ss_aligntype	__uint32_t
+#endif
+#define _SS_SIZE	128
+#define _SS_PADSIZE	(_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (ss_);	/* Address family, etc.  */
+    __ss_aligntype __ss_align;	/* Force desired alignment.  */
+    char __ss_padding[_SS_PADSIZE];
+  };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al.  */
+enum
+  {
+    MSG_OOB		= 0x01,	/* Process out-of-band data.  */
+#define MSG_OOB		MSG_OOB
+    MSG_PEEK		= 0x02,	/* Peek at incoming messages.  */
+#define MSG_PEEK	MSG_PEEK
+    MSG_DONTROUTE	= 0x04,	/* Don't use local routing.  */
+#define MSG_DONTROUTE	MSG_DONTROUTE
+#ifdef __USE_GNU
+    /* DECnet uses a different name.  */
+    MSG_TRYHARD		= MSG_DONTROUTE,
+# define MSG_TRYHARD	MSG_DONTROUTE
+#endif
+    MSG_CTRUNC		= 0x08,	/* Control data lost before delivery.  */
+#define MSG_CTRUNC	MSG_CTRUNC
+    MSG_PROXY		= 0x10,	/* Supply or ask second address.  */
+#define MSG_PROXY	MSG_PROXY
+    MSG_TRUNC		= 0x20,
+#define	MSG_TRUNC	MSG_TRUNC
+    MSG_DONTWAIT	= 0x40, /* Nonblocking IO.  */
+#define	MSG_DONTWAIT	MSG_DONTWAIT
+    MSG_EOR		= 0x80, /* End of record.  */
+#define	MSG_EOR		MSG_EOR
+    MSG_WAITALL		= 0x100, /* Wait for a full request.  */
+#define	MSG_WAITALL	MSG_WAITALL
+    MSG_FIN		= 0x200,
+#define	MSG_FIN		MSG_FIN
+    MSG_SYN		= 0x400,
+#define	MSG_SYN		MSG_SYN
+    MSG_CONFIRM		= 0x800, /* Confirm path validity.  */
+#define	MSG_CONFIRM	MSG_CONFIRM
+    MSG_RST		= 0x1000,
+#define	MSG_RST		MSG_RST
+    MSG_ERRQUEUE	= 0x2000, /* Fetch message from error queue.  */
+#define	MSG_ERRQUEUE	MSG_ERRQUEUE
+    MSG_NOSIGNAL	= 0x4000, /* Do not generate SIGPIPE.  */
+#define	MSG_NOSIGNAL	MSG_NOSIGNAL
+    MSG_MORE		= 0x8000  /* Sender will send more.  */
+#define	MSG_MORE	MSG_MORE
+  };
+
+
+/* Structure describing messages sent by
+   `sendmsg' and received by `recvmsg'.  */
+/* Note: do not change these members to match glibc; these match the
+   SuSv3 spec already (e.g. msg_iovlen/msg_controllen).
+   http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html */
+/* Note: linux kernel uses __kernel_size_t (which is 8bytes on 64bit
+   platforms, and 4bytes on 32bit platforms) for msg_iovlen/msg_controllen */
+struct msghdr
+  {
+    void *msg_name;		/* Address to send to/receive from.  */
+    socklen_t msg_namelen;	/* Length of address data.  */
+
+    struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
+#if __WORDSIZE == 32
+    int msg_iovlen;		/* Number of elements in the vector.  */
+#else
+    size_t msg_iovlen;		/* Number of elements in the vector.  */
+#endif
+
+    void *msg_control;		/* Ancillary data (eg BSD filedesc passing). */
+#if __WORDSIZE == 32
+    socklen_t msg_controllen;	/* Ancillary data buffer length.  */
+#else
+    size_t msg_controllen;	/* Ancillary data buffer length.  */
+#endif
+
+    int msg_flags;		/* Flags on received message.  */
+  };
+
+/* Structure used for storage of ancillary data object information.  */
+struct cmsghdr
+  {
+    size_t cmsg_len;		/* Length of data in cmsg_data plus length
+				   of cmsghdr structure.  */
+    int cmsg_level;		/* Originating protocol.  */
+    int cmsg_type;		/* Protocol specific type.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+    __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data.  */
+#endif
+  };
+
+/* Ancillary data object manipulation macros.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
+#endif
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+#define CMSG_FIRSTHDR(mhdr) \
+  ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)		      \
+   ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
+			 & (size_t) ~(sizeof (size_t) - 1))
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+				      struct cmsghdr *__cmsg) __THROW;
+libc_hidden_proto(__cmsg_nxthdr)
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+#  define _EXTERN_INLINE extern __inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+{
+  if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+    /* The kernel header does this so there may be a reason.  */
+    return 0;
+
+  __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+			       + CMSG_ALIGN (__cmsg->cmsg_len));
+  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+					+ __mhdr->msg_controllen)
+      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+    /* No more entries.  */
+    return 0;
+  return __cmsg;
+}
+#endif	/* Use `extern inline'.  */
+
+/* Socket level message types.  This must match the definitions in
+   <linux/socket.h>.  */
+enum
+  {
+    SCM_RIGHTS = 0x01		/* Transfer file descriptors.  */
+#define SCM_RIGHTS SCM_RIGHTS
+#ifdef __USE_BSD
+    , SCM_CREDENTIALS = 0x02	/* Credentials passing.  */
+# define SCM_CREDENTIALS SCM_CREDENTIALS
+#endif
+  };
+
+/* User visible structure for SCM_CREDENTIALS message */
+
+struct ucred
+{
+  pid_t pid;			/* PID of sending process.  */
+  uid_t uid;			/* UID of sending process.  */
+  gid_t gid;			/* GID of sending process.  */
+};
+
+/* Get socket manipulation related informations from kernel headers.  */
+#ifndef __GLIBC__
+#define __GLIBC__ 2
+#include <asm/socket.h>
+#undef __GLIBC__
+#else
+#include <asm/socket.h>
+#endif
+
+
+/* Structure used to manipulate the SO_LINGER option.  */
+struct linger
+  {
+    int l_onoff;		/* Nonzero to linger on close.  */
+    int l_linger;		/* Time to linger.  */
+  };
+
+#endif	/* bits/socket.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/stab.def b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stab.def
new file mode 100644
index 0000000..3d54774
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stab.def
@@ -0,0 +1,234 @@
+/* Table of DBX symbol codes for the GNU system.
+   Copyright (C) 1988, 1997 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 contains contribution from Cygnus Support.  */
+
+/* Global variable.  Only the name is significant.
+   To find the address, look in the corresponding external symbol.  */
+__define_stab (N_GSYM, 0x20, "GSYM")
+
+/* Function name for BSD Fortran.  Only the name is significant.
+   To find the address, look in the corresponding external symbol.  */
+__define_stab (N_FNAME, 0x22, "FNAME")
+
+/* Function name or text-segment variable for C.  Value is its address.
+   Desc is supposedly starting line number, but GCC doesn't set it
+   and DBX seems not to miss it.  */
+__define_stab (N_FUN, 0x24, "FUN")
+
+/* Data-segment variable with internal linkage.  Value is its address.
+   "Static Sym".  */
+__define_stab (N_STSYM, 0x26, "STSYM")
+
+/* BSS-segment variable with internal linkage.  Value is its address.  */
+__define_stab (N_LCSYM, 0x28, "LCSYM")
+
+/* Name of main routine.  Only the name is significant.
+   This is not used in C.  */
+__define_stab (N_MAIN, 0x2a, "MAIN")
+
+/* Global symbol in Pascal.
+   Supposedly the value is its line number; I'm skeptical.  */
+__define_stab (N_PC, 0x30, "PC")
+
+/* Number of symbols:  0, files,,funcs,lines according to Ultrix V4.0. */
+__define_stab (N_NSYMS, 0x32, "NSYMS")
+
+/* "No DST map for sym: name, ,0,type,ignored"  according to Ultrix V4.0. */
+__define_stab (N_NOMAP, 0x34, "NOMAP")
+
+/* New stab from Solaris.  I don't know what it means, but it
+   don't seem to contain useful information.  */
+__define_stab (N_OBJ, 0x38, "OBJ")
+
+/* New stab from Solaris.  I don't know what it means, but it
+   don't seem to contain useful information.  Possibly related to the
+   optimization flags used in this module.  */
+__define_stab (N_OPT, 0x3c, "OPT")
+
+/* Register variable.  Value is number of register.  */
+__define_stab (N_RSYM, 0x40, "RSYM")
+
+/* Modula-2 compilation unit.  Can someone say what info it contains?  */
+__define_stab (N_M2C, 0x42, "M2C")
+
+/* Line number in text segment.  Desc is the line number;
+   value is corresponding address.  */
+__define_stab (N_SLINE, 0x44, "SLINE")
+
+/* Similar, for data segment.  */
+__define_stab (N_DSLINE, 0x46, "DSLINE")
+
+/* Similar, for bss segment.  */
+__define_stab (N_BSLINE, 0x48, "BSLINE")
+
+/* Sun's source-code browser stabs.  ?? Don't know what the fields are.
+   Supposedly the field is "path to associated .cb file".  THIS VALUE
+   OVERLAPS WITH N_BSLINE!  */
+__define_stab (N_BROWS, 0x48, "BROWS")
+
+/* GNU Modula-2 definition module dependency.  Value is the modification time
+   of the definition file.  Other is non-zero if it is imported with the
+   GNU M2 keyword %INITIALIZE.  Perhaps N_M2C can be used if there
+   are enough empty fields? */
+__define_stab(N_DEFD, 0x4a, "DEFD")
+
+/* THE FOLLOWING TWO STAB VALUES CONFLICT.  Happily, one is for Modula-2
+   and one is for C++.   Still,... */
+/* GNU C++ exception variable.  Name is variable name.  */
+__define_stab (N_EHDECL, 0x50, "EHDECL")
+/* Modula2 info "for imc":  name,,0,0,0  according to Ultrix V4.0.  */
+__define_stab (N_MOD2, 0x50, "MOD2")
+
+/* GNU C++ `catch' clause.  Value is its address.  Desc is nonzero if
+   this entry is immediately followed by a CAUGHT stab saying what exception
+   was caught.  Multiple CAUGHT stabs means that multiple exceptions
+   can be caught here.  If Desc is 0, it means all exceptions are caught
+   here.  */
+__define_stab (N_CATCH, 0x54, "CATCH")
+
+/* Structure or union element.  Value is offset in the structure.  */
+__define_stab (N_SSYM, 0x60, "SSYM")
+
+/* Name of main source file.
+   Value is starting text address of the compilation.  */
+__define_stab (N_SO, 0x64, "SO")
+
+/* Automatic variable in the stack.  Value is offset from frame pointer.
+   Also used for type descriptions.  */
+__define_stab (N_LSYM, 0x80, "LSYM")
+
+/* Beginning of an include file.  Only Sun uses this.
+   In an object file, only the name is significant.
+   The Sun linker puts data into some of the other fields.  */
+__define_stab (N_BINCL, 0x82, "BINCL")
+
+/* Name of sub-source file (#include file).
+   Value is starting text address of the compilation.  */
+__define_stab (N_SOL, 0x84, "SOL")
+
+/* Parameter variable.  Value is offset from argument pointer.
+   (On most machines the argument pointer is the same as the frame pointer.  */
+__define_stab (N_PSYM, 0xa0, "PSYM")
+
+/* End of an include file.  No name.
+   This and N_BINCL act as brackets around the file's output.
+   In an object file, there is no significant data in this entry.
+   The Sun linker puts data into some of the fields.  */
+__define_stab (N_EINCL, 0xa2, "EINCL")
+
+/* Alternate entry point.  Value is its address.  */
+__define_stab (N_ENTRY, 0xa4, "ENTRY")
+
+/* Beginning of lexical block.
+   The desc is the nesting level in lexical blocks.
+   The value is the address of the start of the text for the block.
+   The variables declared inside the block *precede* the N_LBRAC symbol.  */
+__define_stab (N_LBRAC, 0xc0, "LBRAC")
+
+/* Place holder for deleted include file.  Replaces a N_BINCL and everything
+   up to the corresponding N_EINCL.  The Sun linker generates these when
+   it finds multiple identical copies of the symbols from an include file.
+   This appears only in output from the Sun linker.  */
+__define_stab (N_EXCL, 0xc2, "EXCL")
+
+/* Modula-2 scope information.  Can someone say what info it contains?  */
+__define_stab (N_SCOPE, 0xc4, "SCOPE")
+
+/* End of a lexical block.  Desc matches the N_LBRAC's desc.
+   The value is the address of the end of the text for the block.  */
+__define_stab (N_RBRAC, 0xe0, "RBRAC")
+
+/* Begin named common block.  Only the name is significant.  */
+__define_stab (N_BCOMM, 0xe2, "BCOMM")
+
+/* End named common block.  Only the name is significant
+   (and it should match the N_BCOMM).  */
+__define_stab (N_ECOMM, 0xe4, "ECOMM")
+
+/* End common (local name): value is address.
+   I'm not sure how this is used.  */
+__define_stab (N_ECOML, 0xe8, "ECOML")
+
+/* These STAB's are used on Gould systems for Non-Base register symbols
+   or something like that.  FIXME.  I have assigned the values at random
+   since I don't have a Gould here.  Fixups from Gould folk welcome... */
+__define_stab (N_NBTEXT, 0xF0, "NBTEXT")
+__define_stab (N_NBDATA, 0xF2, "NBDATA")
+__define_stab (N_NBBSS,  0xF4, "NBBSS")
+__define_stab (N_NBSTS,  0xF6, "NBSTS")
+__define_stab (N_NBLCS,  0xF8, "NBLCS")
+
+/* Second symbol entry containing a length-value for the preceding entry.
+   The value is the length.  */
+__define_stab (N_LENG, 0xfe, "LENG")
+
+/* The above information, in matrix format.
+
+			STAB MATRIX
+	_________________________________________________
+	| 00 - 1F are not dbx stab symbols		|
+	| In most cases, the low bit is the EXTernal bit|
+
+	| 00 UNDEF  | 02 ABS	| 04 TEXT   | 06 DATA	|
+	| 01  |EXT  | 03  |EXT	| 05  |EXT  | 07  |EXT	|
+
+	| 08 BSS    | 0A INDR	| 0C FN_SEQ | 0E   	|
+	| 09  |EXT  | 0B 	| 0D	    | 0F	|
+
+	| 10 	    | 12 COMM	| 14 SETA   | 16 SETT	|
+	| 11	    | 13	| 15 	    | 17	|
+
+	| 18 SETD   | 1A SETB	| 1C SETV   | 1E WARNING|
+	| 19	    | 1B	| 1D 	    | 1F FN	|
+
+	|_______________________________________________|
+	| Debug entries with bit 01 set are unused.	|
+	| 20 GSYM   | 22 FNAME	| 24 FUN    | 26 STSYM	|
+	| 28 LCSYM  | 2A MAIN	| 2C	    | 2E	|
+	| 30 PC	    | 32 NSYMS	| 34 NOMAP  | 36	|
+	| 38 OBJ    | 3A	| 3C OPT    | 3E	|
+	| 40 RSYM   | 42 M2C	| 44 SLINE  | 46 DSLINE |
+	| 48 BSLINE*| 4A DEFD	| 4C        | 4E	|
+	| 50 EHDECL*| 52	| 54 CATCH  | 56        |
+	| 58        | 5A        | 5C        | 5E	|
+	| 60 SSYM   | 62	| 64 SO	    | 66 	|
+	| 68 	    | 6A	| 6C	    | 6E	|
+	| 70	    | 72	| 74	    | 76	|
+	| 78	    | 7A	| 7C	    | 7E	|
+	| 80 LSYM   | 82 BINCL	| 84 SOL    | 86	|
+	| 88	    | 8A	| 8C	    | 8E	|
+	| 90	    | 92	| 94	    | 96	|
+	| 98	    | 9A	| 9C	    | 9E	|
+	| A0 PSYM   | A2 EINCL	| A4 ENTRY  | A6	|
+	| A8	    | AA	| AC	    | AE	|
+	| B0	    | B2	| B4	    | B6	|
+	| B8	    | BA	| BC	    | BE	|
+	| C0 LBRAC  | C2 EXCL	| C4 SCOPE  | C6	|
+	| C8	    | CA	| CC	    | CE	|
+	| D0	    | D2	| D4	    | D6	|
+	| D8	    | DA	| DC	    | DE	|
+	| E0 RBRAC  | E2 BCOMM	| E4 ECOMM  | E6	|
+	| E8 ECOML  | EA	| EC	    | EE	|
+	| F0	    | F2	| F4	    | F6	|
+	| F8	    | FA	| FC	    | FE LENG	|
+	+-----------------------------------------------+
+ * 50 EHDECL is also MOD2.
+ * 48 BSLINE is also BROWS.
+ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stackinfo.h
new file mode 100644
index 0000000..1ed7b95
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stackinfo.h
@@ -0,0 +1,34 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  Since there is no general truth we can't say
+   anything here.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+#error Machine stack direction unknown.
+#if 0
+#define _STACK_GROWS_DOWN	1
+#define _STACK_GROWS_UP		1
+#endif
+
+#endif	/* stackinfo.h */
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stat.h
new file mode 100644
index 0000000..5fb868d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stat.h
@@ -0,0 +1,170 @@
+/* Copyright (C) 1992, 1995-2001, 2002, 2009 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_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_LINUX_OLD	1
+#define _STAT_VER_KERNEL	1
+#define _STAT_VER_SVR4		2
+#define _STAT_VER_LINUX		3
+#define _STAT_VER		_STAT_VER_LINUX	/* The one defined below.  */
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	1
+#define _MKNOD_VER_SVR4		2
+#define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below.  */
+
+
+struct stat
+  {
+    __dev_t st_dev;			/* Device.  */
+#ifndef __USE_FILE_OFFSET64
+    unsigned short int __pad1;
+    __ino_t st_ino;			/* File serial number.	*/
+#else
+    unsigned int __pad1;
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+#endif
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+#ifndef __USE_FILE_OFFSET64
+    unsigned short int __pad2;
+    __off_t st_size;			/* Size of file, in bytes.  */
+#else
+    unsigned int __pad2;
+    __off64_t st_size;			/* Size of file, in bytes.  */
+#endif
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+#ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+#else
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#endif
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+#ifndef __USE_FILE_OFFSET64
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+#else
+    __ino64_t st_ino;			/* File serial number.	*/
+#endif
+  };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;			/* Device.  */
+    unsigned int __pad1;
+
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned int __pad2;
+    __off64_t st_size;			/* Size of file, in bytes.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    __ino64_t st_ino;			/* File serial number.		*/
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/statfs.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/statfs.h
new file mode 100644
index 0000000..0e27865
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/statfs.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 1997, 1998, 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.  */
+
+#ifndef _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
+
+#include <bits/types.h>
+
+struct statfs
+  {
+    __SWORD_TYPE f_type;
+    __SWORD_TYPE f_bsize;
+#ifndef __USE_FILE_OFFSET64
+    __fsblkcnt_t f_blocks;
+    __fsblkcnt_t f_bfree;
+    __fsblkcnt_t f_bavail;
+    __fsfilcnt_t f_files;
+    __fsfilcnt_t f_ffree;
+#else
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+#endif
+    __fsid_t f_fsid;
+    __SWORD_TYPE f_namelen;
+    __SWORD_TYPE f_frsize;
+    __SWORD_TYPE f_spare[5];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+  {
+    __SWORD_TYPE f_type;
+    __SWORD_TYPE f_bsize;
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsid_t f_fsid;
+    __SWORD_TYPE f_namelen;
+    __SWORD_TYPE f_frsize;
+    __SWORD_TYPE f_spare[5];
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define _STATFS_F_NAMELEN
+#define _STATFS_F_FRSIZE
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/statvfs.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/statvfs.h
new file mode 100644
index 0000000..84717c3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/statvfs.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 1997,1998,2000,2001,2002,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.  */
+
+#ifndef _SYS_STATVFS_H
+# error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
+#endif
+
+#include <bits/types.h>  /* For __fsblkcnt_t and __fsfilcnt_t.  */
+
+#if __WORDSIZE == 32
+#define _STATVFSBUF_F_UNUSED
+#endif
+
+struct statvfs
+  {
+    unsigned long int f_bsize;
+    unsigned long int f_frsize;
+#ifndef __USE_FILE_OFFSET64
+    __fsblkcnt_t f_blocks;
+    __fsblkcnt_t f_bfree;
+    __fsblkcnt_t f_bavail;
+    __fsfilcnt_t f_files;
+    __fsfilcnt_t f_ffree;
+    __fsfilcnt_t f_favail;
+#else
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsfilcnt64_t f_favail;
+#endif
+    unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+    int __f_unused;
+#endif
+    unsigned long int f_flag;
+    unsigned long int f_namemax;
+    int __f_spare[6];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct statvfs64
+  {
+    unsigned long int f_bsize;
+    unsigned long int f_frsize;
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsfilcnt64_t f_favail;
+    unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+    int __f_unused;
+#endif
+    unsigned long int f_flag;
+    unsigned long int f_namemax;
+    int __f_spare[6];
+  };
+#endif
+
+/* Definitions for the flag in `f_flag'.  These definitions should be
+   kept in sync with the definitions in <sys/mount.h>.  */
+enum
+{
+  ST_RDONLY = 1,		/* Mount read-only.  */
+#define ST_RDONLY	ST_RDONLY
+  ST_NOSUID = 2			/* Ignore suid and sgid bits.  */
+#define ST_NOSUID	ST_NOSUID
+#ifdef __USE_GNU
+  ,
+  ST_NODEV = 4,			/* Disallow access to device special files.  */
+# define ST_NODEV	ST_NODEV
+  ST_NOEXEC = 8,		/* Disallow program execution.  */
+# define ST_NOEXEC	ST_NOEXEC
+  ST_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
+# define ST_SYNCHRONOUS	ST_SYNCHRONOUS
+  ST_MANDLOCK = 64,		/* Allow mandatory locks on an FS.  */
+# define ST_MANDLOCK	ST_MANDLOCK
+  ST_WRITE = 128,		/* Write on file/directory/symlink.  */
+# define ST_WRITE	ST_WRITE
+  ST_APPEND = 256,		/* Append-only file.  */
+# define ST_APPEND	ST_APPEND
+  ST_IMMUTABLE = 512,		/* Immutable file.  */
+# define ST_IMMUTABLE	ST_IMMUTABLE
+  ST_NOATIME = 1024,		/* Do not update access times.  */
+# define ST_NOATIME	ST_NOATIME
+  ST_NODIRATIME = 2048,		/* Do not update directory access times.  */
+# define ST_NODIRATIME	ST_NODIRATIME
+  ST_RELATIME = 4096		/* Update atime relative to mtime/ctime.  */
+# define ST_RELATIME	ST_RELATIME
+#endif	/* Use GNU.  */
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio.h
new file mode 100644
index 0000000..d0ba463
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio.h
@@ -0,0 +1,23 @@
+/* Optimizing macros and inline functions for stdio functions.
+   Copyright (C) 1998, 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 _STDIO_H
+# error "Never include <bits/stdio.h> directly; use <stdio.h> instead."
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio_lim.h
new file mode 100644
index 0000000..2c0b36f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio_lim.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1994, 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.  */
+
+#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX
+# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
+#endif
+
+#ifdef _STDIO_H
+# ifdef __UCLIBC_SUSV4_LEGACY__
+#  define L_tmpnam 20
+# endif
+# define TMP_MAX 238328
+# define FILENAME_MAX 4095
+
+# ifdef __USE_POSIX
+#  define L_ctermid 9
+#  define L_cuserid 9
+# endif
+#endif
+
+#if defined __need_FOPEN_MAX || defined _STDIO_H
+# undef  FOPEN_MAX
+# define FOPEN_MAX 16
+#endif
+
+#if defined __need_IOV_MAX && !defined IOV_MAX
+# define IOV_MAX 1024
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls-common.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls-common.h
new file mode 100644
index 0000000..0f5a9299
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls-common.h
@@ -0,0 +1,119 @@
+/*
+ * Common syscall type defines
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#ifndef _SYSCALLS_COMMON_H
+#define _SYSCALLS_COMMON_H	1
+
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls-common.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef SYS_ify
+# define SYS_ify(syscall_name) (__NR_##syscall_name)
+#endif
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+#ifndef INTERNAL_SYSCALL_DECL
+# define INTERNAL_SYSCALL_DECL(err)         do { } while (0)
+#endif
+#ifndef INTERNAL_SYSCALL_ERROR_P
+# define INTERNAL_SYSCALL_ERROR_P(val, err) ((unsigned long)val >= (unsigned long)(-4095))
+#endif
+#ifndef INTERNAL_SYSCALL_ERRNO
+# define INTERNAL_SYSCALL_ERRNO(val, err)   (-(val))
+#endif
+
+/* Define a macro which expands into the inline wrapper code for a system call */
+#ifndef INLINE_SYSCALL
+# define INLINE_SYSCALL(name, nr, args...) INLINE_SYSCALL_NCS(__NR_##name, nr, args)
+#endif
+#ifndef INLINE_SYSCALL_NOERR
+# define INLINE_SYSCALL_NOERR(name, nr, args...) INLINE_SYSCALL_NOERR_NCS(__NR_##name, nr, args)
+#endif
+
+/* Just like INLINE_SYSCALL(), but take a non-constant syscall (NCS) argument */
+#ifndef INLINE_SYSCALL_NCS
+# define INLINE_SYSCALL_NCS(name, nr, args...)				\
+(__extension__								\
+ ({									\
+	INTERNAL_SYSCALL_DECL(__err);					\
+	(__extension__							\
+	 ({								\
+	   long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args);	\
+	   if (unlikely(INTERNAL_SYSCALL_ERROR_P(__res, __err))) {	\
+		__set_errno(INTERNAL_SYSCALL_ERRNO(__res, __err));	\
+		__res = -1L;						\
+	   }								\
+	   __res;							\
+	  })								\
+	);								\
+  })									\
+)
+#endif
+#ifndef INLINE_SYSCALL_NOERR_NCS
+# define INLINE_SYSCALL_NOERR_NCS(name, nr, args...)			\
+({									\
+	INTERNAL_SYSCALL_DECL(__err);					\
+	long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args);	\
+	__res;								\
+})
+#endif
+
+/* No point in forcing people to implement both when they only need one */
+#ifndef INTERNAL_SYSCALL
+# define INTERNAL_SYSCALL(name, err, nr, args...) INTERNAL_SYSCALL_NCS(__NR_##name, err, nr, args)
+#endif
+
+#ifndef INTERNAL_SYSCALL_NCS
+# error your port needs to define INTERNAL_SYSCALL_NCS in bits/syscalls.h
+#endif
+
+#ifndef _syscall0
+
+#define C_DECL_ARGS_0()			void
+#define C_DECL_ARGS_1(t, v)		t v
+#define C_DECL_ARGS_2(t, v, args...)	t v, C_DECL_ARGS_1(args)
+#define C_DECL_ARGS_3(t, v, args...)	t v, C_DECL_ARGS_2(args)
+#define C_DECL_ARGS_4(t, v, args...)	t v, C_DECL_ARGS_3(args)
+#define C_DECL_ARGS_5(t, v, args...)	t v, C_DECL_ARGS_4(args)
+#define C_DECL_ARGS_6(t, v, args...)	t v, C_DECL_ARGS_5(args)
+
+#define C_ARGS_0()
+#define C_ARGS_1(t, v)			v
+#define C_ARGS_2(t, v, args...)		v, C_ARGS_1(args)
+#define C_ARGS_3(t, v, args...)		v, C_ARGS_2(args)
+#define C_ARGS_4(t, v, args...)		v, C_ARGS_3(args)
+#define C_ARGS_5(t, v, args...)		v, C_ARGS_4(args)
+#define C_ARGS_6(t, v, args...)		v, C_ARGS_5(args)
+
+#define SYSCALL_FUNC(nargs, type, name, args...)			\
+type name(C_DECL_ARGS_##nargs(args)) {					\
+	return (type)INLINE_SYSCALL(name, nargs, C_ARGS_##nargs(args));	\
+}
+
+#define SYSCALL_NOERR_FUNC(nargs, type, name, args...)			\
+type name(C_DECL_ARGS_##nargs(args)) {					\
+	return (type)INLINE_SYSCALL_NOERR(name, nargs, C_ARGS_##nargs(args));	\
+}
+
+#define _syscall0(args...)		SYSCALL_FUNC(0, args)
+#define _syscall_noerr0(args...)	SYSCALL_NOERR_FUNC(0, args)
+#define _syscall1(args...)		SYSCALL_FUNC(1, args)
+#define _syscall_noerr1(args...)	SYSCALL_NOERR_FUNC(1, args)
+#define _syscall2(args...)		SYSCALL_FUNC(2, args)
+#define _syscall3(args...)		SYSCALL_FUNC(3, args)
+#define _syscall4(args...)		SYSCALL_FUNC(4, args)
+#define _syscall5(args...)		SYSCALL_FUNC(5, args)
+#define _syscall6(args...)		SYSCALL_FUNC(6, args)
+
+#endif /* _syscall0 */
+
+#endif /* __ASSEMBLER__ */
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls.h
new file mode 100644
index 0000000..03d08d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls.h
@@ -0,0 +1,9 @@
+/* Unlike the asm/unistd.h kernel header file (which this is partly based on),
+ * this file must be able to cope with PIC and non-PIC code.  For some arches
+ * there is no difference.  For x86 (which has far too few registers) there is
+ * a difference.   Regardless, including asm/unistd.h is hereby officially
+ * forbidden.  Don't do it.  It is bad for you.
+ */
+
+#error You have not provided architecture specific bits/syscalls.h
+#error You should need to define only INTERNAL_SYSCALL_NCS
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/termios.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/termios.h
new file mode 100644
index 0000000..b648d80
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/termios.h
@@ -0,0 +1,219 @@
+/* termios type and macro definitions.  Linux version.
+   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 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.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char	cc_t;
+typedef unsigned int	speed_t;
+typedef unsigned int	tcflag_t;
+
+#define NCCS 32
+struct termios
+  {
+    tcflag_t c_iflag;		/* input mode flags */
+    tcflag_t c_oflag;		/* output mode flags */
+    tcflag_t c_cflag;		/* control mode flags */
+    tcflag_t c_lflag;		/* local mode flags */
+    cc_t c_line;			/* line discipline */
+    cc_t c_cc[NCCS];		/* control characters */
+    speed_t c_ispeed;		/* input speed */
+    speed_t c_ospeed;		/* output speed */
+#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
+#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
+  };
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* c_iflag bits */
+#define IGNBRK	0000001
+#define BRKINT	0000002
+#define IGNPAR	0000004
+#define PARMRK	0000010
+#define INPCK	0000020
+#define ISTRIP	0000040
+#define INLCR	0000100
+#define IGNCR	0000200
+#define ICRNL	0000400
+#define IUCLC	0001000
+#define IXON	0002000
+#define IXANY	0004000
+#define IXOFF	0010000
+#define IMAXBEL	0020000
+#define IUTF8	0040000
+
+/* c_oflag bits */
+#define OPOST	0000001
+#define OLCUC	0000002
+#define ONLCR	0000004
+#define OCRNL	0000010
+#define ONOCR	0000020
+#define ONLRET	0000040
+#define OFILL	0000100
+#define OFDEL	0000200
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY	0000400
+# define   NL0	0000000
+# define   NL1	0000400
+# define CRDLY	0003000
+# define   CR0	0000000
+# define   CR1	0001000
+# define   CR2	0002000
+# define   CR3	0003000
+# define TABDLY	0014000
+# define   TAB0	0000000
+# define   TAB1	0004000
+# define   TAB2	0010000
+# define   TAB3	0014000
+# define BSDLY	0020000
+# define   BS0	0000000
+# define   BS1	0020000
+# define FFDLY	0100000
+# define   FF0	0000000
+# define   FF1	0100000
+#endif
+
+#define VTDLY	0040000
+#define   VT0	0000000
+#define   VT1	0040000
+
+#ifdef __USE_MISC
+# define XTABS	0014000
+#endif
+
+/* c_cflag bit meaning */
+#ifdef __USE_MISC
+# define CBAUD	0010017
+#endif
+#define  B0	0000000		/* hang up */
+#define  B50	0000001
+#define  B75	0000002
+#define  B110	0000003
+#define  B134	0000004
+#define  B150	0000005
+#define  B200	0000006
+#define  B300	0000007
+#define  B600	0000010
+#define  B1200	0000011
+#define  B1800	0000012
+#define  B2400	0000013
+#define  B4800	0000014
+#define  B9600	0000015
+#define  B19200	0000016
+#define  B38400	0000017
+#ifdef __USE_MISC
+# define EXTA B19200
+# define EXTB B38400
+#endif
+#define CSIZE	0000060
+#define   CS5	0000000
+#define   CS6	0000020
+#define   CS7	0000040
+#define   CS8	0000060
+#define CSTOPB	0000100
+#define CREAD	0000200
+#define PARENB	0000400
+#define PARODD	0001000
+#define HUPCL	0002000
+#define CLOCAL	0004000
+#ifdef __USE_MISC
+# define CBAUDEX 0010000
+#endif
+#define  BOTHER   0010000
+#define  B57600   0010001
+#define  B115200  0010002
+#define  B230400  0010003
+#define  B460800  0010004
+#define  B500000  0010005
+#define  B576000  0010006
+#define  B921600  0010007
+#define  B1000000 0010010
+#define  B1152000 0010011
+#define  B1500000 0010012
+#define  B2000000 0010013
+#define  B2500000 0010014
+#define  B3000000 0010015
+#define  B3500000 0010016
+#define  B4000000 0010017
+#define __MAX_BAUD B4000000
+#ifdef __USE_MISC
+# define CIBAUD	  002003600000		/* input baud rate (not used) */
+# define CMSPAR   010000000000		/* mark or space (stick) parity */
+# define CRTSCTS  020000000000		/* flow control */
+#endif
+
+/* c_lflag bits */
+#define ISIG	0000001
+#define ICANON	0000002
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE	0000004
+#endif
+#define ECHO	0000010
+#define ECHOE	0000020
+#define ECHOK	0000040
+#define ECHONL	0000100
+#define NOFLSH	0000200
+#define TOSTOP	0000400
+#ifdef __USE_MISC
+# define ECHOCTL 0001000
+# define ECHOPRT 0002000
+# define ECHOKE	 0004000
+# define FLUSHO	 0010000
+# define PENDIN	 0040000
+#endif
+#define IEXTEN	0100000
+
+/* tcflow() and TCXONC use these */
+#define	TCOOFF		0
+#define	TCOON		1
+#define	TCIOFF		2
+#define	TCION		3
+
+/* tcflush() and TCFLSH use these */
+#define	TCIFLUSH	0
+#define	TCOFLUSH	1
+#define	TCIOFLUSH	2
+
+/* tcsetattr uses these */
+#define	TCSANOW		0
+#define	TCSADRAIN	1
+#define	TCSAFLUSH	2
+
+
+#define _IOT_termios /* Hurd ioctl type field.  */ \
+  _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/time.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/time.h
new file mode 100644
index 0000000..7ed54bf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/time.h
@@ -0,0 +1,79 @@
+/* System-dependent timing definitions.  Generic version.
+   Copyright (C) 1996,1997,1999-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.  */
+
+/*
+ * Never include this file directly; use <time.h> instead.
+ */
+
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+#  define _BITS_TIME_H	1
+
+/* ISO/IEC 9899:1990 7.12.1: <time.h>
+   The macro `CLOCKS_PER_SEC' is the number per second of the value
+   returned by the `clock' function. */
+/* CAE XSH, Issue 4, Version 2: <time.h>
+   The value of CLOCKS_PER_SEC is required to be 1 million on all
+   XSI-conformant systems. */
+#  define CLOCKS_PER_SEC  1000000l
+
+/* Get the arch-specific value of __UCLIBC_CLK_TCK_CONST used for CLK_TCK
+ * in sysconf() and clock(). */
+#include <bits/uClibc_clk_tck.h>
+
+#  if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
+   presents the real value for clock ticks per second for the system.  */
+#   include <bits/types.h>
+/* Note (uClibc): glibc #defines CLK_TCK as a sysconf() call. */
+#   define CLK_TCK ((__clock_t) __UCLIBC_CLK_TCK_CONST)
+#  endif
+
+#  ifdef __USE_POSIX199309
+/* Identifier for system-wide realtime clock.  */
+#   define CLOCK_REALTIME		0
+/* Monotonic system-wide clock.  */
+#   define CLOCK_MONOTONIC		1
+/* High-resolution timer from the CPU.  */
+#   define CLOCK_PROCESS_CPUTIME_ID	2
+/* Thread-specific CPU-time clock.  */
+#   define CLOCK_THREAD_CPUTIME_ID	3
+
+/* Flag to indicate time is absolute.  */
+#   define TIMER_ABSTIME		1
+#  endif
+
+# endif	/* bits/time.h */
+#endif
+
+#ifdef __need_timeval
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+#  define _STRUCT_TIMEVAL	1
+#  include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+   microsecond but also has a range of years.  */
+struct timeval
+  {
+    __time_t tv_sec;		/* Seconds.  */
+    __suseconds_t tv_usec;	/* Microseconds.  */
+  };
+# endif	/* struct timeval */
+#endif	/* need timeval */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/timerfd.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/timerfd.h
new file mode 100644
index 0000000..93e8c76
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/timerfd.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2008-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_TIMERFD_H
+# error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead."
+#endif
+
+/* Bits to be set in the FLAGS parameter of `timerfd_create'.  */
+enum
+  {
+    TFD_CLOEXEC = 02000000,
+#define TFD_CLOEXEC TFD_CLOEXEC
+    TFD_NONBLOCK = 00004000
+#define TFD_NONBLOCK TFD_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/types.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/types.h
new file mode 100644
index 0000000..c4c10e2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/types.h
@@ -0,0 +1,208 @@
+/* bits/types.h -- definitions of __*_t types underlying *_t types.
+   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.  */
+
+/*
+ * Never include this file directly; use <sys/types.h> instead.
+ */
+
+#ifndef	_BITS_TYPES_H
+#define	_BITS_TYPES_H	1
+
+#include <features.h>
+#include <bits/wordsize.h>
+
+#define __need_size_t
+#include <stddef.h>
+#ifdef _LIBC
+#include <bits/kernel_types.h>
+#endif
+
+/* Convenience types.  */
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+/* Fixed-size types, underlying types depend on word size and compiler.  */
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+#if __WORDSIZE == 64
+typedef signed long int __int64_t;
+typedef unsigned long int __uint64_t;
+#elif defined(__GNUC__)
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+#endif
+
+/* quad_t is also 64 bits.  */
+#if __WORDSIZE == 64
+typedef long int __quad_t;
+typedef unsigned long int __u_quad_t;
+#elif defined(__GNUC__)
+__extension__ typedef long long int __quad_t;
+__extension__ typedef unsigned long long int __u_quad_t;
+#else
+typedef struct
+{
+  long __val[2];
+} __quad_t;
+typedef struct
+{
+  __u_long __val[2];
+} __u_quad_t;
+#endif
+
+
+/* The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
+   macros for each of the OS types we define below.  The definitions
+   of those macros must use the following macros for underlying types.
+   We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
+   variants of each of the following integer types on this machine.
+
+	16		-- "natural" 16-bit type (always short)
+	32		-- "natural" 32-bit type (always int)
+	64		-- "natural" 64-bit type (long or long long)
+	LONG32		-- 32-bit type, traditionally long
+	QUAD		-- 64-bit type, always long long
+	WORD		-- natural type of __WORDSIZE bits (int or long)
+	LONGWORD	-- type of __WORDSIZE bits, traditionally long
+
+   We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
+   conventional uses of `long' or `long long' type modifiers match the
+   types we define, even when a less-adorned type would be the same size.
+   This matters for (somewhat) portably writing printf/scanf formats for
+   these types, where using the appropriate l or ll format modifiers can
+   make the typedefs and the formats match up across all GNU platforms.  If
+   we used `long' when it's 64 bits where `long long' is expected, then the
+   compiler would warn about the formats not matching the argument types,
+   and the programmer changing them to shut up the compiler would break the
+   program's portability.
+
+   Here we assume what is presently the case in all the GCC configurations
+   we support: long long is always 64 bits, long is always word/address size,
+   and int is always 32 bits.  */
+
+#define	__S16_TYPE		short int
+#define __U16_TYPE		unsigned short int
+#define	__S32_TYPE		int
+#define __U32_TYPE		unsigned int
+#define __SLONGWORD_TYPE	long int
+#define __ULONGWORD_TYPE	unsigned long int
+#if __WORDSIZE == 32
+# define __SQUAD_TYPE		__quad_t
+# define __UQUAD_TYPE		__u_quad_t
+# define __SWORD_TYPE		int
+# define __UWORD_TYPE		unsigned int
+# define __SLONG32_TYPE		long int
+# define __ULONG32_TYPE		unsigned long int
+# define __S64_TYPE		__quad_t
+# define __U64_TYPE		__u_quad_t
+/* We want __extension__ before typedef's that use nonstandard base types
+   such as `long long' in C89 mode.  */
+# define __STD_TYPE		__extension__ typedef
+#elif __WORDSIZE == 64
+# define __SQUAD_TYPE		long int
+# define __UQUAD_TYPE		unsigned long int
+# define __SWORD_TYPE		long int
+# define __UWORD_TYPE		unsigned long int
+# define __SLONG32_TYPE		int
+# define __ULONG32_TYPE		unsigned int
+# define __S64_TYPE		long int
+# define __U64_TYPE		unsigned long int
+/* No need to mark the typedef with __extension__.   */
+# define __STD_TYPE		typedef
+#else
+# error your machine is neither 32 bit or 64 bit ... it must be magical
+#endif
+#include <bits/typesizes.h>	/* Defines __*_T_TYPE macros.  */
+
+
+__STD_TYPE __DEV_T_TYPE __dev_t;	/* Type of device numbers.  */
+__STD_TYPE __UID_T_TYPE __uid_t;	/* Type of user identifications.  */
+__STD_TYPE __GID_T_TYPE __gid_t;	/* Type of group identifications.  */
+__STD_TYPE __INO_T_TYPE __ino_t;	/* Type of file serial numbers.  */
+__STD_TYPE __INO64_T_TYPE __ino64_t;	/* Type of file serial numbers (LFS).*/
+__STD_TYPE __MODE_T_TYPE __mode_t;	/* Type of file attribute bitmasks.  */
+__STD_TYPE __NLINK_T_TYPE __nlink_t;	/* Type of file link counts.  */
+__STD_TYPE __OFF_T_TYPE __off_t;	/* Type of file sizes and offsets.  */
+__STD_TYPE __OFF64_T_TYPE __off64_t;	/* Type of file sizes and offsets (LFS).  */
+__STD_TYPE __PID_T_TYPE __pid_t;	/* Type of process identifications.  */
+__STD_TYPE __FSID_T_TYPE __fsid_t;	/* Type of file system IDs.  */
+__STD_TYPE __CLOCK_T_TYPE __clock_t;	/* Type of CPU usage counts.  */
+__STD_TYPE __RLIM_T_TYPE __rlim_t;	/* Type for resource measurement.  */
+__STD_TYPE __RLIM64_T_TYPE __rlim64_t;	/* Type for resource measurement (LFS).  */
+__STD_TYPE __ID_T_TYPE __id_t;		/* General type for IDs.  */
+__STD_TYPE __TIME_T_TYPE __time_t;	/* Seconds since the Epoch.  */
+__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds.  */
+__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds.  */
+
+__STD_TYPE __DADDR_T_TYPE __daddr_t;	/* The type of a disk address.  */
+__STD_TYPE __SWBLK_T_TYPE __swblk_t;	/* Type of a swap block maybe?  */
+__STD_TYPE __KEY_T_TYPE __key_t;	/* Type of an IPC key.  */
+
+/* Clock ID used in clock and timer functions.  */
+__STD_TYPE __CLOCKID_T_TYPE __clockid_t;
+
+/* Timer ID returned by `timer_create'.  */
+__STD_TYPE __TIMER_T_TYPE __timer_t;
+
+/* Type to represent block size.  */
+__STD_TYPE __BLKSIZE_T_TYPE __blksize_t;
+
+/* Types from the Large File Support interface.  */
+
+/* Type to count number of disk blocks.  */
+__STD_TYPE __BLKCNT_T_TYPE __blkcnt_t;
+__STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t;
+
+/* Type to count file system blocks.  */
+__STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t;
+__STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t;
+
+/* Type to count file system nodes.  */
+__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t;
+__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t;
+
+__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error.  */
+
+/* These few don't really vary by system, they always correspond
+   to one of the other defined types.  */
+typedef __off64_t __loff_t;	/* Type of file sizes and offsets (LFS).  */
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+/* Duplicates info from stdint.h but this is used in unistd.h.  */
+__STD_TYPE __SWORD_TYPE __intptr_t;
+
+/* Duplicate info from sys/socket.h.  */
+__STD_TYPE __U32_TYPE __socklen_t;
+
+
+#undef __STD_TYPE
+
+/* Now add the thread types.  */
+#if defined __UCLIBC_HAS_THREADS__ && (defined __USE_POSIX199506 || defined __USE_UNIX98)
+# include <bits/pthreadtypes.h>
+#endif
+
+#endif /* bits/types.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/typesizes.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/typesizes.h
new file mode 100644
index 0000000..e9226c4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/typesizes.h
@@ -0,0 +1,66 @@
+/* bits/typesizes.h -- underlying types for *_t.  Generic version.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef	_BITS_TYPESIZES_H
+#define	_BITS_TYPESIZES_H	1
+
+/* See <bits/types.h> for the meaning of these macros.  This file exists so
+   that <bits/types.h> need not vary across different GNU platforms.  */
+
+#define __DEV_T_TYPE		__UQUAD_TYPE
+#define __UID_T_TYPE		__U32_TYPE
+#define __GID_T_TYPE		__U32_TYPE
+#define __INO_T_TYPE		__ULONGWORD_TYPE
+#define __INO64_T_TYPE		__UQUAD_TYPE
+#define __MODE_T_TYPE		__U32_TYPE
+#define __NLINK_T_TYPE		__UWORD_TYPE
+#define __OFF_T_TYPE		__SLONGWORD_TYPE
+#define __OFF64_T_TYPE		__SQUAD_TYPE
+#define __PID_T_TYPE		__S32_TYPE
+#define __RLIM_T_TYPE		__ULONGWORD_TYPE
+#define __RLIM64_T_TYPE		__UQUAD_TYPE
+#define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
+#define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
+#define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
+#define	__ID_T_TYPE		__U32_TYPE
+#define __CLOCK_T_TYPE		__SLONGWORD_TYPE
+#define __TIME_T_TYPE		__SLONGWORD_TYPE
+#define __USECONDS_T_TYPE	__U32_TYPE
+#define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
+#define __DADDR_T_TYPE		__S32_TYPE
+#define __SWBLK_T_TYPE		__SLONGWORD_TYPE
+#define __KEY_T_TYPE		__S32_TYPE
+#define __CLOCKID_T_TYPE	__S32_TYPE
+#define __TIMER_T_TYPE		void *
+#define __BLKSIZE_T_TYPE	__SLONGWORD_TYPE
+#define __FSID_T_TYPE		struct { int __val[2]; }
+#define __SSIZE_T_TYPE		__SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'.  */
+#define	__FD_SETSIZE		1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_alloc.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_alloc.h
new file mode 100644
index 0000000..6a70d27
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_alloc.h
@@ -0,0 +1,26 @@
+/*
+ * Macros to transparently switch between the stack and heap for large
+ * allocations.  The former is useful on MMU systems as it results in
+ * smaller code, but the latter is required on NoMMU systems.  This is
+ * due to small stacks that cannot grow and so doing large allocs will
+ * cause a stack overflow.
+ *
+ * Copyright (C) 2010 Mike Frysinger <vapier@gentoo.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#ifndef _UCLIBC_ALLOC_H
+#define _UCLIBC_ALLOC_H
+
+#include <alloca.h>
+#include <stdlib.h>
+
+#ifdef __ARCH_USE_MMU__
+# define stack_heap_alloc(x) alloca(x)
+# define stack_heap_free(x)  do { if (0) free(x); } while (0)
+#else
+# define stack_heap_alloc(x) malloc(x)
+# define stack_heap_free(x)  free(x)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..6cb6177
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_arch_features.h
@@ -0,0 +1,50 @@
+/*
+ * Track misc arch-specific features that aren't config options
+ */
+
+#ifndef _BITS_UCLIBC_ARCH_FEATURES_H
+#define _BITS_UCLIBC_ARCH_FEATURES_H
+
+#error "You should copy this to your arch/bits/ dir and customize"
+
+/* instruction used when calling abort() to kill yourself */
+/*#define __UCLIBC_ABORT_INSTRUCTION__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/common/bits/uClibc_charclass.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_charclass.h
new file mode 100644
index 0000000..50df539
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_charclass.h
@@ -0,0 +1,40 @@
+/*  Copyright (C) 2008  Denys Vlasenko  <vda.linux@googlemail.com>
+ *
+ *  This 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.
+ */
+
+#ifndef _BITS_UCLIBC_CHARCLASS_H
+#define _BITS_UCLIBC_CHARCLASS_H
+
+/* Taking advantage of the C99 mutual-exclusion guarantees for the various
+ * (w)ctype classes, including the descriptions of printing and control
+ * (w)chars, we can place each in one of the following mutually-exlusive
+ * subsets.  Since there are less than 16, we can store the data for
+ * each (w)chars in a nibble. In contrast, glibc uses an unsigned int
+ * per (w)char, with one bit flag for each is* type.  While this allows
+ * a simple '&' operation to determine the type vs. a range test and a
+ * little special handling for the "blank" and "xdigit" types in my
+ * approach, it also uses 8 times the space for the tables on the typical
+ * 32-bit archs we supported.*/
+enum {
+	__CTYPE_unclassified = 0,
+	__CTYPE_alpha_nonupper_nonlower,
+	__CTYPE_alpha_lower,
+	__CTYPE_alpha_upper_lower,
+	__CTYPE_alpha_upper,
+	__CTYPE_digit,
+	__CTYPE_punct,
+	__CTYPE_graph,
+	__CTYPE_print_space_nonblank,
+	__CTYPE_print_space_blank,
+	__CTYPE_space_nonblank_noncntrl,
+	__CTYPE_space_blank_noncntrl,
+	__CTYPE_cntrl_space_nonblank,
+	__CTYPE_cntrl_space_blank,
+	__CTYPE_cntrl_nonspace
+};
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_clk_tck.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_clk_tck.h
new file mode 100644
index 0000000..00b77bf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_clk_tck.h
@@ -0,0 +1,8 @@
+/* Use a default of 100 for CLK_TCK to implement sysconf() and clock().
+ * Override this by supplying an arch-specific version of this header file.
+ *
+ * WARNING: It is assumed that this is a constant integer value usable in
+ * preprocessor conditionals!!!
+ */
+
+#define __UCLIBC_CLK_TCK_CONST		100
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_ctype.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_ctype.h
new file mode 100644
index 0000000..5ff281d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_ctype.h
@@ -0,0 +1,199 @@
+/*  Copyright (C) 2002     Manuel Novoa III
+ *
+ *  This 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.
+ */
+
+/*  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!
+ *
+ *  Besides uClibc, I'm using this code in my libc for elks, which is
+ *  a 16-bit environment with a fairly limited compiler.  It would make
+ *  things much easier for me if this file isn't modified unnecessarily.
+ *  In particular, please put any new or replacement functions somewhere
+ *  else, and modify the makefile to use your version instead.
+ *  Thanks.  Manuel
+ *
+ *  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION! */
+
+#if !defined(_CTYPE_H) && !defined(_WCTYPE_H)
+#error Always include <{w}ctype.h> rather than <bits/uClibc_ctype.h>
+#endif
+
+#ifndef _BITS_UCLIBC_CTYPE_H
+#define _BITS_UCLIBC_CTYPE_H
+
+#ifdef __UCLIBC_GEN_LOCALE
+/* We are in extra/locale/gen_XXX tools build */
+
+#include "uClibc_charclass.h"
+
+#else
+
+/* Define some ctype macros valid for the C/POSIX locale. */
+
+/* ASCII ords of \t, \f, \n, \r, and \v are 9, 12, 10, 13, 11 respectively. */
+#define __C_isspace(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? ((((c) == ' ') || (((unsigned char)((c) - 9)) <= (13 - 9)))) \
+	 : ((((c) == ' ') || (((unsigned int)((c) - 9)) <= (13 - 9)))))
+#define __C_isblank(c) (((c) == ' ') || ((c) == '\t'))
+#define __C_isdigit(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)((c) - '0')) < 10) \
+	 : (((unsigned int)((c) - '0')) < 10))
+#define __C_isxdigit(c) \
+	(__C_isdigit(c) \
+	 || ((sizeof(c) == sizeof(char)) \
+		 ? (((unsigned char)((((c)) | 0x20) - 'a')) < 6) \
+		 : (((unsigned int)((((c)) | 0x20) - 'a')) < 6)))
+#define __C_iscntrl(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? ((((unsigned char)(c)) < 0x20) || ((c) == 0x7f)) \
+	 : ((((unsigned int)(c)) < 0x20) || ((c) == 0x7f)))
+#define __C_isalpha(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)(((c) | 0x20) - 'a')) < 26) \
+	 : (((unsigned int)(((c) | 0x20) - 'a')) < 26))
+#define __C_isalnum(c) (__C_isalpha(c) || __C_isdigit(c))
+#define __C_isprint(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)((c) - 0x20)) <= (0x7e - 0x20)) \
+	 : (((unsigned int)((c) - 0x20)) <= (0x7e - 0x20)))
+#define __C_islower(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)((c) - 'a')) < 26) \
+	 : (((unsigned int)((c) - 'a')) < 26))
+#define __C_isupper(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)((c) - 'A')) < 26) \
+	 : (((unsigned int)((c) - 'A')) < 26))
+#define __C_ispunct(c) \
+	((!__C_isalnum(c)) \
+	 && ((sizeof(c) == sizeof(char)) \
+		 ? (((unsigned char)((c) - 0x21)) <= (0x7e - 0x21)) \
+		 : (((unsigned int)((c) - 0x21)) <= (0x7e - 0x21))))
+#define __C_isgraph(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)((c) - 0x21)) <= (0x7e - 0x21)) \
+	 : (((unsigned int)((c) - 0x21)) <= (0x7e - 0x21)))
+
+#define __C_tolower(c) (__C_isupper(c) ? ((c) | 0x20) : (c))
+#define __C_toupper(c) (__C_islower(c) ? ((c) ^ 0x20) : (c))
+
+/**********************************************************************/
+__BEGIN_DECLS
+
+#ifdef _LIBC
+/* These are uClibc-specific. */
+# define __isdigit_char(c) ((unsigned char)((c) - '0') <= 9)
+# define __isdigit_int(c)  ((unsigned int)((c) - '0') <= 9)
+#endif
+
+/* Now some non-ansi/iso c99 macros. */
+
+#ifdef __UCLIBC_SUSV4_LEGACY__
+#define __isascii(c) (((c) & ~0x7f) == 0)
+#define __toascii(c) ((c) & 0x7f)
+/* Works correctly *only* on lowercase letters! */
+#define _toupper(c) ((c) ^ 0x20)
+/* Works correctly *only* on letters (of any case) and numbers */
+#define _tolower(c) ((c) | 0x20)
+#endif
+
+__END_DECLS
+
+/**********************************************************************/
+#ifdef __GNUC__
+
+# define __body_C_macro(f,args)  __C_ ## f args
+
+# define __body(f,c) \
+(__extension__ ({ \
+	int __res; \
+	if (sizeof(c) > sizeof(char)) { \
+		int __c = (c); \
+		__res = __body_C_macro(f,(__c)); \
+	} else { \
+		unsigned char __c = (c); \
+		__res = __body_C_macro(f,(__c)); \
+	} \
+	__res; \
+}))
+
+# define __isspace(c)   __body(isspace,c)
+# define __isblank(c)   __body(isblank,c)
+# define __isdigit(c)   __body(isdigit,c)
+# define __isxdigit(c)  __body(isxdigit,c)
+# define __iscntrl(c)   __body(iscntrl,c)
+# define __isalpha(c)   __body(isalpha,c)
+# define __isalnum(c)   __body(isalnum,c)
+# define __isprint(c)   __body(isprint,c)
+# define __islower(c)   __body(islower,c)
+# define __isupper(c)   __body(isupper,c)
+# define __ispunct(c)   __body(ispunct,c)
+# define __isgraph(c)   __body(isgraph,c)
+
+/*locale-aware ctype.h has no __tolower, why stub locale
+ *tries to have it? remove after 0.9.31
+ *# define __tolower(c) __body(tolower,c)
+ *# define __toupper(c) __body(toupper,c)
+ */
+
+/* Do not combine in one #if - unifdef tool is not that clever */
+# ifndef __NO_CTYPE
+# ifndef __cplusplus
+
+#  define isspace(c)    __isspace(c)
+#  define isblank(c)    __isblank(c)
+#  define isdigit(c)    __isdigit(c)
+#  define isxdigit(c)   __isxdigit(c)
+#  define iscntrl(c)    __iscntrl(c)
+#  define isalpha(c)    __isalpha(c)
+#  define isalnum(c)    __isalnum(c)
+#  define isprint(c)    __isprint(c)
+#  define islower(c)    __islower(c)
+#  define isupper(c)    __isupper(c)
+#  define ispunct(c)    __ispunct(c)
+#  define isgraph(c)    __isgraph(c)
+
+#  define tolower(c)    __body(tolower,c)
+#  define toupper(c)    __body(toupper,c)
+
+# endif
+# endif
+
+#else  /* !_GNUC__ */
+
+# ifndef __NO_CTYPE
+# ifndef __cplusplus
+
+/* These macros should be safe from side effects!
+ * (not all __C_xxx macros are) */
+#  define isdigit(c)    __C_isdigit(c)
+#  define isalpha(c)    __C_isalpha(c)
+#  define isprint(c)    __C_isprint(c)
+#  define islower(c)    __C_islower(c)
+#  define isupper(c)    __C_isupper(c)
+#  define isgraph(c)    __C_isgraph(c)
+
+# endif
+# endif
+
+#endif /* __GNUC__ */
+/**********************************************************************/
+
+#endif  /* __UCLIBC_GEN_LOCALE */
+
+#endif /* _BITS_UCLIBC_CTYPE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_fpmax.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_fpmax.h
new file mode 100644
index 0000000..e1721bf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_fpmax.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2003-2006     Manuel Novoa III
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Define a maximal floating point type, and the associated constants
+ * that are defined for the floating point types in float.h.
+ *
+ * This is to support archs that are missing long double, or even double.
+ */
+
+#ifndef _UCLIBC_FPMAX_H
+#define _UCLIBC_FPMAX_H
+
+#ifndef _ISOC99_SOURCE
+#define _ISOC99_SOURCE 1
+#endif
+
+#include <features.h>
+#include <float.h>
+
+#ifdef __UCLIBC_HAS_FLOATS__
+
+#if defined(LDBL_MANT_DIG)
+
+typedef long double __fpmax_t;
+#define FPMAX_TYPE           3
+
+#define FPMAX_MANT_DIG       LDBL_MANT_DIG
+#define FPMAX_DIG            LDBL_DIG
+#define FPMAX_EPSILON        LDBL_EPSILON
+#define FPMAX_MIN_EXP        LDBL_MIN_EXP
+#define FPMAX_MIN            LDBL_MIN
+#define FPMAX_MIN_10_EXP     LDBL_MIN_10_EXP
+#define FPMAX_MAX_EXP        LDBL_MAX_EXP
+#define FPMAX_MAX            LDBL_MAX
+#define FPMAX_MAX_10_EXP     LDBL_MAX_10_EXP
+
+#elif defined(DBL_MANT_DIG)
+
+typedef double __fpmax_t;
+#define FPMAX_TYPE           2
+
+#define FPMAX_MANT_DIG       DBL_MANT_DIG
+#define FPMAX_DIG            DBL_DIG
+#define FPMAX_EPSILON        DBL_EPSILON
+#define FPMAX_MIN_EXP        DBL_MIN_EXP
+#define FPMAX_MIN            DBL_MIN
+#define FPMAX_MIN_10_EXP     DBL_MIN_10_EXP
+#define FPMAX_MAX_EXP        DBL_MAX_EXP
+#define FPMAX_MAX            DBL_MAX
+#define FPMAX_MAX_10_EXP     DBL_MAX_10_EXP
+
+#elif defined(FLT_MANT_DIG)
+
+typedef float __fpmax_t;
+#define FPMAX_TYPE           1
+
+#define FPMAX_MANT_DIG       FLT_MANT_DIG
+#define FPMAX_DIG            FLT_DIG
+#define FPMAX_EPSILON        FLT_EPSILON
+#define FPMAX_MIN_EXP        FLT_MIN_EXP
+#define FPMAX_MIN            FLT_MIN
+#define FPMAX_MIN_10_EXP     FLT_MIN_10_EXP
+#define FPMAX_MAX_EXP        FLT_MAX_EXP
+#define FPMAX_MAX            FLT_MAX
+#define FPMAX_MAX_10_EXP     FLT_MAX_10_EXP
+
+#else
+#error unable to determine appropriate type for __fpmax_t!
+#endif
+
+#ifndef DECIMAL_DIG
+
+#ifdef L___strtofpmax
+/* Emit warning only once. */
+#warning DECIMAL_DIG is not defined! If you are using gcc, it may not be defining __STDC_VERSION__ as it should.
+#endif
+#if !defined(FLT_RADIX) || (FLT_RADIX != 2)
+#error unable to compensate for missing DECIMAL_DIG!
+#endif
+
+/*  ceil (1 + #mantissa * log10 (FLT_RADIX)) */
+#define DECIMAL_DIG   (1 + (((FPMAX_MANT_DIG * 100) + 331) / 332))
+
+#endif /* DECIMAL_DIG */
+
+#if defined _LIBC && defined IS_IN_libc
+extern __fpmax_t __strtofpmax(const char *str, char **endptr, int exp_adjust) attribute_hidden;
+
+#ifdef __UCLIBC_HAS_XLOCALE__
+extern __fpmax_t __strtofpmax_l(const char *str, char **endptr, int exp_adjust,
+								__locale_t locale_arg) attribute_hidden;
+#endif
+
+#ifdef __UCLIBC_HAS_WCHAR__
+extern __fpmax_t __wcstofpmax(const wchar_t *wcs, wchar_t **endptr,
+							  int exp_adjust) attribute_hidden;
+
+#ifdef __UCLIBC_HAS_XLOCALE__
+extern __fpmax_t __wcstofpmax_l(const wchar_t *wcs, wchar_t **endptr,
+								int exp_adjust, __locale_t locale_arg) attribute_hidden;
+#endif
+#endif /* __UCLIBC_HAS_WCHAR__ */
+#endif /* _LIBC */
+
+/* The following checks in an __fpmax_t is either 0 or +/- infinity.
+ *
+ * WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!
+ *
+ * This only works if __fpmax_t is the actual maximal floating point type used
+ * in intermediate calculations.  Otherwise, excess precision in the
+ * intermediate values can cause the test to fail.
+ *
+ * WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!
+ */
+
+#define __FPMAX_ZERO_OR_INF_CHECK(x)  ((x) == ((x)/4) )
+
+#endif /* __UCLIBC_HAS_FLOATS__ */
+
+#endif /* _UCLIBC_FPMAX_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_local_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_local_lim.h
new file mode 100644
index 0000000..abfc86d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_local_lim.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/*
+ * Never include this file directly; use <unistd.h> instead.
+ */
+
+#ifndef	_BITS_UCLIBC_LOCAL_LIM_H
+#define	_BITS_UCLIBC_LOCAL_LIM_H	1
+
+/* This file works correctly only if local_lim.h is the NPTL version */
+#if !defined PTHREAD_KEYS_MAX || defined TIMER_MAX
+# error local_lim.h was incorrectly updated, use the NPTL version from glibc
+#endif
+
+/* This should really be moved to thread specific directories */
+#if defined __UCLIBC_HAS_THREADS__ && !defined __UCLIBC_HAS_THREADS_NATIVE__
+# define PTHREAD_THREADS_MAX	1024
+# define TIMER_MAX		256
+#endif
+
+#ifndef __UCLIBC_HAS_THREADS__
+# undef _POSIX_THREAD_KEYS_MAX
+# undef PTHREAD_KEYS_MAX
+# undef _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+# undef PTHREAD_DESTRUCTOR_ITERATIONS
+# undef PTHREAD_STACK_MIN
+# undef DELAYTIMER_MAX
+#endif
+
+#endif /* bits/uClibc_local_lim.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_locale.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_locale.h
new file mode 100644
index 0000000..9790da2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_locale.h
@@ -0,0 +1,374 @@
+/*  Copyright (C) 2002, 2003     Manuel Novoa III
+ *
+ *  This 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.
+ */
+
+/*  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!
+ *
+ *  Besides uClibc, I'm using this code in my libc for elks, which is
+ *  a 16-bit environment with a fairly limited compiler.  It would make
+ *  things much easier for me if this file isn't modified unnecessarily.
+ *  In particular, please put any new or replacement functions somewhere
+ *  else, and modify the makefile to use your version instead.
+ *  Thanks.  Manuel
+ *
+ *  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION! */
+
+#ifndef _UCLIBC_LOCALE_H
+#define _UCLIBC_LOCALE_H
+
+/**********************************************************************/
+/* uClibc compatibilty stuff */
+
+#ifdef __UCLIBC_HAS_LOCALE__
+
+# undef __LOCALE_C_ONLY
+
+#else
+
+# define __LOCALE_C_ONLY
+
+# ifdef _LIBC
+#  define __XL_NPP(N) N
+#  define __LOCALE_PARAM
+#  define __LOCALE_ARG
+# endif
+
+#endif
+
+/**********************************************************************/
+
+#define __NL_ITEM_CATEGORY_SHIFT        8
+#define __NL_ITEM_INDEX_MASK            0xff
+
+/* TODO: Make sure these agree with the locale mmap file gererator! */
+
+#define __LC_CTYPE      0
+#define __LC_NUMERIC    1
+#define __LC_MONETARY   2
+#define __LC_TIME       3
+#define __LC_COLLATE    4
+#define __LC_MESSAGES   5
+#define __LC_ALL        6
+
+/**********************************************************************/
+#ifndef __LOCALE_C_ONLY
+
+enum {
+	__ctype_encoding_7_bit,		/* C/POSIX */
+	__ctype_encoding_utf8,		/* UTF-8 */
+	__ctype_encoding_8_bit		/* for 8-bit codeset locales */
+};
+
+#define LOCALE_STRING_SIZE (2 * __LC_ALL + 2)
+
+ /*
+  * '#' + 2_per_category + '\0'
+  *       {locale row # : 0 = C|POSIX} + 0x8001
+  *       encoded in two chars as (((N+1) >> 8) | 0x80) and ((N+1) & 0xff)
+  *       so decode is  ((((uint16_t)(*s & 0x7f)) << 8) + s[1]) - 1
+  *
+  *       Note: 0s are not used as they are nul-terminators for strings.
+  *       Note: 0xff, 0xff is the encoding for a non-selected locale.
+  *             (see setlocale() below).
+  * In particular, C/POSIX locale is '#' + "\x80\x01"}*LC_ALL + nul.
+  */
+
+struct __uclibc_locale_struct;
+typedef struct __uclibc_locale_struct *__locale_t;
+
+#ifdef _LIBC
+
+/* extern void _locale_set(const unsigned char *p); */
+/* extern void _locale_init(void); */
+
+#include <stddef.h>
+#include <stdint.h>
+#include <bits/uClibc_touplow.h>
+#ifndef __UCLIBC_GEN_LOCALE
+# include <bits/uClibc_locale_data.h>
+#endif
+
+#ifndef __UCLIBC_GEN_LOCALE /* && (defined IS_IN_libc || defined NOT_IN_libc) */
+typedef struct {
+	uint16_t num_weights;
+	uint16_t num_starters;
+	uint16_t ii_shift;
+	uint16_t ti_shift;
+	uint16_t ii_len;
+	uint16_t ti_len;
+	uint16_t max_weight;
+	uint16_t num_col_base;
+	uint16_t max_col_index;
+	uint16_t undefined_idx;
+	uint16_t range_low;
+	uint16_t range_count;
+	uint16_t range_base_weight;
+	uint16_t range_rule_offset; /* change name to index? */
+
+	uint16_t ii_mask;
+	uint16_t ti_mask;
+
+	const uint16_t *index2weight_tbl;
+	const uint16_t *index2ruleidx_tbl;
+	const uint16_t *multistart_tbl;
+	/*	 uint16_t wcs2colidt_offset_low; */
+	/*	 uint16_t wcs2colidt_offset_hi; */
+	const uint16_t *wcs2colidt_tbl;
+
+	/*	 uint16_t undefined_idx; */
+	const uint16_t *overrides_tbl;
+	/*	 uint16_t *multistart_tbl; */
+
+	const uint16_t *weightstr;
+	const uint16_t *ruletable;
+
+
+	uint16_t *index2weight;
+	uint16_t *index2ruleidx;
+
+	uint16_t MAX_WEIGHTS;
+} __collate_t;
+
+/*  static unsigned char cur_locale[LOCALE_STRING_SIZE]; */
+
+struct __uclibc_locale_struct {
+#ifdef __UCLIBC_HAS_XLOCALE__
+	const __ctype_mask_t *__ctype_b;
+	const __ctype_touplow_t *__ctype_tolower;
+	const __ctype_touplow_t *__ctype_toupper;
+#endif
+
+	/* For now, just embed this in the structure. */
+	__ctype_mask_t __ctype_b_data[256 + __UCLIBC_CTYPE_B_TBL_OFFSET];
+	__ctype_touplow_t __ctype_tolower_data[256 + __UCLIBC_CTYPE_TO_TBL_OFFSET];
+	__ctype_touplow_t __ctype_toupper_data[256 + __UCLIBC_CTYPE_TO_TBL_OFFSET];
+
+/*  	int tables_loaded; */
+/*  	unsigned char lctypes[LOCALE_STRING_SIZE]; */
+	unsigned char cur_locale[LOCALE_STRING_SIZE];
+
+	/* NL_LANGINFO stuff. BEWARE ORDERING!!! must agree with NL_* constants! */
+	/* Also, numeric must be followed by monetary and the items must be in
+	 * the "struct lconv" order. */
+
+	uint16_t category_offsets[__LC_ALL]; /* TODO -- fix? */
+	unsigned char category_item_count[__LC_ALL]; /* TODO - fix */
+
+	/* ctype */
+	unsigned char encoding;		/* C/POSIX, 8-bit, UTF-8 */
+	unsigned char mb_cur_max;	/* determined by encoding _AND_ translit!!! */
+	const unsigned char outdigit_length[10];
+
+#ifdef __CTYPE_HAS_8_BIT_LOCALES
+	const unsigned char *idx8ctype;
+	const unsigned char *tbl8ctype;
+	const unsigned char *idx8uplow;
+	const unsigned char *tbl8uplow;
+# ifdef __UCLIBC_HAS_WCHAR__
+	const unsigned char *idx8c2wc;
+	const uint16_t *tbl8c2wc;	/* char > 0x7f to wide char */
+	const unsigned char *idx8wc2c;
+	const unsigned char *tbl8wc2c;
+	/* translit  */
+# endif
+#endif /* __CTYPE_HAS_8_BIT_LOCALES */
+#ifdef __UCLIBC_HAS_WCHAR__
+
+	const uint16_t *code2flag;
+
+	const unsigned char *tblwctype;
+	const unsigned char *tblwuplow;
+/* 	const unsigned char *tblwcomb; */
+	const int16_t *tblwuplow_diff; /* yes... signed */
+	/* width?? */
+
+	wchar_t decimal_point_wc;
+	wchar_t thousands_sep_wc;
+	int decimal_point_len;
+	int thousands_sep_len;
+
+#endif /* __UCLIBC_HAS_WCHAR__ */
+
+	/* ctype */
+	const char *outdigit0_mb;
+	const char *outdigit1_mb;
+	const char *outdigit2_mb;
+	const char *outdigit3_mb;
+	const char *outdigit4_mb;
+	const char *outdigit5_mb;
+	const char *outdigit6_mb;
+	const char *outdigit7_mb;
+	const char *outdigit8_mb;
+	const char *outdigit9_mb;
+	const char *codeset;		/* MUST BE LAST!!! */
+
+	/* numeric */
+	const char *decimal_point;
+	const char *thousands_sep;
+	const char *grouping;
+
+	/* monetary */
+	const char *int_curr_symbol;
+	const char *currency_symbol;
+	const char *mon_decimal_point;
+	const char *mon_thousands_sep;
+	const char *mon_grouping;
+	const char *positive_sign;
+	const char *negative_sign;
+	const char *int_frac_digits;
+	const char *frac_digits;
+	const char *p_cs_precedes;
+	const char *p_sep_by_space;
+	const char *n_cs_precedes;
+	const char *n_sep_by_space;
+	const char *p_sign_posn;
+	const char *n_sign_posn;
+	const char *int_p_cs_precedes;
+	const char *int_p_sep_by_space;
+	const char *int_n_cs_precedes;
+	const char *int_n_sep_by_space;
+	const char *int_p_sign_posn;
+	const char *int_n_sign_posn;
+
+	const char *crncystr;		/* not returned by localeconv */
+
+	/* time */
+	const char *abday_1;
+	const char *abday_2;
+	const char *abday_3;
+	const char *abday_4;
+	const char *abday_5;
+	const char *abday_6;
+	const char *abday_7;
+
+	const char *day_1;
+	const char *day_2;
+	const char *day_3;
+	const char *day_4;
+	const char *day_5;
+	const char *day_6;
+	const char *day_7;
+
+	const char *abmon_1;
+	const char *abmon_2;
+	const char *abmon_3;
+	const char *abmon_4;
+	const char *abmon_5;
+	const char *abmon_6;
+	const char *abmon_7;
+	const char *abmon_8;
+	const char *abmon_9;
+	const char *abmon_10;
+	const char *abmon_11;
+	const char *abmon_12;
+
+	const char *mon_1;
+	const char *mon_2;
+	const char *mon_3;
+	const char *mon_4;
+	const char *mon_5;
+	const char *mon_6;
+	const char *mon_7;
+	const char *mon_8;
+	const char *mon_9;
+	const char *mon_10;
+	const char *mon_11;
+	const char *mon_12;
+
+	const char *am_str;
+	const char *pm_str;
+
+	const char *d_t_fmt;
+	const char *d_fmt;
+	const char *t_fmt;
+	const char *t_fmt_ampm;
+	const char *era;
+
+	const char *era_year;		/* non SUSv3 */
+	const char *era_d_fmt;
+	const char *alt_digits;
+	const char *era_d_t_fmt;
+	const char *era_t_fmt;
+
+	/* messages */
+	const char *yesexpr;
+	const char *noexpr;
+	const char *yesstr;
+	const char *nostr;
+
+	/* collate is at the end */
+	__collate_t collate;
+};
+
+extern struct __uclibc_locale_struct __global_locale_data;
+extern struct __uclibc_locale_struct *__global_locale;
+#endif /* !__UCLIBC_GEN_LOCALE */
+
+#if defined IS_IN_libc || defined NOT_IN_libc
+/* If you plan to remove xxx_IN_libc guards,
+ * remove attribute_hidden, it won't work.
+ */
+extern int __locale_mbrtowc_l(wchar_t *__restrict dst,
+				const char *__restrict src,
+				__locale_t loc) attribute_hidden;
+#endif
+
+#ifdef L_setlocale
+/* so we only get the warning once... */
+#warning need thread version of CUR_LOCALE!
+#endif
+
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_XLOCALE__
+
+extern __locale_t __curlocale_var;
+# ifdef __UCLIBC_HAS_THREADS__
+extern __locale_t __curlocale(void)  __THROW __attribute__ ((__const__));
+extern __locale_t __curlocale_set(__locale_t newloc);
+#  define __UCLIBC_CURLOCALE  (__curlocale())
+# else
+#  define __UCLIBC_CURLOCALE  (__curlocale_var)
+# endif
+
+#elif defined(__UCLIBC_HAS_LOCALE__)
+
+# define __UCLIBC_CURLOCALE   (__global_locale)
+
+#endif
+/**********************************************************************/
+#if defined(__UCLIBC_HAS_XLOCALE__) && defined(__UCLIBC_DO_XLOCALE)
+
+# define __XL_NPP(N) N ## _l
+# define __LOCALE_PARAM    , __locale_t locale_arg
+# define __LOCALE_ARG      , locale_arg
+# define __LOCALE_PTR      locale_arg
+
+#else
+
+# define __XL_NPP(N) N
+# define __LOCALE_PARAM
+# define __LOCALE_ARG
+# define __LOCALE_PTR      __UCLIBC_CURLOCALE
+
+#endif
+/**********************************************************************/
+
+#endif /* _LIBC */
+
+#endif /* !defined(__LOCALE_C_ONLY) */
+
+#endif /* _UCLIBC_LOCALE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_mutex.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_mutex.h
new file mode 100644
index 0000000..ef8016d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_mutex.h
@@ -0,0 +1,157 @@
+/* Copyright (C) 2006   Manuel Novoa III    <mjn3@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#ifndef _UCLIBC_MUTEX_H
+#define _UCLIBC_MUTEX_H
+
+#include <features.h>
+
+#ifdef __UCLIBC_HAS_THREADS__
+
+#include <pthread.h>
+#include <bits/uClibc_pthread.h>
+
+#define __UCLIBC_MUTEX_TYPE				pthread_mutex_t
+
+#define __UCLIBC_MUTEX(M)				pthread_mutex_t M
+#define __UCLIBC_MUTEX_INIT(M,I)			pthread_mutex_t M = I
+#define __UCLIBC_MUTEX_STATIC(M,I)			static pthread_mutex_t M = I
+#define __UCLIBC_MUTEX_EXTERN(M)			extern pthread_mutex_t M
+
+#define __UCLIBC_MUTEX_INIT_VAR(M)								\
+		((M) = (pthread_mutex_t) PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+
+#define __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE(M)								\
+		__pthread_mutex_lock(&(M))
+
+#define __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE(M)								\
+		__pthread_mutex_unlock(&(M))
+
+#define __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE(M)								\
+		__pthread_mutex_trylock(&(M))
+
+#define __UCLIBC_MUTEX_CONDITIONAL_LOCK(M,C)								\
+	do {												\
+		struct _pthread_cleanup_buffer __infunc_pthread_cleanup_buffer;				\
+		int __infunc_need_locking = (C);							\
+		if (__infunc_need_locking) {								\
+			_pthread_cleanup_push_defer(&__infunc_pthread_cleanup_buffer,			\
+					   (void (*) (void *))__pthread_mutex_unlock,			\
+										&(M));			\
+			__pthread_mutex_lock(&(M));							\
+		}											\
+		((void)0)
+
+#define __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M,C)								\
+		if (__infunc_need_locking) {								\
+			_pthread_cleanup_pop_restore(&__infunc_pthread_cleanup_buffer,1);		\
+		}											\
+	} while (0)
+
+#define __UCLIBC_MUTEX_AUTO_LOCK_VAR(A)		int A
+
+#define __UCLIBC_MUTEX_AUTO_LOCK(M,A,V)									\
+        __UCLIBC_MUTEX_CONDITIONAL_LOCK(M,((A=(V)) == 0))
+
+#define __UCLIBC_MUTEX_AUTO_UNLOCK(M,A)									\
+        __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M,(A == 0))
+
+#define __UCLIBC_MUTEX_LOCK(M)										\
+        __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1)
+
+#define __UCLIBC_MUTEX_UNLOCK(M)									\
+        __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1)
+
+#ifdef __USE_STDIO_FUTEXES__
+
+#include <bits/stdio-lock.h>
+
+#define __UCLIBC_IO_MUTEX(M)			_IO_lock_t M
+#define __UCLIBC_IO_MUTEX_LOCK(M) 		_IO_lock_lock(M)
+#define __UCLIBC_IO_MUTEX_UNLOCK(M) 	_IO_lock_unlock(M)
+#define __UCLIBC_IO_MUTEX_TRYLOCK(M) 	_IO_lock_trylock(M)
+#define __UCLIBC_IO_MUTEX_INIT(M) 	_IO_lock_t M = _IO_lock_initializer
+#define __UCLIBC_IO_MUTEX_EXTERN(M)		extern _IO_lock_t M
+
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_LOCK(M,C)		\
+	if (C) {										\
+		_IO_lock_lock(M);							\
+	}
+
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK(M,C)	\
+	if (C) {										\
+		_IO_lock_unlock(M);							\
+	}
+
+#define __UCLIBC_IO_MUTEX_AUTO_LOCK(M,A,V)			\
+		__UCLIBC_IO_MUTEX_CONDITIONAL_LOCK(M,((A=(V))) == 0)
+
+#define __UCLIBC_IO_MUTEX_AUTO_UNLOCK(M,A)			\
+		__UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK(M,((A) == 0))
+
+#define __UCLIBC_IO_MUTEX_LOCK_CANCEL_UNSAFE(M)		_IO_lock_lock(M)
+#define __UCLIBC_IO_MUTEX_UNLOCK_CANCEL_UNSAFE(M) 	_IO_lock_unlock(M)
+
+#else /* of __USE_STDIO_FUTEXES__ */
+
+#define __UCLIBC_IO_MUTEX(M)                        __UCLIBC_MUTEX(M)
+#define __UCLIBC_IO_MUTEX_LOCK(M)                   __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_UNLOCK(M)                 __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_TRYLOCK(M)                __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_INIT(M)                   __UCLIBC_MUTEX_INIT(M, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __UCLIBC_IO_MUTEX_EXTERN(M)                 __UCLIBC_MUTEX_EXTERN(M)
+#define __UCLIBC_IO_MUTEX_AUTO_LOCK(M,A,V)          __UCLIBC_MUTEX_AUTO_LOCK(M,A,V)
+#define __UCLIBC_IO_MUTEX_AUTO_UNLOCK(M,A)          __UCLIBC_MUTEX_AUTO_UNLOCK(M,A)
+#define __UCLIBC_IO_MUTEX_LOCK_CANCEL_UNSAFE(M)     __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_UNLOCK_CANCEL_UNSAFE(M)   __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_LOCK(M,C)     __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK(M,C)   __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1)
+
+#endif /* of __USE_STDIO_FUTEXES__ */
+
+
+#else /* of __UCLIBC_HAS_THREADS__ */
+
+#define __UCLIBC_MUTEX(M)				void *__UCLIBC_MUTEX_DUMMY_ ## M
+#define __UCLIBC_MUTEX_INIT(M,I)			extern void *__UCLIBC_MUTEX_DUMMY_ ## M
+#define __UCLIBC_MUTEX_STATIC(M,I)			extern void *__UCLIBC_MUTEX_DUMMY_ ## M
+#define __UCLIBC_MUTEX_EXTERN(M)			extern void *__UCLIBC_MUTEX_DUMMY_ ## M
+
+#define __UCLIBC_MUTEX_INIT_VAR(M)					((void)0)
+#define __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE(M)		((void)0)
+#define __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE(M)		((void)0)
+#define __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE(M)		(0)	/* Always succeed? */
+
+#define __UCLIBC_MUTEX_CONDITIONAL_LOCK(M,C)		((void)0)
+#define __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M,C)		((void)0)
+
+#define __UCLIBC_MUTEX_AUTO_LOCK_VAR(A)			((void)0)
+#define __UCLIBC_MUTEX_AUTO_LOCK(M,A,V)			((void)0)
+#define __UCLIBC_MUTEX_AUTO_UNLOCK(M,A)			((void)0)
+
+#define __UCLIBC_MUTEX_LOCK(M)				((void)0)
+#define __UCLIBC_MUTEX_UNLOCK(M)			((void)0)
+
+#define __UCLIBC_IO_MUTEX(M)                        __UCLIBC_MUTEX(M)
+#define __UCLIBC_IO_MUTEX_LOCK(M)                   __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_UNLOCK(M)                 __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_TRYLOCK(M)                __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_INIT(M)                   __UCLIBC_MUTEX_INIT(M, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __UCLIBC_IO_MUTEX_EXTERN(M)                 __UCLIBC_MUTEX_EXTERN(M)
+#define __UCLIBC_IO_MUTEX_AUTO_LOCK(M,A,V)          __UCLIBC_MUTEX_AUTO_LOCK(M,A,V)
+#define __UCLIBC_IO_MUTEX_AUTO_UNLOCK(M,A)          __UCLIBC_MUTEX_AUTO_UNLOCK(M,A)
+#define __UCLIBC_IO_MUTEX_LOCK_CANCEL_UNSAFE(M)     __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_UNLOCK_CANCEL_UNSAFE(M)   __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_LOCK(M,C)     __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK(M,C)   __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1)
+
+#endif /* of __UCLIBC_HAS_THREADS__ */
+
+#define __UCLIBC_IO_MUTEX_TRYLOCK_CANCEL_UNSAFE(M)	\
+		__UCLIBC_IO_MUTEX_TRYLOCK(M)
+
+#endif /* _UCLIBC_MUTEX_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_page.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_page.h
new file mode 100644
index 0000000..1340945
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_page.h
@@ -0,0 +1,29 @@
+/*  Copyright (C) 2004     Erik Andersen
+ *
+ *  This 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.
+ */
+
+/* Supply an architecture specific value for PAGE_SIZE and friends.  */
+
+#ifndef _UCLIBC_PAGE_H
+#define _UCLIBC_PAGE_H
+
+/* PAGE_SHIFT determines the page size -- in this case 4096 */
+#define PAGE_SHIFT	12
+#define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#define PAGE_MASK	(~(PAGE_SIZE-1))
+
+#endif /* _UCLIBC_PAGE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_pthread.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_pthread.h
new file mode 100644
index 0000000..15aa1de
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_pthread.h
@@ -0,0 +1,51 @@
+/*  Copyright (C) 2003     Manuel Novoa III
+ *
+ *  This 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.
+ */
+
+/* Supply prototypes for the internal thread functions used by the
+ * uClibc library code.
+ */
+
+#ifndef _UCLIBC_PTHREAD_H
+#define _UCLIBC_PTHREAD_H
+
+#ifndef _PTHREAD_H
+# error "Always include <pthread.h> rather than <bits/uClibc_pthread.h>"
+#endif
+
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
+
+struct _pthread_cleanup_buffer;
+
+/* Threading functions internal to uClibc.  Make these thread functions
+ * weak so that we can elide them from single-threaded processes.  */
+extern int weak_function __pthread_mutex_init (pthread_mutex_t *__mutex,
+		__const pthread_mutexattr_t *__mutex_attr);
+extern int weak_function __pthread_mutex_destroy (pthread_mutex_t *__mutex);
+extern int weak_function __pthread_mutex_lock (pthread_mutex_t *__mutex);
+extern int weak_function __pthread_mutex_unlock (pthread_mutex_t *__mutex);
+extern int weak_function __pthread_mutex_trylock (pthread_mutex_t *__mutex);
+extern void weak_function _pthread_cleanup_push_defer (
+		struct _pthread_cleanup_buffer *__buffer,
+		void (*__routine) (void *), void *__arg);
+extern void weak_function _pthread_cleanup_pop_restore (
+		struct _pthread_cleanup_buffer *__buffer,
+		int __execute);
+
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h
new file mode 100644
index 0000000..a8cf4eb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h
@@ -0,0 +1,527 @@
+/* Copyright (C) 2002-2004   Manuel Novoa III    <mjn3@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#ifndef _STDIO_H
+#error Always include <stdio.h> rather than <bits/uClibc_stdio.h>
+#endif
+
+/**********************************************************************/
+
+#define __STDIO_BUFFERS
+/* ANSI/ISO mandate at least 256. */
+#if defined(__UCLIBC_HAS_STDIO_BUFSIZ_NONE__)
+/* Fake this because some apps use stdio.h BUFSIZ. */
+#define __STDIO_BUFSIZ			256
+#undef __STDIO_BUFFERS
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_256__)
+#define __STDIO_BUFSIZ			256
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_512__)
+#define __STDIO_BUFSIZ			512
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_1024__)
+#define __STDIO_BUFSIZ		   1024
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_2048__)
+#define __STDIO_BUFSIZ		   2048
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_4096__)
+#define __STDIO_BUFSIZ		   4096
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_8192__)
+#define __STDIO_BUFSIZ		   8192
+#else
+#error config seems to be out of sync regarding bufsiz options
+#endif
+
+#ifdef __UCLIBC_HAS_STDIO_BUFSIZ_NONE__
+#define __STDIO_BUILTIN_BUF_SIZE		0
+#else  /* __UCLIBC_HAS_STDIO_BUFSIZ_NONE__ */
+#if defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE__)
+#define __STDIO_BUILTIN_BUF_SIZE		0
+#elif defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4__)
+#define __STDIO_BUILTIN_BUF_SIZE		4
+#elif defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8__)
+#define __STDIO_BUILTIN_BUF_SIZE		8
+#else
+#error config seems to be out of sync regarding builtin buffer size
+#endif
+#endif
+
+#if defined(__STDIO_BUFFERS) || defined(__UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__) || defined(__UCLIBC_HAS_THREADS__)
+#define __STDIO_HAS_OPENLIST 1
+#else
+#undef __STDIO_HAS_OPENLIST
+#endif
+
+/**********************************************************************/
+/* Make sure defines related to large files are consistent. */
+#ifdef _LIBC
+
+#ifdef __UCLIBC_HAS_LFS__
+#undef __USE_LARGEFILE
+#undef __USE_LARGEFILE64
+#undef __USE_FILE_OFFSET64
+/* If we're actually building uClibc with large file support, only define... */
+#define __USE_LARGEFILE64	1
+#endif /* __UCLIBC_HAS_LFS__ */
+
+#else  /* not _LIBC */
+
+#ifndef __UCLIBC_HAS_LFS__
+#if defined(__LARGEFILE64_SOURCE) || defined(__USE_LARGEFILE64) || defined(__USE_FILE_OFFSET64)
+#error Sorry... uClibc was built without large file support!
+#endif
+#endif /* __UCLIBC_HAS_LFS__ */
+
+#endif /* _LIBC */
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_WCHAR__
+
+#define __need_wchar_t
+#include <stddef.h>
+
+/* Note: we don't really need mbstate for 8-bit locales.  We do for UTF-8.
+ * For now, always use it. */
+#define __STDIO_MBSTATE
+#define __need_mbstate_t
+#include <wchar.h>
+
+#endif
+/**********************************************************************/
+/* Currently unimplemented/untested */
+/* #define __STDIO_FLEXIBLE_SETVBUF */
+
+#ifdef __UCLIBC_HAS_STDIO_GETC_MACRO__
+#define __STDIO_GETC_MACRO
+#endif
+
+#ifdef __UCLIBC_HAS_STDIO_PUTC_MACRO__
+#define __STDIO_PUTC_MACRO
+#endif
+
+
+/* These are consistency checks on the different options */
+
+#ifndef __STDIO_BUFFERS
+#undef __STDIO_GETC_MACRO
+#undef __STDIO_PUTC_MACRO
+#endif
+
+#ifdef __BCC__
+#undef __UCLIBC_HAS_LFS__
+#endif
+
+#ifndef __UCLIBC_HAS_LFS__
+#undef __UCLIBC_HAS_FOPEN_LARGEFILE_MODE__
+#endif
+
+/**********************************************************************/
+#include <bits/uClibc_mutex.h>
+
+/* user_locking
+ * 0 : do auto locking/unlocking
+ * 1 : user does locking/unlocking
+ * 2 : initial state prior to thread initialization
+ *     with no auto locking/unlocking
+ *
+ * When threading is initialized, walk the stdio open stream list
+ * and do  "if (user_locking == 2) user_locking = 0;".
+ *
+ * This way, we avoid calling the weak lock/unlock functions.
+ */
+
+#define __STDIO_AUTO_THREADLOCK_VAR						\
+        __UCLIBC_MUTEX_AUTO_LOCK_VAR(__infunc_user_locking)
+
+#define __STDIO_AUTO_THREADLOCK(__stream)					\
+        __UCLIBC_IO_MUTEX_AUTO_LOCK((__stream)->__lock, __infunc_user_locking,	\
+	(__stream)->__user_locking)
+
+#define __STDIO_AUTO_THREADUNLOCK(__stream)					\
+        __UCLIBC_IO_MUTEX_AUTO_UNLOCK((__stream)->__lock, __infunc_user_locking)
+
+#define __STDIO_ALWAYS_THREADLOCK(__stream)					\
+        __UCLIBC_IO_MUTEX_LOCK((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADUNLOCK(__stream)					\
+        __UCLIBC_IO_MUTEX_UNLOCK((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADLOCK_CANCEL_UNSAFE(__stream)			\
+        __UCLIBC_IO_MUTEX_LOCK_CANCEL_UNSAFE((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADTRYLOCK_CANCEL_UNSAFE(__stream)			\
+        __UCLIBC_IO_MUTEX_TRYLOCK_CANCEL_UNSAFE((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADUNLOCK_CANCEL_UNSAFE(__stream)			\
+        __UCLIBC_IO_MUTEX_UNLOCK_CANCEL_UNSAFE((__stream)->__lock)
+
+#ifdef __UCLIBC_HAS_THREADS__
+#define __STDIO_SET_USER_LOCKING(__stream)	((__stream)->__user_locking = 1)
+#else
+#define __STDIO_SET_USER_LOCKING(__stream)		((void)0)
+#endif
+
+#ifdef __UCLIBC_HAS_THREADS__
+#ifdef __USE_STDIO_FUTEXES__
+#define STDIO_INIT_MUTEX(M) _IO_lock_init(M)
+#else
+#define STDIO_INIT_MUTEX(M) __stdio_init_mutex(& M)
+#endif
+#endif
+
+/**********************************************************************/
+
+#define __STDIO_IOFBF 0		/* Fully buffered.  */
+#define __STDIO_IOLBF 1		/* Line buffered.  */
+#define __STDIO_IONBF 2		/* No buffering.  */
+
+typedef struct {
+	__off_t __pos;
+#ifdef __STDIO_MBSTATE
+	__mbstate_t __mbstate;
+#endif
+#ifdef __UCLIBC_HAS_WCHAR__
+	int __mblen_pending;
+#endif
+} __STDIO_fpos_t;
+
+#ifdef __UCLIBC_HAS_LFS__
+typedef struct {
+	__off64_t __pos;
+#ifdef __STDIO_MBSTATE
+	__mbstate_t __mbstate;
+#endif
+#ifdef __UCLIBC_HAS_WCHAR__
+	int __mblen_pending;
+#endif
+} __STDIO_fpos64_t;
+#endif
+
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_LFS__
+typedef __off64_t __offmax_t;		/* TODO -- rename this? */
+#else
+typedef __off_t __offmax_t;		/* TODO -- rename this? */
+#endif
+
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
+
+typedef __ssize_t __io_read_fn(void *__cookie, char *__buf, size_t __bufsize);
+typedef __ssize_t __io_write_fn(void *__cookie,
+					__const char *__buf, size_t __bufsize);
+/* NOTE: GLIBC difference!!! -- fopencookie seek function
+ * For glibc, the type of pos is always (__off64_t *) but in our case
+ * it is type (__off_t *) when the lib is built without large file support.
+ */
+typedef int __io_seek_fn(void *__cookie, __offmax_t *__pos, int __whence);
+typedef int __io_close_fn(void *__cookie);
+
+typedef struct {
+	__io_read_fn  *read;
+	__io_write_fn *write;
+	__io_seek_fn  *seek;
+	__io_close_fn *close;
+} _IO_cookie_io_functions_t;
+
+#if defined(_LIBC) || defined(_GNU_SOURCE)
+
+typedef __io_read_fn cookie_read_function_t;
+typedef __io_write_fn cookie_write_function_t;
+typedef __io_seek_fn cookie_seek_function_t;
+typedef __io_close_fn cookie_close_function_t;
+
+typedef _IO_cookie_io_functions_t cookie_io_functions_t;
+
+#endif
+
+#endif
+/**********************************************************************/
+
+struct __STDIO_FILE_STRUCT {
+	unsigned short __modeflags;
+	/* There could be a hole here, but modeflags is used most.*/
+#ifdef __UCLIBC_HAS_WCHAR__
+	unsigned char __ungot_width[2]; /* 0: current (building) char; 1: scanf */
+	/* Move the following futher down to avoid problems with getc/putc
+	 * macros breaking shared apps when wchar config support is changed. */
+	/* wchar_t ungot[2]; */
+#else  /* __UCLIBC_HAS_WCHAR__ */
+	unsigned char __ungot[2];
+#endif /* __UCLIBC_HAS_WCHAR__ */
+	int __filedes;
+#ifdef __STDIO_BUFFERS
+	unsigned char *__bufstart;	/* pointer to buffer */
+	unsigned char *__bufend;	/* pointer to 1 past end of buffer */
+	unsigned char *__bufpos;
+	unsigned char *__bufread; /* pointer to 1 past last buffered read char */
+
+#ifdef __STDIO_GETC_MACRO
+	unsigned char *__bufgetc_u;	/* 1 past last readable by getc_unlocked */
+#endif /* __STDIO_GETC_MACRO */
+#ifdef __STDIO_PUTC_MACRO
+	unsigned char *__bufputc_u;	/* 1 past last writeable by putc_unlocked */
+#endif /* __STDIO_PUTC_MACRO */
+
+#endif /* __STDIO_BUFFERS */
+
+#ifdef __STDIO_HAS_OPENLIST
+	struct __STDIO_FILE_STRUCT *__nextopen;
+#endif
+#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
+	void *__cookie;
+	_IO_cookie_io_functions_t __gcs;
+#endif
+#ifdef __UCLIBC_HAS_WCHAR__
+	wchar_t __ungot[2];
+#endif
+#ifdef __STDIO_MBSTATE
+	__mbstate_t __state;
+#endif
+#ifdef __UCLIBC_HAS_XLOCALE__
+	void *__unused;				/* Placeholder for codeset binding. */
+#endif
+#ifdef __UCLIBC_HAS_THREADS__
+	int __user_locking;
+	__UCLIBC_IO_MUTEX(__lock);
+#endif
+/* Everything after this is unimplemented... and may be trashed. */
+#if __STDIO_BUILTIN_BUF_SIZE > 0
+	unsigned char __builtinbuf[__STDIO_BUILTIN_BUF_SIZE];
+#endif /* __STDIO_BUILTIN_BUF_SIZE > 0 */
+};
+
+
+/***********************************************************************/
+/* Having ungotten characters implies the stream is reading.
+ * The scheme used here treats the least significant 2 bits of
+ * the stream's modeflags member as follows:
+ *   0 0   Not currently reading.
+ *   0 1   Reading, but no ungetc() or scanf() push back chars.
+ *   1 0   Reading with one ungetc() char (ungot[1] is 1)
+ *         or one scanf() pushed back char (ungot[1] is 0).
+ *   1 1   Reading with both an ungetc() char and a scanf()
+ *         pushed back char.  Note that this must be the result
+ *         of a scanf() push back (in ungot[0]) _followed_ by
+ *         an ungetc() call (in ungot[1]).
+ *
+ * Notes:
+ *   scanf() can NOT use ungetc() to push back characters.
+ *     (See section 7.19.6.2 of the C9X rationale -- WG14/N897.)
+ */
+
+#define __MASK_READING		0x0003U /* (0x0001 | 0x0002) */
+#define __FLAG_READING		0x0001U
+#define __FLAG_UNGOT		0x0002U
+#define __FLAG_EOF		0x0004U
+#define __FLAG_ERROR		0x0008U
+#define __FLAG_WRITEONLY	0x0010U
+#define __FLAG_READONLY		0x0020U /* (__FLAG_WRITEONLY << 1) */
+#define __FLAG_WRITING		0x0040U
+#define __FLAG_NARROW		0x0080U
+
+#define __FLAG_FBF		0x0000U /* must be 0 */
+#define __FLAG_LBF		0x0100U
+#define __FLAG_NBF		0x0200U /* (__FLAG_LBF << 1) */
+#define __MASK_BUFMODE		0x0300U /* (__FLAG_LBF|__FLAG_NBF) */
+#define __FLAG_APPEND		0x0400U /* fixed! == O_APPEND for linux */
+#define __FLAG_WIDE		0x0800U
+/* available slot		0x1000U */
+#define __FLAG_FREEFILE		0x2000U
+#define __FLAG_FREEBUF		0x4000U
+#define __FLAG_LARGEFILE	0x8000U /* fixed! == 0_LARGEFILE for linux */
+#define __FLAG_FAILED_FREOPEN	__FLAG_LARGEFILE
+
+/* Note: In no-buffer mode, it would be possible to pack the necessary
+ * flags into one byte.  Since we wouldn't be buffering and there would
+ * be no support for wchar, the only flags we would need would be:
+ *   2 bits : ungot count
+ *   2 bits : eof + error
+ *   2 bits : readonly + writeonly
+ *   1 bit  : freefile
+ *   1 bit  : appending
+ * So, for a very small system (< 128 files) we might have a
+ * 4-byte FILE struct of:
+ *   unsigned char flags;
+ *   signed char filedes;
+ *   unsigned char ungot[2];
+ */
+/**********************************************************************
+ * PROTOTYPES OF INTERNAL FUNCTIONS
+ **********************************************************************/
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
+
+extern void _stdio_init(void) attribute_hidden;
+extern void _stdio_term(void) attribute_hidden;
+
+#ifdef __STDIO_HAS_OPENLIST
+
+extern struct __STDIO_FILE_STRUCT *_stdio_openlist;
+
+#ifdef __UCLIBC_HAS_THREADS__
+__UCLIBC_IO_MUTEX_EXTERN(_stdio_openlist_add_lock);
+#ifdef __STDIO_BUFFERS
+__UCLIBC_IO_MUTEX_EXTERN(_stdio_openlist_del_lock);
+extern volatile int _stdio_openlist_use_count; /* _stdio_openlist_del_lock */
+extern int _stdio_openlist_del_count; /* _stdio_openlist_del_lock */
+#endif
+extern int _stdio_user_locking;
+extern void __stdio_init_mutex(__UCLIBC_MUTEX_TYPE *m) attribute_hidden;
+#endif
+
+#endif
+
+#endif
+/**********************************************************************/
+
+#define __CLEARERR_UNLOCKED(__stream)					\
+	((void)((__stream)->__modeflags &= ~(__FLAG_EOF|__FLAG_ERROR)))
+#define __FEOF_UNLOCKED(__stream)	((__stream)->__modeflags & __FLAG_EOF)
+#define __FERROR_UNLOCKED(__stream)	((__stream)->__modeflags & __FLAG_ERROR)
+
+#ifdef __UCLIBC_HAS_THREADS__
+# define __CLEARERR(__stream)		(clearerr)(__stream)
+# define __FERROR(__stream)		(ferror)(__stream)
+# define __FEOF(__stream)		(feof)(__stream)
+#else
+# define __CLEARERR(__stream)		__CLEARERR_UNLOCKED(__stream)
+# define __FERROR(__stream)		__FERROR_UNLOCKED(__stream)
+# define __FEOF(__stream)		__FEOF_UNLOCKED(__stream)
+#endif
+
+extern int __fgetc_unlocked(FILE *__stream);
+libc_hidden_proto(__fgetc_unlocked)
+extern int __fputc_unlocked(int __c, FILE *__stream);
+libc_hidden_proto(__fputc_unlocked)
+
+/* First define the default definitions.
+   They are overridden below as necessary. */
+#define __FGETC_UNLOCKED(__stream)		(__fgetc_unlocked)((__stream))
+#define __FGETC(__stream)			(fgetc)((__stream))
+#define __GETC_UNLOCKED_MACRO(__stream)		(__fgetc_unlocked)((__stream))
+#define __GETC_UNLOCKED(__stream)		(__fgetc_unlocked)((__stream))
+#define __GETC(__stream)			(fgetc)((__stream))
+
+#define __FPUTC_UNLOCKED(__c, __stream)		(__fputc_unlocked)((__c),(__stream))
+#define __FPUTC(__c, __stream)			(fputc)((__c),(__stream))
+#define __PUTC_UNLOCKED_MACRO(__c, __stream)	(__fputc_unlocked)((__c),(__stream))
+#define __PUTC_UNLOCKED(__c, __stream)		(__fputc_unlocked)((__c),(__stream))
+#define __PUTC(__c, __stream)			(fputc)((__c),(__stream))
+
+
+#ifdef __STDIO_GETC_MACRO
+
+extern FILE *__stdin;			/* For getchar() macro. */
+
+# undef  __GETC_UNLOCKED_MACRO
+# define __GETC_UNLOCKED_MACRO(__stream)				\
+		( ((__stream)->__bufpos < (__stream)->__bufgetc_u)	\
+		  ? (*(__stream)->__bufpos++)				\
+		  : __fgetc_unlocked(__stream) )
+
+# if 0
+	/* Classic macro approach.  getc{_unlocked} can have side effects. */
+#  undef  __GETC_UNLOCKED
+#  define __GETC_UNLOCKED(__stream)		__GETC_UNLOCKED_MACRO((__stream))
+#  ifndef __UCLIBC_HAS_THREADS__
+#   undef  __GETC
+#   define __GETC(__stream)				__GETC_UNLOCKED_MACRO((__stream))
+#  endif
+
+# else
+	/* Using gcc extension for safety and additional inlining. */
+#  undef  __FGETC_UNLOCKED
+#  define __FGETC_UNLOCKED(__stream)					\
+		(__extension__ ({					\
+			FILE *__S = (__stream);				\
+			__GETC_UNLOCKED_MACRO(__S);			\
+		}) )
+
+#  undef  __GETC_UNLOCKED
+#  define __GETC_UNLOCKED(__stream)		__FGETC_UNLOCKED((__stream))
+
+#  ifdef __UCLIBC_HAS_THREADS__
+#   undef  __FGETC
+#   define __FGETC(__stream)						\
+		(__extension__ ({					\
+			FILE *__S = (__stream);				\
+			((__S->__user_locking )				\
+			 ? __GETC_UNLOCKED_MACRO(__S)			\
+			 : (fgetc)(__S));				\
+		}) )
+
+#   undef  __GETC
+#   define __GETC(__stream)			__FGETC((__stream))
+
+#  else
+
+#   undef  __FGETC
+#   define __FGETC(__stream)			__FGETC_UNLOCKED((__stream))
+#   undef  __GETC
+#   define __GETC(__stream)			__FGETC_UNLOCKED((__stream))
+
+#  endif
+# endif
+
+#else
+
+#endif /* __STDIO_GETC_MACRO */
+
+
+#ifdef __STDIO_PUTC_MACRO
+
+extern FILE *__stdout;			/* For putchar() macro. */
+
+# undef  __PUTC_UNLOCKED_MACRO
+# define __PUTC_UNLOCKED_MACRO(__c, __stream)				\
+		( ((__stream)->__bufpos < (__stream)->__bufputc_u)	\
+		  ? (*(__stream)->__bufpos++) = (__c)			\
+		  : __fputc_unlocked((__c),(__stream)) )
+
+# if 0
+	/* Classic macro approach.  putc{_unlocked} can have side effects.*/
+#  undef  __PUTC_UNLOCKED
+#  define __PUTC_UNLOCKED(__c, __stream)				\
+					__PUTC_UNLOCKED_MACRO((__c), (__stream))
+#  ifndef __UCLIBC_HAS_THREADS__
+#   undef  __PUTC
+#   define __PUTC(__c, __stream)	__PUTC_UNLOCKED_MACRO((__c), (__stream))
+#  endif
+
+# else
+	/* Using gcc extension for safety and additional inlining. */
+
+#  undef  __FPUTC_UNLOCKED
+#  define __FPUTC_UNLOCKED(__c, __stream)				\
+		(__extension__ ({					\
+			FILE *__S = (__stream);				\
+			__PUTC_UNLOCKED_MACRO((__c),__S);		\
+		}) )
+
+#  undef  __PUTC_UNLOCKED
+#  define __PUTC_UNLOCKED(__c, __stream)	__FPUTC_UNLOCKED((__c), (__stream))
+
+#  ifdef __UCLIBC_HAS_THREADS__
+#   undef  __FPUTC
+#   define __FPUTC(__c, __stream)					\
+		(__extension__ ({					\
+			FILE *__S = (__stream);				\
+			((__S->__user_locking)				\
+			 ? __PUTC_UNLOCKED_MACRO((__c),__S)		\
+			 : (fputc)((__c),__S));				\
+		}) )
+
+#   undef  __PUTC
+#   define __PUTC(__c, __stream)		__FPUTC((__c), (__stream))
+
+#  else
+
+#   undef  __FPUTC
+#   define __FPUTC(__c, __stream)		__FPUTC_UNLOCKED((__c),(__stream))
+#   undef  __PUTC
+#   define __PUTC(__c, __stream)		__FPUTC_UNLOCKED((__c),(__stream))
+
+#  endif
+# endif
+
+#endif /* __STDIO_PUTC_MACRO */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
new file mode 100644
index 0000000..a65d613
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
@@ -0,0 +1,55 @@
+/*  Copyright (C) 2003     Manuel Novoa III
+ *
+ *  This 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.
+ */
+
+/*  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!
+ *
+ *  Besides uClibc, I'm using this code in my libc for elks, which is
+ *  a 16-bit environment with a fairly limited compiler.  It would make
+ *  things much easier for me if this file isn't modified unnecessarily.
+ *  In particular, please put any new or replacement functions somewhere
+ *  else, and modify the makefile to use your version instead.
+ *  Thanks.  Manuel
+ *
+ *  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION! */
+
+#ifndef _UCLIBC_TOUPLOW_H
+#define _UCLIBC_TOUPLOW_H
+
+#include <features.h>
+#include <bits/types.h>
+
+/* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
+
+typedef __uint16_t __ctype_mask_t;
+
+#ifdef __UCLIBC_HAS_CTYPE_SIGNED__
+
+typedef __int16_t __ctype_touplow_t;
+#define __UCLIBC_CTYPE_B_TBL_OFFSET       128
+#define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
+
+#else
+
+typedef unsigned char __ctype_touplow_t;
+#define __UCLIBC_CTYPE_B_TBL_OFFSET       1
+#define __UCLIBC_CTYPE_TO_TBL_OFFSET      0
+
+#endif
+
+#endif /* _UCLIBC_TOUPLOW_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uintmaxtostr.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uintmaxtostr.h
new file mode 100644
index 0000000..92633ff
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uintmaxtostr.h
@@ -0,0 +1,116 @@
+/*  Copyright (C) 2003     Manuel Novoa III
+ *
+ *  This 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.
+ */
+
+/*  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!
+ *
+ *  This code is currently under development.  Also, I plan to port
+ *  it to elks which is a 16-bit environment with a fairly limited
+ *  compiler.  Therefore, please refrain from modifying this code
+ *  and, instead, pass any bug-fixes, etc. to me.  Thanks.  Manuel
+ *
+ *  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION! */
+
+#ifndef _UINTMAXTOSTR_H
+#define _UINTMAXTOSTR_H 1
+
+#ifdef _FEATURES_H
+# ifndef __USE_ISOC99
+#  error features was included without defining _ISOC99_SOURCE!
+# endif
+#else
+# ifndef _ISOC99_SOURCE
+#  define _ISOC99_SOURCE
+# endif
+#endif
+
+#include <features.h>
+#include <limits.h>
+#include <stdint.h>
+
+#if INTMAX_MAX <= 2147483647L
+#define __UIM_BUFLEN			12 /* 10 digits + 1 nul + 1 sign */
+#elif INTMAX_MAX <= 9223372036854775807LL
+#define __UIM_BUFLEN			22 /* 20 digits + 1 nul + 1 sign */
+#else
+#error unknown number of digits for intmax_t!
+#endif
+
+#ifdef LLONG_MAX				/* --------------- */
+#if LLONG_MAX <= 2147483647L
+#define __UIM_BUFLEN_LLONG		12 /* 10 digits + 1 nul + 1 sign */
+#elif LLONG_MAX <= 9223372036854775807LL
+#define __UIM_BUFLEN_LLONG		22 /* 20 digits + 1 nul + 1 sign */
+#else
+#error unknown number of digits for long long!
+#endif
+#endif /* ULLONG_MAX ----------------------------- */
+
+#if LONG_MAX <= 2147483647L
+#define __UIM_BUFLEN_LONG		12 /* 10 digits + 1 nul + 1 sign */
+#elif LONG_MAX <= 9223372036854775807LL
+#define __UIM_BUFLEN_LONG		22 /* 20 digits + 1 nul + 1 sign */
+#else
+#error unknown number of digits for long!
+#endif
+
+#if INT_MAX <= 32767
+#define __UIM_BUFLEN_INT		7 /* 10 digits + 1 nul + 1 sign */
+#elif INT_MAX <= 2147483647L
+#define __UIM_BUFLEN_INT		12 /* 10 digits + 1 nul + 1 sign */
+#else
+#error unknown number of digits for int!
+#endif
+
+typedef enum {
+	__UIM_DECIMAL = 0,
+	__UIM_GROUP = ',',			/* Base 10 locale-dependent grouping. */
+	__UIM_LOWER = 'a' - 10,
+	__UIM_UPPER = 'A' - 10,
+} __UIM_CASE;
+
+/* Convert the int val to a string in base abs(base).  val is treated as
+ * an unsigned ??? int type if base > 0, and signed if base < 0.  This
+ * is an internal function with _no_ error checking done unless assert()s
+ * are enabled.
+ *
+ * Note: bufend is a pointer to the END of the buffer passed.
+ * Call like this:
+ *     char buf[SIZE], *p;
+ *     p = _xltostr(buf + sizeof(buf) - 1, {unsigned int},  10, __UIM_DECIMAL)
+ *     p = _xltostr(buf + sizeof(buf) - 1,          {int}, -10, __UIM_DECIMAL)
+ *
+ * WARNING: If base > 10, case _must_be_ either __UIM_LOWER or __UIM_UPPER
+ *          for lower and upper case alphas respectively.
+ * WARNING: If val is really a signed type, make sure base is negative!
+ *          Otherwise, you could overflow your buffer.
+ */
+extern char *_uintmaxtostr(char * __restrict bufend, uintmax_t uval,
+					int base, __UIM_CASE alphacase) attribute_hidden;
+
+/* TODO -- make this either a (possibly inline) function? */
+#ifndef __BCC__
+#define _int10tostr(bufend, intval) \
+	_uintmaxtostr((bufend), (intval), -10, __UIM_DECIMAL)
+#else  /* bcc doesn't do prototypes, we need to explicitly cast */
+#define _int10tostr(bufend, intval) \
+	_uintmaxtostr((bufend), (uintmax_t)(intval), -10, __UIM_DECIMAL)
+#endif
+
+#define __BUFLEN_INT10TOSTR		__UIM_BUFLEN_INT
+
+#endif /* _UINTMAXTOSTR_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uwchar.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uwchar.h
new file mode 100644
index 0000000..ba2c42d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uwchar.h
@@ -0,0 +1,57 @@
+/*  Copyright (C) 2003     Manuel Novoa III
+ *
+ *  This 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.
+ */
+
+/*  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!
+ *
+ *  Besides uClibc, I'm using this code in my libc for elks, which is
+ *  a 16-bit environment with a fairly limited compiler.  It would make
+ *  things much easier for me if this file isn't modified unnecessarily.
+ *  In particular, please put any new or replacement functions somewhere
+ *  else, and modify the makefile to use your version instead.
+ *  Thanks.  Manuel
+ *
+ *  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION! */
+
+
+/*  Define an internal unsigned int type __uwchar_t just large enough
+ *  to hold a wchar_t.
+ */
+
+#ifndef _UCLIBC_UWCHAR_H
+#define _UCLIBC_UWCHAR_H
+
+#include <limits.h>
+#include <stdint.h>
+
+#if WCHAR_MIN == 0
+typedef wchar_t				__uwchar_t;
+#elif WCHAR_MAX <= USHRT_MAX
+typedef unsigned short		__uwchar_t;
+#elif WCHAR_MAX <= UINT_MAX
+typedef unsigned int		__uwchar_t;
+#elif WCHAR_MAX <= ULONG_MAX
+typedef unsigned long		__uwchar_t;
+#elif defined(ULLONG_MAX) && (WCHAR_MAX <= ULLONG_MAX)
+typedef unsigned long long	__uwchar_t;
+#elif WCHAR_MAX <= UINTMAX_MAX
+typedef uintmax_t			__uwchar_t;
+#else
+#error Can not determine an appropriate type for __uwchar_t!
+#endif
+
+#endif /* _UCLIBC_UWCHAR_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_va_copy.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_va_copy.h
new file mode 100644
index 0000000..98663fc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_va_copy.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 2005       Manuel Novoa III    <mjn3@codepoet.org>
+ *
+ * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
+ *
+ *  This 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 _UCLIBC_VA_COPY_H
+#define _UCLIBC_VA_COPY_H 1
+
+#include <stdarg.h>
+
+/* Deal with pre-C99 compilers. */
+#ifndef va_copy
+
+#ifdef __va_copy
+#define va_copy(A,B)	__va_copy(A,B)
+#else
+#warning Neither va_copy (C99/SUSv3) or __va_copy is defined.  Using a simple copy instead.  But you should really check that this is appropriate and supply an arch-specific override if necessary.
+	/* the glibc manual suggests that this will usually suffice when
+        __va_copy doesn't exist.  */
+#define va_copy(A,B)	A = B
+#endif
+
+#endif /* va_copy */
+
+#endif /* _UCLIBC_VA_COPY_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uio.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uio.h
new file mode 100644
index 0000000..87f916d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uio.h
@@ -0,0 +1,51 @@
+/* Copyright (C) 1996, 1997, 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.  */
+
+#if !defined _SYS_UIO_H && !defined _FCNTL_H
+# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
+#endif
+
+#ifndef _BITS_UIO_H
+#define _BITS_UIO_H	1
+
+#include <sys/types.h>
+
+
+/* We should normally use the Linux kernel header file to define this
+   type and macros but this calls for trouble because of the header
+   includes other kernel headers.  */
+
+/* Size of object which can be written atomically.
+
+   This macro has different values in different kernel versions.  The
+   latest versions of the kernel use 1024 and this is good choice.  Since
+   the C library implementation of readv/writev is able to emulate the
+   functionality even if the currently running kernel does not support
+   this large value the readv/writev call will not fail because of this.  */
+#define UIO_MAXIOV	1024
+#define UIO_FASTIOV    8
+
+
+/* Structure for scatter/gather I/O.  */
+struct iovec
+  {
+    void *iov_base;	/* Pointer to data.  */
+    size_t iov_len;	/* Length of data.  */
+  };
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/ustat.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ustat.h
new file mode 100644
index 0000000..69c6b72
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ustat.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 1997, 2002 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_USTAT_H
+# error "Never include <bits/ustat.h> directly; use <sys/ustat.h> instead."
+#endif
+
+#include <sys/types.h>
+
+struct ustat
+  {
+    __daddr_t f_tfree;		/* Number of free blocks.  */
+    __ino_t f_tinode;		/* Number of free inodes.  */
+    char f_fname[6];
+    char f_fpack[6];
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmp.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmp.h
new file mode 100644
index 0000000..e855ad7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmp.h
@@ -0,0 +1,125 @@
+/* The `struct utmp' type, describing entries in the utmp file.  GNU version.
+   Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002
+   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 _UTMP_H
+# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
+#endif
+
+#include <paths.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <bits/wordsize.h>
+
+
+#define UT_LINESIZE	32
+#define UT_NAMESIZE	32
+#define UT_HOSTSIZE	256
+
+
+/* The structure describing an entry in the database of
+   previous logins.  */
+struct lastlog
+  {
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+    int32_t ll_time;
+#else
+    __time_t ll_time;
+#endif
+    char ll_line[UT_LINESIZE];
+    char ll_host[UT_HOSTSIZE];
+  };
+
+
+/* The structure describing the status of a terminated process.  This
+   type is used in `struct utmp' below.  */
+struct exit_status
+  {
+    short int e_termination;	/* Process termination status.  */
+    short int e_exit;		/* Process exit status.  */
+  };
+
+
+/* The structure describing an entry in the user accounting database.  */
+struct utmp
+{
+  short int ut_type;		/* Type of login.  */
+  pid_t ut_pid;			/* Process ID of login process.  */
+  char ut_line[UT_LINESIZE];	/* Devicename.  */
+  char ut_id[4];		/* Inittab ID.  */
+  char ut_user[UT_NAMESIZE];	/* Username.  */
+  char ut_host[UT_HOSTSIZE];	/* Hostname for remote login.  */
+  struct exit_status ut_exit;	/* Exit status of a process marked
+				   as DEAD_PROCESS.  */
+/* The ut_session and ut_tv fields must be the same size when compiled
+   32- and 64-bit.  This allows data files and shared memory to be
+   shared between 32- and 64-bit applications.  */
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+  int32_t ut_session;		/* Session ID, used for windowing.  */
+  struct
+  {
+    int32_t tv_sec;		/* Seconds.  */
+    int32_t tv_usec;		/* Microseconds.  */
+  } ut_tv;			/* Time entry was made.  */
+#else
+  long int ut_session;		/* Session ID, used for windowing.  */
+  struct timeval ut_tv;		/* Time entry was made.  */
+#endif
+
+  int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
+  char __unused[20];		/* Reserved for future use.  */
+};
+
+/* Backwards compatibility hacks.  */
+#define ut_name		ut_user
+#ifndef _NO_UT_TIME
+/* We have a problem here: `ut_time' is also used otherwise.  Define
+   _NO_UT_TIME if the compiler complains.  */
+# define ut_time	ut_tv.tv_sec
+#endif
+#define ut_xtime	ut_tv.tv_sec
+#define ut_addr		ut_addr_v6[0]
+
+
+/* Values for the `ut_type' field of a `struct utmp'.  */
+#define EMPTY		0	/* No valid user accounting information.  */
+
+#define RUN_LVL		1	/* The system's runlevel.  */
+#define BOOT_TIME	2	/* Time of system boot.  */
+#define NEW_TIME	3	/* Time after system clock changed.  */
+#define OLD_TIME	4	/* Time when system clock changed.  */
+
+#define INIT_PROCESS	5	/* Process spawned by the init process.  */
+#define LOGIN_PROCESS	6	/* Session leader of a logged in user.  */
+#define USER_PROCESS	7	/* Normal process.  */
+#define DEAD_PROCESS	8	/* Terminated process.  */
+
+#define ACCOUNTING	9
+
+/* Old Linux name for the EMPTY type.  */
+#define UT_UNKNOWN	EMPTY
+
+
+/* Tell the user that we have a modern system with UT_HOST, UT_PID,
+   UT_TYPE, UT_ID and UT_TV fields.  */
+#define _HAVE_UT_TYPE	1
+#define _HAVE_UT_PID	1
+#define _HAVE_UT_ID	1
+#define _HAVE_UT_TV	1
+#define _HAVE_UT_HOST	1
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmpx.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmpx.h
new file mode 100644
index 0000000..c84cda6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmpx.h
@@ -0,0 +1,103 @@
+/* Structures and definitions for the user accounting database.  GNU version.
+   Copyright (C) 1997, 1998, 2000, 2001, 2002 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 _UTMPX_H
+# error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <sys/time.h>
+#include <bits/wordsize.h>
+
+
+#ifdef __USE_GNU
+# include <paths.h>
+# define _PATH_UTMPX	_PATH_UTMP
+# define _PATH_WTMPX	_PATH_WTMP
+#endif
+
+
+#define __UT_LINESIZE	32
+#define __UT_NAMESIZE	32
+#define __UT_HOSTSIZE	256
+
+
+/* The structure describing the status of a terminated process.  This
+   type is used in `struct utmpx' below.  */
+struct __exit_status
+  {
+#ifdef __USE_GNU
+    short int e_termination;	/* Process termination status.  */
+    short int e_exit;		/* Process exit status.  */
+#else
+    short int __e_termination;	/* Process termination status.  */
+    short int __e_exit;		/* Process exit status.  */
+#endif
+  };
+
+
+/* The structure describing an entry in the user accounting database.  */
+struct utmpx
+{
+  short int ut_type;		/* Type of login.  */
+  __pid_t ut_pid;		/* Process ID of login process.  */
+  char ut_line[__UT_LINESIZE];	/* Devicename.  */
+  char ut_id[4];		/* Inittab ID. */
+  char ut_user[__UT_NAMESIZE];	/* Username.  */
+  char ut_host[__UT_HOSTSIZE];	/* Hostname for remote login.  */
+  struct __exit_status ut_exit;	/* Exit status of a process marked
+				   as DEAD_PROCESS.  */
+
+/* The fields ut_session and ut_tv must be the same size when compiled
+   32- and 64-bit.  This allows files and shared memory to be shared
+   between 32- and 64-bit applications.  */
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+  __int32_t ut_session;		/* Session ID, used for windowing.  */
+  struct
+  {
+    __int32_t tv_sec;		/* Seconds.  */
+    __int32_t tv_usec;		/* Microseconds.  */
+  } ut_tv;			/* Time entry was made.  */
+#else
+  long int ut_session;		/* Session ID, used for windowing.  */
+  struct timeval ut_tv;		/* Time entry was made.  */
+#endif
+  __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
+  char __unused[20];		/* Reserved for future use.  */
+};
+
+
+/* Values for the `ut_type' field of a `struct utmpx'.  */
+#define EMPTY		0	/* No valid user accounting information.  */
+
+#ifdef __USE_GNU
+# define RUN_LVL	1	/* The system's runlevel.  */
+#endif
+#define BOOT_TIME	2	/* Time of system boot.  */
+#define NEW_TIME	3	/* Time after system clock changed.  */
+#define OLD_TIME	4	/* Time when system clock changed.  */
+
+#define INIT_PROCESS	5	/* Process spawned by the init process.  */
+#define LOGIN_PROCESS	6	/* Session leader of a logged in user.  */
+#define USER_PROCESS	7	/* Normal process.  */
+#define DEAD_PROCESS	8	/* Terminated process.  */
+
+#ifdef __USE_GNU
+# define ACCOUNTING	9	/* System accounting.  */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/utsname.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utsname.h
new file mode 100644
index 0000000..35e71e3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utsname.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 1995, 1996, 1997 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_UTSNAME_H
+# error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
+#endif
+
+/* Length of the entries in `struct utsname' is 65.  */
+#define _UTSNAME_LENGTH 65
+
+/* Linux provides as additional information in the `struct utsname'
+   the name of the current domain.  Define _UTSNAME_DOMAIN_LENGTH
+   to a value != 0 to activate this entry.  */
+#define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitflags.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitflags.h
new file mode 100644
index 0000000..464cedb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitflags.h
@@ -0,0 +1,38 @@
+/* Definitions of flag bits for `waitpid' et al.
+   Copyright (C) 1992,1996,1997,2000,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 _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Bits in the third argument to `waitpid'.  */
+#define	WNOHANG		1	/* Don't block waiting.  */
+#define	WUNTRACED	2	/* Report status of stopped children.  */
+
+/* Bits in the fourth argument to `waitid'.  */
+#define WSTOPPED	2	/* Report stopped child (same as WUNTRACED). */
+#define WEXITED		4	/* Report dead child.  */
+#define WCONTINUED	8	/* Report continued child.  */
+#define WNOWAIT		0x01000000 /* Don't reap, just poll status.  */
+
+#define __WNOTHREAD     0x20000000 /* Don't wait on children of other threads
+				      in this group */
+#define __WALL		0x40000000 /* Wait for any child.  */
+#define __WCLONE	0x80000000 /* Wait for cloned process.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitstatus.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitstatus.h
new file mode 100644
index 0000000..699c224
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitstatus.h
@@ -0,0 +1,106 @@
+/* Definitions of status bits for `wait' et al.
+   Copyright (C) 1992,1994,1996,1997,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 _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Everything extant so far uses these same bits.  */
+
+
+/* If WIFEXITED(STATUS), the low-order 8 bits of the status.  */
+#define	__WEXITSTATUS(status)	(((status) & 0xff00) >> 8)
+
+/* If WIFSIGNALED(STATUS), the terminating signal.  */
+#define	__WTERMSIG(status)	((status) & 0x7f)
+
+/* If WIFSTOPPED(STATUS), the signal that stopped the child.  */
+#define	__WSTOPSIG(status)	__WEXITSTATUS(status)
+
+/* Nonzero if STATUS indicates normal termination.  */
+#define	__WIFEXITED(status)	(__WTERMSIG(status) == 0)
+
+/* Nonzero if STATUS indicates termination by a signal.  */
+#define __WIFSIGNALED(status) \
+  (((signed char) (((status) & 0x7f) + 1) >> 1) > 0)
+
+/* Nonzero if STATUS indicates the child is stopped.  */
+#define	__WIFSTOPPED(status)	(((status) & 0xff) == 0x7f)
+
+/* Nonzero if STATUS indicates the child continued after a stop.  We only
+   define this if <bits/waitflags.h> provides the WCONTINUED flag bit.  */
+#ifdef WCONTINUED
+# define __WIFCONTINUED(status)	((status) == __W_CONTINUED)
+#endif
+
+/* Nonzero if STATUS indicates the child dumped core.  */
+#define	__WCOREDUMP(status)	((status) & __WCOREFLAG)
+
+/* Macros for constructing status values.  */
+#define	__W_EXITCODE(ret, sig)	((ret) << 8 | (sig))
+#define	__W_STOPCODE(sig)	((sig) << 8 | 0x7f)
+#define __W_CONTINUED		0xffff
+#define	__WCOREFLAG		0x80
+
+
+#ifdef	__USE_BSD
+
+# include <endian.h>
+
+union wait
+  {
+    int w_status;
+    struct
+      {
+# if	__BYTE_ORDER == __LITTLE_ENDIAN
+	unsigned int __w_termsig:7; /* Terminating signal.  */
+	unsigned int __w_coredump:1; /* Set if dumped core.  */
+	unsigned int __w_retcode:8; /* Return code if exited normally.  */
+	unsigned int:16;
+# endif				/* Little endian.  */
+# if	__BYTE_ORDER == __BIG_ENDIAN
+	unsigned int:16;
+	unsigned int __w_retcode:8;
+	unsigned int __w_coredump:1;
+	unsigned int __w_termsig:7;
+# endif				/* Big endian.  */
+      } __wait_terminated;
+    struct
+      {
+# if	__BYTE_ORDER == __LITTLE_ENDIAN
+	unsigned int __w_stopval:8; /* W_STOPPED if stopped.  */
+	unsigned int __w_stopsig:8; /* Stopping signal.  */
+	unsigned int:16;
+# endif				/* Little endian.  */
+# if	__BYTE_ORDER == __BIG_ENDIAN
+	unsigned int:16;
+	unsigned int __w_stopsig:8; /* Stopping signal.  */
+	unsigned int __w_stopval:8; /* W_STOPPED if stopped.  */
+# endif				/* Big endian.  */
+      } __wait_stopped;
+  };
+
+# define w_termsig	__wait_terminated.__w_termsig
+# define w_coredump	__wait_terminated.__w_coredump
+# define w_retcode	__wait_terminated.__w_retcode
+# define w_stopsig	__wait_stopped.__w_stopsig
+# define w_stopval	__wait_stopped.__w_stopval
+
+#endif	/* Use BSD.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/wchar.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/wchar.h
new file mode 100644
index 0000000..ef1f563
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/wchar.h
@@ -0,0 +1,26 @@
+/* wchar_t type related definitions.
+   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.  */
+
+#ifndef _BITS_WCHAR_H
+#define _BITS_WCHAR_H	1
+
+#define __WCHAR_MIN	(-2147483647 - 1)
+#define __WCHAR_MAX	(2147483647)
+
+#endif	/* bits/wchar.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/wordsize.h
new file mode 100644
index 0000000..2d8e2b9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/wordsize.h
@@ -0,0 +1,6 @@
+#error "This file must be written based on the data type sizes of the target"
+
+#if 0
+#define __WORDSIZE 32
+#define __WORDSIZE 64
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/xopen_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/xopen_lim.h
new file mode 100644
index 0000000..c2363ab
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/xopen_lim.h
@@ -0,0 +1,150 @@
+/* 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.  */
+
+/*
+ * Never include this file directly; use <limits.h> instead.
+ */
+
+/* Additional definitions from X/Open Portability Guide, Issue 4, Version 2
+   System Interfaces and Headers, 4.16 <limits.h>
+
+   Please note only the values which are not greater than the minimum
+   stated in the standard document are listed.  The `sysconf' functions
+   should be used to obtain the actual value.  */
+
+#ifndef _XOPEN_LIM_H
+#define _XOPEN_LIM_H	1
+
+#define __need_IOV_MAX
+#include <bits/stdio_lim.h>
+
+/* We do not provide fixed values for
+
+   ARG_MAX	Maximum length of argument to the `exec' function
+		including environment data.
+
+   ATEXIT_MAX	Maximum number of functions that may be registered
+		with `atexit'.
+
+   CHILD_MAX	Maximum number of simultaneous processes per real
+		user ID.
+
+   OPEN_MAX	Maximum number of files that one process can have open
+		at anyone time.
+
+   PAGESIZE
+   PAGE_SIZE	Size of bytes of a page.
+
+   PASS_MAX	Maximum number of significant bytes in a password.
+
+   We only provide a fixed limit for
+
+   IOV_MAX	Maximum number of `iovec' structures that one process has
+		available for use with `readv' or writev'.
+
+   if this is indeed fixed by the underlying system.
+*/
+
+
+/* Maximum number of `iovec' structures that one process has available
+   for use with `readv' or writev'.  */
+#define	_XOPEN_IOV_MAX	_POSIX_UIO_MAXIOV
+
+
+/* Maximum value of `digit' in calls to the `printf' and `scanf'
+   functions.  Posix dictates this should be a minimum of 9 */
+#if !defined(__UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__) || (__UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__ <= 1)
+#undef NL_ARGMAX
+#elif __UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__ < 9
+#define NL_ARGMAX	9
+#else
+#define NL_ARGMAX	__UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__
+#endif
+
+/* Maximum number of bytes in a `LANG' name.  We have no limit.  */
+#define NL_LANGMAX	_POSIX2_LINE_MAX
+
+/* Maximum message number.  We have no limit.  */
+#define NL_MSGMAX	INT_MAX
+
+/* Maximum number of bytes in N-to-1 collation mapping.  We have no
+   limit.  */
+#define NL_NMAX		INT_MAX
+
+/* Maximum set number.  We have no limit.  */
+#define NL_SETMAX	INT_MAX
+
+/* Maximum number of bytes in a message.  We have no limit.  */
+#define NL_TEXTMAX	INT_MAX
+
+/* Default process priority.  */
+#define NZERO		20
+
+
+/* Number of bits in a word of type `int'.  */
+#ifdef INT_MAX
+# if INT_MAX == 32767
+#  define WORD_BIT	16
+# else
+#  if INT_MAX == 2147483647
+#   define WORD_BIT	32
+#  else
+/* Safe assumption.  */
+#   define WORD_BIT	64
+#  endif
+# endif
+#elif defined __INT_MAX__
+# if __INT_MAX__ == 32767
+#  define WORD_BIT	16
+# else
+#  if __INT_MAX__ == 2147483647
+#   define WORD_BIT	32
+#  else
+/* Safe assumption.  */
+#   define WORD_BIT	64
+#  endif
+# endif
+#else
+# define WORD_BIT	32
+#endif
+
+/* Number of bits in a word of type `long int'.  */
+#ifdef LONG_MAX
+# if LONG_MAX == 2147483647
+#  define LONG_BIT	32
+# else
+/* Safe assumption.  */
+#  define LONG_BIT	64
+# endif
+#elif defined __LONG_MAX__
+# if __LONG_MAX__ == 2147483647
+#  define LONG_BIT	32
+# else
+/* Safe assumption.  */
+#  define LONG_BIT	64
+# endif
+#else
+# include <bits/wordsize.h>
+# if __WORDSIZE == 64
+#  define LONG_BIT	64
+# else
+#  define LONG_BIT	32
+# endif
+#endif
+
+#endif /* bits/xopen_lim.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/brk.c b/ap/build/uClibc/libc/sysdeps/linux/common/brk.c
new file mode 100644
index 0000000..18836ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/brk.c
@@ -0,0 +1,32 @@
+/*
+ * 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 <unistd.h>
+#include <sys/syscall.h>
+
+libc_hidden_proto(brk)
+
+#define __NR___syscall_brk __NR_brk
+static inline _syscall1(void *, __syscall_brk, void *, end)
+
+/* This must be initialized data because commons can't have aliases.  */
+void * __curbrk attribute_hidden = 0;
+
+int brk(void *addr)
+{
+	void *newbrk = __syscall_brk(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/common/capget.c b/ap/build/uClibc/libc/sysdeps/linux/common/capget.c
new file mode 100644
index 0000000..c3e8c57
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/capget.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * capget() for uClibc
+ *
+ * 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>
+int capget(void *header, void *data);
+#ifdef __NR_capget
+_syscall2(int, capget, void *, header, void *, data)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/capset.c b/ap/build/uClibc/libc/sysdeps/linux/common/capset.c
new file mode 100644
index 0000000..c0cf5de
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/capset.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * capset() for uClibc
+ *
+ * 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>
+
+int capset(void *header, const void *data);
+#ifdef __NR_capset
+_syscall2(int, capset, void *, header, const void *, data)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/chdir.c b/ap/build/uClibc/libc/sysdeps/linux/common/chdir.c
new file mode 100644
index 0000000..e138101
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/chdir.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * chdir() for uClibc
+ *
+ * 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 <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+
+#define __NR___syscall_chdir __NR_chdir
+static __inline__ _syscall1(int, __syscall_chdir, const char *, path)
+int chdir(const char *path)
+{
+	return __syscall_chdir(path);
+}
+libc_hidden_def(chdir)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/chmod.c b/ap/build/uClibc/libc/sysdeps/linux/common/chmod.c
new file mode 100644
index 0000000..871e023
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/chmod.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * chmod() for uClibc
+ *
+ * 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 <sys/stat.h>
+
+
+#define __NR___syscall_chmod __NR_chmod
+static __inline__ _syscall2(int, __syscall_chmod, const char *, path, __kernel_mode_t, mode)
+
+int chmod(const char *path, mode_t mode)
+{
+	return __syscall_chmod(path, mode);
+}
+libc_hidden_def(chmod)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/chown.c b/ap/build/uClibc/libc/sysdeps/linux/common/chown.c
new file mode 100644
index 0000000..f2c60e0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/chown.c
@@ -0,0 +1,40 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * chown() for uClibc
+ *
+ * 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 <unistd.h>
+#include <bits/wordsize.h>
+
+
+#if (__WORDSIZE == 32 && defined(__NR_chown32)) || __WORDSIZE == 64
+# ifdef __NR_chown32
+#  undef __NR_chown
+#  define __NR_chown __NR_chown32
+# endif
+
+_syscall3(int, chown, const char *, path, uid_t, owner, gid_t, group)
+
+#else
+
+# define __NR___syscall_chown __NR_chown
+static __inline__ _syscall3(int, __syscall_chown, const char *, path,
+		__kernel_uid_t, owner, __kernel_gid_t, group)
+
+int chown(const char *path, uid_t owner, gid_t group)
+{
+	if (((owner + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((group + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_chown(path, owner, group));
+}
+#endif
+
+libc_hidden_def(chown)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/chroot.c b/ap/build/uClibc/libc/sysdeps/linux/common/chroot.c
new file mode 100644
index 0000000..4c085f2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/chroot.c
@@ -0,0 +1,23 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * chroot() for uClibc
+ *
+ * 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 <unistd.h>
+#include <string.h>
+#include <sys/param.h>
+
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+#define __NR___syscall_chroot __NR_chroot
+static __inline__ _syscall1(int, __syscall_chroot, const char *, path)
+
+int chroot(const char *path)
+{
+	return __syscall_chroot(path);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/clock_getres.c b/ap/build/uClibc/libc/sysdeps/linux/common/clock_getres.c
new file mode 100644
index 0000000..61413b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/clock_getres.c
@@ -0,0 +1,43 @@
+/*
+ * clock_getres() for uClibc
+ *
+ * Copyright (C) 2005 by Peter Kjellerstedt <pkj@axis.com>
+ * 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 <time.h>
+#include <unistd.h>
+
+#ifdef __NR_clock_getres
+_syscall2(int, clock_getres, clockid_t, clock_id, struct timespec*, res)
+#else
+
+int clock_getres(clockid_t clock_id, struct timespec* res)
+{
+	int retval = -1;
+
+	switch (clock_id) {
+		case CLOCK_REALTIME:
+			if (res) {
+				long clk_tck;
+
+				if ((clk_tck = sysconf(_SC_CLK_TCK)) < 0)
+					clk_tck = 100;
+				res->tv_sec = 0;
+				res->tv_nsec = 1000000000 / clk_tck;
+			}
+			retval = 0;
+			break;
+
+		default:
+			errno = EINVAL;
+			break;
+	}
+
+	return retval;
+}
+#endif
+libc_hidden_def(clock_getres)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/clock_gettime.c b/ap/build/uClibc/libc/sysdeps/linux/common/clock_gettime.c
new file mode 100644
index 0000000..d3755a7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/clock_gettime.c
@@ -0,0 +1,41 @@
+/*
+ * clock_gettime() for uClibc
+ *
+ * Copyright (C) 2003 by Justus Pendleton <uc@ryoohki.net>
+ * Copyright (C) 2005 by Peter Kjellerstedt <pkj@axis.com>
+ * 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 <time.h>
+#include <sys/time.h>
+
+#ifdef __NR_clock_gettime
+_syscall2(int, clock_gettime, clockid_t, clock_id, struct timespec*, tp)
+#else
+
+int clock_gettime(clockid_t clock_id, struct timespec* tp)
+{
+	struct timeval tv;
+	int retval = -1;
+
+	switch (clock_id) {
+		case CLOCK_REALTIME:
+			/* In Linux, gettimeofday fails only on bad parameter.
+			 * We know that here parameter isn't bad.
+			 */
+			gettimeofday(&tv, NULL);
+			TIMEVAL_TO_TIMESPEC(&tv, tp);
+			retval = 0;
+			break;
+
+		default:
+			errno = EINVAL;
+			break;
+	}
+
+	return retval;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/clock_settime.c b/ap/build/uClibc/libc/sysdeps/linux/common/clock_settime.c
new file mode 100644
index 0000000..0c9c840
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/clock_settime.c
@@ -0,0 +1,41 @@
+/*
+ * clock_settime() for uClibc
+ *
+ * Copyright (C) 2005 by Peter Kjellerstedt <pkj@axis.com>
+ * 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 <time.h>
+#include <sys/time.h>
+
+#ifdef __NR_clock_settime
+_syscall2(int, clock_settime, clockid_t, clock_id, const struct timespec*, tp)
+#else
+
+int clock_settime(clockid_t clock_id, const struct timespec* tp)
+{
+	struct timeval tv;
+	int retval = -1;
+
+	if (tp->tv_nsec < 0 || tp->tv_nsec >= 1000000000) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	switch (clock_id) {
+		case CLOCK_REALTIME:
+			TIMESPEC_TO_TIMEVAL(&tv, tp);
+			retval = settimeofday(&tv, NULL);
+			break;
+
+		default:
+			errno = EINVAL;
+			break;
+	}
+
+	return retval;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/close.c b/ap/build/uClibc/libc/sysdeps/linux/common/close.c
new file mode 100644
index 0000000..d6b5fbb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/close.c
@@ -0,0 +1,20 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * close() for uClibc
+ *
+ * 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 <unistd.h>
+
+_syscall1(int, close, int, fd)
+
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(close)
+#else
+libc_hidden_weak(close)
+strong_alias(close,__libc_close)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/cmsg_nxthdr.c b/ap/build/uClibc/libc/sysdeps/linux/common/cmsg_nxthdr.c
new file mode 100644
index 0000000..0360b47
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/cmsg_nxthdr.c
@@ -0,0 +1,44 @@
+/* Return point to next ancillary data entry in message header.
+   Copyright (C) 1997, 1998, 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.  */
+
+#define __FORCE_GLIBC
+#include <features.h>
+/* Prevent math.h from defining a colliding inline */
+#undef __USE_EXTERN_INLINES
+#include <sys/socket.h>
+
+
+struct cmsghdr *
+__cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg)
+{
+  if ((size_t) cmsg->cmsg_len < sizeof (struct cmsghdr))
+    /* The kernel header does this so there may be a reason.  */
+    return NULL;
+
+  cmsg = (struct cmsghdr *) ((unsigned char *) cmsg
+			     + CMSG_ALIGN (cmsg->cmsg_len));
+  if ((unsigned char *) (cmsg + 1) > ((unsigned char *) mhdr->msg_control
+				      + mhdr->msg_controllen)
+      || ((unsigned char *) cmsg + CMSG_ALIGN (cmsg->cmsg_len)
+	  > ((unsigned char *) mhdr->msg_control + mhdr->msg_controllen)))
+    /* No more entries.  */
+    return NULL;
+  return cmsg;
+}
+libc_hidden_def(__cmsg_nxthdr)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/creat.c b/ap/build/uClibc/libc/sysdeps/linux/common/creat.c
new file mode 100644
index 0000000..77cf44e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/creat.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * creat() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <fcntl.h>
+
+int creat(const char *file, mode_t mode)
+{
+	return open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/creat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/creat64.c
new file mode 100644
index 0000000..577ad14
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/creat64.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991, 1996, 1997 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 <_lfs_64.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+#include <fcntl.h>
+#include <sys/types.h>
+
+/* Create FILE with protections MODE.  */
+int creat64(const char *file, mode_t mode)
+{
+	return open64(file, O_WRONLY|O_CREAT|O_TRUNC, mode);
+}
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/create_module.c b/ap/build/uClibc/libc/sysdeps/linux/common/create_module.c
new file mode 100644
index 0000000..ddd7c4c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/create_module.c
@@ -0,0 +1,52 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * create_module syscall for uClibc
+ *
+ * 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 <unistd.h>
+#include <features.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_create_module
+
+unsigned long create_module(const char *name, size_t size);
+
+#if defined(__UCLIBC_BROKEN_CREATE_MODULE__)
+# define __NR___create_module  __NR_create_module
+static __inline__ _syscall2(long, __create_module, const char *, name, size_t, size)
+/* By checking the value of errno, we know if we have been fooled
+ * by the syscall2 macro making a very high address look like a
+ * negative, so we we fix it up here.  */
+unsigned long create_module(const char *name, size_t size)
+{
+	long ret = __create_module(name, size);
+
+	/* Jump through hoops to fixup error return codes */
+	if (ret == -1 && errno > 125) {
+		ret = -errno;
+		__set_errno(0);
+	}
+	return ret;
+}
+#elif defined(__UCLIBC_SLIGHTLY_BROKEN_CREATE_MODULE__)
+# define __NR___create_module  __NR_create_module
+/* Alpha doesn't have the same problem, exactly, but a bug in older
+   kernels fails to clear the error flag.  Clear it here explicitly.  */
+static __inline__ _syscall4(unsigned long, __create_module, const char *, name,
+			size_t, size, size_t, dummy, size_t, err)
+unsigned long create_module(const char *name, size_t size)
+{
+	return __create_module(name, size, 0, 0);
+}
+#else
+/* Sparc, MIPS, etc don't mistake return values for errors. */
+_syscall2(unsigned long, create_module, const char *, name, size_t, size)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/delete_module.c b/ap/build/uClibc/libc/sysdeps/linux/common/delete_module.c
new file mode 100644
index 0000000..8ac6e55
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/delete_module.c
@@ -0,0 +1,13 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * delete_module() for uClibc
+ * 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>
+int delete_module(const char *name, unsigned int flags);
+#ifdef __NR_delete_module
+_syscall2(int, delete_module, const char *, name, unsigned int, flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/dl-osinfo.h b/ap/build/uClibc/libc/sysdeps/linux/common/dl-osinfo.h
new file mode 100644
index 0000000..649d203
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/dl-osinfo.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#ifndef _DL_OSINFO_H
+#define _DL_OSINFO_H 1
+
+#include <features.h>
+
+#ifdef __UCLIBC_HAS_SSP__
+# if defined IS_IN_libc || defined IS_IN_rtld
+
+#  if defined __SSP__ || defined __SSP_ALL__
+#   error "file must not be compiled with stack protection enabled on it. Use -fno-stack-protector"
+#  endif
+
+#  include <stdint.h>
+#  include <sys/time.h>
+
+#  ifdef IS_IN_libc
+#include <fcntl.h>
+#   define OPEN open
+#   define READ read
+#   define CLOSE close
+#   define GETTIMEOFDAY gettimeofday
+#  else
+#   define OPEN _dl_open
+#   define READ _dl_read
+#   define CLOSE _dl_close
+#   define GETTIMEOFDAY _dl_gettimeofday
+#  endif
+
+static __always_inline uintptr_t _dl_setup_stack_chk_guard(void)
+{
+	uintptr_t ret;
+#  ifndef __SSP_QUICK_CANARY__
+	{
+		int fd = OPEN("/dev/urandom", O_RDONLY, 0);
+		if (fd >= 0) {
+			size_t size = READ(fd, &ret, sizeof(ret));
+			CLOSE(fd);
+			if (size == (size_t) sizeof(ret))
+				return ret;
+		}
+	}
+#  endif /* !__SSP_QUICK_CANARY__ */
+
+	/* Start with the "terminator canary". */
+	ret = 0xFF0A0D00UL;
+
+	/* Everything failed? Or we are using a weakened model of the
+	 * terminator canary */
+	{
+		struct timeval tv;
+		if (GETTIMEOFDAY(&tv, NULL) != (-1))
+			ret ^= tv.tv_usec ^ tv.tv_sec;
+	}
+	return ret;
+}
+# endif /* libc || rtld */
+#endif /* __UCLIBC_HAS_SSP__ */
+
+#endif /* _DL_OSINFO_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/dup.c b/ap/build/uClibc/libc/sysdeps/linux/common/dup.c
new file mode 100644
index 0000000..d351766
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/dup.c
@@ -0,0 +1,11 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * dup() for uClibc
+ * 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 <unistd.h>
+_syscall1(int, dup, int, oldfd)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/dup2.c b/ap/build/uClibc/libc/sysdeps/linux/common/dup2.c
new file mode 100644
index 0000000..006f06b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/dup2.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * dup2() for uClibc
+ *
+ * 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 <unistd.h>
+
+
+_syscall2(int, dup2, int, oldfd, int, newfd)
+libc_hidden_def(dup2)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/epoll.c b/ap/build/uClibc/libc/sysdeps/linux/common/epoll.c
new file mode 100644
index 0000000..ab3e73b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/epoll.c
@@ -0,0 +1,83 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * epoll_create() / epoll_ctl() / epoll_wait() for uClibc
+ *
+ * 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 <sys/epoll.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# include <sysdep-cancel.h>
+#else
+# define SINGLE_THREAD_P 1
+#endif
+
+/*
+ * epoll_create()
+ */
+#ifdef __NR_epoll_create
+_syscall1(int, epoll_create, int, size)
+#endif
+
+/*
+ * epoll_create1()
+ */
+#ifdef __NR_epoll_create1
+_syscall1(int, epoll_create1, int, flags)
+#endif
+
+/*
+ * epoll_ctl()
+ */
+#ifdef __NR_epoll_ctl
+_syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event)
+#endif
+
+/*
+ * epoll_wait()
+ */
+#ifdef __NR_epoll_wait
+extern __typeof(epoll_wait) __libc_epoll_wait;
+int __libc_epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
+{
+	if (SINGLE_THREAD_P)
+		return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout);
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	else {
+		int oldtype = LIBC_CANCEL_ASYNC ();
+		int result = INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout);
+		LIBC_CANCEL_RESET (oldtype);
+		return result;
+	}
+# endif
+}
+weak_alias(__libc_epoll_wait, epoll_wait)
+#endif
+
+/*
+ * epoll_pwait()
+ */
+#ifdef __NR_epoll_pwait
+# include <signal.h>
+
+extern __typeof(epoll_pwait) __libc_epoll_pwait;
+int __libc_epoll_pwait(int epfd, struct epoll_event *events, int maxevents,
+						int timeout, const sigset_t *set)
+{
+    int nsig = _NSIG / 8;
+	if (SINGLE_THREAD_P)
+		return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig);
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	else {
+		int oldtype = LIBC_CANCEL_ASYNC ();
+		int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig);
+		LIBC_CANCEL_RESET (oldtype);
+		return result;
+	}
+# endif
+}
+weak_alias(__libc_epoll_pwait, epoll_pwait)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/eventfd.c b/ap/build/uClibc/libc/sysdeps/linux/common/eventfd.c
new file mode 100644
index 0000000..cc3f3f0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/eventfd.c
@@ -0,0 +1,18 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * eventfd() for uClibc
+ *
+ * Copyright (C) 2011 Jean-Christian de Rivaz <jc@eclis.ch>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/eventfd.h>
+
+/*
+ * eventfd()
+ */
+#ifdef __NR_eventfd
+_syscall2(int, eventfd, int, count, int, flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/execve.c b/ap/build/uClibc/libc/sysdeps/linux/common/execve.c
new file mode 100644
index 0000000..e8568df
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/execve.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * execve() for uClibc
+ *
+ * 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 <unistd.h>
+#include <string.h>
+#include <sys/param.h>
+
+_syscall3(int, execve, const char *, filename,
+		  char *const *, argv, char *const *, envp)
+libc_hidden_def(execve)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/faccessat.c b/ap/build/uClibc/libc/sysdeps/linux/common/faccessat.c
new file mode 100644
index 0000000..09ca129
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/faccessat.c
@@ -0,0 +1,16 @@
+/*
+ * faccessat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_faccessat
+_syscall4(int, faccessat, int, fd, const char *, file, int, type, int, flag)
+#else
+/* should add emulation with faccess() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fchdir.c b/ap/build/uClibc/libc/sysdeps/linux/common/fchdir.c
new file mode 100644
index 0000000..4d54ef8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fchdir.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fchdir() for uClibc
+ *
+ * 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 <unistd.h>
+
+
+_syscall1(int, fchdir, int, fd)
+libc_hidden_def(fchdir)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fchmod.c b/ap/build/uClibc/libc/sysdeps/linux/common/fchmod.c
new file mode 100644
index 0000000..791f530
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fchmod.c
@@ -0,0 +1,20 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fchmod() for uClibc
+ *
+ * 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 <sys/stat.h>
+
+#define __NR___syscall_fchmod __NR_fchmod
+static __inline__ _syscall2(int, __syscall_fchmod,
+		int, fildes, __kernel_mode_t, mode)
+
+int fchmod(int fildes, mode_t mode)
+{
+	return (__syscall_fchmod(fildes, mode));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fchmodat.c b/ap/build/uClibc/libc/sysdeps/linux/common/fchmodat.c
new file mode 100644
index 0000000..8224a52
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fchmodat.c
@@ -0,0 +1,37 @@
+/*
+ * fchmodat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ * Copyright (C) 2012 Mike Frysinger
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <fcntl.h>
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#ifdef __NR_fchmodat
+/*
+ * The kernel takes 3 args, but userland takes 4.
+ * We have to process all the flags ourselves.
+ */
+int fchmodat(int fd, const char *file, mode_t mode, int flag)
+{
+	/* We only support one flag atm ... */
+	if (flag & ~AT_SYMLINK_NOFOLLOW) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+
+	/* ... but Linux doesn't support perms on symlinks. */
+	if (flag & AT_SYMLINK_NOFOLLOW) {
+		__set_errno(ENOTSUP);
+		return -1;
+	}
+
+	return INLINE_SYSCALL(fchmodat, 3, fd, file, mode);
+}
+#else
+/* should add emulation with fchmod() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fchown.c b/ap/build/uClibc/libc/sysdeps/linux/common/fchown.c
new file mode 100644
index 0000000..61618dc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fchown.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fchown() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_fchown32)) || __WORDSIZE == 64
+# ifdef __NR_fchown32
+#  undef __NR_fchown
+#  define __NR_fchown __NR_fchown32
+# endif
+
+_syscall3(int, fchown, int, fd, uid_t, owner, gid_t, group)
+
+#else
+
+# define __NR___syscall_fchown __NR_fchown
+static __inline__ _syscall3(int, __syscall_fchown, int, fd,
+		__kernel_uid_t, owner, __kernel_gid_t, group)
+
+int fchown(int fd, uid_t owner, gid_t group)
+{
+	if (((owner + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((group + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_fchown(fd, owner, group));
+}
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fchownat.c b/ap/build/uClibc/libc/sysdeps/linux/common/fchownat.c
new file mode 100644
index 0000000..707164d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fchownat.c
@@ -0,0 +1,16 @@
+/*
+ * fchownat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_fchownat
+_syscall5(int, fchownat, int, fd, const char *, file, uid_t, owner, gid_t, group, int, flag)
+#else
+/* should add emulation with fchown() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fdatasync.c b/ap/build/uClibc/libc/sysdeps/linux/common/fdatasync.c
new file mode 100644
index 0000000..e51c723
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fdatasync.c
@@ -0,0 +1,43 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fdatasync() for uClibc
+ *
+ * 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 <unistd.h>
+
+#if !defined __NR_fdatasync && defined __NR_osf_fdatasync
+# define __NR_fdatasync __NR_osf_fdatasync
+#endif
+
+#ifdef __NR_fdatasync
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# include <sysdep-cancel.h>
+# else
+# define SINGLE_THREAD_P 1
+# endif
+
+#define __NR___syscall_fdatasync __NR_fdatasync
+
+static __always_inline
+_syscall1(int, __syscall_fdatasync, int, fd)
+
+int fdatasync(int fd)
+{
+	if (SINGLE_THREAD_P)
+		return __syscall_fdatasync(fd);
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __syscall_fdatasync(fd);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+# endif
+}
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/flock.c b/ap/build/uClibc/libc/sysdeps/linux/common/flock.c
new file mode 100644
index 0000000..3dcd1ae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/flock.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * flock() for uClibc
+ *
+ * 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 <sys/file.h>
+
+#define __NR___syscall_flock __NR_flock
+static __inline__ _syscall2(int, __syscall_flock, int, fd, int, operation)
+
+int flock(int fd, int operation)
+{
+	return (__syscall_flock(fd, operation));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fork.c b/ap/build/uClibc/libc/sysdeps/linux/common/fork.c
new file mode 100644
index 0000000..14e00a2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fork.c
@@ -0,0 +1,23 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fork() for uClibc
+ *
+ * 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 <unistd.h>
+
+#ifdef __ARCH_USE_MMU__
+
+#ifdef __NR_fork
+#define __NR___libc_fork __NR_fork
+extern __typeof(fork) __libc_fork;
+_syscall0(pid_t, __libc_fork)
+weak_alias(__libc_fork,fork)
+libc_hidden_weak(fork)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/common/fpu_control.h
new file mode 100644
index 0000000..de261c2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fpu_control.h
@@ -0,0 +1,41 @@
+/* FPU control word definitions.  Stub version.
+   Copyright (C) 1996, 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.  */
+
+#ifndef _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+#define _FPU_RESERVED 0xffffffff    /* These bits are reserved and not changed.  */
+
+/* The fdlibm code requires no interrupts for exceptions.  Don't
+   change the rounding mode, it would break long double I/O!  */
+#define _FPU_DEFAULT  0x00000000 /* Default value.  */
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t;
+
+/* Macros for accessing the hardware control word.  */
+#define _FPU_GETCW(cw) 0
+#define _FPU_SETCW(cw) do { } while (0)
+
+#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/common/fstat.c b/ap/build/uClibc/libc/sysdeps/linux/common/fstat.c
new file mode 100644
index 0000000..4726a68
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fstat.c
@@ -0,0 +1,44 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fstat() for uClibc
+ *
+ * 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 <unistd.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+int fstat(int fd, struct stat *buf)
+{
+	int result;
+#ifdef __NR_fstat64
+	/* normal stat call has limited values for various stat elements
+	 * e.g. uid device major/minor etc.
+	 * so we use 64 variant if available
+	 * in order to get newer versions of stat elements
+	 */
+	struct kernel_stat64 kbuf;
+	result = INLINE_SYSCALL(fstat64, 2, fd, &kbuf);
+	if (result == 0) {
+		__xstat32_conv(&kbuf, buf);
+	}
+#else
+	struct kernel_stat kbuf;
+
+	result = INLINE_SYSCALL(fstat, 2, fd, &kbuf);
+	if (result == 0) {
+		__xstat_conv(&kbuf, buf);
+	}
+#endif
+	return result;
+}
+libc_hidden_def(fstat)
+
+#if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__
+strong_alias_untyped(fstat,fstat64)
+libc_hidden_def(fstat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fstat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/fstat64.c
new file mode 100644
index 0000000..6061343
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fstat64.c
@@ -0,0 +1,34 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fstat64() for uClibc
+ *
+ * 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>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_fstat64
+#include <unistd.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+
+#define __NR___syscall_fstat64 __NR_fstat64
+static __inline__ _syscall2(int, __syscall_fstat64,
+		int, filedes, struct kernel_stat64 *, buf)
+
+int fstat64(int fd, struct stat64 *buf)
+{
+	int result;
+	struct kernel_stat64 kbuf;
+
+	result = __syscall_fstat64(fd, &kbuf);
+	if (result == 0) {
+		__xstat64_conv(&kbuf, buf);
+	}
+	return result;
+}
+libc_hidden_def(fstat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fstatat.c b/ap/build/uClibc/libc/sysdeps/linux/common/fstatat.c
new file mode 100644
index 0000000..33daa7c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fstatat.c
@@ -0,0 +1,32 @@
+/*
+ * fstatat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+/* 64bit ports tend to favor newfstatat() */
+#ifdef __NR_newfstatat
+# define __NR_fstatat64 __NR_newfstatat
+#endif
+
+#ifdef __NR_fstatat64
+int fstatat(int fd, const char *file, struct stat *buf, int flag)
+{
+	int ret;
+	struct kernel_stat64 kbuf;
+
+	ret = INLINE_SYSCALL(fstatat64, 4, fd, file, &kbuf, flag);
+	if (ret == 0)
+		__xstat32_conv(&kbuf, buf);
+
+	return ret;
+}
+#else
+/* should add emulation with fstat() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fstatat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/fstatat64.c
new file mode 100644
index 0000000..95627af
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fstatat64.c
@@ -0,0 +1,36 @@
+/*
+ * fstatat64() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+#ifdef __UCLIBC_HAS_LFS__
+
+/* 64bit ports tend to favor newfstatat() */
+#ifdef __NR_newfstatat
+# define __NR_fstatat64 __NR_newfstatat
+#endif
+
+#ifdef __NR_fstatat64
+int fstatat64(int fd, const char *file, struct stat64 *buf, int flag)
+{
+	int ret;
+	struct kernel_stat64 kbuf;
+
+	ret = INLINE_SYSCALL(fstatat64, 4, fd, file, &kbuf, flag);
+	if (ret == 0)
+		__xstat64_conv(&kbuf, buf);
+
+	return ret;
+}
+#else
+/* should add emulation with fstat64() and /proc/self/fd/ ... */
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fstatfs.c b/ap/build/uClibc/libc/sysdeps/linux/common/fstatfs.c
new file mode 100644
index 0000000..fa0024a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fstatfs.c
@@ -0,0 +1,31 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fstatfs() for uClibc
+ *
+ * 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 <sys/vfs.h>
+
+#ifndef __USE_FILE_OFFSET64
+extern int fstatfs (int __fildes, struct statfs *__buf)
+     __THROW __nonnull ((2));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf),
+	fstatfs64) __nonnull ((2));
+# else
+#  define fstatfs fstatfs64
+# endif
+#endif
+
+extern __typeof(fstatfs) __libc_fstatfs attribute_hidden;
+#define __NR___libc_fstatfs __NR_fstatfs
+_syscall2(int, __libc_fstatfs, int, fd, struct statfs *, buf)
+
+#if defined __UCLIBC_LINUX_SPECIFIC__
+weak_alias(__libc_fstatfs,fstatfs)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fsync.c b/ap/build/uClibc/libc/sysdeps/linux/common/fsync.c
new file mode 100644
index 0000000..711811f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fsync.c
@@ -0,0 +1,37 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fsync() for uClibc
+ *
+ * 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 <unistd.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include "sysdep-cancel.h"
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+#define __NR___syscall_fsync __NR_fsync
+static inline _syscall1(int, __syscall_fsync, int, fd)
+
+extern __typeof(fsync) __libc_fsync;
+
+int __libc_fsync(int fd)
+{
+	if (SINGLE_THREAD_P)
+		return __syscall_fsync(fd);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __syscall_fsync(fd);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+
+weak_alias(__libc_fsync, fsync)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate.c b/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate.c
new file mode 100644
index 0000000..3bdef3f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * ftruncate() for uClibc
+ *
+ * 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 <unistd.h>
+
+
+_syscall2(int, ftruncate, int, fd, __off_t, length)
+libc_hidden_def(ftruncate)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate64.c b/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate64.c
new file mode 100644
index 0000000..c5a6160
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate64.c
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ *
+ * ftruncate64 syscall.  Copes with 64 bit and 32 bit machines
+ * and on 32 bit machines this sends things into the kernel as
+ * two 32-bit arguments (high and low 32 bits of length) that
+ * are ordered based on endianess.  It turns out endian.h has
+ * just the macro we need to order things, __LONG_LONG_PAIR.
+ */
+
+#include <features.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+
+# include <unistd.h>
+# include <errno.h>
+# include <endian.h>
+# include <stdint.h>
+# include <sys/types.h>
+# include <sys/syscall.h>
+
+
+# ifdef __NR_ftruncate64
+
+#  if __WORDSIZE == 64
+
+/* For a 64 bit machine, life is simple... */
+_syscall2(int, ftruncate64, int, fd, __off64_t, length)
+
+#  elif __WORDSIZE == 32
+
+/* The exported ftruncate64 function.  */
+int ftruncate64 (int fd, __off64_t length)
+{
+    uint32_t low = length & 0xffffffff;
+    uint32_t high = length >> 32;
+#   if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__)
+    return INLINE_SYSCALL(ftruncate64,
+	    4, fd, 0, __LONG_LONG_PAIR (high, low));
+#   else
+    return INLINE_SYSCALL(ftruncate64, 3, fd,
+	    __LONG_LONG_PAIR (high, low));
+#   endif
+}
+
+#  else /* __WORDSIZE */
+#   error Your machine is not 64 bit or 32 bit, I am dazed and confused.
+#  endif /* __WORDSIZE */
+
+# else  /* __NR_ftruncate64 */
+
+
+int ftruncate64 (int fd, __off64_t length)
+{
+	__off_t x = (__off_t) length;
+
+	if (x == length) {
+		return ftruncate(fd, x);
+	}
+
+	__set_errno((x < 0) ? EINVAL : EFBIG);
+
+	return -1;
+}
+
+# endif /* __NR_ftruncate64 */
+libc_hidden_def(ftruncate64)
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/futimens.c b/ap/build/uClibc/libc/sysdeps/linux/common/futimens.c
new file mode 100644
index 0000000..0eaf26a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/futimens.c
@@ -0,0 +1,29 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * futimens() implementation for uClibc
+ *
+ * Copyright (C) 2009 Bernhard Reutner-Fischer <uclibc@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <time.h>
+#ifdef __NR_utimensat
+/* To avoid superfluous warnings about passing NULL to the non-null annotated
+ * 2nd param "__path" below, we bypass inclusion of sys/stat.h and use
+ * a non annotated, local decl.
+ * Note that due to not including the header, we have to alias the call
+ * manually.
+ */
+extern int utimensat (int __fd, __const char *__path,
+	__const struct timespec __times[2],
+	int __flags) __THROW;
+libc_hidden_proto(utimensat)
+
+int futimens (int __fd, __const struct timespec __times[2]) __THROW;
+int futimens (int fd, __const struct timespec ts[2])
+{
+	return utimensat(fd, 0, ts, 0);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/futimesat.c b/ap/build/uClibc/libc/sysdeps/linux/common/futimesat.c
new file mode 100644
index 0000000..bd73eae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/futimesat.c
@@ -0,0 +1,16 @@
+/*
+ * futimesat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/time.h>
+
+#ifdef __NR_futimesat
+_syscall3(int, futimesat, int, fd, const char *, file, const struct timeval *, tvp)
+#else
+/* should add emulation with futimes() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/get_kernel_syms.c b/ap/build/uClibc/libc/sysdeps/linux/common/get_kernel_syms.c
new file mode 100644
index 0000000..6124a81
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/get_kernel_syms.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * get_kernel_syms() for uClibc
+ *
+ * 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>
+
+struct kernel_sym;
+int get_kernel_syms(struct kernel_sym *table attribute_unused);
+#ifdef __NR_get_kernel_syms
+_syscall1(int, get_kernel_syms, struct kernel_sym *, table)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getcwd.c b/ap/build/uClibc/libc/sysdeps/linux/common/getcwd.c
new file mode 100644
index 0000000..8751001
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getcwd.c
@@ -0,0 +1,199 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+/* These functions find the absolute path to the current working directory.  */
+
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/syscall.h>
+
+
+
+#ifdef __NR_getcwd
+
+# define __NR___syscall_getcwd __NR_getcwd
+static __always_inline
+_syscall2(int, __syscall_getcwd, char *, buf, unsigned long, size)
+
+#else
+
+/* If the syscall is not present, we have to walk up the
+ * directory tree till we hit the root.  Now we _could_
+ * use /proc/self/cwd if /proc is mounted... That approach
+ * is left an an exercise for the reader... */
+
+
+/* Seems a few broken filesystems (like coda) don't like this */
+/* #undef FAST_DIR_SEARCH_POSSIBLE on Linux */
+
+
+/* Routine to find the step back down */
+static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path_size)
+{
+	DIR *dp;
+	struct dirent *d;
+	char *ptr;
+	int slen;
+	struct stat st;
+
+# ifdef FAST_DIR_SEARCH_POSSIBLE
+	/* The test is for ELKS lib 0.0.9, this should be fixed in the real kernel */
+	int slow_search = (sizeof(ino_t) != sizeof(d->d_ino));
+# endif
+
+	if (stat(path_buf, &st) < 0) {
+		goto oops;
+	}
+# ifdef FAST_DIR_SEARCH_POSSIBLE
+	if (this_dev != st.st_dev)
+		slow_search = 1;
+# endif
+
+	slen = strlen(path_buf);
+	ptr = path_buf + slen - 1;
+	if (*ptr != '/') {
+		if (slen + 2 > path_size) {
+			goto oops;
+		}
+		strcpy(++ptr, "/");
+		slen++;
+	}
+	slen++;
+
+	dp = opendir(path_buf);
+	if (!dp) {
+	    goto oops;
+	}
+
+	while ((d = readdir(dp)) != 0) {
+# ifdef FAST_DIR_SEARCH_POSSIBLE
+		if (slow_search || this_ino == d->d_ino) {
+# endif
+			if (slen + strlen(d->d_name) > path_size) {
+			    closedir(dp);
+			    goto oops;
+			}
+			strcpy(ptr + 1, d->d_name);
+			if (stat(path_buf, &st) < 0)
+				continue;
+			if (st.st_ino == this_ino && st.st_dev == this_dev) {
+				closedir(dp);
+				return path_buf;
+			}
+# ifdef FAST_DIR_SEARCH_POSSIBLE
+		}
+# endif
+	}
+
+	closedir(dp);
+	return 0;
+
+oops:
+	__set_errno(ERANGE);
+	return 0;
+}
+
+/* Routine to go up tree */
+static char *recurser(char *path_buf, int path_size, dev_t root_dev, ino_t root_ino)
+{
+	struct stat st;
+	dev_t this_dev;
+	ino_t this_ino;
+
+	if (stat(path_buf, &st) < 0) {
+	    if (errno != EFAULT)
+		goto oops;
+	    return 0;
+	}
+	this_dev = st.st_dev;
+	this_ino = st.st_ino;
+	if (this_dev == root_dev && this_ino == root_ino) {
+		if (path_size < 2) {
+		    goto oops;
+		}
+		strcpy(path_buf, "/");
+		return path_buf;
+	}
+	if (strlen(path_buf) + 4 > path_size) {
+	    goto oops;
+	}
+	strcat(path_buf, "/..");
+	if (recurser(path_buf, path_size, root_dev, root_ino) == 0)
+		return 0;
+
+	return search_dir(this_dev, this_ino, path_buf, path_size);
+oops:
+	__set_errno(ERANGE);
+	return 0;
+}
+
+static __always_inline
+int __syscall_getcwd(char * buf, unsigned long size)
+{
+    int len;
+    char *cwd;
+    struct stat st;
+    int olderrno;
+
+    olderrno = errno;
+    len = -1;
+
+    /* get stat for root to have a valid parameters for the terminating condition */
+    if (stat("/", &st) < 0) {
+	/* root dir not found! */
+	return -1;
+    }
+    /* start with actual dir */
+    if (buf) strncpy(buf, ".", size);
+
+    cwd = recurser(buf, size, st.st_dev, st.st_ino);
+    if (cwd) {
+	len = strlen(buf) + 1;
+	__set_errno(olderrno);
+    }
+    return len;
+}
+
+#endif /* __NR_getcwd */
+
+char *getcwd(char *buf, size_t size)
+{
+    int ret;
+    char *path;
+    size_t alloc_size = size;
+
+    if (size == 0) {
+	if (buf != NULL) {
+	    __set_errno(EINVAL);
+	    return NULL;
+	}
+	alloc_size = MAX (PATH_MAX, getpagesize ());
+    }
+    path=buf;
+    if (buf == NULL) {
+	path = malloc(alloc_size);
+	if (path == NULL)
+	    return NULL;
+    }
+    ret = __syscall_getcwd(path, alloc_size);
+    if (ret >= 0)
+    {
+	if (buf == NULL && size == 0)
+	    buf = realloc(path, ret);
+	if (buf == NULL)
+	    buf = path;
+	return buf;
+    }
+    if (buf == NULL)
+	free (path);
+    return NULL;
+}
+libc_hidden_def(getcwd)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getdents.c b/ap/build/uClibc/libc/sysdeps/linux/common/getdents.c
new file mode 100644
index 0000000..46f7b8e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getdents.c
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <assert.h>
+#include <errno.h>
+#include <dirent.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <bits/kernel_types.h>
+#include <bits/kernel-features.h>
+#include <bits/uClibc_alloc.h>
+
+#if !(defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64 && __WORDSIZE == 64)
+/* If the condition above is met, __getdents is defined as an alias
+ * for __getdents64 (see getdents64.c). Otherwise...
+ */
+
+/* With newer versions of linux, the getdents syscall returns d_type
+ * information after the name field.
+ *
+ * See __ASSUME_GETDENTS32_D_TYPE in glibc's kernel-features.h for specific
+ * version / arch details.
+ */
+
+#ifndef offsetof
+# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+struct kernel_dirent
+{
+	long int d_ino;
+	__kernel_off_t d_off;
+	unsigned short int d_reclen;
+	char d_name[256];
+};
+
+ssize_t __getdents (int fd, char *buf, size_t nbytes) attribute_hidden;
+
+#define __NR___syscall_getdents __NR_getdents
+static __always_inline _syscall3(int, __syscall_getdents, int, fd, unsigned char *, kdirp, size_t, count)
+
+#if defined __ASSUME_GETDENTS32_D_TYPE
+
+ssize_t __getdents (int fd, char *buf, size_t nbytes)
+{
+	ssize_t retval;
+
+	retval = __syscall_getdents(fd, (unsigned char *)buf, nbytes);
+
+	/* The kernel added the d_type value after the name.  Change
+	this now.  */
+	if (retval != -1) {
+		union {
+			struct kernel_dirent k;
+			struct dirent u;
+		} *kbuf = (void *) buf;
+
+		while ((char *) kbuf < buf + retval) {
+			char d_type = *((char *) kbuf + kbuf->k.d_reclen - 1);
+			memmove (kbuf->u.d_name, kbuf->k.d_name,
+			strlen (kbuf->k.d_name) + 1);
+			kbuf->u.d_type = d_type;
+
+			kbuf = (void *) ((char *) kbuf + kbuf->k.d_reclen);
+		}
+	}
+
+	return retval;
+}
+
+#elif ! defined __UCLIBC_HAS_LFS__ || ! defined __NR_getdents64
+
+ssize_t __getdents (int fd, char *buf, size_t nbytes)
+{
+    struct dirent *dp;
+    off_t last_offset = -1;
+    ssize_t retval;
+    size_t red_nbytes;
+    struct kernel_dirent *skdp, *kdp;
+    const size_t size_diff = (offsetof (struct dirent, d_name)
+	    - offsetof (struct kernel_dirent, d_name));
+
+    red_nbytes = MIN (nbytes - ((nbytes /
+		    (offsetof (struct dirent, d_name) + 14)) * size_diff),
+	    nbytes - size_diff);
+
+    dp = (struct dirent *) buf;
+    skdp = kdp = stack_heap_alloc(red_nbytes);
+
+    retval = __syscall_getdents(fd, (unsigned char *)kdp, red_nbytes);
+    if (retval == -1) {
+	stack_heap_free(skdp);
+	return -1;
+    }
+
+    while ((char *) kdp < (char *) skdp + retval) {
+	const size_t alignment = __alignof__ (struct dirent);
+	/* Since kdp->d_reclen is already aligned for the kernel structure
+	   this may compute a value that is bigger than necessary.  */
+	size_t new_reclen = ((kdp->d_reclen + size_diff + alignment - 1)
+		& ~(alignment - 1));
+	if ((char *) dp + new_reclen > buf + nbytes) {
+	    /* Our heuristic failed.  We read too many entries.  Reset
+	       the stream.  */
+	    assert (last_offset != -1);
+	    lseek(fd, last_offset, SEEK_SET);
+
+	    if ((char *) dp == buf) {
+		/* The buffer the user passed in is too small to hold even
+		   one entry.  */
+		stack_heap_free(skdp);
+		__set_errno (EINVAL);
+		return -1;
+	    }
+	    break;
+	}
+
+	last_offset = kdp->d_off;
+	dp->d_ino = kdp->d_ino;
+	dp->d_off = kdp->d_off;
+	dp->d_reclen = new_reclen;
+	dp->d_type = DT_UNKNOWN;
+	memcpy (dp->d_name, kdp->d_name,
+		kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
+	dp = (struct dirent *) ((char *) dp + new_reclen);
+	kdp = (struct kernel_dirent *) (((char *) kdp) + kdp->d_reclen);
+    }
+    stack_heap_free(skdp);
+    return (char *) dp - buf;
+}
+
+#elif __WORDSIZE == 32
+
+extern __typeof(__getdents) __getdents64 attribute_hidden;
+ssize_t __getdents (int fd, char *buf, size_t nbytes)
+{
+    struct dirent *dp;
+    struct dirent64 *dp64;
+    ssize_t ret = __getdents64 (fd, buf, nbytes);
+
+    if (ret <= 0)
+	return ret;
+
+    dp64 = (struct dirent64 *) buf;
+    buf += ret;
+    while ((void *) dp64 < (void *) buf) {
+	dp = (struct dirent *) dp64;
+	dp->d_ino = dp64->d_ino;
+	dp->d_off = dp64->d_off;
+	dp->d_reclen = dp64->d_reclen;
+	dp->d_type = dp64->d_type;
+	memmove (dp->d_name, dp64->d_name, dp->d_reclen - offsetof (struct dirent64, d_name));
+	memmove (dp64, dp, dp->d_reclen);
+	dp64 = ((void *) dp64) + dp->d_reclen;
+    }
+
+    return ret;
+}
+
+#endif
+
+#if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
+attribute_hidden strong_alias(__getdents,__getdents64)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getdents64.c b/ap/build/uClibc/libc/sysdeps/linux/common/getdents64.c
new file mode 100644
index 0000000..30686f2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getdents64.c
@@ -0,0 +1,105 @@
+/*
+ * 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 <assert.h>
+#include <errno.h>
+#include <dirent.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <bits/kernel_types.h>
+#include <bits/uClibc_alloc.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64
+
+# ifndef offsetof
+#  define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+# endif
+
+struct kernel_dirent64
+{
+    uint64_t		d_ino;
+    int64_t		d_off;
+    unsigned short	d_reclen;
+    unsigned char	d_type;
+    char		d_name[256];
+};
+
+# define __NR___syscall_getdents64 __NR_getdents64
+static __inline__ _syscall3(int, __syscall_getdents64, int, fd, unsigned char *, dirp, size_t, count)
+
+ssize_t __getdents64 (int fd, char *buf, size_t nbytes) attribute_hidden;
+ssize_t __getdents64 (int fd, char *buf, size_t nbytes)
+{
+    struct dirent64 *dp;
+    off64_t last_offset = -1;
+    ssize_t retval;
+    size_t red_nbytes;
+    struct kernel_dirent64 *skdp, *kdp;
+    const size_t size_diff = (offsetof (struct dirent64, d_name)
+	    - offsetof (struct kernel_dirent64, d_name));
+
+    red_nbytes = MIN (nbytes - ((nbytes /
+		    (offsetof (struct dirent64, d_name) + 14)) * size_diff),
+	    nbytes - size_diff);
+
+    dp = (struct dirent64 *) buf;
+    skdp = kdp = stack_heap_alloc(red_nbytes);
+
+    retval = __syscall_getdents64(fd, (unsigned char *)kdp, red_nbytes);
+    if (retval == -1) {
+	stack_heap_free(skdp);
+	return -1;
+    }
+
+    while ((char *) kdp < (char *) skdp + retval) {
+	const size_t alignment = __alignof__ (struct dirent64);
+	/* Since kdp->d_reclen is already aligned for the kernel structure
+	   this may compute a value that is bigger than necessary.  */
+	size_t new_reclen = ((kdp->d_reclen + size_diff + alignment - 1)
+		& ~(alignment - 1));
+	if ((char *) dp + new_reclen > buf + nbytes) {
+	    /* Our heuristic failed.  We read too many entries.  Reset
+	       the stream.  */
+	    assert (last_offset != -1);
+	    lseek64(fd, last_offset, SEEK_SET);
+
+	    if ((char *) dp == buf) {
+		/* The buffer the user passed in is too small to hold even
+		   one entry.  */
+		stack_heap_free(skdp);
+		__set_errno (EINVAL);
+		return -1;
+	    }
+	    break;
+	}
+
+	last_offset = kdp->d_off;
+	dp->d_ino = kdp->d_ino;
+	dp->d_off = kdp->d_off;
+	dp->d_reclen = new_reclen;
+	dp->d_type = kdp->d_type;
+	memcpy (dp->d_name, kdp->d_name,
+		kdp->d_reclen - offsetof (struct kernel_dirent64, d_name));
+	dp = (struct dirent64 *) ((char *) dp + new_reclen);
+	kdp = (struct kernel_dirent64 *) (((char *) kdp) + kdp->d_reclen);
+    }
+    stack_heap_free(skdp);
+    return (char *) dp - buf;
+}
+
+#if __WORDSIZE == 64
+/* since getdents doesnt give us d_type but getdents64 does, try and
+ * use getdents64 as much as possible */
+attribute_hidden strong_alias(__getdents64,__getdents)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getdirname.c b/ap/build/uClibc/libc/sysdeps/linux/common/getdirname.c
new file mode 100644
index 0000000..c02f66b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getdirname.c
@@ -0,0 +1,58 @@
+/* vi: set sw=4 ts=4: */
+/* Copyright (C) 1992, 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.  */
+
+#include <features.h>
+
+#ifdef __USE_GNU
+#include <unistd.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* Return a malloc'd string containing the current directory name.
+   If the environment variable `PWD' is set, and its value is correct,
+   that value is used.  */
+
+char *
+get_current_dir_name (void)
+{
+	char *pwd;
+#ifdef __UCLIBC_HAS_LFS__
+	struct stat64 dotstat, pwdstat;
+#else
+	struct stat dotstat, pwdstat;
+#endif
+
+	pwd = getenv ("PWD");
+	if (pwd != NULL
+#ifdef __UCLIBC_HAS_LFS__
+		&& stat64 (".", &dotstat) == 0
+		&& stat64 (pwd, &pwdstat) == 0
+#else
+		&& stat (".", &dotstat) == 0
+		&& stat (pwd, &pwdstat) == 0
+#endif
+		&& pwdstat.st_dev == dotstat.st_dev
+		&& pwdstat.st_ino == dotstat.st_ino)
+		/* The PWD value is correct.  Use it.  */
+		return strdup (pwd);
+
+	return getcwd ((char *) NULL, 0);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getdomainname.c b/ap/build/uClibc/libc/sysdeps/linux/common/getdomainname.c
new file mode 100644
index 0000000..8590283
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getdomainname.c
@@ -0,0 +1,49 @@
+/*
+ * 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 <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/utsname.h>
+
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+
+int
+#ifndef __UCLIBC_BSD_SPECIFIC__
+attribute_hidden
+#endif
+getdomainname(char *name, size_t len)
+{
+  struct utsname uts;
+
+  if (name == NULL) {
+    __set_errno(EINVAL);
+    return -1;
+  }
+
+  if (uname(&uts) == -1) return -1;
+
+#ifdef __USE_GNU
+  if (strlen(uts.domainname)+1 > len) {
+#else
+  if (strlen(uts.__domainname)+1 > len) {
+#endif
+    __set_errno(EINVAL);
+    return -1;
+  }
+#ifdef __USE_GNU
+  strcpy(name, uts.domainname);
+#else
+  strcpy(name, uts.__domainname);
+#endif
+  return 0;
+}
+# ifdef __UCLIBC_BSD_SPECIFIC__
+libc_hidden_def(getdomainname)
+# endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getdtablesize.c b/ap/build/uClibc/libc/sysdeps/linux/common/getdtablesize.c
new file mode 100644
index 0000000..7dd3a54
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getdtablesize.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/resource.h>
+#include <limits.h>
+
+/* XXX: _BSD || _XOPEN_SOURCE >= 500 */
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+
+
+#define __LOCAL_OPEN_MAX	    256
+
+/* Return the maximum number of file descriptors
+   the current process could possibly have.  */
+int getdtablesize (void)
+{
+  struct rlimit ru;
+
+  /* This should even work if `getrlimit' is not implemented.  POSIX.1
+     does not define this function but we will generate a stub which
+     returns -1.  */
+  return getrlimit (RLIMIT_NOFILE, &ru) < 0 ? __LOCAL_OPEN_MAX : ru.rlim_cur;
+}
+libc_hidden_def(getdtablesize)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getegid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getegid.c
new file mode 100644
index 0000000..80a8ac9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getegid.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getegid() for uClibc
+ *
+ * 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 <unistd.h>
+
+#ifdef __NR_getegid32
+# undef __NR_getegid
+# define __NR_getegid __NR_getegid32
+#endif
+
+#ifdef __NR_getegid
+_syscall_noerr0(gid_t, getegid)
+libc_hidden_def(getegid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/geteuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/geteuid.c
new file mode 100644
index 0000000..610fbc1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/geteuid.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * geteuid() for uClibc
+ *
+ * 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 <unistd.h>
+
+#ifdef __NR_geteuid32
+# undef __NR_geteuid
+# define __NR_geteuid __NR_geteuid32
+#endif
+
+#ifdef __NR_geteuid
+_syscall_noerr0(uid_t, geteuid)
+libc_hidden_def(geteuid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getgid.c
new file mode 100644
index 0000000..ccfbfc0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getgid.c
@@ -0,0 +1,27 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getgid() for uClibc
+ *
+ * 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 <unistd.h>
+
+#ifdef __NR_getxgid
+# undef __NR_getgid
+# define __NR_getgid __NR_getxgid
+#endif
+#ifdef __NR_getgid32
+# undef __NR_getgid
+# define __NR_getgid __NR_getgid32
+#endif
+
+_syscall_noerr0(gid_t, getgid)
+libc_hidden_def(getgid)
+#if !defined __NR_getegid32 && !defined __NR_getegid
+strong_alias(getgid,getegid)
+libc_hidden_def(getegid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getgroups.c b/ap/build/uClibc/libc/sysdeps/linux/common/getgroups.c
new file mode 100644
index 0000000..ddc2cae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getgroups.c
@@ -0,0 +1,60 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getgroups() for uClibc
+ *
+ * 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 <stdlib.h>
+#include <unistd.h>
+#include <grp.h>
+
+
+#if defined(__NR_getgroups32)
+# undef __NR_getgroups
+# define __NR_getgroups __NR_getgroups32
+_syscall2(int, getgroups, int, size, gid_t *, list)
+
+#elif __WORDSIZE == 64
+_syscall2(int, getgroups, int, size, gid_t *, list)
+
+#else
+
+#define MIN(a,b) (((a)<(b))?(a):(b))
+
+#define __NR___syscall_getgroups __NR_getgroups
+static __inline__ _syscall2(int, __syscall_getgroups,
+		int, size, __kernel_gid_t *, list)
+
+int getgroups(int size, gid_t groups[])
+{
+	if (unlikely(size < 0)) {
+ret_error:
+		__set_errno(EINVAL);
+		return -1;
+	} else {
+		int i, ngids;
+		__kernel_gid_t *kernel_groups;
+
+		size = MIN(size, sysconf(_SC_NGROUPS_MAX));
+		kernel_groups = (__kernel_gid_t *)malloc(sizeof(*kernel_groups) * size);
+		if (size && kernel_groups == NULL)
+			goto ret_error;
+
+		ngids = __syscall_getgroups(size, kernel_groups);
+		if (size != 0 && ngids > 0) {
+			for (i = 0; i < ngids; i++) {
+				groups[i] = kernel_groups[i];
+			}
+		}
+
+		free(kernel_groups);
+		return ngids;
+	}
+}
+#endif
+
+libc_hidden_def(getgroups)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/gethostname.c b/ap/build/uClibc/libc/sysdeps/linux/common/gethostname.c
new file mode 100644
index 0000000..3b59e56
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/gethostname.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <string.h>
+#include <unistd.h>
+#include <sys/utsname.h>
+#include <errno.h>
+
+
+
+int
+gethostname(char *name, size_t len)
+{
+  struct utsname uts;
+
+  if (name == NULL) {
+    __set_errno(EINVAL);
+    return -1;
+  }
+
+  if (uname(&uts) == -1) return -1;
+
+  if (strlen(uts.nodename)+1 > len) {
+    __set_errno(EINVAL);
+    return -1;
+  }
+  strcpy(name, uts.nodename);
+  return 0;
+}
+libc_hidden_def(gethostname)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getitimer.c b/ap/build/uClibc/libc/sysdeps/linux/common/getitimer.c
new file mode 100644
index 0000000..b324233
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getitimer.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getitimer() for uClibc
+ *
+ * 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 <sys/time.h>
+_syscall2(int, getitimer, __itimer_which_t, which, struct itimerval *, value)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getpagesize.c b/ap/build/uClibc/libc/sysdeps/linux/common/getpagesize.c
new file mode 100644
index 0000000..1faa548
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getpagesize.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 1991,1992,1995-1997,2000,2002 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 <unistd.h>
+#include <features.h>
+#include <sys/param.h>
+
+extern size_t __pagesize;
+
+/* Return the system page size.  */
+/* couldn't make __getpagesize hidden, because shm.h uses it in a macro */
+extern __typeof(getpagesize) __getpagesize;
+int __getpagesize(void)
+{
+  if (__pagesize != 0)
+    return __pagesize;
+
+#ifdef	EXEC_PAGESIZE
+  return EXEC_PAGESIZE;
+#else	/* No EXEC_PAGESIZE.  */
+#ifdef	NBPG
+#ifndef	CLSIZE
+#define	CLSIZE	1
+#endif	/* No CLSIZE.  */
+  return NBPG * CLSIZE;
+#else	/* No NBPG.  */
+  return NBPC;
+#endif	/* NBPG.  */
+#endif	/* EXEC_PAGESIZE.  */
+}
+strong_alias(__getpagesize,getpagesize)
+libc_hidden_def(getpagesize)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getpgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getpgid.c
new file mode 100644
index 0000000..8e7516f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getpgid.c
@@ -0,0 +1,25 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getpgid() for uClibc
+ *
+ * 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>
+
+#if defined __USE_UNIX98
+#include <unistd.h>
+
+#define __NR___syscall_getpgid __NR_getpgid
+static __inline__ _syscall1(__kernel_pid_t, __syscall_getpgid, __kernel_pid_t, pid)
+
+pid_t __getpgid(pid_t pid)
+{
+	return (__syscall_getpgid(pid));
+}
+#ifdef __USE_XOPEN_EXTENDED
+weak_alias(__getpgid,getpgid)
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getpgrp.c b/ap/build/uClibc/libc/sysdeps/linux/common/getpgrp.c
new file mode 100644
index 0000000..14912c3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getpgrp.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getpgrp() for uClibc
+ *
+ * Copyright (C) 2000-2008 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_getpgrp
+/* According to the manpage the POSIX.1 version is favoured */
+_syscall_noerr0(pid_t, getpgrp)
+#elif defined __NR_getpgid
+pid_t getpgrp(void)
+{
+	return getpgid(0);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getpid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getpid.c
new file mode 100644
index 0000000..d9a6908
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getpid.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getpid() for uClibc
+ *
+ * Copyright (C) 2000-2006 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_getxpid
+# undef __NR_getpid
+# define __NR_getpid __NR_getxpid
+#endif
+
+_syscall_noerr0(pid_t, getpid)
+libc_hidden_weak(getpid)
+#ifndef __NR_getppid
+strong_alias(getpid,getppid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getppid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getppid.c
new file mode 100644
index 0000000..9d85661
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getppid.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getppid() for uClibc
+ *
+ * Copyright (C) 2000-2006 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef	__NR_getppid
+_syscall_noerr0(pid_t, getppid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getpriority.c b/ap/build/uClibc/libc/sysdeps/linux/common/getpriority.c
new file mode 100644
index 0000000..eba54a5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getpriority.c
@@ -0,0 +1,30 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getpriority() for uClibc
+ *
+ * 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 <sys/resource.h>
+
+
+#define __NR___syscall_getpriority __NR_getpriority
+static __inline__ _syscall2(int, __syscall_getpriority,
+		__priority_which_t, which, id_t, who)
+
+/* The return value of __syscall_getpriority is biased by this value
+ * to avoid returning negative values.  */
+#define PZERO 20
+int getpriority(__priority_which_t which, id_t who)
+{
+	int res;
+
+	res = __syscall_getpriority(which, who);
+	if (res >= 0)
+		res = PZERO - res;
+	return res;
+}
+libc_hidden_def(getpriority)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getresgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getresgid.c
new file mode 100644
index 0000000..425263e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getresgid.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getresgid() for uClibc
+ *
+ * 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>
+#ifdef __USE_GNU
+#include <unistd.h>
+
+#if defined(__NR_getresgid32)
+# undef __NR_getresgid
+# define __NR_getresgid __NR_getresgid32
+_syscall3(int, getresgid, gid_t *, rgid, gid_t *, egid, gid_t *, sgid)
+
+#elif defined(__NR_getresgid)
+# define __NR___syscall_getresgid __NR_getresgid
+static __inline__ _syscall3(int, __syscall_getresgid, __kernel_gid_t *, rgid,
+		  __kernel_gid_t *, egid, __kernel_gid_t *, sgid)
+
+int getresgid(gid_t * rgid, gid_t * egid, gid_t * sgid)
+{
+	int result;
+	__kernel_gid_t k_rgid, k_egid, k_sgid;
+
+	result = __syscall_getresgid(&k_rgid, &k_egid, &k_sgid);
+	if (result == 0) {
+		*rgid = (gid_t) k_rgid;
+		*egid = (gid_t) k_egid;
+		*sgid = (gid_t) k_sgid;
+	}
+	return result;
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getresuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getresuid.c
new file mode 100644
index 0000000..87cf6d6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getresuid.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getresuid() for uClibc
+ *
+ * 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>
+#ifdef __USE_GNU
+#include <unistd.h>
+
+#if defined(__NR_getresuid32)
+# undef __NR_getresuid
+# define __NR_getresuid __NR_getresuid32
+_syscall3(int, getresuid, uid_t *, ruid, uid_t *, euid, uid_t *, suid)
+
+#elif defined(__NR_getresuid)
+# define __NR___syscall_getresuid __NR_getresuid
+static __inline__ _syscall3(int, __syscall_getresuid, __kernel_uid_t *, ruid,
+		  __kernel_uid_t *, euid, __kernel_uid_t *, suid)
+
+int getresuid(uid_t * ruid, uid_t * euid, uid_t * suid)
+{
+	int result;
+	__kernel_uid_t k_ruid, k_euid, k_suid;
+
+	result = __syscall_getresuid(&k_ruid, &k_euid, &k_suid);
+	if (result == 0) {
+		*ruid = (uid_t) k_ruid;
+		*euid = (uid_t) k_euid;
+		*suid = (uid_t) k_suid;
+	}
+	return result;
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit.c b/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit.c
new file mode 100644
index 0000000..4d3163f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit.c
@@ -0,0 +1,67 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getrlimit() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define getrlimit64 __hide_getrlimit64
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/resource.h>
+#undef getrlimit64
+
+
+/* Only wrap getrlimit if the new ugetrlimit is not present and getrlimit sucks */
+
+#if defined __NR_ugetrlimit
+
+/* just call ugetrlimit() */
+# define __NR___syscall_ugetrlimit __NR_ugetrlimit
+static __always_inline
+_syscall2(int, __syscall_ugetrlimit, enum __rlimit_resource, resource,
+          struct rlimit *, rlim)
+int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits)
+{
+	return (__syscall_ugetrlimit(resource, rlimits));
+}
+
+#elif !defined(__UCLIBC_HANDLE_OLDER_RLIMIT__)
+
+/* We don't need to wrap getrlimit() */
+_syscall2(int, getrlimit, __rlimit_resource_t, resource,
+		struct rlimit *, rlim)
+
+#else
+
+/* we have to handle old style getrlimit() */
+# define __NR___syscall_getrlimit __NR_getrlimit
+static __always_inline
+_syscall2(int, __syscall_getrlimit, int, resource, struct rlimit *, rlim)
+
+int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits)
+{
+	int result;
+
+	result = __syscall_getrlimit(resource, rlimits);
+
+	if (result == -1)
+		return result;
+
+	/* We might have to correct the limits values.  Since the old values
+	 * were signed the infinity value is too small.  */
+	if (rlimits->rlim_cur == RLIM_INFINITY >> 1)
+		rlimits->rlim_cur = RLIM_INFINITY;
+	if (rlimits->rlim_max == RLIM_INFINITY >> 1)
+		rlimits->rlim_max = RLIM_INFINITY;
+	return result;
+}
+#endif
+
+libc_hidden_def(getrlimit)
+
+#if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
+strong_alias(getrlimit, getrlimit64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit64.c b/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit64.c
new file mode 100644
index 0000000..d537241
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit64.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1991, 1995, 1996, 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 <_lfs_64.h>
+
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <bits/wordsize.h>
+
+/* the regular getrlimit will work just fine for 64bit users */
+
+#if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 32
+
+
+/* Put the soft and hard limits for RESOURCE in *RLIMITS.
+   Returns 0 if successful, -1 if not (and sets errno).  */
+int getrlimit64 (__rlimit_resource_t resource, struct rlimit64 *rlimits)
+{
+    struct rlimit rlimits32;
+
+    if (getrlimit (resource, &rlimits32) < 0)
+	return -1;
+
+    if (rlimits32.rlim_cur == RLIM_INFINITY)
+	rlimits->rlim_cur = RLIM64_INFINITY;
+    else
+	rlimits->rlim_cur = rlimits32.rlim_cur;
+    if (rlimits32.rlim_max == RLIM_INFINITY)
+	rlimits->rlim_max = RLIM64_INFINITY;
+    else
+	rlimits->rlim_max = rlimits32.rlim_max;
+
+    return 0;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getrusage.c b/ap/build/uClibc/libc/sysdeps/linux/common/getrusage.c
new file mode 100644
index 0000000..3e719f2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getrusage.c
@@ -0,0 +1,13 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getrusage() for uClibc
+ *
+ * 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 <unistd.h>
+#include <wait.h>
+_syscall2(int, getrusage, __rusage_who_t, who, struct rusage *, usage)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getsid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getsid.c
new file mode 100644
index 0000000..5a178bb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getsid.c
@@ -0,0 +1,23 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getsid() for uClibc
+ *
+ * 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 <unistd.h>
+
+#ifdef __USE_XOPEN_EXTENDED
+
+#define __NR___syscall_getsid __NR_getsid
+static __inline__ _syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid)
+
+pid_t getsid(pid_t pid)
+{
+	return (__syscall_getsid(pid));
+}
+libc_hidden_def(getsid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/gettimeofday.c b/ap/build/uClibc/libc/sysdeps/linux/common/gettimeofday.c
new file mode 100644
index 0000000..52490fe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/gettimeofday.c
@@ -0,0 +1,18 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * gettimeofday() for uClibc
+ *
+ * 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 <sys/time.h>
+
+#ifdef __USE_BSD
+_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz)
+#else
+_syscall2(int, gettimeofday, struct timeval *, tv, void *, tz)
+#endif
+libc_hidden_def(gettimeofday)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getuid.c
new file mode 100644
index 0000000..f921acb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getuid.c
@@ -0,0 +1,27 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getuid() for uClibc
+ *
+ * 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 <unistd.h>
+
+#ifdef __NR_getxuid
+# undef __NR_getuid
+# define __NR_getuid __NR_getxuid
+#endif
+#ifdef __NR_getuid32
+# undef __NR_getuid
+# define __NR_getuid __NR_getuid32
+#endif
+
+_syscall_noerr0(uid_t, getuid)
+libc_hidden_def(getuid)
+#if !defined __NR_geteuid32 && !defined __NR_geteuid
+strong_alias(getuid,geteuid)
+libc_hidden_def(geteuid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/hp-timing.h b/ap/build/uClibc/libc/sysdeps/linux/common/hp-timing.h
new file mode 100644
index 0000000..099342d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/hp-timing.h
@@ -0,0 +1,83 @@
+/* High precision, low overhead timing functions.  Generic version.
+   Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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 _HP_TIMING_H
+#define _HP_TIMING_H	1
+
+
+/* There are no generic definitions for the times.  We could write something
+   using the `gettimeofday' system call where available but the overhead of
+   the system call might be too high.
+
+   In case a platform supports timers in the hardware the following macros
+   and types must be defined:
+
+   - HP_TIMING_AVAIL: test for availability.
+
+   - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
+     implemented using function calls but instead uses some inlined code
+     which might simply consist of a few assembler instructions.  We have to
+     know this since we might want to use the macros here in places where we
+     cannot make function calls.
+
+   - hp_timing_t: This is the type for variables used to store the time
+     values.
+
+   - HP_TIMING_ZERO: clear `hp_timing_t' object.
+
+   - HP_TIMING_NOW: place timestamp for current time in variable given as
+     parameter.
+
+   - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
+     HP_TIMING_DIFF macro.
+
+   - HP_TIMING_DIFF: compute difference between two times and store it
+     in a third.  Source and destination might overlap.
+
+   - HP_TIMING_ACCUM: add time difference to another variable.  This might
+     be a bit more complicated to implement for some platforms as the
+     operation should be thread-safe and 64bit arithmetic on 32bit platforms
+     is not.
+
+   - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
+     there are no threads involved.
+
+   - HP_TIMING_PRINT: write decimal representation of the timing value into
+     the given string.  This operation need not be inline even though
+     HP_TIMING_INLINE is specified.
+
+*/
+
+/* Provide dummy definitions.  */
+#define HP_TIMING_AVAIL		(0)
+#define HP_TIMING_INLINE	(0)
+typedef int hp_timing_t;
+#define HP_TIMING_ZERO(Var)
+#define HP_TIMING_NOW(var)
+#define HP_TIMING_DIFF_INIT()
+#define HP_TIMING_DIFF(Diff, Start, End)
+#define HP_TIMING_ACCUM(Sum, Diff)
+#define HP_TIMING_ACCUM_NT(Sum, Diff)
+#define HP_TIMING_PRINT(Buf, Len, Val)
+
+/* Since this implementation is not available we tell the user about it.  */
+#define HP_TIMING_NONAVAIL	1
+
+#endif	/* hp-timing.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/init_module.c b/ap/build/uClibc/libc/sysdeps/linux/common/init_module.c
new file mode 100644
index 0000000..cf6d747
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/init_module.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * init_module() for uClibc
+ *
+ * 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>
+int init_module(void *first, void *second, void *third, void *fourth, void *fifth);
+#ifdef __NR_init_module
+/* This may have 5 arguments (for old 2.0 kernels) or 2 arguments
+ * (for 2.2 and 2.4 kernels).  Use the greatest common denominator,
+ * and let the kernel cope with whatever it gets.  It's good at that. */
+_syscall5(int, init_module, void *, first, void *, second, void *, third,
+		  void *, fourth, void *, fifth)
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/inotify.c b/ap/build/uClibc/libc/sysdeps/linux/common/inotify.c
new file mode 100644
index 0000000..e2f3836
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/inotify.c
@@ -0,0 +1,28 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * inotify interface for uClibc
+ *
+ * Copyright (C) 2006 Austin Morgan <admorgan@morgancomputers.net>
+ * Copyright (C) 2006 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/inotify.h>
+
+#ifdef __NR_inotify_init
+_syscall0(int, inotify_init)
+#endif
+
+#ifdef __NR_inotify_init1
+_syscall1(int, inotify_init1, int, flags)
+#endif
+
+#ifdef __NR_inotify_add_watch
+_syscall3(int, inotify_add_watch, int, fd, const char *, path, uint32_t, mask)
+#endif
+
+#ifdef __NR_inotify_rm_watch
+_syscall2(int, inotify_rm_watch, int, fd, int, wd)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ioctl.c b/ap/build/uClibc/libc/sysdeps/linux/common/ioctl.c
new file mode 100644
index 0000000..f2f0f53
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ioctl.c
@@ -0,0 +1,46 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * ioctl() for uClibc
+ *
+ * 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 <stdarg.h>
+#include <sys/ioctl.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+libc_hidden_proto(ioctl)
+
+#define __NR___syscall_ioctl __NR_ioctl
+static __always_inline
+_syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg)
+
+int ioctl(int fd, unsigned long int request, ...)
+{
+	void *arg;
+	va_list list;
+
+	va_start(list, request);
+	arg = va_arg(list, void *);
+
+	va_end(list);
+
+	if (SINGLE_THREAD_P)
+		return __syscall_ioctl(fd, request, arg);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __syscall_ioctl(fd, request, arg);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+libc_hidden_def(ioctl)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ioperm.c b/ap/build/uClibc/libc/sysdeps/linux/common/ioperm.c
new file mode 100644
index 0000000..bca2fff
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ioperm.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * ioperm() for uClibc
+ *
+ * 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>
+
+#if defined __ARCH_USE_MMU__ && defined __NR_ioperm
+
+/* psm: can't #include <sys/io.h>, some archs miss it */
+extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on) __THROW;
+/* Not needed internally;
+libc_hidden_proto(ioperm)
+*/
+_syscall3(int, ioperm, unsigned long, from, unsigned long, num, int, turn_on)
+/*libc_hidden_def(ioperm)*/
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/iopl.c b/ap/build/uClibc/libc/sysdeps/linux/common/iopl.c
new file mode 100644
index 0000000..4d9c458
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/iopl.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * iopl() for uClibc
+ *
+ * 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>
+#if defined __ARCH_USE_MMU__ && defined __NR_iopl
+/* psm: can't #include <sys/io.h>, some archs miss it */
+extern int iopl(int __level) __THROW;
+_syscall1(int, iopl, int, level)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/kill.c b/ap/build/uClibc/libc/sysdeps/linux/common/kill.c
new file mode 100644
index 0000000..c11a0ed
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/kill.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * kill() for uClibc
+ *
+ * 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 <signal.h>
+
+
+#define __NR___syscall_kill __NR_kill
+static __inline__ _syscall2(int, __syscall_kill, __kernel_pid_t, pid, int, sig)
+
+int kill(pid_t pid, int sig)
+{
+	return (__syscall_kill(pid, sig));
+}
+libc_hidden_def(kill)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/klogctl.c b/ap/build/uClibc/libc/sysdeps/linux/common/klogctl.c
new file mode 100644
index 0000000..58467df
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/klogctl.c
@@ -0,0 +1,18 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * klogctl() for uClibc
+ *
+ * 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 <unistd.h>
+#include <sys/klog.h>
+#define __NR__syslog		__NR_syslog
+static __inline__ _syscall3(int, _syslog, int, type, char *, buf, int, len)
+int klogctl(int type, char *buf, int len)
+{
+	return (_syslog(type, buf, len));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/lchown.c b/ap/build/uClibc/libc/sysdeps/linux/common/lchown.c
new file mode 100644
index 0000000..c0f8ce7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/lchown.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * lchown() for uClibc
+ *
+ * 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 <unistd.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_lchown32)) || __WORDSIZE == 64
+# ifdef __NR_lchown32
+#  undef __NR_lchown
+#  define __NR_lchown __NR_lchown32
+# endif
+
+_syscall3(int, lchown, const char *, path, uid_t, owner, gid_t, group)
+
+#else
+
+# define __NR___syscall_lchown __NR_lchown
+static __inline__ _syscall3(int, __syscall_lchown, const char *, path,
+		__kernel_uid_t, owner, __kernel_gid_t, group)
+
+int lchown(const char *path, uid_t owner, gid_t group)
+{
+	if (((owner + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((group + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return __syscall_lchown(path, owner, group);
+}
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/libgcc_s.h b/ap/build/uClibc/libc/sysdeps/linux/common/libgcc_s.h
new file mode 100644
index 0000000..e74a103
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/libgcc_s.h
@@ -0,0 +1,2 @@
+/* Name of libgcc_s library provided by gcc.  */
+#define LIBGCC_S_SO "libgcc_s.so.1"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/link.c b/ap/build/uClibc/libc/sysdeps/linux/common/link.c
new file mode 100644
index 0000000..b5e5536
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/link.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * link() for uClibc
+ *
+ * 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 <unistd.h>
+_syscall2(int, link, const char *, oldpath, const char *, newpath)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/linkat.c b/ap/build/uClibc/libc/sysdeps/linux/common/linkat.c
new file mode 100644
index 0000000..9abe9ec
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/linkat.c
@@ -0,0 +1,16 @@
+/*
+ * linkat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_linkat
+_syscall5(int, linkat, int, fromfd, const char *, from, int, tofd, const char *, to, int, flags)
+#else
+/* should add emulation with link() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/llseek.c b/ap/build/uClibc/libc/sysdeps/linux/common/llseek.c
new file mode 100644
index 0000000..ff16917
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/llseek.c
@@ -0,0 +1,42 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * llseek/lseek64 syscall for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+/* Newer kernel ports have llseek() instead of _llseek() */
+#if !defined __NR__llseek && defined __NR_llseek
+# define __NR__llseek __NR_llseek
+#endif
+
+#if defined __NR__llseek && defined __UCLIBC_HAS_LFS__
+
+loff_t lseek64(int fd, loff_t offset, int whence)
+{
+	loff_t result;
+	return (loff_t)(INLINE_SYSCALL(_llseek, 5, fd, (off_t) (offset >> 32),
+				(off_t) (offset & 0xffffffff), &result, whence) ?: result);
+}
+
+#else
+
+loff_t lseek64(int fd, loff_t offset, int whence)
+{
+	return (loff_t)(lseek(fd, (off_t) (offset), whence));
+}
+
+#endif
+
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(lseek64)
+#else
+libc_hidden_weak(lseek64)
+strong_alias(lseek64,__libc_lseek64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/longjmp.c b/ap/build/uClibc/libc/sysdeps/linux/common/longjmp.c
new file mode 100644
index 0000000..f3448bc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/longjmp.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 1991, 92, 94, 95, 97, 98, 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 <stddef.h>
+#include <setjmp.h>
+#include <signal.h>
+
+
+extern void __longjmp (__jmp_buf __env, int __val) attribute_noreturn;
+libc_hidden_proto(__longjmp)
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+extern void _longjmp_unwind (jmp_buf env, int val);
+#endif
+
+extern __typeof(longjmp) __libc_longjmp attribute_noreturn;
+/* Set the signal mask to the one specified in ENV, and jump
+   to the position specified in ENV, causing the setjmp
+   call there to return VAL, or 1 if VAL is 0.  */
+void __libc_longjmp (sigjmp_buf env, int val)
+{
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+  /* Perform any cleanups needed by the frames being unwound.  */
+  _longjmp_unwind (env, val);
+#endif
+
+  if (env[0].__mask_was_saved)
+    /* Restore the saved signal mask.  */
+    (void) sigprocmask (SIG_SETMASK, &env[0].__saved_mask, NULL);
+
+  /* Call the machine-dependent function to restore machine state.  */
+  __longjmp (env[0].__jmpbuf, val ?: 1);
+}
+
+weak_alias(__libc_longjmp,longjmp)
+weak_alias(__libc_longjmp,siglongjmp)
+strong_alias(__libc_longjmp,__libc_siglongjmp)
+strong_alias(__libc_longjmp,_longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/lseek.c b/ap/build/uClibc/libc/sysdeps/linux/common/lseek.c
new file mode 100644
index 0000000..9ff4240
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/lseek.c
@@ -0,0 +1,27 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * lseek() for uClibc
+ *
+ * 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 <unistd.h>
+
+#ifdef __NR_lseek
+_syscall3(__off_t, lseek, int, fildes, __off_t, offset, int, whence)
+#else
+
+__off_t lseek(int fildes, __off_t offset, int whence)
+{
+	return lseek64(fildes, offset, whence);
+}
+#endif
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(lseek)
+#else
+libc_hidden_weak(lseek)
+strong_alias(lseek,__libc_lseek)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/lstat.c b/ap/build/uClibc/libc/sysdeps/linux/common/lstat.c
new file mode 100644
index 0000000..db72d1f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/lstat.c
@@ -0,0 +1,44 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * lstat() for uClibc
+ *
+ * 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 <unistd.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+int lstat(const char *file_name, struct stat *buf)
+{
+	int result;
+#ifdef __NR_lstat64
+	/* normal stat call has limited values for various stat elements
+	 * e.g. uid device major/minor etc.
+	 * so we use 64 variant if available
+	 * in order to get newer versions of stat elements
+	 */
+	struct kernel_stat64 kbuf;
+	result = INLINE_SYSCALL(lstat64, 2, file_name, &kbuf);
+	if (result == 0) {
+		__xstat32_conv(&kbuf, buf);
+	}
+#else
+	struct kernel_stat kbuf;
+
+	result = INLINE_SYSCALL(lstat, 2, file_name, &kbuf);
+	if (result == 0) {
+		__xstat_conv(&kbuf, buf);
+	}
+#endif
+	return result;
+}
+libc_hidden_def(lstat)
+
+#if ! defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__
+strong_alias_untyped(lstat,lstat64)
+libc_hidden_def(lstat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/lstat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/lstat64.c
new file mode 100644
index 0000000..235b76d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/lstat64.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * lstat64() for uClibc
+ *
+ * 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>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_lstat64
+# include <unistd.h>
+# include <sys/stat.h>
+# include "xstatconv.h"
+
+
+# define __NR___syscall_lstat64 __NR_lstat64
+static __inline__ _syscall2(int, __syscall_lstat64, const char *, file_name,
+		  struct kernel_stat64 *, buf)
+
+int lstat64(const char *file_name, struct stat64 *buf)
+{
+	int result;
+	struct kernel_stat64 kbuf;
+
+	result = __syscall_lstat64(file_name, &kbuf);
+	if (result == 0) {
+		__xstat64_conv(&kbuf, buf);
+	}
+	return result;
+}
+libc_hidden_def(lstat64)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/lutimes.c b/ap/build/uClibc/libc/sysdeps/linux/common/lutimes.c
new file mode 100644
index 0000000..e01d40e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/lutimes.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * lutimes() implementation for uClibc
+ *
+ * Copyright (C) 2010 Vladimir Zapolskiy <vzapolskiy@gmail.com>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <time.h>
+
+#ifdef __NR_lutimes
+_syscall2(int, lutimes, const char *, file, const struct timeval *, tvp)
+#elif defined __NR_utimensat
+#include <sys/time.h>
+#include <fcntl.h>
+
+int lutimes(const char *file, const struct timeval tvp[2])
+{
+	struct timespec ts[2];
+
+	if (tvp != NULL)
+	{
+		if (tvp[0].tv_usec < 0 || tvp[0].tv_usec >= 1000000
+		    || tvp[1].tv_usec < 0 || tvp[1].tv_usec >= 1000000)
+		{
+			__set_errno(EINVAL);
+			return -1;
+		}
+
+		TIMEVAL_TO_TIMESPEC(&tvp[0], &ts[0]);
+		TIMEVAL_TO_TIMESPEC(&tvp[1], &ts[1]);
+	}
+
+	return utimensat(AT_FDCWD, file, tvp ? ts : NULL, AT_SYMLINK_NOFOLLOW);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/madvise.c b/ap/build/uClibc/libc/sysdeps/linux/common/madvise.c
new file mode 100644
index 0000000..e953d7b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/madvise.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * madvise() for uClibc
+ *
+ * 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 <sys/mman.h>
+#if defined __NR_madvise && defined __USE_BSD
+_syscall3(int, madvise, void *, __addr, size_t, __len, int, __advice)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mincore.c b/ap/build/uClibc/libc/sysdeps/linux/common/mincore.c
new file mode 100644
index 0000000..f1f3557
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mincore.c
@@ -0,0 +1,15 @@
+/*
+ * This file provides the mincore() system call to uClibc.
+ * Copyright (C) 20041215 - <solar@gentoo.org>
+ * 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>
+
+#if defined __NR_mincore && (defined __USE_BSD || defined __USE_SVID)
+#include <unistd.h>
+#include <sys/mman.h>
+_syscall3(int, mincore, void *, start, size_t, length, unsigned char *, vec)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mkdir.c b/ap/build/uClibc/libc/sysdeps/linux/common/mkdir.c
new file mode 100644
index 0000000..fbc587d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mkdir.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mkdir() for uClibc
+ *
+ * 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 <sys/stat.h>
+
+
+#define __NR___syscall_mkdir __NR_mkdir
+static __inline__ _syscall2(int, __syscall_mkdir, const char *, pathname,
+		__kernel_mode_t, mode)
+
+int mkdir(const char *pathname, mode_t mode)
+{
+	return (__syscall_mkdir(pathname, mode));
+}
+libc_hidden_def(mkdir)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mkdirat.c b/ap/build/uClibc/libc/sysdeps/linux/common/mkdirat.c
new file mode 100644
index 0000000..4da9468
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mkdirat.c
@@ -0,0 +1,16 @@
+/*
+ * mkdirat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#ifdef __NR_mkdirat
+_syscall3(int, mkdirat, int, fd, const char *, path, mode_t, mode)
+#else
+/* should add emulation with mkdir() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mkfifo.c b/ap/build/uClibc/libc/sysdeps/linux/common/mkfifo.c
new file mode 100644
index 0000000..0616814
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mkfifo.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991, 1996, 1997 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 <stddef.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+
+/* Create a named pipe (FIFO) named PATH with protections MODE.  */
+int
+mkfifo (const char *path, mode_t mode)
+{
+  return mknod (path, mode | S_IFIFO, 0);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mkfifoat.c b/ap/build/uClibc/libc/sysdeps/linux/common/mkfifoat.c
new file mode 100644
index 0000000..e442fe2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mkfifoat.c
@@ -0,0 +1,19 @@
+/*
+ * mkfifoat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#ifdef __NR_mknodat
+int mkfifoat(int fd, const char *path, mode_t mode)
+{
+	return mknodat(fd, path, mode | S_IFIFO, 0);
+}
+#else
+/* should add emulation with mkfifo() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mknod.c b/ap/build/uClibc/libc/sysdeps/linux/common/mknod.c
new file mode 100644
index 0000000..b52c8c5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mknod.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mknod() for uClibc
+ *
+ * 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 <sys/stat.h>
+
+int mknod(const char *path, mode_t mode, dev_t dev)
+{
+	unsigned long long int k_dev;
+
+	/* We must convert the value to dev_t type used by the kernel.  */
+	k_dev = (dev) & ((1ULL << 32) - 1);
+
+	return INLINE_SYSCALL(mknod, 3, path, mode, (unsigned int)k_dev);
+}
+libc_hidden_def(mknod)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mknodat.c b/ap/build/uClibc/libc/sysdeps/linux/common/mknodat.c
new file mode 100644
index 0000000..93b9e6e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mknodat.c
@@ -0,0 +1,25 @@
+/*
+ * mknodat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#ifdef __NR_mknodat
+int mknodat(int fd, const char *path, mode_t mode, dev_t dev)
+{
+	unsigned long long int k_dev;
+
+	/* We must convert the value to dev_t type used by the kernel.  */
+	k_dev = (dev) & ((1ULL << 32) - 1);
+
+	return INLINE_SYSCALL(mknodat, 4, fd, path, mode, (unsigned int)k_dev);
+}
+libc_hidden_def(mknodat)
+#else
+/* should add emulation with mknod() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mlock.c b/ap/build/uClibc/libc/sysdeps/linux/common/mlock.c
new file mode 100644
index 0000000..12120d8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mlock.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mlock() for uClibc
+ *
+ * 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 <sys/mman.h>
+#if defined __ARCH_USE_MMU__ && defined __NR_mlock
+_syscall2(int, mlock, const void *, addr, size_t, len)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mlockall.c b/ap/build/uClibc/libc/sysdeps/linux/common/mlockall.c
new file mode 100644
index 0000000..99f7201
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mlockall.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mlockall() for uClibc
+ *
+ * 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 <sys/mman.h>
+#if defined __ARCH_USE_MMU__ && defined __NR_mlockall
+_syscall1(int, mlockall, int, flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/common/mmap.c
new file mode 100644
index 0000000..8995898
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mmap.c
@@ -0,0 +1,71 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mmap() for uClibc
+ *
+ * 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 <unistd.h>
+#include <sys/mman.h>
+#include <bits/uClibc_page.h>
+
+#ifdef __NR_mmap
+
+
+#ifdef __UCLIBC_MMAP_HAS_6_ARGS__
+
+_syscall6(void *, mmap, void *, start, size_t, length,
+		int, prot, int, flags, int, fd, off_t, offset)
+
+#else
+
+# 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)
+
+#elif defined(__NR_mmap2)
+
+
+#define __NR___syscall_mmap2 __NR_mmap2
+static __inline__ _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr,
+	size_t, len, int, prot, int, flags, int, fd, off_t, offset)
+
+/* Some architectures always use 12 as page shift for mmap2() eventhough the
+ * real PAGE_SHIFT != 12.  Other architectures use the same value as
+ * PAGE_SHIFT...
+ */
+# ifndef MMAP2_PAGE_SHIFT
+#  define MMAP2_PAGE_SHIFT 12
+# endif
+
+__ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
+{
+	if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)) {
+		__set_errno(EINVAL);
+		return MAP_FAILED;
+	}
+	return __syscall_mmap2(addr, len, prot, flags, fd, offset >> MMAP2_PAGE_SHIFT);
+}
+
+libc_hidden_def(mmap)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mmap64.c b/ap/build/uClibc/libc/sysdeps/linux/common/mmap64.c
new file mode 100644
index 0000000..b6eb2b3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mmap64.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Massivly hacked up for uClibc by Erik Andersen */
+
+#include <_lfs_64.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+
+#include <errno.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+#include <bits/uClibc_page.h>
+
+
+# if !defined __NR_mmap2
+
+/*
+ * This version is a stub that just chops off everything at the mmap 32 bit
+ * mmap() address space...  You will probably need to add in an arch specific
+ * implementation to override this as there is not a generic way for me to
+ * implement this particular syscall if your arch lacks _syscall6...
+ *
+ */
+
+__ptr_t mmap64(__ptr_t addr, size_t len, int prot, int flags, int fd, __off64_t offset)
+{
+	if (offset != (off_t) offset ||
+	    (offset + len) != (off_t) (offset + len)) {
+		__set_errno(EINVAL);
+		return MAP_FAILED;
+	}
+
+	return mmap(addr, len, prot, flags, fd, (off_t) offset);
+}
+
+# else
+
+/* Some architectures always use 12 as page shift for mmap2() eventhough the
+ * real PAGE_SHIFT != 12.  Other architectures use the same value as
+ * PAGE_SHIFT...
+ */
+#  ifndef MMAP2_PAGE_SHIFT
+#   define MMAP2_PAGE_SHIFT 12
+#  endif
+
+__ptr_t mmap64(__ptr_t addr, size_t len, int prot, int flags, int fd, __off64_t offset)
+{
+	/*
+	 * Some arches check the size in INLINE_SYSCALL() and barf if it's
+	 * too big (i.e. a 64bit value getting truncated to 32bit).
+	 */
+# if __WORDSIZE == 32
+	uint32_t sysoff;
+# else
+	uint64_t sysoff;
+# endif
+
+	if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)) {
+		__set_errno(EINVAL);
+		return MAP_FAILED;
+	}
+
+	/*
+	 * We know __off64_t is always a signed 64-bit type, but need things
+	 * to be unsigned before doing the shift.  If it isn't, we might
+	 * sign extend things and pass in the wrong value.  So cast it to
+	 * an unsigned 64-bit value before doing the shift.
+	 */
+	sysoff = (uint64_t)offset >> MMAP2_PAGE_SHIFT;
+
+	return (__ptr_t) INLINE_SYSCALL(mmap2, 6, addr, len, prot, flags, fd, sysoff);
+}
+
+# endif
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/modify_ldt.c b/ap/build/uClibc/libc/sysdeps/linux/common/modify_ldt.c
new file mode 100644
index 0000000..d70bd40
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/modify_ldt.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * modify_ldt() for uClibc
+ *
+ * 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>
+
+int modify_ldt (int func, void *ptr, unsigned long bytecount);
+#ifdef __NR_modify_ldt
+_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mount.c b/ap/build/uClibc/libc/sysdeps/linux/common/mount.c
new file mode 100644
index 0000000..39e5db1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mount.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mount() for uClibc
+ *
+ * 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 <sys/mount.h>
+_syscall5(int, mount, const char *, specialfile, const char *, dir,
+		  const char *, filesystemtype, unsigned long, rwflag,
+		  const void *, data)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mprotect.c b/ap/build/uClibc/libc/sysdeps/linux/common/mprotect.c
new file mode 100644
index 0000000..d60fc04
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mprotect.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mprotect() for uClibc
+ *
+ * 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 <sys/mman.h>
+
+#if defined __NR_mprotect
+_syscall3(int, mprotect, void *, addr, size_t, len, int, prot)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mremap.c b/ap/build/uClibc/libc/sysdeps/linux/common/mremap.c
new file mode 100644
index 0000000..0295a25
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mremap.c
@@ -0,0 +1,28 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mremap() for uClibc
+ *
+ * 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 <unistd.h>
+
+#ifdef __NR_mremap
+
+/* Why do we do this?! */
+
+#define mremap _hidemremap
+#include <sys/mman.h>
+#undef mremap
+
+void *mremap(void *, size_t, size_t, int, void *);
+libc_hidden_proto(mremap)
+
+_syscall5(void *, mremap, void *, old_address, size_t, old_size, size_t,
+		  new_size, int, may_move, void *, new_address)
+libc_hidden_def(mremap)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/msync.c b/ap/build/uClibc/libc/sysdeps/linux/common/msync.c
new file mode 100644
index 0000000..844dbaa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/msync.c
@@ -0,0 +1,45 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * msync() for uClibc
+ *
+ * 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 <unistd.h>
+#include <sys/mman.h>
+
+#ifdef __NR_msync
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+#define __NR___syscall_msync __NR_msync
+static __always_inline _syscall3(int, __syscall_msync, void *, addr, size_t, length,
+						int, flags)
+
+extern __typeof(msync) __libc_msync;
+int __libc_msync(void * addr, size_t length, int flags)
+{
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype, result;
+#endif
+
+	if (SINGLE_THREAD_P)
+		return __syscall_msync(addr, length, flags);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	oldtype = LIBC_CANCEL_ASYNC ();
+	result = __syscall_msync(addr, length, flags);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+weak_alias(__libc_msync,msync)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/munlock.c b/ap/build/uClibc/libc/sysdeps/linux/common/munlock.c
new file mode 100644
index 0000000..07f9376
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/munlock.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * munlock() for uClibc
+ *
+ * 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 <sys/mman.h>
+#if defined __ARCH_USE_MMU__ && defined __NR_munlock
+_syscall2(int, munlock, const void *, addr, size_t, len)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/munlockall.c b/ap/build/uClibc/libc/sysdeps/linux/common/munlockall.c
new file mode 100644
index 0000000..cc15264
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/munlockall.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * munlockall() for uClibc
+ *
+ * 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>
+
+#if defined __NR_munlockall && defined __ARCH_USE_MMU__
+#include <sys/mman.h>
+
+_syscall0(int, munlockall)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/munmap.c b/ap/build/uClibc/libc/sysdeps/linux/common/munmap.c
new file mode 100644
index 0000000..736bffe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/munmap.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * munmap() for uClibc
+ *
+ * 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 <unistd.h>
+#include <sys/mman.h>
+
+
+_syscall2(int, munmap, void *, start, size_t, length)
+libc_hidden_def(munmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/nanosleep.c b/ap/build/uClibc/libc/sysdeps/linux/common/nanosleep.c
new file mode 100644
index 0000000..26ce4a6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/nanosleep.c
@@ -0,0 +1,40 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * nanosleep() for uClibc
+ *
+ * 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 <time.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#include <pthreadP.h>
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+#define __NR___syscall_nanosleep __NR_nanosleep
+static inline _syscall2(int, __syscall_nanosleep, const struct timespec *, req,
+						struct timespec *, rem);
+
+extern __typeof(nanosleep) __libc_nanosleep;
+
+int __libc_nanosleep(const struct timespec *req, struct timespec *rem)
+{
+	if (SINGLE_THREAD_P)
+		return __syscall_nanosleep(req, rem);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __syscall_nanosleep(req, rem);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+
+weak_alias(__libc_nanosleep,nanosleep)
+libc_hidden_weak(nanosleep)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/nice.c b/ap/build/uClibc/libc/sysdeps/linux/common/nice.c
new file mode 100644
index 0000000..3694db8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/nice.c
@@ -0,0 +1,75 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * nice() for uClibc
+ *
+ * Copyright (C) 2005 by Manuel Novoa III <mjn3@codepoet.org>
+ * 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 <unistd.h>
+#include <sys/resource.h>
+
+
+#ifdef __NR_nice
+
+# define __NR___syscall_nice __NR_nice
+static __inline__ _syscall1(int, __syscall_nice, int, incr)
+
+#else
+
+# include <limits.h>
+
+
+static __inline__ int int_add_no_wrap(int a, int b)
+{
+	int s = a + b;
+
+	if (b < 0) {
+		if (s > a) s = INT_MIN;
+	} else {
+		if (s < a) s = INT_MAX;
+	}
+
+	return s;
+}
+
+static __inline__ int __syscall_nice(int incr)
+{
+	int old_priority;
+# if 1
+	/* This should never fail. */
+	old_priority = getpriority(PRIO_PROCESS, 0);
+# else
+	/* But if you want to be paranoid... */
+	int old_errno;
+
+	old_errno = errno;
+	__set_errno(0);
+	old_priority = getpriority(PRIO_PROCESS, 0);
+	if ((old_priority == -1) && errno) {
+		return -1;
+	}
+	__set_errno(old_errno);
+# endif
+
+	if (setpriority(PRIO_PROCESS, 0, int_add_no_wrap(old_priority, incr))) {
+		__set_errno(EPERM);	/* SUSv3 mandates EPERM for nice failure. */
+		return -1;
+	}
+
+	return 0;
+}
+
+#endif
+
+int nice(int incr)
+{
+	if (__syscall_nice(incr)) {
+		return -1;
+	}
+
+	return getpriority(PRIO_PROCESS, 0);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/noophooks.c b/ap/build/uClibc/libc/sysdeps/linux/common/noophooks.c
new file mode 100644
index 0000000..a6c9d76
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/noophooks.c
@@ -0,0 +1,29 @@
+/* Noop hooks for the instrumenting functions.
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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 <libc-internal.h>
+
+void
+__cyg_profile_func_enter (attribute_unused void *this_fn, attribute_unused void *call_site);
+void
+__cyg_profile_func_enter (attribute_unused void *this_fn, attribute_unused void *call_site)
+{
+}
+strong_alias (__cyg_profile_func_enter, __cyg_profile_func_exit)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/not-cancel.h b/ap/build/uClibc/libc/sysdeps/linux/common/not-cancel.h
new file mode 100644
index 0000000..9418417
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/not-cancel.h
@@ -0,0 +1,60 @@
+/* Uncancelable versions of cancelable interfaces.  Linux version.
+   Copyright (C) 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   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 <sysdep.h>
+
+/* Uncancelable open.  */
+#define open_not_cancel(name, flags, mode) \
+   INLINE_SYSCALL (open, 3, (const char *) (name), (flags), (mode))
+#define open_not_cancel_2(name, flags) \
+   INLINE_SYSCALL (open, 2, (const char *) (name), (flags))
+
+/* Uncancelable close.  */
+#define close_not_cancel(fd) \
+  INLINE_SYSCALL (close, 1, fd)
+#define close_not_cancel_no_status(fd) \
+  (void) ({ INTERNAL_SYSCALL_DECL (err);				      \
+	    INTERNAL_SYSCALL (close, err, 1, (fd)); })
+
+/* Uncancelable read.  */
+#define read_not_cancel(fd, buf, n) \
+  INLINE_SYSCALL (read, 3, (fd), (buf), (n))
+
+/* Uncancelable write.  */
+#define write_not_cancel(fd, buf, n) \
+  INLINE_SYSCALL (write, 3, (fd), (buf), (n))
+
+/* Uncancelable writev.  */
+#define writev_not_cancel_no_status(fd, iov, n) \
+  (void) ({ INTERNAL_SYSCALL_DECL (err);				      \
+	    INTERNAL_SYSCALL (writev, err, 3, (fd), (iov), (n)); })
+
+/* Uncancelable fcntl.  */
+#define fcntl_not_cancel(fd, cmd, val) \
+  __fcntl_nocancel (fd, cmd, val)
+
+/* Uncancelable waitpid.  */
+#ifdef __NR_waitpid
+# define waitpid_not_cancel(pid, stat_loc, options) \
+  INLINE_SYSCALL (waitpid, 3, pid, stat_loc, options)
+#else
+# define waitpid_not_cancel(pid, stat_loc, options) \
+  INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ntp_gettime.c b/ap/build/uClibc/libc/sysdeps/linux/common/ntp_gettime.c
new file mode 100644
index 0000000..83959e8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ntp_gettime.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 1999, 2002 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/timex.h>
+
+
+int ntp_gettime(struct ntptimeval *ntv)
+{
+    struct timex tntx;
+    int result;
+
+    tntx.modes = 0;
+    result = adjtimex(&tntx);
+    ntv->time = tntx.time;
+    ntv->maxerror = tntx.maxerror;
+    ntv->esterror = tntx.esterror;
+    return result;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/open.c b/ap/build/uClibc/libc/sysdeps/linux/common/open.c
new file mode 100644
index 0000000..9fb694d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/open.c
@@ -0,0 +1,39 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * open() for uClibc
+ *
+ * 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 <stdlib.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/param.h>
+
+#define __NR___syscall_open __NR_open
+static __inline__ _syscall3(int, __syscall_open, const char *, file,
+		int, flags, __kernel_mode_t, mode)
+
+int open(const char *file, int oflag, ...)
+{
+	mode_t mode = 0;
+
+	if (oflag & O_CREAT) {
+		va_list arg;
+		va_start(arg, oflag);
+		mode = va_arg(arg, mode_t);
+		va_end(arg);
+	}
+
+	return __syscall_open(file, oflag, mode);
+}
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(open)
+#else
+libc_hidden_weak(open)
+strong_alias(open,__libc_open)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/open64.c b/ap/build/uClibc/libc/sysdeps/linux/common/open64.c
new file mode 100644
index 0000000..c1f5400
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/open64.c
@@ -0,0 +1,57 @@
+/*
+ * 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 <fcntl.h>
+#include <stdarg.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <errno.h>
+#include <sysdep-cancel.h>
+#endif
+
+#ifdef __UCLIBC_HAS_LFS__
+
+#ifndef O_LARGEFILE
+# define O_LARGEFILE	0100000
+#endif
+
+/* Open FILE with access OFLAG.  If OFLAG includes O_CREAT,
+   a third argument is the file protection.  */
+int open64 (const char *file, int oflag, ...)
+{
+    mode_t mode = 0;
+
+    if (oflag & O_CREAT)
+    {
+	va_list arg;
+	va_start (arg, oflag);
+	mode = va_arg (arg, mode_t);
+	va_end (arg);
+    }
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (open, 3, file, oflag | O_LARGEFILE, mode);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  int result = INLINE_SYSCALL (open, 3, file, oflag | O_LARGEFILE, mode);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+#else
+  return open(file, oflag | O_LARGEFILE, mode);
+#endif
+}
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(open64)
+#else
+libc_hidden_weak(open64)
+strong_alias(open64,__libc_open64)
+#endif
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/openat.c b/ap/build/uClibc/libc/sysdeps/linux/common/openat.c
new file mode 100644
index 0000000..8380ec6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/openat.c
@@ -0,0 +1,25 @@
+/*
+ * openat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define openat __xx_openat
+#include <sys/syscall.h>
+#include <fcntl.h>
+#undef openat
+
+#ifdef __NR_openat
+/* The openat() prototype is varargs based, but we don't care about that
+ * here, so need to provide our own dedicated signature.
+ */
+extern int openat(int fd, const char *file, int oflag, mode_t mode);
+libc_hidden_proto(openat)
+
+_syscall4(int, openat, int, fd, const char *, file, int, oflag, mode_t, mode)
+libc_hidden_def(openat)
+#else
+/* should add emulation with open() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/openat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/openat64.c
new file mode 100644
index 0000000..06a5819
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/openat64.c
@@ -0,0 +1,32 @@
+/*
+ * openat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define openat64 __xx_openat
+#include <sys/syscall.h>
+#include <fcntl.h>
+#undef openat64
+
+#ifdef __UCLIBC_HAS_LFS__
+
+#ifdef __NR_openat
+/* The openat() prototype is varargs based, but we don't care about that
+ * here, so need to provide our own dedicated signature.
+ */
+extern int openat64(int fd, const char *file, int oflag, mode_t mode);
+libc_hidden_proto(openat64)
+
+int openat64(int fd, const char *file, int oflag, mode_t mode)
+{
+	return openat(fd, file, oflag | O_LARGEFILE, mode);
+}
+libc_hidden_def(openat64)
+#else
+/* should add emulation with open() and /proc/self/fd/ ... */
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pause.c b/ap/build/uClibc/libc/sysdeps/linux/common/pause.c
new file mode 100644
index 0000000..ab16fa7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pause.c
@@ -0,0 +1,41 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * pause() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define __UCLIBC_HIDE_DEPRECATED__
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#endif
+
+#include <signal.h>
+
+/* Suspend the process until a signal arrives.
+   This always returns -1 and sets errno to EINTR.  */
+extern __typeof(pause) __libc_pause;
+int
+__libc_pause (void)
+{
+  sigset_t set;
+
+  /*__sigemptyset (&set); - why? */
+  sigprocmask (SIG_BLOCK, NULL, &set);
+
+  /* pause is a cancellation point, but so is sigsuspend.
+     So no need for anything special here.  */
+
+  return sigsuspend (&set);
+}
+weak_alias (__libc_pause, pause)
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+LIBC_CANCEL_HANDLED ();		/* sigsuspend handles our cancellation.  */
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/personality.c b/ap/build/uClibc/libc/sysdeps/linux/common/personality.c
new file mode 100644
index 0000000..fa304de
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/personality.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * personality() for uClibc
+ *
+ * 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 <sys/personality.h>
+_syscall1(int, personality, unsigned long int, __persona)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pipe.c b/ap/build/uClibc/libc/sysdeps/linux/common/pipe.c
new file mode 100644
index 0000000..8eae27c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pipe.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * pipe() for uClibc
+ *
+ * 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 <unistd.h>
+
+
+_syscall1(int, pipe, int *, filedes)
+libc_hidden_def(pipe)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pipe2.c b/ap/build/uClibc/libc/sysdeps/linux/common/pipe2.c
new file mode 100644
index 0000000..0a3686d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pipe2.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * pipe2() for uClibc
+ *
+ * Copyright (C) 2011 Bernhard Reutner-Fischer <uclibc@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_pipe2
+_syscall2(int, pipe2, int *, filedes, int, flags)
+libc_hidden_def(pipe2)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pivot_root.c b/ap/build/uClibc/libc/sysdeps/linux/common/pivot_root.c
new file mode 100644
index 0000000..0e738d5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pivot_root.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * pivot_root() for uClibc
+ *
+ * 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>
+
+int pivot_root(const char *new_root, const char *put_old);
+#ifdef __NR_pivot_root
+_syscall2(int, pivot_root, const char *, new_root, const char *, put_old)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/poll.c b/ap/build/uClibc/libc/sysdeps/linux/common/poll.c
new file mode 100644
index 0000000..3895e0d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/poll.c
@@ -0,0 +1,230 @@
+/* Copyright (C) 1994,1996,1997,1998,1999,2001,2002
+   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 <sys/poll.h>
+#include <bits/kernel-features.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+libc_hidden_proto(poll)
+
+#if defined __ASSUME_POLL_SYSCALL && defined __NR_poll
+
+#define __NR___syscall_poll __NR_poll
+static inline _syscall3(int, __syscall_poll, struct pollfd *, fds,
+			unsigned long int, nfds, int, timeout);
+
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
+{
+    if (SINGLE_THREAD_P)
+	return __syscall_poll(fds, nfds, timeout);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+    int oldtype = LIBC_CANCEL_ASYNC ();
+    int result = __syscall_poll(fds, nfds, timeout);
+    LIBC_CANCEL_RESET (oldtype);
+    return result;
+#endif
+}
+#else /* !__NR_poll */
+
+#include <alloca.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/time.h>
+#include <sys/param.h>
+#include <unistd.h>
+
+libc_hidden_proto(getdtablesize)
+libc_hidden_proto(select)
+
+/* uClinux 2.0 doesn't have poll, emulate it using select */
+
+/* Poll the file descriptors described by the NFDS structures starting at
+   FDS.  If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
+   an event to occur; if TIMEOUT is -1, block until an event occurs.
+   Returns the number of file descriptors with events, zero if timed out,
+   or -1 for errors.  */
+
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
+{
+    static int max_fd_size;
+    struct timeval tv;
+    fd_set *rset, *wset, *xset;
+    struct pollfd *f;
+    int ready;
+    int maxfd = 0;
+    int bytes;
+
+    if (!max_fd_size)
+	max_fd_size = getdtablesize ();
+
+    bytes = howmany (max_fd_size, __NFDBITS);
+    rset = alloca (bytes);
+    wset = alloca (bytes);
+    xset = alloca (bytes);
+
+    /* We can't call FD_ZERO, since FD_ZERO only works with sets
+       of exactly __FD_SETSIZE size.  */
+    memset (rset, 0, bytes);
+    memset (wset, 0, bytes);
+    memset (xset, 0, bytes);
+
+    for (f = fds; f < &fds[nfds]; ++f)
+    {
+	f->revents = 0;
+	if (f->fd >= 0)
+	{
+	    if (f->fd >= max_fd_size)
+	    {
+		/* The user provides a file descriptor number which is higher
+		   than the maximum we got from the `getdtablesize' call.
+		   Maybe this is ok so enlarge the arrays.  */
+		fd_set *nrset, *nwset, *nxset;
+		int nbytes;
+
+		max_fd_size = roundup (f->fd, __NFDBITS);
+		nbytes = howmany (max_fd_size, __NFDBITS);
+
+		nrset = alloca (nbytes);
+		nwset = alloca (nbytes);
+		nxset = alloca (nbytes);
+
+		memset ((char *) nrset + bytes, 0, nbytes - bytes);
+		memset ((char *) nwset + bytes, 0, nbytes - bytes);
+		memset ((char *) nxset + bytes, 0, nbytes - bytes);
+
+		rset = memcpy (nrset, rset, bytes);
+		wset = memcpy (nwset, wset, bytes);
+		xset = memcpy (nxset, xset, bytes);
+
+		bytes = nbytes;
+	    }
+
+	    if (f->events & POLLIN)
+		FD_SET (f->fd, rset);
+	    if (f->events & POLLOUT)
+		FD_SET (f->fd, wset);
+	    if (f->events & POLLPRI)
+		FD_SET (f->fd, xset);
+	    if (f->fd > maxfd && (f->events & (POLLIN|POLLOUT|POLLPRI)))
+		maxfd = f->fd;
+	}
+    }
+
+    tv.tv_sec = timeout / 1000;
+    tv.tv_usec = (timeout % 1000) * 1000;
+
+    while (1)
+    {
+	ready = select (maxfd + 1, rset, wset, xset,
+		timeout == -1 ? NULL : &tv);
+
+	/* It might be that one or more of the file descriptors is invalid.
+	   We now try to find and mark them and then try again.  */
+	if (ready == -1 && errno == EBADF)
+	{
+	    fd_set *sngl_rset = alloca (bytes);
+	    fd_set *sngl_wset = alloca (bytes);
+	    fd_set *sngl_xset = alloca (bytes);
+	    struct timeval sngl_tv;
+
+	    /* Clear the original set.  */
+	    memset (rset, 0, bytes);
+	    memset (wset, 0, bytes);
+	    memset (xset, 0, bytes);
+
+	    /* This means we don't wait for input.  */
+	    sngl_tv.tv_sec = 0;
+	    sngl_tv.tv_usec = 0;
+
+	    maxfd = -1;
+
+	    /* Reset the return value.  */
+	    ready = 0;
+
+	    for (f = fds; f < &fds[nfds]; ++f)
+		if (f->fd != -1 && (f->events & (POLLIN|POLLOUT|POLLPRI))
+			&& (f->revents & POLLNVAL) == 0)
+		{
+		    int n;
+
+		    memset (sngl_rset, 0, bytes);
+		    memset (sngl_wset, 0, bytes);
+		    memset (sngl_xset, 0, bytes);
+
+		    if (f->events & POLLIN)
+			FD_SET (f->fd, sngl_rset);
+		    if (f->events & POLLOUT)
+			FD_SET (f->fd, sngl_wset);
+		    if (f->events & POLLPRI)
+			FD_SET (f->fd, sngl_xset);
+
+		    n = select (f->fd + 1, sngl_rset, sngl_wset, sngl_xset,
+			    &sngl_tv);
+		    if (n != -1)
+		    {
+			/* This descriptor is ok.  */
+			if (f->events & POLLIN)
+			    FD_SET (f->fd, rset);
+			if (f->events & POLLOUT)
+			    FD_SET (f->fd, wset);
+			if (f->events & POLLPRI)
+			    FD_SET (f->fd, xset);
+			if (f->fd > maxfd)
+			    maxfd = f->fd;
+			if (n > 0)
+			    /* Count it as being available.  */
+			    ++ready;
+		    }
+		    else if (errno == EBADF)
+			f->revents |= POLLNVAL;
+		}
+	    /* Try again.  */
+	    continue;
+	}
+
+	break;
+    }
+
+    if (ready > 0)
+	for (f = fds; f < &fds[nfds]; ++f)
+	{
+	    if (f->fd >= 0)
+	    {
+		if (FD_ISSET (f->fd, rset))
+		    f->revents |= POLLIN;
+		if (FD_ISSET (f->fd, wset))
+		    f->revents |= POLLOUT;
+		if (FD_ISSET (f->fd, xset))
+		    f->revents |= POLLPRI;
+	    }
+	}
+
+    return ready;
+}
+
+#endif
+libc_hidden_def(poll)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/posix_fadvise.c b/ap/build/uClibc/libc/sysdeps/linux/common/posix_fadvise.c
new file mode 100644
index 0000000..17831c2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/posix_fadvise.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise() for 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>
+
+#ifdef __NR_fadvise64
+#define __NR_posix_fadvise __NR_fadvise64
+int posix_fadvise(int fd, off_t offset, off_t len, int advice)
+{
+	INTERNAL_SYSCALL_DECL(err);
+	int ret = (int) (INTERNAL_SYSCALL(posix_fadvise, err, 5, fd,
+	 __LONG_LONG_PAIR (offset >> 31, offset), len, advice));
+    if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+      return INTERNAL_SYSCALL_ERRNO (ret, err);
+    return 0;
+}
+
+#if defined __UCLIBC_HAS_LFS__ && !defined __NR_fadvise64_64
+strong_alias(posix_fadvise,posix_fadvise64)
+#endif
+
+#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/common/posix_fadvise64.c b/ap/build/uClibc/libc/sysdeps/linux/common/posix_fadvise64.c
new file mode 100644
index 0000000..e8a530f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/posix_fadvise64.c
@@ -0,0 +1,70 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise64() for 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__
+#ifdef __NR_fadvise64_64
+
+/* 64 bit implementation is cake ... or more like pie ... */
+#if __WORDSIZE == 64
+
+#define __NR_posix_fadvise64 __NR_fadvise64_64
+
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
+{
+  if (len != (off_t) len)
+    return EOVERFLOW;
+  INTERNAL_SYSCALL_DECL (err);
+    int ret = INTERNAL_SYSCALL (posix_fadvise64, err, 5, fd,
+                               __LONG_LONG_PAIR ((long) (offset >> 32),
+                                                 (long) offset),
+                               (off_t) len, advice);
+  if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
+    return 0;
+  return INTERNAL_SYSCALL_ERRNO (ret, err);
+}
+
+/* 32 bit implementation is kind of a pita */
+#elif __WORDSIZE == 32
+
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
+{
+	INTERNAL_SYSCALL_DECL (err);
+	int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
+								__LONG_LONG_PAIR(offset >> 32, offset &  0xffffffff),
+								__LONG_LONG_PAIR(len >> 32, len & 0xffffffff),
+								advice);
+	if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
+		return 0;
+	return INTERNAL_SYSCALL_ERRNO (ret, err);
+}
+
+#else
+#error your machine is neither 32 bit or 64 bit ... it must be magical
+#endif
+
+#elif !defined __NR_fadvise64 && defined __UCLIBC_HAS_STUBS__
+/* This is declared as a strong alias in posix_fadvise.c if __NR_fadvise64
+ * is defined.
+ */
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
+{
+	return ENOSYS;
+}
+#endif /* __NR_fadvise64_64 */
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ppoll.c b/ap/build/uClibc/libc/sysdeps/linux/common/ppoll.c
new file mode 100644
index 0000000..09b2b15
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ppoll.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
+
+   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 <signal.h>
+#include <sys/syscall.h>
+#include <sys/poll.h>
+#define __need_NULL
+#include <stddef.h>
+
+#if defined __NR_ppoll && defined __UCLIBC_LINUX_SPECIFIC__
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#  include <sysdep-cancel.h>
+# else
+#  define SINGLE_THREAD_P 1
+# endif
+
+int
+ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
+       const sigset_t *sigmask)
+{
+	/* The Linux kernel can in some situations update the timeout value.
+	   We do not want that so use a local variable.  */
+	struct timespec tval;
+	if (timeout != NULL) {
+		tval = *timeout;
+		timeout = &tval;
+	}
+  if (SINGLE_THREAD_P)
+		return INLINE_SYSCALL(ppoll, 5, fds, nfds, timeout, sigmask, _NSIG / 8);
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = INLINE_SYSCALL(ppoll, 5, fds, nfds, timeout, sigmask, _NSIG / 8);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+# endif
+}
+libc_hidden_def(ppoll)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/prctl.c b/ap/build/uClibc/libc/sysdeps/linux/common/prctl.c
new file mode 100644
index 0000000..39c0d4f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/prctl.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * prctl() for uClibc
+ *
+ * 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 <stdarg.h>
+/* psm: including sys/prctl.h would depend on kernel headers */
+
+#ifdef __NR_prctl
+extern int prctl (int, long, long, long, long);
+_syscall5(int, prctl, int, option, long, _a2, long, _a3, long, _a4, long, _a5)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pread_write.c b/ap/build/uClibc/libc/sysdeps/linux/common/pread_write.c
new file mode 100644
index 0000000..88e6957
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pread_write.c
@@ -0,0 +1,187 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/*
+ * Based in part on the files
+ *		./sysdeps/unix/sysv/linux/pwrite.c,
+ *		./sysdeps/unix/sysv/linux/pread.c,
+ *		sysdeps/posix/pread.c
+ *		sysdeps/posix/pwrite.c
+ * from GNU libc 2.2.5, but reworked considerably...
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <endian.h>
+
+extern __typeof(pread) __libc_pread;
+extern __typeof(pwrite) __libc_pwrite;
+#ifdef __UCLIBC_HAS_LFS__
+extern __typeof(pread64) __libc_pread64;
+extern __typeof(pwrite64) __libc_pwrite64;
+#endif
+
+#include <bits/kernel_types.h>
+
+#ifdef __NR_pread
+
+# define __NR___syscall_pread __NR_pread
+static __inline__ _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
+		size_t, count, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
+}
+weak_alias(__libc_pread,pread)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
+{
+	uint32_t low = offset & 0xffffffff;
+	uint32_t high = offset >> 32;
+	return __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
+}
+weak_alias(__libc_pread64,pread64)
+# endif /* __UCLIBC_HAS_LFS__  */
+
+#endif /* __NR_pread */
+
+#ifdef __NR_pwrite
+
+# define __NR___syscall_pwrite __NR_pwrite
+static __inline__ _syscall5(ssize_t, __syscall_pwrite, int, fd, const void *, buf,
+		size_t, count, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+	return __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
+}
+weak_alias(__libc_pwrite,pwrite)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
+{
+	uint32_t low = offset & 0xffffffff;
+	uint32_t high = offset >> 32;
+	return __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
+}
+weak_alias(__libc_pwrite64,pwrite64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* __NR_pwrite */
+
+#if ! defined __NR_pread || ! defined __NR_pwrite
+
+static ssize_t __fake_pread_write(int fd, void *buf,
+		size_t count, off_t offset, int do_pwrite)
+{
+	int save_errno;
+	ssize_t result;
+	off_t old_offset;
+
+	/* Since we must not change the file pointer preserve the
+	 * value so that we can restore it later.  */
+	if ((old_offset=lseek(fd, 0, SEEK_CUR)) == (off_t) -1)
+		return -1;
+
+	/* Set to wanted position.  */
+	if (lseek(fd, offset, SEEK_SET) == (off_t) -1)
+		return -1;
+
+	if (do_pwrite == 1) {
+		/* Write the data.  */
+		result = write(fd, buf, count);
+	} else {
+		/* Read the data.  */
+		result = read(fd, buf, count);
+	}
+
+	/* Now we have to restore the position.  If this fails we
+	 * have to return this as an error.  */
+	save_errno = errno;
+	if (lseek(fd, old_offset, SEEK_SET) == (off_t) -1)
+	{
+		if (result == -1)
+			__set_errno(save_errno);
+		return -1;
+	}
+	__set_errno(save_errno);
+	return(result);
+}
+
+# ifdef __UCLIBC_HAS_LFS__
+
+static ssize_t __fake_pread_write64(int fd, void *buf,
+		size_t count, off64_t offset, int do_pwrite)
+{
+	int save_errno;
+	ssize_t result;
+	off64_t old_offset;
+
+	/* Since we must not change the file pointer preserve the
+	 * value so that we can restore it later.  */
+	if ((old_offset=lseek64(fd, 0, SEEK_CUR)) == (off64_t) -1)
+		return -1;
+
+	/* Set to wanted position.  */
+	if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1)
+		return -1;
+
+	if (do_pwrite == 1) {
+		/* Write the data.  */
+		result = write(fd, buf, count);
+	} else {
+		/* Read the data.  */
+		result = read(fd, buf, count);
+	}
+
+	/* Now we have to restore the position. */
+	save_errno = errno;
+	if (lseek64(fd, old_offset, SEEK_SET) == (off64_t) -1) {
+		if (result == -1)
+			__set_errno (save_errno);
+		return -1;
+	}
+	__set_errno (save_errno);
+	return result;
+}
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /*  ! defined __NR_pread || ! defined __NR_pwrite */
+
+#ifndef __NR_pread
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return __fake_pread_write(fd, buf, count, offset, 0);
+}
+weak_alias(__libc_pread,pread)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
+{
+	return __fake_pread_write64(fd, buf, count, offset, 0);
+}
+weak_alias(__libc_pread64,pread64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* ! __NR_pread */
+
+#ifndef __NR_pwrite
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+	/* we won't actually be modifying the buffer,
+	 *just cast it to get rid of warnings */
+	return __fake_pread_write(fd, (void*)buf, count, offset, 1);
+}
+weak_alias(__libc_pwrite,pwrite)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
+{
+	return __fake_pread_write64(fd, (void*)buf, count, offset, 1);
+}
+weak_alias(__libc_pwrite64,pwrite64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* ! __NR_pwrite */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pselect.c b/ap/build/uClibc/libc/sysdeps/linux/common/pselect.c
new file mode 100644
index 0000000..7e93537
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pselect.c
@@ -0,0 +1,94 @@
+/* Copyright (C) 1996-1998,2001,2002,2003,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   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 <signal.h>
+#include <stddef.h>	/* For NULL.  */
+#include <sys/time.h>
+#include <sys/select.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#endif
+
+libc_hidden_proto(sigprocmask)
+libc_hidden_proto(select)
+
+
+/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
+   readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
+   (if not NULL) for exceptional conditions.  If TIMEOUT is not NULL, time out
+   after waiting the interval specified therein.  Additionally set the sigmask
+   SIGMASK for this call.  Returns the number of ready descriptors, or -1 for
+   errors.  */
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+static int
+__pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+#else
+int
+pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+#endif
+	   const struct timespec *timeout, const sigset_t *sigmask)
+{
+  struct timeval tval;
+  int retval;
+  sigset_t savemask;
+
+  /* Change nanosecond number to microseconds.  This might mean losing
+     precision and therefore the `pselect` should be available.  But
+     for now it is hardly found.  */
+  if (timeout != NULL)
+    TIMESPEC_TO_TIMEVAL (&tval, timeout);
+
+  /* The setting and restoring of the signal mask and the select call
+     should be an atomic operation.  This can't be done without kernel
+     help.  */
+  if (sigmask != NULL)
+    sigprocmask (SIG_SETMASK, sigmask, &savemask);
+
+  /* Note the pselect() is a cancellation point.  But since we call
+     select() which itself is a cancellation point we do not have
+     to do anything here.  */
+  retval = select (nfds, readfds, writefds, exceptfds,
+		     timeout != NULL ? &tval : NULL);
+
+  if (sigmask != NULL)
+    sigprocmask (SIG_SETMASK, &savemask, NULL);
+
+  return retval;
+}
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+int
+pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+	   const struct timespec *timeout, const sigset_t *sigmask)
+{
+	if (SINGLE_THREAD_P)
+		return __pselect (nfds, readfds, writefds, exceptfds,
+				  timeout, sigmask);
+
+	int oldtype = LIBC_CANCEL_ASYNC ();
+
+	int result = __pselect (nfds, readfds, writefds, exceptfds,
+				 timeout, sigmask);
+
+	LIBC_CANCEL_RESET (oldtype);
+
+	return result;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ptrace.c b/ap/build/uClibc/libc/sysdeps/linux/common/ptrace.c
new file mode 100644
index 0000000..8b8ebf0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ptrace.c
@@ -0,0 +1,43 @@
+/*
+ * 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 <sys/types.h>
+#include <sys/ptrace.h>
+#include <stdarg.h>
+
+#if defined __NR_ptrace && defined __USE_BSD && defined __USE_MISC
+#define __NR___syscall_ptrace __NR_ptrace
+
+static __inline__ _syscall4(long, __syscall_ptrace, enum __ptrace_request, request,
+		__kernel_pid_t, pid, void*, addr, void*, data)
+
+long int
+ptrace (enum __ptrace_request request, ...)
+{
+  long int res, ret;
+  va_list ap;
+  pid_t pid;
+  void *addr, *data;
+
+  va_start (ap, request);
+  pid = va_arg (ap, pid_t);
+  addr = va_arg (ap, void *);
+  data = va_arg (ap, void *);
+  va_end (ap);
+
+  if (request > 0 && request < 4)
+    data = &ret;
+
+  res = __syscall_ptrace(request, pid, addr, data);
+  if (res >= 0 && request > 0 && request < 4) {
+      __set_errno(0);
+      return ret;
+    }
+
+  return res;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/query_module.c b/ap/build/uClibc/libc/sysdeps/linux/common/query_module.c
new file mode 100644
index 0000000..7c168df
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/query_module.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * query_module() for uClibc
+ *
+ * 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>
+int query_module(const char *name attribute_unused, int which attribute_unused,
+				 void *buf attribute_unused, size_t bufsize attribute_unused, size_t * ret attribute_unused);
+#ifdef __NR_query_module
+_syscall5(int, query_module, const char *, name, int, which,
+		  void *, buf, size_t, bufsize, size_t *, ret)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/quotactl.c b/ap/build/uClibc/libc/sysdeps/linux/common/quotactl.c
new file mode 100644
index 0000000..edd5092
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/quotactl.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * quotactl() for uClibc
+ *
+ * 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>
+
+#if defined __USE_BSD
+#include <sys/quota.h>
+_syscall4(int, quotactl, int, cmd, const char *, special,
+		  int, id, caddr_t, addr)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/read.c b/ap/build/uClibc/libc/sysdeps/linux/common/read.c
new file mode 100644
index 0000000..9e122fc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/read.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * read() for uClibc
+ *
+ * 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 <unistd.h>
+
+_syscall3(ssize_t, read, int, fd, __ptr_t, buf, size_t, count)
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(read)
+#else
+libc_hidden_weak(read)
+strong_alias(read,__libc_read)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/readahead.c b/ap/build/uClibc/libc/sysdeps/linux/common/readahead.c
new file mode 100644
index 0000000..cd40352
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/readahead.c
@@ -0,0 +1,58 @@
+/* Provide kernel hint to read ahead.
+   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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 <fcntl.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <bits/wordsize.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+
+#include <_lfs_64.h>
+
+#ifdef __NR_readahead
+
+# define __NR___readahead __NR_readahead
+
+# if __WORDSIZE == 64
+
+static __inline__ _syscall3(ssize_t, __readahead, int, fd,
+	off_t, offset, size_t, count)
+
+ssize_t readahead(int fd, off_t offset, size_t count)
+{
+	return __readahead(fd, offset, count);
+}
+
+# else
+
+static __inline__ _syscall4(ssize_t, __readahead, int, fd,
+	off_t, high_offset, off_t, low_offset, size_t, count)
+
+ssize_t readahead(int fd, off64_t offset, size_t count)
+{
+	return __readahead(fd, (off_t) (offset >> 32), (off_t) (offset & 0xffffffff), count);
+}
+
+# endif
+
+#endif
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/readlink.c b/ap/build/uClibc/libc/sysdeps/linux/common/readlink.c
new file mode 100644
index 0000000..ef9e835
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/readlink.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * readlink() for uClibc
+ *
+ * Copyright (C) 2000-2007 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+_syscall3(ssize_t, readlink, const char *, path, char *, buf, size_t, bufsiz)
+libc_hidden_def(readlink)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/readlinkat.c b/ap/build/uClibc/libc/sysdeps/linux/common/readlinkat.c
new file mode 100644
index 0000000..d0a98e1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/readlinkat.c
@@ -0,0 +1,16 @@
+/*
+ * readlinkat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_readlinkat
+_syscall4(ssize_t, readlinkat, int, fd, const char *, path, char *, buf, size_t, len)
+#else
+/* should add emulation with readlink() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/readv.c b/ap/build/uClibc/libc/sysdeps/linux/common/readv.c
new file mode 100644
index 0000000..fce396d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/readv.c
@@ -0,0 +1,50 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * readv() for uClibc
+ *
+ * Copyright (C) 2006 by Steven J. Hill <sjhill@realitydiluted.com>
+ * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/uio.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+
+/* We should deal with kernel which have a smaller UIO_FASTIOV as well
+   as a very big count.  */
+static ssize_t __readv (int fd, const struct iovec *vector, int count)
+{
+  ssize_t bytes_read;
+
+  bytes_read = INLINE_SYSCALL (readv, 3, fd, vector, count);
+
+  if (bytes_read >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
+    return bytes_read;
+
+  /* glibc tries again, but we do not. */
+  //return __atomic_readv_replacement (fd, vector, count);
+
+  return -1;
+}
+
+ssize_t readv (int fd, const struct iovec *vector, int count)
+{
+  if (SINGLE_THREAD_P)
+    return __readv (fd, vector, count);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  int result = __readv (fd, vector, count);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+#else
+_syscall3(ssize_t, readv, int, filedes, const struct iovec *, vector,
+		  int, count)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/reboot.c b/ap/build/uClibc/libc/sysdeps/linux/common/reboot.c
new file mode 100644
index 0000000..ec271b1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/reboot.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * _reboot() for uClibc
+ *
+ * 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 <sys/reboot.h>
+#define __NR__reboot __NR_reboot
+static __inline__ _syscall3(int, _reboot, int, magic, int, magic2, int, flag)
+int reboot(int flag)
+{
+	return (_reboot((int) 0xfee1dead, 672274793, flag));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/remap_file_pages.c b/ap/build/uClibc/libc/sysdeps/linux/common/remap_file_pages.c
new file mode 100644
index 0000000..0512b88
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/remap_file_pages.c
@@ -0,0 +1,16 @@
+/*
+ * remap_file_pages() for uClibc
+ *
+ * Copyright (C) 2008 Will Newton <will.newton@imgtec.com>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_remap_file_pages
+
+_syscall5(int, remap_file_pages, void *, __start, size_t, __size,
+			int, __prot, size_t, __pgoff, int, __flags)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/rename.c b/ap/build/uClibc/libc/sysdeps/linux/common/rename.c
new file mode 100644
index 0000000..9d8397a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/rename.c
@@ -0,0 +1,24 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * rename() for uClibc
+ *
+ * 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 <unistd.h>
+#include <string.h>
+#include <sys/param.h>
+#include <stdio.h>
+
+#define __NR___syscall_rename __NR_rename
+static __inline__ _syscall2(int, __syscall_rename, const char *, oldpath,
+		const char *, newpath)
+
+int rename(const char * oldpath, const char * newpath)
+{
+	return __syscall_rename(oldpath, newpath);
+}
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/renameat.c b/ap/build/uClibc/libc/sysdeps/linux/common/renameat.c
new file mode 100644
index 0000000..a898f7b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/renameat.c
@@ -0,0 +1,16 @@
+/*
+ * renameat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <stdio.h>
+
+#ifdef __NR_renameat
+_syscall4(int, renameat, int, oldfd, const char *, old, int, newfd, const char *, new)
+#else
+/* should add emulation with rename() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/rmdir.c b/ap/build/uClibc/libc/sysdeps/linux/common/rmdir.c
new file mode 100644
index 0000000..bad6654
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/rmdir.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * rmdir() for uClibc
+ *
+ * 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 <unistd.h>
+
+
+_syscall1(int, rmdir, const char *, pathname)
+libc_hidden_def(rmdir)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sbrk.c b/ap/build/uClibc/libc/sysdeps/linux/common/sbrk.c
new file mode 100644
index 0000000..4f0a8c4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sbrk.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <errno.h>
+
+
+/* Defined in brk.c.  */
+extern void *__curbrk attribute_hidden;
+
+/* Extend the process's data space by INCREMENT.
+   If INCREMENT is negative, shrink data space by - INCREMENT.
+   Return start of new space allocated, or -1 for errors.  */
+void * sbrk (intptr_t increment)
+{
+    void *oldbrk;
+
+    if (__curbrk == NULL)
+	if (brk (NULL) < 0)	/* Initialize the break.  */
+	    return (void *) -1;
+
+    if (increment == 0)
+	return __curbrk;
+
+    oldbrk = __curbrk;
+    if (brk (oldbrk + increment) < 0)
+	return (void *) -1;
+
+    return oldbrk;
+}
+libc_hidden_def(sbrk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_cpucount.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_cpucount.c
new file mode 100644
index 0000000..331c0b8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_cpucount.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2007 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 <limits.h>
+#include <sched.h>
+
+
+int
+__sched_cpucount (size_t setsize, const cpu_set_t *setp)
+{
+  int s = 0;
+  const __cpu_mask *p = setp->__bits;
+  const __cpu_mask *end = &setp->__bits[setsize / sizeof (__cpu_mask)];
+
+  while (p < end)
+    {
+      __cpu_mask l = *p++;
+
+#ifdef POPCNT
+      s += POPCNT (l);
+#else
+      if (l == 0)
+	continue;
+
+# if LONG_BIT > 32
+      l = (l & 0x5555555555555555ul) + ((l >> 1) & 0x5555555555555555ul);
+      l = (l & 0x3333333333333333ul) + ((l >> 2) & 0x3333333333333333ul);
+      l = (l & 0x0f0f0f0f0f0f0f0ful) + ((l >> 4) & 0x0f0f0f0f0f0f0f0ful);
+      l = (l & 0x00ff00ff00ff00fful) + ((l >> 8) & 0x00ff00ff00ff00fful);
+      l = (l & 0x0000ffff0000fffful) + ((l >> 16) & 0x0000ffff0000fffful);
+      l = (l & 0x00000000fffffffful) + ((l >> 32) & 0x00000000fffffffful);
+# else
+      l = (l & 0x55555555ul) + ((l >> 1) & 0x55555555ul);
+      l = (l & 0x33333333ul) + ((l >> 2) & 0x33333333ul);
+      l = (l & 0x0f0f0f0ful) + ((l >> 4) & 0x0f0f0f0ful);
+      l = (l & 0x00ff00fful) + ((l >> 8) & 0x00ff00fful);
+      l = (l & 0x0000fffful) + ((l >> 16) & 0x0000fffful);
+# endif
+
+      s += l;
+#endif
+    }
+
+  return s;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_max.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_max.c
new file mode 100644
index 0000000..cf5447c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_max.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_get_priority_max() for uClibc
+ *
+ * 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 <sched.h>
+_syscall1(int, sched_get_priority_max, int, policy)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_min.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_min.c
new file mode 100644
index 0000000..884efed
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_min.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_get_priority_min() for uClibc
+ *
+ * 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 <sched.h>
+_syscall1(int, sched_get_priority_min, int, policy)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_getaffinity.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getaffinity.c
new file mode 100644
index 0000000..8982582
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getaffinity.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 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.  */
+
+#include <features.h>
+#ifdef __USE_GNU
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#include <string.h>
+#include <sys/param.h>
+
+#if defined __NR_sched_getaffinity
+#define __NR___syscall_sched_getaffinity __NR_sched_getaffinity
+static __inline__ _syscall3(int, __syscall_sched_getaffinity, __kernel_pid_t, pid,
+			size_t, cpusetsize, cpu_set_t *, cpuset)
+
+int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
+{
+	int res = (__syscall_sched_getaffinity(pid, MIN(INT_MAX, cpusetsize),
+					       cpuset));
+
+	if (res != -1) {
+		/* Clean the rest of the memory the kernel didn't do.  */
+		memset ((char *) cpuset + res, '\0', cpusetsize - res);
+
+		res = 0;
+	}
+	return res;
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_getcpu.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getcpu.c
new file mode 100644
index 0000000..bc858ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getcpu.c
@@ -0,0 +1,24 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_getcpu() for uClibc
+ *
+ * Copyright (C) 2011 Bernhard Reutner-Fischer <uclibc@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <stdlib.h>
+#include <errno.h>
+#include <sched.h>
+#include <sysdep.h>
+
+#if defined __NR_getcpu
+int
+sched_getcpu (void)
+{
+  unsigned int cpu;
+  int r = INLINE_SYSCALL (getcpu, 3, &cpu, NULL, NULL);
+
+  return r == -1 ? r : cpu;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_getparam.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getparam.c
new file mode 100644
index 0000000..eb17e25
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getparam.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_getparam() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#define __NR___syscall_sched_getparam __NR_sched_getparam
+static __inline__ _syscall2(int, __syscall_sched_getparam,
+		__kernel_pid_t, pid, struct sched_param *, p)
+
+int sched_getparam(pid_t pid, struct sched_param *p)
+{
+	return (__syscall_sched_getparam(pid, p));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_getscheduler.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getscheduler.c
new file mode 100644
index 0000000..e657abd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getscheduler.c
@@ -0,0 +1,20 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_getscheduler() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#define __NR___syscall_sched_getscheduler __NR_sched_getscheduler
+static __inline__ _syscall1(int, __syscall_sched_getscheduler, __kernel_pid_t, pid)
+
+int sched_getscheduler(pid_t pid)
+{
+	return (__syscall_sched_getscheduler(pid));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_rr_get_interval.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_rr_get_interval.c
new file mode 100644
index 0000000..31d620f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_rr_get_interval.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_rr_get_interval() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#define __NR___syscall_sched_rr_get_interval __NR_sched_rr_get_interval
+static __inline__ _syscall2(int, __syscall_sched_rr_get_interval,
+		__kernel_pid_t, pid, struct timespec *, tp)
+
+int sched_rr_get_interval(pid_t pid, struct timespec *tp)
+{
+	return (__syscall_sched_rr_get_interval(pid, tp));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_setaffinity.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setaffinity.c
new file mode 100644
index 0000000..980c441
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setaffinity.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 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.  */
+
+#include <features.h>
+#ifdef __USE_GNU
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <alloca.h>
+
+#if defined __NR_sched_setaffinity
+
+#define __NR___syscall_sched_setaffinity __NR_sched_setaffinity
+static __inline__ _syscall3(int, __syscall_sched_setaffinity, __kernel_pid_t, pid,
+			size_t, cpusetsize, cpu_set_t *, cpuset)
+
+static size_t __kernel_cpumask_size;
+
+int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
+{
+	size_t cnt;
+	if (unlikely (__kernel_cpumask_size == 0)) {
+		INTERNAL_SYSCALL_DECL (err);
+		int res;
+		size_t psize = 128;
+		void *p = alloca (psize);
+
+		while (res = INTERNAL_SYSCALL (sched_getaffinity, err, 3, getpid (),
+					       psize, p),
+		       INTERNAL_SYSCALL_ERROR_P (res, err)
+		       && INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)
+			p = extend_alloca (p, psize, 2 * psize);
+
+		if (res == 0 || INTERNAL_SYSCALL_ERROR_P (res, err)) {
+			__set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
+			return -1;
+		}
+
+		__kernel_cpumask_size = res;
+	}
+
+	/* We now know the size of the kernel cpumask_t.  Make sure the user
+	   does not request to set a bit beyond that.  */
+	for (cnt = __kernel_cpumask_size; cnt < cpusetsize; ++cnt)
+		if (((char *) cpuset)[cnt] != '\0') {
+			/* Found a nonzero byte.  This means the user request cannot be
+			   fulfilled.  */
+			__set_errno (EINVAL);
+			return -1;
+		}
+
+	return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
+}
+#endif
+#endif /* __USE_GNU */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_setparam.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setparam.c
new file mode 100644
index 0000000..0f5f74f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setparam.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_setparam() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#define __NR___syscall_sched_setparam __NR_sched_setparam
+static __inline__ _syscall2(int, __syscall_sched_setparam,
+		__kernel_pid_t, pid, const struct sched_param *, p)
+
+int sched_setparam(pid_t pid, const struct sched_param *p)
+{
+	return (__syscall_sched_setparam(pid, p));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_setscheduler.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setscheduler.c
new file mode 100644
index 0000000..0af498f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setscheduler.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_setscheduler() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#define __NR___syscall_sched_setscheduler __NR_sched_setscheduler
+static __inline__ _syscall3(int, __syscall_sched_setscheduler,
+		__kernel_pid_t, pid, int, policy, const struct sched_param *, p)
+
+int sched_setscheduler(pid_t pid, int policy, const struct sched_param *p)
+{
+	return (__syscall_sched_setscheduler(pid, policy, p));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_yield.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_yield.c
new file mode 100644
index 0000000..2d584bd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_yield.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_yield() for uClibc
+ *
+ * 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 <sched.h>
+_syscall0(int, sched_yield)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/select.c b/ap/build/uClibc/libc/sysdeps/linux/common/select.c
new file mode 100644
index 0000000..029fb08
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/select.c
@@ -0,0 +1,94 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * select() for uClibc
+ *
+ * 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 <sys/select.h>
+#include <stdint.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+#define USEC_PER_SEC 1000000L
+
+extern __typeof(select) __libc_select;
+
+#if !defined(__NR__newselect) && !defined(__NR_select) && defined __USE_XOPEN2K
+# define __NR___libc_pselect6 __NR_pselect6
+static _syscall6(int, __libc_pselect6, int, n, fd_set *, readfds, fd_set *, writefds,
+        fd_set *, exceptfds, const struct timespec *, timeout,
+        const sigset_t *, sigmask)
+
+int __libc_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+                  struct timeval *timeout)
+{
+	struct timespec _ts, *ts = 0;
+	if (timeout) {
+		uint32_t usec;
+		_ts.tv_sec = timeout->tv_sec;
+
+		/* GNU extension: allow for timespec values where the sub-sec
+		* field is equal to or more than 1 second.  The kernel will
+		* reject this on us, so take care of the time shift ourself.
+		* Some applications (like readline and linphone) do this.
+		* See 'clarification on select() type calls and invalid timeouts'
+		* on the POSIX general list for more information.
+		*/
+		usec = timeout->tv_usec;
+		if (usec >= USEC_PER_SEC) {
+			_ts.tv_sec += usec / USEC_PER_SEC;
+			usec %= USEC_PER_SEC;
+		}
+		_ts.tv_nsec = usec * 1000;
+
+		ts = &_ts;
+	}
+
+	if (SINGLE_THREAD_P)
+		return __libc_pselect6(n, readfds, writefds, exceptfds, ts, 0);
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __libc_pselect6(n, readfds, writefds, exceptfds, ts, 0);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+
+}
+
+#else
+
+#ifdef __NR__newselect
+# define __NR___syscall_select __NR__newselect
+#else
+# define __NR___syscall_select __NR_select
+#endif
+
+static _syscall5(int, __syscall_select, int, n, fd_set *, readfds,
+		fd_set *, writefds, fd_set *, exceptfds, struct timeval *, timeout);
+
+int __libc_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+                  struct timeval *timeout)
+{
+	if (SINGLE_THREAD_P)
+		return __syscall_select(n, readfds, writefds, exceptfds, timeout);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __syscall_select(n, readfds, writefds, exceptfds, timeout);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+
+#endif
+
+weak_alias(__libc_select,select)
+libc_hidden_weak(select)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sendfile.c b/ap/build/uClibc/libc/sysdeps/linux/common/sendfile.c
new file mode 100644
index 0000000..89bab9f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sendfile.c
@@ -0,0 +1,23 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sendfile() for uClibc
+ *
+ * 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 <unistd.h>
+#include <sys/sendfile.h>
+
+#ifdef __NR_sendfile
+
+_syscall4(ssize_t, sendfile, int, out_fd, int, in_fd, __off_t *, offset,
+		  size_t, count)
+
+#if ! defined __NR_sendfile64 && defined __UCLIBC_HAS_LFS__
+strong_alias(sendfile,sendfile64)
+#endif
+
+#endif /* __NR_sendfile */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sendfile64.c b/ap/build/uClibc/libc/sysdeps/linux/common/sendfile64.c
new file mode 100644
index 0000000..fc5155f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sendfile64.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* sendfile64 syscall.  Copes with 64 bit and 32 bit machines
+ * and on 32 bit machines this sends things into the kernel as
+ * two 32-bit arguments (high and low 32 bits of length) that
+ * are ordered based on endianess.  It turns out endian.h has
+ * just the macro we need to order things, __LONG_LONG_PAIR.
+ */
+
+#include <features.h>
+#include <unistd.h>
+#include <errno.h>
+#include <endian.h>
+#include <stdint.h>
+#include <sys/sendfile.h>
+#include <sys/syscall.h>
+#include <bits/wordsize.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_sendfile64
+_syscall4(ssize_t,sendfile64, int, out_fd, int, in_fd, __off64_t *, offset, size_t, count)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setdomainname.c b/ap/build/uClibc/libc/sysdeps/linux/common/setdomainname.c
new file mode 100644
index 0000000..6b768b7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setdomainname.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setdomainname() for uClibc
+ *
+ * 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 <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+_syscall2(int, setdomainname, const char *, name, size_t, len)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setegid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setegid.c
new file mode 100644
index 0000000..eae57f5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setegid.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <grp.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+
+#if !defined __UCLIBC_LINUX_SPECIFIC__
+#undef __NR_setresgid
+#undef __NR_setresgid32
+#endif
+
+int setegid(gid_t gid)
+{
+    int result;
+
+    if (gid == (gid_t) ~0)
+    {
+	__set_errno (EINVAL);
+	return -1;
+    }
+
+#if (defined __NR_setresgid || defined __NR_setresgid32) && defined __USE_GNU
+    result = setresgid(-1, gid, -1);
+    if (result == -1 && errno == ENOSYS)
+	/* Will also set the saved group ID if egid != gid,
+	 * making it impossible to switch back...*/
+#endif
+	result = setregid(-1, gid);
+
+    return result;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/seteuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/seteuid.c
new file mode 100644
index 0000000..3e1611d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/seteuid.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <pwd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#if !defined __UCLIBC_LINUX_SPECIFIC__
+#undef __NR_setresuid
+#undef __NR_setresuid32
+#endif
+
+int seteuid(uid_t uid)
+{
+    int result;
+
+    if (uid == (uid_t) ~0)
+    {
+	__set_errno (EINVAL);
+	return -1;
+    }
+
+#if (defined __NR_setresuid || defined __NR_setresuid32) && defined __USE_GNU
+    result = setresuid(-1, uid, -1);
+    if (result == -1 && errno == ENOSYS)
+	/* Will also set the saved user ID if euid != uid,
+	 * making it impossible to switch back...*/
+#endif
+	result = setreuid(-1, uid);
+
+    return result;
+}
+libc_hidden_def(seteuid)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setfsgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setfsgid.c
new file mode 100644
index 0000000..78d35dd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setfsgid.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setfsgid() for uClibc
+ *
+ * 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 <sys/fsuid.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_setfsgid32)) || __WORDSIZE == 64
+# ifdef __NR_setfsgid32
+#  undef __NR_setfsgid
+#  define __NR_setfsgid __NR_setfsgid32
+# endif
+
+_syscall1(int, setfsgid, gid_t, gid)
+
+#else
+
+# define __NR___syscall_setfsgid __NR_setfsgid
+static __inline__ _syscall1(int, __syscall_setfsgid, __kernel_gid_t, gid)
+
+int setfsgid(gid_t gid)
+{
+	if (gid != (gid_t) ((__kernel_gid_t) gid)) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setfsgid(gid));
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setfsuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setfsuid.c
new file mode 100644
index 0000000..a7372bd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setfsuid.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setfsuid() for uClibc
+ *
+ * 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 <sys/fsuid.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_setfsuid32)) || __WORDSIZE == 64
+# ifdef __NR_setfsuid32
+#  undef __NR_setfsuid
+#  define __NR_setfsuid __NR_setfsuid32
+# endif
+
+_syscall1(int, setfsuid, uid_t, uid)
+
+#else
+
+# define __NR___syscall_setfsuid __NR_setfsuid
+static __inline__ _syscall1(int, __syscall_setfsuid, __kernel_uid_t, uid)
+
+int setfsuid(uid_t uid)
+{
+	if (uid != (uid_t) ((__kernel_uid_t) uid)) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setfsuid(uid));
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setgid.c
new file mode 100644
index 0000000..88341ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setgid.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setgid() for uClibc
+ *
+ * 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 <unistd.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_setgid32)) || __WORDSIZE == 64
+# ifdef __NR_setgid32
+#  undef __NR_setgid
+#  define __NR_setgid __NR_setgid32
+# endif
+
+_syscall1(int, setgid, gid_t, gid)
+
+#else
+
+# define __NR___syscall_setgid __NR_setgid
+static __inline__ _syscall1(int, __syscall_setgid, __kernel_gid_t, gid)
+
+int setgid(gid_t gid)
+{
+	if (gid == (gid_t) ~ 0 || gid != (gid_t) ((__kernel_gid_t) gid)) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setgid(gid));
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setgroups.c b/ap/build/uClibc/libc/sysdeps/linux/common/setgroups.c
new file mode 100644
index 0000000..72c9878
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setgroups.c
@@ -0,0 +1,64 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setgroups() for uClibc
+ *
+ * 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 <stdlib.h>
+#include <unistd.h>
+#include <grp.h>
+
+#ifdef __USE_BSD
+
+
+#if defined(__NR_setgroups32)
+# undef __NR_setgroups
+# define __NR_setgroups __NR_setgroups32
+_syscall2(int, setgroups, size_t, size, const gid_t *, list)
+
+#elif __WORDSIZE == 64
+_syscall2(int, setgroups, size_t, size, const gid_t *, list)
+
+#else
+
+
+#define __NR___syscall_setgroups __NR_setgroups
+static __inline__ _syscall2(int, __syscall_setgroups,
+		size_t, size, const __kernel_gid_t *, list)
+
+int setgroups(size_t size, const gid_t *groups)
+{
+	if (size > (size_t) sysconf(_SC_NGROUPS_MAX)) {
+ret_error:
+		__set_errno(EINVAL);
+		return -1;
+	} else {
+		size_t i;
+		__kernel_gid_t *kernel_groups = NULL;
+
+		if (size) {
+			kernel_groups = (__kernel_gid_t *)malloc(sizeof(*kernel_groups) * size);
+			if (kernel_groups == NULL)
+				goto ret_error;
+		}
+
+		for (i = 0; i < size; i++) {
+			kernel_groups[i] = (groups)[i];
+			if (groups[i] != (gid_t) ((__kernel_gid_t) groups[i])) {
+				goto ret_error;
+			}
+		}
+
+		i = __syscall_setgroups(size, kernel_groups);
+		free(kernel_groups);
+		return i;
+	}
+}
+#endif
+
+libc_hidden_def(setgroups)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sethostname.c b/ap/build/uClibc/libc/sysdeps/linux/common/sethostname.c
new file mode 100644
index 0000000..1ceb2a0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sethostname.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sethostname() for uClibc
+ *
+ * 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 <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+_syscall2(int, sethostname, const char *, name, size_t, len)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setitimer.c b/ap/build/uClibc/libc/sysdeps/linux/common/setitimer.c
new file mode 100644
index 0000000..427ff1e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setitimer.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setitimer() for uClibc
+ *
+ * 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 <sys/time.h>
+
+
+_syscall3(int, setitimer, __itimer_which_t, which,
+		  const struct itimerval *, new, struct itimerval *, old)
+libc_hidden_def(setitimer)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setpgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setpgid.c
new file mode 100644
index 0000000..0410c64
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setpgid.c
@@ -0,0 +1,25 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setpgid() for uClibc
+ *
+ * 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>
+
+#if defined __USE_UNIX98 || defined __USE_SVID
+#include <unistd.h>
+
+
+#define __NR___syscall_setpgid __NR_setpgid
+static __inline__ _syscall2(int, __syscall_setpgid,
+		__kernel_pid_t, pid, __kernel_pid_t, pgid)
+
+int setpgid(pid_t pid, pid_t pgid)
+{
+	return (__syscall_setpgid(pid, pgid));
+}
+libc_hidden_def(setpgid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setpgrp.c b/ap/build/uClibc/libc/sysdeps/linux/common/setpgrp.c
new file mode 100644
index 0000000..1a82ac8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setpgrp.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <syscall.h>
+#include <unistd.h>
+
+
+int setpgrp(void)
+{
+	return setpgid(0,0);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setpriority.c b/ap/build/uClibc/libc/sysdeps/linux/common/setpriority.c
new file mode 100644
index 0000000..05d5dd9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setpriority.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setpriority() for uClibc
+ *
+ * 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 <sys/resource.h>
+
+
+_syscall3(int, setpriority, __priority_which_t, which, id_t, who, int, prio)
+libc_hidden_def(setpriority)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setregid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setregid.c
new file mode 100644
index 0000000..15d590a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setregid.c
@@ -0,0 +1,40 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setregid() for uClibc
+ *
+ * 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 <unistd.h>
+#include <bits/wordsize.h>
+
+
+#if (__WORDSIZE == 32 && defined(__NR_setregid32)) || __WORDSIZE == 64
+# ifdef __NR_setregid32
+#  undef __NR_setregid
+#  define __NR_setregid __NR_setregid32
+# endif
+
+_syscall2(int, setregid, gid_t, rgid, gid_t, egid)
+
+#else
+
+# define __NR___syscall_setregid __NR_setregid
+static __inline__ _syscall2(int, __syscall_setregid,
+		__kernel_gid_t, rgid, __kernel_gid_t, egid)
+
+int setregid(gid_t rgid, gid_t egid)
+{
+	if (((rgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
+		|| ((egid + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setregid(rgid, egid));
+}
+#endif
+
+libc_hidden_def(setregid)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setresgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setresgid.c
new file mode 100644
index 0000000..95decc2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setresgid.c
@@ -0,0 +1,41 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setresgid() for uClibc
+ *
+ * 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>
+#ifdef __USE_GNU
+#include <unistd.h>
+
+#if defined(__NR_setresgid32)
+# undef __NR_setresgid
+# define __NR_setresgid __NR_setresgid32
+
+_syscall3(int, setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid)
+libc_hidden_def(setresgid)
+
+#elif defined(__NR_setresgid)
+
+# define __NR___syscall_setresgid __NR_setresgid
+static __inline__ _syscall3(int, __syscall_setresgid,
+		__kernel_gid_t, rgid, __kernel_gid_t, egid, __kernel_gid_t, sgid)
+
+int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
+{
+	if (((rgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
+		|| ((egid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
+		|| ((sgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setresgid(rgid, egid, sgid));
+}
+libc_hidden_def(setresgid)
+
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setresuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setresuid.c
new file mode 100644
index 0000000..022ccfe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setresuid.c
@@ -0,0 +1,41 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setresuid() for uClibc
+ *
+ * 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>
+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
+#include <unistd.h>
+
+#if defined(__NR_setresuid32)
+# undef __NR_setresuid
+# define __NR_setresuid __NR_setresuid32
+
+_syscall3(int, setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
+libc_hidden_def(setresuid)
+
+#elif defined(__NR_setresuid)
+
+# define __NR___syscall_setresuid __NR_setresuid
+static __inline__ _syscall3(int, __syscall_setresuid,
+		__kernel_uid_t, rgid, __kernel_uid_t, egid, __kernel_uid_t, sgid)
+
+int setresuid(uid_t ruid, uid_t euid, uid_t suid)
+{
+	if (((ruid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((euid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((suid + 1) > (uid_t) ((__kernel_uid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setresuid(ruid, euid, suid));
+}
+libc_hidden_def(setresuid)
+
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setreuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setreuid.c
new file mode 100644
index 0000000..a9eea6d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setreuid.c
@@ -0,0 +1,40 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setreuid() for uClibc
+ *
+ * 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 <unistd.h>
+#include <bits/wordsize.h>
+
+
+#if (__WORDSIZE == 32 && defined(__NR_setreuid32)) || __WORDSIZE == 64
+# ifdef __NR_setreuid32
+#  undef __NR_setreuid
+#  define __NR_setreuid __NR_setreuid32
+# endif
+
+_syscall2(int, setreuid, uid_t, ruid, uid_t, euid)
+
+#else
+
+# define __NR___syscall_setreuid __NR_setreuid
+static __inline__ _syscall2(int, __syscall_setreuid,
+		__kernel_uid_t, ruid, __kernel_uid_t, euid)
+
+int setreuid(uid_t ruid, uid_t euid)
+{
+	if (((ruid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((euid + 1) > (uid_t) ((__kernel_uid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setreuid(ruid, euid));
+}
+#endif
+
+libc_hidden_def(setreuid)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit.c b/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit.c
new file mode 100644
index 0000000..ed773f7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit.c
@@ -0,0 +1,69 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setrlimit() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define setrlimit64 __hide_setrlimit64
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/resource.h>
+#undef setrlimit64
+
+
+/* Only wrap setrlimit if the new usetrlimit is not present and setrlimit sucks */
+
+#if defined(__NR_usetrlimit)
+
+/* just call usetrlimit() */
+# define __NR___syscall_usetrlimit __NR_usetrlimit
+static __always_inline
+_syscall2(int, __syscall_usetrlimit, enum __rlimit_resource, resource,
+          const struct rlimit *, rlim)
+int setrlimit(__rlimit_resource_t resource, struct rlimit *rlimits)
+{
+	return (__syscall_usetrlimit(resource, rlimits));
+}
+
+#elif !defined(__UCLIBC_HANDLE_OLDER_RLIMIT__)
+
+/* We don't need to wrap setrlimit() */
+_syscall2(int, setrlimit, __rlimit_resource_t, resource,
+		const struct rlimit *, rlim)
+
+#else
+
+/* we have to handle old style setrlimit() */
+# define __NR___syscall_setrlimit __NR_setrlimit
+static __always_inline
+_syscall2(int, __syscall_setrlimit, int, resource, const struct rlimit *, rlim)
+
+int setrlimit(__rlimit_resource_t resource, const struct rlimit *rlimits)
+{
+	struct rlimit rlimits_small;
+
+	if (rlimits == NULL) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+
+	/* We might have to correct the limits values.  Since the old values
+	 * were signed the new values might be too large.  */
+# define RMIN(x, y) ((x) < (y) ? (x) : (y))
+	rlimits_small.rlim_cur = RMIN((unsigned long int) rlimits->rlim_cur,
+								  RLIM_INFINITY >> 1);
+	rlimits_small.rlim_max = RMIN((unsigned long int) rlimits->rlim_max,
+								  RLIM_INFINITY >> 1);
+#undef RMIN
+	return (__syscall_setrlimit(resource, &rlimits_small));
+}
+#endif
+
+libc_hidden_def(setrlimit)
+
+#if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
+strong_alias(setrlimit, setrlimit64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit64.c b/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit64.c
new file mode 100644
index 0000000..8705c6f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit64.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1991,1995,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.  */
+
+#include <_lfs_64.h>
+
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <bits/wordsize.h>
+
+/* the regular setrlimit will work just fine for 64bit users */
+
+#if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 32
+
+
+/* Set the soft and hard limits for RESOURCE to *RLIMITS.
+   Only the super-user can increase hard limits.
+   Return 0 if successful, -1 if not (and sets errno).  */
+int setrlimit64 (__rlimit_resource_t resource, const struct rlimit64 *rlimits)
+{
+    struct rlimit rlimits32;
+
+    if (rlimits->rlim_cur >= RLIM_INFINITY)
+	rlimits32.rlim_cur = RLIM_INFINITY;
+    else
+	rlimits32.rlim_cur = rlimits->rlim_cur;
+    if (rlimits->rlim_max >= RLIM_INFINITY)
+	rlimits32.rlim_max = RLIM_INFINITY;
+    else
+	rlimits32.rlim_max = rlimits->rlim_max;
+
+    return setrlimit (resource, &rlimits32);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setsid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setsid.c
new file mode 100644
index 0000000..4ca95fc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setsid.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setsid() for uClibc
+ *
+ * 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 <unistd.h>
+
+
+_syscall0(pid_t, setsid)
+libc_hidden_def(setsid)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/settimeofday.c b/ap/build/uClibc/libc/sysdeps/linux/common/settimeofday.c
new file mode 100644
index 0000000..7e508ae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/settimeofday.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * settimeofday() for uClibc
+ *
+ * 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 <sys/time.h>
+
+#ifdef __USE_BSD
+
+
+_syscall2(int, settimeofday, const struct timeval *, tv,
+		  const struct timezone *, tz)
+libc_hidden_def(settimeofday)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setuid.c
new file mode 100644
index 0000000..7fd8c65
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setuid.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setuid() for uClibc
+ *
+ * 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 <unistd.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_setuid32)) || __WORDSIZE == 64
+# ifdef __NR_setuid32
+#  undef __NR_setuid
+#  define __NR_setuid __NR_setuid32
+# endif
+
+_syscall1(int, setuid, uid_t, uid)
+
+#else
+
+# define __NR___syscall_setuid __NR_setuid
+static __inline__ _syscall1(int, __syscall_setuid, __kernel_uid_t, uid)
+
+int setuid(uid_t uid)
+{
+	if (uid == (uid_t) ~ 0 || uid != (uid_t) ((__kernel_uid_t) uid)) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setuid(uid));
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sigaltstack.c b/ap/build/uClibc/libc/sysdeps/linux/common/sigaltstack.c
new file mode 100644
index 0000000..964e16f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sigaltstack.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sigaltstack() for uClibc
+ *
+ * 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 <signal.h>
+
+#if defined __NR_sigaltstack && (defined __USE_BSD || defined __USE_UNIX98)
+
+_syscall2(int, sigaltstack, const struct sigaltstack *, ss,
+		  struct sigaltstack *, oss)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/signalfd.c b/ap/build/uClibc/libc/sysdeps/linux/common/signalfd.c
new file mode 100644
index 0000000..a0c995a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/signalfd.c
@@ -0,0 +1,37 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * signalfd() for uClibc
+ *
+ * Copyright (C) 2008 Bernhard Reutner-Fischer <uclibc@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <signal.h>
+#include <sys/signalfd.h>
+
+#if defined __NR_signalfd4
+#define __NR___syscall_signalfd4 __NR_signalfd4
+static __inline__ _syscall4(int, __syscall_signalfd4, int, fd,
+		const sigset_t *, mask, size_t, sizemask, int, flags)
+#elif defined __NR_signalfd
+#define __NR___syscall_signalfd __NR_signalfd
+static __inline__ _syscall3(int, __syscall_signalfd, int, fd,
+		const sigset_t *, mask, size_t, sizemask)
+#endif
+
+#if defined __NR_signalfd4 || defined __NR_signalfd
+int signalfd (int fd, const sigset_t *mask, int flags)
+{
+#if defined __NR___syscall_signalfd4
+	return __syscall_signalfd4(fd, mask, _NSIG / 8, flags);
+#elif defined __NR___syscall_signalfd
+	if (flags != 0) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return __syscall_signalfd(fd, mask, _NSIG / 8);
+#endif
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sigpending.c b/ap/build/uClibc/libc/sysdeps/linux/common/sigpending.c
new file mode 100644
index 0000000..8fa2a51
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sigpending.c
@@ -0,0 +1,27 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sigpending() for uClibc
+ *
+ * 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>
+
+#if defined __USE_POSIX
+#include <signal.h>
+#undef sigpending
+
+#ifdef __NR_rt_sigpending
+# define __NR___rt_sigpending __NR_rt_sigpending
+static __inline__ _syscall2(int, __rt_sigpending, sigset_t *, set, size_t, size)
+
+int sigpending(sigset_t * set)
+{
+	return __rt_sigpending(set, _NSIG / 8);
+}
+#else
+_syscall1(int, sigpending, sigset_t *, set)
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sigprocmask.c b/ap/build/uClibc/libc/sysdeps/linux/common/sigprocmask.c
new file mode 100644
index 0000000..bc3e64d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sigprocmask.c
@@ -0,0 +1,92 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sigprocmask() for uClibc
+ *
+ * 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>
+
+#if defined __USE_POSIX
+#include <signal.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# include <pthreadP.h>	/* SIGCANCEL */
+#endif
+
+#undef sigprocmask
+
+libc_hidden_proto(sigprocmask)
+
+#ifdef __NR_rt_sigprocmask
+
+# define __NR___rt_sigprocmask __NR_rt_sigprocmask
+static __always_inline
+_syscall4(int, __rt_sigprocmask, int, how, const sigset_t *, set,
+		  sigset_t *, oldset, size_t, size)
+
+int sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
+{
+#ifdef SIGCANCEL
+	sigset_t local_newmask;
+
+	/*
+	 * The only thing we have to make sure here is that SIGCANCEL and
+	 * SIGSETXID are not blocked.
+	 */
+	if (set != NULL && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+# ifdef SIGSETXID
+		|| __builtin_expect (__sigismember (set, SIGSETXID), 0)
+# endif
+		))
+	{
+		local_newmask = *set;
+		__sigdelset (&local_newmask, SIGCANCEL);
+# ifdef SIGSETXID
+		__sigdelset (&local_newmask, SIGSETXID);
+# endif
+		set = &local_newmask;
+	}
+#endif
+
+	return __rt_sigprocmask(how, set, oldset, _NSIG / 8);
+}
+
+
+#else
+
+# define __NR___syscall_sigprocmask __NR_sigprocmask
+static __always_inline
+_syscall3(int, __syscall_sigprocmask, int, how, const sigset_t *, set,
+		  sigset_t *, oldset)
+
+int sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
+{
+#ifdef SIGCANCEL
+	sigset_t local_newmask;
+
+	/*
+	 * The only thing we have to make sure here is that SIGCANCEL and
+	 * SIGSETXID are not blocked.
+	 */
+	if (set != NULL && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+# ifdef SIGSETXID
+		|| __builtin_expect (__sigismember (set, SIGSETXID), 0)
+# endif
+		))
+	{
+		local_newmask = *set;
+		__sigdelset (&local_newmask, SIGCANCEL);
+# ifdef SIGSETXID
+		__sigdelset (&local_newmask, SIGSETXID);
+# endif
+		set = &local_newmask;
+	}
+#endif
+
+	return (__syscall_sigprocmask(how, set, oldset));
+}
+#endif
+libc_hidden_def(sigprocmask)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sigqueue.c b/ap/build/uClibc/libc/sysdeps/linux/common/sigqueue.c
new file mode 100644
index 0000000..e55d3b3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sigqueue.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 1997, 1998, 2000, 2003, 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>
+#include <signal.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <sys/syscall.h>
+#if defined __USE_POSIX199309
+
+
+#ifdef __NR_rt_sigqueueinfo
+
+# define __NR___libc_rt_sigqueueinfo __NR_rt_sigqueueinfo
+static __inline__ _syscall3(int, __libc_rt_sigqueueinfo, pid_t, pid, int, sig, void*, value)
+
+/* Return any pending signal or wait for one for the given time.  */
+int sigqueue (pid_t pid, int sig, const union sigval val)
+{
+  siginfo_t info;
+
+  /* First, clear the siginfo_t structure, so that we don't pass our
+     stack content to other tasks.  */
+  memset (&info, 0, sizeof (siginfo_t));
+  /* We must pass the information about the data in a siginfo_t value.  */
+  info.si_signo = sig;
+  info.si_code = SI_QUEUE;
+  info.si_pid = getpid ();
+  info.si_uid = getuid ();
+  info.si_value = val;
+
+  return __libc_rt_sigqueueinfo(pid, sig, &info);
+}
+
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sigsuspend.c b/ap/build/uClibc/libc/sysdeps/linux/common/sigsuspend.c
new file mode 100644
index 0000000..ded2aad
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sigsuspend.c
@@ -0,0 +1,59 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sigsuspend() for uClibc
+ *
+ * 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>
+
+#if defined __USE_POSIX
+#include <signal.h>
+#undef sigsuspend
+
+libc_hidden_proto(sigsuspend)
+
+#ifdef __NR_rt_sigsuspend
+# define __NR___rt_sigsuspend __NR_rt_sigsuspend
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#  include <errno.h>
+#  include <sysdep-cancel.h>
+
+/* Change the set of blocked signals to SET,
+   wait until a signal arrives, and restore the set of blocked signals.  */
+int sigsuspend (const sigset_t *set)
+{
+	if (SINGLE_THREAD_P)
+		return INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
+
+	int oldtype = LIBC_CANCEL_ASYNC ();
+
+	int result = INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
+
+	LIBC_CANCEL_RESET (oldtype);
+
+	return result;
+}
+# else
+static inline _syscall2(int, __rt_sigsuspend, const sigset_t *, mask, size_t, size)
+
+int sigsuspend(const sigset_t * mask)
+{
+	return __rt_sigsuspend(mask, _NSIG / 8);
+}
+# endif
+#else
+# define __NR___syscall_sigsuspend __NR_sigsuspend
+static __inline__ _syscall3(int, __syscall_sigsuspend, int, a, unsigned long int, b,
+		  unsigned long int, c)
+
+int sigsuspend(const sigset_t * set)
+{
+	return __syscall_sigsuspend(0, 0, set->__val[0]);
+}
+#endif
+libc_hidden_def(sigsuspend)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/splice.c b/ap/build/uClibc/libc/sysdeps/linux/common/splice.c
new file mode 100644
index 0000000..83f348a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/splice.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * splice() for uClibc
+ *
+ * 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>
+
+#ifdef __NR_splice
+_syscall6(ssize_t, splice, int, __fdin, __off64_t *, __offin, int, __fdout,
+	__off64_t *, __offout, size_t, __len, unsigned int, __flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ssp-local.c b/ap/build/uClibc/libc/sysdeps/linux/common/ssp-local.c
new file mode 100644
index 0000000..202d956
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ssp-local.c
@@ -0,0 +1,35 @@
+/* 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.  */
+
+/*
+ * Peter S. Mazinger ps.m[@]gmx.net
+ * copied stack_chk_fail_local.c from glibc and adapted for uClibc
+ */
+
+#include <features.h>
+
+extern void __stack_chk_fail (void) attribute_noreturn;
+
+/* On some architectures, this helps needless PIC pointer setup
+   that would be needed just for the __stack_chk_fail call.  */
+
+void __stack_chk_fail_local (void) attribute_noreturn attribute_hidden;
+void __stack_chk_fail_local (void)
+{
+  __stack_chk_fail ();
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ssp.c b/ap/build/uClibc/libc/sysdeps/linux/common/ssp.c
new file mode 100644
index 0000000..df242cc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ssp.c
@@ -0,0 +1,122 @@
+/*
+ * Distributed under the terms of the GNU Lesser General Public License
+ * $Header: $
+ *
+ * This is a modified version of Hiroaki Etoh's stack smashing routines
+ * implemented for glibc.
+ *
+ * The following people have contributed input to this code.
+ * Ned Ludd - <solar[@]gentoo.org>
+ * Alexander Gabert - <pappy[@]gentoo.org>
+ * The PaX Team - <pageexec[@]freemail.hu>
+ * Peter S. Mazinger - <ps.m[@]gmx.net>
+ * Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
+ * Robert Connolly - <robert[@]linuxfromscratch.org>
+ * Cory Visi <cory[@]visi.name>
+ * Mike Frysinger <vapier[@]gentoo.org>
+ */
+
+#if defined __SSP__ || defined __SSP_ALL__
+#error "file must not be compiled with stack protection enabled on it. Use -fno-stack-protector"
+#endif
+
+#ifdef __PROPOLICE_BLOCK_SEGV__
+# define SSP_SIGTYPE SIGSEGV
+#else
+# define SSP_SIGTYPE SIGABRT
+#endif
+
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+#if defined __UCLIBC_HAS_SYSLOG__
+#include <sys/syslog.h>
+
+#endif
+
+
+static void block_signals(void)
+{
+	struct sigaction sa;
+	sigset_t mask;
+
+	__sigfillset(&mask);
+	__sigdelset(&mask, SSP_SIGTYPE);	/* Block all signal handlers */
+	sigprocmask(SIG_BLOCK, &mask, NULL);	/* except SSP_SIGTYPE */
+
+	/* Make the default handler associated with the signal handler */
+	memset(&sa, 0, sizeof(sa));
+	__sigfillset(&sa.sa_mask);	/* Block all signals */
+	if (SIG_DFL) /* if it's constant zero, it's already done */
+		sa.sa_handler = SIG_DFL;
+	sigaction(SSP_SIGTYPE, &sa, NULL);
+}
+
+static void __cold ssp_write(int fd, const char *msg1, const char *msg2, const char *msg3)
+{
+	write(fd, msg1, strlen(msg1));
+	write(fd, msg2, strlen(msg2));
+	write(fd, msg3, strlen(msg3));
+	write(fd, "()\n", 3);
+#if defined __UCLIBC_HAS_SYSLOG__
+	openlog("ssp", LOG_CONS | LOG_PID, LOG_USER);
+	syslog(LOG_INFO, "%s%s%s()", msg1, msg2, msg3);
+	closelog();
+#endif
+}
+
+static attribute_noreturn void terminate(void)
+{
+	(void) kill(getpid(), SSP_SIGTYPE);
+	_exit(127);
+}
+
+#ifdef __UCLIBC_HAS_SSP_COMPAT__
+void __stack_smash_handler(char func[], int damaged __attribute__ ((unused))) attribute_noreturn __cold;
+void __stack_smash_handler(char func[], int damaged)
+{
+	static const char message[] = ": stack smashing attack in function ";
+
+	block_signals();
+
+	ssp_write(STDERR_FILENO, __uclibc_progname, message, func);
+
+	/* The loop is added only to keep gcc happy. */
+	while(1)
+		terminate();
+}
+#endif
+
+#ifdef __UCLIBC_HAS_SSP__
+void __stack_chk_fail(void) attribute_noreturn __cold;
+void __stack_chk_fail(void)
+{
+	static const char msg1[] = "stack smashing detected: ";
+	static const char msg3[] = " terminated";
+
+	block_signals();
+
+	ssp_write(STDERR_FILENO, msg1, __uclibc_progname, msg3);
+
+	/* The loop is added only to keep gcc happy. */
+	while(1)
+		terminate();
+}
+#endif
+
+#ifdef __UCLIBC_HAS_FORTIFY__
+void __chk_fail(void)
+{
+	static const char msg1[] = "buffer overflow detected: ";
+	static const char msg3[] = " terminated";
+
+	block_signals();
+
+	ssp_write(STDERR_FILENO, msg1, __uclibc_progname, msg3);
+
+	/* The loop is added only to keep gcc happy. */
+	while(1)
+		terminate();
+}
+libc_hidden_def(__chk_fail)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/stat.c b/ap/build/uClibc/libc/sysdeps/linux/common/stat.c
new file mode 100644
index 0000000..829f35a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/stat.c
@@ -0,0 +1,46 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * stat() for uClibc
+ *
+ * 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 <unistd.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+#undef stat
+
+int stat(const char *file_name, struct stat *buf)
+{
+	int result;
+#ifdef __NR_stat64
+	/* normal stat call has limited values for various stat elements
+	 * e.g. uid device major/minor etc.
+	 * so we use 64 variant if available
+	 * in order to get newer versions of stat elements
+	 */
+	struct kernel_stat64 kbuf;
+	result = INLINE_SYSCALL(stat64, 2, file_name, &kbuf);
+	if (result == 0) {
+		__xstat32_conv(&kbuf, buf);
+	}
+#else
+	struct kernel_stat kbuf;
+
+	result = INLINE_SYSCALL(stat, 2, file_name, &kbuf);
+	if (result == 0) {
+		__xstat_conv(&kbuf, buf);
+	}
+#endif
+	return result;
+}
+libc_hidden_def(stat)
+
+#if ! defined __NR_stat64 && defined __UCLIBC_HAS_LFS__
+strong_alias_untyped(stat,stat64)
+libc_hidden_def(stat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/stat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/stat64.c
new file mode 100644
index 0000000..a76f182
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/stat64.c
@@ -0,0 +1,34 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * stat64() for uClibc
+ *
+ * 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 <sys/stat.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_stat64
+
+# define __NR___syscall_stat64 __NR_stat64
+# include <unistd.h>
+# include "xstatconv.h"
+
+static __inline__ _syscall2(int, __syscall_stat64,
+		const char *, file_name, struct kernel_stat64 *, buf)
+
+int stat64(const char *file_name, struct stat64 *buf)
+{
+	int result;
+	struct kernel_stat64 kbuf;
+
+	result = __syscall_stat64(file_name, &kbuf);
+	if (result == 0) {
+		__xstat64_conv(&kbuf, buf);
+	}
+	return result;
+}
+libc_hidden_def(stat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/statfs.c b/ap/build/uClibc/libc/sysdeps/linux/common/statfs.c
new file mode 100644
index 0000000..d24bc9d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/statfs.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * statfs() for uClibc
+ *
+ * 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 <string.h>
+#include <sys/param.h>
+#include <sys/vfs.h>
+
+extern __typeof(statfs) __libc_statfs attribute_hidden;
+#define __NR___libc_statfs __NR_statfs
+_syscall2(int, __libc_statfs, const char *, path, struct statfs *, buf)
+
+#if defined __UCLIBC_LINUX_SPECIFIC__ || defined __UCLIBC_HAS_THREADS_NATIVE__
+/* statfs is used by NPTL, so it must exported in case */
+weak_alias(__libc_statfs,statfs)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/stime.c b/ap/build/uClibc/libc/sysdeps/linux/common/stime.c
new file mode 100644
index 0000000..cb7e804
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/stime.c
@@ -0,0 +1,32 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * stime() for uClibc
+ *
+ * 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 <time.h>
+#include <sys/time.h>
+
+#ifdef __USE_SVID
+#ifdef __NR_stime
+_syscall1(int, stime, const time_t *, t)
+#else
+
+int stime(const time_t * when)
+{
+	struct timeval tv;
+
+	if (when == NULL) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	tv.tv_sec = *when;
+	tv.tv_usec = 0;
+	return settimeofday(&tv, (struct timezone *) 0);
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/stubs.c b/ap/build/uClibc/libc/sysdeps/linux/common/stubs.c
new file mode 100644
index 0000000..4d1e26c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/stubs.c
@@ -0,0 +1,413 @@
+/*
+ * system call not available stub
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <bits/wordsize.h>
+#include <sys/syscall.h>
+
+#ifdef __UCLIBC_HAS_STUBS__
+
+static int enosys_stub(void) __attribute_used__;
+static int enosys_stub(void)
+{
+	__set_errno(ENOSYS);
+	return -1;
+}
+
+#define make_stub(stub) \
+	link_warning(stub, #stub ": this function is not implemented") \
+	strong_alias(enosys_stub, stub)
+
+#ifndef __ARCH_USE_MMU__
+# undef __NR_fork
+#endif
+
+#ifndef __UCLIBC_HAS_LFS__
+# undef __NR_fadvise64
+# undef __NR_fadvise64_64
+# undef __NR_sync_file_range
+#endif
+
+#if !defined __NR_accept && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(accept)
+#endif
+
+#if !defined __NR_accept4 && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__ && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(accept4)
+#endif
+
+#if !defined __NR_arch_prctl && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(arch_prctl)
+#endif
+
+#if !defined __NR_capget && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(capget)
+#endif
+
+#if !defined __NR_capset && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(capset)
+#endif
+
+#if !defined __NR_bdflush && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(bdflush)
+#endif
+
+#if !defined __NR_bind && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(bind)
+#endif
+
+#ifndef __NR_capget
+make_stub(capget)
+#endif
+
+#ifndef __NR_capset
+make_stub(capset)
+#endif
+
+#if !defined __NR_connect && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(connect)
+#endif
+
+#if !defined __NR_create_module && defined __UCLIBC_LINUX_MODULE_24__
+make_stub(create_module)
+#endif
+
+#if !defined __NR_delete_module && defined __UCLIBC_LINUX_MODULE_26__
+make_stub(delete_module)
+#endif
+
+#ifndef __NR_epoll_create
+make_stub(epoll_create)
+#endif
+
+#ifndef __NR_epoll_ctl
+make_stub(epoll_ctl)
+#endif
+
+#ifndef __NR_epoll_wait
+make_stub(epoll_wait)
+#endif
+
+#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(eventfd)
+#endif
+
+#ifndef __NR_fdatasync
+make_stub(fdatasync)
+#endif
+
+#ifndef __NR_flistxattr
+make_stub(flistxattr)
+#endif
+
+#ifndef __NR_fork
+make_stub(fork)
+#endif
+
+#ifndef __NR_fgetxattr
+make_stub(fgetxattr)
+#endif
+
+#ifndef __NR_fremovexattr
+make_stub(fremovexattr)
+#endif
+
+#ifndef __NR_fsetxattr
+make_stub(fsetxattr)
+#endif
+
+#if !defined __NR_fstatfs && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(fstatfs)
+#endif
+
+#ifndef __NR_get_kernel_syms
+make_stub(get_kernel_syms)
+#endif
+
+#if !defined __NR_getcpu && defined __UCLIBC_LINUX_SPECIFIC__ && ((defined __x86_64__ && !defined __UCLIBC_HAS_TLS__) || !defined __x86_64__)
+make_stub(sched_getcpu)
+#endif
+
+#if !defined __NR_getpeername && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(getpeername)
+#endif
+
+#if !defined __NR_getpgrp && !defined __NR_getpgid
+make_stub(getpgrp)
+#endif
+
+#if !defined __NR_getsockname && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(getsockname)
+#endif
+
+#if !defined __NR_getsockopt && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(getsockopt)
+#endif
+
+#ifndef __NR_getxattr
+make_stub(getxattr)
+#endif
+
+#if !defined __NR_init_module && defined __UCLIBC_LINUX_MODULE_26__
+make_stub(init_module)
+#endif
+
+#if !defined __NR_inotify_init && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(inotify_init)
+#endif
+
+#if !defined __NR_inotify_init1 && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(inotify_init1)
+#endif
+
+#if !defined __NR_inotify_add_watch && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(inotify_add_watch)
+#endif
+
+#if !defined __NR_inotify_rm_watch && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(inotify_rm_watch)
+#endif
+
+#if !defined __NR_ioperm && defined __UCLIBC_LINUX_SPECIFIC__ && !defined __arm__
+make_stub(ioperm)
+#endif
+
+#if !defined __NR_iopl && defined __UCLIBC_LINUX_SPECIFIC__ && !defined __arm__
+make_stub(iopl)
+#endif
+
+#ifndef __NR_lgetxattr
+make_stub(lgetxattr)
+#endif
+
+#if !defined __NR_listen && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(listen)
+#endif
+
+#ifndef __NR_listxattr
+make_stub(listxattr)
+#endif
+
+#ifndef __NR_llistxattr
+make_stub(llistxattr)
+#endif
+
+#ifndef __NR_lremovexattr
+make_stub(lremovexattr)
+#endif
+
+#ifndef __NR_lsetxattr
+make_stub(lsetxattr)
+#endif
+
+#if !defined __NR_madvise && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(madvise)
+#endif
+
+#if !defined __NR_modify_ldt && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(modify_ldt)
+#endif
+
+#if !defined __NR_personality && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(personality)
+#endif
+
+#if !defined __NR_pipe2 && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(pipe2)
+#endif
+
+#if !defined __NR_pivot_root && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(pivot_root)
+#endif
+
+#if !defined __NR_ppoll && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(ppoll)
+#endif
+
+#if !defined __NR_prctl && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(prctl)
+#endif
+
+#if !defined __NR_readahead && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(readahead)
+#endif
+
+#if !defined __NR_reboot && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(reboot)
+#endif
+
+#if !defined __NR_query_module && defined __UCLIBC_LINUX_MODULE_24__
+make_stub(query_module)
+#endif
+
+#if !defined __NR_recv && !defined __NR_socketcall && !defined __NR_recvfrom && defined __UCLIBC_HAS_SOCKET__
+make_stub(recv)
+#endif
+
+#if !defined __NR_recvfrom && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(recvfrom)
+#endif
+
+#if !defined __NR_recvmsg && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(recvmsg)
+#endif
+
+#if !defined __NR_remap_file_pages && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(remap_file_pages)
+#endif
+
+#ifndef __NR_removexattr
+make_stub(removexattr)
+#endif
+
+#if !defined __NR_sched_getaffinity && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(sched_getaffinity)
+#endif
+
+#if !defined __NR_sched_setaffinity && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(sched_setaffinity)
+#endif
+
+#if !defined __NR_send && !defined __NR_socketcall && !defined __NR_sendto && defined __UCLIBC_HAS_SOCKET__
+make_stub(send)
+#endif
+
+#if !defined __NR_sendfile && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(sendfile)
+#endif
+
+#if !defined __NR_sendfile64 && !defined __NR_sendfile && defined __UCLIBC_LINUX_SPECIFIC__ && defined __UCLIBC_HAS_LFS__
+make_stub(sendfile64)
+#endif
+
+#if !defined __NR_sendmsg && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(sendmsg)
+#endif
+
+#if !defined __NR_sendto && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(sendto)
+#endif
+
+#if ((__WORDSIZE == 32 && (!defined __NR_setfsgid32 && !defined __NR_setfsgid)) || (__WORDSIZE == 64 && !defined __NR_setfsgid)) && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(setfsgid)
+#endif
+
+#if ((__WORDSIZE == 32 && (!defined __NR_setfsuid32 && !defined __NR_setfsuid)) || (__WORDSIZE == 64 && !defined __NR_setfsuid)) && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(setfsuid)
+#endif
+
+#if !defined __NR_setresgid32 && !defined __NR_setresgid && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(setresgid)
+#endif
+
+#if !defined __NR_setresuid32 && !defined __NR_setresuid && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(setresuid)
+#endif
+
+#if !defined __NR_setsockopt && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(setsockopt)
+#endif
+
+#ifndef __NR_setxattr
+make_stub(setxattr)
+#endif
+
+#if !defined __NR_shutdown && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(shutdown)
+#endif
+
+#if !defined __NR_signalfd4 && !defined __NR_signalfd && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(signalfd)
+#endif
+
+#if !defined __NR_socket && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(socket)
+#endif
+
+#if !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(socketcall)
+#endif
+
+#if !defined __NR_socketpair && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(socketpair)
+#endif
+
+#ifndef __NR_rt_sigtimedwait
+make_stub(sigtimedwait)
+make_stub(sigwaitinfo)
+#endif
+
+#if !defined __NR_splice && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(splice)
+#endif
+
+#if !defined __NR_swapoff && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(swapoff)
+#endif
+
+#if !defined __NR_swapon && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(swapon)
+#endif
+
+#if !defined __NR_sync_file_range && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(sync_file_range)
+#endif
+
+#if !defined __NR__sysctl && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(_sysctl)
+#endif
+
+#if !defined __NR_sysinfo && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(sysinfo)
+#endif
+
+#if !defined __NR_tee && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(tee)
+#endif
+
+#if !defined __NR_timerfd_create && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(timerfd_create)
+#endif
+
+#if !defined __NR_timerfd_settime && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(timerfd_settime)
+#endif
+
+#if !defined __NR_timerfd_gettime && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(timerfd_gettime)
+#endif
+
+#if !defined __NR_umount && !defined __NR_umount2 && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(umount)
+#endif
+
+#if !defined __NR_umount2 && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(umount2)
+#endif
+
+#if !defined __NR_unshare && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(unshare)
+#endif
+
+#ifndef __NR_utimensat
+make_stub(futimens)
+make_stub(utimensat)
+# ifndef __NR_lutimes
+make_stub(lutimes)
+# endif
+#endif
+
+#if !defined __NR_vhangup && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(vhangup)
+#endif
+
+#ifndef __NR_vmsplice
+make_stub(vmsplice)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/swapoff.c b/ap/build/uClibc/libc/sysdeps/linux/common/swapoff.c
new file mode 100644
index 0000000..db0b9be
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/swapoff.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * swapoff() for uClibc
+ *
+ * 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>
+
+#ifdef __NR_swapoff
+
+#include <sys/swap.h>
+_syscall1(int, swapoff, const char *, path)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/swapon.c b/ap/build/uClibc/libc/sysdeps/linux/common/swapon.c
new file mode 100644
index 0000000..5d6b6e2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/swapon.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * swapon() for uClibc
+ *
+ * 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>
+
+#ifdef __NR_swapon
+
+#include <sys/swap.h>
+_syscall2(int, swapon, const char *, path, int, swapflags)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/symlink.c b/ap/build/uClibc/libc/sysdeps/linux/common/symlink.c
new file mode 100644
index 0000000..e53e8d4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/symlink.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * symlink() for uClibc
+ *
+ * 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>
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K
+#include <unistd.h>
+_syscall2(int, symlink, const char *, oldpath, const char *, newpath)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/symlinkat.c b/ap/build/uClibc/libc/sysdeps/linux/common/symlinkat.c
new file mode 100644
index 0000000..6381b33
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/symlinkat.c
@@ -0,0 +1,16 @@
+/*
+ * symlinkat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_symlinkat
+_syscall3(int, symlinkat, const char *, from, int, tofd, const char *, to)
+#else
+/* should add emulation with symlink() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sync.c b/ap/build/uClibc/libc/sysdeps/linux/common/sync.c
new file mode 100644
index 0000000..126f40d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sync.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sync syscall for uClibc
+ *
+ * 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>
+# if defined __USE_BSD || defined __USE_UNIX98
+#include <sys/types.h>
+#include <unistd.h>
+
+void sync(void)
+{
+	INLINE_SYSCALL(sync, 0);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sync_file_range.c b/ap/build/uClibc/libc/sysdeps/linux/common/sync_file_range.c
new file mode 100644
index 0000000..d24403e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sync_file_range.c
@@ -0,0 +1,27 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sync_file_range() for uClibc
+ *
+ * Copyright (C) 2008 Bernhard Reutner-Fischer <uclibc@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#if defined __USE_GNU
+#include <fcntl.h>
+
+#if defined __NR_sync_file_range && defined __UCLIBC_HAS_LFS__
+#define __NR___syscall_sync_file_range __NR_sync_file_range
+static __inline__ _syscall6(int, __syscall_sync_file_range, int, fd,
+		off_t, offset_hi, off_t, offset_lo,
+		off_t, nbytes_hi, off_t, nbytes_lo, unsigned int, flags)
+int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags)
+{
+	return __syscall_sync_file_range(fd,
+		__LONG_LONG_PAIR((long)(offset >> 32), (long)(offset & 0xffffffff)),
+		__LONG_LONG_PAIR((long)(nbytes >> 32), (long)(nbytes & 0xffffffff)),
+		flags);
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/acct.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/acct.h
new file mode 100644
index 0000000..9ee8564
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/acct.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 1996, 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 _SYS_ACCT_H
+#define _SYS_ACCT_H	1
+
+#include <features.h>
+
+#define	__need_time_t
+#include <time.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+#define ACCT_COMM 16
+
+/*
+  comp_t is a 16-bit "floating" point number with a 3-bit base 8
+  exponent and a 13-bit fraction. See linux/kernel/acct.c for the
+  specific encoding system used.
+*/
+
+typedef u_int16_t comp_t;
+
+struct acct
+  {
+    char ac_flag;			/* Accounting flags.  */
+    u_int16_t ac_uid;			/* Accounting user ID.  */
+    u_int16_t ac_gid;			/* Accounting group ID.  */
+    u_int16_t ac_tty;			/* Controlling tty.  */
+    u_int32_t ac_btime;			/* Beginning time.  */
+    comp_t ac_utime;			/* Accounting user time.  */
+    comp_t ac_stime;			/* Accounting system time.  */
+    comp_t ac_etime;			/* Accounting elapsed time.  */
+    comp_t ac_mem;			/* Accounting average memory usage.  */
+    comp_t ac_io;			/* Accounting chars transferred.  */
+    comp_t ac_rw;			/* Accounting blocks read or written.  */
+    comp_t ac_minflt;			/* Accounting minor pagefaults.  */
+    comp_t ac_majflt;			/* Accounting major pagefaults.  */
+    comp_t ac_swaps;			/* Accounting number of swaps.  */
+    u_int32_t ac_exitcode;		/* Accounting process exitcode.  */
+    char ac_comm[ACCT_COMM+1];		/* Accounting command name.  */
+    char ac_pad[10];			/* Accounting padding bytes.  */
+  };
+
+enum
+  {
+    AFORK = 0x01,		/* Has executed fork, but no exec.  */
+    ASU = 0x02,			/* Used super-user privileges.  */
+    ACORE = 0x08,		/* Dumped core.  */
+    AXSIG = 0x10		/* Killed by a signal.  */
+  };
+
+#define AHZ     100
+
+
+/* Switch process accounting on and off.  */
+extern int acct (__const char *__filename) __THROW;
+
+__END_DECLS
+
+#endif	/* sys/acct.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/epoll.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/epoll.h
new file mode 100644
index 0000000..a55ebad
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/epoll.h
@@ -0,0 +1,140 @@
+/* Copyright (C) 2002-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_EPOLL_H
+#define	_SYS_EPOLL_H	1
+
+#include <stdint.h>
+#include <sys/types.h>
+
+/* Get __sigset_t.  */
+#include <bits/sigset.h>
+
+#ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+#endif
+
+/* Get the platform-dependent flags.  */
+#include <bits/epoll.h>
+
+#ifndef __EPOLL_PACKED
+# define __EPOLL_PACKED
+#endif
+
+
+enum EPOLL_EVENTS
+  {
+    EPOLLIN = 0x001,
+#define EPOLLIN EPOLLIN
+    EPOLLPRI = 0x002,
+#define EPOLLPRI EPOLLPRI
+    EPOLLOUT = 0x004,
+#define EPOLLOUT EPOLLOUT
+    EPOLLRDNORM = 0x040,
+#define EPOLLRDNORM EPOLLRDNORM
+    EPOLLRDBAND = 0x080,
+#define EPOLLRDBAND EPOLLRDBAND
+    EPOLLWRNORM = 0x100,
+#define EPOLLWRNORM EPOLLWRNORM
+    EPOLLWRBAND = 0x200,
+#define EPOLLWRBAND EPOLLWRBAND
+    EPOLLMSG = 0x400,
+#define EPOLLMSG EPOLLMSG
+    EPOLLERR = 0x008,
+#define EPOLLERR EPOLLERR
+    EPOLLHUP = 0x010,
+#define EPOLLHUP EPOLLHUP
+    EPOLLRDHUP = 0x2000,
+#define EPOLLRDHUP EPOLLRDHUP
+    EPOLLONESHOT = 1u << 30,
+#define EPOLLONESHOT EPOLLONESHOT
+    EPOLLET = 1u << 31
+#define EPOLLET EPOLLET
+  };
+
+
+/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl().  */
+#define EPOLL_CTL_ADD 1	/* Add a file descriptor to the interface.  */
+#define EPOLL_CTL_DEL 2	/* Remove a file descriptor from the interface.  */
+#define EPOLL_CTL_MOD 3	/* Change file descriptor epoll_event structure.  */
+
+
+typedef union epoll_data
+{
+  void *ptr;
+  int fd;
+  uint32_t u32;
+  uint64_t u64;
+} epoll_data_t;
+
+struct epoll_event
+{
+  uint32_t events;	/* Epoll events */
+  epoll_data_t data;	/* User data variable */
+} __EPOLL_PACKED;
+
+
+__BEGIN_DECLS
+
+/* Creates an epoll instance.  Returns an fd for the new instance.
+   The "size" parameter is a hint specifying the number of file
+   descriptors to be associated with the new instance.  The fd
+   returned by epoll_create() should be closed with close().  */
+extern int epoll_create (int __size) __THROW;
+
+/* Same as epoll_create but with an FLAGS parameter.  The unused SIZE
+   parameter has been dropped.  */
+extern int epoll_create1 (int __flags) __THROW;
+
+
+/* Manipulate an epoll instance "epfd". Returns 0 in case of success,
+   -1 in case of error ( the "errno" variable will contain the
+   specific error code ) The "op" parameter is one of the EPOLL_CTL_*
+   constants defined above. The "fd" parameter is the target of the
+   operation. The "event" parameter describes which events the caller
+   is interested in and any associated user data.  */
+extern int epoll_ctl (int __epfd, int __op, int __fd,
+		      struct epoll_event *__event) __THROW;
+
+
+/* Wait for events on an epoll instance "epfd". Returns the number of
+   triggered events returned in "events" buffer. Or -1 in case of
+   error with the "errno" variable set to the specific error code. The
+   "events" parameter is a buffer that will contain triggered
+   events. The "maxevents" is the maximum number of events to be
+   returned ( usually size of "events" ). The "timeout" parameter
+   specifies the maximum wait time in milliseconds (-1 == infinite).
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int epoll_wait (int __epfd, struct epoll_event *__events,
+		       int __maxevents, int __timeout);
+
+
+/* Same as epoll_wait, but the thread's signal mask is temporarily
+   and atomically replaced with the one provided as parameter.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int epoll_pwait (int __epfd, struct epoll_event *__events,
+			int __maxevents, int __timeout,
+			const __sigset_t *__ss);
+
+__END_DECLS
+
+#endif /* sys/epoll.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/eventfd.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/eventfd.h
new file mode 100644
index 0000000..311f803
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/eventfd.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 2007, 2008, 2009 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_EVENTFD_H
+#define	_SYS_EVENTFD_H	1
+
+#include <stdint.h>
+
+
+/* Type for event counter.  */
+typedef uint64_t eventfd_t;
+
+/* Flags for signalfd.  */
+enum
+  {
+    EFD_SEMAPHORE = 1,
+#define EFD_SEMAPHORE EFD_SEMAPHORE
+    EFD_CLOEXEC = 02000000,
+#define EFD_CLOEXEC EFD_CLOEXEC
+    EFD_NONBLOCK = 04000
+#define EFD_NONBLOCK EFD_NONBLOCK
+  };
+
+
+__BEGIN_DECLS
+
+/* Return file descriptor for generic event channel.  Set initial
+   value to COUNT.  */
+extern int eventfd (int __count, int __flags) __THROW;
+
+__END_DECLS
+
+#endif /* sys/eventfd.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/inotify.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/inotify.h
new file mode 100644
index 0000000..a1d74d6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/inotify.h
@@ -0,0 +1,99 @@
+/* Copyright (C) 2005-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_INOTIFY_H
+#define	_SYS_INOTIFY_H	1
+
+#include <stdint.h>
+
+/* Get the platform-dependent flags.  */
+#include <bits/inotify.h>
+
+
+/* Structure describing an inotify event.  */
+struct inotify_event
+{
+  int wd;		/* Watch descriptor.  */
+  uint32_t mask;	/* Watch mask.  */
+  uint32_t cookie;	/* Cookie to synchronize two events.  */
+  uint32_t len;		/* Length (including NULs) of name.  */
+  char name __flexarr;	/* Name.  */
+};
+
+
+/* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH.  */
+#define IN_ACCESS	 0x00000001	/* File was accessed.  */
+#define IN_MODIFY	 0x00000002	/* File was modified.  */
+#define IN_ATTRIB	 0x00000004	/* Metadata changed.  */
+#define IN_CLOSE_WRITE	 0x00000008	/* Writtable file was closed.  */
+#define IN_CLOSE_NOWRITE 0x00000010	/* Unwrittable file closed.  */
+#define IN_CLOSE	 (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close.  */
+#define IN_OPEN		 0x00000020	/* File was opened.  */
+#define IN_MOVED_FROM	 0x00000040	/* File was moved from X.  */
+#define IN_MOVED_TO      0x00000080	/* File was moved to Y.  */
+#define IN_MOVE		 (IN_MOVED_FROM | IN_MOVED_TO) /* Moves.  */
+#define IN_CREATE	 0x00000100	/* Subfile was created.  */
+#define IN_DELETE	 0x00000200	/* Subfile was deleted.  */
+#define IN_DELETE_SELF	 0x00000400	/* Self was deleted.  */
+#define IN_MOVE_SELF	 0x00000800	/* Self was moved.  */
+
+/* Events sent by the kernel.  */
+#define IN_UNMOUNT	 0x00002000	/* Backing fs was unmounted.  */
+#define IN_Q_OVERFLOW	 0x00004000	/* Event queued overflowed.  */
+#define IN_IGNORED	 0x00008000	/* File was ignored.  */
+
+/* Helper events.  */
+#define IN_CLOSE	 (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE)	/* Close.  */
+#define IN_MOVE		 (IN_MOVED_FROM | IN_MOVED_TO)		/* Moves.  */
+
+/* Special flags.  */
+#define IN_ONLYDIR	 0x01000000	/* Only watch the path if it is a
+					   directory.  */
+#define IN_DONT_FOLLOW	 0x02000000	/* Do not follow a sym link.  */
+#define IN_EXCL_UNLINK	 0x04000000	/* Exclude events on unlinked
+					   objects.  */
+#define IN_MASK_ADD	 0x20000000	/* Add to the mask of an already
+					   existing watch.  */
+#define IN_ISDIR	 0x40000000	/* Event occurred against dir.  */
+#define IN_ONESHOT	 0x80000000	/* Only send event once.  */
+
+/* All events which a program can wait on.  */
+#define IN_ALL_EVENTS	 (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE  \
+			  | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM	      \
+			  | IN_MOVED_TO | IN_CREATE | IN_DELETE		      \
+			  | IN_DELETE_SELF | IN_MOVE_SELF)
+
+
+__BEGIN_DECLS
+
+/* Create and initialize inotify instance.  */
+extern int inotify_init (void) __THROW;
+
+/* Create and initialize inotify instance.  */
+extern int inotify_init1 (int __flags) __THROW;
+
+/* Add watch of object NAME to inotify instance FD.  Notify about
+   events specified by MASK.  */
+extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
+  __THROW;
+
+/* Remove the watch specified by WD from the inotify instance FD.  */
+extern int inotify_rm_watch (int __fd, int __wd) __THROW;
+
+__END_DECLS
+
+#endif /* sys/inotify.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/prctl.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/prctl.h
new file mode 100644
index 0000000..7e9b72d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/prctl.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 1997, 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_PRCTL_H
+#define _SYS_PRCTL_H	1
+
+#include <features.h>
+#include <linux/prctl.h>  /*  The magic values come from here  */
+
+__BEGIN_DECLS
+
+/* Control process execution.  */
+extern int prctl (int __option, ...) __THROW;
+
+__END_DECLS
+
+#endif  /* sys/prctl.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/ptrace.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/ptrace.h
new file mode 100644
index 0000000..08658f9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/ptrace.h
@@ -0,0 +1,168 @@
+/* `ptrace' debugger support interface.  Linux version.
+   Copyright (C) 1996-1999,2000,2006,2007 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_PTRACE_H
+#define _SYS_PTRACE_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.'  */
+enum __ptrace_request
+{
+  /* Indicate that the process making this request should be traced.
+     All signals received by this process can be intercepted by its
+     parent, and its parent can use the other `ptrace' requests.  */
+  PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+  /* Return the word in the process's text space at address ADDR.  */
+  PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+  /* Return the word in the process's data space at address ADDR.  */
+  PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+  /* Return the word in the process's user area at offset ADDR.  */
+  PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+  /* Write the word DATA into the process's text space at address ADDR.  */
+  PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+  /* Write the word DATA into the process's data space at address ADDR.  */
+  PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+  /* Write the word DATA into the process's user area at offset ADDR.  */
+  PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+  /* Continue the process.  */
+  PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+  /* Kill the process.  */
+  PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+  /* Single step the process.
+     This is not supported on all machines.  */
+  PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+  /* Get all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+  /* Set all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+  /* Get all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+  /* Set all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
+  /* Attach to a process that is already running. */
+  PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+  /* Detach from a process attached to with PTRACE_ATTACH.  */
+  PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+  /* Get all extended floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETFPXREGS = 18,
+#define PT_GETFPXREGS PTRACE_GETFPXREGS
+
+  /* Set all extended floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETFPXREGS = 19,
+#define PT_SETFPXREGS PTRACE_SETFPXREGS
+
+  /* Continue and stop at the next (return from) syscall.  */
+  PTRACE_SYSCALL = 24,
+#define PT_SYSCALL PTRACE_SYSCALL
+
+  /* Set ptrace filter options.  */
+  PTRACE_SETOPTIONS = 0x4200,
+#define PT_SETOPTIONS PTRACE_SETOPTIONS
+
+  /* Get last ptrace message.  */
+  PTRACE_GETEVENTMSG = 0x4201,
+#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
+
+  /* Get siginfo for process.  */
+  PTRACE_GETSIGINFO = 0x4202,
+#define PT_GETSIGINFO PTRACE_GETSIGINFO
+
+  /* Set new siginfo for process.  */
+  PTRACE_SETSIGINFO = 0x4203
+#define PT_SETSIGINFO PTRACE_SETSIGINFO
+};
+
+
+/* Options set using PTRACE_SETOPTIONS.  */
+enum __ptrace_setoptions {
+  PTRACE_O_TRACESYSGOOD	= 0x00000001,
+  PTRACE_O_TRACEFORK	= 0x00000002,
+  PTRACE_O_TRACEVFORK   = 0x00000004,
+  PTRACE_O_TRACECLONE	= 0x00000008,
+  PTRACE_O_TRACEEXEC	= 0x00000010,
+  PTRACE_O_TRACEVFORKDONE = 0x00000020,
+  PTRACE_O_TRACEEXIT	= 0x00000040,
+  PTRACE_O_MASK		= 0x0000007f
+};
+
+/* Wait extended result codes for the above trace options.  */
+enum __ptrace_eventcodes {
+  PTRACE_EVENT_FORK	= 1,
+  PTRACE_EVENT_VFORK	= 2,
+  PTRACE_EVENT_CLONE	= 3,
+  PTRACE_EVENT_EXEC	= 4,
+  PTRACE_EVENT_VFORK_DONE = 5,
+  PTRACE_EVENT_EXIT	= 6
+};
+
+/* Perform process tracing functions.  REQUEST is one of the values
+   above, and determines the action to be taken.
+   For all requests except PTRACE_TRACEME, PID specifies the process to be
+   traced.
+
+   PID and the other arguments described above for the various requests should
+   appear (those that are used for the particular request) as:
+     pid_t PID, void *ADDR, int DATA, void *ADDR2
+   after REQUEST.  */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/signalfd.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/signalfd.h
new file mode 100644
index 0000000..46a8d47
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/signalfd.h
@@ -0,0 +1,58 @@
+/* Copyright (C) 2007-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_SIGNALFD_H
+#define	_SYS_SIGNALFD_H	1
+
+#define __need_sigset_t
+#include <signal.h>
+#include <stdint.h>
+
+/* Get the platform-dependent flags.  */
+#include <bits/signalfd.h>
+
+struct signalfd_siginfo
+{
+  uint32_t ssi_signo;
+  int32_t ssi_errno;
+  int32_t ssi_code;
+  uint32_t ssi_pid;
+  uint32_t ssi_uid;
+  int32_t ssi_fd;
+  uint32_t ssi_tid;
+  uint32_t ssi_band;
+  uint32_t ssi_overrun;
+  uint32_t ssi_trapno;
+  int32_t ssi_status;
+  int32_t ssi_int;
+  uint64_t ssi_ptr;
+  uint64_t ssi_utime;
+  uint64_t ssi_stime;
+  uint64_t ssi_addr;
+  uint8_t __pad[48];
+};
+
+__BEGIN_DECLS
+
+/* Request notification for delivery of signals in MASK to be
+   performed using descriptor FD.*/
+extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
+  __THROW __nonnull ((2));
+
+__END_DECLS
+
+#endif /* sys/signalfd.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/timerfd.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/timerfd.h
new file mode 100644
index 0000000..989382a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/timerfd.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2008, 2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_TIMERFD_H
+#define	_SYS_TIMERFD_H	1
+
+#include <time.h>
+
+/* Get the platform-dependent flags.  */
+#include <bits/timerfd.h>
+
+
+/* Bits to be set in the FLAGS parameter of `timerfd_settime'.  */
+enum
+  {
+    TFD_TIMER_ABSTIME = 1 << 0
+#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME
+  };
+
+
+__BEGIN_DECLS
+
+/* Return file descriptor for new interval timer source.  */
+extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW;
+
+/* Set next expiration time of interval timer source UFD to UTMR.  If
+   FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
+   absolute.  Optionally return the old expiration time in OTMR.  */
+extern int timerfd_settime (int __ufd, int __flags,
+			    const struct itimerspec *__utmr,
+			    struct itimerspec *__otmr) __THROW;
+
+/* Return the next expiration time of UFD.  */
+extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
+
+__END_DECLS
+
+#endif /* sys/timerfd.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/user.h
new file mode 100644
index 0000000..03e56c3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/user.h
@@ -0,0 +1 @@
+#error "This file is machine-dependent and not provided for this machine."
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/syscall.c b/ap/build/uClibc/libc/sysdeps/linux/common/syscall.c
new file mode 100644
index 0000000..61f798e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/syscall.c
@@ -0,0 +1,12 @@
+/*
+ * syscall() library function
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+long syscall(long sysnum, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6)
+{
+	return INLINE_SYSCALL_NCS(sysnum, 6, arg1, arg2, arg3, arg4, arg5, arg6);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/common/syscalls.h
new file mode 100644
index 0000000..c4f6a44
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/syscalls.h
@@ -0,0 +1,24 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Common header file for uClibc syscalls
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define _LARGEFILE64_SOURCE
+#include <features.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <endian.h>
+
+#undef __OPTIMIZE__
+/* We absolutely do _NOT_ want interfaces silently
+ * being renamed under us or very bad things will happen... */
+#ifdef __USE_FILE_OFFSET64
+# undef __USE_FILE_OFFSET64
+#endif
+
+#include <bits/kernel_types.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sysctl.c b/ap/build/uClibc/libc/sysdeps/linux/common/sysctl.c
new file mode 100644
index 0000000..dde00be
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sysctl.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * _sysctl() for uClibc
+ *
+ * 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>
+#if defined __NR__sysctl && (defined __USE_GNU || defined __USE_BSD)
+
+/* psm: including sys/sysctl.h would depend on kernel headers */
+struct __sysctl_args {
+	int *name;
+	int nlen;
+	void *oldval;
+	size_t *oldlenp;
+	void *newval;
+	size_t newlen;
+	unsigned long __unused[4];
+};
+extern int sysctl (int *__name, int __nlen, void *__oldval,
+				   size_t *__oldlenp, void *__newval, size_t __newlen) __THROW;
+int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp,
+		   void *newval, size_t newlen)
+{
+	/* avoid initializing on the stack as gcc will call memset() */
+	struct __sysctl_args args;
+	args.name = name;
+	args.nlen = nlen;
+	args.oldval = oldval;
+	args.oldlenp = oldlenp;
+	args.newval = newval;
+	args.newlen = newlen;
+	return INLINE_SYSCALL(_sysctl, 1, &args);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/common/sysdep.h
new file mode 100644
index 0000000..156e571
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sysdep.h
@@ -0,0 +1,175 @@
+/* Generic asm macros used on many machines.
+   Copyright (C) 1991,92,93,96,98,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.  */
+
+#include <sys/syscall.h>
+
+#ifndef C_LABEL
+
+/* Define a macro we can use to construct the asm name for a C symbol.  */
+#ifndef	__UCLIBC_UNDERSCORES__
+#ifdef	__STDC__
+#define C_LABEL(name)		name##:
+#else
+#define C_LABEL(name)		name/**/:
+#endif
+#else
+#ifdef	__STDC__
+#define C_LABEL(name)		_##name##:
+#else
+#define C_LABEL(name)		_/**/name/**/:
+#endif
+#endif
+
+#endif
+
+#ifdef __ASSEMBLER__
+/* Mark the end of function named SYM.  This is used on some platforms
+   to generate correct debugging information.  */
+#ifndef END
+#define END(sym)
+#endif
+
+#ifndef JUMPTARGET
+#define JUMPTARGET(sym)		sym
+#endif
+
+/* Macros to generate eh_frame unwind information.  */
+# ifdef HAVE_ASM_CFI_DIRECTIVES
+#  define cfi_sections(sect...) 	.cfi_sections sect
+#  define cfi_startproc			.cfi_startproc
+#  define cfi_endproc			.cfi_endproc
+#  define cfi_def_cfa(reg, off)		.cfi_def_cfa reg, off
+#  define cfi_def_cfa_register(reg)	.cfi_def_cfa_register reg
+#  define cfi_def_cfa_offset(off)	.cfi_def_cfa_offset off
+#  define cfi_adjust_cfa_offset(off)	.cfi_adjust_cfa_offset off
+#  define cfi_offset(reg, off)		.cfi_offset reg, off
+#  define cfi_rel_offset(reg, off)	.cfi_rel_offset reg, off
+#  define cfi_register(r1, r2)		.cfi_register r1, r2
+#  define cfi_return_column(reg)	.cfi_return_column reg
+#  define cfi_restore(reg)		.cfi_restore reg
+#  define cfi_same_value(reg)		.cfi_same_value reg
+#  define cfi_undefined(reg)		.cfi_undefined reg
+#  define cfi_remember_state		.cfi_remember_state
+#  define cfi_restore_state		.cfi_restore_state
+#  define cfi_window_save		.cfi_window_save
+#  define cfi_personality(enc, exp)	.cfi_personality enc, exp
+#  define cfi_lsda(enc, exp)		.cfi_lsda enc, exp
+
+# else
+#  define cfi_sections(sect...)
+#  define cfi_startproc
+#  define cfi_endproc
+#  define cfi_def_cfa(reg, off)
+#  define cfi_def_cfa_register(reg)
+#  define cfi_def_cfa_offset(off)
+#  define cfi_adjust_cfa_offset(off)
+#  define cfi_offset(reg, off)
+#  define cfi_rel_offset(reg, off)
+#  define cfi_register(r1, r2)
+#  define cfi_return_column(reg)
+#  define cfi_restore(reg)
+#  define cfi_same_value(reg)
+#  define cfi_undefined(reg)
+#  define cfi_remember_state
+#  define cfi_restore_state
+#  define cfi_window_save
+#  define cfi_personality(enc, exp)
+#  define cfi_lsda(enc, exp)
+# endif
+
+#else /* ! ASSEMBLER */
+# ifdef HAVE_ASM_CFI_DIRECTIVES
+#  define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name)
+#  define CFI_STRINGIFY2(Name) #Name
+#  define CFI_SECTIONS(sect...) \
+   ".cfi_sections " CFI_STRINGIFY(sect)
+#  define CFI_STARTPROC	".cfi_startproc"
+#  define CFI_ENDPROC	".cfi_endproc"
+#  define CFI_DEF_CFA(reg, off)	\
+   ".cfi_def_cfa " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
+#  define CFI_DEF_CFA_REGISTER(reg) \
+   ".cfi_def_cfa_register " CFI_STRINGIFY(reg)
+#  define CFI_DEF_CFA_OFFSET(off) \
+   ".cfi_def_cfa_offset " CFI_STRINGIFY(off)
+#  define CFI_ADJUST_CFA_OFFSET(off) \
+   ".cfi_adjust_cfa_offset " CFI_STRINGIFY(off)
+#  define CFI_OFFSET(reg, off) \
+   ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
+#  define CFI_REL_OFFSET(reg, off) \
+   ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
+#  define CFI_REGISTER(r1, r2) \
+   ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
+#  define CFI_RETURN_COLUMN(reg) \
+   ".cfi_return_column " CFI_STRINGIFY(reg)
+#  define CFI_RESTORE(reg) \
+   ".cfi_restore " CFI_STRINGIFY(reg)
+#  define CFI_UNDEFINED(reg) \
+   ".cfi_undefined " CFI_STRINGIFY(reg)
+#  define CFI_REMEMBER_STATE \
+   ".cfi_remember_state"
+#  define CFI_RESTORE_STATE \
+   ".cfi_restore_state"
+#  define CFI_WINDOW_SAVE \
+   ".cfi_window_save"
+#  define CFI_PERSONALITY(enc, exp) \
+   ".cfi_personality " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
+#  define CFI_LSDA(enc, exp) \
+   ".cfi_lsda " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
+# else
+#  define CFI_SECTIONS(sect...)
+#  define CFI_STARTPROC
+#  define CFI_ENDPROC
+#  define CFI_DEF_CFA(reg, off)
+#  define CFI_DEF_CFA_REGISTER(reg)
+#  define CFI_DEF_CFA_OFFSET(off)
+#  define CFI_ADJUST_CFA_OFFSET(off)
+#  define CFI_OFFSET(reg, off)
+#  define CFI_REL_OFFSET(reg, off)
+#  define CFI_REGISTER(r1, r2)
+#  define CFI_RETURN_COLUMN(reg)
+#  define CFI_RESTORE(reg)
+#  define CFI_UNDEFINED(reg)
+#  define CFI_REMEMBER_STATE
+#  define CFI_RESTORE_STATE
+#  define CFI_WINDOW_SAVE
+#  define CFI_PERSONALITY(enc, exp)
+#  define CFI_LSDA(enc, exp)
+# endif
+
+#endif /* __ASSEMBLER__ */
+
+/* Values used for encoding parameter of cfi_personality and cfi_lsda.  */
+#define DW_EH_PE_absptr		0x00
+#define DW_EH_PE_omit		0xff
+#define DW_EH_PE_uleb128	0x01
+#define DW_EH_PE_udata2		0x02
+#define DW_EH_PE_udata4		0x03
+#define DW_EH_PE_udata8		0x04
+#define DW_EH_PE_sleb128	0x09
+#define DW_EH_PE_sdata2		0x0a
+#define DW_EH_PE_sdata4		0x0b
+#define DW_EH_PE_sdata8		0x0c
+#define DW_EH_PE_signed		0x08
+#define DW_EH_PE_pcrel		0x10
+#define DW_EH_PE_textrel	0x20
+#define DW_EH_PE_datarel	0x30
+#define DW_EH_PE_funcrel	0x40
+#define DW_EH_PE_aligned	0x50
+#define DW_EH_PE_indirect	0x80
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sysfs.c b/ap/build/uClibc/libc/sysdeps/linux/common/sysfs.c
new file mode 100644
index 0000000..02f37d7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sysfs.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sysfs() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+/* libc isn't really supposed to export this */
+#if 0
+#include <sys/syscall.h>
+
+#if defined __USE_SVID
+_syscall3(int, sysfs, int, option, unsigned int, index, char, addr)
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sysinfo.c b/ap/build/uClibc/libc/sysdeps/linux/common/sysinfo.c
new file mode 100644
index 0000000..fc37aaf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sysinfo.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sysinfo() for uClibc
+ *
+ * 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 <sys/sysinfo.h>
+_syscall1(int, sysinfo, struct sysinfo *, info)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/tee.c b/ap/build/uClibc/libc/sysdeps/linux/common/tee.c
new file mode 100644
index 0000000..5047767
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/tee.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * tee() for uClibc
+ *
+ * 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>
+
+#ifdef __NR_tee
+_syscall4(ssize_t, tee, int, __fdin, int, __fdout, size_t, __len,
+	unsigned int, __flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/time.c b/ap/build/uClibc/libc/sysdeps/linux/common/time.c
new file mode 100644
index 0000000..e13b44f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/time.c
@@ -0,0 +1,34 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * time() for uClibc
+ *
+ * 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 <time.h>
+#include <sys/time.h>
+
+
+#ifdef __NR_time
+_syscall_noerr1(time_t, time, time_t *, t)
+#else
+time_t time(time_t * t)
+{
+	time_t result;
+	struct timeval tv;
+
+	/* In Linux, gettimeofday fails only on bad parameter.
+	 * We know that here parameter isn't bad.
+	 */
+	gettimeofday(&tv, NULL);
+	result = (time_t) tv.tv_sec;
+	if (t != NULL) {
+		*t = result;
+	}
+	return result;
+}
+#endif
+libc_hidden_def(time)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/timerfd.c b/ap/build/uClibc/libc/sysdeps/linux/common/timerfd.c
new file mode 100644
index 0000000..2332044
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/timerfd.c
@@ -0,0 +1,32 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * timerfd_create() / timerfd_settime() / timerfd_gettime() for uClibc
+ *
+ * Copyright (C) 2009 Stephan Raue <stephan@openelec.tv>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/timerfd.h>
+
+/*
+ * timerfd_create()
+ */
+#ifdef __NR_timerfd_create
+_syscall2(int, timerfd_create, int, clockid, int, flags)
+#endif
+
+/*
+ * timerfd_settime()
+ */
+#ifdef __NR_timerfd_settime
+_syscall4(int,timerfd_settime, int, ufd, int, flags, const struct itimerspec *, utmr, struct itimerspec *, otmr)
+#endif
+
+/*
+ * timerfd_gettime()
+ */
+#ifdef __NR_timerfd_gettime
+_syscall2(int, timerfd_gettime, int, ufd, struct itimerspec *, otmr)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/times.c b/ap/build/uClibc/libc/sysdeps/linux/common/times.c
new file mode 100644
index 0000000..37ae040
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/times.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * times() for uClibc
+ *
+ * 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 <sys/times.h>
+
+
+_syscall_noerr1(clock_t, times, struct tms *, buf)
+libc_hidden_def(times)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/truncate.c b/ap/build/uClibc/libc/sysdeps/linux/common/truncate.c
new file mode 100644
index 0000000..2331bdd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/truncate.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * truncate() for uClibc
+ *
+ * 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 <unistd.h>
+
+
+_syscall2(int, truncate, const char *, path, __off_t, length)
+libc_hidden_def(truncate)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/truncate64.c b/ap/build/uClibc/libc/sysdeps/linux/common/truncate64.c
new file mode 100644
index 0000000..1f6c459
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/truncate64.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* truncate64 syscall.  Copes with 64 bit and 32 bit machines
+ * and on 32 bit machines this sends things into the kernel as
+ * two 32-bit arguments (high and low 32 bits of length) that
+ * are ordered based on endianess.  It turns out endian.h has
+ * just the macro we need to order things, __LONG_LONG_PAIR.
+ */
+
+#include <features.h>
+#include <unistd.h>
+#include <errno.h>
+#include <endian.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#if defined __UCLIBC_HAS_LFS__
+
+#if defined __NR_truncate64
+
+#if __WORDSIZE == 64
+
+/* For a 64 bit machine, life is simple... */
+_syscall2(int, truncate64, const char *, path, __off64_t, length)
+
+#elif __WORDSIZE == 32
+
+/* The exported truncate64 function.  */
+int truncate64(const char * path, __off64_t length)
+{
+	uint32_t low = length & 0xffffffff;
+	uint32_t high = length >> 32;
+#if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__)
+	return INLINE_SYSCALL(truncate64, 4, path, 0,
+			__LONG_LONG_PAIR(high, low));
+#else
+	return INLINE_SYSCALL(truncate64, 3, path,
+			__LONG_LONG_PAIR(high, low));
+#endif
+}
+
+#else /* __WORDSIZE */
+#error Your machine is not 64 bit nor 32 bit, I am dazed and confused.
+#endif /* __WORDSIZE */
+
+#else  /* __NR_truncate64 */
+
+
+int truncate64(const char * path, __off64_t length)
+{
+	__off_t x = (__off_t) length;
+
+	if (x == length) {
+		return truncate(path, x);
+	}
+
+	__set_errno((x < 0) ? EINVAL : EFBIG);
+
+	return -1;
+}
+
+#endif /* __NR_truncate64 */
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ulimit.c b/ap/build/uClibc/libc/sysdeps/linux/common/ulimit.c
new file mode 100644
index 0000000..8be4a37
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ulimit.c
@@ -0,0 +1,48 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * 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 <stdarg.h>
+#include <unistd.h>
+#include <ulimit.h>
+#include <sys/resource.h>
+
+
+long int ulimit(int cmd, ...)
+{
+	va_list va;
+	struct rlimit limit;
+	long int result = -1;
+	va_start (va, cmd);
+	switch (cmd) {
+		/* Get limit on file size.  */
+		case UL_GETFSIZE:
+			if (getrlimit(RLIMIT_FSIZE, &limit) == 0)
+				result =  limit.rlim_cur / 512; /* bytes to 512 byte blocksize */
+			break;
+		/* Set limit on file size.  */
+		case UL_SETFSIZE:
+			result = va_arg (va, long int);
+			if ((rlim_t) result > RLIM_INFINITY / 512) {
+				limit.rlim_cur = RLIM_INFINITY;
+				limit.rlim_max = RLIM_INFINITY;
+			} else {
+				limit.rlim_cur = result * 512;
+				limit.rlim_max = result * 512;
+			}
+			result = setrlimit(RLIMIT_FSIZE, &limit);
+			break;
+		case __UL_GETOPENMAX:
+			result = sysconf(_SC_OPEN_MAX);
+			break;
+		default:
+			__set_errno(EINVAL);
+	}
+	va_end (va);
+	return result;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/umask.c b/ap/build/uClibc/libc/sysdeps/linux/common/umask.c
new file mode 100644
index 0000000..b838e17
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/umask.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * umask() for uClibc
+ *
+ * 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 <sys/stat.h>
+
+#define __NR___syscall_umask __NR_umask
+static __inline__ _syscall1(__kernel_mode_t, __syscall_umask, __kernel_mode_t, mode)
+
+mode_t umask(mode_t mode)
+{
+	return __syscall_umask(mode);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/umount.c b/ap/build/uClibc/libc/sysdeps/linux/common/umount.c
new file mode 100644
index 0000000..a084d29
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/umount.c
@@ -0,0 +1,32 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * umount() for uClibc
+ *
+ * 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>
+
+#if defined __USE_GNU
+#include <sys/mount.h>
+
+/* arch provides umount() syscall */
+#ifdef __NR_umount
+
+_syscall1(int, umount, const char *, specialfile)
+
+/* arch provides umount2() syscall */
+#elif defined __NR_umount2
+
+# define __NR___syscall_umount2 __NR_umount2
+static __inline__ _syscall2(int, __syscall_umount2, const char *, special_file, int, flags)
+
+int umount(const char *special_file)
+{
+	return (__syscall_umount2(special_file, 0));
+}
+
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/umount2.c b/ap/build/uClibc/libc/sysdeps/linux/common/umount2.c
new file mode 100644
index 0000000..2cc4a23
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/umount2.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * umount2() for uClibc
+ *
+ * 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>
+
+#if defined __USE_GNU
+#include <sys/mount.h>
+#ifdef __NR_umount2	/* Old kernels don't have umount2 */
+_syscall2(int, umount2, const char *, special_file, int, flags)
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/uname.c b/ap/build/uClibc/libc/sysdeps/linux/common/uname.c
new file mode 100644
index 0000000..0feec93
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/uname.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * uname() for uClibc
+ *
+ * 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 <sys/utsname.h>
+
+
+_syscall1(int, uname, struct utsname *, buf)
+libc_hidden_def(uname)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/unlink.c b/ap/build/uClibc/libc/sysdeps/linux/common/unlink.c
new file mode 100644
index 0000000..513cdd5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/unlink.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * unlink() for uClibc
+ *
+ * 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 <unistd.h>
+
+
+_syscall1(int, unlink, const char *, pathname)
+libc_hidden_def(unlink)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/unlinkat.c b/ap/build/uClibc/libc/sysdeps/linux/common/unlinkat.c
new file mode 100644
index 0000000..0eaf2b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/unlinkat.c
@@ -0,0 +1,16 @@
+/*
+ * unlinkat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_unlinkat
+_syscall3(int, unlinkat, int, fd, const char *, file, int, flag)
+#else
+/* should add emulation with unlink() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/unshare.c b/ap/build/uClibc/libc/sysdeps/linux/common/unshare.c
new file mode 100644
index 0000000..624ca12
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/unshare.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * unshare() for uClibc
+ *
+ * Copyright (C) 2011 Henning Heinold <heinold@inf.fu-berlin.de>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sched.h>
+
+#if defined __NR_unshare
+_syscall1(int, unshare, int, flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/unwind.h b/ap/build/uClibc/libc/sysdeps/linux/common/unwind.h
new file mode 100644
index 0000000..81fc4db
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/unwind.h
@@ -0,0 +1,220 @@
+/* Exception handling and frame unwind runtime interface routines.
+   Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This is derived from the C++ ABI for IA-64.  Where we diverge
+   for cross-architecture compatibility are noted with "@@@".  */
+
+#ifndef _UNWIND_H
+#define _UNWIND_H	1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Level 1: Base ABI  */
+
+/* @@@ The IA-64 ABI uses uint64 throughout.  Most places this is
+   inefficient for 32-bit and smaller machines.  */
+typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
+typedef signed _Unwind_Sword __attribute__((__mode__(__word__)));
+#if defined(__ia64__) && defined(__hpux__)
+typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__)));
+#else
+typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
+#endif
+typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
+
+/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and
+   consumer of an exception.  We'll go along with this for now even on
+   32-bit machines.  We'll need to provide some other option for
+   16-bit machines and for machines with > 8 bits per byte.  */
+typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
+
+/* The unwind interface uses reason codes in several contexts to
+   identify the reasons for failures or other actions.  */
+typedef enum
+{
+  _URC_NO_REASON = 0,
+  _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
+  _URC_FATAL_PHASE2_ERROR = 2,
+  _URC_FATAL_PHASE1_ERROR = 3,
+  _URC_NORMAL_STOP = 4,
+  _URC_END_OF_STACK = 5,
+  _URC_HANDLER_FOUND = 6,
+  _URC_INSTALL_CONTEXT = 7,
+  _URC_CONTINUE_UNWIND = 8
+} _Unwind_Reason_Code;
+
+
+/* The unwind interface uses a pointer to an exception header object
+   as its representation of an exception being thrown. In general, the
+   full representation of an exception object is language- and
+   implementation-specific, but it will be prefixed by a header
+   understood by the unwind interface.  */
+
+struct _Unwind_Exception;
+
+typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
+					      struct _Unwind_Exception *);
+
+struct _Unwind_Exception
+{
+  _Unwind_Exception_Class exception_class;
+  _Unwind_Exception_Cleanup_Fn exception_cleanup;
+  _Unwind_Word private_1;
+  _Unwind_Word private_2;
+
+  /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
+     Taking that literally does not make much sense generically.  Instead we
+     provide the maximum alignment required by any type for the machine.  */
+} __attribute__((__aligned__));
+
+
+/* The ACTIONS argument to the personality routine is a bitwise OR of one
+   or more of the following constants.  */
+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
+
+/* This is an opaque type used to refer to a system-specific data
+   structure used by the system unwinder. This context is created and
+   destroyed by the system, and passed to the personality routine
+   during unwinding.  */
+struct _Unwind_Context;
+
+/* Raise an exception, passing along the given exception object.  */
+extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
+
+/* Raise an exception for forced unwinding.  */
+
+typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
+     (int, _Unwind_Action, _Unwind_Exception_Class,
+      struct _Unwind_Exception *, struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
+						 _Unwind_Stop_Fn,
+						 void *);
+
+/* Helper to invoke the exception_cleanup routine.  */
+extern void _Unwind_DeleteException (struct _Unwind_Exception *);
+
+/* Resume propagation of an existing exception.  This is used after
+   e.g. executing cleanup code, and not to implement rethrowing.  */
+extern void _Unwind_Resume (struct _Unwind_Exception *);
+
+/* @@@ Use unwind data to perform a stack backtrace.  The trace callback
+   is called for every stack frame in the call chain, but no cleanup
+   actions are performed.  */
+typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
+     (struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
+
+/* These functions are used for communicating information about the unwind
+   context (i.e. the unwind descriptors and the user register state) between
+   the unwind library and the personality routine and landing pad.  Only
+   selected registers maybe manipulated.  */
+
+extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int);
+extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
+
+extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
+extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
+
+/* @@@ Retrieve the CFA of the given context.  */
+extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
+
+extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *);
+
+extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
+
+
+/* The personality routine is the function in the C++ (or other language)
+   runtime library which serves as an interface between the system unwind
+   library and language-specific exception handling semantics.  It is
+   specific to the code fragment described by an unwind info block, and
+   it is always referenced via the pointer in the unwind info block, and
+   hence it has no ABI-specified name.
+
+   Note that this implies that two different C++ implementations can
+   use different names, and have different contents in the language
+   specific data area.  Moreover, that the language specific data
+   area contains no version info because name of the function invoked
+   provides more effective versioning by detecting at link time the
+   lack of code to handle the different data format.  */
+
+typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
+     (int, _Unwind_Action, _Unwind_Exception_Class,
+      struct _Unwind_Exception *, struct _Unwind_Context *);
+
+/* @@@ The following alternate entry points are for setjmp/longjmp
+   based unwinding.  */
+
+struct SjLj_Function_Context;
+extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
+extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
+
+extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException
+     (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind
+     (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
+extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *);
+
+/* @@@ The following provide access to the base addresses for text
+   and data-relative addressing in the LDSA.  In order to stay link
+   compatible with the standard ABI for IA-64, we inline these.  */
+
+#ifdef __ia64__
+#include <stdlib.h>
+
+static inline _Unwind_Ptr
+_Unwind_GetDataRelBase (struct _Unwind_Context *_C)
+{
+  /* The GP is stored in R1.  */
+  return _Unwind_GetGR (_C, 1);
+}
+
+static inline _Unwind_Ptr
+_Unwind_GetTextRelBase (struct _Unwind_Context *_C)
+{
+  abort ();
+  return 0;
+}
+
+/* @@@ Retrieve the Backing Store Pointer of the given context.  */
+extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
+#else
+extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
+extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
+#endif
+
+/* @@@ Given an address, return the entry point of the function that
+   contains it.  */
+extern void * _Unwind_FindEnclosingFunction (void *pc);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* unwind.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/uselib.c b/ap/build/uClibc/libc/sysdeps/linux/common/uselib.c
new file mode 100644
index 0000000..b2b806f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/uselib.c
@@ -0,0 +1,18 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * uselib() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#if 0
+linux specific and we do not use it in uClibc.
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#ifdef __NR_uselib
+int uselib (const char *library);
+_syscall1(int, uselib, const char *, library)
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ustat.c b/ap/build/uClibc/libc/sysdeps/linux/common/ustat.c
new file mode 100644
index 0000000..e97fa76
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ustat.c
@@ -0,0 +1,26 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * ustat() for uClibc
+ *
+ * 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 <sys/ustat.h>
+#include <sys/sysmacros.h>
+
+#define __NR___syscall_ustat __NR_ustat
+/* Kernel's fs/super.c defines this:
+ * long sys_ustat(unsigned dev, struct ustat __user * ubuf),
+ * thus we use unsigned, not __kernel_dev_t.
+ */
+static __inline__ _syscall2(int, __syscall_ustat,
+		unsigned, kdev_t,
+		struct ustat *, ubuf)
+
+int ustat(dev_t dev, struct ustat *ubuf)
+{
+	return __syscall_ustat(dev, ubuf);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/utime.c b/ap/build/uClibc/libc/sysdeps/linux/common/utime.c
new file mode 100644
index 0000000..c9fd1bf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/utime.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * utime() for uClibc
+ *
+ * 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 <utime.h>
+
+
+#ifdef __NR_utime
+_syscall2(int, utime, const char *, file, const struct utimbuf *, times)
+#else
+#include <stdlib.h>
+#include <sys/time.h>
+
+
+int utime(const char *file, const struct utimbuf *times)
+{
+	struct timeval timevals[2];
+
+	if (times != NULL) {
+		timevals[0].tv_usec = 0L;
+		timevals[1].tv_usec = 0L;
+		timevals[0].tv_sec = (long int) times->actime;
+		timevals[1].tv_sec = (long int) times->modtime;
+	}
+	return utimes(file, times ? timevals : NULL);
+}
+#endif
+link_warning(utime, "the use of OBSOLESCENT `utime' is discouraged, use `utimes'")
+libc_hidden_def(utime)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/utimensat.c b/ap/build/uClibc/libc/sysdeps/linux/common/utimensat.c
new file mode 100644
index 0000000..2cfb824
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/utimensat.c
@@ -0,0 +1,18 @@
+/*
+ * utimensat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#ifdef __NR_utimensat
+_syscall4(int, utimensat, int, fd, const char *, path, const struct timespec *, times, int, flags)
+libc_hidden_def(utimensat)
+#else
+/* should add emulation with utimens() and /proc/self/fd/ ... */
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/utimes.c b/ap/build/uClibc/libc/sysdeps/linux/common/utimes.c
new file mode 100644
index 0000000..99d9202
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/utimes.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * utimes() for uClibc
+ *
+ * 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 <utime.h>
+#include <sys/time.h>
+
+
+#ifdef __NR_utimes
+_syscall2(int, utimes, const char *, file, const struct timeval *, tvp)
+#else
+#include <stdlib.h>
+
+
+int utimes(const char *file, const struct timeval tvp[2])
+{
+	struct utimbuf buf, *times;
+
+	if (tvp) {
+		times = &buf;
+		times->actime = tvp[0].tv_sec;
+		times->modtime = tvp[1].tv_sec;
+	} else {
+		times = NULL;
+	}
+	return utime(file, times);
+}
+#endif
+libc_hidden_def(utimes)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/vfork.c b/ap/build/uClibc/libc/sysdeps/linux/common/vfork.c
new file mode 100644
index 0000000..e7c9208
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/vfork.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+extern __typeof(vfork) __vfork attribute_hidden;
+
+#ifdef __NR_vfork
+
+# define __NR___vfork __NR_vfork
+_syscall0(pid_t, __vfork)
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
+
+#elif defined __ARCH_USE_MMU__ && defined __NR_fork
+
+/* Trivial implementation for arches that lack vfork */
+
+pid_t __vfork(void)
+{
+    return fork();
+}
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/vhangup.c b/ap/build/uClibc/libc/sysdeps/linux/common/vhangup.c
new file mode 100644
index 0000000..77910e6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/vhangup.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * vhangup() for uClibc
+ *
+ * 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 <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+_syscall0(int, vhangup)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/vmsplice.c b/ap/build/uClibc/libc/sysdeps/linux/common/vmsplice.c
new file mode 100644
index 0000000..dd0640e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/vmsplice.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * vmsplice() for uClibc
+ *
+ * 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>
+
+#ifdef __NR_vmsplice
+_syscall4(ssize_t, vmsplice, int, __fdout, const struct iovec *, __iov,
+	size_t, __count, unsigned int, __flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/wait.c b/ap/build/uClibc/libc/sysdeps/linux/common/wait.c
new file mode 100644
index 0000000..9b529eb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/wait.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2006 Steven J. Hill <sjhill@realitydiluted.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#include <stdlib.h>
+#include <syscall.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+
+extern __typeof(wait) __libc_wait;
+/* Wait for a child to die.  When one does, put its status in *STAT_LOC
+ * and return its process ID.  For errors, return (pid_t) -1.  */
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <errno.h>
+#include <sysdep-cancel.h>
+
+pid_t attribute_hidden
+__libc_wait (__WAIT_STATUS_DEFN stat_loc)
+{
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (wait4, 4, WAIT_ANY, stat_loc, 0,
+			   (struct rusage *) NULL);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  pid_t result = INLINE_SYSCALL (wait4, 4, WAIT_ANY, stat_loc, 0,
+				 (struct rusage *) NULL);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+#else
+/* Wait for a child to die.  When one does, put its status in *STAT_LOC
+ * and return its process ID.  For errors, return (pid_t) -1.  */
+__pid_t __libc_wait (__WAIT_STATUS_DEFN stat_loc)
+{
+      return wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
+}
+#endif
+weak_alias(__libc_wait,wait)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/wait3.c b/ap/build/uClibc/libc/sysdeps/linux/common/wait3.c
new file mode 100644
index 0000000..0d480ec
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/wait3.c
@@ -0,0 +1,24 @@
+/*
+ * 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 <sys/types.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+
+#if defined __USE_BSD
+
+
+/* Wait for a child to exit.  When one does, put its status in *STAT_LOC and
+ * return its process ID.  For errors return (pid_t) -1.  If USAGE is not nil,
+ * store information about the child's resource usage (as a `struct rusage')
+ * there.  If the WUNTRACED bit is set in OPTIONS, return status for stopped
+ * children; otherwise don't.  */
+pid_t wait3 (__WAIT_STATUS stat_loc, int options, struct rusage * usage)
+{
+      return wait4 (WAIT_ANY, stat_loc, options, usage);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/wait4.c b/ap/build/uClibc/libc/sysdeps/linux/common/wait4.c
new file mode 100644
index 0000000..dceab41
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/wait4.c
@@ -0,0 +1,25 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * wait4() for uClibc
+ *
+ * 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>
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#include <sys/wait.h>
+#include <sys/resource.h>
+
+
+#define __NR___syscall_wait4 __NR_wait4
+static __inline__ _syscall4(int, __syscall_wait4, __kernel_pid_t, pid,
+		int *, status, int, opts, struct rusage *, rusage)
+
+pid_t wait4(pid_t pid, int *status, int opts, struct rusage *rusage)
+{
+	return (__syscall_wait4(pid, status, opts, rusage));
+}
+libc_hidden_def(wait4)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/waitid.c b/ap/build/uClibc/libc/sysdeps/linux/common/waitid.c
new file mode 100644
index 0000000..c8115f9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/waitid.c
@@ -0,0 +1,81 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2007 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+
+#if defined __USE_SVID || defined __USE_XOPEN
+# include <string.h>
+# include <sys/types.h>
+# include <sys/wait.h>
+# include <sys/syscall.h>
+
+# ifdef __NR_waitid
+
+#  ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#  include <sysdep-cancel.h>
+#  else
+#  define SINGLE_THREAD_P 1
+#  endif
+
+/* The waitid() POSIX interface takes 4 arguments, but the kernel function
+ * actually takes 5.  The fifth is a pointer to struct rusage.  Make sure
+ * we pass NULL rather than letting whatever was in the register bleed up.
+ */
+#define __NR_waitid5 __NR_waitid
+static __always_inline
+_syscall5(int, waitid5, idtype_t, idtype, id_t, id, siginfo_t*, infop,
+                 int, options, struct rusage*, ru)
+# endif
+
+int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options)
+{
+# ifdef __NR_waitid
+ if (SINGLE_THREAD_P)
+		return waitid5(idtype, id, infop, options, NULL);
+
+#  ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = waitid5(idtype, id, infop, options, NULL);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#  endif
+
+# elif defined __NR_waitpid
+	switch (idtype) {
+		case P_PID:
+			if (id <= 0)
+				goto invalid;
+			break;
+		case P_PGID:
+			if (id < 0 || id == 1)
+				goto invalid;
+			id = -id;
+			break;
+		case P_ALL:
+			id = -1;
+			break;
+		default:
+		invalid:
+			__set_errno(EINVAL);
+			return -1;
+	}
+
+	memset(infop, 0, sizeof *infop);
+	infop->si_pid = waitpid(id, &infop->si_status, options
+#  ifdef WEXITED
+					   &~ WEXITED
+#  endif
+					  );
+	if (infop->si_pid < 0)
+		return infop->si_pid;
+	return 0;
+# else
+ __set_errno(ENOSYS);
+ return -1;
+# endif
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/waitpid.c b/ap/build/uClibc/libc/sysdeps/linux/common/waitpid.c
new file mode 100644
index 0000000..d043719
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/waitpid.c
@@ -0,0 +1,37 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2006 Steven J. Hill <sjhill@realitydiluted.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include "sysdep-cancel.h"
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+libc_hidden_proto(wait4)
+
+extern __typeof(waitpid) __libc_waitpid;
+__pid_t __libc_waitpid(__pid_t pid, int *wait_stat, int options)
+{
+	if (SINGLE_THREAD_P)
+		return wait4(pid, wait_stat, options, NULL);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = wait4(pid, wait_stat, options, NULL);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+libc_hidden_proto(waitpid)
+weak_alias(__libc_waitpid,waitpid)
+libc_hidden_weak(waitpid)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/write.c b/ap/build/uClibc/libc/sysdeps/linux/common/write.c
new file mode 100644
index 0000000..5a6f722
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/write.c
@@ -0,0 +1,25 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * write() for uClibc
+ *
+ * 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 <unistd.h>
+
+_syscall3(ssize_t, write, int, fd, const __ptr_t, buf, size_t, count)
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(write)
+#else
+libc_hidden_weak(write)
+strong_alias(write,__libc_write)
+#endif
+
+#if 0
+/* Stupid libgcc.a from gcc 2.95.x uses __write in pure.o
+ * which is a blatant GNU libc-ism... */
+strong_alias(write,__write)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/writev.c b/ap/build/uClibc/libc/sysdeps/linux/common/writev.c
new file mode 100644
index 0000000..bd0e407
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/writev.c
@@ -0,0 +1,50 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * writev() for uClibc
+ *
+ * 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 <sys/uio.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <errno.h>
+#include <sysdep-cancel.h>
+
+/* We should deal with kernel which have a smaller UIO_FASTIOV as well
+   as a very big count.  */
+static ssize_t __writev (int fd, const struct iovec *vector, int count)
+{
+  ssize_t bytes_written;
+
+  bytes_written = INLINE_SYSCALL (writev, 3, fd, vector, count);
+
+  if (bytes_written >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
+    return bytes_written;
+
+  /* glibc tries again, but we do not. */
+  /* return __atomic_writev_replacement (fd, vector, count); */
+
+  return -1;
+}
+
+ssize_t writev (int fd, const struct iovec *vector, int count)
+{
+  if (SINGLE_THREAD_P)
+    return __writev (fd, vector, count);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  ssize_t result = __writev (fd, vector, count);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+#else
+_syscall3(ssize_t, writev, int, filedes, const struct iovec *, vector,
+		  int, count)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/xattr.c b/ap/build/uClibc/libc/sysdeps/linux/common/xattr.c
new file mode 100644
index 0000000..dea471a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/xattr.c
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2004 <solar@gentoo.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* This file provides the following Extended Attribute system calls to uClibc.
+ *
+ *	setxattr(), lsetxattr(), fsetxattr(),
+ *	getxattr(), lgetxattr(), fgetxattr(),
+ *	listxattr(), llistxattr(), flistxattr(),
+ *	removexattr(), lremovexattr(), fremovexattr()
+ *
+ * Dec 2004 - <solar@gentoo.org>
+ */
+
+/* Taken from the manpage.
+ * On success, a positive number is returned indicating the size of the
+ * extended attribute name list. On failure, -1 is returned and errno
+ * is set appropriately. If extended attributes are not supported by the
+ * filesystem, or are disabled, errno is set to ENOSYS.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/xattr.h>
+
+/* sets */
+#ifdef __NR_setxattr
+_syscall5(int, setxattr, const char *, path, const char *, name,
+	const void *, value, size_t, size, int, flags)
+#endif
+
+#ifdef __NR_lsetxattr
+_syscall5(int, lsetxattr, const char *, path, const char *, name,
+	const void *, value, size_t, size, int, flags)
+#endif
+
+#ifdef __NR_fsetxattr
+_syscall5(int, fsetxattr, int, filedes, const char *, name, const void *,
+	value, size_t, size, int, flags)
+#endif
+
+/* gets */
+#ifdef __NR_getxattr
+_syscall4(ssize_t, getxattr, const char *, path, const char *, name,
+	void *, value, size_t, size)
+#endif
+
+#ifdef __NR_lgetxattr
+_syscall4(ssize_t, lgetxattr, const char *, path, const char *, name,
+	void *, value, size_t, size)
+#endif
+
+#ifdef __NR_fgetxattr
+_syscall4(ssize_t, fgetxattr, int, filedes, const char *, name, void *,
+	value, size_t, size)
+#endif
+
+/* list */
+#ifdef __NR_listxattr
+_syscall3(ssize_t, listxattr, const char *, path, char *, list, size_t,
+	size)
+#endif
+
+#ifdef __NR_llistxattr
+_syscall3(ssize_t, llistxattr, const char *, path, char *, list, size_t,
+	size)
+#endif
+
+#ifdef __NR_flistxattr
+_syscall3(ssize_t, flistxattr, int, filedes, char *, list, size_t, size)
+#endif
+
+/* remove */
+#ifdef __NR_removexattr
+_syscall2(int, removexattr, const char *, path, const char *, name)
+#endif
+
+#ifdef __NR_lremovexattr
+_syscall2(int, lremovexattr, const char *, path, const char *, name)
+#endif
+
+#ifdef __NR_fremovexattr
+_syscall2(int, fremovexattr, int, filedes, const char *, name)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.c b/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.c
new file mode 100644
index 0000000..deef392
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.c
@@ -0,0 +1,90 @@
+/* Convert between the kernel's `struct stat' format, and libc's.
+   Copyright (C) 1991,1995,1996,1997,2000,2002 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.
+
+   Modified for uClibc by Erik Andersen <andersen@codepoet.org>
+   */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+#include <string.h>
+#include "xstatconv.h"
+
+void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
+{
+	/* Convert to current kernel version of `struct stat'. */
+	memset(buf, 0x00, sizeof(*buf));
+	buf->st_dev = kbuf->st_dev;
+	buf->st_ino = kbuf->st_ino;
+	buf->st_mode = kbuf->st_mode;
+	buf->st_nlink = kbuf->st_nlink;
+	buf->st_uid = kbuf->st_uid;
+	buf->st_gid = kbuf->st_gid;
+	buf->st_rdev = kbuf->st_rdev;
+	buf->st_size = kbuf->st_size;
+	buf->st_blksize = kbuf->st_blksize;
+	buf->st_blocks = kbuf->st_blocks;
+	buf->st_atim = kbuf->st_atim;
+	buf->st_mtim = kbuf->st_mtim;
+	buf->st_ctim = kbuf->st_ctim;
+}
+
+void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf)
+{
+	/* Convert to current kernel version of `struct stat64'. */
+	memset(buf, 0x00, sizeof(*buf));
+	buf->st_dev = kbuf->st_dev;
+	buf->st_ino = kbuf->st_ino;
+	buf->st_mode = kbuf->st_mode;
+	buf->st_nlink = kbuf->st_nlink;
+	buf->st_uid = kbuf->st_uid;
+	buf->st_gid = kbuf->st_gid;
+	buf->st_rdev = kbuf->st_rdev;
+	buf->st_size = kbuf->st_size;
+	buf->st_blksize = kbuf->st_blksize;
+	buf->st_blocks = kbuf->st_blocks;
+	buf->st_atim = kbuf->st_atim;
+	buf->st_mtim = kbuf->st_mtim;
+	buf->st_ctim = kbuf->st_ctim;
+}
+
+#ifdef __UCLIBC_HAS_LFS__
+
+void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf)
+{
+	/* Convert to current kernel version of `struct stat64'. */
+	memset(buf, 0x00, sizeof(*buf));
+	buf->st_dev = kbuf->st_dev;
+	buf->st_ino = kbuf->st_ino;
+# ifdef _HAVE_STAT64___ST_INO
+	buf->__st_ino = kbuf->__st_ino;
+# endif
+	buf->st_mode = kbuf->st_mode;
+	buf->st_nlink = kbuf->st_nlink;
+	buf->st_uid = kbuf->st_uid;
+	buf->st_gid = kbuf->st_gid;
+	buf->st_rdev = kbuf->st_rdev;
+	buf->st_size = kbuf->st_size;
+	buf->st_blksize = kbuf->st_blksize;
+	buf->st_blocks = kbuf->st_blocks;
+	buf->st_atim = kbuf->st_atim;
+	buf->st_mtim = kbuf->st_mtim;
+	buf->st_ctim = kbuf->st_ctim;
+}
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.h b/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.h
new file mode 100644
index 0000000..7568da8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.h
@@ -0,0 +1,33 @@
+/* Convert between the kernel's `struct stat' format, and libc's.
+   Copyright (C) 1991,1995,1996,1997,2000,2002 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.
+
+   Modified for uClibc by Erik Andersen <andersen@codepoet.org>
+   */
+
+/* Pull in whatever this particular arch's kernel thinks the kernel version of
+ * struct stat should look like.  It turns out that each arch has a different
+ * opinion on the subject, and different kernel revs use different names... */
+#include <bits/kernel_stat.h>
+
+extern void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf) attribute_hidden;
+extern void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf) attribute_hidden;
+#if defined __UCLIBC_HAS_LFS__
+extern void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf) attribute_hidden;
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/Makefile b/ap/build/uClibc/libc/sysdeps/linux/cris/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/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/cris/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/cris/Makefile.arch
new file mode 100644
index 0000000..8a682b0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/Makefile.arch
@@ -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.
+#
+
+CSRC := __init_brk.c brk.c sbrk.c
+
+SSRC := setjmp.S __longjmp.S clone.S sysdep.S syscall.S vfork.S
+ifeq ($(UNIFIED_SYSCALL),y)
+SSRC += __uClibc_syscall.S
+endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/__init_brk.c b/ap/build/uClibc/libc/sysdeps/linux/cris/__init_brk.c
new file mode 100644
index 0000000..27b8524
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/__init_brk.c
@@ -0,0 +1,32 @@
+/* From libc-5.3.12 */
+
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <errno.h>
+#include "sysdep.h"
+
+void * __curbrk attribute_hidden = 0;
+
+extern int __init_brk (void) attribute_hidden;
+int
+__init_brk (void)
+{
+    if (__curbrk == 0) {
+	    /* Notice that we don't need to save/restore the GOT
+	     * register since that is not call clobbered by the syscall.
+	     */
+	    __asm__ ("clear.d $r10\n\t"
+		 "movu.w " STR(__NR_brk) ",$r9\n\t"
+		 "break 13\n\t"
+		 "move.d $r10, %0"
+		 : "=r" (__curbrk)
+		 :
+		 : "r9", "r10");
+
+	    if (__curbrk == 0) {
+		    __set_errno(ENOMEM);
+		    return -1;
+	    }
+    }
+    return 0;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/cris/__longjmp.S
new file mode 100644
index 0000000..52a986f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/__longjmp.S
@@ -0,0 +1,62 @@
+/* longjmp for CRIS.
+   Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <features.h>
+#include "sysdep.h"
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+	.syntax no_register_prefix
+
+/* Saving and restoring CCR is meaningless, so we don't do it.  */
+ENTRY (__longjmp)
+	/* Note that r10 = jmp_buf, r11 = retval.  */
+#ifdef __arch_v32
+
+	/* We don't restore the call-clobbered registers for v32;
+	   their space (corresponding to v10) is now defined as
+	   reserved.  */
+	movem [r10],r9
+	addq 14*4,r10
+	cmpq 0,r11
+	beq 0f
+	move.d [r10+],sp
+
+	move.d r11,r9
+0:
+	move.d [r10+],acr
+	jump acr
+	move [r10],srp
+
+#else
+
+	move [r10+16*4],srp
+	test.d r11
+	beq 0f                  /* Already a 1 in place. */
+	nop
+	/* Offset for r9, the return value (see setjmp).  */
+	move.d r11,[r10+6*4]
+0:
+	movem [r10],pc
+
+#endif
+END (__longjmp)
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/bits/byteswap.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/byteswap.h
new file mode 100644
index 0000000..a82f9c0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/byteswap.h
@@ -0,0 +1,20 @@
+#ifndef _ASM_BITS_BYTESWAP_H
+#define _ASM_BITS_BYTESWAP_H 1
+
+/* CRIS specific byte swap operations: 16, 32 and 64-bit */
+
+#define __bswap_non_constant_16(x) \
+	__extension__ 							\
+	({ unsigned short __bswap_16_v; 				\
+	   __asm__ ("swapb %0" : "=r" (__bswap_16_v) : "0" (x)); 	\
+	   __bswap_16_v; })
+
+#define __bswap_non_constant_32(x) \
+	__extension__ 							\
+	({ unsigned int __bswap_32_v; 					\
+	   __asm__ ("swapwb %0" : "=r" (__bswap_32_v) : "0" (x)); 	\
+	   __bswap_32_v; })
+
+#endif
+
+#include <bits/byteswap-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/endian.h
new file mode 100644
index 0000000..90e290b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/endian.h
@@ -0,0 +1,7 @@
+/* cris is little-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/fcntl.h
new file mode 100644
index 0000000..29443ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/fcntl.h
@@ -0,0 +1,239 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 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	_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_DIRECT	 040000	/* Direct disk access.	*/
+# define O_DIRECTORY	0200000	/* Must be a directory.	 */
+# define O_NOFOLLOW	0400000	/* Do not follow links.	 */
+# define O_NOATIME	01000000 /* Do not set atime.  */
+# define O_CLOEXEC	02000000 /* set close_on_exec */
+#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	0100000
+#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]FL.  */
+#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/cris/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/kernel_stat.h
new file mode 100644
index 0000000..619f35e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/kernel_stat.h
@@ -0,0 +1,58 @@
+/* Taken from linux/include/asm-cris/stat.h */
+
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+struct kernel_stat {
+	unsigned short st_dev;
+	unsigned short __pad1;
+	unsigned long st_ino;
+	unsigned short st_mode;
+	unsigned short st_nlink;
+	unsigned short st_uid;
+	unsigned short st_gid;
+	unsigned short st_rdev;
+	unsigned short __pad2;
+	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;
+};
+
+/* This matches struct kernel_stat64 in glibc2.1, hence the absolutely
+ * insane amounts of padding around dev_t's.
+ */
+struct kernel_stat64 {
+	unsigned short	st_dev;
+	unsigned char	__pad0[10];
+
+#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 short	st_rdev;
+	unsigned char	__pad3[10];
+
+	long long	st_size;
+	unsigned long	st_blksize;
+
+	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
+	unsigned long	__pad4;		/* future possible st_blocks high bits */
+
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+
+	unsigned long long	st_ino;
+};
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/kernel_types.h
new file mode 100644
index 0000000..5d31f7b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/kernel_types.h
@@ -0,0 +1,48 @@
+/* Taken from linux/include/asm-cris/posix_types.h */
+
+#ifndef __ARCH_CRIS_POSIX_TYPES_H
+#define __ARCH_CRIS_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 long	__kernel_size_t;
+typedef long		__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 __kernel_dev_t	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+
+#ifdef __GNUC__
+typedef long long	__kernel_loff_t;
+#endif
+
+typedef struct {
+#if defined(__USE_ALL)
+	int	val[2];
+#else
+	int	__val[2];
+#endif
+    } __kernel_fsid_t;
+
+/* should this ifdef be here ?  */
+
+#endif /* __ARCH_CRIS_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/setjmp.h
new file mode 100644
index 0000000..2a29c8c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/setjmp.h
@@ -0,0 +1,66 @@
+/* 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'.  CRIS 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
+
+/*
+   Note that we save and restore CCR to be able to
+   correctly handle DI/EI.  Note also that the "move x,ccr" does NOT affect
+   the DMA enable bits (E and D).
+
+   jmp_buf[0] - PC
+   jmp_buf[1] - SP (R14)
+   jmp_buf[2] - R13
+   jmp_buf[3] - R12
+   jmp_buf[4] - R11
+   jmp_buf[5] - R10
+   jmp_buf[6] - R9
+   jmp_buf[7] - R8
+   jmp_buf[8] - R7
+   jmp_buf[9] - R6
+   jmp_buf[10] - R5
+   jmp_buf[11] - R4
+   jmp_buf[12] - R3
+   jmp_buf[13] - R2
+   jmp_buf[14] - R1
+   jmp_buf[15] - R0
+   jmp_buf[16] - SRP
+   jmp_buf[17] - CCR
+   */
+
+#define _JBLEN 18
+#if     defined (__USE_MISC) || defined (_ASM)
+#define JB_SP 1
+#endif
+
+#ifndef	_ASM
+typedef int __jmp_buf[_JBLEN];
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[JB_SP])
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/stackinfo.h
new file mode 100644
index 0000000..43c9448
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2002 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 cris the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/syscalls.h
new file mode 100644
index 0000000..cb2f41c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/syscalls.h
@@ -0,0 +1,96 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+
+#ifndef _SYSCALL_H
+#error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\
+(__extension__ \
+  ({						\
+     register unsigned long __res __asm__ ("r10");	\
+     LOAD_ARGS_c_##nr(args)			\
+     register unsigned long __callno __asm__ ("r9")	\
+       = name;					\
+     __asm__ __volatile__ (LOAD_ARGS_asm_##nr (args)	\
+		   CHECK_ARGS_asm_##nr		\
+		   "break 13"			\
+		   : "=r" (__res)		\
+		   : ASM_ARGS_##nr (args)	\
+		   : ASM_CLOBBER_##nr);		\
+     __res;					\
+   }) \
+)
+#define LOAD_ARGS_c_0()
+#define LOAD_ARGS_asm_0()
+#define ASM_CLOBBER_0 "memory"
+#define ASM_ARGS_0() "r" (__callno)
+#define CHECK_ARGS_asm_0
+
+#define LOAD_ARGS_c_1(r10) \
+	LOAD_ARGS_c_0()						\
+	register unsigned long __r10 __asm__ ("r10") = (unsigned long) (r10);
+#define LOAD_ARGS_asm_1(r10) LOAD_ARGS_asm_0 ()
+#define ASM_CLOBBER_1 ASM_CLOBBER_0
+#define ASM_ARGS_1(r10) ASM_ARGS_0 (), "0" (__r10)
+#define CHECK_ARGS_asm_1			\
+	".ifnc %0,$r10\n\t"			\
+	".err\n\t"				\
+	".endif\n\t"
+
+#define LOAD_ARGS_c_2(r10, r11) \
+	LOAD_ARGS_c_1(r10)					\
+	register unsigned long __r11 __asm__ ("r11") = (unsigned long) (r11);
+#define LOAD_ARGS_asm_2(r10, r11) LOAD_ARGS_asm_1 (r10)
+#define ASM_CLOBBER_2 ASM_CLOBBER_1
+#define ASM_ARGS_2(r10, r11) ASM_ARGS_1 (r10), "r" (__r11)
+#define CHECK_ARGS_asm_2			\
+	".ifnc %0-%3,$r10-$r11\n\t"		\
+	".err\n\t"				\
+	".endif\n\t"
+
+#define LOAD_ARGS_c_3(r10, r11, r12) \
+	LOAD_ARGS_c_2(r10, r11)					\
+	register unsigned long __r12 __asm__ ("r12") = (unsigned long) (r12);
+#define LOAD_ARGS_asm_3(r10, r11, r12) LOAD_ARGS_asm_2 (r10, r11)
+#define ASM_CLOBBER_3 ASM_CLOBBER_2
+#define ASM_ARGS_3(r10, r11, r12) ASM_ARGS_2 (r10, r11), "r" (__r12)
+#define CHECK_ARGS_asm_3			\
+	".ifnc %0-%3-%4,$r10-$r11-$r12\n\t"	\
+	".err\n\t"				\
+	".endif\n\t"
+
+#define LOAD_ARGS_c_4(r10, r11, r12, r13) \
+	LOAD_ARGS_c_3(r10, r11, r12)				\
+	register unsigned long __r13 __asm__ ("r13") = (unsigned long) (r13);
+#define LOAD_ARGS_asm_4(r10, r11, r12, r13) LOAD_ARGS_asm_3 (r10, r11, r12)
+#define ASM_CLOBBER_4 ASM_CLOBBER_3
+#define ASM_ARGS_4(r10, r11, r12, r13) ASM_ARGS_3 (r10, r11, r12), "r" (__r13)
+#define CHECK_ARGS_asm_4				\
+	".ifnc %0-%3-%4-%5,$r10-$r11-$r12-$r13\n\t"	\
+	".err\n\t"					\
+	".endif\n\t"
+
+#define LOAD_ARGS_c_5(r10, r11, r12, r13, mof) \
+	LOAD_ARGS_c_4(r10, r11, r12, r13)
+#define LOAD_ARGS_asm_5(r10, r11, r12, r13, mof) \
+	LOAD_ARGS_asm_4 (r10, r11, r12, r13) "move %6,$mof\n\t"
+#define ASM_CLOBBER_5 ASM_CLOBBER_4
+#define ASM_ARGS_5(r10, r11, r12, r13, mof) \
+	ASM_ARGS_4 (r10, r11, r12, r13), "g" (mof)
+#define CHECK_ARGS_asm_5 CHECK_ARGS_asm_4
+
+#define LOAD_ARGS_c_6(r10, r11, r12, r13, mof, srp)		\
+	LOAD_ARGS_c_5(r10, r11, r12, r13, mof)
+#define LOAD_ARGS_asm_6(r10, r11, r12, r13, mof, srp)		\
+	LOAD_ARGS_asm_5(r10, r11, r12, r13, mof)		\
+	"move %7,$srp\n\t"
+#define ASM_CLOBBER_6 ASM_CLOBBER_5, "srp"
+#define ASM_ARGS_6(r10, r11, r12, r13, mof, srp) \
+	ASM_ARGS_5 (r10, r11, r12, r13, mof), "g" (srp)
+#define CHECK_ARGS_asm_6 CHECK_ARGS_asm_5
+
+#endif /* not __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/bits/termios.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/termios.h
new file mode 100644
index 0000000..63ca4ea
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/termios.h
@@ -0,0 +1,215 @@
+/* termios type and macro definitions.  Linux version.
+   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 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.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char	cc_t;
+typedef unsigned int	speed_t;
+typedef unsigned int	tcflag_t;
+
+#define NCCS 32
+struct termios
+  {
+    tcflag_t c_iflag;		/* input mode flags */
+    tcflag_t c_oflag;		/* output mode flags */
+    tcflag_t c_cflag;		/* control mode flags */
+    tcflag_t c_lflag;		/* local mode flags */
+    cc_t c_line;			/* line discipline */
+    cc_t c_cc[NCCS];		/* control characters */
+    speed_t c_ispeed;		/* input speed */
+    speed_t c_ospeed;		/* output speed */
+#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
+#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
+  };
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* c_iflag bits */
+#define IGNBRK	0000001
+#define BRKINT	0000002
+#define IGNPAR	0000004
+#define PARMRK	0000010
+#define INPCK	0000020
+#define ISTRIP	0000040
+#define INLCR	0000100
+#define IGNCR	0000200
+#define ICRNL	0000400
+#define IUCLC	0001000
+#define IXON	0002000
+#define IXANY	0004000
+#define IXOFF	0010000
+#define IMAXBEL	0020000
+#define IUTF8	0040000
+
+/* c_oflag bits */
+#define OPOST	0000001
+#define OLCUC	0000002
+#define ONLCR	0000004
+#define OCRNL	0000010
+#define ONOCR	0000020
+#define ONLRET	0000040
+#define OFILL	0000100
+#define OFDEL	0000200
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY	0000400
+# define   NL0	0000000
+# define   NL1	0000400
+# define CRDLY	0003000
+# define   CR0	0000000
+# define   CR1	0001000
+# define   CR2	0002000
+# define   CR3	0003000
+# define TABDLY	0014000
+# define   TAB0	0000000
+# define   TAB1	0004000
+# define   TAB2	0010000
+# define   TAB3	0014000
+# define BSDLY	0020000
+# define   BS0	0000000
+# define   BS1	0020000
+# define FFDLY	0100000
+# define   FF0	0000000
+# define   FF1	0100000
+#endif
+
+#define VTDLY	0040000
+#define   VT0	0000000
+#define   VT1	0040000
+
+#ifdef __USE_MISC
+# define XTABS	0014000
+#endif
+
+/* c_cflag bit meaning */
+#ifdef __USE_MISC
+# define CBAUD	0010017
+#endif
+#define  B0	0000000		/* hang up */
+#define  B50	0000001
+#define  B75	0000002
+#define  B110	0000003
+#define  B134	0000004
+#define  B150	0000005
+#define  B200	0000006
+#define  B300	0000007
+#define  B600	0000010
+#define  B1200	0000011
+#define  B1800	0000012
+#define  B2400	0000013
+#define  B4800	0000014
+#define  B9600	0000015
+#define  B19200	0000016
+#define  B38400	0000017
+#ifdef __USE_MISC
+# define EXTA B19200
+# define EXTB B38400
+#endif
+#define CSIZE	0000060
+#define   CS5	0000000
+#define   CS6	0000020
+#define   CS7	0000040
+#define   CS8	0000060
+#define CSTOPB	0000100
+#define CREAD	0000200
+#define PARENB	0000400
+#define PARODD	0001000
+#define HUPCL	0002000
+#define CLOCAL	0004000
+#ifdef __USE_MISC
+# define CBAUDEX 0010000
+#endif
+#define  B57600   0010001
+#define  B115200  0010002
+#define  B230400  0010003
+#define  B460800  0010004
+#define  B921600  0010005
+#define  B1843200 0010006
+#define  B6250000 0010007
+#ifdef __arch_v32
+#define  B12500000 0010010
+#define __MAX_BAUD B12500000
+#else
+#define __MAX_BAUD B6250000
+#endif
+#ifdef __USE_MISC
+# define CIBAUD	  002003600000		/* input baud rate (not used) */
+# define CMSPAR   010000000000		/* mark or space (stick) parity */
+# define CRTSCTS  020000000000		/* flow control */
+#endif
+
+/* c_lflag bits */
+#define ISIG	0000001
+#define ICANON	0000002
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE	0000004
+#endif
+#define ECHO	0000010
+#define ECHOE	0000020
+#define ECHOK	0000040
+#define ECHONL	0000100
+#define NOFLSH	0000200
+#define TOSTOP	0000400
+#ifdef __USE_MISC
+# define ECHOCTL 0001000
+# define ECHOPRT 0002000
+# define ECHOKE	 0004000
+# define FLUSHO	 0010000
+# define PENDIN	 0040000
+#endif
+#define IEXTEN	0100000
+
+/* tcflow() and TCXONC use these */
+#define	TCOOFF		0
+#define	TCOON		1
+#define	TCIOFF		2
+#define	TCION		3
+
+/* tcflush() and TCFLSH use these */
+#define	TCIFLUSH	0
+#define	TCOFLUSH	1
+#define	TCIOFLUSH	2
+
+/* tcsetattr uses these */
+#define	TCSANOW		0
+#define	TCSADRAIN	1
+#define	TCSAFLUSH	2
+
+
+#define _IOT_termios /* Hurd ioctl type field.  */ \
+  _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..fc14946
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/uClibc_arch_features.h
@@ -0,0 +1,48 @@
+/*
+ * 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__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target 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 */
+#define __UCLIBC_ASM_LINE_SEP__ @
+
+#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/bits/uClibc_page.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/uClibc_page.h
new file mode 100644
index 0000000..adfc3c9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/uClibc_page.h
@@ -0,0 +1,34 @@
+/*  Copyright (C) 2004     Erik Andersen
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supply an architecture specific value for PAGE_SIZE and friends.  */
+
+#ifndef _UCLIBC_PAGE_H
+#define _UCLIBC_PAGE_H
+
+/* PAGE_SHIFT determines the page size -- in this case 8192 */
+#define PAGE_SHIFT	13
+#define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#define PAGE_MASK	(~(PAGE_SIZE-1))
+
+/* Some architectures always use 12 as page shift for mmap2() eventhough the
+ * real PAGE_SHIFT != 12.  Other architectures use the same value as
+ * PAGE_SHIFT...
+ */
+#define MMAP2_PAGE_SHIFT PAGE_SHIFT
+
+#endif /* _UCLIBC_PAGE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/cris/bits/wordsize.h
new file mode 100644
index 0000000..d6a2fc6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#define __WORDSIZE      32
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/brk.c b/ap/build/uClibc/libc/sysdeps/linux/cris/brk.c
new file mode 100644
index 0000000..6c877bb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/brk.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <errno.h>
+#include "sysdep.h"
+
+extern void * __curbrk attribute_hidden;
+extern int __init_brk (void) attribute_hidden;
+
+int brk(void * end_data_seg)
+{
+	if (__init_brk () == 0) {
+		/*
+		 * Notice that we don't need to save/restore the GOT
+		 * register since that is not call clobbered by the syscall.
+		 */
+		__asm__ ("move.d %1,$r10\n\t"
+		     "movu.w " STR(__NR_brk) ",$r9\n\t"
+		     "break 13\n\t"
+		     "move.d $r10, %0"
+		     : "=r" (__curbrk)
+		     : "g" (end_data_seg)
+		     : "r9", "r10");
+
+		if (__curbrk == end_data_seg)
+			return 0;
+		__set_errno(ENOMEM);
+	}
+	return -1;
+
+}
+libc_hidden_def(brk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/clone.S b/ap/build/uClibc/libc/sysdeps/linux/cris/clone.S
new file mode 100644
index 0000000..9e284fe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/clone.S
@@ -0,0 +1,96 @@
+/* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <features.h>
+#include <sys/syscall.h>
+#include "sysdep.h"
+#define _ERRNO_H	1
+#include <bits/errno.h>
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
+
+	.syntax no_register_prefix
+
+        .text
+ENTRY (clone)
+	/* Sanity check arguments: No NULL function pointers.  Allow a NULL
+	   stack pointer though; it makes the kernel allocate stack.  */
+	cmpq	0,r10
+	beq	1f
+	nop
+
+	/* We need to muck with a few registers.  */
+	subq	8,sp
+	movem	r1,[sp]
+
+	/* Save the function pointer and argument.  We can't save them
+	   onto the new stack since it can be NULL.  */
+	move.d	r10,r0
+	move.d	r13,r1
+
+        /* Move the other arguments into place for the system call.  */
+	move.d	r11,r10
+	move.d	r12,r11
+
+	/* Do the system call.  */
+	movu.w	SYS_ify (clone),r9
+	break	13
+	cmpq	0,r10
+	beq	.Lthread_start
+	nop
+
+	/* Jump to error handler if we get (unsigned) -4096 .. 0xffffffff.  */
+	cmps.w	-4096,r10
+	bhs	0f
+	movem	[sp+],r1
+
+	/* In parent, successful return.  (Avoid using "ret" - it's a macro.)  */
+	Ret
+	nop
+
+.Lthread_start:
+	/* Terminate frame pointers here.  */
+	moveq	0,r8
+
+#ifdef __arch_v32
+	/* Is this the right place for an argument?  */
+	jsr	r0
+	move.d	r1,r10
+#else
+	/* I've told you once.  */
+	move.d	r1,r10
+	jsr	r0
+#endif
+
+	SETUP_PIC
+	PLTCALL	(HIDDEN_JUMPTARGET(_exit))
+
+	/* Die horribly.  */
+	move.d 6809,r13
+	test.d	[r13]
+
+	/* Stop the unstoppable.  */
+9:
+	ba	9b
+	nop
+
+/* Local error handler.  */
+1:
+	movs.w	-EINVAL,r10
+	/* Drop through into the ordinary error handler.  */
+PSEUDO_END (clone)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/cris/crt1.S
new file mode 100644
index 0000000..b07e36b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/crt1.S
@@ -0,0 +1,56 @@
+/* Startup code compliant to the ELF CRIS ABI */
+
+#include <features.h>
+
+	.syntax no_register_prefix
+
+/* The first piece of initialized data.  */
+	.data
+	.global	__data_start
+	.align	2
+	.type	__data_start, @object
+	.size	__data_start, 4
+__data_start:
+	.dword	0
+
+	.text
+	.align	1
+	.global	_start
+	.type	_start, %function
+#if defined(__UCLIBC_CTOR_DTOR__)
+	.type	_init, %function
+	.type	_fini, %function
+#else
+	.weak	_init
+	.weak	_fini
+#endif
+	.type	main, %function
+	.type	__uClibc_main, %function
+
+/*
+ * On the stack we have argc. We can calculate argv/envp
+ * from that and the succeeding stack location, but fix so
+ * we get the right calling convention (regs in r10/r11).
+ *
+ * Please view linux/fs/binfmt_elf.c for a complete
+ * understanding of this.
+ */
+
+/*
+ * Need to call __uClibc_main(main, argc, argv, _init, _fini)
+ */
+
+_start:
+	move.d	main, r10
+	move.d	[sp+], r11
+	move.d	sp, r12
+	subq	4, sp
+	move	srp, [sp]
+	subq	4, sp
+	move.d	_fini, r13
+	move.d	r13, [sp]
+	move.d	_init, r13
+	/* Leave control to the libc */
+	jsr	__uClibc_main
+	nop
+	.size	_start, .-_start
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/crti.S b/ap/build/uClibc/libc/sysdeps/linux/cris/crti.S
new file mode 100644
index 0000000..d9e1397
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/crti.S
@@ -0,0 +1,37 @@
+/* glibc's sysdeps/cris/elf/initfini.c used for reference [PROLOG] */
+
+	.section	.init
+	.align	1
+	.global	_init
+	.type	_init, @function
+_init:
+	subq	4,$sp
+	move.d	$r1,[$sp]
+	move	$srp,$r1
+	subq	4,$sp
+	move.d	$r0,[$sp]
+#ifdef __arch_v32
+	lapc	_GLOBAL_OFFSET_TABLE_,$r0
+#else
+	move.d	$pc,$r0
+	sub.d	.:GOTOFF,$r0
+#endif
+	.align	1
+
+	.section	.fini
+	.align	1
+	.global	_fini
+	.type	_fini, @function
+_fini:
+	subq	4,$sp
+	move.d	$r1,[$sp]
+	move	$srp,$r1
+	subq	4,$sp
+	move.d	$r0,[$sp]
+#ifdef __arch_v32
+	lapc	_GLOBAL_OFFSET_TABLE_,$r0
+#else
+	move.d	$pc,$r0
+	sub.d	.:GOTOFF,$r0
+#endif
+	.align	1
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/cris/crtn.S
new file mode 100644
index 0000000..7b2dce1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/crtn.S
@@ -0,0 +1,21 @@
+/* glibc's sysdeps/cris/elf/initfini.c used for reference [EPILOG] */
+
+	.section	.init
+	.align	1
+	.global	_init
+	.type	_init, @function
+	move.d	[$sp+],$r0
+	move	$r1,$srp
+	move.d	[$sp+],$r1
+	Ret
+	nop
+
+	.section	.fini
+	.align	1
+	.global	_fini
+	.type	_fini, @function
+	move.d	[$sp+],$r0
+	move	$r1,$srp
+	move.d	[$sp+],$r1
+	Ret
+	nop
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/fork.c b/ap/build/uClibc/libc/sysdeps/linux/cris/fork.c
new file mode 100644
index 0000000..19aa172
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/fork.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include "sysdep.h"
+
+#define __NR___libc_fork __NR_fork
+SYSCALL__ (__libc_fork, 0)
+	/* R1 is now 0 for the parent and 1 for the child.  Decrement it to
+	   make it -1 (all bits set) for the parent, and 0 (no bits set)
+	   for the child.  Then AND it with R0, so the parent gets
+	   R0&-1==R0, and the child gets R0&0==0.  */
+     /* i dunno what the blurb above is useful for. we just return. */
+__asm__("ret\n\tnop");
+weak_alias(__libc_fork,fork)
+libc_hidden_weak(fork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/libc.map b/ap/build/uClibc/libc/sysdeps/linux/cris/libc.map
new file mode 100644
index 0000000..6710c73
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/libc.map
@@ -0,0 +1,3 @@
+U {
+	local: __sigjmp_save;
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/sbrk.c b/ap/build/uClibc/libc/sysdeps/linux/cris/sbrk.c
new file mode 100644
index 0000000..fa04b20
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/sbrk.c
@@ -0,0 +1,41 @@
+/* From libc-5.3.12 */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <errno.h>
+#include "sysdep.h"
+
+extern void * __curbrk attribute_hidden;
+extern int __init_brk (void) attribute_hidden;
+
+void *
+sbrk(intptr_t increment)
+{
+	if (__init_brk () == 0) {
+		void * tmp = __curbrk + increment;
+
+		/*
+		 * Notice that we don't need to save/restore the GOT
+		 * register since that is not call clobbered by the syscall.
+		 */
+		__asm__ ("move.d %1,$r10\n\t"
+		     "movu.w " STR(__NR_brk) ",$r9\n\t"
+		     "break 13\n\t"
+		     "move.d $r10, %0"
+		     : "=r" (__curbrk)
+		     : "g" (tmp)
+		     : "r9", "r10");
+
+		if (__curbrk == tmp)
+			return tmp - increment;
+		__set_errno(ENOMEM);
+		return ((void *) -1);
+	}
+	return ((void *) -1);
+}
+libc_hidden_def(sbrk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/cris/setjmp.S
new file mode 100644
index 0000000..e7bb635
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/setjmp.S
@@ -0,0 +1,84 @@
+/* setjmp for CRIS.
+   Copyright (C) 2001, 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "sysdep.h"
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+        .syntax no_register_prefix
+
+ENTRY (__sigsetjmp)
+.Local__sigsetjmp:      
+
+#ifdef __arch_v32
+
+	moveq 1,r9
+	move.d r10,r12
+	addq 14*4,r12
+	movem r9,[r10]
+	lapc 0f,r13
+	move.d sp,[r12+]
+	move.d r13,[r12+]
+	move srp,[r12+]
+
+#else
+
+        moveq 1,r9
+        movem sp,[r10+1*4]
+#ifdef __PIC__
+        move.d pc,r9
+        addq 0f-.,r9
+#else
+        move.d 0f,r9
+#endif
+        move.d r9,[r10]
+        move srp,[r10+16*4]
+
+#endif
+
+/* Saving and restoring CCR is meaningless, so we don't do it.  */
+
+/* Saving registers would complicate  the implementation, but we
+   can get away with not setting up R0 here since we know that
+   __sigjmp_save is a local symbol; it doesn't have a PLT (which
+   would have required GOT in R0 at the time of the jump).  */
+        PLTJUMP (__sigjmp_save)
+0: /* This is where longjmp returns.  (Don't use "ret" - it's a macro.  */
+        Ret
+        move.d r9,r10
+END (__sigsetjmp)
+	
+/* Binary compatibility entry points.  Having these in separate files
+   is not meaningful and just adds library overhead.  */
+
+ENTRY (__setjmp)
+        ba .Local__sigsetjmp
+        moveq 0,r11
+END (__setjmp)
+
+ENTRY (_setjmp)
+        ba .Local__sigsetjmp
+        moveq 0,r11
+END (_setjmp)
+
+ENTRY (setjmp)
+        ba .Local__sigsetjmp
+        moveq 1,r11
+END (setjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/cris/sys/procfs.h
new file mode 100644
index 0000000..072029b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/sys/procfs.h
@@ -0,0 +1,115 @@
+/* Copyright (C) 1996, 1997, 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+#include <asm/elf.h>
+
+__BEGIN_DECLS
+
+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.  Fields present but not used are
+   marked with "XXX".  */
+struct elf_prstatus
+  {
+#if 0
+    long int pr_flags;			/* XXX Process flags.  */
+    short int pr_why;			/* XXX Reason for process halt.  */
+    short int pr_what;			/* XXX More detailed reason.  */
+#endif
+    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.  */
+#if 0
+    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
+    struct sigaction pr_action;		/* Signal action for current sig.  */
+#endif
+    __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.  */
+#if 0
+    long int pr_instr;			/* Current instruction.  */
+#endif
+    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.  */
+  };
+
+/* Addresses.  */
+typedef void *psaddr_t;
+
+/* Register sets.  Linux has different names.  */
+typedef gregset_t prgregset_t;
+typedef fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+   therefore habe only ine PID type.  */
+typedef __pid_t lwpid_t;
+
+
+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/cris/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/cris/sys/ucontext.h
new file mode 100644
index 0000000..5f87545
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/sys/ucontext.h
@@ -0,0 +1,95 @@
+/* Copyright (C) 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.  */
+
+/* System V/cris ABI compliant context switching support.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#include <features.h>
+#include <signal.h>
+
+#include <bits/sigcontext.h>
+
+/* Type for general register.  */
+typedef long int greg_t;
+
+/* Number of general registers.  */
+#define NGREG   20
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+/* 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
+  R_SP = R14,
+#define R_SP    R_SP
+  R_PC = R15,
+#define R_PC    R_PC
+};
+
+/* A placeholder; CRIS does not have any fp regs.  */
+typedef unsigned long fpregset_t;
+
+/* A machine context is exactly a sigcontext.  */
+typedef struct sigcontext mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/cris/sys/user.h
new file mode 100644
index 0000000..d629c30
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/sys/user.h
@@ -0,0 +1,81 @@
+#ifndef __ASM_CRIS_USER_H
+#define __ASM_CRIS_USER_H
+
+/* User-mode register used for core dumps. */
+
+struct user_fpregs {
+};
+
+struct user_regs_struct {
+	unsigned long r0;	/* General registers. */
+	unsigned long r1;
+	unsigned long r2;
+	unsigned long r3;
+	unsigned long r4;
+	unsigned long r5;
+	unsigned long r6;
+	unsigned long r7;
+	unsigned long r8;
+	unsigned long r9;
+	unsigned long r10;
+	unsigned long r11;
+	unsigned long r12;
+	unsigned long r13;
+	unsigned long sp;	/* R14, Stack pointer. */
+	unsigned long acr;	/* R15, Address calculation register. */
+	unsigned long bz;	/* P0, Constant zero (8-bits). */
+	unsigned long vr;	/* P1, Version register (8-bits). */
+	unsigned long pid;	/* P2, Process ID (8-bits). */
+	unsigned long srs;	/* P3, Support register select (8-bits). */
+	unsigned long wz;	/* P4, Constant zero (16-bits). */
+	unsigned long exs;	/* P5, Exception status. */
+	unsigned long eda;	/* P6, Exception data address. */
+	unsigned long mof;	/* P7, Multiply overflow regiter. */
+	unsigned long dz;	/* P8, Constant zero (32-bits). */
+	unsigned long ebp;	/* P9, Exception base pointer. */
+	unsigned long erp;	/* P10, Exception return pointer. */
+	unsigned long srp;	/* P11, Subroutine return pointer. */
+	unsigned long nrp;	/* P12, NMI return pointer. */
+	unsigned long ccs;	/* P13, Condition code stack. */
+	unsigned long usp;	/* P14, User mode stack pointer. */
+	unsigned long spc;	/* P15, Single step PC. */
+};
+
+/*
+ * Core file format: The core file is written in such a way that gdb
+ * can understand it and provide useful information to the user (under
+ * linux we use the `trad-core' bfd).  The file contents are as follows:
+ *
+ *  upage: 1 page consisting of a user struct that tells gdb
+ *	what is present in the file.  Directly after this is a
+ *	copy of the task_struct, which is currently not used by gdb,
+ *	but it may come in handy at some point.  All of the registers
+ *	are stored as part of the upage.  The upage should always be
+ *	only one page long.
+ *  data: The data segment follows next.  We use current->end_text to
+ *	current->brk to pick up all of the user variables, plus any memory
+ *	that may have been sbrk'ed.  No attempt is made to determine if a
+ *	page is demand-zero or if a page is totally unused, we just cover
+ *	the entire range.  All of the addresses are rounded in such a way
+ *	that an integral number of pages is written.
+ *  stack: We need the stack information in order to get a meaningful
+ *	backtrace.  We need to write the data from usp to
+ *	current->start_stack, so we round each of these in order to be able
+ *	to write an integer number of pages.
+ */
+
+struct user {
+	struct user_regs_struct	regs;		/* entire machine state */
+	size_t		u_tsize;		/* text size (pages) */
+	size_t		u_dsize;		/* data size (pages) */
+	size_t		u_ssize;		/* stack size (pages) */
+	unsigned long	start_code;		/* text starting address */
+	unsigned long	start_data;		/* data starting address */
+	unsigned long	start_stack;		/* stack starting address */
+	long int	signal;			/* signal causing core dump */
+	unsigned long	u_ar0;			/* help gdb find registers */
+	unsigned long	magic;			/* identifies a core file */
+	char		u_comm[32];		/* user command name */
+};
+
+#endif /* __ASM_CRIS_USER_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/syscall.S b/ap/build/uClibc/libc/sysdeps/linux/cris/syscall.S
new file mode 100644
index 0000000..d4b052e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/syscall.S
@@ -0,0 +1,61 @@
+/* Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "sysdep.h"
+
+	.syntax no_register_prefix
+
+/* Make syscall (callno, ...) into a system call.  */
+
+ENTRY (syscall)
+#ifdef __arch_v32
+	subq	4,sp
+	move.d	r10,r9
+	move	srp,[sp]
+	addoq	8,sp,acr
+	move.d	r11,r10
+	move	[acr],mof
+	addoq	12,sp,acr
+	move.d	r12,r11
+	move	[acr],srp
+	addoq	4,sp,acr
+	move.d	r13,r12
+	move.d	[acr],r13
+	break	13
+	cmps.w	-4096,r10
+	bhs	0f
+	move	[sp+],srp
+	Ret
+	nop
+#else
+	push	srp
+	move.d	r10,r9
+	move.d	r11,r10
+	move.d	r12,r11
+	move.d	r13,r12
+	move.d	[sp+4],r13
+	move	[sp+8],mof
+	move	[sp+12],srp
+	break	13
+	cmps.w	-4096,r10
+	bhs	0f
+	pop	srp
+	Ret
+	nop
+#endif
+PSEUDO_END (syscall)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/sysdep.S b/ap/build/uClibc/libc/sysdeps/linux/cris/sysdep.S
new file mode 100644
index 0000000..416751d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/sysdep.S
@@ -0,0 +1,80 @@
+/* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <features.h>
+#include "sysdep.h"
+
+/* The syscall stubs jump here when they detect an error, bot for PIC and
+   non-PIC.  */
+
+	.syntax	no_register_prefix
+
+ENTRY (__syscall_error)
+	neg.d	r10,r10
+
+#ifdef	__UCLIBC_HAS_THREADS__
+	subq	4,sp
+	move.d	r10,[sp]
+	subq	4,sp
+	move 	srp,[sp]
+
+	/* Note that __syscall_error is only visible within this library,
+	   and no-one passes it on as a pointer, so can assume that R0 (GOT
+	   pointer) is correctly set up.  */
+	PLTCALL	(HIDDEN_JUMPTARGET(__errno_location))
+
+	move	[sp+],srp
+	move.d	[sp+],r11
+	move.d	r11,[r10]
+
+#else /* not __UCLIBC_HAS_THREADS__ */
+#ifdef __arch_v32
+# ifdef __PIC__
+	addo.d	C_SYMBOL_NAME(errno:GOT),r0,acr
+	move.d	[acr],r9
+	move.d	r10,[r9]
+# else /* not __PIC__ */
+	lapc	C_SYMBOL_NAME(errno),acr
+	move.d	r10,[r9]
+# endif /* not __PIC__ */
+#else /* not __arch_v32 */
+# ifdef __PIC__
+	move.d	[r0+C_SYMBOL_NAME(errno:GOT)],r9
+	move.d  r10,[r9]
+# else
+	move.d	r10,[C_SYMBOL_NAME(errno)]
+# endif
+#endif /* not __arch_v32 */
+#endif /* __UCLIBC_HAS_THREADS__ */
+
+#ifdef __PIC__
+/* PIC callers are supposed to have R0 on stack, ready for us to restore.
+   Callers are only allowed from within this DSO, so the GOT in r0 is the
+   one we want to use.
+
+   (Don't use "ret" - it's a macro).   */
+
+	moveq	-1,r10
+	Ret
+	move.d	[sp+],r0
+#else
+	Ret
+	moveq	-1,r10
+#endif
+
+END (__syscall_error)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/cris/sysdep.h
new file mode 100644
index 0000000..5960fe2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/sysdep.h
@@ -0,0 +1,151 @@
+/* Assembler macros for CRIS.
+   Copyright (C) 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYSDEP_H_
+#define _SYSDEP_H_
+
+#include <sys/syscall.h>
+
+#ifndef C_LABEL
+
+/* Define a macro we can use to construct the asm name for a C symbol.  */
+#ifdef  __STDC__
+#define C_LABEL(name)           name##:
+#else
+#define C_LABEL(name)           name/**/:
+#endif
+
+#endif /* C_LABEL */
+
+#define __STR(x) #x
+#define STR(x) __STR(x)
+
+/* Mark the end of function named SYM.  This is used on some platforms
+   to generate correct debugging information.  */
+#ifndef END
+#define END(sym)
+#endif
+
+#undef SYS_ify
+#define SYS_ify(syscall_name)   (__NR_##syscall_name)
+
+#ifdef __ASSEMBLER__
+
+#undef SYS_ify
+#define SYS_ify(syscall_name)   __NR_##syscall_name
+
+/* Syntactic details of assembly-code.  */
+
+/* It is *not* generally true that "ELF uses byte-counts for .align, most
+   others use log2 of count of bytes", like some neighboring configs say.
+   See "align" in gas/read.c which is not overridden by
+   gas/config/obj-elf.c.  It takes a log2 argument.  *Some* targets
+   override it to take a byte argument.  People should read source instead
+   of relying on hearsay.  */
+#define ALIGNARG(log2) log2
+
+#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg
+#define ASM_SIZE_DIRECTIVE(name) .size name,.-name
+
+/* The non-PIC jump is preferred, since it does not stall, and does not
+   invoke generation of a PLT.  These macros assume that $r0 is set up as
+   GOT register.  */
+#ifdef __arch_v32
+#ifdef __PIC__
+#define PLTJUMP(_x) \
+  ba C_SYMBOL_NAME (_x):PLT				@ \
+  nop
+
+#define PLTCALL(_x) \
+  bsr C_SYMBOL_NAME (_x):PLT				@ \
+  nop
+
+#define SETUP_PIC \
+  subq 4,$sp						@ \
+  move.d $r0,[$sp]					@ \
+  lapc _GLOBAL_OFFSET_TABLE_,$r0
+
+#define TEARDOWN_PIC move.d [$sp+],$r0
+#else
+#define PLTJUMP(_x) \
+  ba C_SYMBOL_NAME (_x)					@ \
+  nop
+
+#define PLTCALL(_x) \
+  bsr  C_SYMBOL_NAME (_x)				@ \
+  nop
+
+#define SETUP_PIC
+#define TEARDOWN_PIC
+#endif
+
+#else
+
+#ifdef __PIC__
+#define PLTJUMP(_x) \
+  add.d C_SYMBOL_NAME (_x):PLT,$pc
+
+#define PLTCALL(_x) \
+  jsr [$r0+C_SYMBOL_NAME (_x):GOTPLT16]
+
+#define SETUP_PIC \
+  push $r0						@ \
+  move.d $pc,$r0					@ \
+  sub.d .:GOTOFF,$r0
+
+#define TEARDOWN_PIC pop $r0
+#else
+#define PLTJUMP(_x) jump C_SYMBOL_NAME (_x)
+#define PLTCALL(_x) jsr  C_SYMBOL_NAME (_x)
+#define SETUP_PIC
+#define TEARDOWN_PIC
+#endif
+
+#endif /* __arch_v32 */
+
+/* Define an entry point visible from C.  */
+#define ENTRY(name) \
+  .text							@ \
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (name) 		@ \
+  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME (name), function)	@ \
+  .align ALIGNARG (2) 					@ \
+  C_LABEL(name)
+
+#undef END
+#define END(name) \
+  ASM_SIZE_DIRECTIVE (C_SYMBOL_NAME (name))
+
+#define PSEUDO(name, syscall_name, args) \
+  ENTRY (name)						@ \
+  DOARGS_##args						@ \
+  movu.w SYS_ify (syscall_name),$r9			@ \
+  break 13						@ \
+  cmps.w -4096,$r10					@ \
+  bhs   0f						@ \
+  nop							@ \
+  UNDOARGS_return_##args
+
+#define PSEUDO_END(name) \
+0:							@ \
+  SETUP_PIC						@ \
+  PLTJUMP (__syscall_error)				@ \
+  END (name)
+
+#endif /* __ASSEMBLER__ */
+#endif /* _SYSDEP_H_ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/cris/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/cris/vfork.S
new file mode 100644
index 0000000..ea8a81d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/cris/vfork.S
@@ -0,0 +1,30 @@
+/*-
+ * Copyright (c) 2011
+ *	Thorsten Glaser <tg@freewrt.org>
+ *
+ * This file is available either under the terms and conditions of
+ * the MirOS Licence, or the same terms as klibc or uClibc.
+ */
+
+#include "sysdep.h"
+
+	.syntax no_register_prefix
+
+/*
+ * vfork is special, but PSEUDO() would probably work were it not broken;
+ * there must be nothing at all on the stack above the stack frame of the
+ * enclosing function
+ */
+
+ENTRY(__vfork)
+	movu.w	__NR_vfork,$r9
+	break	13
+	cmps.w	-4096,$r10
+	bhs	0f
+	 nop
+	Ret
+	 nop
+PSEUDO_END(__vfork)
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/Makefile b/ap/build/uClibc/libc/sysdeps/linux/e1/Makefile
new file mode 100644
index 0000000..c69ccb9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/Makefile
@@ -0,0 +1,56 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TOPDIR=../../../../
+include $(TOPDIR)Rules.mak
+
+#FIXME -- this arch should include its own crti.S and crtn.S
+UCLIBC_CTOR_DTOR=n
+
+# If you're looking for vfork(), it is defined in include/unistd.h
+
+CRT_SRC := crt0.S
+CRT_OBJ := crt0.o
+CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
+
+# why is crt1.c listed in CSRC ?
+CSRC := crt1.c syscalls.c longjmp.c setjmp.c vfork.c
+OBJS := $(patsubst %.c,%.o, $(CSRC))
+
+OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
+
+all: $(OBJ_LIST) $(CTOR_TARGETS)
+
+$(OBJ_LIST): $(OBJS) $(CRT_OBJ)
+	$(STRIPTOOL) -x -R .note -R .comment $^
+	$(INSTALL) -d $(TOPDIR)lib/
+	cp $(CRT_OBJ) $(TOPDIR)lib/
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
+
+$(CRT_OBJ): %.o : %.S
+	$(CC) $(ASFLAGS) -c $< -o $@
+
+$(OBJS): %.o : %.c
+	$(CC) $(CFLAGS) -c $< -o $@
+
+ifeq ($(UCLIBC_CTOR_DTOR),y)
+$(TOPDIR)lib/crti.o: crti.S
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
+
+$(TOPDIR)lib/crtn.o: crtn.S
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
+else
+$(CTOR_TARGETS):
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(AR) $(ARFLAGS) $@
+endif
+
+headers:
+
+clean:
+	$(RM) *.o *~ core
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/endian.h
new file mode 100644
index 0000000..0d38c1c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/endian.h
@@ -0,0 +1,7 @@
+/* e1 is big-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __BIG_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/fcntl.h
new file mode 100644
index 0000000..a9cb722
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/fcntl.h
@@ -0,0 +1,233 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   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.  */
+
+#ifndef	_FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+
+#include <sys/types.h>
+
+/* 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.	*/
+#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_XOPEN2K
+# 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]FL.  */
+#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
+#endif /* LINUX_SPECIFIC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/fenv.h
new file mode 100644
index 0000000..beeea3d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/fenv.h
@@ -0,0 +1,88 @@
+
+/*  Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
+                                Yannis Mitsos <yannis.mitsos@gdt.gr>
+
+   Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+   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
+
+
+/* Define bits representing the exception.  We use the bit positions of
+   the appropriate bits in the SR.  */
+enum
+  {
+    FE_INEXACT = (1 << 8),
+#define FE_INEXACT	FE_INEXACT
+    FE_UNDERFLOW = (1 << 9),
+#define FE_UNDERFLOW	FE_UNDERFLOW
+    FE_OVERFLOW = (1 << 10),
+#define FE_OVERFLOW	FE_OVERFLOW
+    FE_DIVBYZERO = (1 << 11),
+#define FE_DIVBYZERO	FE_DIVBYZERO
+    FE_INVALID = (1 << 12)
+#define FE_INVALID	FE_INVALID
+  };
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* We support all of the four defined rounding modes.  We use
+   the bit positions in the FPCR Mode Control Byte as the values for the
+   appropriate macros.  */
+enum
+  {
+    FE_TONEAREST = 0,
+#define FE_TONEAREST	FE_TONEAREST
+    FE_TOWARDZERO = 1 << 13 ,
+#define FE_TOWARDZERO	FE_TOWARDZERO
+    FE_DOWNWARD = 2 << 13,
+#define FE_DOWNWARD	FE_DOWNWARD
+    FE_UPWARD = 3 << 13
+#define FE_UPWARD	FE_UPWARD
+  };
+
+
+/* Type representing exception flags.  */
+typedef unsigned int fexcept_t;
+
+
+/* Type representing floating-point environment.*/
+typedef struct
+{
+    unsigned int round_mode;
+    unsigned int trap_enabled;
+    unsigned int accrued_except;
+    unsigned int actual_except;
+} fenv_t;
+
+#if 0
+/* If the default argument is used we use this value.  */
+const fenv FE_DFL_ENV_OBJ = {0, 0x1C00, 0}
+#define FE_DFL_ENV	(&FE_DFL_ENV_OBJ)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exceptions are masked.  */
+const fenv_t FE_NOMASK_ENV_OBJ = { 0, 0x1F00, 0 };
+# define FE_NOMASK_ENV	(&FE_NOMASK_ENV_OBJ)
+#endif
+
+#endif
+
+#include <bits/fenvinline.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/bits/fenvinline.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/fenvinline.h
new file mode 100644
index 0000000..2556247
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/fenvinline.h
@@ -0,0 +1,298 @@
+/*
+   Inline floating-point environment handling functions for Hyperstone e1-32X.
+   Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
+                               Yannis Mitsos <yannis.mitsos@gdt.gr>
+
+   Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+
+   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 __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_MATH_INLINES
+
+/**********************************************************
+ *  --- A small description of the E1-16/32X FP unit. ---
+ * FP exceptions can be enabled and disabled through
+ * <feenableexcept>, <fedisableexcept>.
+ *
+ * - When an enabled exception takes place a SIGFPE signal
+ * is sent to the process by the exception handler. User
+ * can test for the exception that took place through
+ * <fetestexcept>.
+ * feraiseexcept works only for accrued exceptions.
+ *
+ * - When a disabld exception takes place it does not generate
+ * a trap. The user can check if any exception took place after
+ * an FP instruction by issuing an <fetestexcept> command.
+ * User should first clear the G2 register by issuing an
+ * <feclearexcept> function.
+ * The following program is a typical example of how the user
+ * should check for exceptions that did not generate a SIGFPE
+ * signal :
+ * {
+ *   double f;
+ *   int raised;
+ *   feclearexcept (FE_ALL_EXCEPT);
+ *   f = compute ();
+ *   raised = fetestexcept (FE_OVERFLOW | FE_INVALID);
+ *   if (raised & FE_OVERFLOW) {  ...  }
+ *   if (raised & FE_INVALID) {  ...  }
+ *    ...
+ * }
+ ***********************************************************/
+
+/* Get FPU rounding mode  */
+#define fegetround()                     \
+({                                       \
+	unsigned int tmp;                \
+	__asm__ __volatile__("mov %0, SR"        \
+			:"=l"(tmp)       \
+			:/*no input*/);  \
+	tmp &= (3<<13);                  \
+	(tmp);                           \
+})
+
+/* Set FPU rounding mode  */
+#define fesetround(round)                \
+({                                       \
+	unsigned int tmp = (3 << 13);    \
+	while(1) {                       \
+	/* Clear SR.FRM field */         \
+	__asm__ __volatile__("andn SR, %0"       \
+			:/*no output*/   \
+			:"l"(tmp) );     \
+	tmp &= round;                    \
+                                         \
+	if(tmp) {                        \
+		tmp = -1;                \
+		break;                   \
+	}                                \
+                                         \
+	__asm__ __volatile__("or SR, %0"         \
+			:/*no input*/    \
+			:"l"(round) );   \
+	tmp = 0;                         \
+	break;                           \
+	}                                \
+	(tmp);                           \
+})
+
+/* The following functions test for accrued exceptions.
+ * No trap is generated on an FP exception.
+ */
+static __inline__ feclearexcept(int __excepts)
+{
+	unsigned int enabled_excepts, disabled_excepts;
+
+	/* Check that __excepts is correctly set */
+	if( __excepts & (~0x1F00) )
+		return -1;
+
+	__asm__ __volatile__("mov %0, SR"
+		     :"=l"(enabled_excepts)
+		     :/*no input*/ );
+
+	enabled_excepts  &= 0x1F00;
+	disabled_excepts = ~enabled_excepts;
+	disabled_excepts &= 0x1F00;
+
+	enabled_excepts  &= __excepts;
+	disabled_excepts &= __excepts;
+
+	/* Clear accrued exceptions */
+	__asm__ __volatile__("andn G2, %0\n\t"
+		     "andn G2, %1\n\t"
+			:/*no output*/
+			:"l"(enabled_excepts),
+			 "l"(disabled_excepts >> 8) );
+	return 0;
+}
+
+/* fetestexcepts tests both for actual and accrued
+ * excepts. You can test for an exception either after
+ * an FP instruction or within a SIGFPE handler
+ */
+__inline__ int fetestexcept(int __excepts)
+{
+	unsigned int G2, G2en, G2dis;
+	unsigned int enabled_excepts, disabled_excepts;
+
+	/* Check that __excepts is correctly set */
+	if( __excepts & (~0x1F00) )
+		return -1;
+
+	__asm__ __volatile__("mov %0, SR"
+		     :"=l"(enabled_excepts)
+		     :/*no input*/ );
+
+	enabled_excepts &= 0x1F00;
+	disabled_excepts = ~enabled_excepts;
+	disabled_excepts &= 0x1F00;
+
+ 	__asm__ __volatile__("mov %0, G2"
+		    :"=l"(G2)
+		    :/*no input*/ );
+
+	G2en  = G2 & 0x1F00;
+	G2dis = G2 & 0x1F;
+	G2en  &= enabled_excepts;
+	G2dis &= (disabled_excepts >> 8);
+	return ( G2en | (G2dis << 8) );
+}
+
+static __inline__ int feraiseexcept(int __excepts)
+{
+	__asm__ __volatile__("or G2, %0"
+			:/*no output*/
+			:"l"( __excepts >> 8  ) );
+	return 0;
+}
+
+/* The following functions enable/disable individual exceptions.
+ * If enabling an exception trap is going to occur, in case of error.
+ */
+#define feenableexcept(__excepts)          \
+({                                         \
+	int __retval, __pexcepts;          \
+	int __tmpexcepts = __excepts;      \
+                                           \
+	while(1) {                         \
+	    __asm__ __volatile__("mov %0, SR"      \
+		     :"=l"(__pexcepts)     \
+		     :/*no input*/ );      \
+	    __pexcepts &= 0x1F00;          \
+	                                   \
+/* Check if __except values are valid */   \
+	    if( __tmpexcepts & ~0x1F00 ) { \
+	        __retval = -1;             \
+		fprintf(stderr,"Non valid excepts\n");\
+	        break;                     \
+	    }                              \
+	                                   \
+	    __asm__ __volatile__("or SR, %0"       \
+			:/*no output*/     \
+			:"l"(__tmpexcepts) ); \
+	    __retval = __pexcepts;         \
+	    break;                         \
+	}                                  \
+	(__retval);                        \
+})
+
+
+#define fedisableexcept(__excepts)         \
+({                                         \
+	int __retval, __pexcepts;          \
+	int __tmpexcepts = __excepts;      \
+	                                   \
+	while(1) {                         \
+	    __asm__ __volatile__("mov %0, SR"      \
+		     :"=l"(__pexcepts)     \
+		     :/*no input*/ );      \
+	    __pexcepts &= 0x1F00;          \
+	                                   \
+/* Check if __except values are valid */   \
+	    if( __tmpexcepts & ~0x1F00 ) { \
+	        __retval = -1;             \
+		fprintf(stderr,"Non valid excepts\n");\
+	        break;                     \
+	    }                              \
+	                                   \
+	    __asm__ __volatile__("andn SR, %0"     \
+			:/*no output*/     \
+			:"l"(__tmpexcepts) ); \
+	    __retval = __pexcepts;         \
+	    break;                         \
+	}                                  \
+	(__retval);                        \
+})
+
+static __inline__ int fegetexcept(int excepts)
+{
+	unsigned int tmp;
+	__asm__ __volatile__("mov %0, SR"
+		    :"=l"(tmp)
+		    :/*no input*/ );
+	tmp &= 0x1F00;
+	return tmp;
+}
+
+static __inline__ int fegetenv(fenv_t *envp)
+{
+	__asm__ __volatile__("mov %0, SR\n\t
+		      mov %1, SR\n\t
+		      mov %2, G2\n\t
+		      mov %3, G2\n\t"
+		     :"=l"(envp->round_mode),
+		      "=l"(envp->trap_enabled),
+		      "=l"(envp->accrued_except),
+		      "=l"(envp->actual_except)
+		     :/*no input*/ );
+	envp->round_mode &= (3<<13);
+	envp->trap_enabled &= 0x1F00;
+	envp->accrued_except &= 0x1F;
+	envp->accrued_except <<= 8;
+	envp->actual_except &= 0x1F00;
+}
+
+#define feholdexcept(envp)        \
+(                                         \
+	fegetenv(envp);                   \
+	fedisableexcept(FE_ALL_EXCEPT);   \
+	feclearexcept(FE_ALL_EXCEPT);     \
+	(0);                              \
+)
+
+#define fesetenv(envp)                \
+({                                                  \
+	/* Clear FRM & FTE field of SR */           \
+	unsigned long clearSR = ( 127<<8 );         \
+	__asm__ __volatile__("andn SR, %0\n\t"              \
+		     "or   SR, %1\n\t"              \
+		     "or   SR, %2\n\t"              \
+		     :/*no output*/                 \
+		     :"l"(clearSR),                 \
+		      "l"(envp->round_mode),        \
+		      "l"(envp->trap_enabled) );    \
+	__asm__ __volatile__("andn G2, 0x1F1F\n\t"          \
+		     "or   G2, %0\n\t"              \
+		     "or   G2, %1\n\t"              \
+		     :/*no output*/                 \
+		     :"l"( envp->accrued_except >> 8),\
+		     :"l"( envp->actual_except ) ); \
+	(0); /* return 0 */                         \
+})
+
+#define feupdateenv(envp)                           \
+({                                                  \
+	/* Clear FRM & FTE field of SR */           \
+	__asm__ __volatile__(/* We dont clear the prev SR*/ \
+		     "or   SR, %1\n\t"              \
+		     "or   SR, %2\n\t"              \
+		     :/*no output*/                 \
+		     :"l"(clearSR),                 \
+		      "l"(envp->round_mode),        \
+		      "l"(envp->accrued_except) );  \
+	__asm__ __volatile__(/* We dont clear the prev SR*/ \
+		     "or   G2, %0\n\t"              \
+		     "or   G2, %1\n\t"              \
+		     :/*no output*/                 \
+		     :"l"( envp->accrued_except >> 8),\
+		     :"l"( envp->actual_except ) ); \
+	(0); /* return 0 */                         \
+})
+
+
+#endif /* __GNUC__ && !_SOFT_FLOAT */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/kernel_stat.h
new file mode 100644
index 0000000..99a6cba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/kernel_stat.h
@@ -0,0 +1,50 @@
+#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 {
+	unsigned short st_dev;
+	unsigned short __pad1;
+	unsigned long st_ino;
+	unsigned short st_mode;
+	unsigned short st_nlink;
+	unsigned short st_uid;
+	unsigned short st_gid;
+	unsigned short st_rdev;
+	unsigned short __pad2;
+	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 short	st_dev;
+	unsigned char	__pad0[10];
+#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 short	st_rdev;
+	unsigned char	__pad3[10];
+	long long	st_size;
+	unsigned long	st_blksize;
+	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
+	unsigned long	__pad4;		/* future possible st_blocks high bits */
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned long long	st_ino;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/kernel_types.h
new file mode 100644
index 0000000..f55a129
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/kernel_types.h
@@ -0,0 +1,48 @@
+/* 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_E1_POSIX_TYPES_H
+#define __ARCH_E1_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 __kernel_dev_t	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+typedef long long	__kernel_loff_t;
+
+/*
+typedef struct {
+#ifdef __USE_ALL
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+*/
+
+#endif /* __ARCH_E1_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/bits/proto.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/proto.h
new file mode 100644
index 0000000..7aa38ff
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/proto.h
@@ -0,0 +1,5 @@
+#ifndef _E1_PROTO_H_
+#define _E1_PROTO_H_
+int kprintf( char *msg, int len);
+#define KPRINTF(msg)  kprintf(msg, strlen(msg)+1)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/setjmp.h
new file mode 100644
index 0000000..88fa76f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/setjmp.h
@@ -0,0 +1,22 @@
+/* This file is lisenced under LGPL.
+ * Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
+ *                             Yannis Mitsos <yannis.mitsos@gdt.gr>
+ */
+
+#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
+
+typedef struct {
+	unsigned long G3;
+	unsigned long G4;
+	unsigned long SavedSP;
+	unsigned long SavedPC;
+	unsigned long SavedSR;
+	unsigned long ReturnValue;
+} __jmp_buf[1];
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/syscalls.h
new file mode 100644
index 0000000..8852a0f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/syscalls.h
@@ -0,0 +1,17 @@
+/* This file is licensed under LGPL.
+ * Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
+ *                             Yannis Mitsos <yannis.mitsos@gdt.gr>
+ */
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#include <features.h>
+
+/* Include the library _syscallx macros */
+#include <bits/unistd.h>
+
+#endif /* _BITS_SYSCALLS_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..2a9422e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/uClibc_arch_features.h
@@ -0,0 +1,48 @@
+/*
+ * 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__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/e1/bits/unistd.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/unistd.h
new file mode 100644
index 0000000..f492b8b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/unistd.h
@@ -0,0 +1,464 @@
+ /* This file is lisenced under LGPL.
+  * Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
+  *                             Yannis Mitsos <yannis.mitsos@gdt.gr>
+  */
+#ifndef _BITS_UNISTD_H_
+#define _BITS_UNISTD_H_
+
+#include <bits/proto.h>
+#include <errno.h>
+
+#define __E1_COFF_GCC__
+
+/* The following macros have been provided by C.Baumhof
+ * They can be inlined in contrast to the previous ones*/
+#define _syscall0(type, name)  \
+type name(void)              \
+{                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+    par1 = -1;              \
+	par2 = __NR_##name;         \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1), "l"(par2)  \
+		:"memory","L14","L15");   \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define _syscall1(type, name,atype, a)  \
+type name(atype a)              \
+{                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+    par1 = -1;              \
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1), "l"(par2), "l"(par3)  \
+		:"memory","L13","L14","L15");   \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define _syscall2(type, name,atype, a, btype, b)  \
+type name(atype a, btype b)              \
+{                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+	register int par4 __asm__("L12");   \
+    par1 = -1;              \
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	par4 = (int)b;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1), "l"(par2), "l"(par3), "l"(par4) \
+		:"memory","L12","L13","L14","L15");   \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define _syscall3(type, name,atype, a, btype, b, ctype, c)  \
+type name(atype a, btype b, ctype c)                      \
+{                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+	register int par4 __asm__("L12");   \
+	register int par5 __asm__("L11");   \
+    par1 = -1;              \
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	par4 = (int)b;              \
+	par5 = (int)c;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1), "l"(par2), "l"(par3), "l"(par4), "l"(par5) \
+		:"memory","L11","L12","L13","L14","L15");    \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define _syscall4(type, name,atype, a, btype, b, ctype, c, dtype, d)  \
+type name(atype a, btype b, ctype c,dtype d)                      \
+{                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+	register int par4 __asm__("L12");   \
+	register int par5 __asm__("L11");   \
+	register int par6 __asm__("L10");   \
+    par1 = -1;              \
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	par4 = (int)b;              \
+	par5 = (int)c;              \
+	par6 = (int)d;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1),"l"(par2),"l"(par3),"l"(par4),"l"(par5),"l"(par6) \
+		:"memory","L10","L11","L12","L13","L14","L15");    \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define _syscall5(type, name,atype, a, btype, b, ctype, c, dtype, d, etype, e)  \
+type name(atype a, btype b, ctype c,dtype d, etype e)                      \
+{                                                       \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+	register int par4 __asm__("L12");   \
+	register int par5 __asm__("L11");   \
+	register int par6 __asm__("L10");   \
+	register int par7 __asm__("L9");   \
+    par1 = -1;              	\
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	par4 = (int)b;              \
+	par5 = (int)c;              \
+	par6 = (int)d;              \
+	par7 = (int)e;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1),"l"(par2),"l"(par3),"l"(par4),"l"(par5),"l"(par6),"l"(par7) \
+		:"memory","L9","L10","L11","L12","L13","L14","L15");    \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+	return (type)(par1);                    \
+}
+
+#define _syscall6(type, name,atype, a, btype, b, ctype, c, dtype, d, etype, e, ftype, f)  \
+type name(atype a, btype b, ctype c,dtype d, etype e, ftype f)                      \
+{                                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+	register int par4 __asm__("L12");   \
+	register int par5 __asm__("L11");   \
+	register int par6 __asm__("L10");   \
+	register int par7 __asm__("L9");   \
+	register int par8 __asm__("L8");   \
+	int sys_retval;				\
+    par1 = -1;              	\
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	par4 = (int)b;              \
+	par5 = (int)c;              \
+	par6 = (int)d;              \
+	par7 = (int)e;              \
+	par7 = (int)f;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1),"l"(par2),"l"(par3),"l"(par4),"l"(par5),"l"(par6),"l"(par7),"l"(par8) \
+		:"memory","L8","L9","L10","L11","L12","L13","L14","L15");	\
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define __syscall0(type, name)  \
+type name(...)                      \
+{                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	par1 = -1;              \
+	par2 = __NR_##name;         \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1), "l"(par2)\
+		:"memory","L14","L15");    \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define __syscall1(type, name, atype, a)  \
+type name(atype a, ...)                      \
+{                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+	par1 = -1;              \
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1), "l"(par2), "l"(par3)\
+		:"memory","L13","L14","L15");    \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define __syscall2(type, name,atype, a, btype, b)  \
+type name(atype a, btype b, ...)                      \
+{                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+	register int par4 __asm__("L12");   \
+	par1 = -1;              \
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	par4 = (int)b;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1), "l"(par2), "l"(par3), "l"(par4)\
+		:"memory","L12","L13","L14","L15");    \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define __syscall3(type, name,atype, a, btype, b, ctype, c)  \
+type name(atype a, btype b, ctype c, ...)                      \
+{                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+	register int par4 __asm__("L12");   \
+	register int par5 __asm__("L11");   \
+	par1 = -1;              \
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	par4 = (int)b;              \
+	par5 = (int)c;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1), "l"(par2), "l"(par3), "l"(par4), "l"(par5) \
+		:"memory","L11","L12","L13","L14","L15");    \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define __syscall4(type, name,atype, a, btype, b, ctype, c, dtype, d)  \
+type name(atype a, btype b, ctype c,dtype d, ...)                      \
+{                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+	register int par4 __asm__("L12");   \
+	register int par5 __asm__("L11");   \
+	register int par6 __asm__("L10");   \
+	par1 = -1;              \
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	par4 = (int)b;              \
+	par5 = (int)c;              \
+	par6 = (int)d;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1),"l"(par2),"l"(par3),"l"(par4),"l"(par5),"l"(par6) \
+		:"memory","L10","L11","L12","L13","L14","L15");    \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define __syscall5(type, name,atype, a, btype, b, ctype, c, dtype, d, etype, e)  \
+type name(atype a, btype b, ctype c,dtype d, etype e, ...)                      \
+{                                                       \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+	register int par4 __asm__("L12");   \
+	register int par5 __asm__("L11");   \
+	register int par6 __asm__("L10");   \
+	register int par7 __asm__("L9");   \
+	par1 = -1;                  \
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	par4 = (int)b;              \
+	par5 = (int)c;              \
+	par6 = (int)d;              \
+	par7 = (int)e;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1),"l"(par2),"l"(par3),"l"(par4),"l"(par5),"l"(par6),"l"(par7) \
+		:"memory","L9","L10","L11","L12","L13","L14","L15");    \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#define __syscall6(type, name,atype, a, btype, b, ctype, c, dtype, d, etype, e, ftype, f)  \
+type name(atype a, btype b, ctype c,dtype d, etype e, ftype f, ...)                      \
+{                                                               \
+	register int par1 __asm__("L15");   \
+	register int par2 __asm__("L14");   \
+	register int par3 __asm__("L13");   \
+	register int par4 __asm__("L12");   \
+	register int par5 __asm__("L11");   \
+	register int par6 __asm__("L10");   \
+	register int par7 __asm__("L9");   \
+	register int par8 __asm__("L8");   \
+	par1 = -1;                  \
+	par2 = __NR_##name;         \
+	par3 = (int)a;              \
+	par4 = (int)b;              \
+	par5 = (int)c;              \
+	par6 = (int)d;              \
+	par7 = (int)e;              \
+	par7 = (int)f;              \
+	__asm__ __volatile__(                   \
+		"trap    47"                        \
+		:"=l"(par1)                             \
+		:"0"(par1),"l"(par2),"l"(par3),"l"(par4),"l"(par5),"l"(par6),"l"(par7),"l"(par8) \
+		:"memory","L8","L9","L10","L11","L12","L13","L14","L15");    \
+																	\
+	if( par1 < 0 ) {													\
+			__set_errno( -par1 );										\
+			return -1;											\
+	} else															\
+		return (type)(par1);                    					\
+}
+
+#include <sys/types.h>
+/* Taken from <bits/errno.h> */
+#ifndef _LIBC
+/* We don't support pthreads for the moment*/
+#define __set_errno(val) ((errno) = (val))
+#endif
+
+#if 0
+#define _syscall3(type, name,atype, a , btype, b, ctype, c)  \
+type name(atype a, btype b, ctype c,)                      \
+{                                               \
+		__asm__ __volatile__(					\
+			"movi  L9, -1\n\t"                  \
+			"movi  L8, %0\n\t"					\
+			"ldw.d G3, L7, 0\n\t"				\
+			"ldw.d G3, L6, 4\n\t"				\
+			"ldw.d G3, L5, 8\n\t"				\
+		:/* no output */						\
+		:"i"(__NR_##name)						\
+		:"cc","memory","%L5","L6","L7","L8","L9");\
+        __asm__ __volatile__(                   \
+			"trap    47\n\t"                    \
+			"mov L2, L9\n\t");                  \
+}
+
+#define _syscall4(type, name,atype, a, btype, b, ctype, c, dtype, d)  \
+type name(atype a, btype b, ctype c,dtype d)                      \
+{                                               \
+		__asm__ __volatile__(					\
+			"movi  L11, -1\n\t"                  \
+			"movi  L10, %0\n\t"					\
+			"ldw.d G3, L9, 0\n\t"				\
+			"ldw.d G3, L8, 4\n\t"				\
+			"ldw.d G3, L7, 8\n\t"				\
+			"ldw.d G3, L6, 12\n\t"				\
+		:/* no output */						\
+		:"i"(__NR_##name)						\
+		:"cc","memory","L6","L7","L8","L9","L10","L11");\
+        __asm__ __volatile__(                   \
+			"trap    47\n\t"                    \
+			"mov L2, L11\n\t");                  \
+}
+
+#define _syscall5(type, name,atype, a, btype, b, ctype, c, dtype, d, etype, e)  \
+type name(atype a, btype b, ctype c,dtype d, etype e)                      \
+{                                                       \
+		__asm__ __volatile__(					\
+			"movi  L13, -1\n\t"                  \
+			"movi  L12, %0\n\t"					\
+			"ldw.d G3, L11, 0\n\t"				\
+			"ldw.d G3, L10, 4\n\t"				\
+			"ldw.d G3, L9, 8\n\t"				\
+			"ldw.d G3, L8, 12\n\t"				\
+			"ldw.d G3, L7, 16\n\t"				\
+		:/* no output */						\
+		:"i"(__NR_##name)						\
+		:"cc","memory","L7","L8","L9","L10","L11","L12","L13");\
+        __asm__ __volatile__(                   \
+			"trap    47\n\t"                    \
+			"mov L2, L13\n\t");                  \
+}
+
+#define _syscall6(type, name,atype, a, btype, b, ctype, c, dtype, d, etype, e, ftype, f)  \
+type name(atype a, btype b, ctype c,dtype d, etype e, ftype f)                      \
+{                                                               \
+		__asm__ __volatile__(					\
+			"movi  L15, -1\n\t"                  \
+			"movi  L14, %0\n\t"					\
+			"ldw.d G3, L13, 0\n\t"				\
+			"ldw.d G3, L12, 4\n\t"				\
+			"ldw.d G3, L11, 8\n\t"				\
+			"ldw.d G3, L10, 12\n\t"				\
+			"ldw.d G3, L9, 16\n\t"				\
+			"ldw.d G3, L8, 20\n\t"				\
+		:/* no output */						\
+		:"i"(__NR_##name)						\
+		:"cc","memory","L8","L9","L10","L11","L12","L13","L14","L15");\
+        __asm__ __volatile__(                   \
+			"trap    47\n\t"                    \
+			"mov L2, L15\n\t");                  \
+}
+#endif
+
+#endif /* !_HYPERSTONE_NOMMU_UNISTD_H_ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/wordsize.h
new file mode 100644
index 0000000..a56d3ef
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/bits/wordsize.h
@@ -0,0 +1,22 @@
+/* Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
+                               Yannis Mitsos <yannis.mitsos@gdt.gr>
+
+   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/e1/crt0.S b/ap/build/uClibc/libc/sysdeps/linux/e1/crt0.S
new file mode 100644
index 0000000..9d5e98d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/crt0.S
@@ -0,0 +1,17 @@
+/*  This file is lisenced under LGPL
+ *  Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
+ *                              Yannis Mitsos <yannis.mitsos@gdt.gr>
+ */
+
+.global __start
+__start:
+	call L1, 0, __uClibc_start
+
+/* 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/e1/crt1.c b/ap/build/uClibc/libc/sysdeps/linux/e1/crt1.c
new file mode 100644
index 0000000..dd8ed6a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/crt1.c
@@ -0,0 +1,48 @@
+/* vi: set sw=4 ts=4: */
+/* uClibc/sysdeps/linux/m68k/crt0.S
+ * Pull stuff off the stack and get uClibc moving.
+ *
+ * Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
+ *                             Yannis Mitsos <yannis.mitsos@gdt.gr>
+ *
+ * Copyright (C) 2000,2001 by Erik Andersen <andersen@uclibc.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* Stick in a dummy reference to main(), so that if an application
+ * is linking when the main() function is in a static library (.a)
+ * we can be sure that main() actually gets linked in */
+extern void main(int argc,void *argv,void *envp);
+/* void (*mainp)(int argc,void *argv,void *envp) = main; */
+
+void __uClibc_main(int argc,void *argv,void *envp);
+
+void _uClibc_start(unsigned int first_arg)
+{
+	unsigned int argc;
+	char **argv, **envp;
+	unsigned long *stack;
+
+	stack = (unsigned long*) first_arg;
+	argc = *(stack);
+	argv = (char **)(stack + 1);
+	envp = (char **)(stack + 1 + argc + 1);
+
+	__uClibc_main(argc, argv, envp);
+}
+
+void __main() { }
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/longjmp.c b/ap/build/uClibc/libc/sysdeps/linux/e1/longjmp.c
new file mode 100644
index 0000000..3d188c4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/longjmp.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
+ *                             Yannis Mitsos <yannis.mitsos@gdt.gr>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <syscall.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <signal.h>
+
+#define __NR_e1newSP  224
+static __inline__ _syscall1(int, e1newSP, unsigned long, SavedSP )
+
+unsigned long jmpbuf_ptr;
+
+void longjmp(jmp_buf state, int value )
+{
+	if(!value)
+		state->__jmpbuf->ReturnValue = 1;
+	else
+		state->__jmpbuf->ReturnValue = value;
+
+	jmpbuf_ptr = (unsigned long)state;
+	e1newSP(state->__jmpbuf->SavedSP);
+
+#define _state_ ((struct __jmp_buf_tag*)jmpbuf_ptr)
+	__asm__ __volatile__("mov L0, %0\n\t"
+		     "mov L1, %1\n\t"
+		     "mov L2, %2\n\t"
+		     "mov G3, %3\n\t"
+		     "mov G4, %4\n\t"
+		     "ret PC, L1\n\t"
+		     :/*no output*/
+		     :"l"(_state_->__jmpbuf->ReturnValue),
+		      "l"(_state_->__jmpbuf->SavedPC),
+		      "l"(_state_->__jmpbuf->SavedSR),
+		      "l"(_state_->__jmpbuf->G3),
+		      "l"(_state_->__jmpbuf->G4)
+		     :"%G3", "%G4", "%L0", "%L1" );
+#undef _state_
+}
+
+
+void siglongjmp(sigjmp_buf state, int value )
+{
+	if( state->__mask_was_saved )
+		sigprocmask(SIG_SETMASK, &state->__saved_mask, NULL);
+
+	if(!value)
+		state->__jmpbuf->ReturnValue = 1;
+	else
+		state->__jmpbuf->ReturnValue = value;
+
+	jmpbuf_ptr = (unsigned long)state;
+	e1newSP(state->__jmpbuf->SavedSP);
+
+
+#define _state_ ((struct __jmp_buf_tag*)jmpbuf_ptr)
+	__asm__ __volatile__("mov L0, %0\n\t"
+		     "mov L1, %1\n\t"
+		     "mov L2, %2\n\t"
+		     "mov G3, %3\n\t"
+		     "mov G4, %4\n\t"
+		     "ret PC, L1\n\t"
+		     :/*no output*/
+		     :"l"(_state_->__jmpbuf->ReturnValue),
+		      "l"(_state_->__jmpbuf->SavedPC),
+		      "l"(_state_->__jmpbuf->SavedSR),
+		      "l"(_state_->__jmpbuf->G3),
+		      "l"(_state_->__jmpbuf->G4)
+		     :"%G3", "%G4", "%L0", "%L1" );
+#undef _state_
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/setjmp.c b/ap/build/uClibc/libc/sysdeps/linux/e1/setjmp.c
new file mode 100644
index 0000000..e8a758c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/setjmp.c
@@ -0,0 +1,55 @@
+/*  This file is lisenced under LGPL
+ *  Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
+ *                              Yannis Mitsos <yannis.mitsos@gdt.gr>
+ */
+
+#include <setjmp.h>
+#include <stdio.h>
+#include <signal.h>
+
+
+int setjmp( jmp_buf state)
+{
+	__asm__ __volatile__(	"mov %0, G3\n\t"
+			"mov %1, G4\n\t"
+			:"=l"(state->__jmpbuf->G3),
+			 "=l"(state->__jmpbuf->G4)
+			:/*no input*/
+			:"%G3", "%G4" );
+
+	__asm__ __volatile__(   "setadr  %0\n\t"
+			"mov %1, L1\n\t"
+			"mov %2, L2\n\t"
+			:"=l"(state->__jmpbuf->SavedSP),
+			 "=l"(state->__jmpbuf->SavedPC),
+			 "=l"(state->__jmpbuf->SavedSR)
+			:/*no input*/);
+	return 0;
+}
+
+int sigsetjmp( sigjmp_buf state , int savesigs)
+{
+
+	if(savesigs) {
+		state->__mask_was_saved = 1;
+		/* how arg in <sigprocmask> is not significant */
+		sigprocmask(SIG_SETMASK, NULL, &state->__saved_mask);
+	} else
+		state->__mask_was_saved = 0;
+
+	__asm__ __volatile__(	"mov %0, G3\n\t"
+			"mov %1, G4\n\t"
+			:"=l"(state->__jmpbuf->G3),
+			 "=l"(state->__jmpbuf->G4)
+			:/*no input*/
+			:"%G3", "%G4" );
+
+	__asm__ __volatile__(   "setadr  %0\n\t"
+			"mov %1, L2\n\t"
+			"mov %2, L3\n\t"
+			:"=l"(state->__jmpbuf->SavedSP),
+			 "=l"(state->__jmpbuf->SavedPC),
+			 "=l"(state->__jmpbuf->SavedSR)
+			:/*no input*/);
+	return 0;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/e1/sys/procfs.h
new file mode 100644
index 0000000..8416b3b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/sys/procfs.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 1996, 1997, 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_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.  */
+
+#endif	/* sys/procfs.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/sys/reg.h b/ap/build/uClibc/libc/sysdeps/linux/e1/sys/reg.h
new file mode 100644
index 0000000..a8a7ec1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/sys/reg.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 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.  */
+
+#ifndef _SYS_REG_H
+#define _SYS_REG_H	1
+
+/* Index into an array of 4 byte integers returned from ptrace for
+   location of the users' stored general purpose registers. */
+
+#endif	/* _SYS_REG_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/e1/sys/ucontext.h
new file mode 100644
index 0000000..3c441dc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/sys/ucontext.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 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.  */
+
+/* System V/m68k ABI compliant context switching support.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* Type for general register.  */
+typedef int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	18
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+/* Number of each register is the `gregset_t' array.  */
+enum
+{
+  R_D0 = 0,
+#define R_D0	R_D0
+  R_D1 = 1,
+#define R_D1	R_D1
+  R_D2 = 2,
+#define R_D2	R_D2
+  R_D3 = 3,
+#define R_D3	R_D3
+  R_D4 = 4,
+#define R_D4	R_D4
+  R_D5 = 5,
+#define R_D5	R_D5
+  R_D6 = 6,
+#define R_D6	R_D6
+  R_D7 = 7,
+#define R_D7	R_D7
+  R_A0 = 8,
+#define R_A0	R_A0
+  R_A1 = 9,
+#define R_A1	R_A1
+  R_A2 = 10,
+#define R_A2	R_A2
+  R_A3 = 11,
+#define R_A3	R_A3
+  R_A4 = 12,
+#define R_A4	R_A4
+  R_A5 = 13,
+#define R_A5	R_A5
+  R_A6 = 14,
+#define R_A6	R_A6
+  R_A7 = 15,
+#define R_A7	R_A7
+  R_SP = 15,
+#define R_SP	R_SP
+  R_PC = 16,
+#define R_PC	R_PC
+  R_PS = 17
+#define R_PS	R_PS
+};
+
+/* Structure to describe FPU registers.  */
+typedef struct fpregset
+{
+  int f_fpregs[8][3];
+  int f_pcr;
+  int f_psr;
+  int f_fpiaddr;
+} fpregset_t;
+
+/* Context to describe whole processor state.  */
+typedef struct
+{
+  int version;
+  gregset_t gregs;
+  fpregset_t fpregs;
+} mcontext_t;
+
+#define MCONTEXT_VERSION 2
+
+/* Userlevel context.  */
+typedef struct ucontext
+{
+  unsigned long int uc_flags;
+  struct ucontext *uc_link;
+  __sigset_t uc_sigmask;
+  stack_t uc_stack;
+  mcontext_t uc_mcontext;
+  long int uc_filler[174];
+} ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/syscalls.c b/ap/build/uClibc/libc/sysdeps/linux/e1/syscalls.c
new file mode 100644
index 0000000..e58ad5f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/syscalls.c
@@ -0,0 +1,11 @@
+/*  This file is lisenced under LGPL
+ *  Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
+ *                              Yannis Mitsos <yannis.mitsos@gdt.gr>
+ */
+
+#include <syscall.h>
+
+/* We now need a declaration of the `errno' variable.  */
+extern int errno;
+#   define __set_errno(val) ((errno) = (val))
+_syscall2( int, kprintf, char *, msg, int, len)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/e1/vfork.c b/ap/build/uClibc/libc/sysdeps/linux/e1/vfork.c
new file mode 100644
index 0000000..c7caafd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/e1/vfork.c
@@ -0,0 +1,14 @@
+/*
+ * 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/types.h>
+#include <sys/syscall.h>
+#include <errno.h>
+
+#define __NR___vfork __NR_vfork
+attribute_hidden _syscall0(pid_t, __vfork)
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/Makefile b/ap/build/uClibc/libc/sysdeps/linux/frv/Makefile
new file mode 100644
index 0000000..554fdb0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/Makefile
@@ -0,0 +1,58 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+# ported to FR-V by Alexandre Oliva <aoliva@redhat.com>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TOPDIR=../../../../
+include $(TOPDIR)Rules.mak
+
+CRT_SRC := crt0.S
+CRT_OBJ := crt0.o crt1.o
+SCRT_OBJ := $(patsubst %,S%, $(CRT_OBJ))
+
+CTOR_TARGETS := crti.o crtn.o
+
+SSRC := __longjmp.S setjmp.S clone.S vfork.S
+SOBJ := $(patsubst %.S,%.o, $(SSRC))
+
+CSRC = mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c
+CSRC += xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.c
+COBJ := $(patsubst %.c,%.o, $(CSRC))
+
+OBJS := $(SOBJ) $(COBJ)
+
+OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
+
+all: $(OBJ_LIST)
+
+$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS)
+	$(STRIPTOOL) -x -R .note -R .comment $^
+	$(INSTALL) -d $(TOPDIR)lib/
+	cp $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
+
+$(CRT_OBJ): $(CRT_SRC) crtreloc.o
+	$(CC) $(ASFLAGS) -DL_$* -r -nostdlib $^ -o $*.o
+
+crtreloc.o: crtreloc.c
+	$(CC) $(CFLAGS) -c $< -o $@
+
+$(SCRT_OBJ): $(CRT_SRC) Scrtreloc.o
+	$(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* -r -nostdlib $^ -o $*.o
+
+Scrtreloc.o: crtreloc.c
+	$(CC) $(CFLAGS) $(PIEFLAG) -c $< -o $@
+
+$(CTOR_TARGETS): %.o : %.S
+	$(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
+
+$(SOBJ): %.o : %.S
+	$(CC) $(ASFLAGS) -c $< -o $@
+
+$(COBJ): %.o : %.c
+	$(CC) $(CFLAGS) -c $< -o $@
+
+clean:
+	$(RM) *.o *~ core
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/__init_brk.c b/ap/build/uClibc/libc/sysdeps/linux/frv/__init_brk.c
new file mode 100644
index 0000000..7e4c8d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/__init_brk.c
@@ -0,0 +1,26 @@
+/* From libc-5.3.12 */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+void * __curbrk attribute_hidden = 0;
+
+#define __NR__brk __NR_brk
+attribute_hidden _syscall1(void *, _brk, void *, ptr)
+
+extern int __init_brk(void) attribute_hidden;
+int
+__init_brk (void)
+{
+    if (__curbrk == 0)
+    {
+		__curbrk = _brk(0);
+		if (__curbrk == 0)
+		{
+		  __set_errno(ENOMEM);
+		  return -1;
+		}
+    }
+    return 0;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/frv/__longjmp.S
new file mode 100644
index 0000000..c3145c8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/__longjmp.S
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+# setjmp/longjmp for Frv.  The jmpbuf looks like this:
+#	
+# Register	jmpbuf offset
+# R16-R31	0x0-0x03c
+# R48-R63	0x40-0x7c
+# FR16-FR31     0x80-0xbc
+# FR48-FR63     0xc0-0xfc
+# LR            0x100
+# SP            0x104
+# FP            0x108
+#
+# R8 contains the pointer to jmpbuf
+
+	.text
+	.global	__longjmp
+	.type	__longjmp,@function
+__longjmp:
+	lddi	@(gr8,0), gr16
+	lddi	@(gr8,8), gr18
+	lddi 	@(gr8,16), gr20
+	lddi	@(gr8,24), gr22
+	lddi	@(gr8,32), gr24
+	lddi	@(gr8,40), gr26
+	lddi	@(gr8,48), gr28
+	lddi	@(gr8,56), gr30
+#if __FRV_GPR__ != 32
+	lddi	@(gr8,64), gr48
+	lddi	@(gr8,72), gr50
+	lddi	@(gr8,80), gr52
+	lddi	@(gr8,88), gr54
+	lddi	@(gr8,96), gr56
+	lddi	@(gr8,104), gr58
+	lddi	@(gr8,112), gr60
+	lddi	@(gr8,120), gr62
+#endif
+
+#if __FRV_FPR__ != 0
+	lddfi	@(gr8,128), fr16
+	lddfi	@(gr8,136), fr18
+	lddfi 	@(gr8,144), fr20
+	lddfi	@(gr8,152), fr22
+	lddfi	@(gr8,160), fr24
+	lddfi	@(gr8,168), fr26
+	lddfi	@(gr8,176), fr28
+	lddfi	@(gr8,184), fr30
+#if __FRV_FPR__ != 32
+	lddfi	@(gr8,192), fr48
+	lddfi	@(gr8,200), fr50
+	lddfi	@(gr8,208), fr52
+	lddfi	@(gr8,216), fr54
+	lddfi	@(gr8,224), fr56
+	lddfi	@(gr8,232), fr58
+	lddfi	@(gr8,240), fr60
+	lddfi	@(gr8,248), fr62
+#endif
+#endif
+
+        ldi     @(gr8,256), gr4
+	movgs   gr4,lr
+
+        ldi     @(gr8,260), sp
+        ldi     @(gr8,264), fp
+	
+# Value to return is in r9.  If zero, return 1
+	cmp	gr9, gr0, icc0
+	setlos	#1, gr8
+	ckne	icc0, cc4
+	cmov	gr9, gr8, cc4, 1
+	ret
+.Lend2:
+	.size	__longjmp,.Lend2-__longjmp
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/bits/elf-fdpic.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/elf-fdpic.h
new file mode 100644
index 0000000..b7e87b8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/elf-fdpic.h
@@ -0,0 +1,115 @@
+/* Copyright 2003, 2004 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+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.)
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#ifndef _BITS_ELF_FDPIC_H
+#define _BITS_ELF_FDPIC_H
+
+/* These data structures are described in the FDPIC ABI extension.
+   The kernel passes a process a memory map, such that for every LOAD
+   segment there is an elf32_fdpic_loadseg entry.  A pointer to an
+   elf32_fdpic_loadmap is passed in GR8 at start-up, and a pointer to
+   an additional such map is passed in GR9 for the interpreter, when
+   there is one.  */
+
+#include <elf.h>
+
+/* This data structure represents a PT_LOAD segment.  */
+struct elf32_fdpic_loadseg
+{
+  /* Core address to which the segment is mapped.  */
+  Elf32_Addr addr;
+  /* VMA recorded in the program header.  */
+  Elf32_Addr p_vaddr;
+  /* Size of this segment in memory.  */
+  Elf32_Word p_memsz;
+};
+
+struct elf32_fdpic_loadmap {
+  /* Protocol version number, must be zero.  */
+  Elf32_Half version;
+  /* Number of segments in this map.  */
+  Elf32_Half nsegs;
+  /* The actual memory map.  */
+  struct elf32_fdpic_loadseg segs[/*nsegs*/];
+};
+
+struct elf32_fdpic_loadaddr {
+  struct elf32_fdpic_loadmap *map;
+  void *got_value;
+};
+
+/* Map a pointer's VMA to its corresponding address according to the
+   load map.  */
+static __always_inline void *
+__reloc_pointer (void *p,
+		 const struct elf32_fdpic_loadmap *map)
+{
+  int c;
+
+#if 0
+  if (map->version != 0)
+    /* Crash.  */
+    ((void(*)())0)();
+#endif
+
+  /* No special provision is made for NULL.  We don't want NULL
+     addresses to go through relocation, so they shouldn't be in
+     .rofixup sections, and, if they're present in dynamic
+     relocations, they shall be mapped to the NULL address without
+     undergoing relocations.  */
+
+  for (c = 0;
+       /* Take advantage of the fact that the loadmap is ordered by
+	  virtual addresses.  In general there will only be 2 entries,
+	  so it's not profitable to do a binary search.  */
+       c < map->nsegs && p >= (void*)map->segs[c].p_vaddr;
+       c++)
+    {
+      /* This should be computed as part of the pointer comparison
+	 above, but we want to use the carry in the comparison, so we
+	 can't convert it to an integer type beforehand.  */
+      unsigned long offset = p - (void*)map->segs[c].p_vaddr;
+      /* We only check for one-past-the-end for the last segment,
+	 assumed to be the data segment, because other cases are
+	 ambiguous in the absence of padding between segments, and
+	 rofixup already serves as padding between text and data.
+	 Unfortunately, unless we special-case the last segment, we
+	 fail to relocate the _end symbol.  */
+      if (offset < map->segs[c].p_memsz
+	  || (offset == map->segs[c].p_memsz && c + 1 == map->nsegs))
+	return (char*)map->segs[c].addr + offset;
+    }
+
+  /* We might want to crash instead.  */
+  return (void*)-1;
+}
+
+# define __RELOC_POINTER(ptr, loadaddr) \
+  (__reloc_pointer ((void*)(ptr), \
+		    (loadaddr).map))
+
+#endif /* _BITS_ELF_FDPIC_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/endian.h
new file mode 100644
index 0000000..3ce83c5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/endian.h
@@ -0,0 +1,7 @@
+/* frv is big-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __BIG_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/fcntl.h
new file mode 100644
index 0000000..d437175
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/fcntl.h
@@ -0,0 +1,217 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995, 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	_FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+
+#include <sys/types.h>
+
+/* 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_DIRECT	 040000	/* Direct disk access.  */
+# define O_DIRECTORY	0200000	/* Must be a directory.  */
+# define O_NOFOLLOW	0400000	/* Do not follow links.  */
+# define O_NOATIME	01000000 /* don't 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	0100000
+#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_XOPEN2K
+# 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]FL.  */
+#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
+
+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/frv/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/kernel_stat.h
new file mode 100644
index 0000000..1cf5210
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/kernel_stat.h
@@ -0,0 +1,74 @@
+#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 {
+	unsigned char __pad1[6];
+	unsigned short st_dev;
+
+	unsigned long __pad2;
+	unsigned long st_ino;
+
+	unsigned short __pad3;
+	unsigned short st_mode;
+	unsigned short __pad4;
+	unsigned short st_nlink;
+
+	unsigned short __pad5;
+	unsigned short st_uid;
+	unsigned short __pad6;
+	unsigned short st_gid;
+
+	unsigned char __pad7[6];
+	unsigned short st_rdev;
+
+	unsigned long __pad8;
+	unsigned long st_size;
+
+	unsigned long __pad9;		/* align 64-bit st_blocks to 2-word */
+	unsigned long st_blksize;
+
+	unsigned long __pad10;	/* future possible st_blocks high bits */
+	unsigned long st_blocks;	/* Number 512-byte blocks allocated. */
+
+	struct timespec st_atim;
+	struct timespec st_mtim;
+	struct timespec st_ctim;
+
+	unsigned long long __unused4;
+};
+
+struct kernel_stat64 {
+	unsigned char __pad1[6];
+	unsigned short st_dev;
+
+	unsigned long long st_ino;
+
+	unsigned int st_mode;
+	unsigned int st_nlink;
+
+	unsigned long st_uid;
+	unsigned long st_gid;
+
+	unsigned char __pad2[6];
+	unsigned short st_rdev;
+
+	long long st_size;
+
+	unsigned long __pad3;		/* align 64-bit st_blocks to 2-word */
+	unsigned long st_blksize;
+
+	unsigned long __pad4;		/* future possible st_blocks high bits */
+	unsigned long st_blocks;	/* Number 512-byte blocks allocated. */
+
+	struct timespec st_atim;
+	struct timespec st_mtim;
+	struct timespec st_ctim;
+
+	unsigned long long __unused4;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/kernel_types.h
new file mode 100644
index 0000000..8403fd3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/kernel_types.h
@@ -0,0 +1,43 @@
+/* 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 _ASM_POSIX_TYPES_H
+#define _ASM_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 struct {
+#ifdef __USE_ALL
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* _ASM_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/setjmp.h
new file mode 100644
index 0000000..d49ad7b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/setjmp.h
@@ -0,0 +1,58 @@
+/* Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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'.  FRV 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
+
+#define	__SETJMP_NUM_INT	32		/* number of integer registers to save */
+#define	__SETJMP_NUM_DBL	32		/* number of double registers to save */
+
+#define	__SETJMP_INT(x)	(x)
+#define	__SETJMP_DBL(x)	(__SETJMP_NUM_INT+(x))
+#define	__SETJMP_LR	(__SETJMP_NUM_INT+__SETJMP_NUM_DBL)
+#define __SETJMP_SP	(__SETJMP_LR+1)
+#define __SETJMP_FP	(__SETJMP_SP+1)
+
+
+#ifndef _ASM
+typedef struct
+/* Demand 64-bit alignment such that we can use std/ldd in
+   setjmp/longjmp.  */
+__attribute__((__aligned__(8)))
+  {
+    /* Callee-saved registers.  */
+    unsigned long __ints[__SETJMP_NUM_INT];	/* integer registers */
+    unsigned long __dbls[__SETJMP_NUM_DBL];	/* double registers */
+    unsigned long __lr;				/* linkage register */
+    unsigned long __sp;				/* stack pointer */
+    unsigned long __fp;				/* frame pointer */
+  } __jmp_buf[1];
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)->__sp)
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/stackinfo.h
new file mode 100644
index 0000000..03412e0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/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 FRV the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/stat.h
new file mode 100644
index 0000000..0fcacf1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/stat.h
@@ -0,0 +1,159 @@
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001, 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_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_KERNEL	0
+#define _STAT_VER_LINUX		0
+#define _STAT_VER		_STAT_VER_LINUX	/* The one defined below.  */
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	1
+#define _MKNOD_VER_SVR4		2
+#define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below.  */
+
+struct stat
+{
+    __dev_t st_dev;			/* Device.  */
+
+#ifndef __USE_FILE_OFFSET64
+    unsigned long __pad1;
+    __ino_t st_ino;			/* File serial number.	*/
+#else
+    __ino64_t st_ino;			/* File serial number.	*/
+#endif
+
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+
+    __dev_t st_rdev;			/* Device number, if device.  */
+
+#ifndef __USE_FILE_OFFSET64
+    unsigned long __pad2;
+    __off_t st_size;			/* Size of file, in bytes.  */
+
+    unsigned long __pad3;
+#else
+    __off64_t st_size;			/* Size of file, in bytes.  */
+
+    unsigned long __pad1;
+#endif
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+#ifndef __USE_FILE_OFFSET64
+    unsigned long __pad4;
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+#else
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#endif
+
+    unsigned long int __unused1;
+    __time_t st_atime;			/* Time of last access.  */
+
+    unsigned long int __unused2;
+    __time_t st_mtime;			/* Time of last modification.  */
+
+    unsigned long int __unused3;
+    __time_t st_ctime;			/* Time of last status change.  */
+
+    unsigned long long __unused4;
+};
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+{
+    __dev_t st_dev;			/* Device.  */
+
+    __ino64_t st_ino;			/* File serial number.	*/
+
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+
+    __dev_t st_rdev;			/* Device number, if device.  */
+
+    __off64_t st_size;			/* Size of file, in bytes.  */
+
+    unsigned long __pad1;
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+
+    unsigned long int __unused1;
+    __time_t st_atime;			/* Time of last access.  */
+
+    unsigned long int __unused2;
+    __time_t st_mtime;			/* Time of last modification.  */
+
+    unsigned long int __unused3;
+    __time_t st_ctime;			/* Time of last status change.  */
+
+    unsigned long long __unused4;
+};
+#endif
+
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
+
+#endif	/* _BITS_STAT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/syscalls.h
new file mode 100644
index 0000000..eea3050
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/syscalls.h
@@ -0,0 +1,139 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+#define SYS_ify(syscall_name)  (__NR_##syscall_name)
+
+/* user-visible error numbers are in the range -1 - -4095: see <asm-frv/errno.h> */
+#if defined _LIBC && !defined __set_errno
+# define __syscall_return(type, res) \
+do { \
+        unsigned long __sr2 = (res);		    			    \
+	if (__builtin_expect ((unsigned long)(__sr2)			    \
+			      >= (unsigned long)(-4095), 0)) {		    \
+		extern int __syscall_error (int);			    \
+		return (type) __syscall_error (__sr2);		    	    \
+	}								    \
+	return (type) (__sr2); 						    \
+} while (0)
+#else
+# define __syscall_return(type, res) \
+do { \
+        unsigned long __sr2 = (res);		    			    \
+	if (__builtin_expect ((unsigned long)(__sr2)			    \
+			      >= (unsigned long)(-4095), 0)) {		    \
+		__set_errno (-__sr2);				    	    \
+		__sr2 = -1; 						    \
+	}								    \
+	return (type) (__sr2); 						    \
+} while (0)
+#endif
+
+#ifndef __set_errno
+# define __set_errno(val) ((*__errno_location ()) = (val))
+#endif
+
+/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
+
+#define _syscall0(type,name) \
+type name(void) \
+{ \
+register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); 	    \
+register unsigned long __sc0 __asm__ ("gr8");				    \
+__asm__ __volatile__ ("tra	gr0,gr0"				    \
+	: "=r" (__sc0) 							    \
+	: "r" (__scnum)); 						    \
+__syscall_return(type,__sc0); 						    \
+}
+
+#define _syscall1(type,name,type1,arg1) \
+type name(type1 arg1) \
+{ \
+register unsigned long __scnum __asm__ ("gr7") = (__NR_##name);		    \
+register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1;	    \
+__asm__ __volatile__ ("tra	gr0,gr0"				    \
+	: "+r" (__sc0) 							    \
+	: "r" (__scnum));						    \
+__syscall_return(type,__sc0);	 					    \
+}
+
+#define _syscall2(type,name,type1,arg1,type2,arg2) \
+type name(type1 arg1,type2 arg2) \
+{ \
+register unsigned long __scnum __asm__ ("gr7") = (__NR_##name);		    \
+register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1;	    \
+register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2;	    \
+__asm__ __volatile__ ("tra	gr0,gr0"				    \
+	: "+r" (__sc0)	 						    \
+	: "r" (__scnum), "r" (__sc1));					    \
+__syscall_return(type,__sc0);	 					    \
+}
+
+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
+type name(type1 arg1,type2 arg2,type3 arg3) \
+{ \
+register unsigned long __scnum __asm__ ("gr7") = (__NR_##name);		    \
+register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1;	    \
+register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2;	    \
+register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3;	    \
+__asm__ __volatile__ ("tra	gr0,gr0"				    \
+	: "+r" (__sc0)	 						    \
+	: "r" (__scnum), "r" (__sc1), "r" (__sc2));			    \
+__syscall_return(type,__sc0);	 					    \
+}
+
+#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
+type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+{ \
+register unsigned long __scnum __asm__ ("gr7") = (__NR_##name);		    \
+register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1;	    \
+register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2;	    \
+register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3;	    \
+register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4;	    \
+__asm__ __volatile__ ("tra	gr0,gr0"				    \
+	: "+r" (__sc0)	 						    \
+	: "r" (__scnum), "r" (__sc1), "r" (__sc2), "r" (__sc3));	    \
+__syscall_return(type,__sc0);	 					    \
+}
+
+#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
+type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
+{ \
+register unsigned long __scnum __asm__ ("gr7") = (__NR_##name);		    \
+register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1;	    \
+register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2;	    \
+register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3;	    \
+register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4;	    \
+register unsigned long __sc4 __asm__ ("gr12") = (unsigned long) arg5;	    \
+__asm__ __volatile__ ("tra	gr0,gr0"				    \
+	: "+r" (__sc0)	 						    \
+	: "r" (__scnum), "r" (__sc1), "r" (__sc2),		 	    \
+	  "r" (__sc3), "r" (__sc4));					    \
+__syscall_return(type,__sc0);	 					    \
+}
+
+#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5, type6, arg6) \
+type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
+{ \
+register unsigned long __scnum __asm__ ("gr7") = (__NR_##name);		    \
+register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1;	    \
+register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2;	    \
+register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3;	    \
+register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4;	    \
+register unsigned long __sc4 __asm__ ("gr12") = (unsigned long) arg5;	    \
+register unsigned long __sc5 __asm__ ("gr13") = (unsigned long) arg6;	    \
+__asm__ __volatile__ ("tra	gr0,gr0"				    \
+	: "+r" (__sc0)	 						    \
+	: "r" (__scnum), "r" (__sc1), "r" (__sc2),			    \
+	  "r" (__sc3), "r" (__sc4), "r" (__sc5));			    \
+__syscall_return(type,__sc0);	 					    \
+}
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..2a9422e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h
@@ -0,0 +1,48 @@
+/*
+ * 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__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/frv/bits/uClibc_page.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/uClibc_page.h
new file mode 100644
index 0000000..51a6e15
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/uClibc_page.h
@@ -0,0 +1,32 @@
+/*  Copyright (C) 2004     Erik Andersen
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supply an architecture specific value for PAGE_SIZE and friends.  */
+
+#ifndef _UCLIBC_PAGE_H
+#define _UCLIBC_PAGE_H
+
+/* PAGE_SHIFT determines the page size -- in this case 4096 */
+#define PAGE_SHIFT	(14)
+#ifndef __ASSEMBLY__
+#define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#else
+#define PAGE_SIZE	(1 << PAGE_SHIFT)
+#endif
+#define PAGE_MASK	(~(PAGE_SIZE-1))
+
+#endif /* _UCLIBC_PAGE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/frv/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/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/frv/brk.c b/ap/build/uClibc/libc/sysdeps/linux/frv/brk.c
new file mode 100644
index 0000000..a98cd54
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/brk.c
@@ -0,0 +1,27 @@
+/* From libc-5.3.12 */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+extern void * __curbrk attribute_hidden;
+extern int __init_brk (void) attribute_hidden;
+extern void *_brk(void *ptr) attribute_hidden;
+
+int brk(void * end_data_seg)
+{
+    if (__init_brk () == 0)
+    {
+		__curbrk = _brk(end_data_seg);
+		if (__curbrk == end_data_seg)
+			return 0;
+		__set_errno(ENOMEM);
+    }
+    return -1;
+}
+libc_hidden_def(brk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/clone.S b/ap/build/uClibc/libc/sysdeps/linux/frv/clone.S
new file mode 100644
index 0000000..1456157
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/clone.S
@@ -0,0 +1,83 @@
+/* Copyright (C) 2003, 2004 Free Software Foudnation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Alexandre Oliva <aoliva@redhat.com>, 2003.
+
+   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.  */
+
+#include <features.h>
+#include <asm/unistd.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+
+	.text
+	.globl	clone
+	.type clone,@function
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
+clone:
+	/* Sanity check arguments.  */
+	cmp.p	gr8, gr0, icc0
+	cmp	gr9, gr0, icc1
+	mov.p	gr8, gr4
+	beq	icc0, #0, .Lerror
+	mov.p	gr11, gr5
+	beq	icc1, #0, .Lerror
+
+	mov.p	gr10, gr8
+	setlos	#__NR_clone, gr7
+	tra	gr0,gr0
+
+	cmp.p	gr8, gr0, icc0
+	setlos #-4096, gr6
+	cmp.p	gr8, gr6, icc1
+	beq	icc0, #0, .Lthread_start
+	blslr	icc1, #2
+
+.Lsys_error:
+	sethi.p	#gotofffuncdeschi(__syscall_error), gr14
+	setlo	#gotofffuncdesclo(__syscall_error), gr14
+	ldd	@(gr14, gr15), gr14
+	jmpl	@(gr14, gr0)
+
+.Lerror:
+	setlos.p #-EINVAL, gr8
+	bra	.Lsys_error
+
+###############################################################################
+#
+# come here as the new thread [GR4 is fn, GR5 is arg]
+#
+###############################################################################
+.Lthread_start:
+	/* Save the PIC register.  */
+	mov	gr15, gr17
+
+	/* Call the user's function.  */
+	ldd.p	@(gr4, gr0), gr14
+	mov	gr5, gr8
+	calll	@(gr14, gr0)
+
+	/* Call _exit, rather simply inlining the syscall, such that
+	   breakpoints work.*/
+
+	mov.p	gr17, gr15
+	call	HIDDEN_JUMPTARGET(_exit)
+
+	/* Should never get here.  */
+	jmpl	@(gr0, gr0)
+	.size	clone,.-clone
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/crt0.S b/ap/build/uClibc/libc/sysdeps/linux/frv/crt0.S
new file mode 100644
index 0000000..a1d07bb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/crt0.S
@@ -0,0 +1,125 @@
+/* Copyright (C) 1991, 1992, 2003, 2004 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+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.)
+
+You should have received a copy of the GNU Lesser General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+
+/*  Based on ../i386/crt0.S and newlib's libgloss/frv/crt0.S  */
+
+/*
+    When we enter this piece of code, the program stack looks like this:
+        argc            argument counter (integer)
+        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
+
+    Also, GR16 holds a pointer to a memory map.  */
+
+#include <features.h>
+
+	.text
+	.global _start
+	.type	_start,%function
+#if defined L_crt0 || defined L_Scrt0 || ! defined __UCLIBC_CTOR_DTOR__
+	.type __uClibc_main,%function
+#else
+	.weak	_init
+	.weak	_fini
+	.type	__uClibc_start_main,%function
+#endif
+_start:
+	/* Make sure the stack pointer is properly aligned.  Save the
+	   original value in gr21 such that we can get to arguments and
+	   such from there.  */
+	mov.p	sp, gr21
+	andi	sp, #-8, sp
+	/* At program start-up, gr16 contains a pointer to a memory
+	   map, that we use to relocate addresses.  */
+	call	.Lcall
+.Lcall:
+	movsg	lr, gr4
+	sethi.p	#gprelhi(.Lcall), gr5
+	setlo	#gprello(.Lcall), gr5
+	sub.p	gr4, gr5, gr4
+	/* gr4 now holds the _gp address.  */
+
+	mov	gr16, gr8
+	sethi.p #gprelhi(__ROFIXUP_LIST__), gr9
+	sethi	#gprelhi(__ROFIXUP_END__), gr10
+	setlo.p #gprello(__ROFIXUP_LIST__), gr9
+	setlo	#gprello(__ROFIXUP_END__), gr10
+	add.p	gr9, gr4, gr9
+	add	gr10, gr4, gr10
+	call	__self_reloc
+	mov.p	gr8, gr17
+	mov	gr8, gr15
+	/* gr17 now holds the self-relocated _GLOBAL_OFFSET_TABLE_
+	address, because the linker added its unrelocated address as
+	the last entry in the ROFIXUP list, and __self_reloc returns
+	the last entry, relocated.  */
+
+	/* Prepare arguments for uClibc main.  */
+	ld	@(gr21, gr0), gr8
+	slli	gr8, #2, gr10
+	add	gr21, gr10, gr10
+	addi.p	gr21, #4, gr9
+	addi	gr10, #8, gr10
+
+	/* Set up an invalid (NULL return address, NULL frame pointer)
+	   callers stack frame so anybody unrolling the stack knows where
+	   to stop */
+	mov	gr0, fp
+	movgs	gr0, lr
+
+#if (defined L_crt1 || defined L_Scrt1) && defined __UCLIBC_CTOR_DTOR__
+	/* Pass .init and .fini arguments to __uClibc_start_main().  */
+	sethi.p	#gotfuncdeschi(_init), gr11
+	sethi	#gotfuncdeschi(_fini), gr12
+	setlo.p	#gotfuncdesclo(_init), gr11
+	setlo	#gotfuncdesclo(_fini), gr12
+	ld.p	@(gr11, gr17), gr11
+	mov	gr17, gr15
+	ld.p	@(gr12, gr17), gr12
+	call	__uClibc_start_main
+#else
+	mov.p	gr17, gr15
+	call	__uClibc_main
+#endif
+
+	/* Crash if somehow `exit' returns anyways.  */
+	jmpl	@(gr0,gr0)
+.size _start,.-_start
+
+/* 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/frv/crti.S b/ap/build/uClibc/libc/sysdeps/linux/frv/crti.S
new file mode 100644
index 0000000..1788524
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/crti.S
@@ -0,0 +1,50 @@
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+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.)
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+	.section .init,"x"
+	.p2align 2
+	.globl _init
+	.type	_init, @function
+_init:
+	addi sp,#-16,sp
+	st.p fp, @(sp,gr0)
+	mov sp, fp
+	movsg lr, gr5
+	sti gr15, @(fp,4) 
+	sti gr5, @(fp,8)
+	
+	.section .fini,"x"
+	.p2align 2
+	.globl _fini
+	.type	_fini, @function
+_fini:
+	addi sp,#-16,sp
+	st.p fp, @(sp,gr0)
+	mov sp, fp
+	movsg lr, gr5
+	sti gr15, @(fp,4)
+	sti gr5, @(fp,8)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/frv/crtn.S
new file mode 100644
index 0000000..bd11901
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/crtn.S
@@ -0,0 +1,42 @@
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+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.)
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+	.section .init,"x"
+	.globl _init
+	.type	_init, @function
+	ldi @(fp,8), gr5
+	ld @(sp,gr0), fp
+	addi sp,#16,sp
+	jmpl @(gr5,gr0)
+	
+	.section .fini,"x"
+	.globl _fini
+	.type	_fini, @function
+	ldi @(fp,8), gr5
+	ld @(sp,gr0), fp
+	addi sp,#16,sp
+	jmpl @(gr5,gr0)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/crtreloc.c b/ap/build/uClibc/libc/sysdeps/linux/frv/crtreloc.c
new file mode 100644
index 0000000..ba934bc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/crtreloc.c
@@ -0,0 +1,120 @@
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   written by Alexandre Oliva <aoliva@redhat.com>
+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.)
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#include <sys/types.h>
+#include <link.h>
+
+/* This file is to be compiled into crt object files, to enable
+   executables to easily self-relocate.  */
+
+/* Compute the runtime address of pointer in the range [p,e), and then
+   map the pointer pointed by it.  */
+static __always_inline void ***
+reloc_range_indirect (void ***p, void ***e,
+		      const struct elf32_fdpic_loadmap *map)
+{
+  while (p < e)
+    {
+      void *ptr = __reloc_pointer (*p, map);
+      if (ptr)
+	{
+	  void *pt;
+	  if ((long)ptr & 3)
+	    __builtin_memcpy(&pt, ptr, sizeof(pt));
+	  else
+	    pt = *(void**)ptr;
+	  pt = __reloc_pointer (pt, map);
+	  if ((long)ptr & 3)
+	    __builtin_memcpy(ptr, &pt, sizeof(pt));
+	  else
+	    *(void**)ptr = pt;
+	}
+      p++;
+    }
+  return p;
+}
+
+/* Call __reloc_range_indirect for the given range except for the last
+   entry, whose contents are only relocated.  It's expected to hold
+   the GOT value.  */
+void* attribute_hidden
+__self_reloc (const struct elf32_fdpic_loadmap *map,
+	      void ***p, void ***e)
+{
+  p = reloc_range_indirect (p, e-1, map);
+
+  if (p >= e)
+    return (void*)-1;
+
+  return __reloc_pointer (*p, map);
+}
+
+#if 0
+/* These are other functions that might be useful, but that we don't
+   need.  */
+
+/* Remap pointers in [p,e).  */
+static __always_inline void**
+reloc_range (void **p, void **e,
+	     const struct elf32_fdpic_loadmap *map)
+{
+  while (p < e)
+    {
+      *p = __reloc_pointer (*p, map);
+      p++;
+    }
+  return p;
+}
+
+/* Remap p, adjust e by the same offset, then map the pointers in the
+   range determined by them.  */
+void attribute_hidden
+__reloc_range (const struct elf32_fdpic_loadmap *map,
+	       void **p, void **e)
+{
+  void **old = p;
+
+  p = __reloc_pointer (p, map);
+  e += p - old;
+  reloc_range (p, e, map);
+}
+
+/* Remap p, adjust e by the same offset, then map pointers referenced
+   by the (unadjusted) pointers in the range.  Return the relocated
+   value of the last pointer in the range.  */
+void* attribute_hidden
+__reloc_range_indirect (const struct elf32_fdpic_loadmap *map,
+			void ***p, void ***e)
+{
+  void ***old = p;
+
+  p = __reloc_pointer (p, map);
+  e += p - old;
+  return reloc_range_indirect (p, e, map);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/dl-iterate-phdr.c b/ap/build/uClibc/libc/sysdeps/linux/frv/dl-iterate-phdr.c
new file mode 100644
index 0000000..144e4c1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/dl-iterate-phdr.c
@@ -0,0 +1,42 @@
+/* Copyright 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
+Library 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; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#include <link.h>
+
+extern int weak_function
+__dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
+				    size_t size, void *data),
+		   void *data);
+
+/* Define it as a pointer, such that we get a pointer to the global
+   function descriptor, that won't be optimized away by the
+   linker.  */
+static int (*ptr) (int (*callback) (struct dl_phdr_info *info,
+				    size_t size, void *data),
+		   void *data) = __dl_iterate_phdr;
+
+int
+dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
+				  size_t size, void *data),
+		 void *data)
+{
+  if (ptr)
+    return ptr (callback, data);
+
+  return 0;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/fstat.c b/ap/build/uClibc/libc/sysdeps/linux/frv/fstat.c
new file mode 100644
index 0000000..45d2746
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/fstat.c
@@ -0,0 +1,17 @@
+/*
+ * Syscalls for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+_syscall2(int, fstat, int, fd, struct stat *, buf)
+libc_hidden_def(fstat)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/fstat64.c b/ap/build/uClibc/libc/sysdeps/linux/frv/fstat64.c
new file mode 100644
index 0000000..f795342
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/fstat64.c
@@ -0,0 +1,19 @@
+/*
+ * Syscalls for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+_syscall2(int, fstat64, int, fd, struct stat64 *, buf)
+libc_hidden_def(fstat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/lstat.c b/ap/build/uClibc/libc/sysdeps/linux/frv/lstat.c
new file mode 100644
index 0000000..94f722f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/lstat.c
@@ -0,0 +1,17 @@
+/*
+ * Syscalls for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+_syscall2(int, lstat, const char *, file_name, struct stat *, buf)
+libc_hidden_def(lstat)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/lstat64.c b/ap/build/uClibc/libc/sysdeps/linux/frv/lstat64.c
new file mode 100644
index 0000000..f038fb0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/lstat64.c
@@ -0,0 +1,19 @@
+/*
+ * Syscalls for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+_syscall2(int, lstat64, const char *, file_name, struct stat64 *, buf)
+libc_hidden_def(lstat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/frv/mmap.c
new file mode 100644
index 0000000..cb91124
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/mmap.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1997, 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Daniel Jacobowitz <dan@debian.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.  */
+
+/* Massivly hacked up for uClibc by Erik Andersen */
+
+/* Extracted from ../common/mmap64.c by Alexandre Oliva <aoliva@redhat.com>
+
+   We don't want to use the old mmap interface.  */
+
+#include <features.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <sys/mman.h>
+
+
+#define __NR___syscall_mmap2	    __NR_mmap2
+static __inline__ _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr,
+	size_t, len, int, prot, int, flags, int, fd, off_t, offset)
+
+/* This is always 12, even on architectures where PAGE_SHIFT != 12.  */
+# ifndef MMAP2_PAGE_SHIFT
+#  define MMAP2_PAGE_SHIFT 12
+# endif
+
+__ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
+{
+    if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)) {
+	__set_errno (EINVAL);
+	return MAP_FAILED;
+    }
+    return(__syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT)));
+}
+libc_hidden_def(mmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/sbrk.c b/ap/build/uClibc/libc/sysdeps/linux/frv/sbrk.c
new file mode 100644
index 0000000..2dc719a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/sbrk.c
@@ -0,0 +1,25 @@
+/* From libc-5.3.12 */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+extern void * __curbrk attribute_hidden;
+extern int __init_brk (void) attribute_hidden;
+extern void *_brk(void *ptr) attribute_hidden;
+
+void *
+sbrk(intptr_t increment)
+{
+    if (__init_brk () == 0)
+    {
+		char * tmp = (char*)__curbrk+increment;
+		__curbrk = _brk(tmp);
+		if (__curbrk == tmp)
+			return tmp-increment;
+		__set_errno(ENOMEM);
+		return ((void *) -1);
+    }
+    return ((void *) -1);
+}
+libc_hidden_def(sbrk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/frv/setjmp.S
new file mode 100644
index 0000000..66008d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/setjmp.S
@@ -0,0 +1,90 @@
+	.text
+
+/* 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
+_setjmp:
+	setlos	#0, gr9
+	bra	.Lsigsetjmp_intern
+	.size	_setjmp,.-_setjmp
+	
+/* 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.  */
+
+	.align 4
+	.type	setjmp,@function
+	.globl	setjmp
+setjmp:	
+	setlos	#1, gr9
+	bra	.Lsigsetjmp_intern
+	.size	setjmp,.-setjmp
+	
+# setjmp/longjmp for Frv.  The jmpbuf looks like this:
+#	
+# Register	jmpbuf offset
+# R16-R31	0x0-0x03c
+# R48-R63	0x40-0x7c
+# FR16-FR31     0x80-0xbc
+# FR48-FR63     0xc0-0xfc
+# LR            0x100
+# SP            0x104
+# FP            0x108
+
+	.global	__sigsetjmp
+	.type	__sigsetjmp,@function
+__sigsetjmp:
+.Lsigsetjmp_intern:
+	stdi	gr16, @(gr8,0)
+	stdi	gr18, @(gr8,8)
+	stdi 	gr20, @(gr8,16)
+	stdi	gr22, @(gr8,24)
+	stdi	gr24, @(gr8,32)
+	stdi	gr26, @(gr8,40)
+	stdi	gr28, @(gr8,48)
+	stdi	gr30, @(gr8,56)
+#if __FRV_GPR__ != 32
+	stdi	gr48, @(gr8,64)
+	stdi	gr50, @(gr8,72)
+	stdi	gr52, @(gr8,80)
+	stdi	gr54, @(gr8,88)
+	stdi	gr56, @(gr8,96)
+	stdi	gr58, @(gr8,104)
+	stdi	gr60, @(gr8,112)
+	stdi	gr62, @(gr8,120)
+#endif
+
+#if __FRV_FPR__ != 0
+	stdfi	fr16, @(gr8,128)
+	stdfi	fr18, @(gr8,136)
+	stdfi 	fr20, @(gr8,144)
+	stdfi	fr22, @(gr8,152)
+	stdfi	fr24, @(gr8,160)
+	stdfi	fr26, @(gr8,168)
+	stdfi	fr28, @(gr8,176)
+	stdfi	fr30, @(gr8,184)
+#if __FRV_FPR__ != 32
+	stdfi	fr48, @(gr8,192)
+	stdfi	fr50, @(gr8,200)
+	stdfi	fr52, @(gr8,208)
+	stdfi	fr54, @(gr8,216)
+	stdfi	fr56, @(gr8,224)
+	stdfi	fr58, @(gr8,232)
+	stdfi	fr60, @(gr8,240)
+	stdfi	fr62, @(gr8,248)
+#endif
+#endif
+
+        movsg	lr, gr4
+	sti     gr4, @(gr8,256)
+	sti     sp, @(gr8,260)
+	sti     fp, @(gr8,264)
+	
+	sethi.p	#gotofffuncdeschi(__sigjmp_save), gr4
+	setlo	#gotofffuncdesclo(__sigjmp_save), gr4
+	ldd	@(gr15, gr4), gr14
+	jmpl	@(gr14, gr0)
+	.size	__sigsetjmp,.-__sigsetjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/stat.c b/ap/build/uClibc/libc/sysdeps/linux/frv/stat.c
new file mode 100644
index 0000000..74e3100
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/stat.c
@@ -0,0 +1,17 @@
+/*
+ * Syscalls for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+_syscall2(int, stat, const char *, file_name, struct stat *, buf)
+libc_hidden_def(stat)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/stat64.c b/ap/build/uClibc/libc/sysdeps/linux/frv/stat64.c
new file mode 100644
index 0000000..675e634
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/stat64.c
@@ -0,0 +1,19 @@
+/*
+ * Syscalls for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+_syscall2(int, stat64, const char *, file_name, struct stat64 *, buf)
+libc_hidden_def(stat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/frv/sys/procfs.h
new file mode 100644
index 0000000..f075233
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/sys/procfs.h
@@ -0,0 +1,125 @@
+/* Copyright (C) 1996, 1997, 1999, 2000, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_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_struct' 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_int_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers.  */
+typedef struct user_fpmedia_regs 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/frv/sys/ptrace.h b/ap/build/uClibc/libc/sysdeps/linux/frv/sys/ptrace.h
new file mode 100644
index 0000000..6b0eca7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/sys/ptrace.h
@@ -0,0 +1,139 @@
+/* `ptrace' debugger support interface.  FRV-Linux version.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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_PTRACE_H
+#define _SYS_PTRACE_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.'  */
+enum __ptrace_request
+{
+  /* Indicate that the process making this request should be traced.
+     All signals received by this process can be intercepted by its
+     parent, and its parent can use the other `ptrace' requests.  */
+  PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+  /* Return the word in the process's text space at address ADDR.  */
+  PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+  /* Return the word in the process's data space at address ADDR.  */
+  PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+  /* Return the word in the process's user area at offset ADDR.  */
+  PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+  /* Write the word DATA into the process's text space at address ADDR.  */
+  PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+  /* Write the word DATA into the process's data space at address ADDR.  */
+  PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+  /* Write the word DATA into the process's user area at offset ADDR.  */
+  PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+  /* Continue the process.  */
+  PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+  /* Kill the process.  */
+  PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+  /* Single step the process.
+     This is not supported on all machines.  */
+  PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+  /* Get all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+  /* Set all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+  /* Get all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+  /* Set all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
+  /* Attach to a process that is already running. */
+  PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+  /* Detach from a process attached to with PTRACE_ATTACH.  */
+  PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+  /* Get all extended floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETFPXREGS = 18,
+#define PT_GETFPXREGS PTRACE_GETFPXREGS
+
+  /* Set all extended floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETFPXREGS = 19,
+#define PT_SETFPXREGS PTRACE_SETFPXREGS
+
+  /* Continue and stop at the next (return from) syscall.  */
+  PTRACE_SYSCALL = 24,
+#define PT_SYSCALL PTRACE_SYSCALL
+
+  /* Obtain the load map of the main program or the interpreter of the
+     ptraced process, depending on whether the addr argument is
+     (void*)0 or (void*)1, respectively.  */
+  PTRACE_GETFDPIC = 31
+#define PT_GETFDPIC PTRACE_GETFDPIC
+};
+
+#define PTRACE_GETFDPIC_EXEC      ((void*)0)	/* [addr] request the executable loadmap */
+#define PTRACE_GETFDPIC_INTERP    ((void*)1)	/* [addr] request the interpreter loadmap */
+
+/* Perform process tracing functions.  REQUEST is one of the values
+   above, and determines the action to be taken.
+   For all requests except PTRACE_TRACEME, PID specifies the process to be
+   traced.
+
+   PID and the other arguments described above for the various requests should
+   appear (those that are used for the particular request) as:
+     pid_t PID, void *ADDR, int DATA, void *ADDR2
+   after REQUEST.  */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/frv/sys/ucontext.h
new file mode 100644
index 0000000..487c9ee
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/sys/ucontext.h
@@ -0,0 +1,451 @@
+/* Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+
+typedef unsigned long greg_t;
+
+/* Number of general registers.  */
+#define NGREG	(10+2+64)
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+#ifdef __USE_GNU
+/* Number of each register is the `gregset_t' array.  */
+enum
+{
+  REG_PSR = 0,
+#define REG_PSR	REG_PSR
+  REG_ISR = 1,
+#define REG_ISR	REG_ISR
+  REG_CCR = 2,
+#define REG_CCR	REG_CCR
+  REG_CCCR = 3,
+#define REG_CCCR	REG_CCCR
+  REG_LR = 4,
+#define REG_LR	REG_LR
+  REG_LCR = 5,
+#define REG_LCR	REG_LCR
+  REG_PC = 6,
+#define REG_PC	REG_PC
+  REG___STATUS = 7,
+#define REG___STATUS	REG___STATUS
+  REG_SYSCALLNO = 8,
+#define REG_SYSCALLNO	REG_SYSCALLNO
+  REG_ORIG_GR8 = 9,
+#define REG_ORIG_GR8	REG_ORIG_GR8
+  REG_GNER0 = 10,
+#define REG_GNER0	REG_GNER0
+  REG_GNER1 = 11,
+#define REG_GNER1	REG_GNER1
+  REG_GR0 = 12,
+#define REG_GR0	REG_GR0
+  REG_GR1 = 13,
+#define REG_GR1	REG_GR1
+  REG_GR2 = 14,
+#define REG_GR2	REG_GR2
+  REG_GR3 = 15,
+#define REG_GR3	REG_GR3
+  REG_GR4 = 16,
+#define REG_GR4	REG_GR4
+  REG_GR5 = 17,
+#define REG_GR5	REG_GR5
+  REG_GR6 = 18,
+#define REG_GR6	REG_GR6
+  REG_GR7 = 19,
+#define REG_GR7	REG_GR7
+  REG_GR8 = 20,
+#define REG_GR8	REG_GR8
+  REG_GR9 = 21,
+#define REG_GR9	REG_GR9
+  REG_GR10 = 22,
+#define REG_GR10	REG_GR10
+  REG_GR11 = 23,
+#define REG_GR11	REG_GR11
+  REG_GR12 = 24,
+#define REG_GR12	REG_GR12
+  REG_GR13 = 25,
+#define REG_GR13	REG_GR13
+  REG_GR14 = 26,
+#define REG_GR14	REG_GR14
+  REG_GR15 = 27,
+#define REG_GR15	REG_GR15
+  REG_GR16 = 28,
+#define REG_GR16	REG_GR16
+  REG_GR17 = 29,
+#define REG_GR17	REG_GR17
+  REG_GR18 = 30,
+#define REG_GR18	REG_GR18
+  REG_GR19 = 31,
+#define REG_GR19	REG_GR19
+  REG_GR20 = 32,
+#define REG_GR20	REG_GR20
+  REG_GR21 = 33,
+#define REG_GR21	REG_GR21
+  REG_GR22 = 34,
+#define REG_GR22	REG_GR22
+  REG_GR23 = 35,
+#define REG_GR23	REG_GR23
+  REG_GR24 = 36,
+#define REG_GR24	REG_GR24
+  REG_GR25 = 37,
+#define REG_GR25	REG_GR25
+  REG_GR26 = 38,
+#define REG_GR26	REG_GR26
+  REG_GR27 = 39,
+#define REG_GR27	REG_GR27
+  REG_GR28 = 40,
+#define REG_GR28	REG_GR28
+  REG_GR29 = 41,
+#define REG_GR29	REG_GR29
+  REG_GR30 = 42,
+#define REG_GR30	REG_GR30
+  REG_GR31 = 43,
+#define REG_GR31	REG_GR31
+  REG_GR32 = 44,
+#define REG_GR32	REG_GR32
+  REG_GR33 = 45,
+#define REG_GR33	REG_GR33
+  REG_GR34 = 46,
+#define REG_GR34	REG_GR34
+  REG_GR35 = 47,
+#define REG_GR35	REG_GR35
+  REG_GR36 = 48,
+#define REG_GR36	REG_GR36
+  REG_GR37 = 49,
+#define REG_GR37	REG_GR37
+  REG_GR38 = 50,
+#define REG_GR38	REG_GR38
+  REG_GR39 = 51,
+#define REG_GR39	REG_GR39
+  REG_GR40 = 52,
+#define REG_GR40	REG_GR40
+  REG_GR41 = 53,
+#define REG_GR41	REG_GR41
+  REG_GR42 = 54,
+#define REG_GR42	REG_GR42
+  REG_GR43 = 55,
+#define REG_GR43	REG_GR43
+  REG_GR44 = 56,
+#define REG_GR44	REG_GR44
+  REG_GR45 = 57,
+#define REG_GR45	REG_GR45
+  REG_GR46 = 58,
+#define REG_GR46	REG_GR46
+  REG_GR47 = 59,
+#define REG_GR47	REG_GR47
+  REG_GR48 = 60,
+#define REG_GR48	REG_GR48
+  REG_GR49 = 61,
+#define REG_GR49	REG_GR49
+  REG_GR50 = 62,
+#define REG_GR50	REG_GR50
+  REG_GR51 = 63,
+#define REG_GR51	REG_GR51
+  REG_GR52 = 64,
+#define REG_GR52	REG_GR52
+  REG_GR53 = 65,
+#define REG_GR53	REG_GR53
+  REG_GR54 = 66,
+#define REG_GR54	REG_GR54
+  REG_GR55 = 67,
+#define REG_GR55	REG_GR55
+  REG_GR56 = 68,
+#define REG_GR56	REG_GR56
+  REG_GR57 = 69,
+#define REG_GR57	REG_GR57
+  REG_GR58 = 70,
+#define REG_GR58	REG_GR58
+  REG_GR59 = 71,
+#define REG_GR59	REG_GR59
+  REG_GR60 = 72,
+#define REG_GR60	REG_GR60
+  REG_GR61 = 73,
+#define REG_GR61	REG_GR61
+  REG_GR62 = 74,
+#define REG_GR62	REG_GR62
+  REG_GR63 = 75,
+#define REG_GR63	REG_GR63
+};
+#endif
+
+typedef unsigned long freg_t;
+
+/* Number of FPU registers.  */
+#define NFPREG	(64+2+2+8+2+1)
+
+#ifdef __USE_GNU
+/* Number of each register is the `gregset_t' array.  */
+enum
+{
+  REG_FR0 = 0,
+#define REG_FR0	REG_FR0
+  REG_FR1 = 1,
+#define REG_FR1	REG_FR1
+  REG_FR2 = 2,
+#define REG_FR2	REG_FR2
+  REG_FR3 = 3,
+#define REG_FR3	REG_FR3
+  REG_FR4 = 4,
+#define REG_FR4	REG_FR4
+  REG_FR5 = 5,
+#define REG_FR5	REG_FR5
+  REG_FR6 = 6,
+#define REG_FR6	REG_FR6
+  REG_FR7 = 7,
+#define REG_FR7	REG_FR7
+  REG_FR8 = 8,
+#define REG_FR8	REG_FR8
+  REG_FR9 = 9,
+#define REG_FR9	REG_FR9
+  REG_FR10 = 10,
+#define REG_FR10	REG_FR10
+  REG_FR11 = 11,
+#define REG_FR11	REG_FR11
+  REG_FR12 = 12,
+#define REG_FR12	REG_FR12
+  REG_FR13 = 13,
+#define REG_FR13	REG_FR13
+  REG_FR14 = 14,
+#define REG_FR14	REG_FR14
+  REG_FR15 = 15,
+#define REG_FR15	REG_FR15
+  REG_FR16 = 16,
+#define REG_FR16	REG_FR16
+  REG_FR17 = 17,
+#define REG_FR17	REG_FR17
+  REG_FR18 = 18,
+#define REG_FR18	REG_FR18
+  REG_FR19 = 19,
+#define REG_FR19	REG_FR19
+  REG_FR20 = 20,
+#define REG_FR20	REG_FR20
+  REG_FR21 = 21,
+#define REG_FR21	REG_FR21
+  REG_FR22 = 22,
+#define REG_FR22	REG_FR22
+  REG_FR23 = 23,
+#define REG_FR23	REG_FR23
+  REG_FR24 = 24,
+#define REG_FR24	REG_FR24
+  REG_FR25 = 25,
+#define REG_FR25	REG_FR25
+  REG_FR26 = 26,
+#define REG_FR26	REG_FR26
+  REG_FR27 = 27,
+#define REG_FR27	REG_FR27
+  REG_FR28 = 28,
+#define REG_FR28	REG_FR28
+  REG_FR29 = 29,
+#define REG_FR29	REG_FR29
+  REG_FR30 = 30,
+#define REG_FR30	REG_FR30
+  REG_FR31 = 31,
+#define REG_FR31	REG_FR31
+  REG_FR32 = 32,
+#define REG_FR32	REG_FR32
+  REG_FR33 = 33,
+#define REG_FR33	REG_FR33
+  REG_FR34 = 34,
+#define REG_FR34	REG_FR34
+  REG_FR35 = 35,
+#define REG_FR35	REG_FR35
+  REG_FR36 = 36,
+#define REG_FR36	REG_FR36
+  REG_FR37 = 37,
+#define REG_FR37	REG_FR37
+  REG_FR38 = 38,
+#define REG_FR38	REG_FR38
+  REG_FR39 = 39,
+#define REG_FR39	REG_FR39
+  REG_FR40 = 40,
+#define REG_FR40	REG_FR40
+  REG_FR41 = 41,
+#define REG_FR41	REG_FR41
+  REG_FR42 = 42,
+#define REG_FR42	REG_FR42
+  REG_FR43 = 43,
+#define REG_FR43	REG_FR43
+  REG_FR44 = 44,
+#define REG_FR44	REG_FR44
+  REG_FR45 = 45,
+#define REG_FR45	REG_FR45
+  REG_FR46 = 46,
+#define REG_FR46	REG_FR46
+  REG_FR47 = 47,
+#define REG_FR47	REG_FR47
+  REG_FR48 = 48,
+#define REG_FR48	REG_FR48
+  REG_FR49 = 49,
+#define REG_FR49	REG_FR49
+  REG_FR50 = 50,
+#define REG_FR50	REG_FR50
+  REG_FR51 = 51,
+#define REG_FR51	REG_FR51
+  REG_FR52 = 52,
+#define REG_FR52	REG_FR52
+  REG_FR53 = 53,
+#define REG_FR53	REG_FR53
+  REG_FR54 = 54,
+#define REG_FR54	REG_FR54
+  REG_FR55 = 55,
+#define REG_FR55	REG_FR55
+  REG_FR56 = 56,
+#define REG_FR56	REG_FR56
+  REG_FR57 = 57,
+#define REG_FR57	REG_FR57
+  REG_FR58 = 58,
+#define REG_FR58	REG_FR58
+  REG_FR59 = 59,
+#define REG_FR59	REG_FR59
+  REG_FR60 = 60,
+#define REG_FR60	REG_FR60
+  REG_FR61 = 61,
+#define REG_FR61	REG_FR61
+  REG_FR62 = 62,
+#define REG_FR62	REG_FR62
+  REG_FR63 = 63,
+#define REG_FR63	REG_FR63
+  REG_FNER0 = 64,
+#define REG_FNER0	REG_FNER0
+  REG_FNER1 = 65,
+#define REG_FNER1	REG_FNER1
+  REG_MSR0 = 66,
+#define REG_MSR0	REG_MSR0
+  REG_MSR1 = 67,
+#define REG_MSR1	REG_MSR1
+  REG_ACC0 = 68,
+#define REG_ACC0	REG_ACC0
+  REG_ACC1 = 69,
+#define REG_ACC1	REG_ACC1
+  REG_ACC2 = 70,
+#define REG_ACC2	REG_ACC2
+  REG_ACC3 = 71,
+#define REG_ACC3	REG_ACC3
+  REG_ACC4 = 72,
+#define REG_ACC4	REG_ACC4
+  REG_ACC5 = 73,
+#define REG_ACC5	REG_ACC5
+  REG_ACC6 = 74,
+#define REG_ACC6	REG_ACC6
+  REG_ACC7 = 75,
+#define REG_ACC7	REG_ACC7
+  REG_ACCG0123 = 76,
+#define REG_ACCG0123	REG_ACCG0123
+  REG_ACCG4567 = 77,
+#define REG_ACCG4567	REG_ACCG4567
+  REG_FSR0 = 78,
+#define REG_FSR0	REG_FSR0
+};
+#endif
+
+/* Structure to describe FPU registers.  */
+typedef freg_t fpregset_t[NFPREG];
+
+/* Context to describe whole processor state.  */
+typedef struct
+  {
+    gregset_t gregs;
+    fpregset_t fpregs;
+    void *extension;
+    unsigned long sc_oldmask; 	/* old sigmask */
+  } __attribute__((aligned(8))) mcontext_t;
+
+#ifdef __USE_GNU
+struct kernel_user_int_regs
+{
+  /* integer registers
+   * - up to gr[31] mirror pt_regs in the kernel
+   */
+  unsigned long		psr;		/* Processor Status Register */
+  unsigned long		isr;		/* Integer Status Register */
+  unsigned long		ccr;		/* Condition Code Register */
+  unsigned long		cccr;		/* Condition Code for Conditional Insns Register */
+  unsigned long		lr;		/* Link Register */
+  unsigned long		lcr;		/* Loop Count Register */
+  unsigned long		pc;		/* Program Counter Register */
+  unsigned long		__status;	/* exception status */
+  unsigned long		syscallno;	/* syscall number or -1 */
+  unsigned long		orig_gr8;	/* original syscall arg #1 */
+  unsigned long		gner[2];
+
+  union {
+    unsigned long	tbr;
+    unsigned long	gr[64];
+  };
+};
+
+struct kernel_user_fpmedia_regs
+{
+  /* FP/Media registers */
+  unsigned long	fr[64];
+  unsigned long	fner[2];
+  unsigned long	msr[2];
+  unsigned long	acc[8];
+  unsigned char	accg[8];
+  unsigned long	fsr[1];
+};
+
+struct kernel_user_context
+{
+  struct kernel_user_int_regs i;
+  struct kernel_user_fpmedia_regs f;
+
+  /* we provide a context extension so that we can save the regs for CPUs that
+   * implement many more of Fujitsu's lavish register spec
+   */
+  void			*extension;
+
+  /* This is not part of the kernel's struct user_context, but
+     rather of the enclosing struct sigcontext, but we add it
+     here to parallel mcontext_t, just for completeness.  */
+  unsigned long sc_oldmask; 	/* old sigmask */
+} __attribute__((aligned(8)));
+
+/* This union enables alias-safe casts from mcontext_t* to the union
+   type, that can then be dereferenced as_aliases.  */
+union kmcontext_t
+{
+  mcontext_t as_regsets;
+  /* as_aliases is actually missing sc_oldmask, that is present in
+     mcontext_t.  */
+  struct kernel_user_context as_aliases;
+};
+#endif
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/syscall.c b/ap/build/uClibc/libc/sysdeps/linux/frv/syscall.c
new file mode 100644
index 0000000..7b416e8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/syscall.c
@@ -0,0 +1,41 @@
+/* syscall for frv/uClibc
+ *
+ * Copyright (C) 2004 by Alexandre Oliva <aoliva@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <features.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+
+long syscall(long sysnum, long arg1, long arg2, long arg3,
+	     long arg4, long arg5, long arg6)
+{
+  register unsigned long __scnum __asm__ ("gr7") = (sysnum);
+  register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) (arg1);
+  register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) (arg2);
+  register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) (arg3);
+  register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) (arg4);
+  register unsigned long __sc4 __asm__ ("gr12") = (unsigned long) (arg5);
+  register unsigned long __sc5 __asm__ ("gr13") = (unsigned long) (arg6);
+  __asm__ __volatile__ ("tra	gr0,gr0"
+			: "+r" (__sc0)
+			: "r" (__scnum), "r" (__sc1), "r" (__sc2),
+			"r" (__sc3), "r" (__sc4), "r" (__sc5));
+  __syscall_return(long,__sc0);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/sysdep.c b/ap/build/uClibc/libc/sysdeps/linux/frv/sysdep.c
new file mode 100644
index 0000000..7387d11
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/sysdep.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 1997, 1998, 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.  */
+
+#include <errno.h>
+
+/* This routine is jumped to by all the syscall handlers, to stash
+   an error number into errno.  */
+int __syscall_error (int err_no)
+{
+  __set_errno (-err_no);
+  return -1;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/frv/vfork.S
new file mode 100644
index 0000000..8935a12
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/vfork.S
@@ -0,0 +1,47 @@
+/* Copyright (C) 2003, 2004 Free Software Foudnation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Howells <dhowells@redhat.com>, 2003.
+
+   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 <asm/unistd.h>
+#define _ERRNO_H       1
+#include <bits/errno.h>
+
+       .text
+       .globl	__vfork
+       .hidden	__vfork
+       .type	__vfork,@function
+/* int vfork(void) */
+__vfork:
+	setlos.p #__NR_vfork, gr7
+	setlos	#-4096, gr4
+	tra	gr0, gr0
+
+	cmp	gr8, gr4, icc0
+	blslr	icc0, #2
+
+	sethi.p	#gotofffuncdeschi(__syscall_error), gr14
+	setlo	#gotofffuncdesclo(__syscall_error), gr14
+	ldd	@(gr14, gr15), gr14
+	jmpl	@(gr14, gr0)
+
+       .size   __vfork,.-__vfork
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/frv/xstatconv.c b/ap/build/uClibc/libc/sysdeps/linux/frv/xstatconv.c
new file mode 100644
index 0000000..d7948c0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/frv/xstatconv.c
@@ -0,0 +1 @@
+/* We don't need any of this.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/Makefile b/ap/build/uClibc/libc/sysdeps/linux/h8300/Makefile
new file mode 100644
index 0000000..2ab4ee6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/Makefile
@@ -0,0 +1,65 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TOPDIR=../../../../
+include $(TOPDIR)Rules.mak
+ifeq ($(DOPIC),y)
+# is this not provided by gcc ?
+ASFLAGS+=-D__PIC__
+endif
+
+#FIXME -- this arch should include its own crti.S and crtn.S
+UCLIBC_CTOR_DTOR=n
+
+CRT_SRC := crt0.S
+CRT_OBJ := crt0.o crt1.o
+CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
+
+SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S
+SOBJ := $(patsubst %.S,%.o, $(SSRC))
+
+CSRC := ptrace.c brk.c
+COBJ := $(patsubst %.c,%.o, $(CSRC))
+
+OBJS := $(SOBJ) $(COBJ)
+
+OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
+
+all: $(OBJ_LIST) $(CTOR_TARGETS)
+
+$(OBJ_LIST): $(OBJS) $(CRT_OBJ)
+	$(STRIPTOOL) -x -R .note -R .comment $^
+	$(INSTALL) -d $(TOPDIR)lib/
+	cp $(CRT_OBJ) $(TOPDIR)lib/
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
+
+$(CRT_OBJ): $(CRT_SRC)
+	$(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
+
+$(SOBJ): %.o : %.S
+	$(CC) $(ASFLAGS) -c $< -o $@
+
+$(COBJ): %.o : %.c
+	$(CC) $(CFLAGS) -c $< -o $@
+
+ifeq ($(UCLIBC_CTOR_DTOR),y)
+$(TOPDIR)lib/crti.o: crti.S
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
+
+$(TOPDIR)lib/crtn.o: crtn.S
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
+else
+$(CTOR_TARGETS):
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(AR) $(ARFLAGS) $@
+endif
+
+headers:
+
+clean:
+	$(RM) *.o *~ core
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/h8300/__longjmp.S
new file mode 100644
index 0000000..5cffa3e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/__longjmp.S
@@ -0,0 +1,22 @@
+#ifdef __H8300S__
+	.h8300s
+#else
+	.h8300h
+#endif
+	.text
+	
+.global ___longjmp
+
+___longjmp:
+	mov.l	er1,er1
+	bne	1f
+	sub.l	er1,er1
+	inc.l	#1,er1
+1:
+	mov.l	@er0+,er4
+	mov.l	@er0+,er5
+	mov.l	@er0+,er6
+	mov.l	@er0+,sp
+	mov.l	@er0+,er3	; return PC
+	adds	#4,sp		; adjust return stack
+	jmp	@er3
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/byteswap.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/byteswap.h
new file mode 100644
index 0000000..781a4db
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/byteswap.h
@@ -0,0 +1,40 @@
+/* Macros to swap the order of bytes in integer values.  H8/300 version.
+   Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _ASM_BITS_BYTESWAP_H
+#define _ASM_BITS_BYTESWAP_H 1
+
+#define __bswap_non_constant_32(x) \
+  __extension__						\
+  ({ unsigned int __v;					\
+     __asm__ __volatile__ ("mov.l %0,er0\n\t"		\
+			   "mov.b r0l,r1h\n\t"		\
+			   "mov.b r0h,r1l\n\t"		\
+			   "mov.w r1,e1\n\t"		\
+			   "mov.w e0,r0\n\t"		\
+			   "mov.b r0l,r1h\n\t"		\
+			   "mov.b r0h,r1l\n\t"		\
+			   "mov.l er1,%0"		\
+			   : "=d" (__v)			\
+			   : "0" (x): "er0","er1");	\
+     __v; })
+
+#endif
+
+#include <bits/byteswap-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/endian.h
new file mode 100644
index 0000000..383918d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/endian.h
@@ -0,0 +1,7 @@
+/* H8/300 is big-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __BIG_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/fcntl.h
new file mode 100644
index 0000000..c8aeb91
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/fcntl.h
@@ -0,0 +1,233 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   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.  */
+
+#ifndef	_FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+
+#include <sys/types.h>
+
+/* 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.	*/
+#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_XOPEN2K
+# 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]FL.  */
+#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/h8300/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/kernel_stat.h
new file mode 100644
index 0000000..5f6c8ae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/kernel_stat.h
@@ -0,0 +1,50 @@
+#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 {
+	unsigned short st_dev;
+	unsigned short __pad1;
+	unsigned long st_ino;
+	unsigned short st_mode;
+	unsigned short st_nlink;
+	unsigned short st_uid;
+	unsigned short st_gid;
+	unsigned short st_rdev;
+	unsigned short __pad2;
+	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	__pad1[2];
+#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 short	st_rdev;
+	unsigned char	__pad3[10];
+	long long	st_size;
+	unsigned long	st_blksize;
+	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
+	unsigned long	__pad4;		/* future possible st_blocks high bits */
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned long long	st_ino;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/kernel_types.h
new file mode 100644
index 0000000..4cfd1bf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/kernel_types.h
@@ -0,0 +1,46 @@
+#ifndef _BITS_KERNEL_TYPES_H
+#define _BITS_KERNEL_TYPES_H
+
+/* Sigh.  We need to carefully wrap this one...  No guarantees
+ * that the asm/posix_types.h kernel header is working.  Many
+ * arches have broken headers that introduce tons of gratuitous
+ * conflicts with uClibc's namespace.   See bits/kernel_types.h
+ * for i386, arm, etc for examples... */
+
+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 /* _BITS_KERNEL_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/setjmp.h
new file mode 100644
index 0000000..15f8d84
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/setjmp.h
@@ -0,0 +1,32 @@
+
+/* Copyright (C) 2004, Yoshinori Sato <ysato@users.sourceforge.jp> */
+/* Define the machine-dependent type `jmp_buf'.  H8/300 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
+
+typedef struct
+  {
+    unsigned long __regs[4];  /* save er4 - er7(sp) */
+    unsigned long __pc;       /* the return address */
+  } __jmp_buf[1];
+
+#endif /* _ASM */
+
+#define JB_REGS   0
+#define JB_PC     16
+#define JB_SIZE   20
+
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)->__regs[3])
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/sigcontextinfo.h
new file mode 100644
index 0000000..b7e08cf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/sigcontextinfo.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>, 1998.
+
+   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 SIGCONTEXT int _code, struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS _code,
+#define GET_PC(ctx)	((void *) (ctx)->sc_pc)
+#define GET_FRAME(ctx)	((void *) __builtin_frame_address (1))
+#define GET_STACK(ctx)	((void *) (ctx)->sc_usp)
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/stackinfo.h
new file mode 100644
index 0000000..89a77d9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On h8300 the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/syscalls.h
new file mode 100644
index 0000000..5867ed6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/syscalls.h
@@ -0,0 +1,151 @@
+/* Unlike the asm/unistd.h kernel header file (which this is partly based on),
+ * this file must be able to cope with PIC and non-PIC code.  For some arches
+ * there is no difference.  For x86 (which has far too few registers) there is
+ * a difference.   Regardless, including asm/unistd.h is hereby officially
+ * forbidden.  Don't do it.  It is bad for you.
+ */
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#define __syscall_return(type, res) \
+do { \
+	if ((unsigned long)(res) >= (unsigned long)(-125)) { \
+	/* avoid using res which is declared to be in register d0; \
+	   errno might expand to a function call and clobber it.  */ \
+		int __err = -(res); \
+		errno = __err; \
+		res = -1; \
+	} \
+	return (type) (res); \
+} while (0)
+
+#define _syscall0(type, name)							\
+type name(void)									\
+{										\
+  register long __res __asm__("er0");						\
+  __asm__ __volatile__ ("mov.l	%1,er0\n\t"					\
+  			"trapa	#0\n\t"						\
+			: "=r" (__res)						\
+			: "ir" (__NR_##name)					\
+			: "cc");						\
+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {			\
+    errno = -__res;								\
+    __res = -1;									\
+  }										\
+  return (type)__res;								\
+}
+
+#define _syscall1(type, name, atype, a)						\
+type name(atype a)								\
+{										\
+  register long __res __asm__("er0");						\
+  __asm__ __volatile__ ("mov.l	%2, er1\n\t"					\
+  			"mov.l	%1, er0\n\t"					\
+  			"trapa	#0\n\t"						\
+			: "=r" (__res)						\
+			: "ir" (__NR_##name),					\
+			  "g" ((long)a)						\
+			: "cc", "er1");					\
+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {			\
+    errno = -__res;								\
+    __res = -1;									\
+  }										\
+  return (type)__res;								\
+}
+
+#define _syscall2(type, name, atype, a, btype, b)				\
+type name(atype a, btype b)							\
+{										\
+  register long __res __asm__("er0");						\
+  __asm__ __volatile__ ("mov.l	%3, er2\n\t"					\
+  			"mov.l	%2, er1\n\t"					\
+			"mov.l	%1, er0\n\t"					\
+  			"trapa	#0\n\t"						\
+			: "=r" (__res)						\
+			: "ir" (__NR_##name),					\
+			  "g" ((long)a),					\
+			  "g" ((long)b)						\
+			: "cc", "er1", "er2"); 				\
+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {			\
+    errno = -__res;								\
+    __res = -1;									\
+  }										\
+  return (type)__res;								\
+}
+
+#define _syscall3(type, name, atype, a, btype, b, ctype, c)			\
+type name(atype a, btype b, ctype c)						\
+{										\
+  register long __res __asm__("er0");						\
+  __asm__ __volatile__ ("mov.l	%4, er3\n\t"					\
+			"mov.l	%3, er2\n\t"					\
+  			"mov.l	%2, er1\n\t"					\
+			"mov.l	%1, er0\n\t"					\
+  			"trapa	#0\n\t"						\
+			: "=r" (__res)						\
+			: "ir" (__NR_##name),					\
+			  "g" ((long)a),					\
+			  "g" ((long)b),					\
+			  "g" ((long)c)						\
+			: "cc", "er1", "er2", "er3");  			\
+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {			\
+    errno = -__res;								\
+    __res = -1;									\
+  }										\
+  return (type)__res;								\
+}
+
+#define _syscall4(type, name, atype, a, btype, b, ctype, c, dtype, d)		\
+type name(atype a, btype b, ctype c, dtype d)					\
+{										\
+  register long __res __asm__("er0");						\
+  __asm__ __volatile__ ("mov.l	%5, er4\n\t"					\
+			"mov.l	%4, er3\n\t"					\
+			"mov.l	%3, er2\n\t"					\
+  			"mov.l	%2, er1\n\t"					\
+			"mov.l	%1, er0\n\t"					\
+  			"trapa	#0\n\t"						\
+			: "=r" (__res)						\
+			: "ir" (__NR_##name),					\
+			  "g" ((long)a),					\
+			  "g" ((long)b),					\
+			  "g" ((long)c),					\
+			  "g" ((long)d)						\
+			: "cc", "er1", "er2", "er3", "er4");			\
+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {			\
+    errno = -__res;								\
+    __res = -1;									\
+  }										\
+  return (type)__res;								\
+}
+
+#define _syscall5(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e)	\
+type name(atype a, btype b, ctype c, dtype d, etype e)				\
+{										\
+  register long __res __asm__("er0");						\
+  __asm__ __volatile__ ( \
+                        "mov.l  er5,@-sp\n\t"                                   \
+			"mov.l	%5, er4\n\t"					\
+			"mov.l	%4, er3\n\t"					\
+			"mov.l	%3, er2\n\t"					\
+  			"mov.l	%2, er1\n\t"					\
+			"mov.l	%1, er0\n\t"					\
+			"mov.l	%6, er5\n\t"					\
+  			"trapa	#0\n\t"						\
+                       "mov.l  @sp+,er5\n\t"                                   \
+			: "=r" (__res)						\
+			: "ir" (__NR_##name),					\
+			  "g" ((long)a),					\
+			  "g" ((long)b),					\
+			  "g" ((long)c),					\
+			  "g" ((long)d),					\
+			  "m" ((long)e)						\
+			: "cc", "er1", "er2", "er3", "er4");		        \
+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {		       	\
+    errno = -__res;								\
+    __res = -1;									\
+  }										\
+  return (type)__res;								\
+}
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..4bab547
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h
@@ -0,0 +1,48 @@
+/*
+ * 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__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/h8300/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/wordsize.h
new file mode 100644
index 0000000..b47eee9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bits/wordsize.h
@@ -0,0 +1 @@
+#define __WORDSIZE 32
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/brk.c b/ap/build/uClibc/libc/sysdeps/linux/h8300/brk.c
new file mode 100644
index 0000000..b337813
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/brk.c
@@ -0,0 +1,37 @@
+/* brk on H8/300 by ysato */
+/*
+ * 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 <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;
+
+    __asm__ ("mov.l %2,er1\n\t"
+	 "mov.l %1,er0\n\t"
+	 "trapa #0\n\t"
+	 "mov.l er0,%0"
+	 : "=r" (newbrk)
+	 : "0" (__NR_brk), "g" (addr)
+	 : "er0","er1");
+
+    __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/h8300/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/h8300/bsd-_setjmp.S
new file mode 100644
index 0000000..e315058
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bsd-_setjmp.S
@@ -0,0 +1,27 @@
+/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'.  H8/300 version. */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+#ifdef __H8300S__
+	.h8300s
+#else
+	.h8300h
+#endif
+	.text
+	
+.global __setjmp
+
+__setjmp:
+	add.l	#JB_SIZE,er0
+	mov.l	@sp,er1		; return PC
+	mov.l	er1,@-er0
+	mov.l	sp,@-er0
+	mov.l	er6,@-er0
+	mov.l	er5,@-er0
+	mov.l	er4,@-er0
+	mov.l	er0,er1
+	sub.l	er0,er0
+	mov.l	er0,@(JB_SIZE:16,er1)
+	rts
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/h8300/bsd-setjmp.S
new file mode 100644
index 0000000..9c35355
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/bsd-setjmp.S
@@ -0,0 +1,30 @@
+/* BSD `_setjmp' entry point to `sigsetjmp (..., 1)'.  H8/300 version. */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+#ifdef __H8300S__
+	.h8300s
+#else
+	.h8300h
+#endif
+	.text
+	
+.global _setjmp
+
+_setjmp:
+	add.l	#JB_SIZE,er0
+	mov.l	@sp,er1		; return PC
+	mov.l	er1,@-er0
+	mov.l	sp,@-er0
+	mov.l	er6,@-er0
+	mov.l	er5,@-er0
+	mov.l	er4,@-er0
+	sub.l	er0,er0
+#if !defined(__PIC__)
+	jmp	@___sigjmp_save
+#else
+	mov.l	@(___sigjmp_save@GOTOFF,er5),er1
+	jmp	@er3
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/clone.S b/ap/build/uClibc/libc/sysdeps/linux/h8300/clone.S
new file mode 100644
index 0000000..554a297
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/clone.S
@@ -0,0 +1,68 @@
+/* Adapted from glibc */
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. */
+
+/* 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 <bits/errno.h>
+#include <sys/syscall.h>
+
+/* int _clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
+
+#ifdef __H8300H__
+	.h8300h
+#endif
+#ifdef __H8300S__
+	.h8300s
+#endif
+
+.text
+.globl	_clone
+_clone:
+	/* Sanity check arguments.  */
+	mov.l	#-EINVAL,er3
+	mov.l	er0,er0			/* no NULL function pointers */
+	beq	__syscall_error
+	mov.l	er1,er1			/* no NULL stack pointers */
+	beq	__syscall_error
+
+	/* Allocate space and copy the argument onto the new stack.  */
+	mov.l	@(4:16,sp),er3
+	mov.l	er3,@-er1
+
+	/* Do the system call */
+	mov.l	er0,er3			/* er3 = child entry */
+	mov.l	er1,er0
+	mov.l	er2,er1			/* er1 = flags */
+	mov.l	er0,er2			/* er2 = child sp */
+	mov.l	#__NR_clone,r0
+	trapa	#0
+	mov.l	er0,er0
+	bmi	__syscall_error
+	beq	thread_start
+
+	rts
+
+__syscall_error:
+	neg.l	er0
+	mov.l	er0,@-sp
+#if !defined(__PIC__)
+	jsr	@__errno_location
+#else
+	mov.l	@(__errno_location@GOTOFF,er5),er1
+	jsr	@er1
+#endif
+	mov.l	@sp,er1
+	mov.l	er1,@er0
+	sub.l	er0,er0
+	dec.l	#1,er0
+
+	rts
+
+thread_start:
+	mov.l	@sp+,er0		/* restore args */
+	jsr     @er3
+	mov.l	er0,er1
+	mov.l	#__NR_exit,er0
+	trapa	#0
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/crt0.S b/ap/build/uClibc/libc/sysdeps/linux/h8300/crt0.S
new file mode 100644
index 0000000..ebdca18
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/crt0.S
@@ -0,0 +1,70 @@
+/* Copyright (C) 1991, 1992 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 Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#include <features.h>
+
+	.global	_start
+	.global __exit
+	.global atexit
+	.global main
+
+#ifdef __H8300S__
+	.h8300s
+#else
+	.h8300h
+#endif
+	.text
+
+_start: /* put here so that references to _start work with elf-PIC */
+
+	mov.l	@(0,sp),er0	/* argc */
+	mov.l	@(4,sp),er1	/* argv */
+	mov.l	@(8,sp),er2	/* envp */
+#if !defined(__PIC__)
+	jsr	@___uClibc_main
+#else
+	mov.l	@(___uClibc_main@GOTOFF,er5),er3
+	jsr	@er3
+#endif
+
+	/* If that didn't kill us, ... */
+__exit:
+	mov.l	er0,er1
+	sub.l	er0,er0
+	inc.l	#1,er0		 /* __NR_exit */
+	trapa	#0
+
+/*
+ *	this was needed for gcc/g++-builds,  atexit was not getting included
+ *	for some stupid reason,  this gets us a compiler
+ */
+empty_func:
+	rts
+	.weak atexit
+	atexit = empty_func
+
+
+/* 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/h8300/crti.S b/ap/build/uClibc/libc/sysdeps/linux/h8300/crti.S
new file mode 100644
index 0000000..270df27
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/crti.S
@@ -0,0 +1,30 @@
+#ifdef __H8300H__
+	.h8300h
+#endif
+#ifdef __H8300S__
+	.h8300s
+#endif
+	.file	"initfini.c"
+; #APP
+
+	.section .init
+; #NO_APP
+	.align 1
+	.global __init
+__init:
+	mov.l	er6,@-er7
+	mov.l	er7,er6
+; #APP
+	.align 1
+
+	.section .fini
+; #NO_APP
+	.align 1
+	.global __fini
+__fini:
+	mov.l	er6,@-er7
+	mov.l	er7,er6
+; #APP
+	.align 1
+
+	.end
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/h8300/crtn.S
new file mode 100644
index 0000000..8f9fa1f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/crtn.S
@@ -0,0 +1,28 @@
+#ifdef __H8300H__
+	.h8300h
+#endif
+#ifdef __H8300S__
+	.h8300s
+#endif
+	.file	"initfini.c"
+; #APP
+
+	.section .init
+; #NO_APP
+	.align 1
+	.global __init
+; #NO_APP
+	mov.l	@er7+,er6
+	rts
+; #APP
+
+	.section .fini
+; #NO_APP
+	.align 1
+	.global __fini
+; #NO_APP
+	mov.l	@er7+,er6
+	rts
+; #APP
+
+	.end
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/float.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/float.h
new file mode 100644
index 0000000..7dbe4e9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/float.h
@@ -0,0 +1,96 @@
+/* float.h for target with IEEE 32 bit and 64 bit floating point formats */
+#ifndef _FLOAT_H_
+#define _FLOAT_H_
+/* Produced by enquire version 4.3, CWI, Amsterdam */
+
+   /* Radix of exponent representation */
+#undef FLT_RADIX
+#define FLT_RADIX 2
+   /* Number of base-FLT_RADIX digits in the significand of a float */
+#undef FLT_MANT_DIG
+#define FLT_MANT_DIG 24
+   /* Number of decimal digits of precision in a float */
+#undef FLT_DIG
+#define FLT_DIG 6
+   /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */
+#undef FLT_ROUNDS
+#define FLT_ROUNDS 1
+   /* Difference between 1.0 and the minimum float greater than 1.0 */
+#undef FLT_EPSILON
+#define FLT_EPSILON 1.19209290e-07F
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
+#undef FLT_MIN_EXP
+#define FLT_MIN_EXP (-125)
+   /* Minimum normalised float */
+#undef FLT_MIN
+#define FLT_MIN 1.17549435e-38F
+   /* Minimum int x such that 10**x is a normalised float */
+#undef FLT_MIN_10_EXP
+#define FLT_MIN_10_EXP (-37)
+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
+#undef FLT_MAX_EXP
+#define FLT_MAX_EXP 128
+   /* Maximum float */
+#undef FLT_MAX
+#define FLT_MAX 3.40282347e+38F
+   /* Maximum int x such that 10**x is a representable float */
+#undef FLT_MAX_10_EXP
+#define FLT_MAX_10_EXP 38
+
+   /* Number of base-FLT_RADIX digits in the significand of a double */
+#undef DBL_MANT_DIG
+#define DBL_MANT_DIG 53
+   /* Number of decimal digits of precision in a double */
+#undef DBL_DIG
+#define DBL_DIG 15
+   /* Difference between 1.0 and the minimum double greater than 1.0 */
+#undef DBL_EPSILON
+#define DBL_EPSILON 2.2204460492503131e-16
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
+#undef DBL_MIN_EXP
+#define DBL_MIN_EXP (-1021)
+   /* Minimum normalised double */
+#undef DBL_MIN
+#define DBL_MIN 2.2250738585072014e-308
+   /* Minimum int x such that 10**x is a normalised double */
+#undef DBL_MIN_10_EXP
+#define DBL_MIN_10_EXP (-307)
+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
+#undef DBL_MAX_EXP
+#define DBL_MAX_EXP 1024
+   /* Maximum double */
+#undef DBL_MAX
+#define DBL_MAX 1.7976931348623157e+308
+   /* Maximum int x such that 10**x is a representable double */
+#undef DBL_MAX_10_EXP
+#define DBL_MAX_10_EXP 308
+
+   /* Number of base-FLT_RADIX digits in the significand of a long double */
+#undef LDBL_MANT_DIG
+#define LDBL_MANT_DIG 53
+   /* Number of decimal digits of precision in a long double */
+#undef LDBL_DIG
+#define LDBL_DIG 15
+   /* Difference between 1.0 and the minimum long double greater than 1.0 */
+#undef LDBL_EPSILON
+#define LDBL_EPSILON 2.2204460492503131e-16L
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
+#undef LDBL_MIN_EXP
+#define LDBL_MIN_EXP (-1021)
+   /* Minimum normalised long double */
+#undef LDBL_MIN
+#define LDBL_MIN 2.2250738585072014e-308L
+   /* Minimum int x such that 10**x is a normalised long double */
+#undef LDBL_MIN_10_EXP
+#define LDBL_MIN_10_EXP (-307)
+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */
+#undef LDBL_MAX_EXP
+#define LDBL_MAX_EXP 1024
+   /* Maximum long double */
+#undef LDBL_MAX
+#define LDBL_MAX 1.7976931348623157e+308L
+   /* Maximum int x such that 10**x is a representable long double */
+#undef LDBL_MAX_10_EXP
+#define LDBL_MAX_10_EXP 308
+
+#endif /*  _FLOAT_H_ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/ptrace.c b/ap/build/uClibc/libc/sysdeps/linux/h8300/ptrace.c
new file mode 100644
index 0000000..1dd7d06
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/ptrace.c
@@ -0,0 +1,36 @@
+
+#include <errno.h>
+#include <asm/ptrace.h>
+#include <asm/unistd.h>
+
+int
+ptrace(int request, int pid, int addr, int data)
+{
+	int ret;
+	int res;
+
+	if (request > 0 && request < 4) data = (int)&ret;
+
+	__asm__ __volatile__ ("sub.l er0,er0\n\t"
+                          "mov.b %1,r0l\n\t"
+			  "mov.l %2,er1\n\t"
+			  "mov.l %3,er2\n\t"
+			  "mov.l %4,er3\n\t"
+			  "mov.l %5,er4\n\t"
+			  "trapa  #0\n\t"
+			  "mov.l er0,%0"
+		:"=g" (res)
+		:"i" (__NR_ptrace), "g" (request), "g" (pid),
+		 "g" (addr), "g" (data)
+		: "er0", "er1", "er2", "er3", "er4");
+
+	if (res >= 0) {
+		if (request > 0 && request < 4) {
+			__set_errno(0);
+			return (ret);
+		}
+		return (int) res;
+	}
+	__set_errno(-res);
+	return -1;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/h8300/setjmp.S
new file mode 100644
index 0000000..5e48767
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/setjmp.S
@@ -0,0 +1,23 @@
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+#ifdef __H8300S__
+	.h8300s
+#else
+	.h8300h
+#endif
+	.text
+
+.global ___sigsetjmp
+
+___sigsetjmp:
+	add.l	#JB_SIZE,er0
+	mov.l	@sp,er1		; return PC
+	mov.l	er1,@-er0
+	mov.l	sp,@-er0
+	mov.l	er6,@-er0
+	mov.l	er5,@-er0
+	mov.l	er4,@-er0
+	sub.l	er0,er0
+	rts
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/sys/procfs.h
new file mode 100644
index 0000000..27abf8e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/sys/procfs.h
@@ -0,0 +1,126 @@
+/* Copyright (C) 1996, 1997, 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_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_struct' 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_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers.  */
+typedef struct user_m68kfp_struct 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/h8300/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/h8300/sys/ucontext.h
new file mode 100644
index 0000000..ffc9ea0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/sys/ucontext.h
@@ -0,0 +1,75 @@
+/* Copyright (C) 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.  */
+
+/* H8/300 compliant context switching support.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+typedef int greg_t;
+
+/* Number of general registers.  */
+#define NFPREG	8
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NFPREG];
+
+#ifdef __USE_GNU
+/* Number of each register is the `gregset_t' array.  */
+enum
+{
+  ER0 = 0,
+#define ER0	ER0
+  ER1 = 1,
+#define ER1	ER1
+  ER2 = 2,
+#define ER2	ER2
+  ER3 = 3,
+#define ER3	ER3
+  ER4 = 4,
+#define ER4	ER4
+  ER5 = 5,
+#define ER5	ER5
+  ER6 = 6,
+#define ER6	ER6
+  ER7 = 7,
+#define ER7	ER7
+};
+#endif
+
+/* Context to describe whole processor state.  */
+typedef struct
+  {
+    gregset_t gregs;
+  } mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/h8300/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/h8300/vfork.S
new file mode 100644
index 0000000..35c04e5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/h8300/vfork.S
@@ -0,0 +1,41 @@
+
+#include <asm/unistd.h>
+
+#ifndef __NR_vfork
+#define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
+#endif
+
+#ifdef __H8300S__
+	.h8300s
+#else
+	.h8300h
+#endif
+	.text
+	.align 2
+	.globl	_errno
+	.globl	___vfork
+	.hidden	___vfork
+	.type	___vfork,@function
+___vfork:
+	mov.l	@sp+, er1
+	sub.l	er0,er0
+	mov.b	#__NR_vfork,r0l
+	trapa	#0
+	mov.l	#-4096, er2
+	cmp.l 	er0,er2
+	bcs     fix_errno
+	jmp	@er1                     /* don't return,  just jmp directly */
+fix_errno:
+	neg.l	er0
+#if !defined(__PIC__)
+	mov.l	er0,@_errno
+#else
+	mov.l	@(_errno@GOTOFF,er5),er2
+	mov.l	er0,@er2
+#endif
+	sub.l	er0,er0
+	dec.l	#1,er0
+	jmp	@er1                     /* don't return,  just jmp directly */
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/Makefile b/ap/build/uClibc/libc/sysdeps/linux/hppa/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/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/hppa/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/hppa/Makefile.arch
new file mode 100644
index 0000000..2b0cf09
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/Makefile.arch
@@ -0,0 +1,11 @@
+# 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 := __syscall_error.c brk.c mmap.c syscall.c
+
+SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S \
+	add_n.s lshift.s rshift.s sub_n.s udiv_qrnnd.s
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/hppa/__longjmp.S
new file mode 100644
index 0000000..750863e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/__longjmp.S
@@ -0,0 +1,74 @@
+/* longjmp for PA-RISC.
+   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>
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+/* __longjmp(jmpbuf, val) */
+
+	.text
+	.align 4
+	.globl __longjmp
+	.export __longjmp, code
+	.proc
+	.callinfo
+__longjmp:	
+	/* set return value */
+	copy	%r25, %r28
+	
+	ldw	0(%r26), %r3
+	ldw	8(%r26), %r4
+	ldw	12(%r26), %r5
+	ldw	16(%r26), %r6
+	ldw	20(%r26), %r7
+	ldw	24(%r26), %r8
+	ldw	28(%r26), %r9
+	ldw	32(%r26), %r10
+	ldw	36(%r26), %r11
+	ldw	40(%r26), %r12
+	ldw	44(%r26), %r13
+	ldw	48(%r26), %r14
+	ldw	52(%r26), %r15
+	ldw	56(%r26), %r16
+	ldw	60(%r26), %r17
+	ldw	64(%r26), %r18
+	ldw	68(%r26), %r19
+	ldw	72(%r26), %r27
+	ldw	76(%r26), %r30
+	
+	ldw	80(%r26), %rp
+
+	ldo	88(%r26),%r20
+	fldds,ma 8(%r20), %fr12
+	fldds,ma 8(%r20), %fr13
+	fldds,ma 8(%r20), %fr14
+	fldds,ma 8(%r20), %fr15
+	fldds,ma 8(%r20), %fr16
+	fldds,ma 8(%r20), %fr17
+	fldds,ma 8(%r20), %fr18
+	fldds,ma 8(%r20), %fr19
+	fldds,ma 8(%r20), %fr20
+	fldds	 0(%r20), %fr21
+
+	bv,n	%r0(%r2)
+	.procend
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/__syscall_error.c b/ap/build/uClibc/libc/sysdeps/linux/hppa/__syscall_error.c
new file mode 100644
index 0000000..5e109a8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/__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/hppa/add_n.s b/ap/build/uClibc/libc/sysdeps/linux/hppa/add_n.s
new file mode 100644
index 0000000..a396b34
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/add_n.s
@@ -0,0 +1,58 @@
+;! HP-PA  __mpn_add_n -- Add two limb vectors of the same length > 0 and store
+;! sum in a third limb vector.
+
+;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+
+;! This file is part of the GNU MP Library.
+
+;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  If not, write to
+;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+;! MA 02111-1307, USA.
+
+
+;! INPUT PARAMETERS
+;! res_ptr	gr26
+;! s1_ptr	gr25
+;! s2_ptr	gr24
+;! size		gr23
+
+;! One might want to unroll this as for other processors, but it turns
+;! out that the data cache contention after a store makes such
+;! unrolling useless.  We can't come under 5 cycles/limb anyway.
+
+	.text
+	.export		__mpn_add_n
+__mpn_add_n:
+	.proc
+	.callinfo	frame=0,no_calls
+	.entry
+
+	ldws,ma		4(%r25),%r21
+	ldws,ma		4(%r24),%r20
+
+	addib,=		-1,%r23,L$end	;! check for (SIZE == 1)
+	 add		%r21,%r20,%r28	;! add first limbs ignoring cy
+
+L$loop:	ldws,ma		4(%r25),%r21
+	ldws,ma		4(%r24),%r20
+	stws,ma		%r28,4(%r26)
+	addib,<>	-1,%r23,L$loop
+	 addc		%r21,%r20,%r28
+
+L$end:	stws		%r28,0(%r26)
+	bv		0(%r2)
+	 addc		%r0,%r0,%r28
+
+	.exit
+	.procend
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/atomic.h
new file mode 100644
index 0000000..87aeb84
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/atomic.h
@@ -0,0 +1,103 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Carlos O'Donell <carlos@baldric.uwo.ca>, 2005.
+
+   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 <stdint.h>
+#include <bits/kernel-features.h>
+
+#define ABORT_INSTRUCTION __asm__(__UCLIBC_ABORT_INSTRUCTION__)
+
+/* We need EFAULT, ENOSYS */
+#if !defined EFAULT && !defined ENOSYS
+#define EFAULT	14
+#define ENOSYS	251
+#endif
+
+#ifndef _BITS_ATOMIC_H
+#define _BITS_ATOMIC_H	1
+
+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;
+
+/* prev = *addr;
+   if (prev == old)
+     *addr = new;
+   return prev; */
+
+/* Use the kernel atomic light weight syscalls on hppa */ 
+#define LWS "0xb0"
+#define LWS_CAS "0"
+/* Note r31 is the link register */
+#define LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory"
+#define ASM_EAGAIN "11" 
+
+#if __ASSUME_LWS_CAS
+/* The only basic operation needed is compare and exchange.  */
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) 	\
+  ({									\
+     volatile int lws_errno = EFAULT;					\
+     volatile int lws_ret = 0xdeadbeef;					\
+     __asm__ volatile(							\
+	"0:					\n\t"			\
+	"copy	%3, %%r26			\n\t"			\
+	"copy	%4, %%r25			\n\t"			\
+	"copy	%5, %%r24			\n\t"			\
+	"ble	" LWS "(%%sr2, %%r0)		\n\t"			\
+	"ldi	" LWS_CAS ", %%r20		\n\t"			\
+	"cmpib,=,n " ASM_EAGAIN ",%%r21,0b	\n\t"			\
+	"nop					\n\t"			\
+	"stw	%%r28, %0			\n\t"			\
+        "sub	%%r0, %%r21, %%r21		\n\t"			\
+	"stw	%%r21, %1			\n\t"			\
+	: "=m" (lws_ret), "=m" (lws_errno), "=m" (*mem)			\
+        : "r" (mem), "r" (oldval), "r" (newval)				\
+	: LWS_CLOBBER							\
+     );									\
+    									\
+     if(lws_errno == EFAULT || lws_errno == ENOSYS)			\
+     	ABORT_INSTRUCTION;						\
+    									\
+     lws_ret;								\
+   })
+
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) 	\
+  ({									\
+     int ret;								\
+     ret = atomic_compare_and_exchange_val_acq(mem, newval, oldval);	\
+     /* Return 1 if it was already acquired */				\
+     (ret != oldval);							\
+   })
+#else
+# error __ASSUME_LWS_CAS is required to build uClibc.
+#endif	
+/* __ASSUME_LWS_CAS */
+
+#endif
+/* _BITS_ATOMIC_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/endian.h
new file mode 100644
index 0000000..585db0c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/endian.h
@@ -0,0 +1,7 @@
+/* hppa1.1 big-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __BIG_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/fcntl.h
new file mode 100644
index 0000000..86e3b6f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/fcntl.h
@@ -0,0 +1,229 @@
+/* O_*, F_*, FD_* bit values for Linux/HPPA.
+   Copyright (C) 1995,1996,1997,1998,1999,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 _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_RDONLY	00000000
+#define O_WRONLY	00000001
+#define O_RDWR		00000002
+#define O_ACCMODE	00000003
+#define O_APPEND	00000010
+#define O_BLKSEEK	00000100 /* HPUX only */
+#define O_CREAT		00000400 /* not fcntl */
+#define O_TRUNC		00001000 /* not fcntl */
+#define O_EXCL		00002000 /* not fcntl */
+#define O_ASYNC		00020000
+#define O_SYNC		00100000
+#define O_NONBLOCK	00200004 /* HPUX has separate NDELAY & NONBLOCK */
+#define O_NDELAY	O_NONBLOCK
+#define O_NOCTTY	00400000 /* not fcntl */
+
+
+#ifdef __USE_GNU
+# define O_DIRECT	00040000 /* Direct disk access. */
+# define O_DIRECTORY	00010000 /* Must be a directory. */
+# define O_NOFOLLOW	00000200 /* Do not follow links. */
+# define O_NOATIME	04000000 /* Do not set atime. */
+# define O_CLOEXEC	010000000 /* set close_on_exec */
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE	00004000
+#endif
+
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC		01000000 /* HPUX only */
+# define O_RSYNC		02000000 /* HPUX only */
+#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	8	/* Get record locking info.  */
+#define F_SETLK64	9	/* Set record locking info (non-blocking).  */
+#define F_SETLKW64	10	/* Set record locking info (blocking).  */
+
+#if defined __USE_BSD || defined __USE_UNIX98
+# define F_GETOWN	11	/* Get owner of socket (receiver of SIGIO).  */
+# define F_SETOWN	12	/* Set owner of socket (receiver of SIGIO).  */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG	13	/* Set number of signal to be sent.  */
+# define F_GETSIG	14	/* 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]FL */
+#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		1	/* Read lock.  */
+#define F_WRLCK		2	/* Write lock.  */
+#define F_UNLCK		3	/* 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
+/* 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/hppa/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/fenv.h
new file mode 100644
index 0000000..c5f8c43
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/fenv.h
@@ -0,0 +1,78 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>
+
+   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
+
+/* Define bits representing the exception.  We use the values of the
+   appropriate enable bits in the FPU status word (which,
+   coincidentally, are the same as the flag bits, but shifted right by
+   27 bits).  */
+enum
+{
+  FE_INVALID   = 1<<4, /* V */
+#define FE_INVALID	FE_INVALID
+  FE_DIVBYZERO = 1<<3, /* Z */
+#define FE_DIVBYZERO	FE_DIVBYZERO
+  FE_OVERFLOW  = 1<<2, /* O */
+#define FE_OVERFLOW	FE_OVERFLOW
+  FE_UNDERFLOW = 1<<1, /* U */
+#define FE_UNDERFLOW	FE_UNDERFLOW
+  FE_INEXACT   = 1<<0, /* I */
+#define FE_INEXACT	FE_INEXACT
+};
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The PA-RISC FPU supports all of the four defined rounding modes.
+   We use the values of the RM field in the floating point status
+   register for the appropriate macros.  */
+enum
+  {
+    FE_TONEAREST  = 0 << 9,
+#define FE_TONEAREST	FE_TONEAREST
+    FE_TOWARDZERO = 1 << 9,
+#define FE_TOWARDZERO	FE_TOWARDZERO
+    FE_UPWARD     = 2 << 9,
+#define FE_UPWARD	FE_UPWARD
+    FE_DOWNWARD   = 3 << 9,
+#define FE_DOWNWARD	FE_DOWNWARD
+  };
+
+/* Type representing exception flags. */
+typedef unsigned int fexcept_t;
+
+/* Type representing floating-point environment.  This structure
+   corresponds to the layout of the status and exception words in the
+   register file. */
+typedef struct
+{
+  unsigned int __status_word;
+  unsigned int __exception[7];
+} fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV ((fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exceptions are masked.  */
+# define FE_NOMASK_ENV	((fenv_t *) -2)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/ipc.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/ipc.h
new file mode 100644
index 0000000..d80cf06
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/ipc.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 1995-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.  */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#ifdef __USE_GNU
+# define IPC_INFO	3		/* See ipcs.  */
+#endif
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;			/* Key.  */
+    __uid_t uid;			/* Owner's user ID.  */
+    __gid_t gid;			/* Owner's group ID.  */
+    __uid_t cuid;			/* Creator's user ID.  */
+    __gid_t cgid;			/* Creator's group ID.  */
+#if __WORDSIZE == 32
+    unsigned short int __pad1;
+    unsigned short int mode;		/* Read/write permission.  */
+    unsigned short int __pad2;
+#else
+    __mode_t mode;			/* Read/write permission.  */
+    unsigned short int __pad2;
+#endif
+    unsigned short int __seq;		/* Sequence number.  */
+    unsigned int __pad3;
+    unsigned long long int __unused1;
+    unsigned long long int __unused2;
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/kernel_sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/kernel_sigaction.h
new file mode 100644
index 0000000..1c093a5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/kernel_sigaction.h
@@ -0,0 +1,23 @@
+#ifndef _BITS_SIGACTION_STRUCT_H
+#define _BITS_SIGACTION_STRUCT_H
+
+/* We have a separate header file here because we do not support
+   SA_RESTORER on hppa. */
+
+/* This is the sigaction struction from the Linux 2.1.20 kernel.  */
+/* Blah.  This is bogus.  We don't ever use it. */
+struct old_kernel_sigaction {
+	__sighandler_t k_sa_handler;
+	unsigned long sa_mask;
+	unsigned long sa_flags;
+};
+
+/* In uclibc, userspace struct sigaction is identical to
+ * "new" struct kernel_sigaction (one from the Linux 2.1.68 kernel).
+ * See sigaction.h
+ */
+
+extern int __syscall_rt_sigaction (int, const struct sigaction *,
+	struct sigaction *, size_t) attribute_hidden;
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/kernel_stat.h
new file mode 100644
index 0000000..097abfb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/kernel_stat.h
@@ -0,0 +1,60 @@
+/* Ripped from linux/include/asm-parisc/stat.h
+ * and renamed 'struct stat' to 'struct kernel_stat' */
+
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+struct kernel_stat {
+	unsigned int	st_dev;		/* dev_t is 32 bits on parisc */
+	ino_t		st_ino;		/* 32 bits */
+	mode_t		st_mode;	/* 16 bits */
+	nlink_t		st_nlink;	/* 16 bits */
+	unsigned short	st_reserved1;	/* old st_uid */
+	unsigned short	st_reserved2;	/* old st_gid */
+	unsigned int	st_rdev;
+	off_t		st_size;
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	int		st_blksize;
+	int		st_blocks;
+	unsigned int	__unused1;	/* ACL stuff */
+	unsigned int	__unused2;	/* network */
+	ino_t		__unused3;	/* network */
+	unsigned int	__unused4;	/* cnodes */
+	unsigned short	__unused5;	/* netsite */
+	short		st_fstype;
+	unsigned int	st_realdev;
+	unsigned short	st_basemode;
+	unsigned short	st_spareshort;
+	uid_t		st_uid;
+	gid_t		st_gid;
+	unsigned int	st_spare4[3];
+};
+
+/* This is the struct that 32-bit userspace applications are expecting.
+ * How 64-bit apps are going to be compiled, I have no idea.  But at least
+ * this way, we don't have a wrapper in the kernel.
+ */
+struct kernel_stat64 {
+	unsigned long long	st_dev;
+	unsigned int		__pad1;
+
+	unsigned int		__st_ino;	/* Not actually filled in */
+	unsigned int		st_mode;
+	unsigned int		st_nlink;
+	unsigned int		st_uid;
+	unsigned int		st_gid;
+	unsigned long long	st_rdev;
+	unsigned int		__pad2;
+	signed long long	st_size;
+	signed int		st_blksize;
+
+	signed long long	st_blocks;
+	struct timespec		st_atim;
+	struct timespec		st_mtim;
+	struct timespec		st_ctim;
+	unsigned long long	st_ino;
+};
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/kernel_types.h
new file mode 100644
index 0000000..6b2e794
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/kernel_types.h
@@ -0,0 +1,63 @@
+/* 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_PARISC_POSIX_TYPES_H
+#define __ARCH_PARISC_POSIX_TYPES_H
+
+typedef unsigned long		__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 int		__kernel_uid_t;
+typedef unsigned int		__kernel_gid_t;
+typedef int			__kernel_suseconds_t;
+typedef long			__kernel_clock_t;
+typedef int			__kernel_timer_t;
+typedef int			__kernel_clockid_t;
+typedef int			__kernel_daddr_t;
+/* Note these change from narrow to wide kernels */
+#ifdef __LP64__
+typedef unsigned long		__kernel_size_t;
+typedef long			__kernel_ssize_t;
+typedef long			__kernel_ptrdiff_t;
+typedef long			__kernel_time_t;
+#else
+typedef unsigned int		__kernel_size_t;
+typedef int			__kernel_ssize_t;
+typedef int			__kernel_ptrdiff_t;
+typedef long			__kernel_time_t;
+#endif
+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 long long		__kernel_loff_t;
+typedef long long		__kernel_off64_t;
+typedef unsigned long long	__kernel_ino64_t;
+
+typedef unsigned int		__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;
+
+/* compatibility stuff */
+typedef __kernel_uid_t __kernel_old_uid_t;
+typedef __kernel_gid_t __kernel_old_gid_t;
+
+#endif /* __ARCH_PARISC_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/mman.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/mman.h
new file mode 100644
index 0000000..7f9bf4e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/mman.h
@@ -0,0 +1,94 @@
+/* Definitions for POSIX memory map interface.  Linux/HPPA version.
+   Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* these are basically taken from the kernel definitions */
+
+#define PROT_READ	0x1		/* page can be read */
+#define PROT_WRITE	0x2		/* page can be written */
+#define PROT_EXEC	0x4		/* page can be executed */
+#define PROT_NONE	0x0		/* page can not be accessed */
+#define PROT_GROWSDOWN	0x01000000	/* Extend change to start of
+					   growsdown vma (mprotect only).  */
+#define PROT_GROWSUP	0x02000000	/* Extend change to start of
+					   growsup vma (mprotect only).  */
+
+#define MAP_SHARED	0x01		/* Share changes */
+#define MAP_PRIVATE	0x02		/* Changes are private */
+#define MAP_TYPE	0x03		/* Mask for type of mapping */
+#define MAP_FIXED	0x04		/* Interpret addr exactly */
+#define MAP_ANONYMOUS	0x10		/* don't use a file */
+
+#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
+#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
+#define MAP_LOCKED	0x2000		/* pages are locked */
+#define MAP_NORESERVE	0x4000		/* don't check for reservations */
+#define MAP_GROWSDOWN	0x8000		/* stack-like segment */
+#define MAP_POPULATE	0x10000		/* populate (prefault) pagetables */
+#define MAP_NONBLOCK	0x20000		/* do not block on IO */
+#define MAP_UNINITIALIZE 0x4000000     /* For anonymous mmap, memory could
+					  be uninitialized. */
+
+#define MS_SYNC		1		/* synchronous memory sync */
+#define MS_ASYNC	2		/* sync memory asynchronously */
+#define MS_INVALIDATE	4		/* invalidate the caches */
+
+#define MCL_CURRENT	1		/* lock all current mappings */
+#define MCL_FUTURE	2		/* lock all future mappings */
+
+/* Advice to "madvise" */
+#ifdef __USE_BSD
+# define MADV_NORMAL	  0	/* no further special treatment */
+# define MADV_RANDOM	  1	/* expect random page references */
+# define MADV_SEQUENTIAL  2	/* expect sequential page references */
+# define MADV_WILLNEED	  3	/* will need these pages */
+# define MADV_DONTNEED	  4	/* dont need these pages */
+# define MADV_SPACEAVAIL  5	/* insure that resources are reserved */
+# define MADV_VPS_PURGE	  6	/* Purge pages from VM page cache */
+# define MADV_VPS_INHERIT 7	/* Inherit parents page size */
+# define MADV_REMOVE	  9	/* Remove these pages and resources.  */
+# define MADV_DONTFORK	 10	/* Do not inherit across fork.  */
+# define MADV_DOFORK	 11	/* Do inherit across fork.  */
+#endif
+
+/* The range 12-64 is reserved for page size specification. */
+#define MADV_4K_PAGES   12              /* Use 4K pages  */
+#define MADV_16K_PAGES  14              /* Use 16K pages */
+#define MADV_64K_PAGES  16              /* Use 64K pages */
+#define MADV_256K_PAGES 18              /* Use 256K pages */
+#define MADV_1M_PAGES   20              /* Use 1 Megabyte pages */
+#define MADV_4M_PAGES   22              /* Use 4 Megabyte pages */
+#define MADV_16M_PAGES  24              /* Use 16 Megabyte pages */
+#define MADV_64M_PAGES  26              /* Use 64 Megabyte pages */
+
+/* compatibility flags */
+#define MAP_ANON	MAP_ANONYMOUS
+#define MAP_FILE	0
+#define MAP_VARIABLE	0
+
+/* Flags for `mremap'.  */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE 1
+# define MREMAP_FIXED	2
+#endif
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/setjmp.h
new file mode 100644
index 0000000..4395b8f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/setjmp.h
@@ -0,0 +1,45 @@
+/* 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.  */
+
+/* Define the machine-dependent type `jmp_buf'.  HPPA 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
+
+/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
+   We use an array of 'double' instead, to make writing the assembler
+   easier, and to ensure proper alignment. Naturally, user code should
+   not depend on either representation. */
+
+#if defined __USE_MISC || defined _ASM
+#define JB_SP (76/4)
+#endif
+
+#ifndef	_ASM
+typedef double __jmp_buf[21];
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame containing a local
+   variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(_jmpbuf, _address)				\
+     ((void *)(_address) > (void *)(((unsigned long *) _jmpbuf)[JB_SP]))
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/sigaction.h
new file mode 100644
index 0000000..3dac69e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/sigaction.h
@@ -0,0 +1,66 @@
+/* Definitions for Linux/HPPA sigaction.
+   Copyright (C) 1996, 1997, 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 _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives.  */
+struct sigaction {
+#ifdef __USE_POSIX199309
+	union {
+		__sighandler_t sa_handler;
+		void (*sa_sigaction)(int, siginfo_t *, void *);
+	} __sigaction_handler;
+# define sa_handler     __sigaction_handler.sa_handler
+# define sa_sigaction   __sigaction_handler.sa_sigaction
+#else
+	__sighandler_t  sa_handler;
+#endif
+	unsigned long   sa_flags;
+	sigset_t        sa_mask;
+	/* HPPA has no sa_restorer field.  */
+};
+
+/* Bits in `sa_flags'.  */
+
+#define SA_NOCLDSTOP  0x00000008  /* Don't send SIGCHLD when children stop.  */
+#define SA_NOCLDWAIT  0x00000080  /* Don't create zombie on child death.  */
+#define SA_SIGINFO    0x00000010  /* Invoke signal-catching function with
+				     three arguments instead of one.  */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK   0x00000001 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESETHAND 0x00000004 /* Reset to SIG_DFL on entry to handler.  */
+# define SA_NODEFER   0x00000020 /* Don't automatically block the signal
+				    when its handler is being executed.  */
+# define SA_RESTART   0x00000040 /* Restart syscall on signal return.  */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historic no-op.  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
+# define SA_STACK     SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'.  */
+#define SIG_BLOCK          0	/* for blocking signals */
+#define SIG_UNBLOCK        1	/* for unblocking signals */
+#define SIG_SETMASK        2	/* for setting the signal mask */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/signum.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/signum.h
new file mode 100644
index 0000000..d1d0f38
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/signum.h
@@ -0,0 +1,62 @@
+/* Signal number definitions.  Linux/HPPA version.
+   Copyright (C) 1995,1996,1997,1998,1999,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.  */
+
+#ifdef	_SIGNAL_H
+
+#define	SIGHUP		1	/* Hangup (POSIX).  */
+#define	SIGINT		2	/* Interrupt (ANSI).  */
+#define	SIGQUIT		3	/* Quit (POSIX).  */
+#define	SIGILL		4	/* Illegal instruction (ANSI).  */
+#define	SIGTRAP		5	/* Trace trap (POSIX).  */
+#define	SIGABRT		6	/* Abort (ANSI).  */
+#define	SIGIOT		6	/* IOT trap (4.2 BSD).  */
+#define	SIGEMT		7
+#define	SIGFPE		8	/* Floating-point exception (ANSI).  */
+#define	SIGKILL		9	/* Kill, unblockable (POSIX).  */
+#define	SIGBUS		10	/* BUS error (4.2 BSD).  */
+#define	SIGSEGV		11	/* Segmentation violation (ANSI).  */
+#define SIGSYS		12	/* Bad system call.  */
+#define	SIGPIPE		13	/* Broken pipe (POSIX).  */
+#define	SIGALRM		14	/* Alarm clock (POSIX).  */
+#define	SIGTERM		15	/* Termination (ANSI).  */
+#define	SIGUSR1		16	/* User-defined signal 1 (POSIX).  */
+#define SIGUSR2		17	/* User-defined signal 2 (POSIX).  */
+#define	SIGCLD		SIGCHLD	/* Same as SIGCHLD (System V).  */
+#define	SIGCHLD		18	/* Child status has changed (POSIX).  */
+#define	SIGPWR		19	/* Power failure restart (System V).  */
+#define	SIGVTALRM	20	/* Virtual alarm clock (4.2 BSD).  */
+#define	SIGPROF		21	/* Profiling alarm clock (4.2 BSD).  */
+#define	SIGPOLL		SIGIO	/* Pollable event occurred (System V).  */
+#define	SIGIO		22	/* I/O now possible (4.2 BSD).  */
+#define	SIGWINCH	23	/* Window size change (4.3 BSD, Sun).  */
+#define	SIGSTOP		24	/* Stop, unblockable (POSIX).  */
+#define	SIGTSTP		25	/* Keyboard stop (POSIX).  */
+#define	SIGCONT		26	/* Continue (POSIX).  */
+#define	SIGTTIN		27	/* Background read from tty (POSIX).  */
+#define	SIGTTOU		28	/* Background write to tty (POSIX).  */
+#define	SIGURG		29	/* Urgent condition on socket (4.2 BSD).  */
+#define SIGLOST		30	/* Operating System Has Lost (HP/UX). */
+#define SIGUNUSED	31
+#define	SIGXCPU		33	/* CPU limit exceeded (4.2 BSD).  */
+#define	SIGXFSZ		34	/* File size limit exceeded (4.2 BSD).  */
+#define	SIGSTKFLT	36	/* Stack fault.  */
+
+#define __SIGRTMIN	37
+
+#endif	/* <signal.h> included.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/stackinfo.h
new file mode 100644
index 0000000..318de71
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On PA the stack grows up.  */
+#define _STACK_GROWS_UP	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/syscalls.h
new file mode 100644
index 0000000..fddad62
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/syscalls.h
@@ -0,0 +1,100 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+/* Assume all syscalls are done from PIC code just to be
+ * safe. The worst case scenario is that you lose a register
+ * and save/restore r19 across the syscall. */
+#define PIC
+
+/* Definition taken from glibc 2.3.3
+ * sysdeps/unix/sysv/linux/hppa/sysdep.h
+ */
+
+#ifdef PIC
+/* WARNING: CANNOT BE USED IN A NOP! */
+# define K_STW_ASM_PIC	"       copy %%r19, %%r4\n"
+# define K_LDW_ASM_PIC	"       copy %%r4, %%r19\n"
+# define K_USING_GR4	"%r4",
+#else
+# define K_STW_ASM_PIC	" \n"
+# define K_LDW_ASM_PIC	" \n"
+# define K_USING_GR4
+#endif
+
+/* GCC has to be warned that a syscall may clobber all the ABI
+   registers listed as "caller-saves", see page 8, Table 2
+   in section 2.2.6 of the PA-RISC RUN-TIME architecture
+   document. However! r28 is the result and will conflict with
+   the clobber list so it is left out. Also the input arguments
+   registers r20 -> r26 will conflict with the list so they
+   are treated specially. Although r19 is clobbered by the syscall
+   we cannot say this because it would violate ABI, thus we say
+   r4 is clobbered and use that register to save/restore r19
+   across the syscall. */
+
+#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
+			 "%r20", "%r29", "%r31"
+
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\
+(__extension__ \
+ ({	\
+	register unsigned long __res __asm__("r28");		\
+	K_LOAD_ARGS_##nr(args)					\
+	/* FIXME: HACK stw/ldw r19 around syscall */		\
+	__asm__ __volatile__(					\
+		K_STW_ASM_PIC					\
+		"	ble  0x100(%%sr2, %%r0)\n"		\
+		"	ldi %1, %%r20\n"			\
+		K_LDW_ASM_PIC					\
+		: "=r" (__res)					\
+		: "i" (name) K_ASM_ARGS_##nr			\
+		: "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr	\
+	);							\
+	__res;							\
+  }) \
+)
+#define K_LOAD_ARGS_0()
+#define K_LOAD_ARGS_1(r26)					\
+	register unsigned long __r26 __asm__("r26") = (unsigned long)(r26);   \
+	K_LOAD_ARGS_0()
+#define K_LOAD_ARGS_2(r26,r25)					\
+	register unsigned long __r25 __asm__("r25") = (unsigned long)(r25);   \
+	K_LOAD_ARGS_1(r26)
+#define K_LOAD_ARGS_3(r26,r25,r24)				\
+	register unsigned long __r24 __asm__("r24") = (unsigned long)(r24);   \
+	K_LOAD_ARGS_2(r26,r25)
+#define K_LOAD_ARGS_4(r26,r25,r24,r23)				\
+	register unsigned long __r23 __asm__("r23") = (unsigned long)(r23);   \
+	K_LOAD_ARGS_3(r26,r25,r24)
+#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22)			\
+	register unsigned long __r22 __asm__("r22") = (unsigned long)(r22);   \
+	K_LOAD_ARGS_4(r26,r25,r24,r23)
+#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21)			\
+	register unsigned long __r21 __asm__("r21") = (unsigned long)(r21);   \
+	K_LOAD_ARGS_5(r26,r25,r24,r23,r22)
+
+/* Even with zero args we use r20 for the syscall number */
+#define K_ASM_ARGS_0
+#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26)
+#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25)
+#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24)
+#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23)
+#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22)
+#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21)
+
+/* The registers not listed as inputs but clobbered */
+#define K_CLOB_ARGS_6
+#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21"
+#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22"
+#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23"
+#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24"
+#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
+#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..722447d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h
@@ -0,0 +1,47 @@
+/*
+ * 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__ "iitlbp %r0,(%sr0,%r0)"
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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__
+
+/* the default ; is a comment on hppa */
+#define __UCLIBC_ASM_LINE_SEP__ !
+
+#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/wordsize.h
new file mode 100644
index 0000000..951e838
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bits/wordsize.h
@@ -0,0 +1,7 @@
+/* Determine the wordsize from the preprocessor defines.  */
+
+#ifdef __LP64__
+# define __WORDSIZE	64
+#else
+# define __WORDSIZE	32
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/brk.c b/ap/build/uClibc/libc/sysdeps/linux/hppa/brk.c
new file mode 100644
index 0000000..10e1fc8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/brk.c
@@ -0,0 +1,42 @@
+/* brk system call for Linux/HPPA.
+   Copyright (C) 1995, 1996, 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.  */
+
+#include <errno.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+/* This must be initialized data because commons can't have aliases.  */
+void *__curbrk attribute_hidden = 0;
+
+int
+brk (void *addr)
+{
+  void *newbrk;
+
+  __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr);
+
+  if (newbrk < addr)
+    {
+      __set_errno (ENOMEM);
+      return -1;
+    }
+
+  return 0;
+}
+libc_hidden_def(brk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/hppa/bsd-_setjmp.S
new file mode 100644
index 0000000..30e53f5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bsd-_setjmp.S
@@ -0,0 +1,36 @@
+/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'.  HPPA version.
+   Copyright (C) 2001, 2002 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 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.  */
+
+	.text
+	.align 4
+	.globl _setjmp
+	.export _setjmp, code
+	.level 2.0
+	.proc
+	.callinfo
+	.import __sigsetjmp
+_setjmp:
+	b	__sigsetjmp
+	ldi	0, %r25
+
+	.procend
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/hppa/bsd-setjmp.S
new file mode 100644
index 0000000..04ddba4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/bsd-setjmp.S
@@ -0,0 +1,36 @@
+/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'.  HPPA version.
+   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 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.  */
+
+	.text
+	.align 4
+	.globl setjmp
+	.export setjmp, code
+	.level 2.0
+	.proc
+	.callinfo
+	.import __sigsetjmp
+setjmp:
+	b	__sigsetjmp
+	ldi	1, %r25
+
+	.procend
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/clone.S b/ap/build/uClibc/libc/sysdeps/linux/hppa/clone.S
new file mode 100644
index 0000000..b8e354c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/clone.S
@@ -0,0 +1,135 @@
+/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Huggins-Daines <dhd@debian.org>, 2000.
+   Based on the Alpha version by Richard Henderson <rth@tamu.edu>, 1996.
+
+   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.  */
+
+#include <asm/unistd.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+/* Non-thread code calls __clone with the following parameters:
+   int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg)
+   
+   NPTL Code will call __clone with the following parameters:
+   int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
+	     int *parent_tidptr, struct user_desc *newtls, int *child_pidptr)
+	
+   The code should not mangle the extra input registers.
+   Syscall expects:				Input to __clone:
+	4(r25) - function pointer 		(r26, arg0) 
+	0(r25) - argument			(r23, arg3)
+	r26 - clone flags.			(r24, arg2)
+	r25+64 - user stack pointer.		(r25, arg1)
+	r24 - parent tid pointer.		(stack - 52)
+	r23 - struct user_desc newtls pointer.	(stack - 56)
+	r22 - child tid pointer.		(stack - 60)
+	r20 - clone syscall number		(constant)
+ */
+
+.text
+.global __clone
+.type   __clone,%function
+__clone:
+
+	/* Sanity check arguments.  */
+	ldi     -EINVAL,%ret0
+	comib,=,n  0,%arg0,.Lerror        /* no NULL function pointers */
+	comib,=,n  0,%arg1,.Lerror        /* no NULL stack pointers */
+
+	/* Save the fn ptr and arg on the new stack.  */
+	stwm    %r26,64(%r25)
+	stw	%r23,-60(%r25)
+	/* Clone arguments are (int flags, void * child_stack) */
+	copy	%r24,%r26	/* flags are first */
+	/* User stack pointer is in the correct register already */
+
+	/* Load args from stack... */
+	ldw	-52(%sp), %r24	/* Load parent_tidptr */
+	ldw	-56(%sp), %r23 	/* Load newtls */
+	ldw	-60(%sp), %r22	/* Load child_tidptr */
+
+	/* Create frame to get r3 free */
+	copy	%sp, %r21
+	stwm	%r3, 64(%sp)
+	stw	%r21, -4(%sp)
+
+	/* Save the PIC register. */
+#ifdef __PIC__
+	copy	%r19, %r3		/* parent */
+#endif
+
+	/* Do the system call */
+	ble     0x100(%sr2,%r0)
+	ldi	__NR_clone,%r20
+
+	ldi	-4096,%r1
+	comclr,>>= %r1,%ret0,%r0	/* Note: unsigned compare. */
+	b,n	.LerrorRest
+
+	comib,=,n 0,%ret0,thread_start
+
+	/* Successful return from the parent
+	   No need to restore the PIC register, 
+	   since we return immediately. */
+
+	bv	%r0(%rp)
+	ldwm	-64(%sp), %r3
+
+.LerrorRest:
+	/* Restore the PIC register on error */
+#ifdef __PIC__
+	copy	%r3, %r19		/* parent */ 
+#endif
+
+	/* Something bad happened -- no child created */
+.Lerror:
+
+	/* Set errno, save ret0 so we return with that value. */
+	copy	%ret0, %r3
+	b	__syscall_error
+	sub     %r0,%ret0,%arg0
+	copy	%r3, %ret0
+	/* Return after setting errno, and restoring ret0 */
+	bv	%r0(%rp)
+	ldwm	-64(%sp), %r3
+
+thread_start:
+
+	/* Load up the arguments.  */
+	ldw	-60(%sr0, %sp),%arg0
+	ldw     -64(%sr0, %sp),%r22
+
+	/* $$dyncall fixes childs PIC register */
+
+	/* Call the user's function */
+	bl	$$dyncall,%r31
+	copy	%r31,%rp
+
+	bl	HIDDEN_JUMPTARGET(_exit),%rp
+	copy	%ret0,%arg0
+
+	/* Die horribly.  */
+	iitlbp	%r0,(%sr0,%r0)
+
+.size clone,.-clone
+
+weak_alias (__clone, clone)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/hppa/crt1.S
new file mode 100644
index 0000000..8b42dac
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/crt1.S
@@ -0,0 +1,126 @@
+/* ELF startup code for HPPA.
+   Copyright (C) 2002 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.  */
+
+	.import main, code
+	.import $global$, data
+	.import __uClibc_main, code
+#if defined(__UCLIBC_CTOR_DTOR__)
+	.import _fini, code
+	.import _init, code
+#else
+	.weak _fini
+	.weak _init
+#endif
+
+	/* Have the linker create plabel words
+           so we get PLABEL32 relocs and not 21/14 */
+	.section	.rodata
+	.align 4
+.Lpmain:
+	.word P%main
+.Lp__uClibc_main:
+	.word P%__uClibc_main
+.Lp_fini:
+	.word P%_fini
+.Lp_init:
+	.word P%_init
+
+	.text
+	.align 4
+	.globl _start
+	.export _start, ENTRY
+	.type _start,@function
+_start:
+
+	.proc
+	.callinfo
+
+	/* Expand the stack to store the 5th through 7th args */
+	ldo	64(%sp), %sp
+	/* TODO: Follow ABI? Place more things on the stack here... */
+
+#ifdef __PIC__
+	/* load main (1st argument) */
+	addil	LR'.Lpmain, %r19
+	ldw	RR'.Lpmain(%r1), %r26
+	ldw	0(%r26),%r26
+	/* argc and argv should be in 25 and 24 (2nd and 3rd argument) */
+	/* void (*init) (void) (4th argument) */
+	addil	LR'.Lp_init, %r19
+	ldw	RR'.Lp_init(%r1), %r23
+	ldw	0(%r23), %r23
+	/* void (*fini) (void) (5th argument) */
+	addil	LR'.Lp_fini, %r19
+	ldw	RR'.Lp_fini(%r1), %r22
+	ldw	0(%r22), %r22
+#else
+	/* load main (1st argument) */
+	ldil	LR'.Lpmain, %r26
+	ldw	RR'.Lpmain(%r26), %r26
+	/* argc and argv should be in 25 and 24 (2nd and 3rd argument) */
+	/* void (*init) (void) (4th argument) */
+	ldil	LR'.Lp_init, %r23
+	ldw	RR'.Lp_init(%r23), %r23
+	/* void (*fini) (void) (5th argument) */
+	ldil	LR'.Lp_fini, %r22
+	ldw	RR'.Lp_fini(%r22), %r22
+#endif
+	/* Store 5th argument */
+	stw	%r22, -52(%sp)
+	/* void (*rtld_fini) (void) (6th argument) */
+	stw	%r23, -56(%sp)
+	/* void *stack_end (7th argument) */
+	stw	%sp, -60(%sp)
+
+	/* load global */
+	ldil	L%$global$, %dp
+	ldo	R%$global$(%dp), %dp
+
+	bl	__uClibc_main,%r2
+	nop
+	/* die horribly if it returned (it shouldn't) */
+	iitlbp %r0,(%sr0,%r0)
+	nop
+
+	.procend
+
+/* 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/hppa/crti.S b/ap/build/uClibc/libc/sysdeps/linux/hppa/crti.S
new file mode 100644
index 0000000..9a37c71
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/crti.S
@@ -0,0 +1,24 @@
+/* glibc's sysdeps/hppa/elf/initfini.c used for reference [PROLOG] */
+
+	.section .init
+	.align 4
+	.globl _init
+	.type _init,@function
+_init:
+	stw	%rp,-20(%sp)
+	stwm	%r4,64(%sp)
+	stw	%r19,-32(%sp)
+	copy	%r19,%r4	/* delay slot */
+	copy	%r4,%r19
+
+
+
+	.section .fini
+	.align 4
+	.globl _fini
+	.type _fini,@function
+_fini:
+	stw	%rp,-20(%sp)
+	stwm	%r4,64(%sp)
+	stw	%r19,-32(%sp)
+	copy	%r19,%r4
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/hppa/crtn.S
new file mode 100644
index 0000000..6602ece
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/crtn.S
@@ -0,0 +1,34 @@
+/* glibc's sysdeps/hppa/elf/initfini.c used for reference [EPILOG] */
+
+        .text
+        .align 4
+/* Here is the tail end of _init.  We put __gmon_start before this so
+   that the assembler creates the .PARISC.unwind section for us, ie.
+   with the right attributes.  */
+	.section .init
+	ldw	-84(%sp),%rp
+	copy	%r4,%r19
+	bv	%r0(%rp)
+_end_init:
+	ldwm	-64(%sp),%r4
+
+/* Our very own unwind info, because the assembler can't handle
+   functions split into two or more pieces.  */
+	.section .PARISC.unwind
+	.extern _init
+	.word	_init, _end_init
+	.byte	0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08
+
+
+
+	.section .fini
+	ldw	-84(%sp),%rp
+	copy	%r4,%r19
+	bv	%r0(%rp)
+_end_fini:
+	ldwm	-64(%sp),%r4
+
+	.section .PARISC.unwind
+	.extern _fini
+	.word	_fini, _end_fini
+	.byte	0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/lshift.s b/ap/build/uClibc/libc/sysdeps/linux/hppa/lshift.s
new file mode 100644
index 0000000..151b283
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/lshift.s
@@ -0,0 +1,66 @@
+;! HP-PA  __mpn_lshift --
+
+;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+
+;! This file is part of the GNU MP Library.
+
+;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  If not, write to
+;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+;! MA 02111-1307, USA.
+
+
+;! INPUT PARAMETERS
+;! res_ptr	gr26
+;! s_ptr	gr25
+;! size		gr24
+;! cnt		gr23
+
+	.text
+	.export		__mpn_lshift
+__mpn_lshift:
+	.proc
+	.callinfo	frame=64,no_calls
+	.entry
+
+	sh2add		%r24,%r25,%r25
+	sh2add		%r24,%r26,%r26
+	ldws,mb		-4(%r25),%r22
+	subi		32,%r23,%r1
+	mtsar		%r1
+	addib,=		-1,%r24,L$0004
+	vshd		%r0,%r22,%r28		;! compute carry out limb
+	ldws,mb		-4(%r25),%r29
+	addib,=		-1,%r24,L$0002
+	vshd		%r22,%r29,%r20
+
+L$loop:	ldws,mb		-4(%r25),%r22
+	stws,mb		%r20,-4(%r26)
+	addib,=		-1,%r24,L$0003
+	vshd		%r29,%r22,%r20
+	ldws,mb		-4(%r25),%r29
+	stws,mb		%r20,-4(%r26)
+	addib,<>	-1,%r24,L$loop
+	vshd		%r22,%r29,%r20
+
+L$0002:	stws,mb		%r20,-4(%r26)
+	vshd		%r29,%r0,%r20
+	bv		0(%r2)
+	stw		%r20,-4(%r26)
+L$0003:	stws,mb		%r20,-4(%r26)
+L$0004:	vshd		%r22,%r0,%r20
+	bv		0(%r2)
+	stw		%r20,-4(%r26)
+
+	.exit
+	.procend
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/hppa/mmap.c
new file mode 100644
index 0000000..bb1352f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/mmap.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mmap() for uClibc/x86_64
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2005 by Mike Frysinger <vapier@gentoo.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+
+_syscall6(void *, mmap, void *, start, size_t, length, int, prot,
+          int, flags, int, fd, off_t, offset)
+libc_hidden_def(mmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/rshift.s b/ap/build/uClibc/libc/sysdeps/linux/hppa/rshift.s
new file mode 100644
index 0000000..dff189d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/rshift.s
@@ -0,0 +1,63 @@
+;! HP-PA  __mpn_rshift -- 
+
+;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+
+;! This file is part of the GNU MP Library.
+
+;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  If not, write to
+;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+;! MA 02111-1307, USA.
+
+
+;! INPUT PARAMETERS
+;! res_ptr	gr26
+;! s_ptr	gr25
+;! size		gr24
+;! cnt		gr23
+
+	.text
+	.export		__mpn_rshift
+__mpn_rshift:
+	.proc
+	.callinfo	frame=64,no_calls
+	.entry
+
+	ldws,ma		4(%r25),%r22
+	mtsar		%r23
+	addib,=		-1,%r24,L$0004
+	vshd		%r22,%r0,%r28		;! compute carry out limb
+	ldws,ma		4(%r25),%r29
+	addib,=		-1,%r24,L$0002
+	vshd		%r29,%r22,%r20
+
+L$loop:	ldws,ma		4(%r25),%r22
+	stws,ma		%r20,4(%r26)
+	addib,=		-1,%r24,L$0003
+	vshd		%r22,%r29,%r20
+	ldws,ma		4(%r25),%r29
+	stws,ma		%r20,4(%r26)
+	addib,<>	-1,%r24,L$loop
+	vshd		%r29,%r22,%r20
+
+L$0002:	stws,ma		%r20,4(%r26)
+	vshd		%r0,%r29,%r20
+	bv		0(%r2)
+	stw		%r20,0(%r26)
+L$0003:	stws,ma		%r20,4(%r26)
+L$0004:	vshd		%r0,%r22,%r20
+	bv		0(%r2)
+	stw		%r20,0(%r26)
+
+	.exit
+	.procend
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/hppa/setjmp.S
new file mode 100644
index 0000000..fdc4c42
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/setjmp.S
@@ -0,0 +1,63 @@
+/* setjmp for HPPA.
+   Copyright (C) 1995, 1996, 1997, 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.  */
+
+	.text
+	.align 4
+	.import __sigjmp_save, code
+	.globl __sigsetjmp
+	.export __sigsetjmp, code
+	.proc
+	.callinfo
+__sigsetjmp:
+	stw	%r3, 0(%r26)
+	stw	%r4, 8(%r26)
+	stw	%r5, 12(%r26)
+	stw	%r6, 16(%r26)
+	stw	%r7, 20(%r26)
+	stw	%r8, 24(%r26)
+	stw	%r9, 28(%r26)
+	stw	%r10, 32(%r26)
+	stw	%r11, 36(%r26)
+	stw	%r12, 40(%r26)
+	stw	%r13, 44(%r26)
+	stw	%r14, 48(%r26)
+	stw	%r15, 52(%r26)
+	stw	%r16, 56(%r26)
+	stw	%r17, 60(%r26)
+	stw	%r18, 64(%r26)
+	stw	%r19, 68(%r26)
+	stw	%r27, 72(%r26)
+	stw	%r30, 76(%r26)
+
+	stw	%rp, 80(%r26)
+
+	ldo	88(%r26),%r1
+	fstds,ma %fr12, 8(%r1) /* 88 */
+	fstds,ma %fr13, 8(%r1) /* 96 */
+	fstds,ma %fr14, 8(%r1) /* 104 */
+	fstds,ma %fr15, 8(%r1) /* 112 */
+	fstds,ma %fr16, 8(%r1) /* 120 */
+	fstds,ma %fr17, 8(%r1) /* 128 */
+	fstds,ma %fr18, 8(%r1) /* 136 */
+	fstds,ma %fr19, 8(%r1) /* 144 */
+	fstds,ma %fr20, 8(%r1) /* 152 */
+	fstds	 %fr21, 0(%r1) /* 160 */
+	b __sigjmp_save
+	nop
+	.procend
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/sub_n.s b/ap/build/uClibc/libc/sysdeps/linux/hppa/sub_n.s
new file mode 100644
index 0000000..7764961
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/sub_n.s
@@ -0,0 +1,59 @@
+;! HP-PA  __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+;! store difference in a third limb vector.
+
+;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+
+;! This file is part of the GNU MP Library.
+
+;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  If not, write to
+;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+;! MA 02111-1307, USA.
+
+
+;! INPUT PARAMETERS
+;! res_ptr	gr26
+;! s1_ptr	gr25
+;! s2_ptr	gr24
+;! size		gr23
+
+;! One might want to unroll this as for other processors, but it turns
+;! out that the data cache contention after a store makes such
+;! unrolling useless.  We can't come under 5 cycles/limb anyway.
+
+	.text
+	.export		__mpn_sub_n
+__mpn_sub_n:
+	.proc
+	.callinfo	frame=0,no_calls
+	.entry
+
+	ldws,ma		4(%r25),%r21
+	ldws,ma		4(%r24),%r20
+
+	addib,=		-1,%r23,L$end	;! check for (SIZE == 1)
+	 sub		%r21,%r20,%r28	;! subtract first limbs ignoring cy
+
+L$loop:	ldws,ma		4(%r25),%r21
+	ldws,ma		4(%r24),%r20
+	stws,ma		%r28,4(%r26)
+	addib,<>	-1,%r23,L$loop
+	 subb		%r21,%r20,%r28
+
+L$end:	stws		%r28,0(%r26)
+	addc		%r0,%r0,%r28
+	bv		0(%r2)
+	 subi		1,%r28,%r28
+
+	.exit
+	.procend
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/sys/procfs.h
new file mode 100644
index 0000000..2e6d109
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/sys/procfs.h
@@ -0,0 +1,113 @@
+/* Copyright (C) 1996, 1997, 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.  */
+
+#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 <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+#include <asm/elf.h>
+
+__BEGIN_DECLS
+
+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 int pr_uid;
+    unsigned 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/hppa/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/hppa/sys/ucontext.h
new file mode 100644
index 0000000..1431143
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/sys/ucontext.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 1997, 1998, 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.  */
+
+/* Don't rely on this, the interface is currently messed up and may need to
+   be broken to be fixed.  */
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+
+/* Type for general register.  */
+typedef unsigned long int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	80
+#define NFPREG	32
+
+/* Container for all general registers.  */
+typedef struct gregset
+  {
+    greg_t g_regs[32];
+    greg_t sr_regs[8];
+    greg_t cr_regs[24];
+    greg_t g_pad[16];
+  } gregset_t;
+
+/* Container for all FPU registers.  */
+typedef struct fpregset
+  {
+    double fp_dregs[32];
+  } fpregset_t;
+
+/* Context to describe whole processor state.  */
+typedef struct sigcontext mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/syscall.c b/ap/build/uClibc/libc/sysdeps/linux/hppa/syscall.c
new file mode 100644
index 0000000..cd11e08
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/syscall.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 1997, 1998, 2001, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdarg.h>
+#include <errno.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+/* HPPA implements syscall() in 'C'; the assembler version would
+   typically be in syscall.S. Also note that we have INLINE_SYSCALL,
+   INTERNAL_SYSCALL, and all the generated pure assembly syscall wrappers.
+   How often the function is used is unknown. */
+
+long int
+syscall (long int __sysno, ...)
+{
+  /* FIXME: Keep this matching INLINE_SYSCALL for hppa */
+  va_list args;
+  long int arg0, arg1, arg2, arg3, arg4, arg5;
+  long int __sys_res;
+
+  /* Load varargs */
+  va_start (args, __sysno);
+  arg0 = va_arg (args, long int);
+  arg1 = va_arg (args, long int);
+  arg2 = va_arg (args, long int);
+  arg3 = va_arg (args, long int);
+  arg4 = va_arg (args, long int);
+  arg5 = va_arg (args, long int);
+  va_end (args);
+
+  {
+    register unsigned long int __res __asm__("r28");
+    K_LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5)
+    __asm__ __volatile__ (K_STW_ASM_PIC
+		  "	ble  0x100(%%sr2, %%r0)	\n"
+		  "	copy %1, %%r20		\n"
+		  K_LDW_ASM_PIC
+		  : "=r" (__res)
+		  : "r" (__sysno) K_ASM_ARGS_6
+		  : "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_6);
+    __sys_res = __res;
+  }
+  if ((unsigned long int) __sys_res >= (unsigned long int) -4095)
+    {
+      __set_errno (-__sys_res);
+      __sys_res = -1;
+    }
+  return __sys_res;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/hppa/udiv_qrnnd.s b/ap/build/uClibc/libc/sysdeps/linux/hppa/udiv_qrnnd.s
new file mode 100644
index 0000000..8e9c07a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/hppa/udiv_qrnnd.s
@@ -0,0 +1,286 @@
+;! HP-PA  __udiv_qrnnd division support, used from longlong.h.
+;! This version runs fast on pre-PA7000 CPUs.
+
+;! Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+
+;! This file is part of the GNU MP Library.
+
+;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  If not, write to
+;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+;! MA 02111-1307, USA.
+
+
+;! INPUT PARAMETERS
+;! rem_ptr	gr26
+;! n1		gr25
+;! n0		gr24
+;! d		gr23
+
+;! The code size is a bit excessive.  We could merge the last two ds;addc
+;! sequences by simply moving the "bb,< Odd" instruction down.  The only
+;! trouble is the FFFFFFFF code that would need some hacking.
+
+	.text
+	.export		__udiv_qrnnd
+__udiv_qrnnd:
+	.proc
+	.callinfo	frame=0,no_calls
+	.entry
+
+	comb,<		%r23,%r0,L$largedivisor
+	 sub		%r0,%r23,%r1		;! clear cy as side-effect
+	ds		%r0,%r1,%r0
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r23,%r25
+	addc		%r24,%r24,%r28
+	ds		%r25,%r23,%r25
+	comclr,>=	%r25,%r0,%r0
+	addl		%r25,%r23,%r25
+	stws		%r25,0(%r26)
+	bv		0(%r2)
+	 addc		%r28,%r28,%r28
+
+L$largedivisor:
+	extru		%r24,31,1,%r20		;! r20 = n0 & 1
+	bb,<		%r23,31,L$odd
+	 extru		%r23,30,31,%r22		;! r22 = d >> 1
+	shd		%r25,%r24,1,%r24	;! r24 = new n0
+	extru		%r25,30,31,%r25		;! r25 = new n1
+	sub		%r0,%r22,%r21
+	ds		%r0,%r21,%r0
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	comclr,>=	%r25,%r0,%r0
+	addl		%r25,%r22,%r25
+	sh1addl		%r25,%r20,%r25
+	stws		%r25,0(%r26)
+	bv		0(%r2)
+	 addc		%r24,%r24,%r28
+
+L$odd:	addib,sv,n	1,%r22,L$FF..		;! r22 = (d / 2 + 1)
+	shd		%r25,%r24,1,%r24	;! r24 = new n0
+	extru		%r25,30,31,%r25		;! r25 = new n1
+	sub		%r0,%r22,%r21
+	ds		%r0,%r21,%r0
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r24
+	ds		%r25,%r22,%r25
+	addc		%r24,%r24,%r28
+	comclr,>=	%r25,%r0,%r0
+	addl		%r25,%r22,%r25
+	sh1addl		%r25,%r20,%r25
+;! We have computed (n1,,n0) / (d + 1), q' = r28, r' = r25
+	add,nuv		%r28,%r25,%r25
+	addl		%r25,%r1,%r25
+	addc		%r0,%r28,%r28
+	sub,<<		%r25,%r23,%r0
+	addl		%r25,%r1,%r25
+	stws		%r25,0(%r26)
+	bv		0(%r2)
+	 addc		%r0,%r28,%r28
+
+;! This is just a special case of the code above.
+;! We come here when d == 0xFFFFFFFF
+L$FF..:	add,uv		%r25,%r24,%r24
+	sub,<<		%r24,%r23,%r0
+	ldo		1(%r24),%r24
+	stws		%r24,0(%r26)
+	bv		0(%r2)
+	 addc		%r0,%r25,%r28
+
+	.exit
+	.procend
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/Makefile b/ap/build/uClibc/libc/sysdeps/linux/i386/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/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/i386/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/i386/Makefile.arch
new file mode 100644
index 0000000..966f8b5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/Makefile.arch
@@ -0,0 +1,17 @@
+# 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 __syscall_error.c sigaction.c
+
+SSRC := \
+	__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
+	sync_file_range.S syscall.S mmap.S mmap64.S posix_fadvise64.S
+
+
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+SSRC += vfork.S clone.S
+endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/i386/__longjmp.S
new file mode 100644
index 0000000..e2809c0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/__longjmp.S
@@ -0,0 +1,42 @@
+/* longjmp for i386.
+   Copyright (C) 1995, 1996, 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <features.h>
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+.global __longjmp
+.type   __longjmp,%function
+__longjmp:
+	movl 4(%esp), %ecx	/* User's jmp_buf in %ecx.  */
+	movl 8(%esp), %eax	/* Second argument is return value.  */
+	/* Save the return address now.  */
+	movl (JB_PC*4)(%ecx), %edx
+	/* Restore registers.  */
+	movl (JB_BX*4)(%ecx), %ebx
+	movl (JB_SI*4)(%ecx), %esi
+	movl (JB_DI*4)(%ecx), %edi
+	movl (JB_BP*4)(%ecx), %ebp
+	movl (JB_SP*4)(%ecx), %esp
+	/* Jump to saved PC.  */
+	jmp *%edx
+.size __longjmp,.-__longjmp
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/__syscall_error.c b/ap/build/uClibc/libc/sysdeps/linux/i386/__syscall_error.c
new file mode 100644
index 0000000..36946bc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/__syscall_error.c
@@ -0,0 +1,35 @@
+/* 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.
+ */
+
+/* This routine is jumped to by all the syscall handlers, to stash
+ * an error number into errno.  */
+
+/* This version uses a lot of magic and relies heavily on x86
+ * calling convention ... The advantage is that this is the same
+ * size as the previous __syscall_error() but all the .S functions
+ * need just one instruction.
+ *
+ * Local .S files have to set %eax to the negative errno value
+ * and then jump to this function.  The neglected return to caller
+ * and return value of -1 is taken care of here so we don't have to
+ * worry about it in the .S functions.
+ *
+ * We have to stash the errno from %eax in a local stack var because
+ * __set_errno will prob call a function thus clobbering %eax on us.
+ */
+
+#include <errno.h>
+#include <features.h>
+
+int __syscall_error(void) attribute_hidden;
+int __syscall_error(void)
+{
+	register int eax __asm__ ("%eax");
+	int _errno = -eax;
+	__set_errno (_errno);
+	return -1;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/atomic.h
new file mode 100644
index 0000000..c838978
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/atomic.h
@@ -0,0 +1,369 @@
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   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 <stdint.h>
+
+#if defined __CONFIG_GENERIC_I386__ || defined __CONFIG_I386__
+# warning this file is only good for 486 or better
+#endif
+
+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 int16_t atomic16_t;
+typedef uint16_t uatomic16_t;
+typedef int_fast16_t atomic_fast16_t;
+typedef uint_fast16_t uatomic_fast16_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 int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+typedef int_fast64_t atomic_fast64_t;
+typedef uint_fast64_t uatomic_fast64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+
+#ifndef LOCK_PREFIX
+# ifdef UP
+#  define LOCK_PREFIX	/* nothing */
+# else
+#  define LOCK_PREFIX "lock;"
+# endif
+#endif
+
+
+#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
+  ({ __typeof (*mem) ret;						      \
+     __asm__ __volatile__ (LOCK_PREFIX "cmpxchgb %b2, %1"		      \
+		       : "=a" (ret), "=m" (*mem)			      \
+		       : "q" (newval), "m" (*mem), "0" (oldval));	      \
+     ret; })
+
+#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
+  ({ __typeof (*mem) ret;						      \
+     __asm__ __volatile__ (LOCK_PREFIX "cmpxchgw %w2, %1"		      \
+		       : "=a" (ret), "=m" (*mem)			      \
+		       : "r" (newval), "m" (*mem), "0" (oldval));	      \
+     ret; })
+
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+  ({ __typeof (*mem) ret;						      \
+     __asm__ __volatile__ (LOCK_PREFIX "cmpxchgl %2, %1"		      \
+		       : "=a" (ret), "=m" (*mem)			      \
+		       : "r" (newval), "m" (*mem), "0" (oldval));	      \
+     ret; })
+
+/* XXX We do not really need 64-bit compare-and-exchange.  At least
+   not in the moment.  Using it would mean causing portability
+   problems since not many other 32-bit architectures have support for
+   such an operation.  So don't define any code for now.  If it is
+   really going to be used the code below can be used on Intel Pentium
+   and later, but NOT on i486.  */
+#if 1
+# define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+  ({ __typeof (*mem) ret = *(mem); abort (); ret = (newval); ret = (oldval); })
+#else
+# ifdef __PIC__
+#  define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+  ({ __typeof (*mem) ret;						      \
+     __asm__ __volatile__ ("xchgl %2, %%ebx\n\t"			      \
+		       LOCK_PREFIX "cmpxchg8b %1\n\t"			      \
+		       "xchgl %2, %%ebx"				      \
+		       : "=A" (ret), "=m" (*mem)			      \
+		       : "DS" (((unsigned long long int) (newval))	      \
+			       & 0xffffffff),				      \
+			 "c" (((unsigned long long int) (newval)) >> 32),     \
+			 "m" (*mem), "a" (((unsigned long long int) (oldval)) \
+					  & 0xffffffff),		      \
+			 "d" (((unsigned long long int) (oldval)) >> 32));    \
+     ret; })
+# else
+#  define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+  ({ __typeof (*mem) ret;						      \
+     __asm__ __volatile__ (LOCK_PREFIX "cmpxchg8b %1"			      \
+		       : "=A" (ret), "=m" (*mem)			      \
+		       : "b" (((unsigned long long int) (newval))	      \
+			      & 0xffffffff),				      \
+			 "c" (((unsigned long long int) (newval)) >> 32),     \
+			 "m" (*mem), "a" (((unsigned long long int) (oldval)) \
+					  & 0xffffffff),		      \
+			 "d" (((unsigned long long int) (oldval)) >> 32));    \
+     ret; })
+# endif
+#endif
+
+
+/* Note that we need no lock prefix.  */
+#define atomic_exchange_acq(mem, newvalue) \
+  ({ __typeof (*mem) result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ ("xchgb %b0, %1"				      \
+			 : "=r" (result), "=m" (*mem)			      \
+			 : "0" (newvalue), "m" (*mem));			      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ ("xchgw %w0, %1"				      \
+			 : "=r" (result), "=m" (*mem)			      \
+			 : "0" (newvalue), "m" (*mem));			      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ ("xchgl %0, %1"				      \
+			 : "=r" (result), "=m" (*mem)			      \
+			 : "0" (newvalue), "m" (*mem));			      \
+     else								      \
+       {								      \
+	 result = 0;							      \
+	 abort ();							      \
+       }								      \
+     result; })
+
+
+#define atomic_exchange_and_add(mem, value) \
+  ({ __typeof (*mem) __result;						      \
+     __typeof (value) __addval = (value);				      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "xaddb %b0, %1"		      \
+			 : "=r" (__result), "=m" (*mem)			      \
+			 : "0" (__addval), "m" (*mem));			      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "xaddw %w0, %1"		      \
+			 : "=r" (__result), "=m" (*mem)			      \
+			 : "0" (__addval), "m" (*mem));			      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "xaddl %0, %1"			      \
+			 : "=r" (__result), "=m" (*mem)			      \
+			 : "0" (__addval), "m" (*mem));			      \
+     else								      \
+       {								      \
+	 __typeof (mem) __memp = (mem);					      \
+	 __typeof (*mem) __tmpval;					      \
+	 __result = *__memp;						      \
+	 do								      \
+	   __tmpval = __result;						      \
+	 while ((__result = __arch_compare_and_exchange_val_64_acq	      \
+		 (__memp, __result + __addval, __result)) == __tmpval);	      \
+       }								      \
+     __result; })
+
+
+#define atomic_add(mem, value) \
+  (void) ({ if (__builtin_constant_p (value) && (value) == 1)		      \
+	      atomic_increment (mem);					      \
+	    else if (__builtin_constant_p (value) && (value) == -1)	      \
+	      atomic_decrement (mem);					      \
+	    else if (sizeof (*mem) == 1)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "addb %b1, %0"		      \
+				: "=m" (*mem)				      \
+				: "ir" (value), "m" (*mem));		      \
+	    else if (sizeof (*mem) == 2)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "addw %w1, %0"		      \
+				: "=m" (*mem)				      \
+				: "ir" (value), "m" (*mem));		      \
+	    else if (sizeof (*mem) == 4)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "addl %1, %0"		      \
+				: "=m" (*mem)				      \
+				: "ir" (value), "m" (*mem));		      \
+	    else							      \
+	      {								      \
+		__typeof (value) __addval = (value);			      \
+		__typeof (mem) __memp = (mem);				      \
+		__typeof (*mem) __oldval = *__memp;			      \
+		__typeof (*mem) __tmpval;				      \
+		do							      \
+		  __tmpval = __oldval;					      \
+		while ((__oldval = __arch_compare_and_exchange_val_64_acq     \
+		       (__memp, __oldval + __addval, __oldval)) == __tmpval); \
+	      }								      \
+	    })
+
+
+#define atomic_add_negative(mem, value) \
+  ({ unsigned char __result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "addb %b2, %0; sets %1"	      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "iq" (value), "m" (*mem));			      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "addw %w2, %0; sets %1"	      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" (value), "m" (*mem));			      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "addl %2, %0; sets %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" (value), "m" (*mem));			      \
+     else								      \
+       abort ();							      \
+     __result; })
+
+
+#define atomic_add_zero(mem, value) \
+  ({ unsigned char __result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "addb %b2, %0; setz %1"	      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" (value), "m" (*mem));			      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "addw %w2, %0; setz %1"	      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" (value), "m" (*mem));			      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "addl %2, %0; setz %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" (value), "m" (*mem));			      \
+     else								      \
+       abort ();							      \
+     __result; })
+
+
+#define atomic_increment(mem) \
+  (void) ({ if (sizeof (*mem) == 1)					      \
+	      __asm__ __volatile__ (LOCK_PREFIX "incb %b0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else if (sizeof (*mem) == 2)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "incw %w0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else if (sizeof (*mem) == 4)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "incl %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else							      \
+	      {								      \
+		__typeof (mem) __memp = (mem);				      \
+		__typeof (*mem) __oldval = *__memp;			      \
+		__typeof (*mem) __tmpval;				      \
+		do							      \
+		  __tmpval = __oldval;					      \
+		while ((__oldval = __arch_compare_and_exchange_val_64_acq     \
+		       (__memp, __oldval + 1, __oldval)) == __tmpval);	      \
+	      }								      \
+	    })
+
+
+#define atomic_increment_and_test(mem) \
+  ({ unsigned char __result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "incb %0; sete %b1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "incw %0; sete %w1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "incl %0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else								      \
+       abort ();							      \
+     __result; })
+
+
+#define atomic_decrement(mem) \
+  (void) ({ if (sizeof (*mem) == 1)					      \
+	      __asm__ __volatile__ (LOCK_PREFIX "decb %b0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else if (sizeof (*mem) == 2)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "decw %w0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else if (sizeof (*mem) == 4)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "decl %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else							      \
+	      {								      \
+		__typeof (mem) __memp = (mem);				      \
+		__typeof (*mem) __oldval = *__memp;			      \
+		__typeof (*mem) __tmpval;				      \
+		do							      \
+		  __tmpval = __oldval;					      \
+		while ((__oldval = __arch_compare_and_exchange_val_64_acq     \
+		       (__memp, __oldval - 1, __oldval)) == __tmpval);        \
+	      }								      \
+	    })
+
+
+#define atomic_decrement_and_test(mem) \
+  ({ unsigned char __result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "decb %b0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "decw %w0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "decl %0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else								      \
+       abort ();							      \
+     __result; })
+
+
+#define atomic_bit_set(mem, bit) \
+  (void) ({ if (sizeof (*mem) == 1)					      \
+	      __asm__ __volatile__ (LOCK_PREFIX "orb %b2, %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem), "ir" (1 << (bit)));	      \
+	    else if (sizeof (*mem) == 2)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "orw %w2, %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem), "ir" (1 << (bit)));	      \
+	    else if (sizeof (*mem) == 4)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "orl %2, %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem), "ir" (1 << (bit)));	      \
+	    else							      \
+	      abort ();							      \
+	    })
+
+
+#define atomic_bit_test_set(mem, bit) \
+  ({ unsigned char __result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "btsb %3, %1; setc %0"		      \
+			 : "=q" (__result), "=m" (*mem)			      \
+			 : "m" (*mem), "ir" (bit));			      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "btsw %3, %1; setc %0"		      \
+			 : "=q" (__result), "=m" (*mem)			      \
+			 : "m" (*mem), "ir" (bit));			      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "btsl %3, %1; setc %0"		      \
+			 : "=q" (__result), "=m" (*mem)			      \
+			 : "m" (*mem), "ir" (bit));			      \
+     else								      \
+       abort ();							      \
+     __result; })
+
+
+#define atomic_delay() __asm__ ("rep; nop")
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/byteswap.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/byteswap.h
new file mode 100644
index 0000000..052eda3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/byteswap.h
@@ -0,0 +1,56 @@
+/* Macros to swap the order of bytes in integer values.
+   Copyright (C) 1997, 1998, 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.  */
+
+#ifndef _ASM_BITS_BYTESWAP_H
+#define _ASM_BITS_BYTESWAP_H 1
+
+#define __bswap_non_constant_16(x) \
+     (__extension__							      \
+      ({ register unsigned short int __v;				      \
+	 __asm__ ("rorw $8, %w0"					      \
+		  : "=r" (__v)						      \
+		  : "0" (x)						      \
+		  : "cc");						      \
+	 __v; }))
+
+/* To swap the bytes in a word the i486 processors and up provide the
+   `bswap' opcode.  On i386 we have to use three instructions.  */
+#if !defined __i486__ && !defined __pentium__ && !defined __pentiumpro__ \
+      && !defined __pentium4__
+# define __bswap_non_constant_32(x) \
+     (__extension__							      \
+      ({ register unsigned int __v;					      \
+	 __asm__ ("rorw $8, %w0;"					      \
+		  "rorl $16, %0;"					      \
+		  "rorw $8, %w0"					      \
+		  : "=r" (__v)						      \
+		  : "0" (x)						      \
+		  : "cc");						      \
+	 __v; }))
+#else
+# define __bswap_non_constant_32(x) \
+     (__extension__							      \
+      ({ register unsigned int __v;					      \
+	 __asm__ ("bswap %0" : "=r" (__v) : "0" (x));			      \
+	 __v; }))
+#endif
+
+#endif
+
+#include <bits/byteswap-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/endian.h
new file mode 100644
index 0000000..54bd9d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/endian.h
@@ -0,0 +1,7 @@
+/* i386 is little-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/fcntl.h
new file mode 100644
index 0000000..22e073b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/fcntl.h
@@ -0,0 +1,239 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995, 1996, 1997, 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_DIRECT	 040000	/* Direct disk access.	*/
+# define O_DIRECTORY	0200000	/* Must be a directory.	 */
+# define O_NOFOLLOW	0400000	/* Do not follow links.	 */
+# define O_NOATIME     01000000 /* Do not set atime.  */
+# define O_CLOEXEC     02000000 /* Set close_on_exec.  */
+#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	0100000
+#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/i386/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/fenv.h
new file mode 100644
index 0000000..ef3fcb3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/fenv.h
@@ -0,0 +1,90 @@
+/* Copyright (C) 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.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Define bits representing the exception.  We use the bit positions
+   of the appropriate bits in the FPU control word.  */
+enum
+  {
+    FE_INVALID = 0x01,
+#define FE_INVALID	FE_INVALID
+    __FE_DENORM = 0x02,
+    FE_DIVBYZERO = 0x04,
+#define FE_DIVBYZERO	FE_DIVBYZERO
+    FE_OVERFLOW = 0x08,
+#define FE_OVERFLOW	FE_OVERFLOW
+    FE_UNDERFLOW = 0x10,
+#define FE_UNDERFLOW	FE_UNDERFLOW
+    FE_INEXACT = 0x20
+#define FE_INEXACT	FE_INEXACT
+  };
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The ix87 FPU supports all of the four defined rounding modes.  We
+   use again the bit positions in the FPU control word as the values
+   for the appropriate macros.  */
+enum
+  {
+    FE_TONEAREST = 0,
+#define FE_TONEAREST	FE_TONEAREST
+    FE_DOWNWARD = 0x400,
+#define FE_DOWNWARD	FE_DOWNWARD
+    FE_UPWARD = 0x800,
+#define FE_UPWARD	FE_UPWARD
+    FE_TOWARDZERO = 0xc00
+#define FE_TOWARDZERO	FE_TOWARDZERO
+  };
+
+
+/* Type representing exception flags.  */
+typedef unsigned short int fexcept_t;
+
+
+/* Type representing floating-point environment.  This function corresponds
+   to the layout of the block written by the `fstenv'.  */
+typedef struct
+  {
+    unsigned short int __control_word;
+    unsigned short int __unused1;
+    unsigned short int __status_word;
+    unsigned short int __unused2;
+    unsigned short int __tags;
+    unsigned short int __unused3;
+    unsigned int __eip;
+    unsigned short int __cs_selector;
+    unsigned int __opcode:11;
+    unsigned int __unused4:5;
+    unsigned int __data_offset;
+    unsigned short int __data_selector;
+    unsigned short int __unused5;
+  }
+fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((__const fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exception is masked.  */
+# define FE_NOMASK_ENV	((__const fenv_t *) -2)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/kernel_stat.h
new file mode 100644
index 0000000..231a984
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/kernel_stat.h
@@ -0,0 +1,49 @@
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+/* This file provides whatever this particular arch's kernel thinks
+ * struct stat should look like...  It turns out each arch has a
+ * different opinion on the subject... */
+
+struct kernel_stat {
+	unsigned long st_dev;
+	unsigned long st_ino;
+	unsigned short st_mode;
+	unsigned short st_nlink;
+	unsigned short st_uid;
+	unsigned short st_gid;
+	unsigned short st_rdev;
+	unsigned short __pad2;
+	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 short	st_rdev;
+	unsigned char	__pad3[10];
+	long long	st_size;
+	unsigned long	st_blksize;
+	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
+	unsigned long	__pad4;		/* future possible st_blocks high bits */
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned long long	st_ino;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/kernel_types.h
new file mode 100644
index 0000000..59044b8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/kernel_types.h
@@ -0,0 +1,55 @@
+/* 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
+ */
+
+/* a hack for compiling a 32 bit user space with 64 bit
+ * kernel on x86_64  */
+#if !defined(__ARCH_I386_POSIX_TYPES_H) && \
+    !defined(_ASM_X86_64_POSIX_TYPES_H) && \
+    !defined(_ASM_X86_POSIX_TYPES_32_H) && \
+    !defined(_ASM_X86_POSIX_TYPES_64_H)
+#define _ASM_X86_64_POSIX_TYPES_H
+#define __ARCH_I386_POSIX_TYPES_H
+#define _ASM_X86_POSIX_TYPES_32_H
+#define _ASM_X86_POSIX_TYPES_64_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 __kernel_dev_t	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+typedef long long	__kernel_loff_t;
+
+typedef struct {
+#ifdef __USE_ALL
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/mathdef.h
new file mode 100644
index 0000000..a3786fc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/mathdef.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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
+
+# if defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 0
+/* When using -mfpmath=sse, values are computed with the precission of the
+   used type.  */
+typedef float float_t;		/* `float' expressions are evaluated as `float'.  */
+typedef double double_t;	/* `double' expressions are evaluated as
+				   `double'.  */
+# else
+/* The ix87 FPUs evaluate all values in the 80 bit floating-point format
+   which is also available for the user as `long double'.  Therefore we
+   define:  */
+typedef long double float_t;	/* `float' expressions are evaluated as
+				   `long double'.  */
+typedef long double double_t;	/* `double' expressions are evaluated as
+				   `long double'.  */
+# endif
+
+/* The values returned by `ilogb' for 0 and NaN respectively.  */
+# define FP_ILOGB0	(-2147483647 - 1)
+# define FP_ILOGBNAN	(-2147483647 - 1)
+
+#endif	/* ISO C99 */
+
+#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/mathinline.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/mathinline.h
new file mode 100644
index 0000000..9e67182
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/mathinline.h
@@ -0,0 +1,766 @@
+/* Inline math functions for i387.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by John C. Bowman <bowman@math.ualberta.ca>, 1995.
+
+   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/mathinline.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __cplusplus
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE extern __inline
+#endif
+
+
+#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
+/* GCC 2.97 and up have builtins that actually can be used.  */
+# if !__GNUC_PREREQ (2,97)
+/* ISO C99 defines some macros to perform unordered comparisons.  The
+   ix87 FPU supports this with special opcodes and we should use them.
+   These must not be inline functions since we have to be able to handle
+   all floating-point types.  */
+#  undef isgreater
+#  undef isgreaterequal
+#  undef isless
+#  undef islessequal
+#  undef islessgreater
+#  undef isunordered
+#  ifdef __i686__
+/* For the PentiumPro and more recent processors we can provide
+   better code.  */
+#   define isgreater(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip %%st(1), %%st; seta %%al"			      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__result; })
+#   define isgreaterequal(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip %%st(1), %%st; setae %%al"			      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__result; })
+
+#   define isless(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip %%st(1), %%st; seta %%al"			      \
+		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st");	      \
+	__result; })
+
+#   define islessequal(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip %%st(1), %%st; setae %%al"			      \
+		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st");	      \
+	__result; })
+
+#   define islessgreater(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip %%st(1), %%st; setne %%al"			      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__result; })
+
+#   define isunordered(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip %%st(1), %%st; setp %%al"			      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__result; })
+#  else
+/* This is the dumb, portable code for i386 and above.  */
+#   define isgreater(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al"	      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+	__result; })
+
+#   define isgreaterequal(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al"	      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+	__result; })
+
+#   define isless(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al"	      \
+		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
+	__result; })
+
+#   define islessequal(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al"	      \
+		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
+	__result; })
+
+#   define islessgreater(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al"	      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+	__result; })
+
+#   define isunordered(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucompp; fnstsw; sahf; setp %%al"			      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+	__result; })
+#  endif /* __i686__ */
+# endif	/* GCC 2.97 */
+
+/* The gcc, version 2.7 or below, has problems with all this inlining
+   code.  So disable it for this version of the compiler.  */
+# if __GNUC_PREREQ (2, 8)
+/* Test for negative number.  Used in the signbit() macro.  */
+__MATH_INLINE int
+__NTH (__signbitf (float __x))
+{
+  __extension__ union { float __f; int __i; } __u = { __f: __x };
+  return __u.__i < 0;
+}
+__MATH_INLINE int
+__NTH (__signbit (double __x))
+{
+  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+  return __u.__i[1] < 0;
+}
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
+{
+  __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
+  return (__u.__i[2] & 0x8000) != 0;
+}
+# endif
+#endif
+
+
+/* The gcc, version 2.7 or below, has problems with all this inlining
+   code.  So disable it for this version of the compiler.  */
+#if __GNUC_PREREQ (2, 8)
+
+#if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
+     && defined __OPTIMIZE__)
+
+/* A macro to define float, double, and long double versions of various
+   math functions for the ix87 FPU.  FUNC is the function name (which will
+   be suffixed with f and l for the float and long double version,
+   respectively).  OP is the name of the FPU operation.
+   We define two sets of macros.  The set with the additional NP
+   doesn't add a prototype declaration.  */
+
+#if defined __USE_MISC || defined __USE_ISOC99
+# define __inline_mathop(func, op) \
+  __inline_mathop_ (double, func, op)					      \
+  __inline_mathop_ (float, __CONCAT(func,f), op)			      \
+  __inline_mathop_ (long double, __CONCAT(func,l), op)
+# define __inline_mathopNP(func, op) \
+  __inline_mathopNP_ (double, func, op)					      \
+  __inline_mathopNP_ (float, __CONCAT(func,f), op)			      \
+  __inline_mathopNP_ (long double, __CONCAT(func,l), op)
+#else
+# define __inline_mathop(func, op) \
+  __inline_mathop_ (double, func, op)
+# define __inline_mathopNP(func, op) \
+  __inline_mathopNP_ (double, func, op)
+#endif
+
+#define __inline_mathop_(float_type, func, op) \
+  __inline_mathop_decl_ (float_type, func, op, "0" (__x))
+#define __inline_mathopNP_(float_type, func, op) \
+  __inline_mathop_declNP_ (float_type, func, op, "0" (__x))
+
+
+#if defined __USE_MISC || defined __USE_ISOC99
+# define __inline_mathop_decl(func, op, params...) \
+  __inline_mathop_decl_ (double, func, op, params)			      \
+  __inline_mathop_decl_ (float, __CONCAT(func,f), op, params)		      \
+  __inline_mathop_decl_ (long double, __CONCAT(func,l), op, params)
+# define __inline_mathop_declNP(func, op, params...) \
+  __inline_mathop_declNP_ (double, func, op, params)			      \
+  __inline_mathop_declNP_ (float, __CONCAT(func,f), op, params)		      \
+  __inline_mathop_declNP_ (long double, __CONCAT(func,l), op, params)
+#else
+# define __inline_mathop_decl(func, op, params...) \
+  __inline_mathop_decl_ (double, func, op, params)
+# define __inline_mathop_declNP(func, op, params...) \
+  __inline_mathop_declNP_ (double, func, op, params)
+#endif
+
+#define __inline_mathop_decl_(float_type, func, op, params...) \
+  __MATH_INLINE float_type func (float_type) __THROW;			      \
+  __inline_mathop_declNP_ (float_type, func, op, params)
+
+#define __inline_mathop_declNP_(float_type, func, op, params...) \
+  __MATH_INLINE float_type __NTH (func (float_type __x))		      \
+  {									      \
+    register float_type __result;					      \
+    __asm__ __volatile__ (op : "=t" (__result) : params);		      \
+    return __result;							      \
+  }
+
+
+#if defined __USE_MISC || defined __USE_ISOC99
+# define __inline_mathcode(func, arg, code) \
+  __inline_mathcode_ (double, func, arg, code)				      \
+  __inline_mathcode_ (float, __CONCAT(func,f), arg, code)		      \
+  __inline_mathcode_ (long double, __CONCAT(func,l), arg, code)
+# define __inline_mathcodeNP(func, arg, code) \
+  __inline_mathcodeNP_ (double, func, arg, code)			      \
+  __inline_mathcodeNP_ (float, __CONCAT(func,f), arg, code)		      \
+  __inline_mathcodeNP_ (long double, __CONCAT(func,l), arg, code)
+# define __inline_mathcode2(func, arg1, arg2, code) \
+  __inline_mathcode2_ (double, func, arg1, arg2, code)			      \
+  __inline_mathcode2_ (float, __CONCAT(func,f), arg1, arg2, code)	      \
+  __inline_mathcode2_ (long double, __CONCAT(func,l), arg1, arg2, code)
+# define __inline_mathcodeNP2(func, arg1, arg2, code) \
+  __inline_mathcodeNP2_ (double, func, arg1, arg2, code)		      \
+  __inline_mathcodeNP2_ (float, __CONCAT(func,f), arg1, arg2, code)	      \
+  __inline_mathcodeNP2_ (long double, __CONCAT(func,l), arg1, arg2, code)
+# define __inline_mathcode3(func, arg1, arg2, arg3, code) \
+  __inline_mathcode3_ (double, func, arg1, arg2, arg3, code)		      \
+  __inline_mathcode3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code)	      \
+  __inline_mathcode3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code)
+# define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \
+  __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code)		      \
+  __inline_mathcodeNP3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code)     \
+  __inline_mathcodeNP3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code)
+#else
+# define __inline_mathcode(func, arg, code) \
+  __inline_mathcode_ (double, func, (arg), code)
+# define __inline_mathcodeNP(func, arg, code) \
+  __inline_mathcodeNP_ (double, func, (arg), code)
+# define __inline_mathcode2(func, arg1, arg2, code) \
+  __inline_mathcode2_ (double, func, arg1, arg2, code)
+# define __inline_mathcodeNP2(func, arg1, arg2, code) \
+  __inline_mathcodeNP2_ (double, func, arg1, arg2, code)
+# define __inline_mathcode3(func, arg1, arg2, arg3, code) \
+  __inline_mathcode3_ (double, func, arg1, arg2, arg3, code)
+# define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \
+  __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code)
+#endif
+
+#define __inline_mathcode_(float_type, func, arg, code) \
+  __MATH_INLINE float_type func (float_type) __THROW;			      \
+  __inline_mathcodeNP_(float_type, func, arg, code)
+
+#define __inline_mathcodeNP_(float_type, func, arg, code) \
+  __MATH_INLINE float_type __NTH (func (float_type arg))		      \
+  {									      \
+    code;								      \
+  }
+
+
+#define __inline_mathcode2_(float_type, func, arg1, arg2, code) \
+  __MATH_INLINE float_type func (float_type, float_type) __THROW;	      \
+  __inline_mathcodeNP2_ (float_type, func, arg1, arg2, code)
+
+#define __inline_mathcodeNP2_(float_type, func, arg1, arg2, code) \
+  __MATH_INLINE float_type __NTH (func (float_type arg1, float_type arg2))    \
+  {									      \
+    code;								      \
+  }
+
+#define __inline_mathcode3_(float_type, func, arg1, arg2, arg3, code) \
+  __MATH_INLINE float_type func (float_type, float_type, float_type) __THROW; \
+  __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code)
+
+#define __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code) \
+  __MATH_INLINE float_type __NTH (func (float_type arg1, float_type arg2,     \
+					float_type arg3))		      \
+  {									      \
+    code;								      \
+  }
+#endif
+
+
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+/* Miscellaneous functions */
+
+__inline_mathcode (__sgn, __x, \
+  return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0))
+
+/* __FAST_MATH__ is defined by gcc -ffast-math.  */
+#ifdef __FAST_MATH__
+__inline_mathcode (__pow2, __x, \
+  register long double __value;						      \
+  register long double __exponent;					      \
+  __extension__ long long int __p = (long long int) __x;		      \
+  if (__x == (long double) __p)						      \
+    {									      \
+      __asm__ __volatile__						      \
+	("fscale"							      \
+	 : "=t" (__value) : "0" (1.0), "u" (__x));			      \
+      return __value;							      \
+    }									      \
+  __asm__ __volatile__							      \
+    ("fld	%%st(0)\n\t"						      \
+     "frndint			# int(x)\n\t"				      \
+     "fxch\n\t"								      \
+     "fsub	%%st(1)		# fract(x)\n\t"				      \
+     "f2xm1			# 2^(fract(x)) - 1\n\t"			      \
+     : "=t" (__value), "=u" (__exponent) : "0" (__x));			      \
+  __value += 1.0;							      \
+  __asm__ __volatile__							      \
+    ("fscale"								      \
+     : "=t" (__value) : "0" (__value), "u" (__exponent));		      \
+  return __value)
+
+# ifdef __USE_GNU
+#  define __sincos_code \
+  register long double __cosr;						      \
+  register long double __sinr;						      \
+  __asm__ __volatile__							      \
+    ("fsincos\n\t"							      \
+     "fnstsw	%%ax\n\t"						      \
+     "testl	$0x400, %%eax\n\t"					      \
+     "jz	1f\n\t"							      \
+     "fldpi\n\t"							      \
+     "fadd	%%st(0)\n\t"						      \
+     "fxch	%%st(1)\n\t"						      \
+     "2: fprem1\n\t"							      \
+     "fnstsw	%%ax\n\t"						      \
+     "testl	$0x400, %%eax\n\t"					      \
+     "jnz	2b\n\t"							      \
+     "fstp	%%st(1)\n\t"						      \
+     "fsincos\n\t"							      \
+     "1:"								      \
+     : "=t" (__cosr), "=u" (__sinr) : "0" (__x));			      \
+  *__sinx = __sinr;							      \
+  *__cosx = __cosr
+
+__MATH_INLINE void
+__NTH (__sincos (double __x, double *__sinx, double *__cosx))
+{
+  __sincos_code;
+}
+
+__MATH_INLINE void
+__NTH (__sincosf (float __x, float *__sinx, float *__cosx))
+{
+  __sincos_code;
+}
+
+__MATH_INLINE void
+__NTH (__sincosl (long double __x, long double *__sinx, long double *__cosx))
+{
+  __sincos_code;
+}
+# endif
+
+
+/* Optimized inline implementation, sometimes with reduced precision
+   and/or argument range.  */
+
+# if __GNUC_PREREQ (3, 5)
+#  define __expm1_code \
+  register long double __temp;						      \
+  __temp = __builtin_expm1l (__x);					      \
+  return __temp ? __temp : __x
+# else
+#  define __expm1_code \
+  register long double __value;						      \
+  register long double __exponent;					      \
+  register long double __temp;						      \
+  __asm__ __volatile__							      \
+    ("fldl2e			# e^x - 1 = 2^(x * log2(e)) - 1\n\t"	      \
+     "fmul	%%st(1)		# x * log2(e)\n\t"			      \
+     "fst	%%st(1)\n\t"						      \
+     "frndint			# int(x * log2(e))\n\t"			      \
+     "fxch\n\t"								      \
+     "fsub	%%st(1)		# fract(x * log2(e))\n\t"		      \
+     "f2xm1			# 2^(fract(x * log2(e))) - 1\n\t"	      \
+     "fscale			# 2^(x * log2(e)) - 2^(int(x * log2(e)))\n\t" \
+     : "=t" (__value), "=u" (__exponent) : "0" (__x));			      \
+  __asm__ __volatile__							      \
+    ("fscale			# 2^int(x * log2(e))\n\t"		      \
+     : "=t" (__temp) : "0" (1.0), "u" (__exponent));			      \
+  __temp -= 1.0;							      \
+  __temp += __value;							      \
+  return __temp ? __temp : __x
+# endif
+__inline_mathcodeNP_ (long double, __expm1l, __x, __expm1_code)
+
+# if __GNUC_PREREQ (3, 4)
+__inline_mathcodeNP_ (long double, __expl, __x, return __builtin_expl (__x))
+# else
+#  define __exp_code \
+  register long double __value;						      \
+  register long double __exponent;					      \
+  __asm__ __volatile__							      \
+    ("fldl2e			# e^x = 2^(x * log2(e))\n\t"		      \
+     "fmul	%%st(1)		# x * log2(e)\n\t"			      \
+     "fst	%%st(1)\n\t"						      \
+     "frndint			# int(x * log2(e))\n\t"			      \
+     "fxch\n\t"								      \
+     "fsub	%%st(1)		# fract(x * log2(e))\n\t"		      \
+     "f2xm1			# 2^(fract(x * log2(e))) - 1\n\t"	      \
+     : "=t" (__value), "=u" (__exponent) : "0" (__x));			      \
+  __value += 1.0;							      \
+  __asm__ __volatile__							      \
+    ("fscale"								      \
+     : "=t" (__value) : "0" (__value), "u" (__exponent));		      \
+  return __value
+__inline_mathcodeNP (exp, __x, __exp_code)
+__inline_mathcodeNP_ (long double, __expl, __x, __exp_code)
+# endif
+
+
+# if !__GNUC_PREREQ (3, 5)
+__inline_mathcodeNP (tan, __x, \
+  register long double __value;						      \
+  register long double __value2 __attribute__ ((__unused__));		      \
+  __asm__ __volatile__							      \
+    ("fptan"								      \
+     : "=t" (__value2), "=u" (__value) : "0" (__x));			      \
+  return __value)
+# endif
+#endif /* __FAST_MATH__ */
+
+
+#if __GNUC_PREREQ (3, 4)
+__inline_mathcodeNP2_ (long double, __atan2l, __y, __x,
+		       return __builtin_atan2l (__y, __x))
+#else
+# define __atan2_code \
+  register long double __value;						      \
+  __asm__ __volatile__							      \
+    ("fpatan"								      \
+     : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)");		      \
+  return __value
+# ifdef __FAST_MATH__
+__inline_mathcodeNP2 (atan2, __y, __x, __atan2_code)
+# endif
+__inline_mathcodeNP2_ (long double, __atan2l, __y, __x, __atan2_code)
+#endif
+
+
+#if defined __FAST_MATH__ && !__GNUC_PREREQ (3, 5)
+__inline_mathcodeNP2 (fmod, __x, __y, \
+  register long double __value;						      \
+  __asm__ __volatile__							      \
+    ("1:	fprem\n\t"						      \
+     "fnstsw	%%ax\n\t"						      \
+     "sahf\n\t"								      \
+     "jp	1b"							      \
+     : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc");		      \
+  return __value)
+#endif
+
+
+#ifdef __FAST_MATH__
+# if !__GNUC_PREREQ (3,3)
+__inline_mathopNP (sqrt, "fsqrt")
+__inline_mathopNP_ (long double, __sqrtl, "fsqrt")
+#  define __libc_sqrtl(n) __sqrtl (n)
+# else
+#  define __libc_sqrtl(n) __builtin_sqrtl (n)
+# endif
+#endif
+
+#if __GNUC_PREREQ (2, 8)
+__inline_mathcodeNP_ (double, fabs, __x, return __builtin_fabs (__x))
+# if defined __USE_MISC || defined __USE_ISOC99
+__inline_mathcodeNP_ (float, fabsf, __x, return __builtin_fabsf (__x))
+__inline_mathcodeNP_ (long double, fabsl, __x, return __builtin_fabsl (__x))
+# endif
+__inline_mathcodeNP_ (long double, __fabsl, __x, return __builtin_fabsl (__x))
+#else
+__inline_mathop (fabs, "fabs")
+__inline_mathop_ (long double, __fabsl, "fabs")
+#endif
+
+#ifdef __FAST_MATH__
+# if !__GNUC_PREREQ (3, 4)
+/* The argument range of this inline version is reduced.  */
+__inline_mathopNP (sin, "fsin")
+/* The argument range of this inline version is reduced.  */
+__inline_mathopNP (cos, "fcos")
+
+__inline_mathop_declNP (log, "fldln2; fxch; fyl2x", "0" (__x) : "st(1)")
+# endif
+
+# if !__GNUC_PREREQ (3, 5)
+__inline_mathop_declNP (log10, "fldlg2; fxch; fyl2x", "0" (__x) : "st(1)")
+
+__inline_mathcodeNP (asin, __x, return __atan2l (__x, __libc_sqrtl (1.0 - __x * __x)))
+__inline_mathcodeNP (acos, __x, return __atan2l (__libc_sqrtl (1.0 - __x * __x), __x))
+# endif
+
+# if !__GNUC_PREREQ (3, 4)
+__inline_mathop_declNP (atan, "fld1; fpatan", "0" (__x) : "st(1)")
+# endif
+#endif /* __FAST_MATH__ */
+
+__inline_mathcode_ (long double, __sgn1l, __x, \
+  __extension__ union { long double __xld; unsigned int __xi[3]; } __n =      \
+    { __xld: __x };							      \
+  __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff;			      \
+  __n.__xi[1] = 0x80000000;						      \
+  __n.__xi[0] = 0;							      \
+  return __n.__xld)
+
+
+#ifdef __FAST_MATH__
+/* The argument range of the inline version of sinhl is slightly reduced.  */
+__inline_mathcodeNP (sinh, __x, \
+  register long double __exm1 = __expm1l (__fabsl (__x));		      \
+  return 0.5 * (__exm1 / (__exm1 + 1.0) + __exm1) * __sgn1l (__x))
+
+__inline_mathcodeNP (cosh, __x, \
+  register long double __ex = __expl (__x);				      \
+  return 0.5 * (__ex + 1.0 / __ex))
+
+__inline_mathcodeNP (tanh, __x, \
+  register long double __exm1 = __expm1l (-__fabsl (__x + __x));	      \
+  return __exm1 / (__exm1 + 2.0) * __sgn1l (-__x))
+#endif
+
+__inline_mathcodeNP (floor, __x, \
+  register long double __value;						      \
+  __volatile__ unsigned short int __cw;					      \
+  __volatile__ unsigned short int __cwtmp;				      \
+  __asm__ __volatile__ ("fnstcw %0" : "=m" (__cw));				      \
+  __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */		      \
+  __asm__ __volatile__ ("fldcw %0" : : "m" (__cwtmp));			      \
+  __asm__ __volatile__ ("frndint" : "=t" (__value) : "0" (__x));		      \
+  __asm__ __volatile__ ("fldcw %0" : : "m" (__cw));				      \
+  return __value)
+
+__inline_mathcodeNP (ceil, __x, \
+  register long double __value;						      \
+  __volatile__ unsigned short int __cw;					      \
+  __volatile__ unsigned short int __cwtmp;				      \
+  __asm__ __volatile__ ("fnstcw %0" : "=m" (__cw));				      \
+  __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */			      \
+  __asm__ __volatile__ ("fldcw %0" : : "m" (__cwtmp));			      \
+  __asm__ __volatile__ ("frndint" : "=t" (__value) : "0" (__x));		      \
+  __asm__ __volatile__ ("fldcw %0" : : "m" (__cw));				      \
+  return __value)
+
+#ifdef __FAST_MATH__
+# define __ldexp_code \
+  register long double __value;						      \
+  __asm__ __volatile__							      \
+    ("fscale"								      \
+     : "=t" (__value) : "0" (__x), "u" ((long double) __y));		      \
+  return __value
+
+__MATH_INLINE double
+__NTH (ldexp (double __x, int __y))
+{
+  __ldexp_code;
+}
+#endif
+
+
+/* Optimized versions for some non-standardized functions.  */
+#if defined __USE_ISOC99 || defined __USE_MISC
+
+# ifdef __FAST_MATH__
+__inline_mathcodeNP (expm1, __x, __expm1_code)
+
+/* We cannot rely on M_SQRT being defined.  So we do it for ourself
+   here.  */
+#  define __M_SQRT2	1.41421356237309504880L	/* sqrt(2) */
+
+#  if !__GNUC_PREREQ (3, 5)
+__inline_mathcodeNP (log1p, __x, \
+  register long double __value;						      \
+  if (__fabsl (__x) >= 1.0 - 0.5 * __M_SQRT2)				      \
+    __value = logl (1.0 + __x);						      \
+  else									      \
+    __asm__ __volatile__							      \
+      ("fldln2\n\t"							      \
+       "fxch\n\t"							      \
+       "fyl2xp1"							      \
+       : "=t" (__value) : "0" (__x) : "st(1)");				      \
+  return __value)
+#  endif
+
+
+/* The argument range of the inline version of asinhl is slightly reduced.  */
+__inline_mathcodeNP (asinh, __x, \
+  register long double  __y = __fabsl (__x);				      \
+  return (log1pl (__y * __y / (__libc_sqrtl (__y * __y + 1.0) + 1.0) + __y)   \
+	  * __sgn1l (__x)))
+
+__inline_mathcodeNP (acosh, __x, \
+  return logl (__x + __libc_sqrtl (__x - 1.0) * __libc_sqrtl (__x + 1.0)))
+
+__inline_mathcodeNP (atanh, __x, \
+  register long double __y = __fabsl (__x);				      \
+  return -0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * __sgn1l (__x))
+
+/* The argument range of the inline version of hypotl is slightly reduced.  */
+__inline_mathcodeNP2 (hypot, __x, __y,
+		      return __libc_sqrtl (__x * __x + __y * __y))
+
+#  if !__GNUC_PREREQ (3, 5)
+__inline_mathcodeNP(logb, __x, \
+  register long double __value;						      \
+  register long double __junk;						      \
+  __asm__ __volatile__							      \
+    ("fxtract\n\t"							      \
+     : "=t" (__junk), "=u" (__value) : "0" (__x));			      \
+  return __value)
+#  endif
+
+# endif
+#endif
+
+#ifdef __USE_ISOC99
+# ifdef __FAST_MATH__
+
+#  if !__GNUC_PREREQ (3, 5)
+__inline_mathop_declNP (log2, "fld1; fxch; fyl2x", "0" (__x) : "st(1)")
+#  endif
+
+__MATH_INLINE float
+__NTH (ldexpf (float __x, int __y))
+{
+  __ldexp_code;
+}
+
+__MATH_INLINE long double
+__NTH (ldexpl (long double __x, int __y))
+{
+  __ldexp_code;
+}
+
+__inline_mathcodeNP3 (fma, __x, __y, __z, return (__x * __y) + __z)
+
+__inline_mathopNP (rint, "frndint")
+# endif /* __FAST_MATH__ */
+
+# define __lrint_code \
+  long int __lrintres;							      \
+  __asm__ __volatile__							      \
+    ("fistpl %0"							      \
+     : "=m" (__lrintres) : "t" (__x) : "st");				      \
+  return __lrintres
+__MATH_INLINE long int
+__NTH (lrintf (float __x))
+{
+  __lrint_code;
+}
+__MATH_INLINE long int
+__NTH (lrint (double __x))
+{
+  __lrint_code;
+}
+__MATH_INLINE long int
+__NTH (lrintl (long double __x))
+{
+  __lrint_code;
+}
+# undef __lrint_code
+
+# define __llrint_code \
+  long long int __llrintres;						      \
+  __asm__ __volatile__							      \
+    ("fistpll %0"							      \
+     : "=m" (__llrintres) : "t" (__x) : "st");				      \
+  return __llrintres
+__MATH_INLINE long long int
+__NTH (llrintf (float __x))
+{
+  __llrint_code;
+}
+__MATH_INLINE long long int
+__NTH (llrint (double __x))
+{
+  __llrint_code;
+}
+__MATH_INLINE long long int
+__NTH (llrintl (long double __x))
+{
+  __llrint_code;
+}
+# undef __llrint_code
+
+#endif
+
+
+#ifdef __USE_MISC
+
+# if defined __FAST_MATH__ && !__GNUC_PREREQ (3, 5)
+__inline_mathcodeNP2 (drem, __x, __y, \
+  register double __value;						      \
+  register int __clobbered;						      \
+  __asm__ __volatile__							      \
+    ("1:	fprem1\n\t"						      \
+     "fstsw	%%ax\n\t"						      \
+     "sahf\n\t"								      \
+     "jp	1b"							      \
+     : "=t" (__value), "=&a" (__clobbered) : "0" (__x), "u" (__y) : "cc");    \
+  return __value)
+# endif
+
+
+/* This function is used in the `isfinite' macro.  */
+__MATH_INLINE int
+__NTH (__finite (double __x))
+{
+  union { double __d; int __i[2]; } u;
+  u.__d = __x;
+  /* Finite numbers have at least one zero bit in exponent. */
+  /* All other numbers will result in 0xffffffff after OR: */
+  return (u.__i[1] | 0x800fffff) != 0xffffffff;
+}
+
+__MATH_INLINE int
+__NTH (__finitef (float __x))
+{
+  union { float __d; int __i; } u;
+  u.__d = __x;
+  return (u.__i | 0x807fffff) != 0xffffffff;
+}
+
+
+/* Miscellaneous functions */
+# ifdef __FAST_MATH__
+__inline_mathcode (__coshm1, __x, \
+  register long double __exm1 = __expm1l (__fabsl (__x));		      \
+  return 0.5 * (__exm1 / (__exm1 + 1.0)) * __exm1)
+
+__inline_mathcode (__acosh1p, __x, \
+  return log1pl (__x + __libc_sqrtl (__x) * __libc_sqrtl (__x + 2.0)))
+
+# endif /* __FAST_MATH__ */
+#endif /* __USE_MISC  */
+
+/* Undefine some of the large macros which are not used anymore.  */
+#undef __atan2_code
+#ifdef __FAST_MATH__
+# undef __expm1_code
+# undef __exp_code
+# undef __sincos_code
+#endif /* __FAST_MATH__ */
+
+#endif /* __NO_MATH_INLINES  */
+
+
+/* This code is used internally in the GNU libc.  */
+#ifdef __LIBC_INTERNAL_MATH_INLINES
+__inline_mathop (__ieee754_sqrt, "fsqrt")
+__inline_mathcode2 (__ieee754_atan2, __y, __x,
+		    register long double __value;
+		    __asm__ __volatile__ ("fpatan\n\t"
+					: "=t" (__value)
+					: "0" (__x), "u" (__y) : "st(1)");
+		    return __value;)
+#endif
+
+#endif /* __GNUC__  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/select.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/select.h
new file mode 100644
index 0000000..972bfb6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/select.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 1997, 1998, 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_SELECT_H
+# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
+#endif
+
+
+#if defined __GNUC__ && __GNUC__ >= 2
+
+# define __FD_ZERO(fdsp) \
+  do {									      \
+    int __d0, __d1;							      \
+    __asm__ __volatile__ ("cld; rep; stosl"				      \
+			  : "=c" (__d0), "=D" (__d1)			      \
+			  : "a" (0), "0" (sizeof (fd_set)		      \
+					  / sizeof (__fd_mask)),	      \
+			    "1" (&__FDS_BITS (fdsp)[0])			      \
+			  : "memory");					      \
+  } while (0)
+
+# define __FD_SET(fd, fdsp) \
+  __asm__ __volatile__ ("btsl %1,%0"					      \
+			: "=m" (__FDS_BITS (fdsp)[__FDELT (fd)])	      \
+			: "r" (((int) (fd)) % __NFDBITS)		      \
+			: "cc","memory")
+# define __FD_CLR(fd, fdsp) \
+  __asm__ __volatile__ ("btrl %1,%0"					      \
+			: "=m" (__FDS_BITS (fdsp)[__FDELT (fd)])	      \
+			: "r" (((int) (fd)) % __NFDBITS)		      \
+			: "cc","memory")
+# define __FD_ISSET(fd, fdsp) \
+  (__extension__							      \
+   ({register char __result;						      \
+     __asm__ __volatile__ ("btl %1,%2 ; setcb %b0"			      \
+			   : "=q" (__result)				      \
+			   : "r" (((int) (fd)) % __NFDBITS),		      \
+			     "m" (__FDS_BITS (fdsp)[__FDELT (fd)])	      \
+			   : "cc");					      \
+     __result; }))
+
+#else	/* ! GNU CC */
+
+/* We don't use `memset' because this would require a prototype and
+   the array isn't too big.  */
+# define __FD_ZERO(set)  \
+  do {									      \
+    unsigned int __i;							      \
+    fd_set *__arr = (set);						      \
+    for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i)	      \
+      __FDS_BITS (__arr)[__i] = 0;					      \
+  } while (0)
+# define __FD_SET(d, set)    (__FDS_BITS (set)[__FDELT (d)] |= __FDMASK (d))
+# define __FD_CLR(d, set)    (__FDS_BITS (set)[__FDELT (d)] &= ~__FDMASK (d))
+# define __FD_ISSET(d, set)  (__FDS_BITS (set)[__FDELT (d)] & __FDMASK (d))
+
+#endif	/* GNU CC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/setjmp.h
new file mode 100644
index 0000000..107fe58
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/setjmp.h
@@ -0,0 +1,46 @@
+/* Copyright (C) 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* Define the machine-dependent type `jmp_buf'.  Intel 386 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
+
+#if defined __USE_MISC || defined _ASM
+# define JB_BX	0
+# define JB_SI	1
+# define JB_DI	2
+# define JB_BP	3
+# define JB_SP	4
+# define JB_PC	5
+# define JB_SIZE 24
+#endif
+
+#ifndef	_ASM
+typedef int __jmp_buf[6];
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[JB_SP])
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/sigcontextinfo.h
new file mode 100644
index 0000000..b7367ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/sigcontextinfo.h
@@ -0,0 +1,51 @@
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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 SIGCONTEXT struct sigcontext
+#define SIGCONTEXT_EXTRA_ARGS
+#define GET_PC(ctx)	((void *) ctx.eip)
+#define GET_FRAME(ctx)	((void *) ctx.ebp)
+#define GET_STACK(ctx)	((void *) ctx.esp_at_signal)
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+do {									      \
+  int __tmp1, __tmp2, __tmp3, __tmp4;					      \
+  __asm__ __volatile__ ("movl\t%%esp, %%edi\n\t"				      \
+		    "andl\t$-16, %%esp\n\t"				      \
+		    "subl\t%8, %%esp\n\t"				      \
+		    "movl\t%%edi, %c8-4(%%esp)\n\t"			      \
+		    "movl\t%1, 0(%%esp)\n\t"				      \
+		    "leal\t4(%%esp), %%edi\n\t"				      \
+		    "cld\n\t"						      \
+		    "rep\tmovsl\n\t"					      \
+		    "call\t*%0\n\t"					      \
+		    "cld\n\t"						      \
+		    "movl\t%9, %%ecx\n\t"				      \
+		    "subl\t%%edi, %%esi\n\t"				      \
+		    "leal\t4(%%esp,%%esi,1), %%edi\n\t"			      \
+		    "leal\t4(%%esp), %%esi\n\t"				      \
+		    "rep\tmovsl\n\t"					      \
+		    "movl\t%c8-4(%%esp), %%esp\n\t"			      \
+		    : "=a" (__tmp1), "=d" (__tmp2), "=S" (__tmp3),	      \
+		      "=c" (__tmp4)					      \
+		    : "0" (handler), "1" (signo), "2" (&ctx),		      \
+		      "3" (sizeof (struct sigcontext) / 4),		      \
+		      "n" ((sizeof (struct sigcontext) + 19) & ~15),	      \
+		      "i" (sizeof (struct sigcontext) / 4)		      \
+		    : "cc", "edi");					      \
+} while (0)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/stackinfo.h
new file mode 100644
index 0000000..a9a6745
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On x86 the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/syscalls.h
new file mode 100644
index 0000000..9fb4f35
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/syscalls.h
@@ -0,0 +1,193 @@
+#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.2.5/sysdeps/unix/sysv/linux/i386/sysdep.h
+ */
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+(__extension__ \
+ ({ \
+	register unsigned int resultvar; \
+	__asm__ __volatile__ ( \
+		LOADARGS_##nr                                   \
+		"movl	%1, %%eax\n\t"                          \
+		"int	$0x80\n\t"                              \
+		RESTOREARGS_##nr                                \
+		: "=a" (resultvar)                              \
+		: "g" (name) ASMFMT_##nr(args) : "memory", "cc" \
+	); \
+	(int) resultvar; \
+  }) \
+)
+
+#if 1 /* defined __PIC__ || defined __pic__ */
+
+/* This code avoids pushing/popping ebx as much as possible.
+ * I think the main reason was that older GCCs had problems
+ * with proper saving/restoring of ebx if "b" constraint was used,
+ * which was breaking -fPIC code really badly.
+ * At least gcc 4.2.x seems to not need these tricks anymore,
+ * but this code is still useful because it often avoids
+ * using stack for saving ebx.
+ * Keeping it unconditionally enabled for now.
+ */
+
+/* We need some help from the assembler to generate optimal code.
+ * We define some macros here which later will be used.  */
+/* gcc>=4.6 with LTO need the same guards as IMA (a.k.a --combine) did.
+ * See gcc.gnu.org/PR47577  */
+/* FIXME: drop these b* macros! */
+
+__asm__ (
+#if defined __DOMULTI__ || __GNUC_PREREQ (4, 6)
+	/* Protect against asm macro redefinition (happens in __DOMULTI__ mode).
+	 * Unfortunately, it ends up visible in .o files. */
+	".ifndef _BITS_SYSCALLS_ASM\n\t"
+	".set _BITS_SYSCALLS_ASM,1\n\t"
+#endif
+	".L__X'%ebx = 1\n\t"
+	".L__X'%ecx = 2\n\t"
+	".L__X'%edx = 2\n\t"
+	".L__X'%eax = 3\n\t"
+	".L__X'%esi = 3\n\t"
+	".L__X'%edi = 3\n\t"
+	".L__X'%ebp = 3\n\t"
+	".L__X'%esp = 3\n\t"
+
+	/* Loading param #1 (ebx) is done by loading it into
+	 * another register, and then performing bpushl+bmovl,
+	 * since we must preserve ebx */
+
+	".macro bpushl name reg\n\t"
+	".if 1 - \\name\n\t"    /* if reg!=ebx... */
+	".if 2 - \\name\n\t"    /* if reg can't be clobbered... */
+	"pushl %ebx\n\t"        /* save ebx on stack */
+	".else\n\t"
+	"xchgl \\reg, %ebx\n\t" /* else save ebx in reg, and load reg to ebx */
+	".endif\n\t"
+	".endif\n\t"
+	".endm\n\t"
+
+	".macro bmovl name reg\n\t"
+	".if 1 - \\name\n\t"
+	".if 2 - \\name\n\t"    /* if reg can't be clobbered... */
+	"movl \\reg, %ebx\n\t"  /* load reg to ebx */
+	".endif\n\t"
+	".endif\n\t"
+	".endm\n\t"
+
+	".macro bpopl name reg\n\t"
+	".if 1 - \\name\n\t"
+	".if 2 - \\name\n\t"    /* if reg can't be clobbered... */
+	"popl %ebx\n\t"         /* restore ebx from stack */
+	".else\n\t"
+	"xchgl \\reg, %ebx\n\t" /* else restore ebx from reg */
+	".endif\n\t"
+	".endif\n\t"
+	".endm\n\t"
+
+#if defined __DOMULTI__ || __GNUC_PREREQ (4, 6)
+	".endif\n\t" /* _BITS_SYSCALLS_ASM */
+#endif
+);
+
+#define LOADARGS_0
+#define LOADARGS_1  "bpushl .L__X'%k2, %k2\n\t" "bmovl .L__X'%k2, %k2\n\t"
+#define LOADARGS_2  LOADARGS_1
+#define LOADARGS_3  LOADARGS_1
+#define LOADARGS_4  LOADARGS_1
+#define LOADARGS_5  LOADARGS_1
+#define LOADARGS_6  LOADARGS_1 "push %%ebp\n\t" "movl %7, %%ebp\n\t"
+
+#define RESTOREARGS_0
+#define RESTOREARGS_1  "bpopl .L__X'%k2, %k2\n\t"
+#define RESTOREARGS_2  RESTOREARGS_1
+#define RESTOREARGS_3  RESTOREARGS_1
+#define RESTOREARGS_4  RESTOREARGS_1
+#define RESTOREARGS_5  RESTOREARGS_1
+#define RESTOREARGS_6  "pop %%ebp\n\t" RESTOREARGS_1
+
+#define ASMFMT_0()
+/* "acdSD" constraint would work too, but "SD" would use esi/edi and cause
+ * them to be pushed/popped by compiler, "a" would use eax and cause ebx
+ * to be saved/restored on stack, not in register. Narrowing choice down
+ * to "ecx or edx" results in smaller and faster code: */
+#define ASMFMT_1(arg1) \
+	, "cd" (arg1)
+/* Can use "adSD" constraint here: */
+#define ASMFMT_2(arg1, arg2) \
+	, "d" (arg1), "c" (arg2)
+/* Can use "aSD" constraint here: */
+#define ASMFMT_3(arg1, arg2, arg3) \
+	, "a" (arg1), "c" (arg2), "d" (arg3)
+/* Can use "aD" constraint here: */
+#define ASMFMT_4(arg1, arg2, arg3, arg4) \
+	, "a" (arg1), "c" (arg2), "d" (arg3), "S" (arg4)
+#define ASMFMT_5(arg1, arg2, arg3, arg4, arg5) \
+	, "a" (arg1), "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5)
+#define ASMFMT_6(arg1, arg2, arg3, arg4, arg5, arg6) \
+	, "a" (arg1), "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5), "m" (arg6)
+
+#else /* !PIC */
+
+/* Simpler code which just uses "b" constraint to load ebx.
+ * Seems to work with gc 4.2.x, and generates slightly smaller,
+ * but slightly slower code. Example (time syscall):
+ *
+ * -	8b 4c 24 04            mov    0x4(%esp),%ecx
+ * -	87 cb                  xchg   %ecx,%ebx
+ * +	53                     push   %ebx
+ * +	8b 5c 24 08            mov    0x8(%esp),%ebx
+ *	b8 0d 00 00 00         mov    $0xd,%eax
+ *	cd 80                  int    $0x80
+ * -	87 cb                  xchg   %ecx,%ebx
+ * +	5b                     pop    %ebx
+ *	c3                     ret
+ *
+ * 2 bytes smaller, but uses stack via "push/pop ebx"
+ */
+
+#define LOADARGS_0
+#define LOADARGS_1
+#define LOADARGS_2
+#define LOADARGS_3
+#define LOADARGS_4
+#define LOADARGS_5
+#define LOADARGS_6  "push %%ebp\n\t" "movl %7, %%ebp\n\t"
+
+#define RESTOREARGS_0
+#define RESTOREARGS_1
+#define RESTOREARGS_2
+#define RESTOREARGS_3
+#define RESTOREARGS_4
+#define RESTOREARGS_5
+#define RESTOREARGS_6  "pop %%ebp\n\t"
+
+#define ASMFMT_0()
+#define ASMFMT_1(arg1) \
+	, "b" (arg1)
+#define ASMFMT_2(arg1, arg2) \
+	, "b" (arg1), "c" (arg2)
+#define ASMFMT_3(arg1, arg2, arg3) \
+	, "b" (arg1), "c" (arg2), "d" (arg3)
+#define ASMFMT_4(arg1, arg2, arg3, arg4) \
+	, "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4)
+#define ASMFMT_5(arg1, arg2, arg3, arg4, arg5) \
+	, "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5)
+#define ASMFMT_6(arg1, arg2, arg3, arg4, arg5, arg6) \
+	, "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5), "m" (arg6)
+
+#endif /* !PIC */
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..536e9c1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
@@ -0,0 +1,52 @@
+/*
+ * 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__ "hlt"
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#define __UCLIBC_BROKEN_CREATE_MODULE__
+
+/* does your target have to worry about older [gs]etrlimit() ? */
+/* this is only an issue on i386 where linux < 2.3.25, so we just assume it works ... */
+#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 */
+#define __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__
+
+#if defined _LIBC
+#define internal_function __attribute__ ((regparm (3), stdcall))
+#endif
+
+#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/wchar.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/wchar.h
new file mode 100644
index 0000000..442a462
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/wchar.h
@@ -0,0 +1,26 @@
+/* wchar_t type related definitions.
+   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.  */
+
+#ifndef _BITS_WCHAR_H
+#define _BITS_WCHAR_H	1
+
+#define __WCHAR_MIN	(-2147483647l - 1l)
+#define __WCHAR_MAX	(2147483647l)
+
+#endif	/* bits/wchar.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/wordsize.h
new file mode 100644
index 0000000..f4c2144
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bits/wordsize.h
@@ -0,0 +1,25 @@
+/* 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
+
+#ifdef _LIBC
+#ifndef smallint_type
+#define smallint_type char
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/brk.c b/ap/build/uClibc/libc/sysdeps/linux/i386/brk.c
new file mode 100644
index 0000000..51aa6f8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/brk.c
@@ -0,0 +1,51 @@
+/* brk system call for Linux/i386.
+   Copyright (C) 1995, 1996, 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 <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;
+
+	/* %ebx is used in PIC code, need to save/restore it manually.
+	 * gcc won't do it for us if we will request it in constraints
+	 */
+	__asm__("pushl	%%ebx\n"
+		"movl	%2, %%ebx\n"
+		"int	$0x80\n"
+		"popl	%%ebx\n"
+		: "=a" (newbrk)
+		: "0" (__NR_brk), "g" (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/i386/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/i386/bsd-_setjmp.S
new file mode 100644
index 0000000..f3cd6cb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bsd-_setjmp.S
@@ -0,0 +1,46 @@
+/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'.  i386 version.
+   Copyright (C) 1994,1995,1996,1997,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.  */
+
+/* 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.  */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+.global _setjmp
+.type   _setjmp,%function
+_setjmp:
+	xorl %eax, %eax
+	movl 4   (%esp), %edx
+
+	/* Save registers.  */
+	movl %ebx, (JB_BX*4)(%edx)
+	movl %esi, (JB_SI*4)(%edx)
+	movl %edi, (JB_DI*4)(%edx)
+	leal 4 (%esp), %ecx	/* Save SP as it will be after we return.  */
+	movl %ecx, (JB_SP*4)(%edx)
+	movl 0 (%esp), %ecx	/* Save PC we are returning to now.  */
+	movl %ecx, (JB_PC*4)(%edx)
+	movl %ebp, (JB_BP*4)(%edx) /* Save caller's frame pointer.  */
+
+	movl %eax, JB_SIZE(%edx) /* No signal mask set.  */
+	ret
+.size _setjmp,.-_setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/i386/bsd-setjmp.S
new file mode 100644
index 0000000..df46997
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/bsd-setjmp.S
@@ -0,0 +1,60 @@
+/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'.  i386 version.
+   Copyright (C) 1995, 1996, 1997, 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.  */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+.global setjmp
+.type   setjmp,%function
+setjmp:
+	movl 4   (%esp), %eax
+	/* Save registers.  */
+	movl %ebx, (0 *4)(%eax)
+	movl %esi, (1 *4)(%eax)
+	movl %edi, (2 *4)(%eax)
+	/* Save SP as it will be after we return.  */
+	leal 4   (%esp), %ecx
+	movl %ecx, (4 *4)(%eax)
+	/* Save PC we are returning to now.  */
+	movl 0 (%esp), %ecx
+	movl %ecx, (5 *4)(%eax)
+	/* Save caller's frame pointer.  */
+	movl %ebp, (3 *4)(%eax)  
+
+	/* Call __sigjmp_save.  */
+	pushl $1
+	pushl 8(%esp)
+#ifdef	__PIC__
+	/* We cannot use the PLT, because it requires that %ebx be set, but
+	   we can't save and restore our caller's value.  Instead, we do an
+	   indirect jump through the GOT, using for the temporary register
+	   %ecx, which is call-clobbered.  */
+	call here2
+here2:	popl %ecx
+	addl $_GLOBAL_OFFSET_TABLE_+[.-here2], %ecx
+	movl    __sigjmp_save    @GOT  (%ecx), %ecx
+	call *%ecx
+#else
+	call __sigjmp_save
+#endif
+	popl %ecx
+	popl %edx
+	ret
+.size setjmp,.-setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/clone.S b/ap/build/uClibc/libc/sysdeps/linux/i386/clone.S
new file mode 100644
index 0000000..a7de3fe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/clone.S
@@ -0,0 +1,131 @@
+/* Copyright (C) 1996-2000,02,03,04,2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@tamu.edu)
+
+   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.
+
+   Hacked up for uClibc by Erik Andersen <andersen@codepoet.org>
+*/
+
+#define _ERRNO_H	1
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
+	     pid_t *ptid, struct user_desc *tls, pid_t *ctid); */
+
+#define LINKAGE     4
+#define PTR_SIZE    4
+#define PARMS       LINKAGE        /* no space for saved regs */
+#define FUNC        PARMS
+#define STACK       FUNC+4
+#define FLAGS       STACK+PTR_SIZE
+#define ARG         FLAGS+4
+#define PTID        ARG+PTR_SIZE
+#define TLS         PTID+PTR_SIZE
+#define CTID        TLS+PTR_SIZE
+
+.text
+.global clone
+.type   clone,%function
+clone:
+	/* Sanity check arguments.  */
+	movl	$-EINVAL,%eax
+
+	/* no NULL function pointers */
+	movl	FUNC(%esp),%ecx
+#ifdef __PIC__
+	jecxz	__error
+#else
+	testl	%ecx,%ecx
+	jz	__error
+#endif
+
+	/* no NULL stack pointers */
+	movl	STACK(%esp),%ecx
+#ifdef __PIC__
+	jecxz	__error
+#else
+	testl	%ecx,%ecx
+	jz	__error
+#endif
+
+	/* Insert the argument onto the new stack.  Make sure the new
+	   thread is started with an alignment of (mod 16).  */
+	andl	$0xfffffff0, %ecx
+	subl	$28,%ecx
+	movl	ARG(%esp),%eax		/* no negative argument counts */
+	movl	%eax,12(%ecx)
+
+	/* Save the function pointer as the zeroth argument.
+	   It will be popped off in the child in the ebx frobbing below.  */
+	movl	FUNC(%esp),%eax
+	movl	%eax,8(%ecx)
+	/* Don't leak any information.  */
+	movl	$0,4(%ecx)
+#ifndef RESET_PID
+	movl	$0,(%ecx)
+#endif
+
+
+	/* Do the system call */
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	TLS+12(%esp),%esi
+	movl	PTID+12(%esp),%edx
+	movl	FLAGS+12(%esp),%ebx
+	movl	CTID+12(%esp),%edi
+	movl	$__NR_clone,%eax
+#ifdef RESET_PID
+	/* Remember the flag value.  */
+	movl	%ebx, (%ecx)
+#endif
+	int	$0x80
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+
+	test	%eax,%eax
+	jl	__error
+	jz	.Lthread_start
+	ret
+
+.Lthread_start:
+	/* Note: %esi is zero.  */
+	movl	%esi,%ebp	/* terminate the stack frame */
+	call	*%ebx
+#ifdef __PIC__
+	call	.Lhere
+.Lhere:
+	popl	%ebx
+	addl	$_GLOBAL_OFFSET_TABLE_+[.-.Lhere], %ebx
+#endif
+	movl	%eax, %ebx
+	movl	$__NR_exit, %eax
+	int	$0x80
+
+/* Need to indirect jump to syscall error 
+ * or we end up with TEXTREL's
+ */
+__error:
+	jmp __syscall_error
+
+.size clone,.-clone
+weak_alias(clone, __clone)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/i386/crt1.S
new file mode 100644
index 0000000..a133cb9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/crt1.S
@@ -0,0 +1,140 @@
+/* Startup code compliant to the ELF i386 ABI.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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.  The SVR4/i386 ABI (pages 3-31, 3-32) says that when the entry
+   point runs, most registers' values are unspecified, except for:
+
+   %edx		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.
+
+   %esp		The stack contains the arguments and environment:
+		0(%esp)			argc
+		4(%esp)			argv[0]
+		...
+		(4*argc)(%esp)		NULL
+		(4*(argc+1))(%esp)	envp[0]
+		...
+					NULL
+*/
+
+#include <features.h>
+
+.text
+.global _start
+.type   _start,%function
+#if defined(__UCLIBC_CTOR_DTOR__)
+.type   _init,%function
+.type   _fini,%function
+#else
+.weak   _init
+.weak   _fini
+#endif
+.type   main,%function
+.type   __uClibc_main,%function
+_start:
+	/* Clear the frame pointer.  The ABI suggests this be done, to mark
+	   the outermost frame obviously.  */
+	xorl %ebp, %ebp
+
+	/* Extract the arguments as encoded on the stack and set up
+	   the arguments for `main': argc, argv.  envp will be determined
+	   later in __libc_start_main.  */
+	popl %esi		/* Pop the argument count.  */
+	movl %esp, %ecx		/* argv starts just at the current stack top.*/
+
+	/* Before pushing the arguments align the stack to a 16-byte
+	(SSE needs 16-byte alignment) boundary to avoid penalties from
+	misaligned accesses.  Thanks to Edward Seidl <seidl@janed.com>
+	for pointing this out.  */
+	andl $0xfffffff0, %esp
+	pushl %eax		/* Push garbage because we allocate
+				   28 more bytes.  */
+
+	/* Provide the highest stack address to the user code (for stacks
+	   which grow downwards).  */
+	pushl %esp
+
+	pushl %edx		/* Push address of the shared library
+				   termination function.  */
+
+#ifdef __PIC__
+	/* Load PIC register.  */
+	call .L0
+.L0:
+	pop %ebx
+	addl $_GLOBAL_OFFSET_TABLE_+[.-.L0],%ebx
+
+	/* Push address of our own entry points to .fini and .init.  */
+	pushl _fini@GOT(%ebx)
+	pushl _init@GOT(%ebx)
+
+	pushl %ecx		/* Push second argument: argv.  */
+	pushl %esi		/* Push first argument: argc.  */
+
+	pushl main@GOT(%ebx)
+
+	/* Call the user's main function, and exit with its value.
+	   But let the libc call main.    */
+	call __uClibc_main@PLT
+#else
+	/* Push address of our own entry points to .fini and .init.  */
+	pushl $_fini
+	pushl $_init
+
+	pushl %ecx		/* Push second argument: argv.  */
+	pushl %esi		/* Push first argument: argc.  */
+
+	pushl $main
+
+	/* Call the user's main function, and exit with its value.
+	   But let the libc call main.    */
+	call __uClibc_main
+#endif
+
+	hlt			/* Crash if somehow `exit' does return.  */
+.size _start,.-_start
+
+/* Define a symbol for the first piece of initialized data.  */
+.data
+.global __data_start
+__data_start:
+.long 0
+.weak data_start
+	data_start = __data_start
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/crti.S b/ap/build/uClibc/libc/sysdeps/linux/i386/crti.S
new file mode 100644
index 0000000..7dbaaad
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/crti.S
@@ -0,0 +1,31 @@
+.section .init
+.global _init
+.type   _init,%function
+_init:
+	pushl	%ebp
+	movl	%esp, %ebp
+	pushl	%ebx
+	call	__get_pc_thunk_bx
+	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
+
+
+
+.section .fini
+.global _fini
+.type   _fini,%function
+_fini:
+	pushl	%ebp
+	movl	%esp, %ebp
+	pushl	%ebx
+	call	__get_pc_thunk_bx
+	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
+
+
+
+.section .gnu.linkonce.t.__get_pc_thunk_bx,"ax",@progbits
+.global __get_pc_thunk_bx
+.hidden	__get_pc_thunk_bx
+.type   __get_pc_thunk_bx,%function
+__get_pc_thunk_bx:
+	movl	(%esp), %ebx
+	ret
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/i386/crtn.S
new file mode 100644
index 0000000..34d5b38
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/crtn.S
@@ -0,0 +1,27 @@
+.file "initfini.c"
+
+.section .init
+.global _init
+.type   _init,%function
+	popl	%ebx
+	popl	%ebp
+	ret
+
+
+
+.section .fini
+.global _fini
+.type   _fini,%function
+	popl	%ebx
+	popl	%ebp
+	ret
+
+
+
+.section .gnu.linkonce.t.__get_pc_thunk_bx,"ax",@progbits
+.global __get_pc_thunk_bx
+.hidden	__get_pc_thunk_bx
+.type   __get_pc_thunk_bx,%function
+__get_pc_thunk_bx:
+	movl	(%esp), %ebx
+	ret
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/i386/fpu_control.h
new file mode 100644
index 0000000..c6cb005
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/fpu_control.h
@@ -0,0 +1,104 @@
+/* FPU control word bits.  i387 version.
+   Copyright (C) 1993,1995-1998,2000,2001,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Olaf Flebbe.
+
+   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	1
+
+/* Here is the dirty part. Set up your 387 through the control word
+ * (cw) register.
+ *
+ *     15-13    12  11-10  9-8     7-6     5    4    3    2    1    0
+ * | reserved | IC | RC  | PC | reserved | PM | UM | OM | ZM | DM | IM
+ *
+ * IM: Invalid operation mask
+ * DM: Denormalized operand mask
+ * ZM: Zero-divide mask
+ * OM: Overflow mask
+ * UM: Underflow mask
+ * PM: Precision (inexact result) mask
+ *
+ * Mask bit is 1 means no interrupt.
+ *
+ * PC: Precision control
+ * 11 - round to extended precision
+ * 10 - round to double precision
+ * 00 - round to single precision
+ *
+ * RC: Rounding control
+ * 00 - rounding to nearest
+ * 01 - rounding down (toward - infinity)
+ * 10 - rounding up (toward + infinity)
+ * 11 - rounding toward zero
+ *
+ * IC: Infinity control
+ * That is for 8087 and 80287 only.
+ *
+ * The hardware default is 0x037f which we use.
+ */
+
+#include <features.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_IM  0x01
+#define _FPU_MASK_DM  0x02
+#define _FPU_MASK_ZM  0x04
+#define _FPU_MASK_OM  0x08
+#define _FPU_MASK_UM  0x10
+#define _FPU_MASK_PM  0x20
+
+/* precision control */
+#define _FPU_EXTENDED 0x300	/* libm requires double extended precision.  */
+#define _FPU_DOUBLE   0x200
+#define _FPU_SINGLE   0x0
+
+/* rounding control */
+#define _FPU_RC_NEAREST 0x0    /* RECOMMENDED */
+#define _FPU_RC_DOWN    0x400
+#define _FPU_RC_UP      0x800
+#define _FPU_RC_ZERO    0xC00
+
+#define _FPU_RESERVED 0xF0C0  /* Reserved bits in cw */
+
+
+/* The fdlibm code requires strict IEEE double precision arithmetic,
+   and no interrupts for exceptions, rounding to nearest.  */
+
+#define _FPU_DEFAULT  0x037f
+
+/* IEEE:  same as above.  */
+#define _FPU_IEEE     0x037f
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
+
+/* Macros for accessing the hardware control word.
+
+   Note that the use of these macros is no sufficient anymore with
+   recent hardware.  Some floating point operations are executed in
+   the SSE/SSE2 engines which have their own control and status register.  */
+#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw))
+#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw))
+
+#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/i386/mmap.S b/ap/build/uClibc/libc/sysdeps/linux/i386/mmap.S
new file mode 100644
index 0000000..fe7a798
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/mmap.S
@@ -0,0 +1,51 @@
+/* Copyright (C) 1995,96,97,98,99,2000,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.
+
+   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 _ERRNO_H	1
+#include <features.h>
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+.text
+.global mmap
+.type   mmap,%function
+mmap:
+
+	/* Save registers.  */
+	movl %ebx, %edx
+
+	movl $__NR_mmap, %eax	/* System call number in %eax.  */
+
+	lea 4(%esp), %ebx		/* Address of args is 1st arg.  */
+
+	/* Do the system call trap.  */
+	int $0x80
+
+	/* Restore registers.  */
+	movl %edx, %ebx
+
+	/* If 0 > %eax > -4096 there was an error.  */
+	cmpl $-4096, %eax
+	ja __syscall_error
+
+	/* Successful; return the syscall's value.  */
+	ret
+
+.size mmap,.-mmap
+
+libc_hidden_def(mmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/mmap64.S b/ap/build/uClibc/libc/sysdeps/linux/i386/mmap64.S
new file mode 100644
index 0000000..a6b4aa0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/mmap64.S
@@ -0,0 +1,93 @@
+/* Copyright (C) 1995,96,97,98,99,2000,2002 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 _ERRNO_H	1
+#include <features.h>
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_mmap2
+
+
+#define LINKAGE     4
+#define PTR_SIZE    4
+#define SVRSP	16		/* saved register space */
+#define PARMS	LINKAGE+SVRSP	/* space for 4 saved regs */
+#define ADDR	PARMS
+#define LEN	ADDR+PTR_SIZE
+#define PROT	LEN+4
+#define FLAGS	PROT+4
+#define FD	FLAGS+4
+#define OFFLO	FD+4
+#define OFFHI	OFFLO+4
+
+.text
+.global mmap64
+.type   mmap64,%function
+
+mmap64:
+	/* Save registers.  */
+	pushl %ebp
+	pushl %ebx
+	pushl %esi
+	pushl %edi
+
+	movl OFFLO(%esp), %edx
+	movl OFFHI(%esp), %ecx
+	testl $0xfff, %edx
+	jne L_einval
+	shrdl $12, %ecx, %edx		/* mmap2 takes the offset in pages.  */
+	shrl $12, %ecx
+	jne L_einval
+	movl %edx, %ebp
+
+	movl ADDR(%esp), %ebx
+	movl LEN(%esp), %ecx
+	movl PROT(%esp), %edx
+	movl FLAGS(%esp), %esi
+	movl FD(%esp), %edi
+
+	movl $__NR_mmap2, %eax	/* System call number in %eax.  */
+	/* Do the system call trap.  */
+	int $0x80
+
+	/* Restore registers.  */
+	popl %edi
+	popl %esi
+	popl %ebx
+	popl %ebp
+
+	/* If 0 > %eax > -4096 there was an error.  */
+	cmpl $-4095,%eax
+	ja __syscall_error
+	/* Successful; return the syscall's value.  */
+	ret
+
+	/* This means the offset value is too large.  */
+L_einval:
+	popl %edi
+	popl %esi
+	popl %ebx
+	popl %ebp
+	movl $-EINVAL, %eax
+	jmp __syscall_error
+
+.size mmap64,.-mmap64
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/posix_fadvise64.S b/ap/build/uClibc/libc/sysdeps/linux/i386/posix_fadvise64.S
new file mode 100644
index 0000000..8a8947d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/posix_fadvise64.S
@@ -0,0 +1,109 @@
+/* Copyright (C) 1995-2000,2002,2003,2004,2005,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.  */
+
+#define _ERRNO_H	1
+#include <features.h>
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+#if defined __NR_fadvise64_64 || defined __NR_fadvise64
+
+/* 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
+*/
+
+.text
+.global posix_fadvise64
+.type   posix_fadvise64,%function
+posix_fadvise64:
+#if defined __NR_fadvise64_64
+	/* Save regs  */
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	movl $__NR_fadvise64_64, %eax	/* Syscall number in %eax.  */
+
+	movl	20(%esp), %ebx
+	movl	24(%esp), %ecx
+	movl	28(%esp), %edx
+	movl	32(%esp), %esi
+	movl	36(%esp), %edi
+	movl	40(%esp), %ebp
+
+	/* Do the system call trap.  */
+	int $0x80
+
+	/* Restore regs  */
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+
+	/* Returns 0 on success, else an error code.  */
+	negl	%eax
+
+#elif defined __NR_fadvise64
+	/* Save regs  */
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+#if 0
+	/* does len overflow long?  */
+	cmpl	$0, 28(%esp)
+	movl	$-EOVERFLOW, %eax
+	jne	overflow
+#endif
+	movl $__NR_fadvise64, %eax	/* Syscall number in %eax.  */
+
+	movl	16(%esp), %ebx
+	movl	20(%esp), %ecx
+	movl	24(%esp), %edx
+	movl	28(%esp), %esi
+	movl	32(%esp), %edi
+
+	/* Do the system call trap.  */
+	int $0x80
+overflow:
+	/* Restore regs  */
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+
+	/* Returns 0 on success, else an error code.  */
+	negl	%eax
+#endif
+
+	/* Successful; return the syscall's value.  */
+	ret
+
+.size posix_fadvise64,.-posix_fadvise64
+
+/*
+** libc_hidden_def(__libc_posix_fadvise64)
+** #if defined __UCLIBC_HAS_LFS__ && defined __UCLIBC_HAS_ADVANCED_REALTIME__
+** weak_alias(__libc_posix_fadvise64,posix_fadvise64)
+** #endif
+*/
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/i386/setjmp.S
new file mode 100644
index 0000000..20a6a0b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/setjmp.S
@@ -0,0 +1,58 @@
+/* setjmp for i386, ELF version.
+   Copyright (C) 1995, 1996, 1997, 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.  */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+
+.global __sigsetjmp
+.type   __sigsetjmp,%function
+
+__sigsetjmp:
+        movl 4   (%esp), %eax
+     	/* Save registers.  */
+        movl %ebx, (0 *4)(%eax)
+        movl %esi, (1 *4)(%eax)
+        movl %edi, (2 *4)(%eax)
+	/* Save SP as it will be after we return.  */
+        leal 4(%esp), %ecx       
+        movl %ecx, (4 *4)(%eax)
+	/* Save PC we are returning to now.  */
+        movl 0(%esp), %ecx       
+        movl %ecx, (5 *4)(%eax)
+	/* Save caller's frame pointer.  */
+        movl %ebp, (3 *4)(%eax)  
+
+	/* Make a tail call to __sigjmp_save; it takes the same args.  */
+#ifdef	__PIC__
+	/* We cannot use the PLT, because it requires that %ebx be set, but
+           we can't save and restore our caller's value.  Instead, we do an
+           indirect jump through the GOT, using for the temporary register
+           %ecx, which is call-clobbered.  */
+	call .Lhere
+.Lhere:
+	popl %ecx
+	addl $_GLOBAL_OFFSET_TABLE_+[.- .Lhere  ], %ecx
+	movl    __sigjmp_save    @GOT  (%ecx), %ecx
+	jmp *%ecx
+#else
+	jmp   __sigjmp_save
+#endif
+.size __sigsetjmp,.-__sigsetjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/i386/sigaction.c
new file mode 100644
index 0000000..a6a22de
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sigaction.c
@@ -0,0 +1,142 @@
+/* Copyright (C) 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+
+   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 __typeof(sigaction) __libc_sigaction;
+
+
+#if defined __NR_rt_sigaction
+
+extern void restore_rt(void) __asm__ ("__restore_rt") attribute_hidden;
+extern void restore(void) __asm__ ("__restore") attribute_hidden;
+
+/* 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) {
+		memcpy(&kact, act, sizeof(kact));
+		kact.sa_flags |= SA_RESTORER;
+		kact.sa_restorer = (act->sa_flags & SA_SIGINFO) ? &restore_rt : &restore;
+		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
+
+extern void restore(void) __asm__ ("__restore") attribute_hidden;
+
+/* 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 | SA_RESTORER;
+		kact.sa_restorer = &restore;
+	}
+	__asm__ __volatile__ (
+		"	pushl	%%ebx\n"
+		"	movl	%3, %%ebx\n"
+		"	int	$0x80\n"
+		"	popl	%%ebx\n"
+		: "=a" (result), "=m" (koact)
+		: "0" (__NR_sigaction), "r" (sig), "m" (kact),
+		  "c" (act ? &kact : NULL),
+		  "d" (oact ? &koact : NULL));
+	if (result < 0) {
+		__set_errno(-result);
+		return -1;
+	}
+	if (oact) {
+		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
+
+
+/* NOTE: Please think twice before making any changes to the bits of
+   code below.  GDB needs some intimate knowledge about it to
+   recognize them as signal trampolines, and make backtraces through
+   signal handlers work right.  Important are both the names
+   (__restore and __restore_rt) and the exact instruction sequence.
+   If you ever feel the need to make any changes, please notify the
+   appropriate GDB maintainer.  */
+
+#define RESTORE(name, syscall) RESTORE2(name, syscall)
+
+#ifdef __NR_rt_sigaction
+/* The return code for realtime-signals.  */
+# define RESTORE2(name, syscall) \
+__asm__	(						\
+	".text\n"					\
+	"__" #name ":\n"				\
+	"	movl	$" #syscall ", %eax\n"		\
+	"	int	$0x80\n"			\
+);
+RESTORE(restore_rt, __NR_rt_sigreturn)
+#endif
+
+#ifdef __NR_sigreturn
+/* For the boring old signals.  */
+# undef RESTORE2
+# define RESTORE2(name, syscall) \
+__asm__ (						\
+	".text\n"					\
+	"__" #name ":\n"				\
+	"	popl	%eax\n"				\
+	"	movl	$" #syscall ", %eax\n"		\
+	"	int	$0x80\n"			\
+);
+RESTORE(restore, __NR_sigreturn)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/sync_file_range.S b/ap/build/uClibc/libc/sysdeps/linux/i386/sync_file_range.S
new file mode 100644
index 0000000..6cdaf45
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sync_file_range.S
@@ -0,0 +1,67 @@
+/* Copyright (C) 2006, 2007 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 _ERRNO_H	1
+#include <features.h>
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+.text
+.global sync_file_range
+.type   sync_file_range,%function
+sync_file_range:
+#ifdef __NR_sync_file_range
+
+	/* Save regs */
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	pushl	%ebp
+
+	movl $__NR_sync_file_range, %eax	/* Syscall number in %eax.  */
+
+	movl	20(%esp), %ebx
+	movl	24(%esp), %ecx
+	movl	28(%esp), %edx
+	movl	32(%esp), %esi
+	movl	36(%esp), %edi
+	movl	40(%esp), %ebp
+
+	/* Do the system call trap.  */
+	int $0x80
+
+	/* Restore regs  */
+	popl	%ebp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+
+	/* If 0 > %eax > -4096 there was an error.  */
+	cmpl $-4096, %eax
+	ja __syscall_error
+#else
+	movl	$-ENOSYS, %eax
+	jmp __syscall_error
+#endif
+	/* Successful; return the syscall's value.  */
+	ret
+
+.size sync_file_range,.-sync_file_range
+
+libc_hidden_def(sync_file_range)
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/sys/debugreg.h b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/debugreg.h
new file mode 100644
index 0000000..c99c943
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/debugreg.h
@@ -0,0 +1,91 @@
+/* Copyright (C) 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 _SYS_DEBUGREG_H
+#define _SYS_DEBUGREG_H	1
+
+/* Indicate the register numbers for a number of the specific
+   debug registers.  Registers 0-3 contain the addresses we wish to trap on */
+#define DR_FIRSTADDR 0        /* u_debugreg[DR_FIRSTADDR] */
+#define DR_LASTADDR 3         /* u_debugreg[DR_LASTADDR]  */
+
+#define DR_STATUS 6           /* u_debugreg[DR_STATUS]     */
+#define DR_CONTROL 7          /* u_debugreg[DR_CONTROL] */
+
+/* Define a few things for the status register.  We can use this to determine
+   which debugging register was responsible for the trap.  The other bits
+   are either reserved or not of interest to us. */
+
+#define DR_TRAP0	(0x1)		/* db0 */
+#define DR_TRAP1	(0x2)		/* db1 */
+#define DR_TRAP2	(0x4)		/* db2 */
+#define DR_TRAP3	(0x8)		/* db3 */
+
+#define DR_STEP		(0x4000)	/* single-step */
+#define DR_SWITCH	(0x8000)	/* task switch */
+
+/* Now define a bunch of things for manipulating the control register.
+   The top two bytes of the control register consist of 4 fields of 4
+   bits - each field corresponds to one of the four debug registers,
+   and indicates what types of access we trap on, and how large the data
+   field is that we are looking at */
+
+#define DR_CONTROL_SHIFT 16   /* Skip this many bits in ctl register */
+#define DR_CONTROL_SIZE  4    /* 4 control bits per register */
+
+#define DR_RW_EXECUTE	(0x0) /* Settings for the access types to trap on */
+#define DR_RW_WRITE	(0x1)
+#define DR_RW_READ	(0x3)
+
+#define DR_LEN_1 (0x0)	      /* Settings for data length to trap on */
+#define DR_LEN_2 (0x4)
+#define DR_LEN_4 (0xC)
+
+/* The low byte to the control register determine which registers are
+   enabled.  There are 4 fields of two bits.  One bit is "local", meaning
+   that the processor will reset the bit after a task switch and the other
+   is global meaning that we have to explicitly reset the bit.  With linux,
+   you can use either one, since we explicitly zero the register when we enter
+   kernel mode. */
+
+#define DR_LOCAL_ENABLE_SHIFT  0   /* Extra shift to the local enable bit */
+#define DR_GLOBAL_ENABLE_SHIFT 1   /* Extra shift to the global enable bit */
+#define DR_ENABLE_SIZE	       2   /* 2 enable bits per register */
+
+#define DR_LOCAL_ENABLE_MASK  (0x55) /* Set  local bits for all 4 regs */
+#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
+
+/* The second byte to the control register has a few special things.
+
+    On the i386, you should set the DR_LOCAL_SLOWDOWN or
+    DR_GLOBAL_SLOWDOWN bits if you want to know exactly which
+    instruction triggered the watchpoint.  Setting these bits causes
+    the processor to run more slowly, but leaving them clear makes it
+    treat watchpoint hits as imprecise exceptions, so you can't
+    reliably determine which instruction caused the hit.
+
+    The i486 and all later IA-32 processors ignore DR_LOCAL_SLOWDOWN
+    and DR_GLOBAL_SLOWDOWN.  They always report the exception
+    precisely, except in some rare cases, which the user can't do
+    anything about.  */
+
+#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */
+#define DR_LOCAL_SLOWDOWN   (0x100)  /* Local slow the pipeline */
+#define DR_GLOBAL_SLOWDOWN  (0x200)  /* Global slow the pipeline */
+
+#endif	/* sys/debugreg.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/sys/elf.h b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/elf.h
new file mode 100644
index 0000000..d959cdc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/elf.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 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 _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/i386/sys/io.h b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/io.h
new file mode 100644
index 0000000..00205e4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/io.h
@@ -0,0 +1,184 @@
+/* Copyright (C) 1996, 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	_SYS_IO_H
+#define	_SYS_IO_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#if defined __UCLIBC_LINUX_SPECIFIC__
+/* 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.
+
+   Portability note: not all Linux platforms support this call.  Most
+   platforms based on the PC I/O architecture probably will, however.
+   E.g., Linux/Alpha for Alpha PCs supports this.  */
+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>3, permission to
+   access any I/O port is granted.  This call requires root
+   privileges. */
+extern int iopl (int __level) __THROW;
+#endif /* __UCLIBC_LINUX_SPECIFIC__ */
+
+#if defined __GNUC__ && __GNUC__ >= 2
+
+static __inline unsigned char
+inb (unsigned short int port)
+{
+  unsigned char _v;
+
+  __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned char
+inb_p (unsigned short int port)
+{
+  unsigned char _v;
+
+  __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned short int
+inw (unsigned short int port)
+{
+  unsigned short _v;
+
+  __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned short int
+inw_p (unsigned short int port)
+{
+  unsigned short int _v;
+
+  __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned int
+inl (unsigned short int port)
+{
+  unsigned int _v;
+
+  __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned int
+inl_p (unsigned short int port)
+{
+  unsigned int _v;
+  __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline void
+outb (unsigned char value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port));
+}
+
+static __inline void
+outb_p (unsigned char value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+outw (unsigned short int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port));
+
+}
+
+static __inline void
+outw_p (unsigned short int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+outl (unsigned int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (port));
+}
+
+static __inline void
+outl_p (unsigned int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+insb (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insb":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+insw (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insw":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+insl (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insl":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsb (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsw (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsl (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+#endif	/* GNU C */
+
+__END_DECLS
+#endif /* _SYS_IO_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/sys/perm.h b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/perm.h
new file mode 100644
index 0000000..db67d36
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/perm.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 1996, 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_PERM_H
+
+#define _SYS_PERM_H	1
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Set port input/output permissions.  */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+		   int __turn_on) __THROW;
+libc_hidden_proto(ioperm)
+
+
+/* Change I/O privilege level.  */
+extern int iopl (int __level) __THROW;
+
+__END_DECLS
+
+#endif	/* _SYS_PERM_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/procfs.h
new file mode 100644
index 0000000..f0be433
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/procfs.h
@@ -0,0 +1,131 @@
+/* Copyright (C) 1996, 1997, 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.  */
+
+#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_struct' 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_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers.  */
+typedef struct user_fpregs_struct elf_fpregset_t;
+
+/* Register set for the extended floating-point registers.  Includes
+   the Pentium III SSE registers in addition to the classic
+   floating-point stuff.  */
+typedef struct user_fpxregs_struct elf_fpxregset_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/i386/sys/reg.h b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/reg.h
new file mode 100644
index 0000000..39003c4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/reg.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 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.  */
+
+#ifndef _SYS_REG_H
+#define _SYS_REG_H	1
+
+/* Index into an array of 4 byte integers returned from ptrace for
+ * location of the users' stored general purpose registers. */
+
+#define EBX 0
+#define ECX 1
+#define EDX 2
+#define ESI 3
+#define EDI 4
+#define EBP 5
+#define EAX 6
+#define DS 7
+#define ES 8
+#define FS 9
+#define GS 10
+#define ORIG_EAX 11
+#define EIP 12
+#define CS  13
+#define EFL 14
+#define UESP 15
+#define SS   16
+
+#endif	/* _SYS_REG_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/ucontext.h
new file mode 100644
index 0000000..d6474c7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/ucontext.h
@@ -0,0 +1,129 @@
+/* Copyright (C) 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.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+
+/* Type for general register.  */
+typedef int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	19
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+#ifdef __USE_GNU
+/* Number of each register is the `gregset_t' array.  */
+enum
+{
+  REG_GS = 0,
+# define REG_GS		REG_GS
+  REG_FS,
+# define REG_FS		REG_FS
+  REG_ES,
+# define REG_ES		REG_ES
+  REG_DS,
+# define REG_DS		REG_DS
+  REG_EDI,
+# define REG_EDI	REG_EDI
+  REG_ESI,
+# define REG_ESI	REG_ESI
+  REG_EBP,
+# define REG_EBP	REG_EBP
+  REG_ESP,
+# define REG_ESP	REG_ESP
+  REG_EBX,
+# define REG_EBX	REG_EBX
+  REG_EDX,
+# define REG_EDX	REG_EDX
+  REG_ECX,
+# define REG_ECX	REG_ECX
+  REG_EAX,
+# define REG_EAX	REG_EAX
+  REG_TRAPNO,
+# define REG_TRAPNO	REG_TRAPNO
+  REG_ERR,
+# define REG_ERR	REG_ERR
+  REG_EIP,
+# define REG_EIP	REG_EIP
+  REG_CS,
+# define REG_CS		REG_CS
+  REG_EFL,
+# define REG_EFL	REG_EFL
+  REG_UESP,
+# define REG_UESP	REG_UESP
+  REG_SS
+# define REG_SS	REG_SS
+};
+#endif
+
+/* Definitions taken from the kernel headers.  */
+struct _libc_fpreg
+{
+  unsigned short int significand[4];
+  unsigned short int exponent;
+};
+
+struct _libc_fpstate
+{
+  unsigned long int cw;
+  unsigned long int sw;
+  unsigned long int tag;
+  unsigned long int ipoff;
+  unsigned long int cssel;
+  unsigned long int dataoff;
+  unsigned long int datasel;
+  struct _libc_fpreg _st[8];
+  unsigned long int status;
+};
+
+/* Structure to describe FPU registers.  */
+typedef struct _libc_fpstate *fpregset_t;
+
+/* Context to describe whole processor state.  */
+typedef struct
+  {
+    gregset_t gregs;
+    /* Due to Linux's history we have to use a pointer here.  The SysV/i386
+       ABI requires a struct with the values.  */
+    fpregset_t fpregs;
+    unsigned long int oldmask;
+    unsigned long int cr2;
+  } mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+    struct _libc_fpstate __fpregs_mem;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/user.h
new file mode 100644
index 0000000..c5cfff2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/user.h
@@ -0,0 +1,101 @@
+/* Copyright (C) 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 _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
+{
+  long int cwd;
+  long int swd;
+  long int twd;
+  long int fip;
+  long int fcs;
+  long int foo;
+  long int fos;
+  long int st_space [20];
+};
+
+struct user_fpxregs_struct
+{
+  unsigned short int cwd;
+  unsigned short int swd;
+  unsigned short int twd;
+  unsigned short int fop;
+  long int fip;
+  long int fcs;
+  long int foo;
+  long int fos;
+  long int mxcsr;
+  long int reserved;
+  long int st_space[32];   /* 8*16 bytes for each FP-reg = 128 bytes */
+  long int xmm_space[32];  /* 8*16 bytes for each XMM-reg = 128 bytes */
+  long int padding[56];
+};
+
+struct user_regs_struct
+{
+  long int ebx;
+  long int ecx;
+  long int edx;
+  long int esi;
+  long int edi;
+  long int ebp;
+  long int eax;
+  long int xds;
+  long int xes;
+  long int xfs;
+  long int xgs;
+  long int orig_eax;
+  long int eip;
+  long int xcs;
+  long int eflags;
+  long int esp;
+  long int xss;
+};
+
+struct user
+{
+  struct user_regs_struct	regs;
+  int				u_fpvalid;
+  struct user_fpregs_struct	i387;
+  unsigned long int		u_tsize;
+  unsigned long int		u_dsize;
+  unsigned long int		u_ssize;
+  unsigned long			start_code;
+  unsigned long			start_stack;
+  long int			signal;
+  int				reserved;
+  struct user_regs_struct*	u_ar0;
+  struct user_fpregs_struct*	u_fpstate;
+  unsigned long int		magic;
+  char				u_comm [32];
+  int				u_debugreg [8];
+};
+
+#include <bits/uClibc_page.h>
+#define NBPG			PAGE_SIZE
+#define UPAGES			1
+#define HOST_TEXT_START_ADDR	(u.start_code)
+#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
+
+#endif	/* _SYS_USER_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/sys/vm86.h b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/vm86.h
new file mode 100644
index 0000000..8faeed7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sys/vm86.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996, 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_VM86_H
+
+#define _SYS_VM86_H	1
+#include <features.h>
+
+/* Get constants and data types from kernel header file.  */
+#include <asm/vm86.h>
+
+__BEGIN_DECLS
+
+/* Enter virtual 8086 mode.  */
+extern int vm86 (struct vm86_struct *__info) __THROW;
+
+__END_DECLS
+
+#endif	/* _SYS_VM86_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/syscall.S b/ap/build/uClibc/libc/sysdeps/linux/i386/syscall.S
new file mode 100644
index 0000000..b9f65fe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/syscall.S
@@ -0,0 +1,50 @@
+/*
+ * June 27, 2001             Manuel Novoa III
+ *
+ * This is a heavily modified version of gcc's output for the _syscall5 macro.
+ * The idea (originally from dietlibc) is that all syscall functions simply set
+ * the syscall number as the first argument, then set the syscall arguments as
+ * the next up-to-five arguments, and then jump here.  All the common work is
+ * done by syscall(), saving a fair amount of generated code when a number of
+ * syscalls are used.  The (potential) cost is some unnecessary pushes, pops,
+ * and movs but the execution time penalty should be relatively small compared
+ * to the cost of the syscall itself.
+ *
+ * July 24, 2002 
+ *
+ * Modified by Erik Andersen to take all function parameters from off the stack
+ * like a proper function and eliminates the old 255 syscall number limit.  So
+ * now we can just call this as a function as syscall() per the function
+ * prototype in unistd.h, so to call _exit(42) you can just call.
+ *         syscall(__NR_exit, 42);
+ * and things will just work.
+ */
+
+.text
+.global syscall
+.type   syscall,%function
+syscall:
+	pushl %ebp
+	pushl %edi
+	pushl %esi
+	pushl %ebx
+
+	movl  44(%esp),%ebp	/* Load the 6 syscall argument registers */
+	movl  40(%esp),%edi
+	movl  36(%esp),%esi
+	movl  32(%esp),%edx
+	movl  28(%esp),%ecx
+	movl  24(%esp),%ebx
+	movl  20(%esp),%eax	/* Load syscall number into %eax.  */
+	int $0x80
+
+	popl %ebx
+	popl %esi
+	popl %edi
+	popl %ebp
+
+	cmpl $-4095,%eax
+	jae  __syscall_error
+	ret			/* Return to caller.  */
+
+.size syscall,.-syscall
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/i386/sysdep.h
new file mode 100644
index 0000000..b06d392
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/sysdep.h
@@ -0,0 +1,462 @@
+/* Copyright (C) 1992,1993,1995-2000,2002-2006,2007
+	Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
+
+   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_I386_SYSDEP_H
+#define _LINUX_I386_SYSDEP_H 1
+
+#include <sys/syscall.h>
+#include <common/sysdep.h>
+
+#ifdef	__ASSEMBLER__
+
+/* Syntactic details of assembler.  */
+
+/* ELF uses byte-counts for .align, most others use log2 of count of bytes.  */
+#define ALIGNARG(log2) 1<<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 an entry point visible from C.
+
+   There is currently a bug in gdb which prevents us from specifying
+   incomplete stabs information.  Fake some entries here which specify
+   the current source file.  */
+#define	ENTRY(name)							      \
+  STABS_CURRENT_FILE1("")						      \
+  STABS_CURRENT_FILE(name)						      \
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);				      \
+  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)			      \
+  .align ALIGNARG(4);							      \
+  STABS_FUN(name)							      \
+  C_LABEL(name)								      \
+  cfi_startproc;							      \
+  CALL_MCOUNT
+
+#undef	END
+#define END(name)							      \
+  cfi_endproc;								      \
+  ASM_SIZE_DIRECTIVE(name)						      \
+  STABS_FUN_END(name)
+
+#ifdef HAVE_CPP_ASM_DEBUGINFO
+/* Disable that goop, because we just pass -g through to the assembler
+   and it generates proper line number information directly.  */
+# define STABS_CURRENT_FILE1(name)
+# define STABS_CURRENT_FILE(name)
+# define STABS_FUN(name)
+# define STABS_FUN_END(name)
+#else
+/* Remove the following two lines once the gdb bug is fixed.  */
+#define STABS_CURRENT_FILE(name)					      \
+  STABS_CURRENT_FILE1 (#name)
+#define STABS_CURRENT_FILE1(name)					      \
+  1: .stabs name,100,0,0,1b;
+/* Emit stabs definition lines.  We use F(0,1) and define t(0,1) as `int',
+   the same way gcc does it.  */
+#define STABS_FUN(name) STABS_FUN2(name, name##:F(0,1))
+#define STABS_FUN2(name, namestr)					      \
+  .stabs "int:t(0,1)=r(0,1);-2147483648;2147483647;",128,0,0,0;		      \
+  .stabs #namestr,36,0,0,name;
+#define STABS_FUN_END(name)						      \
+  1: .stabs "",36,0,0,1b-name;
+#endif
+
+/* If compiled for profiling, call `mcount' at the start of each function.  */
+#ifdef	PROF
+/* The mcount code relies on a normal frame pointer being on the stack
+   to locate our caller, so push one just for its benefit.  */
+#define CALL_MCOUNT \
+  pushl %ebp; cfi_adjust_cfa_offset (4); movl %esp, %ebp; \
+  cfi_def_cfa_register (ebp); call JUMPTARGET(mcount); \
+  popl %ebp; cfi_def_cfa (esp, 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
+
+#undef JUMPTARGET
+#ifdef __PIC__
+#define JUMPTARGET(name)	name##@PLT
+#define SYSCALL_PIC_SETUP \
+    pushl %ebx;								      \
+    cfi_adjust_cfa_offset (4);						      \
+    call 0f;								      \
+0:  popl %ebx;								      \
+    cfi_adjust_cfa_offset (-4);						      \
+    addl $_GLOBAL_OFFSET_TABLE+[.-0b], %ebx;
+
+
+# define SETUP_PIC_REG(reg) \
+  .ifndef __x86.get_pc_thunk.reg;					      \
+  .section .gnu.linkonce.t.__x86.get_pc_thunk.reg,"ax",@progbits;	      \
+  .globl __x86.get_pc_thunk.reg;					      \
+  .hidden __x86.get_pc_thunk.reg;					      \
+  .type __x86.get_pc_thunk.reg,@function;				      \
+__x86.get_pc_thunk.reg:						      \
+  movl (%esp), %e##reg;							      \
+  ret;									      \
+  .size __x86.get_pc_thunk.reg, . - __x86.get_pc_thunk.reg;		      \
+  .previous;								      \
+  .endif;								      \
+  call __x86.get_pc_thunk.reg
+
+# define LOAD_PIC_REG(reg) \
+  SETUP_PIC_REG(reg); addl $_GLOBAL_OFFSET_TABLE_, %e##reg
+
+#else
+#define JUMPTARGET(name)	name
+#define SYSCALL_PIC_SETUP	/* Nothing.  */
+#endif
+
+/* Local label name for asm code. */
+#ifndef L
+#ifdef HAVE_ELF
+#define L(name)		.L##name
+#else
+#define L(name)		name
+#endif
+#endif
+
+/* Avoid conflics with thunk section */
+#undef __i686
+#endif	/* __ASSEMBLER__ */
+
+#ifndef offsetof
+# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+/* 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 SYS_ify(syscall_name)	__NR_##syscall_name
+
+#if defined USE_DL_SYSINFO \
+    && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define I386_USE_SYSENTER	1
+#else
+# undef I386_USE_SYSENTER
+#endif
+
+#ifdef __ASSEMBLER__
+
+/* 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 %eax
+   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 savely
+   test with -4095.  */
+
+/* We don't want the label for the error handle to be global when we define
+   it here.  */
+#ifdef __PIC__
+# define SYSCALL_ERROR_LABEL 0f
+#else
+# define SYSCALL_ERROR_LABEL syscall_error
+#endif
+
+#undef	PSEUDO
+#define	PSEUDO(name, syscall_name, args)				      \
+  .text;								      \
+  ENTRY (name)								      \
+    DO_CALL (syscall_name, args);					      \
+    cmpl $-4095, %eax;							      \
+    jae SYSCALL_ERROR_LABEL;						      \
+  L(pseudo_end):
+
+#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)
+
+#undef	PSEUDO_END_NOERRNO
+#define	PSEUDO_END_NOERRNO(name)					      \
+  END (name)
+
+#define ret_NOERRNO ret
+
+/* 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);					      \
+    negl %eax
+
+#undef	PSEUDO_END_ERRVAL
+#define	PSEUDO_END_ERRVAL(name) \
+  END (name)
+
+#define ret_ERRVAL ret
+
+#ifndef __PIC__
+# define SYSCALL_ERROR_HANDLER	/* Nothing here; code in sysdep.S is used.  */
+#else
+
+# ifdef RTLD_PRIVATE_ERRNO
+#  define SYSCALL_ERROR_HANDLER						      \
+0:SETUP_PIC_REG(cx);							      \
+  addl $_GLOBAL_OFFSET_TABLE_, %ecx;					      \
+  xorl %edx, %edx;							      \
+  subl %eax, %edx;							      \
+  movl %edx, rtld_errno@GOTOFF(%ecx);					      \
+  orl $-1, %eax;							      \
+  jmp L(pseudo_end);
+
+# elif defined _LIBC_REENTRANT
+
+#  if defined USE___THREAD
+#   ifndef NOT_IN_libc
+#    define SYSCALL_ERROR_ERRNO __libc_errno
+#   else
+#    define SYSCALL_ERROR_ERRNO errno
+#   endif
+#   define SYSCALL_ERROR_HANDLER					      \
+0:SETUP_PIC_REG (cx);							      \
+  addl $_GLOBAL_OFFSET_TABLE_, %ecx;					      \
+  movl SYSCALL_ERROR_ERRNO@GOTNTPOFF(%ecx), %ecx;			      \
+  xorl %edx, %edx;							      \
+  subl %eax, %edx;							      \
+  SYSCALL_ERROR_HANDLER_TLS_STORE (%edx, %ecx);				      \
+  orl $-1, %eax;							      \
+  jmp L(pseudo_end);
+#   ifndef NO_TLS_DIRECT_SEG_REFS
+#    define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff)		      \
+  movl src, %gs:(destoff)
+#   else
+#    define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff)		      \
+  addl %gs:0, destoff;							      \
+  movl src, (destoff)
+#   endif
+#  else
+#   define SYSCALL_ERROR_HANDLER					      \
+0:pushl %ebx;								      \
+  cfi_adjust_cfa_offset (4);						      \
+  cfi_rel_offset (ebx, 0);						      \
+  SETUP_PIC_REG (bx);							      \
+  addl $_GLOBAL_OFFSET_TABLE_, %ebx;					      \
+  xorl %edx, %edx;							      \
+  subl %eax, %edx;							      \
+  pushl %edx;								      \
+  cfi_adjust_cfa_offset (4);						      \
+  call __errno_location@PLT;					              \
+  popl %ecx;								      \
+  cfi_adjust_cfa_offset (-4);						      \
+  popl %ebx;								      \
+  cfi_adjust_cfa_offset (-4);						      \
+  cfi_restore (ebx);							      \
+  movl %ecx, (%eax);							      \
+  orl $-1, %eax;							      \
+  jmp L(pseudo_end);
+/* A quick note: it is assumed that the call to `__errno_location' does
+   not modify the stack!  */
+#  endif
+# else
+/* Store (- %eax) into errno through the GOT.  */
+#  define SYSCALL_ERROR_HANDLER						      \
+0:SETUP_PIC_REG(cx);							      \
+  addl $_GLOBAL_OFFSET_TABLE_, %ecx;					      \
+  xorl %edx, %edx;							      \
+  subl %eax, %edx;							      \
+  movl errno@GOT(%ecx), %ecx;						      \
+  movl %edx, (%ecx);							      \
+  orl $-1, %eax;							      \
+  jmp L(pseudo_end);
+# endif	/* _LIBC_REENTRANT */
+#endif	/* __PIC__ */
+
+
+/* The original calling convention for system calls on Linux/i386 is
+   to use int $0x80.  */
+#ifdef I386_USE_SYSENTER
+# ifdef SHARED
+#  define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
+# else
+#  define ENTER_KERNEL call *_dl_sysinfo
+# endif
+#else
+# define ENTER_KERNEL int $0x80
+#endif
+
+/* Linux takes system call arguments in registers:
+
+	syscall number	%eax	     call-clobbered
+	arg 1		%ebx	     call-saved
+	arg 2		%ecx	     call-clobbered
+	arg 3		%edx	     call-clobbered
+	arg 4		%esi	     call-saved
+	arg 5		%edi	     call-saved
+	arg 6		%ebp	     call-saved
+
+   The stack layout upon entering the function is:
+
+	24(%esp)	Arg# 6
+	20(%esp)	Arg# 5
+	16(%esp)	Arg# 4
+	12(%esp)	Arg# 3
+	 8(%esp)	Arg# 2
+	 4(%esp)	Arg# 1
+	  (%esp)	Return address
+
+   (Of course a function with say 3 arguments does not have entries for
+   arguments 4, 5, and 6.)
+
+   The following code tries hard to be optimal.  A general assumption
+   (which is true according to the data books I have) is that
+
+	2 * xchg	is more expensive than	pushl + movl + popl
+
+   Beside this a neat trick is used.  The calling conventions for Linux
+   tell that among the registers used for parameters %ecx and %edx need
+   not be saved.  Beside this we may clobber this registers even when
+   they are not used for parameter passing.
+
+   As a result one can see below that we save the content of the %ebx
+   register in the %edx register when we have less than 3 arguments
+   (2 * movl is less expensive than pushl + popl).
+
+   Second unlike for the other registers we don't save the content of
+   %ecx and %edx when we have more than 1 and 2 registers resp.
+
+   The code below might look a bit long but we have to take care for
+   the pipelined processors (i586).  Here the `pushl' and `popl'
+   instructions are marked as NP (not pairable) but the exception is
+   two consecutive of these instruction.  This gives no penalty on
+   other processors though.  */
+
+#undef	DO_CALL
+#define DO_CALL(syscall_name, args)			      		      \
+    PUSHARGS_##args							      \
+    DOARGS_##args							      \
+    movl $SYS_ify (syscall_name), %eax;					      \
+    ENTER_KERNEL							      \
+    POPARGS_##args
+
+#define PUSHARGS_0	/* No arguments to push.  */
+#define	DOARGS_0	/* No arguments to frob.  */
+#define	POPARGS_0	/* No arguments to pop.  */
+#define	_PUSHARGS_0	/* No arguments to push.  */
+#define _DOARGS_0(n)	/* No arguments to frob.  */
+#define	_POPARGS_0	/* No arguments to pop.  */
+
+#define PUSHARGS_1	movl %ebx, %edx; L(SAVEBX1): PUSHARGS_0
+#define	DOARGS_1	_DOARGS_1 (4)
+#define	POPARGS_1	POPARGS_0; movl %edx, %ebx; L(RESTBX1):
+#define	_PUSHARGS_1	pushl %ebx; cfi_adjust_cfa_offset (4); \
+			cfi_rel_offset (ebx, 0); L(PUSHBX1): _PUSHARGS_0
+#define _DOARGS_1(n)	movl n(%esp), %ebx; _DOARGS_0(n-4)
+#define	_POPARGS_1	_POPARGS_0; popl %ebx; cfi_adjust_cfa_offset (-4); \
+			cfi_restore (ebx); L(POPBX1):
+
+#define PUSHARGS_2	PUSHARGS_1
+#define	DOARGS_2	_DOARGS_2 (8)
+#define	POPARGS_2	POPARGS_1
+#define _PUSHARGS_2	_PUSHARGS_1
+#define	_DOARGS_2(n)	movl n(%esp), %ecx; _DOARGS_1 (n-4)
+#define	_POPARGS_2	_POPARGS_1
+
+#define PUSHARGS_3	_PUSHARGS_2
+#define DOARGS_3	_DOARGS_3 (16)
+#define POPARGS_3	_POPARGS_3
+#define _PUSHARGS_3	_PUSHARGS_2
+#define _DOARGS_3(n)	movl n(%esp), %edx; _DOARGS_2 (n-4)
+#define _POPARGS_3	_POPARGS_2
+
+#define PUSHARGS_4	_PUSHARGS_4
+#define DOARGS_4	_DOARGS_4 (24)
+#define POPARGS_4	_POPARGS_4
+#define _PUSHARGS_4	pushl %esi; cfi_adjust_cfa_offset (4); \
+			cfi_rel_offset (esi, 0); L(PUSHSI1): _PUSHARGS_3
+#define _DOARGS_4(n)	movl n(%esp), %esi; _DOARGS_3 (n-4)
+#define _POPARGS_4	_POPARGS_3; popl %esi; cfi_adjust_cfa_offset (-4); \
+			cfi_restore (esi); L(POPSI1):
+
+#define PUSHARGS_5	_PUSHARGS_5
+#define DOARGS_5	_DOARGS_5 (32)
+#define POPARGS_5	_POPARGS_5
+#define _PUSHARGS_5	pushl %edi; cfi_adjust_cfa_offset (4); \
+			cfi_rel_offset (edi, 0); L(PUSHDI1): _PUSHARGS_4
+#define _DOARGS_5(n)	movl n(%esp), %edi; _DOARGS_4 (n-4)
+#define _POPARGS_5	_POPARGS_4; popl %edi; cfi_adjust_cfa_offset (-4); \
+			cfi_restore (edi); L(POPDI1):
+
+#define PUSHARGS_6	_PUSHARGS_6
+#define DOARGS_6	_DOARGS_6 (40)
+#define POPARGS_6	_POPARGS_6
+#define _PUSHARGS_6	pushl %ebp; cfi_adjust_cfa_offset (4); \
+			cfi_rel_offset (ebp, 0); L(PUSHBP1): _PUSHARGS_5
+#define _DOARGS_6(n)	movl n(%esp), %ebp; _DOARGS_5 (n-4)
+#define _POPARGS_6	_POPARGS_5; popl %ebp; cfi_adjust_cfa_offset (-4); \
+			cfi_restore (ebp); L(POPBP1):
+
+#endif	/* __ASSEMBLER__ */
+
+
+/* Pointer mangling support.  */
+#if defined NOT_IN_libc && defined IS_IN_rtld
+/* We cannot use the thread descriptor because in ld.so we use setjmp
+   earlier than the descriptor is initialized.  Using a global variable
+   is too complicated here since we have no PC-relative addressing mode.  */
+#else
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE(reg)	xorl %gs:POINTER_GUARD, reg;		      \
+				roll $9, reg
+#  define PTR_DEMANGLE(reg)	rorl $9, reg;				      \
+				xorl %gs:POINTER_GUARD, reg
+# else
+#  define PTR_MANGLE(var)	__asm__ ("xorl %%gs:%c2, %0\n"		      \
+				     "roll $9, %0"			      \
+				     : "=r" (var)			      \
+				     : "0" (var),			      \
+				       "i" (offsetof (tcbhead_t,	      \
+						      pointer_guard)))
+#  define PTR_DEMANGLE(var)	__asm__ ("rorl $9, %0\n"			      \
+				     "xorl %%gs:%c2, %0"		      \
+				     : "=r" (var)			      \
+				     : "0" (var),			      \
+				       "i" (offsetof (tcbhead_t,	      \
+						      pointer_guard)))
+# endif
+#endif
+
+#endif /* linux/i386/sysdep.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i386/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/i386/vfork.S
new file mode 100644
index 0000000..c9db2f4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i386/vfork.S
@@ -0,0 +1,41 @@
+/*
+ * 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>
+
+#ifndef __NR_vfork
+/* No vfork so use fork instead */
+# define __NR_vfork __NR_fork
+#endif
+
+.text
+.global __vfork
+.hidden __vfork
+.type   __vfork,%function
+
+__vfork:
+	popl %ecx
+
+#ifdef SAVE_PID
+	SAVE_PID
+#endif
+
+	movl $__NR_vfork,%eax
+	int $0x80
+	pushl %ecx
+
+#ifdef RESTORE_PID
+	RESTORE_PID
+#endif
+
+	cmpl $-4095,%eax
+	jae __syscall_error
+	ret
+
+.size __vfork,.-__vfork
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/AUTHORS b/ap/build/uClibc/libc/sysdeps/linux/i960/AUTHORS
new file mode 100644
index 0000000..0d65549
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/AUTHORS
@@ -0,0 +1,4 @@
+The initial support (inspired by what was done in an old i960 port of uC-libc):
+
+Martin Proulx <mproulx at okiok.com>
+http://www.okiok.com
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/Makefile b/ap/build/uClibc/libc/sysdeps/linux/i960/Makefile
new file mode 100644
index 0000000..d6ae358
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/Makefile
@@ -0,0 +1,55 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TOPDIR=../../../../
+include $(TOPDIR)Rules.mak
+
+#FIXME -- this arch should include its own crti.S and crtn.S
+UCLIBC_CTOR_DTOR=n
+
+CRT_SRC := crt0.S
+CRT_OBJ := crt0.o crt1.o
+CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
+
+SSRC := clone.S _mmap.S setjmp.S vfork.S
+SOBJ := $(patsubst %.S,%.o, $(SSRC))
+
+OBJS := $(SOBJ)
+
+OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
+
+all: $(OBJ_LIST) $(CTOR_TARGETS)
+
+$(OBJ_LIST): $(OBJS) $(CRT_OBJ)
+	$(STRIPTOOL) -x -R .note -R .comment $^
+	$(INSTALL) -d $(TOPDIR)lib/
+	cp $(CRT_OBJ) $(TOPDIR)lib/
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
+
+$(CRT_OBJ): $(CRT_SRC)
+	$(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
+
+$(SOBJ): %.o : %.S
+	$(CC) $(ASFLAGS) -c $< -o $@
+
+ifeq ($(UCLIBC_CTOR_DTOR),y)
+$(TOPDIR)lib/crti.o: crti.S
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
+
+$(TOPDIR)lib/crtn.o: crtn.S
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
+else
+$(CTOR_TARGETS):
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(AR) $(ARFLAGS) $@
+endif
+
+headers:
+
+clean:
+	$(RM) *.o *~ core
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/README b/ap/build/uClibc/libc/sysdeps/linux/i960/README
new file mode 100644
index 0000000..7516735
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/README
@@ -0,0 +1,71 @@
+Overview
+---------------------------------------------------------------------------
+
+This is the README file for the i960 support in uClibc.
+
+This has been tested with gcc 2.95.3 and i960-intel-coff target.
+
+There is no support at all to compile with the intel CTOOLS, as this would
+have required too many changes to uClibc.  So you won't see any support 
+in the asm files for position independent data or code.
+
+Quirks needed
+---------------------------------------------------------------------------
+
+prepended underscore
+--------------------
+
+As the i960 compiler prepends an underscore to symbols, it is critical that
+Rules.mak defines SYMBOL_PREFIX as _, such that -D__UCLIBC_UNDERSCORES__
+is added to CFLAGS to make sure that underscores are applied to symbol
+names when needed.
+
+
+__va_copy in va-i960.h
+----------------------
+
+When compiled with gcc-2.95, the __va_copy macro in va-i960.h seems to be broken
+and it has to be modified in order for uClibc to compile correctly.
+
+Change:
+
+#define __va_copy(dest, src) (dest) = (src)
+
+To:
+
+#define __va_copy(dest, src)  dest[0] = src[0]; dest[1] = src[1]
+
+
+gcc integration
+---------------------------------------------------------------------------
+
+I've preferred modifying the specs file so that the i960-intel-coff compiler
+directly compiles with uClibc.
+
+First, compile and install the standard i960-intel-coff compiler, which is meant
+to be used with newlib.
+
+Then, compile uClibc, installing over the newlib include files and libraries.
+
+Update the specs file with the included specs.uclinux.gcc-2.95.i960-intel-coff
+
+This specs file always build relocatable objects, which has the disadvantage
+of not letting you know if the link is missing any symbols.
+
+coff2flt
+---------------------------------------------------------------------------
+
+In order to run the executables under uClinux, fully relocatable binaries 
+need to be built using coff2flt.
+
+We have built a working coff2flt that works with the i960 and the current version
+of binfmt_flat with uClinux.
+
+Contact Martin Proulx <mproulx at okiok.com> for further informations.
+
+
+
+
+
+Check: 
+    _mmap.S: besoin???
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/i960/bits/endian.h
new file mode 100644
index 0000000..e2b1316
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/bits/endian.h
@@ -0,0 +1,15 @@
+/* This file should define __BYTE_ORDER as appropriate for the machine
+   in question.  See string/endian.h for how to define it.
+
+   If only the stub bits/endian.h applies to a particular configuration,
+   bytesex.h is generated by running a program on the host machine.
+   So if cross-compiling to a machine with a different byte order,
+   the bits/endian.h file for that machine must exist.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/i960/bits/fcntl.h
new file mode 100644
index 0000000..696f961
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/bits/fcntl.h
@@ -0,0 +1,233 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995, 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	_FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+
+#include <sys/types.h>
+
+/* 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_DIRECT	 040000	/* Direct disk access.	*/
+# define O_DIRECTORY	0200000	/* Must be a directory.	 */
+# define O_NOFOLLOW	0400000	/* Do not follow links.	 */
+#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	0100000
+#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_XOPEN2K
+# 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]FL.  */
+#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/i960/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/i960/bits/setjmp.h
new file mode 100644
index 0000000..f90e4ce
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/bits/setjmp.h
@@ -0,0 +1,38 @@
+/* Define the machine-dependent type `jmp_buf'.  i960 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
+
+/*
+ * assume that every single local and global register
+ * must be saved.
+ *
+ * ___SAVEREGS is the number of quads to save.
+ *
+ * Using the structure will guarantee quad-word alignment for the
+ * jmp_buf type.
+ */
+
+#define ___SAVEREGS 8
+
+typedef struct __jmp_buf__ {
+  long _q0;
+  long _q1;
+  long _q2;
+  long _q3;
+} __attribute__ ((aligned (16))) __jmp_buf[___SAVEREGS] ;
+
+/* I have not yet figured out what this should be for the i960... */
+
+#if 0
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[0].__sp)
+#endif
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/i960/bits/syscalls.h
new file mode 100644
index 0000000..b218513
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/bits/syscalls.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#include <features.h>
+
+/* Do something very evil for now.  Until we create our own syscall
+ * macros, short circuit bits/sysnum.h  and use asm/unistd.h instead */
+#warning "fixme -- add arch specific syscall macros.h"
+#include <asm/unistd.h>
+
+#endif /* _BITS_SYSCALLS_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/i960/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..0ddef34
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/bits/uClibc_arch_features.h
@@ -0,0 +1,48 @@
+/*
+ * 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__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target 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/i960/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/i960/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/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/i960/clone.S b/ap/build/uClibc/libc/sysdeps/linux/i960/clone.S
new file mode 100644
index 0000000..f602fba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/clone.S
@@ -0,0 +1,62 @@
+#
+# clone.S, part of the i960 support for the uClibc library.
+#
+# Copyright (C) 2002 by Okiok Data Ltd.  http://www.okiok.com/
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Library General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# at 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Derived from an old port of uC-libc to the i960 by Keith Adams (kma@cse.ogi.edu).
+#
+
+#include <sys/syscall.h>        
+#include <bits/errno.h>
+        
+/* clone is even more special than fork as it mucks with stacks
+   and invokes a function in the right context after its all over.  */
+        
+/* int _clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
+
+        .globl clone
+clone: 
+        /* set up new stack image in regs r4-r7; argument will be in r3 in child.  */
+        ldconst 0, r4                   /* pfp == 0 */
+        addo    16, g1, r5              /* sp == newfp + 16 */
+        mov     g0, r6                  /* rip == fnc */
+        mov     g2, r7
+        stq     r4, (g1)
+
+        addo    sp, 4, sp
+        st      g10, -4(sp)
+        mov     sp, g10
+        ldconst __NR_clone, g13
+        calls   0
+
+        /* Do the system call */
+        cmpibg  0, g0, __syscall_error    /* if < 0, error */
+        be      thread_start            /* if == 0, we're the child */
+        ret                             /* we're the parent */
+
+__syscall_error:
+        not     g0, r3
+        callx   ___errno_location
+        st      r3, (g0)
+        ret
+
+thread_start:
+        # our new pfp is in g1; here we go
+        flushreg
+        mov     g1, pfp
+        flushreg
+        ret
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/crt0.S b/ap/build/uClibc/libc/sysdeps/linux/i960/crt0.S
new file mode 100644
index 0000000..b167ad7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/crt0.S
@@ -0,0 +1,58 @@
+#
+# crt0.S, part of the i960 support for the uClibc library.
+#
+# Copyright (C) 2002 by Okiok Data Ltd.  http://www.okiok.com/
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Library General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# at 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+/*
+ *
+ * The behavior in this file is tightly coupled with how the linux kernel sets things up
+ * on the stack before calling us.
+ *
+ * Currently fs/binfmt_flat.c (for STACK_GROWS_UP) and arch/i960/kernel/process.c
+ * build things so that a pointer to argc is left in g13 by start_thread().
+ *
+ * ^
+ * |                        <- sp somewhere around here, after being aligned.
+ * |
+ * |envp    -> envp[0]
+ * |argv    -> argv[0]
+ * |argc                    <- g13
+ *
+ * A complete picture of how things are set up can be seen in the comments of
+ * create_flat_tables_stack_grows_up in fs/binfmt_flat.c
+ *
+ * I believe having to use this register could probably be avoided.
+ *
+ */
+
+        .globl  start
+start:
+        mov     g13, r3
+        ldt     (r3), g0
+        callx   ___uClibc_main
+
+/* We might want to add some instruction so that it crashes if main returns */
+
+/* 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/i960/mmap.S b/ap/build/uClibc/libc/sysdeps/linux/i960/mmap.S
new file mode 100644
index 0000000..bc42679
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/mmap.S
@@ -0,0 +1,52 @@
+#
+# __mmap.S, part of the i960 support for the uClibc library.
+#
+# Copyright (C) 2002 by Okiok Data Ltd.  http://www.okiok.com/
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Library General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# at 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Derived from an old port of uC-libc to the i960 by Keith Adams (kma@cse.ogi.edu).
+#
+
+#include <sys/syscall.h>
+
+/* This is a plain system call.  The 6 arguments are already set up correctly */
+/* void  *  mmap(void  *start,  size_t length, int prot , int flags, int fd, off_t offset) */
+     
+           
+        .globl _mmap
+_mmap:  
+        mov     g13, r3
+        ldconst __NR_mmap, g13
+        calls   0
+        mov     r3, g13
+
+        /* We now need to check if the return value is a small negative integer.                    */
+        /* This is somewhat tricky as the return code (normally an address) is an                   */
+        /* unsigned type, or an ordinal in i960 assembler.                                          */
+        /* We'll use the fact that, integers from -256 to -1 are ordinals 0xFFFFFF00 to 0xFFFFFFFF. */
+        /* So by checking that the return address is in the top range of the ordinals, we'll        */
+        /* in fact be checking if it's not an encoded negated erro code.                            */
+
+        /* The range -256 to -1 should be enough since that in uClinux 2.0.39, there are            */
+        /* 124 system calls for the i960.                                                           */
+        
+        ldconst 0xFFFFFF00, r3  /* This is the integer's -256 representation */
+        cmpobl  g0, r3, 1f      /* Something smaller than this means it's out of the range, and a valid address */
+        subi    g0, 0, r3       /* If it's an errno, save its negated (now positive) value in _errno. */
+        st      r3, _errno      
+        subi    1, 0, g0        /* And return -1. */
+1:
+        ret
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/i960/setjmp.S
new file mode 100644
index 0000000..2133ef5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/setjmp.S
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * 
+ * Copyright (c) 1993 Intel Corporation
+ * 
+ * Intel hereby grants you permission to copy, modify, and distribute this
+ * software and its documentation.  Intel grants this permission provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation.  In addition, Intel grants this permission provided that
+ * you prominently mark as "not part of the original" any modifications
+ * made to this software or documentation, and that the name of Intel
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software or the documentation without specific,
+ * written prior permission.
+ * 
+ * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR
+ * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY
+ * OR FITNESS FOR A PARTICULAR PURPOSE.  Intel makes no guarantee or
+ * representations regarding the use of, or the results of the use of,
+ * the software and documentation in terms of correctness, accuracy,
+ * reliability, currentness, or otherwise; and you rely on the software,
+ * documentation and results solely at your own risk.
+ *
+ * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS,
+ * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES
+ * OF ANY KIND.  IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM
+ * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER.
+ * 
+ ******************************************************************************/
+
+/***************************************************************************
+ *
+ * Modified from the original in order to fit with 
+ * uClibc's setjmp, _setjmp, __sigsetjmp and ___sigjmp_save.
+ *
+ *
+ * int setjmp (jmp_buf __env)  is the BSD style setjmp function.
+ * It simply calls __sigsetjmp(env, 1)
+ *
+ * int _setjmp (jmp_buf __env) is the posix style setjmp function.
+ * It simply calls __sigsetjmp(env, 0)
+ * This is the one normally used.
+ *
+ ***************************************************************************/
+
+        .text 
+        .align  4
+        .globl _setjmp
+        .globl __setjmp
+        
+_setjmp:
+        mov 1, g1   /* __sigsetjmp(env, 1) */
+        bx __sigsetjmp
+
+__setjmp:
+        mov 0, g1   /* __sigsetjmp(env, 0) */
+        bx __sigsetjmp     
+
+        
+/******************************************************************************/
+/*                                                                            */
+/*      setjmp(), longjmp()                                                   */
+/*                                                                            */
+/******************************************************************************/
+	.file "setjmp.S"
+	.text
+	/* .link_pix */
+
+	.align	4
+	.globl	__sigsetjmp
+__sigsetjmp:
+	flushreg
+	andnot	0xf,pfp,g2	/* get pfp, mask out return status bits */
+	st	g2, 0x58(g0)	/* save fp of caller*/
+   /* save globals not killed by the calling convention */
+	stq	g8, 0x40(g0)	/* save g8-g11*/
+	st	g12, 0x50(g0)	/* save g12*/
+	st	g14, 0x54(g0)	/* save g14*/
+   /* save previous frame local registers */
+	ldq	(g2), g4	/* get previous frame pfp, sp, rip, r3 */
+	stq	g4, (g0)	/* save pfp, sp, rip, r3 */
+	ldq	0x10(g2), g4	/* get previous frame r4-r7 */
+	stq	g4, 0x10(g0)	/* save r4-r7 */
+	ldq	0x20(g2), g4	/* get previous frame r8-r11 */
+	stq	g4, 0x20(g0)	/* save r8-r11 */
+	ldq	0x30(g2), g4	/* get previous frame r12-r15 */
+	stq	g4, 0x30(g0)	/* save r12-r15 */
+
+        bx ___sigjmp_save   
+
+   /*
+    * fake a return to the place that called the corresponding __sigsetjmp
+   */
+	.align	4
+	.globl	___longjmp
+___longjmp:
+	call	0f		/* ensure there is at least one stack frame */
+
+0:
+	flushreg		/* do this before swapping stack */
+	ld	0x58(g0), pfp	/* get fp of caller of setjmp */
+   /* restore local registers 
+    * the following code modifies the frame of the function which originally 
+    *  called setjmp.
+    */
+	ldq	(g0), g4	/* get pfp, sp, rip, r3 */
+	stq	g4, (pfp)	/* restore pfp, sp, rip, r3 */
+	ldq	0x10(g0), g4	/* get r4-r7 */
+	stq	g4, 0x10(pfp)	/* restore r4-r7 */
+	ldq	0x20(g0), g4	/* get r8-r11 */
+	stq	g4, 0x20(pfp)	/* restore r8-r11 */
+	ldq	0x30(g0), g4	/* get r12-r15 */
+	stq	g4, 0x30(pfp)	/* restore r12-r15 */
+   /* restore global registers */
+	ldq	0x40(g0), g8	/* get old g8-g11 values */
+	ld	0x50(g0), g12	/* get old g12 value */
+	ld	0x54(g0), g14	/* get old g14 value */
+
+	mov	g1, g0		/* get return value */
+	cmpo	g0, 0		/* make sure it is not zero */
+	bne	0f
+	mov	1, g0		/* return 1 by default */
+0:
+	ret			/* return to caller of __sigsetjmp */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/specs.uclinux.gcc-2.95.i960-intel-coff b/ap/build/uClibc/libc/sysdeps/linux/i960/specs.uclinux.gcc-2.95.i960-intel-coff
new file mode 100644
index 0000000..cefd853
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/specs.uclinux.gcc-2.95.i960-intel-coff
@@ -0,0 +1,64 @@
+*asm:
+%{mka:-AKA}%{mkb:-AKB}%{msa:-ASA}%{msb:-ASB}	%{mmc:-AMC}%{mca:-ACA}%{mcc:-ACC}%{mcf:-ACF}        %{mja:-AJX}%{mjd:-AJX}%{mjf:-AJX}%{mrp:-AJX}	%{!mka:%{!mkb:%{!msa:%{!msb:%{!mmc:%{!mca:%{!mcc:%{!mcf:%{!mja:%{!mjd:%{!mjf:%{!mrp:-AKB}}}}}}}}}}}}	%{mlink-relax:-linkrelax}
+
+*asm_final:
+
+
+*cpp:
+%{mic*:-D__i960			%{mka:-D__i960KA}%{mkb:-D__i960KB}			%{mja:-D__i960JA}%{mjd:-D__i960JD}%{mjf:-D__i960JF}			%{mrp:-D__i960RP}			%{msa:-D__i960SA}%{msb:-D__i960SB}			%{mmc:-D__i960MC}			%{mca:-D__i960CA}%{mcc:-D__i960CC}			%{mcf:-D__i960CF}}	%{mka:-D__i960KA__ -D__i960_KA__}	%{mkb:-D__i960KB__ -D__i960_KB__}	%{msa:-D__i960SA__ -D__i960_SA__}	%{msb:-D__i960SB__ -D__i960_SB__}	%{mmc:-D__i960MC__ -D__i960_MC__}	%{mca:-D__i960CA__ -D__i960_CA__}	%{mcc:-D__i960CC__ -D__i960_CC__}	%{mcf:-D__i960CF__ -D__i960_CF__}	%{!mka:%{!mkb:%{!msa:%{!msb:%{!mmc:%{!mca:		%{!mcc:%{!mcf:-D__i960_KB -D__i960KB__ %{mic*:-D__i960KB}}}}}}}}}	%{mlong-double-64:-D__LONG_DOUBLE_64__}
+
+*cc1:
+%{!mka:%{!mkb:%{!msa:%{!msb:%{!mmc:%{!mca:%{!mcc:%{!mcf:%{!mja:%{!mjd:%{!mjf:%{!mrp:-mka}}}}}}}}}}}}	 %{!gs*:%{!gc*:%{mbout:%{g*:-gstabs}}		       %{mcoff:%{g*:-gcoff}}		       %{!mbout:%{!mcoff:%{g*:-gstabs}}}}}
+
+*cc1plus:
+
+
+*endfile:
+crtn.o%s
+
+*link:
+%{mka:-AKA}%{mkb:-AKB}%{msa:-ASA}%{msb:-ASB}	%{mmc:-AMC}%{mca:-ACA}%{mcc:-ACC}%{mcf:-ACF}        %{mja:-AJX}%{mjd:-AJX}%{mjf:-AJX}%{mrp:-AJX}	%{mbout:-Fbout}%{mcoff:-Fcoff}	%{mlink-relax:-relax} -r -d
+
+*lib:
+-lc -lgcc
+
+*libgcc:
+
+
+*startfile:
+%{!shared:%{pg:pgcrt0%O%s}%{!pg:%{p:pcrt0%O%s}%{!p:crt0%O%s}}} crti.o%s
+
+*switches_need_spaces:
+
+
+*signed_char:
+%{!fsigned-char:%{!mic*:-D__CHAR_UNSIGNED__}}
+
+*predefines:
+-Di960 -Di80960 -DI960 -DI80960 -Acpu(i960) -Amachine(i960) -Dunix -Dlinux -Asystem(posix) -D__linux__ -D__uClinux__ -DEMBED
+
+*cross_compile:
+1
+
+*version:
+2.95.3
+
+*multilib:
+. !mnumerics !msoft-float !mlong-double-64;float mnumerics !msoft-float !mlong-double-64;soft-float !mnumerics msoft-float !mlong-double-64;ld64 !mnumerics !msoft-float mlong-double-64;float/ld64 mnumerics !msoft-float mlong-double-64;soft-float/ld64 !mnumerics msoft-float mlong-double-64;
+
+*multilib_defaults:
+mnumerics
+
+*multilib_extra:
+
+
+*multilib_matches:
+msb mnumerics;msc mnumerics;mkb mnumerics;mkc mnumerics;mmc mnumerics;mcb mnumerics;mcc mnumerics;mjf mnumerics;msa msoft-float;mka msoft-float;mca msoft-float;mcf msoft-float;mnumerics mnumerics;msoft-float msoft-float;mlong-double-64 mlong-double-64;
+
+*linker:
+collect2
+
+*link_command:
+%{!fsyntax-only:  %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} 			%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}			%{!A:%{!nostdlib:%{!nostartfiles:%S}}}			%{static:} %{L*} %D %o			%{!nostdlib:%{!nodefaultlibs:%G %L %G}}			%{!A:%{!nostdlib:%{!nostartfiles:%E}}}			%{T*}			
+ }}}}}}
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/i960/sys/procfs.h
new file mode 100644
index 0000000..27abf8e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/sys/procfs.h
@@ -0,0 +1,126 @@
+/* Copyright (C) 1996, 1997, 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_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_struct' 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_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers.  */
+typedef struct user_m68kfp_struct 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/i960/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/i960/sys/ucontext.h
new file mode 100644
index 0000000..8c55ea4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/sys/ucontext.h
@@ -0,0 +1,76 @@
+/* Copyright (C) 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.  */
+
+/* Don't rely on this, the interface is currently messed up and may need to
+   be broken to be fixed.  */
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+
+/* Type for general register.  */
+typedef unsigned long int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	32 /* 16 global and 16 local */
+
+/* Container for all general registers.  */
+/* gregset_t must be an array.  The below declared array corresponds to:
+typedef struct gregset {
+	greg_t	g_regs[32];
+	greg_t	g_hi;
+	greg_t	g_lo;
+	greg_t	g_pad[3];
+} gregset_t;  */
+typedef greg_t gregset_t[NGREG];
+
+/* Container for all FPU registers.  */
+typedef struct fpregset {
+    /* No floating point registers on most i960 */
+
+    /* Otherwise, signal the missing implementation */
+#if defined(__i960SB) || defined(__i960KB)
+#error Floating point support is not yet implemented for the i960 platform.
+#endif
+} fpregset_t;
+
+
+/* Context to describe whole processor state.  */
+typedef struct
+  {
+    gregset_t gregs;
+    fpregset_t fpregs;
+  } mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/i960/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/i960/vfork.S
new file mode 100644
index 0000000..1646e1b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/i960/vfork.S
@@ -0,0 +1,33 @@
+/*
+ * clone.S, part of the i960 support for the uClibc library.
+ *
+ * Copyright (C) 2002 by Okiok Data Ltd.  http://www.okiok.com/
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/*
+ * Derived from an old port of uC-libc to the i960 by Keith Adams (kma@cse.ogi.edu).
+ */
+
+#include <sys/syscall.h>
+        
+#ifndef __NR_vfork
+#define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
+#endif
+     
+        .globl	___vfork
+        .hidden	___vfork
+___vfork:
+        mov         g13, r3
+        ldconst     __NR_vfork, g13
+        calls       0
+        mov         r3, g13
+        cmpible     0, g0, 1f
+        subo        g0, 0, r3
+        st          r3, _errno
+1:      
+        ret
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/Makefile b/ap/build/uClibc/libc/sysdeps/linux/ia64/Makefile
new file mode 100644
index 0000000..b1bf1ef
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/Makefile
@@ -0,0 +1,15 @@
+# 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.
+#
+
+TOPDIR=../../../../
+
+top_srcdir=$(TOPDIR)
+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/ia64/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/ia64/Makefile.arch
new file mode 100644
index 0000000..223f9ef
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/Makefile.arch
@@ -0,0 +1,12 @@
+# 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 := __syscall_error.c
+
+SSRC := \
+	__longjmp.S brk.S bsd-setjmp.S bsd-_setjmp.S clone2.S fork.S \
+	pipe.S setjmp.S syscall.S vfork.S
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/__longjmp.S
new file mode 100644
index 0000000..85fe936
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/__longjmp.S
@@ -0,0 +1,162 @@
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+   Contributed by David Mosberger-Tang <davidm@hpl.hp.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.
+
+   Note that __sigsetjmp() did NOT flush the register stack.  Instead,
+   we do it here since __longjmp() is usually much less frequently
+   invoked than __sigsetjmp(). The only difficulty is that __sigsetjmp()
+   didn't (and wouldn't be able to) save ar.rnat either.  This is a problem
+   because if we're not careful, we could end up loading random NaT bits.
+   There are two cases:
+
+	(i)  ar.bsp < ia64_rse_rnat_addr(jmpbuf.ar_bsp)
+		ar.rnat contains the desired bits---preserve ar.rnat
+		across loadrs and write to ar.bspstore
+
+	(ii) ar.bsp >= ia64_rse_rnat_addr(jmpbuf.ar_bsp)
+		The desired ar.rnat is stored in
+		ia64_rse_rnat_addr(jmpbuf.ar_bsp).  Load those
+		bits into ar.rnat after setting ar.bspstore. */
+
+#include "sysdep.h"
+#include <features.h>
+
+#	define	pPos	p6	/* is rotate count positive? */
+#	define	pNeg	p7	/* is rotate count negative? */
+
+
+	/* __longjmp(__jmp_buf buf, int val) */
+
+LEAF(__longjmp)
+	alloc r8=ar.pfs,2,1,0,0
+	mov r27=ar.rsc
+	add r2=0x98,in0		/* r2 <- &jmpbuf.orig_jmp_buf_addr */
+	;;
+	ld8 r8=[r2],-16		/* r8 <- orig_jmp_buf_addr */
+	mov r10=ar.bsp
+	and r11=~0x3,r27	/* clear ar.rsc.mode */
+	;;
+	flushrs			/* flush dirty regs to backing store (must be first in insn grp) */
+	ld8 r23=[r2],8		/* r23 <- jmpbuf.ar_bsp */
+	sub r8=r8,in0		/* r8 <- &orig_jmpbuf - &jmpbuf */
+	;;
+	ld8 r25=[r2]		/* r25 <- jmpbuf.ar_unat */
+	extr.u r8=r8,3,6	/* r8 <- (&orig_jmpbuf - &jmpbuf)/8 & 0x3f */
+	;;
+	cmp.lt pNeg,pPos=r8,r0
+	mov r2=in0
+	;;
+(pPos)	mov r16=r8
+(pNeg)	add r16=64,r8
+(pPos)	sub r17=64,r8
+(pNeg)	sub r17=r0,r8
+	;;
+	mov ar.rsc=r11		/* put RSE in enforced lazy mode */
+	shr.u r8=r25,r16
+	add r3=8,in0		/* r3 <- &jmpbuf.r1 */
+	shl r9=r25,r17
+	;;
+	or r25=r8,r9
+	;;
+	mov r26=ar.rnat
+	mov ar.unat=r25		/* setup ar.unat (NaT bits for r1, r4-r7, and r12) */
+	;;
+	ld8.fill.nta sp=[r2],16	/* r12 (sp) */
+	ld8.fill.nta gp=[r3],16		/* r1 (gp) */
+	dep r11=-1,r23,3,6	/* r11 <- ia64_rse_rnat_addr(jmpbuf.ar_bsp) */
+	;;
+	ld8.nta r16=[r2],16		/* caller's unat */
+	ld8.nta r17=[r3],16		/* fpsr */
+	;;
+	ld8.fill.nta r4=[r2],16	/* r4 */
+	ld8.fill.nta r5=[r3],16		/* r5 (gp) */
+	cmp.geu p8,p0=r10,r11	/* p8 <- (ar.bsp >= jmpbuf.ar_bsp) */
+	;;
+	ld8.fill.nta r6=[r2],16	/* r6 */
+	ld8.fill.nta r7=[r3],16		/* r7 */
+	;;
+	mov ar.unat=r16			/* restore caller's unat */
+	mov ar.fpsr=r17			/* restore fpsr */
+	;;
+	ld8.nta r16=[r2],16		/* b0 */
+	ld8.nta r17=[r3],16		/* b1 */
+	;;
+(p8)	ld8 r26=[r11]		/* r26 <- *ia64_rse_rnat_addr(jmpbuf.ar_bsp) */
+	mov ar.bspstore=r23	/* restore ar.bspstore */
+	;;
+	ld8.nta r18=[r2],16		/* b2 */
+	ld8.nta r19=[r3],16		/* b3 */
+	;;
+	ld8.nta r20=[r2],16		/* b4 */
+	ld8.nta r21=[r3],16		/* b5 */
+	;;
+	ld8.nta r11=[r2],16		/* ar.pfs */
+	ld8.nta r22=[r3],56		/* ar.lc */
+	;;
+	ld8.nta r24=[r2],32		/* pr */
+	mov b0=r16
+	;;
+	ldf.fill.nta f2=[r2],32
+	ldf.fill.nta f3=[r3],32
+	mov b1=r17
+	;;
+	ldf.fill.nta f4=[r2],32
+	ldf.fill.nta f5=[r3],32
+	mov b2=r18
+	;;
+	ldf.fill.nta f16=[r2],32
+	ldf.fill.nta f17=[r3],32
+	mov b3=r19
+	;;
+	ldf.fill.nta f18=[r2],32
+	ldf.fill.nta f19=[r3],32
+	mov b4=r20
+	;;
+	ldf.fill.nta f20=[r2],32
+	ldf.fill.nta f21=[r3],32
+	mov b5=r21
+	;;
+	ldf.fill.nta f22=[r2],32
+	ldf.fill.nta f23=[r3],32
+	mov ar.lc=r22
+	;;
+	ldf.fill.nta f24=[r2],32
+	ldf.fill.nta f25=[r3],32
+	cmp.eq p8,p9=0,in1
+	;;
+	ldf.fill.nta f26=[r2],32
+	ldf.fill.nta f27=[r3],32
+	mov ar.pfs=r11
+	;;
+	ldf.fill.nta f28=[r2],32
+	ldf.fill.nta f29=[r3],32
+	;;
+	ldf.fill.nta f30=[r2]
+	ldf.fill.nta f31=[r3]
+(p8)	mov r8=1
+
+	mov ar.rnat=r26		/* restore ar.rnat */
+	;;
+	mov ar.rsc=r27		/* restore ar.rsc */
+(p9)	mov r8=in1
+
+	invala			/* virt. -> phys. regnum mapping may change */
+	mov pr=r24,-1
+	ret
+END(__longjmp)
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/__syscall_error.c b/ap/build/uClibc/libc/sysdeps/linux/ia64/__syscall_error.c
new file mode 100644
index 0000000..0727b2b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/__syscall_error.c
@@ -0,0 +1,19 @@
+/* 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(void) attribute_hidden;
+int __syscall_error(void)
+{
+	register int err_no __asm__("%r8");
+	__set_errno(err_no);
+	return -1;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/atomic.h
new file mode 100644
index 0000000..1020c2f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/atomic.h
@@ -0,0 +1,119 @@
+/* Copyright (C) 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.  */
+
+#include <stdint.h>
+#include <ia64intrin.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 int16_t atomic16_t;
+typedef uint16_t uatomic16_t;
+typedef int_fast16_t atomic_fast16_t;
+typedef uint_fast16_t uatomic_fast16_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 int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+typedef int_fast64_t atomic_fast64_t;
+typedef uint_fast64_t uatomic_fast64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+
+#define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval) \
+  (abort (), 0)
+
+#define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval) \
+  (abort (), 0)
+
+#define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
+  (!__sync_bool_compare_and_swap ((mem), (int) (long) (oldval), \
+				  (int) (long) (newval)))
+
+#define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \
+  (!__sync_bool_compare_and_swap ((mem), (long) (oldval), \
+				  (long) (newval)))
+
+#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
+  (abort (), (__typeof (*mem)) 0)
+
+#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
+  (abort (), (__typeof (*mem)) 0)
+
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+  __sync_val_compare_and_swap ((mem), (int) (long) (oldval), \
+			       (int) (long) (newval))
+
+#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+  __sync_val_compare_and_swap ((mem), (long) (oldval), (long) (newval))
+
+/* Atomically store newval and return the old value.  */
+#define atomic_exchange_acq(mem, value) \
+  __sync_lock_test_and_set (mem, value)
+
+#define atomic_exchange_rel(mem, value) \
+  (__sync_synchronize (), __sync_lock_test_and_set (mem, value))
+
+#define atomic_exchange_and_add(mem, value) \
+  ({ __typeof (*mem) __result;						      \
+     __result = __sync_fetch_and_add ((mem), (int) (value));		      \
+     __result; })
+
+#define atomic_decrement_if_positive(mem) \
+  ({ __typeof (*mem) __oldval, __val;					      \
+     __typeof (mem) __memp = (mem);					      \
+									      \
+     __val = (*__memp);							      \
+     do									      \
+       {								      \
+	 __oldval = __val;						      \
+	 if (__builtin_expect (__val <= 0, 0))				      \
+	   break;							      \
+	 __val = atomic_compare_and_exchange_val_acq (__memp,	__oldval - 1, \
+						      __oldval);	      \
+       }								      \
+     while (__builtin_expect (__val != __oldval, 0));			      \
+     __oldval; })
+
+#define atomic_bit_test_set(mem, bit) \
+  ({ __typeof (*mem) __oldval, __val;					      \
+     __typeof (mem) __memp = (mem);					      \
+     __typeof (*mem) __mask = ((__typeof (*mem)) 1 << (bit));		      \
+									      \
+     __val = (*__memp);							      \
+     do									      \
+       {								      \
+	 __oldval = __val;						      \
+	 __val = atomic_compare_and_exchange_val_acq (__memp,		      \
+						      __oldval | __mask,      \
+						      __oldval);	      \
+       }								      \
+     while (__builtin_expect (__val != __oldval, 0));			      \
+     __oldval & __mask; })
+
+#define atomic_full_barrier() __sync_synchronize ()
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/byteswap.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/byteswap.h
new file mode 100644
index 0000000..346c82c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/byteswap.h
@@ -0,0 +1,52 @@
+/* Macros to swap the order of bytes in integer values.
+   Copyright (C) 1997, 1998, 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.  */
+
+#ifndef _ASM_BITS_BYTESWAP_H
+#define _ASM_BITS_BYTESWAP_H 1
+
+#define __bswap_non_constant_16(x) \
+     (__extension__							      \
+      ({ register unsigned short int __v;				      \
+	 __asm__ __volatile__ ("shl %0 = %1, 48 ;;"			      \
+				"mux1 %0 = %0, @rev ;;"			      \
+				: "=r" (__v)				      \
+				: "r" ((unsigned short int) (x)));	      \
+	 __v; }))
+
+#define __bswap_non_constant_32(x) \
+     (__extension__							      \
+      ({ register unsigned int __v;					      \
+	 __asm__ __volatile__ ("shl %0 = %1, 32 ;;"			      \
+				"mux1 %0 = %0, @rev ;;"			      \
+				: "=r" (__v)				      \
+				: "r" ((unsigned int) (x)));		      \
+	 __v; }))
+
+#define __bswap_non_constant_64(x) \
+     (__extension__							      \
+      ({ register unsigned long int __v;				      \
+	 __asm__ __volatile__ ("mux1 %0 = %1, @rev ;;"			      \
+				: "=r" (__v)				      \
+				: "r" ((unsigned long int) (x)));	      \
+         __v; }))
+#endif
+
+#endif
+
+#include <bits/byteswap-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/endian.h
new file mode 100644
index 0000000..98a5e23
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/endian.h
@@ -0,0 +1,7 @@
+/* Linux/ia64 is little-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/fcntl.h
new file mode 100644
index 0000000..85a55f6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/fcntl.h
@@ -0,0 +1,232 @@
+/* O_*, F_*, FD_* bit values for Linux/IA64.
+   Copyright (C) 1999, 2000, 2004, 2006, 2007 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_DIRECT	040000
+# define O_DIRECTORY	0200000	/* must be a directory */
+# define O_NOFOLLOW	0400000 /* don't follow links */
+# define O_NOATIME	01000000 /* Do not set atime.  */
+# define O_CLOEXEC	02000000 /* Set close_on_exec.  */
+#endif
+
+#ifdef __USE_LARGEFILE64
+/* Not necessary, files are always with 64bit off_t.  */
+# define O_LARGEFILE	0
+#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
+
+/* 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.  */
+#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).	*/
+
+/* Not necessary, we always have 64-bit offsets.  */
+#define F_GETLK64	5	/* Get record locking info.  */
+#define F_SETLK64	6	/* Set record locking info (non-blocking).  */
+#define F_SETLKW64	7	/* 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
+
+/* We don't need to support __USE_FILE_OFFSET64.  */
+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').  */
+    __off_t l_start;	/* Offset where the lock begins.  */
+    __off_t l_len;	/* Size of the locked area; zero means until EOF.  */
+    __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/ia64/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/fenv.h
new file mode 100644
index 0000000..32515f0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/fenv.h
@@ -0,0 +1,87 @@
+/* Copyright (C) 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.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Define bits representing the exception.  We use the bit positions of
+   the appropriate bits in the FPSR...  (Tahoe EAS 2.4 5-4)*/
+
+enum
+  {
+    FE_INEXACT =	1UL << 5,
+#define FE_INEXACT	FE_INEXACT
+
+    FE_UNDERFLOW =	1UL << 4,
+#define FE_UNDERFLOW	FE_UNDERFLOW
+
+    FE_OVERFLOW =	1UL << 3,
+#define FE_OVERFLOW	FE_OVERFLOW
+
+    FE_DIVBYZERO =	1UL << 2,
+#define FE_DIVBYZERO	FE_DIVBYZERO
+
+    FE_UNNORMAL =	1UL << 1,
+#define FE_UNNORMAL	FE_UNNORMAL
+
+    FE_INVALID =	1UL << 0,
+#define FE_INVALID	FE_INVALID
+
+    FE_ALL_EXCEPT =
+	(FE_INEXACT | FE_UNDERFLOW | FE_OVERFLOW | FE_DIVBYZERO | FE_UNNORMAL | FE_INVALID)
+#define FE_ALL_EXCEPT	FE_ALL_EXCEPT
+  };
+
+
+enum
+  {
+    FE_TOWARDZERO =	3,
+#define FE_TOWARDZERO	FE_TOWARDZERO
+
+    FE_UPWARD =		2,
+#define FE_UPWARD	FE_UPWARD
+
+    FE_DOWNWARD = 	1,
+#define FE_DOWNWARD	FE_DOWNWARD
+
+    FE_TONEAREST =	0,
+#define FE_TONEAREST	FE_TONEAREST
+  };
+
+
+/* Type representing exception flags.  */
+typedef unsigned long int fexcept_t;
+
+/* Type representing floating-point environment.  */
+typedef unsigned long int fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((__const fenv_t *) 0xc009804c0270033fUL)
+
+#ifdef __USE_GNU
+/* Floating-point environment where only FE_UNNORMAL is masked since this
+   exception is not generally supported by glibc.  */
+# define FE_NOMASK_ENV	((__const fenv_t *) 0xc009804c02700302UL)
+
+/* Floating-point environment with (processor-dependent) non-IEEE
+   floating point.  In this case, turning on flush-to-zero mode for
+   s0, s2, and s3.  */
+# define FE_NONIEEE_ENV ((__const fenv_t *) 0xc009a04d0270037fUL)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/ipc.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/ipc.h
new file mode 100644
index 0000000..858c332
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/ipc.h
@@ -0,0 +1,54 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+	Contributed by David Mosberger-Tang <davidm@hpl.hp.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.  */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#define IPC_INFO	3		/* See ipcs.  */
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;			/* Key.  */
+    __uid_t uid;			/* Owner's user ID.  */
+    __gid_t gid;			/* Owner's group ID.  */
+    __uid_t cuid;			/* Creator's user ID.  */
+    __gid_t cgid;			/* Creator's group ID.  */
+    __mode_t mode;			/* Read/write permission.  */
+    unsigned short int __seq;		/* Sequence number.  */
+    unsigned short int __pad1;
+    unsigned long int __unused1;
+    unsigned long int __unused2;
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/kernel_stat.h
new file mode 100644
index 0000000..28abc4b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/kernel_stat.h
@@ -0,0 +1,33 @@
+/* Ripped from linux/include/asm-ia64/stat.h
+ * and renamed 'struct stat' to 'struct kernel_stat' */
+
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+/*
+ * Modified 1998, 1999
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+struct kernel_stat {
+	unsigned long	st_dev;
+	unsigned long	st_ino;
+	unsigned long	st_nlink;
+	unsigned int	st_mode;
+	unsigned int	st_uid;
+	unsigned int	st_gid;
+	unsigned int	__pad0;
+	unsigned long	st_rdev;
+	unsigned long	st_size;
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned long	st_blksize;
+	long		st_blocks;
+	unsigned long	__unused[3];
+};
+
+/* ia64 stat64 is same as stat */
+#define kernel_stat64 kernel_stat
+
+#endif /* _BITS_STAT_STRUCT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/kernel_types.h
new file mode 100644
index 0000000..e31dc65
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/kernel_types.h
@@ -0,0 +1,58 @@
+/* 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 _ASM_IA64_POSIX_TYPES_H
+#define _ASM_IA64_POSIX_TYPES_H
+
+/*
+ * This file is generally used by user-level software, so you need to
+ * be a little careful about namespace pollution etc.  Also, we cannot
+ * assume GCC is being used.
+ *
+ * Based on <asm-alpha/posix_types.h>.
+ *
+ * Modified 1998-2000, 2003
+ *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
+ */
+
+typedef unsigned long	__kernel_ino_t;
+typedef unsigned int	__kernel_mode_t;
+typedef unsigned int	__kernel_nlink_t;
+typedef long		__kernel_off_t;
+typedef long long	__kernel_loff_t;
+typedef int		__kernel_pid_t;
+typedef int		__kernel_ipc_pid_t;
+typedef unsigned int	__kernel_uid_t;
+typedef unsigned int	__kernel_gid_t;
+typedef unsigned long	__kernel_size_t;
+typedef long		__kernel_ssize_t;
+typedef long		__kernel_ptrdiff_t;
+typedef long		__kernel_time_t;
+typedef long		__kernel_suseconds_t;
+typedef long		__kernel_clock_t;
+typedef int		__kernel_timer_t;
+typedef int		__kernel_clockid_t;
+typedef int		__kernel_daddr_t;
+typedef char *		__kernel_caddr_t;
+typedef unsigned long	__kernel_sigset_t;	/* at least 32 bits */
+typedef unsigned short	__kernel_uid16_t;
+typedef unsigned short	__kernel_gid16_t;
+
+typedef struct {
+	int	val[2];
+} __kernel_fsid_t;
+
+typedef __kernel_uid_t __kernel_old_uid_t;
+typedef __kernel_gid_t __kernel_old_gid_t;
+typedef __kernel_uid_t __kernel_uid32_t;
+typedef __kernel_gid_t __kernel_gid32_t;
+
+typedef unsigned int	__kernel_dev_t;
+typedef unsigned int	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+
+#endif /* _ASM_IA64_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/mathdef.h
new file mode 100644
index 0000000..5da23cc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/mathdef.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 2000, 2001, 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
+
+/* The IA-64 architecture computes values with the precision of the
+   used type.  */
+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 - 1)
+# define FP_ILOGBNAN	2147483647
+
+#endif	/* ISO C99 */
+
+#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/mathinline.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/mathinline.h
new file mode 100644
index 0000000..9bb5f1a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/mathinline.h
@@ -0,0 +1,54 @@
+/* Inline math functions for ia64.
+   Copyright (C) 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/mathinline.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __cplusplus
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE extern __inline
+#endif
+
+#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
+/* The gcc, version 2.7 or below, has problems with all this inlining
+   code.  So disable it for this version of the compiler.  */
+# if __GNUC_PREREQ (2, 8)
+/* Test for negative number.  Used in the signbit() macro.  */
+__MATH_INLINE int
+__NTH (__signbitf (float __x))
+{
+  __extension__ union { float __f; int __i; } __u = { __f: __x };
+  return __u.__i < 0;
+}
+__MATH_INLINE int
+__NTH (__signbit (double __x))
+{
+  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+  return __u.__i[1] < 0;
+}
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
+{
+  __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
+  return (__u.__i[2] & 0x8000) != 0;
+}
+# endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/mman.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/mman.h
new file mode 100644
index 0000000..a9d56ed
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/mman.h
@@ -0,0 +1,4 @@
+#ifdef __USE_MISC
+# define MAP_GROWSUP	  0x00200	/* Register stack-like segment */
+#endif
+#include <bits/mman-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/msq.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/msq.h
new file mode 100644
index 0000000..cd268ee
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/msq.h
@@ -0,0 +1,69 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+	Contribute by David Mosberger-Tang <davidm@hpl.hp.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.  */
+
+#ifndef _SYS_MSG_H
+#error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Define options for message queue functions.  */
+#define MSG_NOERROR	010000	/* no error if message is too big */
+#define MSG_EXCEPT	020000	/* recv any msg except of specified type */
+
+
+/* Structure of record for one message inside the kernel.
+   The type `struct __msg' is opaque.  */
+struct msqid_ds
+{
+  struct ipc_perm msg_perm;	/* structure describing operation permission */
+  __time_t msg_stime;		/* time of last msgsnd command */
+  __time_t msg_rtime;		/* time of last msgrcv command */
+  __time_t msg_ctime;		/* time of last change */
+  unsigned long int __msg_cbytes;	/* current number of bytes on queue */
+  unsigned long int msg_qnum;	/* number of messages currently on queue */
+  unsigned long int msg_qbytes;	/* max number of bytes allowed on queue */
+  __pid_t msg_lspid;		/* pid of last msgsnd() */
+  __pid_t msg_lrpid;		/* pid of last msgrcv() */
+  unsigned long int __unused1;
+  unsigned long int __unused2;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes	__msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+  {
+    int msgpool;
+    int msgmap;
+    int msgmax;
+    int msgmnb;
+    int msgmni;
+    int msgssz;
+    int msgtql;
+    unsigned short int msgseg;
+  };
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sem.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sem.h
new file mode 100644
index 0000000..449f1ec
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sem.h
@@ -0,0 +1,87 @@
+/* Copyright (C) 2000
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+	Contributed by David Mosberger-Tang <davidm@hpl.hp.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.  */
+
+#ifndef _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'.  */
+#define SEM_UNDO	0x1000		/* undo the operation on exit */
+
+/* Commands for `semctl'.  */
+#define GETPID		11		/* get sempid */
+#define GETVAL		12		/* get semval */
+#define GETALL		13		/* get all semval's */
+#define GETNCNT		14		/* get semncnt */
+#define GETZCNT		15		/* get semzcnt */
+#define SETVAL		16		/* set semval */
+#define SETALL		17		/* set all semval's */
+
+
+/* Data structure describing a set of semaphores.  */
+struct semid_ds
+{
+  struct ipc_perm sem_perm;		/* operation permission struct */
+  __time_t sem_otime;			/* last semop() time */
+  __time_t sem_ctime;			/* last time changed by semctl() */
+  unsigned long int sem_nsems;		/* number of semaphores in set */
+  unsigned long int __unused1;
+  unsigned long int __unused2;
+};
+
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;				<= value for SETVAL
+     struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;		<= array for GETALL & SETALL
+     struct seminfo *__buf;		<= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED	1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct  seminfo
+{
+  int semmap;
+  int semmni;
+  int semmns;
+  int semmnu;
+  int semmsl;
+  int semopm;
+  int semume;
+  int semusz;
+  int semvmx;
+  int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/setjmp.h
new file mode 100644
index 0000000..7662575
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/setjmp.h
@@ -0,0 +1,40 @@
+/* Define the machine-dependent type `jmp_buf'.  Linux/IA-64 version.
+   Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Mosberger-Tang <davidm@hpl.hp.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.  */
+
+#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
+
+/* User code must not depend on the internal representation of jmp_buf. */
+
+#define _JBLEN	70
+
+/* the __jmp_buf element type should be __float80 per ABI... */
+typedef long __jmp_buf[_JBLEN] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */
+
+/* Test if longjmp to JMPBUF would unwind the frame containing a local
+   variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(_jmpbuf, _address)		\
+     ((void *)(_address) < (void *)(((long *)_jmpbuf)[0]))
+
+#endif  /* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/shm.h
new file mode 100644
index 0000000..7f38f2d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/shm.h
@@ -0,0 +1,94 @@
+/* Copyright (C) 2000, 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.
+
+   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 <sys/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) */
+
+/* Segment low boundary address multiple.  */
+#define SHMLBA		(1024 * 1024)
+
+/* 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() */
+    __time_t shm_dtime;			/* time of last shmdt() */
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+    __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 __unused1;
+    unsigned long int __unused2;
+  };
+
+#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 */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sigaction.h
new file mode 100644
index 0000000..4049402
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sigaction.h
@@ -0,0 +1,64 @@
+/* Definitions for Linux/ia64 sigaction.
+   Copyright (C) 1996, 1997, 2000, 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 _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives.  */
+struct sigaction {
+#ifdef __USE_POSIX199309
+	union {
+		__sighandler_t sa_handler;
+		void (*sa_sigaction)(int, siginfo_t *, void *);
+	} __sigaction_handler;
+# define sa_handler     __sigaction_handler.sa_handler
+# define sa_sigaction   __sigaction_handler.sa_sigaction
+#else
+	__sighandler_t  sa_handler;
+#endif
+	unsigned long   sa_flags;
+	sigset_t        sa_mask;
+	/* IA64 has no sa_restorer field.  */
+};
+
+/* Bits in `sa_flags'.  */
+#define SA_NOCLDSTOP  0x00000001 /* Don't send SIGCHLD when children stop.  */
+#define SA_NOCLDWAIT  0x00000002 /* Don't create zombie on child death.  */
+#define SA_SIGINFO    0x00000004
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK   0x08000000 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
+# define SA_NODEFER   0x40000000 /* Don't automatically block the signal
+				    when its handler is being executed.  */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler.  */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historic no-op.  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
+# define SA_STACK     SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'.  */
+#define SIG_BLOCK          0	/* for blocking signals */
+#define SIG_UNBLOCK        1	/* for unblocking signals */
+#define SIG_SETMASK        2	/* for setting the signal mask */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sigcontext.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sigcontext.h
new file mode 100644
index 0000000..72c60ec
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sigcontext.h
@@ -0,0 +1,79 @@
+/* Copyright (C) 1996, 1997, 1998, 2000, 2001, 2003, 2004
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jes Sorensen <jes@linuxcare.com>, July 2000
+
+   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 _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H 1
+
+#include <bits/sigstack.h>
+
+struct ia64_fpreg
+  {
+    union
+      {
+	unsigned long bits[2];
+      } u;
+  } __attribute__ ((aligned (16)));
+
+struct sigcontext
+{
+  unsigned long int sc_flags;	/* see manifest constants below */
+  unsigned long int sc_nat;	/* bit i == 1 iff scratch reg gr[i] is a NaT */
+  stack_t sc_stack;		/* previously active stack */
+
+  unsigned long int sc_ip;	/* instruction pointer */
+  unsigned long int sc_cfm;	/* current frame marker */
+  unsigned long int sc_um;	/* user mask bits */
+  unsigned long int sc_ar_rsc;	/* register stack configuration register */
+  unsigned long int sc_ar_bsp;	/* backing store pointer */
+  unsigned long int sc_ar_rnat;	/* RSE NaT collection register */
+  unsigned long int sc_ar_ccv;	/* compare & exchange compare value register */
+  unsigned long int sc_ar_unat;	/* ar.unat of interrupted context */
+  unsigned long int sc_ar_fpsr;	/* floating-point status register */
+  unsigned long int sc_ar_pfs;	/* previous function state */
+  unsigned long int sc_ar_lc;	/* loop count register */
+  unsigned long int sc_pr;	/* predicate registers */
+  unsigned long int sc_br[8];	/* branch registers */
+  unsigned long int sc_gr[32];	/* general registers (static partition) */
+  struct ia64_fpreg sc_fr[128];	/* floating-point registers */
+  unsigned long int sc_rbs_base;/* NULL or new base of sighandler's rbs */
+  unsigned long int sc_loadrs;	/* see description above */
+  unsigned long int sc_ar25;	/* cmp8xchg16 uses this */
+  unsigned long int sc_ar26;	/* rsvd for scratch use */
+  unsigned long int sc_rsvd[12];/* reserved for future use */
+
+  /* sc_mask is actually an sigset_t but we don't want to
+   * include the kernel headers here. */
+  unsigned long int sc_mask;	/* signal mask to restore after handler returns */
+};
+
+/* sc_flag bit definitions. */
+#define IA64_SC_FLAG_ONSTACK_BIT	0	/* is handler running on signal stack? */
+#define IA64_SC_FLAG_IN_SYSCALL_BIT	1	/* did signal interrupt a syscall? */
+#define IA64_SC_FLAG_FPH_VALID_BIT	2	/* is state in f[32]-f[127] valid? */
+
+#define IA64_SC_FLAG_ONSTACK		(1 << IA64_SC_FLAG_ONSTACK_BIT)
+#define IA64_SC_FLAG_IN_SYSCALL		(1 << IA64_SC_FLAG_IN_SYSCALL_BIT)
+#define IA64_SC_FLAG_FPH_VALID		(1 << IA64_SC_FLAG_FPH_VALID_BIT)
+
+#endif /* _BITS_SIGCONTEXT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/siginfo.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/siginfo.h
new file mode 100644
index 0000000..66310c6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/siginfo.h
@@ -0,0 +1,339 @@
+/* siginfo_t, sigevent and constants.  Linux/ia64 version.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Mosberger-Tang <davidm@hpl.hp.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.  */
+
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+    && !defined __need_sigevent_t
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+#if (!defined __have_sigval_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t \
+	 || defined __need_sigevent_t))
+# define __have_sigval_t	1
+
+/* Type for data associated with a signal.  */
+typedef union sigval
+  {
+    int sival_int;
+    void *sival_ptr;
+  } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t	1
+
+# define __SI_MAX_SIZE     128
+# define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 4)
+
+typedef struct siginfo
+  {
+    int si_signo;		/* Signal number.  */
+    int si_errno;		/* If non-zero, an errno value associated with
+				   this signal, as defined in <errno.h>.  */
+    int si_code;		/* Signal code.  */
+    int __pad0;			/* Explicit padding.  */
+
+    union
+      {
+	int _pad[__SI_PAD_SIZE];
+
+	 /* kill().  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	  } _kill;
+
+	/* POSIX.1b timers.  */
+	struct
+	  {
+	    int si_tid;		/* Timer ID.  */
+	    int si_overrun;	/* Overrun count.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _timer;
+
+	/* POSIX.1b signals.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _rt;
+
+	/* SIGCHLD.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Which child.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    int si_status;	/* Exit value or signal.  */
+	    __clock_t si_utime;
+	    __clock_t si_stime;
+	  } _sigchld;
+
+	/* SIGILL, SIGFPE, SIGSEGV, SIGBUS.  */
+	struct
+	  {
+	    void *si_addr;	/* Faulting insn/memory ref.  */
+	    int _si_imm;
+	    unsigned int _si_flags;
+	    unsigned long int _si_isr;
+	  } _sigfault;
+
+	/* SIGPOLL.  */
+	struct
+	  {
+	    long int si_band;	/* Band event for SIGPOLL.  */
+	    int si_fd;
+	  } _sigpoll;
+      } _sifields;
+  } siginfo_t;
+
+
+/* X/Open requires some more fields with fixed names.  */
+# define si_pid		_sifields._kill.si_pid
+# define si_uid		_sifields._kill.si_uid
+# define si_timerid	_sifields._timer.si_tid
+# define si_overrun	_sifields._timer.si_overrun
+# define si_status	_sifields._sigchld.si_status
+# define si_utime	_sifields._sigchld.si_utime
+# define si_stime	_sifields._sigchld.si_stime
+# define si_value	_sifields._rt.si_sigval
+# define si_int		_sifields._rt.si_sigval.sival_int
+# define si_ptr		_sifields._rt.si_sigval.sival_ptr
+# define si_addr	_sifields._sigfault.si_addr
+# define si_band	_sifields._sigpoll.si_band
+# define si_fd		_sifields._sigpoll.si_fd
+
+# ifdef __USE_GNU
+#  define si_imm	_sifields._sigfault._si_imm
+#  define si_segvflags	_sifields._sigfault._si_flags
+#  define si_isr	_sifields._sigfault._si_isr
+# endif
+
+/* Values for `si_code'.  Positive values are reserved for kernel-generated
+   signals.  */
+enum
+{
+  SI_ASYNCNL = -60,		/* Sent by asynch name lookup completion.  */
+# define SI_ASYNCNL	SI_ASYNCNL
+  SI_TKILL = -6,		/* Sent by tkill.  */
+# define SI_TKILL	SI_TKILL
+  SI_SIGIO,			/* Sent by queued SIGIO. */
+# define SI_SIGIO	SI_SIGIO
+  SI_ASYNCIO,			/* Sent by AIO completion.  */
+# define SI_ASYNCIO	SI_ASYNCIO
+  SI_MESGQ,			/* Sent by real time mesq state change.  */
+# define SI_MESGQ	SI_MESGQ
+  SI_TIMER,			/* Sent by timer expiration.  */
+# define SI_TIMER	SI_TIMER
+  SI_QUEUE,			/* Sent by sigqueue.  */
+# define SI_QUEUE	SI_QUEUE
+  SI_USER,			/* Sent by kill, sigsend, raise.  */
+# define SI_USER	SI_USER
+  SI_KERNEL = 0x80		/* Send by kernel.  */
+#define SI_KERNEL	SI_KERNEL
+};
+
+
+/* `si_code' values for SIGILL signal.  */
+enum
+{
+  ILL_ILLOPC = 1,		/* Illegal opcode.  */
+# define ILL_ILLOPC	ILL_ILLOPC
+  ILL_ILLOPN,			/* Illegal operand.  */
+# define ILL_ILLOPN	ILL_ILLOPN
+  ILL_ILLADR,			/* Illegal addressing mode.  */
+# define ILL_ILLADR	ILL_ILLADR
+  ILL_ILLTRP,			/* Illegal trap. */
+# define ILL_ILLTRP	ILL_ILLTRP
+  ILL_PRVOPC,			/* Privileged opcode.  */
+# define ILL_PRVOPC	ILL_PRVOPC
+  ILL_PRVREG,			/* Privileged register.  */
+# define ILL_PRVREG	ILL_PRVREG
+  ILL_COPROC,			/* Coprocessor error.  */
+# define ILL_COPROC	ILL_COPROC
+  ILL_BADSTK,			/* Internal stack error.  */
+# define ILL_BADSTK	ILL_BADSTK
+  ILL_BADIADDR			/* Unimplemented instruction address. */
+# define ILL_BADIADDR	ILL_BADIADDR
+
+# ifdef __USE_GNU
+   , ILL_BREAK
+#  define ILL_BREAK	ILL_BREAK
+# endif
+};
+
+/* `si_code' values for SIGFPE signal.  */
+enum
+{
+  FPE_INTDIV = 1,		/* Integer divide by zero.  */
+# define FPE_INTDIV	FPE_INTDIV
+  FPE_INTOVF,			/* Integer overflow.  */
+# define FPE_INTOVF	FPE_INTOVF
+  FPE_FLTDIV,			/* Floating point divide by zero.  */
+# define FPE_FLTDIV	FPE_FLTDIV
+  FPE_FLTOVF,			/* Floating point overflow.  */
+# define FPE_FLTOVF	FPE_FLTOVF
+  FPE_FLTUND,			/* Floating point underflow.  */
+# define FPE_FLTUND	FPE_FLTUND
+  FPE_FLTRES,			/* Floating point inexact result.  */
+# define FPE_FLTRES	FPE_FLTRES
+  FPE_FLTINV,			/* Floating point invalid operation.  */
+# define FPE_FLTINV	FPE_FLTINV
+  FPE_FLTSUB			/* Subscript out of range.  */
+# define FPE_FLTSUB	FPE_FLTSUB
+# ifdef __USE_GNU
+   , FPE_DECOVF
+#  define FPE_DECOVF	FPE_DECOVF
+   , FPE_DECDIV
+#  define FPE_DECDIV	FPE_DECDIV
+   , FPE_DECERR
+#  define FPE_DECERR	FPE_DECERR
+   , FPE_INVASC
+#  define FPE_INVASC	FPE_INVASC
+   , FPE_INVDEC
+#  define FPE_INVDEC	FPE_INVDEC
+# endif
+};
+
+/* `si_code' values for SIGSEGV signal.  */
+enum
+{
+  SEGV_MAPERR = 1,		/* Address not mapped to object.  */
+# define SEGV_MAPERR	SEGV_MAPERR
+  SEGV_ACCERR			/* Invalid permissions for mapped object.  */
+# define SEGV_ACCERR	SEGV_ACCERR
+# ifdef __USE_GNU
+  , SEGV_PSTKOVF		/* Paragraph stack overflow. */
+# define SEGV_PSTKOVF	SEGV_PSTKOVF
+# endif
+};
+
+/* `si_code' values for SIGBUS signal.  */
+enum
+{
+  BUS_ADRALN = 1,		/* Invalid address alignment.  */
+# define BUS_ADRALN	BUS_ADRALN
+  BUS_ADRERR,			/* Non-existant physical address.  */
+# define BUS_ADRERR	BUS_ADRERR
+  BUS_OBJERR			/* Object specific hardware error.  */
+# define BUS_OBJERR	BUS_OBJERR
+};
+
+/* `si_code' values for SIGTRAP signal.  */
+enum
+{
+  TRAP_BRKPT = 1,		/* Process breakpoint.  */
+# define TRAP_BRKPT	TRAP_BRKPT
+  TRAP_TRACE			/* Process trace trap.  */
+# define TRAP_TRACE	TRAP_TRACE
+
+# ifdef __USE_GNU
+  , TRAP_BRANCH
+# define TRAP_BRANCH	TRAP_BRANCH
+  , TRAP_HWBKPT
+# define TRAP_HWBKPT	TRAP_HWBKPT
+# endif
+};
+
+/* `si_code' values for SIGCHLD signal.  */
+enum
+{
+  CLD_EXITED = 1,		/* Child has exited.  */
+# define CLD_EXITED	CLD_EXITED
+  CLD_KILLED,			/* Child was killed.  */
+# define CLD_KILLED	CLD_KILLED
+  CLD_DUMPED,			/* Child terminated abnormally.  */
+# define CLD_DUMPED	CLD_DUMPED
+  CLD_TRAPPED,			/* Traced child has trapped.  */
+# define CLD_TRAPPED	CLD_TRAPPED
+  CLD_STOPPED,			/* Child has stopped.  */
+# define CLD_STOPPED	CLD_STOPPED
+  CLD_CONTINUED			/* Stopped child has continued.  */
+# define CLD_CONTINUED	CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal.  */
+enum
+{
+  POLL_IN = 1,			/* Data input available.  */
+# define POLL_IN	POLL_IN
+  POLL_OUT,			/* Output buffers available.  */
+# define POLL_OUT	POLL_OUT
+  POLL_MSG,			/* Input message available.   */
+# define POLL_MSG	POLL_MSG
+  POLL_ERR,			/* I/O error.  */
+# define POLL_ERR	POLL_ERR
+  POLL_PRI,			/* High priority input available.  */
+# define POLL_PRI	POLL_PRI
+  POLL_HUP			/* Device disconnected.  */
+# define POLL_HUP	POLL_HUP
+};
+
+# undef __need_siginfo_t
+#endif	/* !have siginfo_t && (have _SIGNAL_H || need siginfo_t).  */
+
+
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+    && !defined __have_sigevent_t
+# define __have_sigevent_t	1
+
+/* Structure to transport application-defined values with signals.  */
+# define __SIGEV_MAX_SIZE	64
+# define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+
+typedef struct sigevent
+  {
+    sigval_t sigev_value;
+    int sigev_signo;
+    int sigev_notify;
+
+    union
+      {
+	int _pad[__SIGEV_PAD_SIZE];
+
+	struct
+	  {
+	    void (*_function) (sigval_t);	/* Function to start.  */
+	    void *_attribute;			/* Really pthread_attr_t.  */
+	  } _sigev_thread;
+      } _sigev_un;
+  } sigevent_t;
+
+/* POSIX names to access some of the members.  */
+# define sigev_notify_function   _sigev_un._sigev_thread._function
+# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+/* `sigev_notify' values.  */
+enum
+{
+  SIGEV_SIGNAL = 0,		/* Notify via signal.  */
+# define SIGEV_SIGNAL	SIGEV_SIGNAL
+  SIGEV_NONE,			/* Other notification: meaningless.  */
+# define SIGEV_NONE	SIGEV_NONE
+  SIGEV_THREAD,			/* Deliver via thread creation.  */
+# define SIGEV_THREAD	SIGEV_THREAD
+
+  SIGEV_THREAD_ID = 4		/* Send signal to specific thread.  */
+#define SIGEV_THREAD_ID	SIGEV_THREAD_ID
+};
+
+#endif	/* have _SIGNAL_H.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sigstack.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sigstack.h
new file mode 100644
index 0000000..ea27a77
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/sigstack.h
@@ -0,0 +1,65 @@
+/* sigstack, sigaltstack definitions.
+   Copyright (C) 1998, 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.  */
+
+#ifndef _SIGNAL_H
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+#ifndef _SIGSTACK_H
+#define _SIGSTACK_H	1
+
+#if defined __UCLIBC_SUSV4_LEGACY__ || !defined __UCLIBC_STRICT_HEADERS__
+/* Structure describing a signal stack (obsolete).  */
+struct sigstack
+  {
+    __ptr_t ss_sp;		/* Signal stack pointer.  */
+    int ss_onstack;		/* Nonzero if executing on this stack.  */
+  };
+#endif
+
+
+/* Possible values for `ss_flags.'.  */
+enum
+{
+  SS_ONSTACK = 1,
+#define SS_ONSTACK	SS_ONSTACK
+  SS_DISABLE
+#define SS_DISABLE	SS_DISABLE
+};
+
+/* Minimum stack size for a signal handler.
+
+   Yes, this should be 131072 but the constant got defined incorrectly
+   in the kernel and we have to live with it.  Users should in any case
+   use SIGSTKSZ as the size user-supplied buffers should have.  */
+#define MINSIGSTKSZ	131027
+
+/* System default stack size.  */
+#define SIGSTKSZ	262144
+
+
+/* Alternate, preferred interface.  */
+typedef struct sigaltstack
+  {
+    __ptr_t ss_sp;
+    int ss_flags;
+    size_t ss_size;
+  } stack_t;
+
+#endif	/* bits/sigstack.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/stackinfo.h
new file mode 100644
index 0000000..b7dc5d9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/stackinfo.h
@@ -0,0 +1,29 @@
+/* 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 IA-64 the stack grows down.  The register stack is of no concern
+   here.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/stat.h
new file mode 100644
index 0000000..75a3318
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/stat.h
@@ -0,0 +1,145 @@
+/* Copyright (C) 1999, 2000, 2001, 2002, 2009 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_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_KERNEL	0
+#define _STAT_VER_LINUX		1
+#define _STAT_VER		_STAT_VER_LINUX
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	0
+
+struct stat
+  {
+    __dev_t st_dev;		/* Device.  */
+    __ino_t st_ino;		/* File serial number.	*/
+    __nlink_t st_nlink;		/* Link count.  */
+    __mode_t st_mode;		/* File mode.  */
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
+    int pad0;
+    __dev_t st_rdev;		/* Device number, if device.  */
+    __off_t st_size;		/* Size of file, in bytes.  */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+    __blkcnt_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+    long int __unused[3];
+  };
+
+#ifdef __USE_LARGEFILE64
+/* Note stat64 is the same shape as stat.  */
+struct stat64
+  {
+    __dev_t st_dev;		/* Device.  */
+    __ino64_t st_ino;		/* File serial number.  */
+    __nlink_t st_nlink;		/* Link count.  */
+    __mode_t st_mode;		/* File mode.  */
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
+    int pad0;
+    __dev_t st_rdev;		/* Device number, if device.  */
+    __off_t st_size;		/* Size of file, in bytes.  */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+    long int __unused[3];
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/syscalls.h
new file mode 100644
index 0000000..ae09687
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/syscalls.h
@@ -0,0 +1,166 @@
+/* Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
+   Based on code originally written by David Mosberger-Tang
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+#undef IA64_USE_NEW_STUB
+
+#define __IA64_BREAK_SYSCALL	0x100000
+
+/* mostly taken from glibc sysdeps/unix/sysv/linux/ia64/sysdep.h */
+#define BREAK_INSN_1(num) "break " #num ";;\n\t"
+#define BREAK_INSN(num) BREAK_INSN_1(num)
+
+/* On IA-64 we have stacked registers for passing arguments.  The
+   "out" registers end up being the called function's "in"
+   registers.
+
+   Also, since we have plenty of registers we have two return values
+   from a syscall.  r10 is set to -1 on error, whilst r8 contains the
+   (non-negative) errno on error or the return value on success.
+ */
+
+# define DO_INLINE_SYSCALL_NCS(name, nr, args...)		\
+    LOAD_ARGS_##nr (args)					\
+    register long _r8 __asm__ ("r8");				\
+    register long _r10 __asm__ ("r10");				\
+    register long _r15 __asm__ ("r15") = name;			\
+    long _retval;						\
+    LOAD_REGS_##nr						\
+    __asm__ __volatile__ (BREAK_INSN (__IA64_BREAK_SYSCALL)	\
+		      : "=r" (_r8), "=r" (_r10), "=r" (_r15)	\
+			ASM_OUTARGS_##nr			\
+		      : "2" (_r15) ASM_ARGS_##nr		\
+		      : "memory" ASM_CLOBBERS_##nr);		\
+    _retval = _r8;
+
+#define INLINE_SYSCALL_NCS(name, nr, args...)		\
+(__extension__						\
+  ({							\
+    DO_INLINE_SYSCALL_NCS (name, nr, args)		\
+    if (unlikely (_r10 == -1))				\
+      {							\
+	__set_errno (_retval);				\
+	_retval = -1;					\
+      }							\
+    _retval;						\
+   })							\
+)
+
+#define INTERNAL_SYSCALL_DECL(err) long int err
+
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\
+(__extension__ \
+  ({							\
+    DO_INLINE_SYSCALL_NCS (name, nr, args)		\
+    err = _r10;						\
+    _retval;						\
+   }) \
+)
+#define INTERNAL_SYSCALL_ERROR_P(val, err)	(err == -1)
+
+#define INTERNAL_SYSCALL_ERRNO(val, err)	(val)
+
+#define LOAD_ARGS_0()
+#define LOAD_REGS_0
+#define LOAD_ARGS_1(a1)					\
+  long _arg1 = (long) (a1);				\
+  LOAD_ARGS_0 ()
+#define LOAD_REGS_1					\
+  register long _out0 __asm__ ("out0") = _arg1;		\
+  LOAD_REGS_0
+#define LOAD_ARGS_2(a1, a2)				\
+  long _arg2 = (long) (a2);				\
+  LOAD_ARGS_1 (a1)
+#define LOAD_REGS_2					\
+  register long _out1 __asm__ ("out1") = _arg2;		\
+  LOAD_REGS_1
+#define LOAD_ARGS_3(a1, a2, a3)				\
+  long _arg3 = (long) (a3);				\
+  LOAD_ARGS_2 (a1, a2)
+#define LOAD_REGS_3					\
+  register long _out2 __asm__ ("out2") = _arg3;		\
+  LOAD_REGS_2
+#define LOAD_ARGS_4(a1, a2, a3, a4)			\
+  long _arg4 = (long) (a4);				\
+  LOAD_ARGS_3 (a1, a2, a3)
+#define LOAD_REGS_4					\
+  register long _out3 __asm__ ("out3") = _arg4;		\
+  LOAD_REGS_3
+#define LOAD_ARGS_5(a1, a2, a3, a4, a5)			\
+  long _arg5 = (long) (a5);				\
+  LOAD_ARGS_4 (a1, a2, a3, a4)
+#define LOAD_REGS_5					\
+  register long _out4 __asm__ ("out4") = _arg5;		\
+  LOAD_REGS_4
+#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6)		\
+  long _arg6 = (long) (a6);	    			\
+  LOAD_ARGS_5 (a1, a2, a3, a4, a5)
+#define LOAD_REGS_6					\
+  register long _out5 __asm__ ("out5") = _arg6;		\
+  LOAD_REGS_5
+
+#define ASM_OUTARGS_0
+#define ASM_OUTARGS_1	ASM_OUTARGS_0, "=r" (_out0)
+#define ASM_OUTARGS_2	ASM_OUTARGS_1, "=r" (_out1)
+#define ASM_OUTARGS_3	ASM_OUTARGS_2, "=r" (_out2)
+#define ASM_OUTARGS_4	ASM_OUTARGS_3, "=r" (_out3)
+#define ASM_OUTARGS_5	ASM_OUTARGS_4, "=r" (_out4)
+#define ASM_OUTARGS_6	ASM_OUTARGS_5, "=r" (_out5)
+
+#define ASM_ARGS_0
+#define ASM_ARGS_1	ASM_ARGS_0, "3" (_out0)
+#define ASM_ARGS_2	ASM_ARGS_1, "4" (_out1)
+#define ASM_ARGS_3	ASM_ARGS_2, "5" (_out2)
+#define ASM_ARGS_4	ASM_ARGS_3, "6" (_out3)
+#define ASM_ARGS_5	ASM_ARGS_4, "7" (_out4)
+#define ASM_ARGS_6	ASM_ARGS_5, "8" (_out5)
+
+#define ASM_CLOBBERS_0	ASM_CLOBBERS_1, "out0"
+#define ASM_CLOBBERS_1	ASM_CLOBBERS_2, "out1"
+#define ASM_CLOBBERS_2	ASM_CLOBBERS_3, "out2"
+#define ASM_CLOBBERS_3	ASM_CLOBBERS_4, "out3"
+#define ASM_CLOBBERS_4	ASM_CLOBBERS_5, "out4"
+#define ASM_CLOBBERS_5	ASM_CLOBBERS_6, "out5"
+#define ASM_CLOBBERS_6	ASM_CLOBBERS_6_COMMON , "b7"
+#define ASM_CLOBBERS_6_COMMON	, "out6", "out7",			\
+  /* Non-stacked integer registers, minus r8, r10, r15.  */		\
+  "r2", "r3", "r9", "r11", "r12", "r13", "r14", "r16", "r17", "r18",	\
+  "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27",	\
+  "r28", "r29", "r30", "r31",						\
+  /* Predicate registers.  */						\
+  "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15",	\
+  /* Non-rotating fp registers.  */					\
+  "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",	\
+  /* Branch registers.  */						\
+  "b6"
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..a3644ce
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/uClibc_arch_features.h
@@ -0,0 +1,47 @@
+/*
+ * 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__ "break 0"
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/ia64/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/bits/wordsize.h
new file mode 100644
index 0000000..dd698fa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/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	64
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/brk.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/brk.S
new file mode 100644
index 0000000..e9974d5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/brk.S
@@ -0,0 +1,52 @@
+/* brk system call for Linux/ia64
+   Copyright (C) 1999,2000,2001,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Written by Stephane Eranian <eranian@hpl.hp.com> and
+	      Jes Sorensen, <Jes.Sorensen@cern.ch>, April 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 "sysdep.h"
+
+#include <asm/unistd.h>
+#include <asm/errno.h>
+
+	.global __curbrk
+	.hidden __curbrk
+	.type __curbrk,@object
+	.size __curbrk,8
+	.data
+	.align	8
+__curbrk:
+	data8	0
+
+weak_alias (__curbrk, ___brk_addr)
+
+LEAF(brk)
+	.regstk 1, 0, 0, 0
+	DO_CALL(__NR_brk)
+	cmp.ltu	p6, p0 = ret0, in0
+	addl r9 = @ltoff(__curbrk), gp
+	;;
+	ld8 r9 = [r9]
+(p6) 	mov ret0 = ENOMEM
+(p6)	br.cond.spnt.few __syscall_error
+	;;
+	st8 [r9] = ret0
+	mov ret0 = 0
+	ret
+END(brk)
+libc_hidden_def(brk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/bsd-_setjmp.S
new file mode 100644
index 0000000..4e6a2da
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bsd-_setjmp.S
@@ -0,0 +1 @@
+/* _setjmp is in setjmp.S  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/bsd-setjmp.S
new file mode 100644
index 0000000..1da848d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/bsd-setjmp.S
@@ -0,0 +1 @@
+/* setjmp is in setjmp.S  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/clone2.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/clone2.S
new file mode 100644
index 0000000..7f067df
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/clone2.S
@@ -0,0 +1,107 @@
+/* Copyright (C) 2000, 2001, 2003, 2004, 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.  */
+
+#include "sysdep.h"
+
+#include "sysdep.h"
+#include <asm/errno.h>
+
+
+/* int  __clone2(int (*fn) (void *arg), void *child_stack_base, 	*/
+/* 	         size_t child_stack_size, int flags, void *arg,		*/
+/*	         pid_t *parent_tid, void *tls, pid_t *child_tid)	*/
+
+#define CHILD	p8
+#define PARENT	p9
+
+ENTRY(__clone2)
+	.prologue
+	alloc r2=ar.pfs,8,1,6,0
+	cmp.eq p6,p0=0,in0
+	cmp.eq p7,p0=0,in1
+	mov r8=EINVAL
+	mov out0=in3		/* Flags are first syscall argument.	*/
+	mov out1=in1		/* Stack address.			*/
+(p6)	br.cond.spnt.many __syscall_error	/* no NULL function pointers */
+(p7)	br.cond.spnt.many __syscall_error	/* no NULL stack pointers */
+	;;
+	mov out2=in2		/* Stack size.				*/
+	mov out3=in5		/* Parent TID Pointer			*/
+	mov out4=in7		/* Child TID Pointer			*/
+ 	mov out5=in6		/* TLS pointer				*/
+	/*
+	 * clone2() is special: the child cannot execute br.ret right
+	 * after the system call returns, because it starts out
+	 * executing on an empty stack.  Because of this, we can't use
+	 * the new (lightweight) syscall convention here.  Instead, we
+	 * just fall back on always using "break".
+	 *
+	 * Furthermore, since the child starts with an empty stack, we
+	 * need to avoid unwinding past invalid memory.  To that end,
+	 * we'll pretend now that __clone2() is the end of the
+	 * call-chain.  This is wrong for the parent, but only until
+	 * it returns from clone2() but it's better than the
+	 * alternative.
+	 */
+	mov r15=SYS_ify (clone2)
+	.save rp, r0
+	break __BREAK_SYSCALL
+	.body
+        cmp.eq p6,p0=-1,r10
+	cmp.eq CHILD,PARENT=0,r8 /* Are we the child?   */
+(p6)	br.cond.spnt.many __syscall_error
+	;;
+(CHILD)	mov loc0=gp
+(PARENT) ret
+	;;
+#ifdef RESET_PID
+	tbit.nz p6,p0=in3,16	/* CLONE_THREAD */
+	tbit.z p7,p10=in3,8	/* CLONE_VM */
+(p6)	br.cond.dptk 1f
+	;;
+	mov r15=SYS_ify (getpid)
+(p10)	addl r8=-1,r0
+(p7)	break __BREAK_SYSCALL
+	;;
+	add r9=PID,r13
+	add r10=TID,r13
+	;;
+	st4 [r9]=r8
+	st4 [r10]=r8
+	;;
+#endif
+1:	ld8 out1=[in0],8	/* Retrieve code pointer.	*/
+	mov out0=in4		/* Pass proper argument	to fn */
+	;;
+	ld8 gp=[in0]		/* Load function gp.		*/
+	mov b6=out1
+	br.call.dptk.many rp=b6	/* Call fn(arg) in the child 	*/
+	;;
+	mov out0=r8		/* Argument to _exit		*/
+	mov gp=loc0
+	.globl HIDDEN_JUMPTARGET(_exit)
+	br.call.dpnt.many rp=HIDDEN_JUMPTARGET(_exit)
+				/* call _exit with result from fn.	*/
+	ret			/* Not reached.		*/
+PSEUDO_END(__clone2)
+
+/* For now we leave __clone undefined.  This is unlikely to be a	*/
+/* problem, since at least the i386 __clone in glibc always failed	*/
+/* with a 0 sp (eventhough the kernel explicitly handled it).		*/
+/* Thus all such calls needed to pass an explicit sp, and as a result,	*/
+/* would be unlikely to work on ia64.					*/
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/crt1.S
new file mode 100644
index 0000000..774e84f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/crt1.S
@@ -0,0 +1,129 @@
+/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 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.
+
+   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.  */
+
+#define __ASSEMBLY__
+#include "sysdep.h"
+
+#include <asm/unistd.h>
+#include <asm/fpu.h>
+
+/*
+ * Arguments for __uClibc_main:
+ *	out0:	main
+ *	out1:	argc
+ *	out2:	argv
+ *	out3:	init
+ *	out4:	fini
+ *	out5:	rtld_fini
+ *	out6:	stack_end
+ */
+
+#if defined(__UCLIBC_CTOR_DTOR__)
+.type   _init,%function
+.type   _fini,%function
+#else
+.weak   _init
+.weak   _fini
+#endif
+
+	.align 32
+	.global _start
+
+	.proc _start
+	.type _start,@function
+_start:
+	.prologue
+	.save rp, r0
+	.body
+	.prologue
+	{ .mlx
+	  alloc r2 = ar.pfs,0,0,7,0
+	  movl r3 = FPSR_DEFAULT
+	}
+	{ .mlx
+	  adds out2 = 16, sp	/* get address of argc value */
+	  movl gp = @gprel(0f)
+	  ;;
+	}
+0:	{ .mmi
+	  ld8 out1 = [out2], 8	/* load argc and move out2 to become argv */
+	  mov.m r10 = ar.bsp	/* fetch rbs base address */
+	  mov r9 = ip
+	  ;;
+	}
+	{ .mii
+	  mov ar.fpsr = r3
+	  sub gp = r9, gp	/* back-compute gp value */
+	  adds out6 = 16, sp	/* highest non-environment stack address */
+	  ;;
+	}
+	{
+	  addl r11 = @ltoff(__libc_ia64_register_backing_store_base), gp
+	  addl out0 = @ltoff(@fptr(main)), gp
+	  addl out3 = @ltoff(@fptr(_init)), gp
+	  ;;
+	}
+	{ .mmi
+	  ld8 r3 = [r11]	/* pointer to __libc_ia64_register_backing_store_base */
+	  ld8 out0 = [out0]	/* pointer to `main' function descriptor */
+	  addl out4 = @ltoff(@fptr(_fini)), gp
+	  ;;
+	}
+	{ .mmi
+	  ld8 out3 = [out3]	/* pointer to `init' function descriptor */
+	  ld8 out4 = [out4]	/* pointer to `fini' function descriptor */
+	  nop 0
+	}
+	.body
+	{ .mib
+	  st8 [r3] = r10
+	  mov out5 = ret0	/* dynamic linker destructor */
+	  br.call.sptk.few rp = __uClibc_main
+	}
+	{ .mib
+	  break 0	/* break miserably if we ever return */
+	}
+	.endp _start
+
+/* 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
+
+	.common __libc_ia64_register_backing_store_base, 8, 8
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/crti.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/crti.S
new file mode 100644
index 0000000..c22bbf1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/crti.S
@@ -0,0 +1,36 @@
+/* glibc's sysdeps/ia64/elf/initfini.c used for reference [PROLOG] */
+
+	.text
+	.section .init
+	.global _init#
+	.proc _init#
+_init:
+	.prologue
+	.save ar.pfs, r34
+	alloc r34 = ar.pfs, 0, 3, 0, 0
+	.vframe r32
+	mov r32 = r12
+	.save rp, r33
+	mov r33 = b0
+	.body
+	adds r12 = -16, r12
+	;;
+	.endp _init#
+
+
+
+	.section .fini
+	.global _fini#
+	.proc _fini#
+_fini:
+	.prologue
+	.save ar.pfs, r34
+	alloc r34 = ar.pfs, 0, 3, 0, 0
+	.vframe r32
+	mov r32 = r12
+	.save rp, r33
+	mov r33 = b0
+	.body
+	adds r12 = -16, r12
+	;;
+	.endp _fini#
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/crtn.S
new file mode 100644
index 0000000..5403446
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/crtn.S
@@ -0,0 +1,33 @@
+/* glibc's sysdeps/ia64/elf/initfini.c used for reference [EPILOG] */
+
+	.text
+	.section .init
+	.proc _init#
+_init:
+	.prologue
+	.save ar.pfs, r34
+	.vframe r32
+	.save rp, r33
+	.body
+	.regstk 0,2,0,0
+	mov r12 = r32
+	mov ar.pfs = r34
+	mov b0 = r33
+	br.ret.sptk.many b0
+	.endp _init#
+
+
+
+	.section .fini
+	.proc _fini#
+_fini:
+	.prologue
+	.save ar.pfs, r34
+	.vframe r32
+	.save rp, r33
+	.body
+	mov r12 = r32
+	mov ar.pfs = r34
+	mov b0 = r33
+	br.ret.sptk.many b0
+	.endp _fini#
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/fork.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/fork.S
new file mode 100644
index 0000000..c657453
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/fork.S
@@ -0,0 +1,42 @@
+/* Copyright (C) 2000, 2002 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 "sysdep.h"
+#define _SIGNAL_H
+#include <bits/signum.h>
+
+/* pid_t fork(void); */
+/* Implemented as a clone system call with parameters SIGCHLD and 0	*/
+
+ENTRY(__libc_fork)
+	alloc r2=ar.pfs,0,0,2,0
+	mov out0=SIGCHLD	/* Return SIGCHLD when child finishes	*/
+				/* no other clone flags; nothing shared	*/
+	mov out1=0		/* Standard sp value.			*/
+	;;
+	DO_CALL (SYS_ify (clone))
+	cmp.eq p6,p0=-1,r10
+(p6)	br.cond.spnt.few __syscall_error
+	ret
+PSEUDO_END(__libc_fork)
+
+weak_alias (__libc_fork, __fork)
+libc_hidden_def (__fork)
+weak_alias (__libc_fork, fork)
+libc_hidden_weak (fork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/pipe.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/pipe.S
new file mode 100644
index 0000000..2bfa8a7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/pipe.S
@@ -0,0 +1,37 @@
+/* Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Mosberger <davidm@hpl.hp.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.  */
+
+/* __pipe is a special syscall since it returns two values.  */
+
+#include "sysdep.h"
+
+ENTRY(pipe)
+       .regstk 1,0,0,0
+       DO_CALL (SYS_ify (pipe))
+       cmp.ne p6,p0=-1,r10
+       ;;
+(p6)   st4 [in0]=r8,4
+(p6)   mov ret0=0
+       ;;
+(p6)   st4 [in0]=r9
+(p6)   ret
+       br.cond.spnt.few __syscall_error
+PSEUDO_END(pipe)
+
+libc_hidden_def (pipe)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/setjmp.S
new file mode 100644
index 0000000..cf6c75d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/setjmp.S
@@ -0,0 +1,189 @@
+/* Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005
+   Free Software Foundation, Inc.
+   Contributed by David Mosberger-Tang <davidm@hpl.hp.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.
+
+   The layout of the jmp_buf is as follows.  This is subject to change
+   and user-code should never depend on the particular layout of
+   jmp_buf!
+
+
+  	offset:	description:
+	-------	------------
+  	0x000	stack pointer (r12)	; unchangeable (see _JMPBUF_UNWINDS)
+  	0x008	r1 (gp)
+	0x010	caller's unat
+	0x018	fpsr
+  	0x020	r4
+  	0x028	r5
+  	0x030	r6
+  	0x038	r7
+  	0x040	rp (b0)
+  	0x048	b1
+  	0x050	b2
+  	0x058	b3
+  	0x060	b4
+  	0x068	b5
+  	0x070	ar.pfs
+  	0x078	ar.lc
+  	0x080	pr
+  	0x088	ar.bsp			; unchangeable (see __longjmp.S)
+  	0x090	ar.unat
+	0x098	&__jmp_buf	; address of the jmpbuf (needed to locate NaT bits in unat)
+	0x0a0	 f2
+	0x0b0	 f3
+	0x0c0	 f4
+	0x0d0	 f5
+	0x0e0	f16
+  	0x0f0	f17
+  	0x100	f18
+  	0x110	f19
+  	0x120	f20
+  	0x130	f21
+  	0x130	f22
+  	0x140	f23
+  	0x150	f24
+  	0x160	f25
+  	0x170	f26
+  	0x180	f27
+  	0x190	f28
+  	0x1a0	f29
+  	0x1b0	f30
+  	0x1c0	f31 */
+
+#include "sysdep.h"
+#include <features.h>
+
+	/* The following two entry points are the traditional entry points: */
+
+LEAF(setjmp)
+	alloc r8=ar.pfs,2,0,0,0
+	mov in1=1
+	br.cond.sptk.many _GI___sigsetjmp
+END(setjmp)
+
+LEAF(_setjmp)
+	alloc r8=ar.pfs,2,0,0,0
+	mov in1=0
+	br.cond.sptk.many _GI___sigsetjmp
+END(_setjmp)
+libc_hidden_def (_setjmp)
+
+	/* __sigsetjmp(__jmp_buf buf, int savemask) */
+
+ENTRY(__sigsetjmp)
+	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2)
+	alloc loc1=ar.pfs,2,5,2,0
+	.save ar.unat, loc2
+	mov loc2=ar.unat
+	;;
+	mov r17=ar.fpsr
+	mov r2=in0
+	add r3=8,in0
+	;;
+.mem.offset 8,0;	st8.spill.nta [r2]=sp,16	/* r12 (sp) */
+.mem.offset 0,0;	st8.spill.nta [r3]=gp,16	/* r1 (gp) */
+	;;
+	st8.nta [r2]=loc2,16		/* save caller's unat */
+	st8.nta [r3]=r17,16		/* save fpsr */
+	add r8=0xa0,in0
+	;;
+.mem.offset 8,0;	st8.spill.nta [r2]=r4,16	/* r4 */
+.mem.offset 0,0;	st8.spill.nta [r3]=r5,16	/* r5 */
+	add r9=0xb0,in0
+	;;
+	stf.spill.nta [r8]=f2,32
+	stf.spill.nta [r9]=f3,32
+	mov loc0=rp
+	.body
+	;;
+	stf.spill.nta [r8]=f4,32
+	stf.spill.nta [r9]=f5,32
+	mov r17=b1
+	;;
+	stf.spill.nta [r8]=f16,32
+	stf.spill.nta [r9]=f17,32
+	mov r18=b2
+	;;
+	stf.spill.nta [r8]=f18,32
+	stf.spill.nta [r9]=f19,32
+	mov r19=b3
+	;;
+	stf.spill.nta [r8]=f20,32
+	stf.spill.nta [r9]=f21,32
+	mov r20=b4
+	;;
+	stf.spill.nta [r8]=f22,32
+	stf.spill.nta [r9]=f23,32
+	mov r21=b5
+	;;
+	stf.spill.nta [r8]=f24,32
+	stf.spill.nta [r9]=f25,32
+	mov r22=ar.lc
+	;;
+	stf.spill.nta [r8]=f26,32
+	stf.spill.nta [r9]=f27,32
+	mov r24=pr
+	;;
+	stf.spill.nta [r8]=f28,32
+	stf.spill.nta [r9]=f29,32
+	;;
+	stf.spill.nta [r8]=f30
+	stf.spill.nta [r9]=f31
+
+.mem.offset 8,0;	st8.spill.nta [r2]=r6,16	/* r6 */
+.mem.offset 0,0;	st8.spill.nta [r3]=r7,16	/* r7 */
+	;;
+	mov r23=ar.bsp
+	mov r25=ar.unat
+	mov out0=in0
+
+	st8.nta [r2]=loc0,16		/* b0 */
+	st8.nta [r3]=r17,16		/* b1 */
+	mov out1=in1
+	;;
+	st8.nta [r2]=r18,16		/* b2 */
+	st8.nta [r3]=r19,16		/* b3 */
+	;;
+	st8.nta [r2]=r20,16		/* b4 */
+	st8.nta [r3]=r21,16		/* b5 */
+	;;
+	st8.nta [r2]=loc1,16		/* ar.pfs */
+	st8.nta [r3]=r22,16		/* ar.lc */
+	;;
+	st8.nta [r2]=r24,16		/* pr */
+	st8.nta [r3]=r23,16		/* ar.bsp */
+	;;
+	st8.nta [r2]=r25		/* ar.unat */
+	st8.nta [r3]=in0		/* &__jmp_buf */
+#if defined NOT_IN_libc && defined IS_IN_rtld
+	/* In ld.so we never save the signal mask.  */
+	;;
+#else
+	br.call.dpnt.few rp=__sigjmp_save
+#endif
+.ret0:					/* force a new bundle ::q */
+	mov.m ar.unat=loc2		/* restore caller's unat */
+	mov rp=loc0
+	mov ar.pfs=loc1
+	mov r8=0
+	ret
+END(__sigsetjmp)
+strong_alias(__sigsetjmp, _GI___sigsetjmp)
+
+weak_extern(_setjmp)
+weak_extern(setjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/io.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/io.h
new file mode 100644
index 0000000..cdd6091
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/io.h
@@ -0,0 +1,69 @@
+/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+     Contributed by David Mosberger-Tang <davidm@hpl.hp.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.  */
+
+#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.
+
+   Portability note: not all Linux platforms support this call.  Most
+   platforms based on the PC I/O architecture probably will, however.
+   E.g., Linux/Alpha for Alpha PCs supports this.  */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+		   int __turn_on);
+libc_hidden_proto(ioperm)
+
+/* Set the I/O privilege level to LEVEL.  If LEVEL>3, permission to
+   access any I/O port is granted.  This call requires root
+   privileges. */
+extern int iopl (int __level);
+
+extern unsigned int _inb (unsigned long int __port);
+extern unsigned int _inb (unsigned long int __port);
+extern unsigned int _inw (unsigned long int __port);
+extern unsigned int _inl (unsigned long int __port);
+extern void _outb (unsigned char __val, unsigned long int __port);
+extern void _outw (unsigned short __val, unsigned long int __port);
+extern void _outl (unsigned int __val, unsigned long int __port);
+
+#define inb	_inb
+#define inw	_inw
+#define inl	_inl
+#define outb	_outb
+#define outw	_outw
+#define outl	_outl
+
+/* Access PCI space protected from machine checks.  */
+extern int pciconfig_read (unsigned long int __bus, unsigned long int __dfn,
+			   unsigned long int __off, unsigned long int __len,
+			   unsigned char *__buf);
+
+extern int pciconfig_write (unsigned long int __bus, unsigned long int __dfn,
+			    unsigned long int __off, unsigned long int __len,
+			    unsigned char *__buf);
+
+__END_DECLS
+
+#endif /* _SYS_IO_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/procfs.h
new file mode 100644
index 0000000..b5196b9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/procfs.h
@@ -0,0 +1,130 @@
+/* Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+
+__BEGIN_DECLS
+
+struct elf_siginfo
+  {
+    int si_signo;			/* Signal number.  */
+    int si_code;			/* Extra code.  */
+    int si_errno;			/* Errno.  */
+  };
+
+/* We really need just 72 but let's leave some headroom...  */
+#define ELF_NGREG	128
+/* f0 and f1 could be omitted, but so what...  */
+#define ELF_NFPREG	128
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct ia64_fpreg elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+typedef elf_greg_t greg_t;
+typedef elf_gregset_t gregset_t;
+typedef elf_fpregset_t fpregset_t;
+#define NGREG ELF_NGREG
+
+/* 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.  Fields present but not used are
+   marked with "XXX".  */
+struct elf_prstatus
+  {
+#if 0
+    long int pr_flags;			/* XXX Process flags.  */
+    short int pr_why;			/* XXX Reason for process halt.  */
+    short int pr_what;			/* XXX More detailed reason.  */
+#endif
+    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.  */
+#if 0
+    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
+    struct sigaction pr_action;		/* Signal action for current sig.  */
+#endif
+    __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.  */
+#if 0
+    long int pr_instr;			/* Current instruction.  */
+#endif
+    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 int pr_uid;
+    unsigned 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.  */
+  };
+
+/* Addresses.  */
+typedef void *psaddr_t;
+
+/* Register sets.  Linux has different names.  */
+typedef gregset_t prgregset_t;
+typedef fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+   therefore habe only ine PID type.  */
+typedef __pid_t lwpid_t;
+
+
+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/ia64/sys/ptrace.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/ptrace.h
new file mode 100644
index 0000000..986c4b2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/ptrace.h
@@ -0,0 +1,135 @@
+/* `ptrace' debugger support interface.  Linux/ia64 version.
+   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.  */
+
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H	1
+
+#include <features.h>
+#include <sys/ucontext.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.'  */
+enum __ptrace_request
+{
+  /* Indicate that the process making this request should be traced.
+     All signals received by this process can be intercepted by its
+     parent, and its parent can use the other `ptrace' requests.  */
+  PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+  /* Return the word in the process's text space at address ADDR.  */
+  PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+  /* Return the word in the process's data space at address ADDR.  */
+  PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+  /* Return the word in the process's user area at offset ADDR.  */
+  PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+  /* Write the word DATA into the process's text space at address ADDR.  */
+  PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+  /* Write the word DATA into the process's data space at address ADDR.  */
+  PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+  /* Write the word DATA into the process's user area at offset ADDR.  */
+  PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+  /* Continue the process.  */
+  PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+  /* Kill the process.  */
+  PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+  /* Single step the process.
+     This is not supported on all machines.  */
+  PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+  /* Execute process until next taken branch.  */
+  PTRACE_SINGLEBLOCK = 12,
+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
+
+  /* Get siginfo for process.  */
+  PTRACE_GETSIGINFO = 13,
+#define PT_GETSIGINFO PTRACE_GETSIGINFO
+
+  /* Set new siginfo for process.  */
+  PTRACE_SETSIGINFO = 14,
+#define PT_GETSIGINFO PTRACE_GETSIGINFO
+
+  /* Attach to a process that is already running. */
+  PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+  /* Detach from a process attached to with PTRACE_ATTACH.  */
+  PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+  /* Get all registers (pt_all_user_regs) in one shot */
+  PTRACE_GETREGS = 18,
+#define PT_GETREGS PTRACE_GETREGS
+
+  /* Set all registers (pt_all_user_regs) in one shot */
+  PTRACE_SETREGS = 19,
+#define PT_SETREGS PTRACE_SETREGS
+
+  /* Continue and stop at the next (return from) syscall.  */
+  PTRACE_SYSCALL = 24
+#define PT_SYSCALL PTRACE_SYSCALL
+};
+
+/* pt_all_user_regs is used for PTRACE_GETREGS/PTRACE_SETREGS.  */
+struct pt_all_user_regs
+  {
+    unsigned long nat;
+    unsigned long cr_iip;
+    unsigned long cfm;
+    unsigned long cr_ipsr;
+    unsigned long pr;
+
+    unsigned long gr[32];
+    unsigned long br[8];
+    unsigned long ar[128];
+    struct ia64_fpreg fr[128];
+  };
+
+/* Perform process tracing functions.  REQUEST is one of the values
+   above, and determines the action to be taken.
+   For all requests except PTRACE_TRACEME, PID specifies the process to be
+   traced.
+
+   PID and the other arguments described above for the various requests should
+   appear (those that are used for the particular request) as:
+     pid_t PID, void *ADDR, int DATA, void *ADDR2
+   after REQUEST.  */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/ucontext.h
new file mode 100644
index 0000000..17dc85f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/ucontext.h
@@ -0,0 +1,66 @@
+/* Copyright (C) 1998, 2000, 2001, 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_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+#include <bits/sigcontext.h>
+
+/*
+ * These are here mostly for backwards compatibility with older Unices.
+ * IA-64 Linux does not distinguish between "struct sigcontext" and
+ * "ucontext_t" as all the necessary info is inside the former.
+ */
+
+typedef struct sigcontext mcontext_t;
+
+#if defined __cplusplus && __GNUC_PREREQ (3, 5)
+# define _SC_GR0_OFFSET	\
+	__builtin_offsetof (struct sigcontext, sc_gr[0])
+#elif defined __GNUC__
+# define _SC_GR0_OFFSET	\
+	(((char *) &((struct sigcontext *) 0)->sc_gr[0]) - (char *) 0)
+#else
+# define _SC_GR0_OFFSET	0xc8	/* pray that this is correct... */
+#endif
+
+typedef struct ucontext
+  {
+    union
+      {
+	mcontext_t _mc;
+	struct
+	  {
+	    unsigned long _pad[_SC_GR0_OFFSET/8];
+	    struct ucontext *_link;	/* this should overlay sc_gr[0] */
+	  }
+	_uc;
+      }
+    _u;
+  }
+ucontext_t;
+
+#define uc_mcontext	_u._mc
+#define uc_sigmask	_u._mc.sc_mask
+#define uc_stack	_u._mc.sc_stack
+#define uc_link		_u._uc._link
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/user.h
new file mode 100644
index 0000000..0392187
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/sys/user.h
@@ -0,0 +1,54 @@
+/* Copyright (C) 2002 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
+
+#include <features.h>
+#include <sys/types.h>
+
+/* This definition comes directly from the kernel headers.  If
+   anything changes in them this header has to be changed, too.  */
+
+
+/* The definition in the kernel has the comment "XXX fix me".  */
+#define EF_SIZE		3072
+
+
+struct user
+{
+  unsigned long int regs[EF_SIZE / 8 + 32];	/* Integer and fp regs.  */
+  size_t u_tsize;				/* Text size (pages).  */
+  size_t u_dsize;				/* Data size (pages).  */
+  size_t u_ssize;				/* Stack size (pages).  */
+  unsigned long int start_code;			/* Text starting address.  */
+  unsigned long int start_data;			/* Data starting address.  */
+  unsigned long int start_stack;		/* Stack starting address.  */
+  long int signal;				/* Signal causing core dump. */
+  struct regs *u_ar0;				/* Help gdb find registers.  */
+  unsigned long int magic;			/* Identifies a core file.  */
+  char u_comm[32];				/* User command name.  */
+};
+
+#define NBPG			PAGE_SIZE
+#define UPAGES			1
+#define HOST_TEXT_START_ADDR	(u.start_code)
+#define HOST_DATA_START_ADDR	(u.start_data)
+#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
+
+#endif	/* sys/user.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/syscall.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/syscall.S
new file mode 100644
index 0000000..e4ac834
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/syscall.S
@@ -0,0 +1,30 @@
+/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jes Sorensen <Jes.Sorensen@cern.ch>.
+
+   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 "sysdep.h"
+
+ENTRY(syscall)
+	alloc r2=ar.pfs,1,0,8,0
+	mov r15=r32		/* syscall number */
+	break __BREAK_SYSCALL
+	;;
+	cmp.ne p6,p0=-1,r10	/* r10 = -1 on error */
+(p6)	ret
+	br.cond.spnt.few __syscall_error
+PSEUDO_END(syscall)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/ia64/sysdep.h
new file mode 100644
index 0000000..d10020a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/sysdep.h
@@ -0,0 +1,168 @@
+/* Copyright (C) 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
+   Based on code originally written by David Mosberger-Tang
+
+   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_IA64_SYSDEP_H
+#define _LINUX_IA64_SYSDEP_H 1
+
+#include <features.h>
+#include <asm/unistd.h>
+
+#ifdef __ASSEMBLER__
+
+/* Macros to help writing .prologue directives in assembly code.  */
+#define ASM_UNW_PRLG_RP			0x8
+#define ASM_UNW_PRLG_PFS		0x4
+#define ASM_UNW_PRLG_PSP		0x2
+#define ASM_UNW_PRLG_PR			0x1
+#define ASM_UNW_PRLG_GRSAVE(ninputs)	(32+(ninputs))
+
+#ifdef	__STDC__
+#define C_LABEL(name)		name :
+#else
+#define C_LABEL(name)		name/**/:
+#endif
+
+#define CALL_MCOUNT
+
+#define ENTRY(name)				\
+	.text;					\
+	.align 32;				\
+	.proc C_SYMBOL_NAME(name);		\
+	.global C_SYMBOL_NAME(name);		\
+	C_LABEL(name)				\
+	CALL_MCOUNT
+
+#define LEAF(name)				\
+  .text;					\
+  .align 32;					\
+  .proc C_SYMBOL_NAME(name);			\
+  .global name;					\
+  C_LABEL(name)
+
+/* Mark the end of function SYM.  */
+#undef END
+#define END(sym)	.endp C_SYMBOL_NAME(sym)
+
+/* 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
+#ifdef __STDC__
+# define SYS_ify(syscall_name)	__NR_##syscall_name
+#else
+# define SYS_ify(syscall_name)	__NR_/**/syscall_name
+#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 %d0 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 savely test with -4095.  */
+
+/* We don't want the label for the error handler to be visible in the symbol
+   table when we define it here.  */
+#define SYSCALL_ERROR_LABEL __syscall_error
+
+#undef PSEUDO
+#define	PSEUDO(name, syscall_name, args)	\
+  ENTRY(name)					\
+    DO_CALL (SYS_ify(syscall_name));		\
+	cmp.eq p6,p0=-1,r10;			\
+(p6)	br.cond.spnt.few __syscall_error;
+
+#define DO_CALL_VIA_BREAK(num)			\
+	mov r15=num;				\
+	break __BREAK_SYSCALL
+
+#ifdef IA64_USE_NEW_STUB
+# ifdef SHARED
+#  define DO_CALL(num)				\
+	.prologue;				\
+	adds r2 = SYSINFO_OFFSET, r13;;		\
+	ld8 r2 = [r2];				\
+	.save ar.pfs, r11;			\
+	mov r11 = ar.pfs;;			\
+	.body;					\
+	mov r15 = num;				\
+	mov b7 = r2;				\
+	br.call.sptk.many b6 = b7;;		\
+	.restore sp;				\
+	mov ar.pfs = r11;			\
+	.prologue;				\
+	.body
+# else /* !SHARED */
+#  define DO_CALL(num)				\
+	.prologue;				\
+	mov r15 = num;				\
+	movl r2 = _dl_sysinfo;;			\
+	ld8 r2 = [r2];				\
+	.save ar.pfs, r11;			\
+	mov r11 = ar.pfs;;			\
+	.body;					\
+	mov b7 = r2;				\
+	br.call.sptk.many b6 = b7;;		\
+	.restore sp;				\
+	mov ar.pfs = r11;			\
+	.prologue;				\
+	.body
+# endif
+#else
+# define DO_CALL(num)				DO_CALL_VIA_BREAK(num)
+#endif
+
+#undef PSEUDO_END
+#define PSEUDO_END(name)	.endp C_SYMBOL_NAME(name);
+
+#undef PSEUDO_NOERRNO
+#define	PSEUDO_NOERRNO(name, syscall_name, args)	\
+  ENTRY(name)						\
+    DO_CALL (SYS_ify(syscall_name));
+
+#undef PSEUDO_END_NOERRNO
+#define PSEUDO_END_NOERRNO(name)	.endp C_SYMBOL_NAME(name);
+
+#undef PSEUDO_ERRVAL
+#define	PSEUDO_ERRVAL(name, syscall_name, args)	\
+  ENTRY(name)					\
+    DO_CALL (SYS_ify(syscall_name));		\
+	cmp.eq p6,p0=-1,r10;			\
+(p6)	mov r10=r8;
+
+
+#undef PSEUDO_END_ERRVAL
+#define PSEUDO_END_ERRVAL(name)	.endp C_SYMBOL_NAME(name);
+
+#undef END
+#define END(name)						\
+	.size	C_SYMBOL_NAME(name), . - C_SYMBOL_NAME(name) ;	\
+	.endp	C_SYMBOL_NAME(name)
+
+#define ret			br.ret.sptk.few b0
+#define ret_NOERRNO		ret
+#define ret_ERRVAL		ret
+
+#endif /* not __ASSEMBLER__ */
+
+#endif /* linux/ia64/sysdep.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/ia64/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/ia64/vfork.S
new file mode 100644
index 0000000..f233b05
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/ia64/vfork.S
@@ -0,0 +1,44 @@
+/* Copyright (C) 2000, 2002 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 "sysdep.h"
+#define _SIGNAL_H
+#include <bits/signum.h>
+
+/* The following are defined in linux/sched.h, which unfortunately	*/
+/* is not safe for inclusion in an assembly file.			*/
+#define CLONE_VM        0x00000100      /* set if VM shared between processes */
+#define CLONE_VFORK     0x00004000      /* set if the parent wants the child to wake it up on mm_release */
+
+/* pid_t vfork(void); */
+/* Implemented as __clone_syscall(CLONE_VFORK | CLONE_VM | SIGCHLD, 0)	*/
+
+ENTRY(__vfork)
+	alloc r2=ar.pfs,0,0,2,0
+	mov out0=CLONE_VM+CLONE_VFORK+SIGCHLD
+	mov out1=0		/* Standard sp value.			*/
+	;;
+	DO_CALL_VIA_BREAK (SYS_ify (clone))
+	cmp.eq p6,p0=-1,r10
+(p6)	br.cond.spnt.few __syscall_error
+	ret
+PSEUDO_END(__vfork)
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/Makefile b/ap/build/uClibc/libc/sysdeps/linux/m68k/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/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/m68k/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/m68k/Makefile.arch
new file mode 100644
index 0000000..bde54c5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/Makefile.arch
@@ -0,0 +1,10 @@
+# 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 __syscall_error.c
+
+SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/README.m68k b/ap/build/uClibc/libc/sysdeps/linux/m68k/README.m68k
new file mode 100644
index 0000000..c1c1b4b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/README.m68k
@@ -0,0 +1,54 @@
+
+README for uC-libc on the m68k[nommu] architecture
+
+James Graves <jgraves@deltamobile.com>
+
+For now (2001/1/9) support for the m68k should be considered "alpha"
+quality at best.  It mostly works OK for some of the stuff I'm working
+on, but you can't fully compile other things (like the user
+applications for uClinux).  Needs lots more testing.
+
+Only developed/tested with m68k-pic-coff-gcc 2.7.2.3-pic-060999, from
+Lineo.
+
+Configuration:
+
+	Read and edit the Config file, carefully.
+
+	TARGET_ARCH=m68k
+	CROSS_COMPILE = m68k-pic-coff-
+	CC = $(CROSS_COMPILE)gcc
+	STRIPTOOL = $(CROSS_COMPILE)strip
+	KERNEL_SOURCE=/opt/uClinux/linux
+	HAS_MMU = false
+	HAS_FLOATS = false
+	MALLOC = malloc-simple
+	INSTALL_DIR = /opt/uClinux/m68k-pic-coff
+
+	The regular malloc library is broken, dunno why.  Use
+	simple-malloc.
+
+Installation:
+	Theoretically, you should be able to install right over the
+	existing uC-libc 0.9.1 files in
+	/opt/uClinux/m68k-pic-coff/include, but I recommend cleaning
+	out all the include files there.
+
+	The only file in there that's not from the old uC-libc is
+	assert.h, but I don't know why that would be the valid copy.
+
+	run:
+		make install
+
+Problems:
+
+	I _may_ be able to help if you run into problems.  Create a
+	really, really short program that demonstrates the problem,
+	and contact me.
+
+TODO:
+	Fix vfork().
+
+	Does crt0.o still need to be a separate file?  Can't I just
+	stick it in libc.a and be done with it?  Is that specified in
+	the GCC link options?
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/m68k/__longjmp.S
new file mode 100644
index 0000000..5db9e43
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/__longjmp.S
@@ -0,0 +1,26 @@
+
+/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
+/* This file is released under the LGPL, any version you like */
+
+#define _ASM
+#define _SETJMP_H
+#include <features.h>
+#include <bits/setjmp.h>
+
+.globl __longjmp
+.type  __longjmp,@function
+.align 4
+__longjmp:
+	moveal	%sp@(4), %a0
+	movel	%sp@(8), %d0
+	bne		1f
+	movel	#1, %d0
+1:
+	moveml	%a0@(JB_REGS), %d2-%d7/%a2-%a7
+#if defined(__HAVE_68881__) || defined(__HAVE_FPU__)
+	fmovemx %a0@(JB_FPREGS), %fp2-%fp7
+#endif
+	movel	%a0@(JB_PC), %sp@
+	rts
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/__syscall_error.c b/ap/build/uClibc/libc/sysdeps/linux/m68k/__syscall_error.c
new file mode 100644
index 0000000..a29f6ff
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/__syscall_error.c
@@ -0,0 +1,19 @@
+/* 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(void) attribute_hidden;
+int __syscall_error(void)
+{
+	register int err_no __asm__("%d0");
+	__set_errno(-err_no);
+	return -1;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/byteswap.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/byteswap.h
new file mode 100644
index 0000000..4884742
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/byteswap.h
@@ -0,0 +1,37 @@
+/* Macros to swap the order of bytes in integer values.  m68k version.
+   Copyright (C) 1997, 2002 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 _ASM_BITS_BYTESWAP_H
+#define _ASM_BITS_BYTESWAP_H 1
+
+#if !defined __mcoldfire__
+# define __bswap_non_constant_32(x) \
+  __extension__							\
+  ({ unsigned int __bswap_32_v;					\
+     __asm__ __volatile__ ("ror%.w %#8, %0;"			\
+			   "swap %0;"				\
+			   "ror%.w %#8, %0"			\
+			   : "=d" (__bswap_32_v)		\
+			   : "0" ((unsigned int) (x)));		\
+     __bswap_32_v; })
+#endif
+
+#endif
+
+#include <bits/byteswap-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/endian.h
new file mode 100644
index 0000000..bf4ecb6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/endian.h
@@ -0,0 +1,7 @@
+/* m68k is big-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __BIG_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/fcntl.h
new file mode 100644
index 0000000..e564b42
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/fcntl.h
@@ -0,0 +1,238 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 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	_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]FL.  */
+#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/m68k/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/fenv.h
new file mode 100644
index 0000000..7c0bcb6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/fenv.h
@@ -0,0 +1,79 @@
+/* Copyright (C) 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.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Define bits representing the exception.  We use the bit positions of
+   the appropriate bits in the FPSR Accrued Exception Byte.  */
+enum
+  {
+    FE_INEXACT = 1 << 3,
+#define FE_INEXACT	FE_INEXACT
+    FE_DIVBYZERO = 1 << 4,
+#define FE_DIVBYZERO	FE_DIVBYZERO
+    FE_UNDERFLOW = 1 << 5,
+#define FE_UNDERFLOW	FE_UNDERFLOW
+    FE_OVERFLOW = 1 << 6,
+#define FE_OVERFLOW	FE_OVERFLOW
+    FE_INVALID = 1 << 7
+#define FE_INVALID	FE_INVALID
+  };
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The m68k FPU supports all of the four defined rounding modes.  We use
+   the bit positions in the FPCR Mode Control Byte as the values for the
+   appropriate macros.  */
+enum
+  {
+    FE_TONEAREST = 0,
+#define FE_TONEAREST	FE_TONEAREST
+    FE_TOWARDZERO = 1 << 4,
+#define FE_TOWARDZERO	FE_TOWARDZERO
+    FE_DOWNWARD = 2 << 4,
+#define FE_DOWNWARD	FE_DOWNWARD
+    FE_UPWARD = 3 << 4
+#define FE_UPWARD	FE_UPWARD
+  };
+
+
+/* Type representing exception flags.  */
+typedef unsigned int fexcept_t;
+
+
+/* Type representing floating-point environment.  This structure
+   corresponds to the layout of the block written by `fmovem'.  */
+typedef struct
+  {
+    unsigned int __control_register;
+    unsigned int __status_register;
+    unsigned int __instruction_address;
+  }
+fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((__const fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exceptions are masked.  */
+# define FE_NOMASK_ENV	((__const fenv_t *) -2)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/kernel_stat.h
new file mode 100644
index 0000000..3911c9b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/kernel_stat.h
@@ -0,0 +1,52 @@
+#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 {
+	unsigned short st_dev;
+	unsigned short __pad1;
+	unsigned long st_ino;
+	unsigned short st_mode;
+	unsigned short st_nlink;
+	unsigned short st_uid;
+	unsigned short st_gid;
+	unsigned short st_rdev;
+	unsigned short __pad2;
+	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 char	__pad0[6];
+	unsigned short	st_dev;
+	unsigned char	__pad1[2];
+#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 char	__pad2[6];
+	unsigned short	st_rdev;
+	unsigned char	__pad3[2];
+	long long	st_size;
+	unsigned long	st_blksize;
+	unsigned long	__pad4;		/* future possible st_blocks high bits */
+	unsigned 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;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/kernel_types.h
new file mode 100644
index 0000000..176b968
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/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_M68K_POSIX_TYPES_H
+#define __ARCH_M68K_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_M68K_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/mathdef.h
new file mode 100644
index 0000000..a69e930
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/mathdef.h
@@ -0,0 +1,42 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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
+
+/* The m68k FPUs evaluate all values in the 96 bit floating-point format
+   which is also available for the user as `long double'.  Therefore we
+   define: */
+typedef long double float_t;	/* `float' expressions are evaluated as
+				   `long double'.  */
+typedef long double double_t;	/* `double' expressions are evaluated as
+				   `long double'.  */
+
+/* The values returned by `ilogb' for 0 and NaN respectively.  */
+# define FP_ILOGB0	(-2147483647 - 1)
+# define FP_ILOGBNAN	(2147483647)
+
+#endif	/* ISO C99 */
+
+#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/mathinline.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/mathinline.h
new file mode 100644
index 0000000..f316600
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/mathinline.h
@@ -0,0 +1,445 @@
+/* Definitions of inline math functions implemented by the m68881/2.
+   Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004
+     Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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.  */
+
+#ifdef	__GNUC__
+
+#ifdef __USE_ISOC99
+/* GCC 3.1 and up have builtins that actually can be used.  */
+# if !__GNUC_PREREQ (3,1)
+/* ISO C99 defines some macros to perform unordered comparisons.  The
+   m68k FPU supports this with special opcodes and we should use them.
+   These must not be inline functions since we have to be able to handle
+   all floating-point types.  */
+#  undef isgreater
+#  undef isgreaterequal
+#  undef isless
+#  undef islessequal
+#  undef islessgreater
+#  undef isunordered
+#  define isgreater(x, y)					\
+   __extension__					\
+   ({ char __result;					\
+      __asm__ ("fcmp%.x %2,%1; fsogt %0"		\
+	       : "=dm" (__result) : "f" (x), "f" (y));	\
+      __result != 0; })
+
+#  define isgreaterequal(x, y)				\
+   __extension__					\
+   ({ char __result;					\
+      __asm__ ("fcmp%.x %2,%1; fsoge %0"		\
+	       : "=dm" (__result) : "f" (x), "f" (y));	\
+      __result != 0; })
+
+#  define isless(x, y)					\
+   __extension__					\
+   ({ char __result;					\
+      __asm__ ("fcmp%.x %2,%1; fsolt %0"		\
+	       : "=dm" (__result) : "f" (x), "f" (y));	\
+      __result != 0; })
+
+#  define islessequal(x, y)				\
+   __extension__					\
+   ({ char __result;					\
+      __asm__ ("fcmp%.x %2,%1; fsole %0"		\
+	       : "=dm" (__result) : "f" (x), "f" (y));	\
+      __result != 0; })
+
+#  define islessgreater(x, y)				\
+   __extension__					\
+   ({ char __result;					\
+      __asm__ ("fcmp%.x %2,%1; fsogl %0"		\
+	       : "=dm" (__result) : "f" (x), "f" (y));	\
+      __result != 0; })
+
+#  define isunordered(x, y)				\
+   __extension__					\
+   ({ char __result;					\
+      __asm__ ("fcmp%.x %2,%1; fsun %0"			\
+	       : "=dm" (__result) : "f" (x), "f" (y));	\
+      __result != 0; })
+# endif /* GCC 3.1 */
+#endif
+
+
+#if (!defined __NO_MATH_INLINES && defined __OPTIMIZE__) \
+    || defined __LIBC_INTERNAL_MATH_INLINES
+
+#ifdef	__LIBC_INTERNAL_MATH_INLINES
+/* This is used when defining the functions themselves.  Define them with
+   __ names, and with `static inline' instead of `extern inline' so the
+   bodies will always be used, never an external function call.  */
+# define __m81_u(x)		__CONCAT(__,x)
+# define __m81_inline		static __inline
+#else
+# define __m81_u(x)		x
+# ifdef __cplusplus
+#  define __m81_inline		__inline
+# else
+#  define __m81_inline		extern __inline
+# endif
+# define __M81_MATH_INLINES	1
+#endif
+
+/* Define a const math function.  */
+#define __m81_defun(rettype, func, args)				      \
+  __m81_inline rettype __attribute__((__const__))			      \
+  __m81_u(func) args
+
+/* Define the three variants of a math function that has a direct
+   implementation in the m68k fpu.  FUNC is the name for C (which will be
+   suffixed with f and l for the float and long double version, resp).  OP
+   is the name of the fpu operation (without leading f).  */
+
+#if defined __USE_MISC || defined __USE_ISOC99
+# define __inline_mathop(func, op)			\
+  __inline_mathop1(double, func, op)			\
+  __inline_mathop1(float, __CONCAT(func,f), op)	\
+  __inline_mathop1(long double, __CONCAT(func,l), op)
+#else
+# define __inline_mathop(func, op)			\
+  __inline_mathop1(double, func, op)
+#endif
+
+#define __inline_mathop1(float_type,func, op)				      \
+  __m81_defun (float_type, func, (float_type __mathop_x))		      \
+  {									      \
+    float_type __result;						      \
+    __asm__("f" __STRING(op) "%.x %1, %0" : "=f" (__result) : "f" (__mathop_x));\
+    return __result;							      \
+  }
+
+__inline_mathop(__atan, atan)
+__inline_mathop(__cos, cos)
+__inline_mathop(__sin, sin)
+__inline_mathop(__tan, tan)
+__inline_mathop(__tanh, tanh)
+__inline_mathop(__fabs, abs)
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__inline_mathop(__rint, int)
+__inline_mathop(__expm1, etoxm1)
+__inline_mathop(__log1p, lognp1)
+#endif
+
+#ifdef __USE_MISC
+__inline_mathop(__significand, getman)
+#endif
+
+#ifdef __USE_ISOC99
+__inline_mathop(__trunc, intrz)
+#endif
+
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+
+__inline_mathop(atan, atan)
+__inline_mathop(cos, cos)
+__inline_mathop(sin, sin)
+__inline_mathop(tan, tan)
+__inline_mathop(tanh, tanh)
+
+# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__inline_mathop(rint, int)
+__inline_mathop(expm1, etoxm1)
+__inline_mathop(log1p, lognp1)
+# endif
+
+# ifdef __USE_MISC
+__inline_mathop(significand, getman)
+# endif
+
+# ifdef __USE_ISOC99
+__inline_mathop(trunc, intrz)
+# endif
+
+#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
+
+/* This macro contains the definition for the rest of the inline
+   functions, using FLOAT_TYPE as the domain type and S as the suffix
+   for the function names.  */
+
+#define __inline_functions(float_type, s)				  \
+__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x))	  \
+{									  \
+  float_type __result;							  \
+  unsigned long int __ctrl_reg;						  \
+  __asm__ __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg));		  \
+  /* Set rounding towards negative infinity.  */			  \
+  __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs.  */		  \
+		      : "dmi" ((__ctrl_reg & ~0x10) | 0x20));		  \
+  /* Convert X to an integer, using -Inf rounding.  */			  \
+  __asm__ __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x));	  \
+  /* Restore the previous rounding mode.  */				  \
+  __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs.  */		  \
+		      : "dmi" (__ctrl_reg));				  \
+  return __result;							  \
+}									  \
+									  \
+__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x))	  	  \
+{									  \
+  float_type __result;							  \
+  unsigned long int __ctrl_reg;						  \
+  __asm__ __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg));		  \
+  /* Set rounding towards positive infinity.  */			  \
+  __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs.  */		  \
+		      : "dmi" (__ctrl_reg | 0x30));			  \
+  /* Convert X to an integer, using +Inf rounding.  */			  \
+  __asm__ __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x));	  \
+  /* Restore the previous rounding mode.  */				  \
+  __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs.  */		  \
+		      : "dmi" (__ctrl_reg));				  \
+  return __result;							  \
+}
+
+__inline_functions(double,)
+#if defined __USE_MISC || defined __USE_ISOC99
+__inline_functions(float,f)
+__inline_functions(long double,l)
+#endif
+#undef __inline_functions
+
+#ifdef __USE_MISC
+
+# define __inline_functions(float_type, s)				  \
+__m81_defun (int, __CONCAT(__isinf,s), (float_type __value))	  	  \
+{									  \
+  /* There is no branch-condition for infinity,				  \
+     so we must extract and examine the condition codes manually.  */	  \
+  unsigned long int __fpsr;						  \
+  __asm__("ftst%.x %1\n"							  \
+	"fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value));	  \
+  return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0;	  \
+}									  \
+									  \
+__m81_defun (int, __CONCAT(__finite,s), (float_type __value))	  	  \
+{									  \
+  /* There is no branch-condition for infinity, so we must extract and	  \
+     examine the condition codes manually.  */				  \
+  unsigned long int __fpsr;						  \
+  __asm__ ("ftst%.x %1\n"							  \
+	 "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value));	  \
+  return (__fpsr & (3 << 24)) == 0;					  \
+}									  \
+									  \
+__m81_defun (float_type, __CONCAT(__scalbn,s),				  \
+	     (float_type __x, int __n))					  \
+{									  \
+  float_type __result;							  \
+  __asm__ ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x));  \
+  return __result;							  \
+}
+
+__inline_functions(double,)
+__inline_functions(float,f)
+__inline_functions(long double,l)
+# undef __inline_functions
+
+#endif /* Use misc.  */
+
+#if defined __USE_MISC || defined __USE_XOPEN
+
+# define __inline_functions(float_type, s)				  \
+__m81_defun (int, __CONCAT(__isnan,s), (float_type __value))	  	  \
+{									  \
+  char __result;							  \
+  __asm__("ftst%.x %1\n"							  \
+	"fsun %0" : "=dm" (__result) : "f" (__value));			  \
+  return __result;							  \
+}
+
+__inline_functions(double,)
+# ifdef __USE_MISC
+__inline_functions(float,f)
+__inline_functions(long double,l)
+# endif
+# undef __inline_functions
+
+#endif
+
+#ifdef __USE_ISOC99
+
+# define __inline_functions(float_type, s)				  \
+__m81_defun (int, __CONCAT(__signbit,s), (float_type __value))	  	  \
+{									  \
+  /* There is no branch-condition for the sign bit, so we must extract	  \
+     and examine the condition codes manually.  */			  \
+  unsigned long int __fpsr;						  \
+  __asm__ ("ftst%.x %1\n"							  \
+	 "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value));	  \
+  return (__fpsr >> 27) & 1;						  \
+}									  \
+									  \
+  __m81_defun (float_type, __CONCAT(__scalbln,s),			  \
+	     (float_type __x, long int __n))				  \
+{									  \
+  return __CONCAT(__scalbn,s) (__x, __n);				  \
+}									  \
+									  \
+__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x))	  \
+{									  \
+  float_type __result;							  \
+  unsigned long int __ctrl_reg;						  \
+  __asm__ __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg));		  \
+  /* Temporarily disable the inexact exception.  */			  \
+  __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs.  */		  \
+		      : "dmi" (__ctrl_reg & ~0x200));			  \
+  __asm__ __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x));	  \
+  __asm__ __volatile__ ("fmove%.l %0, %!" : /* No outputs.  */		  \
+		      : "dmi" (__ctrl_reg));				  \
+  return __result;							  \
+}									  \
+									  \
+__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x))		  \
+{									  \
+  long int __result;							  \
+  __asm__ ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x));		  \
+  return __result;							  \
+}									  \
+									  \
+__m81_inline float_type							  \
+__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y,		  \
+			   float_type __z)				  \
+{									  \
+  return (__x * __y) + __z;						  \
+}
+
+__inline_functions (double,)
+__inline_functions (float,f)
+__inline_functions (long double,l)
+# undef __inline_functions
+
+#endif /* Use ISO C9x */
+
+#ifdef __USE_GNU
+
+# define __inline_functions(float_type, s)				\
+__m81_inline void							\
+__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx,	\
+			      float_type *__cosx)			\
+{									\
+  __asm__ ("fsincos%.x %2,%1:%0"						\
+	 : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x));			\
+}
+
+__inline_functions (double,)
+__inline_functions (float,f)
+__inline_functions (long double,l)
+# undef __inline_functions
+
+#endif
+
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+
+/* Define inline versions of the user visible functions.  */
+
+/* Note that there must be no whitespace before the argument passed for
+   NAME, to make token pasting work correctly with -traditional.  */
+# define __inline_forward_c(rettype, name, args1, args2)	\
+extern __inline rettype __attribute__((__const__))		\
+  name args1							\
+{								\
+  return __CONCAT(__,name) args2;				\
+}
+
+# define __inline_forward(rettype, name, args1, args2)	\
+extern __inline rettype name args1			\
+{							\
+  return __CONCAT(__,name) args2;			\
+}
+
+__inline_forward_c(double,floor, (double __x), (__x))
+__inline_forward_c(double,ceil, (double __x), (__x))
+# ifdef __USE_MISC
+#  ifndef __USE_ISOC99 /* Conflict with macro of same name.  */
+__inline_forward_c(int,isinf, (double __value), (__value))
+#  endif
+__inline_forward_c(int,finite, (double __value), (__value))
+__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n))
+# endif
+# if defined __USE_MISC || defined __USE_XOPEN
+#  ifndef __USE_ISOC99 /* Conflict with macro of same name.  */
+__inline_forward_c(int,isnan, (double __value), (__value))
+#  endif
+# endif
+# ifdef __USE_ISOC99
+__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
+__inline_forward_c(double,nearbyint, (double __value), (__value))
+__inline_forward_c(long int,lrint, (double __value), (__value))
+__inline_forward_c(double,fma, (double __x, double __y, double __z),
+		   (__x, __y, __z))
+# endif
+# ifdef __USE_GNU
+__inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
+		 (__x, __sinx, __cosx))
+# endif
+
+# if defined __USE_MISC || defined __USE_ISOC99
+
+__inline_forward_c(float,floorf, (float __x), (__x))
+__inline_forward_c(float,ceilf, (float __x), (__x))
+#  ifdef __USE_MISC
+__inline_forward_c(int,isinff, (float __value), (__value))
+__inline_forward_c(int,finitef, (float __value), (__value))
+__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n))
+__inline_forward_c(int,isnanf, (float __value), (__value))
+#  endif
+# ifdef __USE_ISOC99
+__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
+__inline_forward_c(float,nearbyintf, (float __value), (__value))
+__inline_forward_c(long int,lrintf, (float __value), (__value))
+__inline_forward_c(float,fmaf, (float __x, float __y, float __z),
+		   (__x, __y, __z))
+# endif
+# ifdef __USE_GNU
+__inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx),
+		 (__x, __sinx, __cosx))
+# endif
+
+__inline_forward_c(long double,floorl, (long double __x), (__x))
+__inline_forward_c(long double,ceill, (long double __x), (__x))
+# ifdef __USE_MISC
+__inline_forward_c(int,isinfl, (long double __value), (__value))
+__inline_forward_c(int,finitel, (long double __value), (__value))
+__inline_forward_c(long double,scalbnl, (long double __x, int __n), (__x, __n))
+__inline_forward_c(int,isnanl, (long double __value), (__value))
+# endif
+# ifdef __USE_ISOC99
+__inline_forward_c(long double,scalblnl, (long double __x, long int __n),
+		   (__x, __n))
+__inline_forward_c(long double,nearbyintl, (long double __value), (__value))
+__inline_forward_c(long int,lrintl, (long double __value), (__value))
+__inline_forward_c(long double,fmal,
+		   (long double __x, long double __y, long double __z),
+		   (__x, __y, __z))
+# endif
+# ifdef __USE_GNU
+__inline_forward(void,sincosl,
+		 (long double __x, long double *__sinx, long double *__cosx),
+		 (__x, __sinx, __cosx))
+# endif
+
+#endif /* Use misc or ISO C99 */
+
+#undef __inline_forward
+#undef __inline_forward_c
+
+#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
+
+#endif
+#endif	/* GCC.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/poll.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/poll.h
new file mode 100644
index 0000000..f7a7393
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/poll.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1997, 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_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for.  These bits may be set in `events'
+   to indicate the interesting event types; they will appear in `revents'
+   to indicate the status of the file descriptor.  */
+#define POLLIN		0x001		/* There is data to read.  */
+#define POLLPRI		0x002		/* There is urgent data to read.  */
+#define POLLOUT		0x004		/* Writing now will not block.  */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2.  */
+# define POLLRDNORM	0x040		/* Normal data may be read.  */
+# define POLLRDBAND	0x080		/* Priority data may be read.  */
+# define POLLWRNORM	POLLOUT		/* Writing now will not block.  */
+# define POLLWRBAND	0x100		/* Priority data may be written.  */
+#endif
+
+/* Event types always implicitly polled for.  These bits need not be set in
+   `events', but they will appear in `revents' to indicate the status of
+   the file descriptor.  */
+#define POLLERR		0x008		/* Error condition.  */
+#define POLLHUP		0x010		/* Hung up.  */
+#define POLLNVAL	0x020		/* Invalid polling request.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/setjmp.h
new file mode 100644
index 0000000..a6b0ed0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/setjmp.h
@@ -0,0 +1,68 @@
+/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
+/* Copyright (C) 1997,1998,2005,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.  */
+
+/* Define the machine-dependent type `jmp_buf'.  m68k 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
+
+typedef struct
+  {
+    /* There are eight 4-byte data registers, but D0 is not saved.  */
+    long int __dregs[7];
+
+    /* There are six 4-byte address registers, plus the FP and SP.  */
+    int *__aregs[6];
+    int *__fp;
+    int *__sp;
+
+#if defined __HAVE_68881__ || defined __HAVE_FPU__
+    /* There are eight floating point registers which
+       are saved in IEEE 96-bit extended format.  */
+    char __fpregs[8 * (96 / 8)];
+#endif
+
+  } __jmp_buf[1];
+
+#endif
+
+#define JB_REGS   0
+#define JB_DREGS  0
+#define JB_AREGS  24
+#define JB_PC     48
+#define JB_FPREGS 52
+
+#if defined __HAVE_68881__ || defined __HAVE_FPU__
+# define JB_SIZE 76
+#else
+# define JB_SIZE 52
+#endif
+
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)->__aregs[5])
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/sigcontextinfo.h
new file mode 100644
index 0000000..b7e08cf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/sigcontextinfo.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>, 1998.
+
+   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 SIGCONTEXT int _code, struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS _code,
+#define GET_PC(ctx)	((void *) (ctx)->sc_pc)
+#define GET_FRAME(ctx)	((void *) __builtin_frame_address (1))
+#define GET_STACK(ctx)	((void *) (ctx)->sc_usp)
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/stackinfo.h
new file mode 100644
index 0000000..66e5a17
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On m68k the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/stat.h
new file mode 100644
index 0000000..8d18d6d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/stat.h
@@ -0,0 +1,169 @@
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002,2008,2009
+     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_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_LINUX_OLD	1
+#define _STAT_VER_KERNEL	1
+#define _STAT_VER_SVR4		2
+#define _STAT_VER_LINUX		3
+#define _STAT_VER		_STAT_VER_LINUX	/* The one defined below.  */
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	1
+#define _MKNOD_VER_SVR4		2
+#define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below.  */
+
+
+struct stat
+  {
+    __dev_t st_dev;			/* Device.  */
+    unsigned short int __pad1;
+#ifndef __USE_FILE_OFFSET64
+    __ino_t st_ino;			/* File serial number.	*/
+#else
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+#endif
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned short int __pad2;
+#ifndef __USE_FILE_OFFSET64
+    __off_t st_size;			/* Size of file, in bytes.  */
+#else
+    __off64_t st_size;			/* Size of file, in bytes.  */
+#endif
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+#ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+#else
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#endif
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+#ifndef __USE_FILE_OFFSET64
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+#else
+    __ino64_t st_ino;			/* File serial number.	*/
+#endif
+  };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;			/* Device.  */
+    unsigned short int __pad1;
+
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned short int __pad2;
+    __off64_t st_size;			/* Size of file, in bytes.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    __ino64_t st_ino;			/* File serial number.		*/
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/syscalls.h
new file mode 100644
index 0000000..17966ed
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/syscalls.h
@@ -0,0 +1,113 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+/* m68k headers does stupid stuff with __NR_iopl / __NR_vm86:
+ * #define __NR_iopl   not supported
+ * #define __NR_vm86   not supported
+ */
+#undef __NR_iopl
+#undef __NR_vm86
+
+#ifndef __ASSEMBLER__
+
+/* Linux takes system call arguments in registers:
+
+	syscall number	%d0	     call-clobbered
+	arg 1		%d1	     call-clobbered
+	arg 2		%d2	     call-saved
+	arg 3		%d3	     call-saved
+	arg 4		%d4	     call-saved
+	arg 5		%d5	     call-saved
+	arg 6		%a0	     call-clobbered
+
+   The stack layout upon entering the function is:
+
+	24(%sp)		Arg# 6
+	20(%sp)		Arg# 5
+	16(%sp)		Arg# 4
+	12(%sp)		Arg# 3
+	 8(%sp)		Arg# 2
+	 4(%sp)		Arg# 1
+	  (%sp)		Return address
+
+   (Of course a function with say 3 arguments does not have entries for
+   arguments 4 and 5.)
+
+   Separate move's are faster than movem, but need more space.  Since
+   speed is more important, we don't use movem.  Since %a0 and %a1 are
+   scratch registers, we can use them for saving as well.  */
+
+/* Define a macro which expands inline into the wrapper code for a system
+   call.  This use is for internal calls that do not need to handle errors
+   normally.  It will never touch errno.  This returns just what the kernel
+   gave back.  */
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\
+(__extension__ \
+  ({ unsigned int _sys_result;				\
+     {							\
+       /* Load argument values in temporary variables
+	  to perform side effects like function calls
+	  before the call used registers are set.  */	\
+       LOAD_ARGS_##nr (args)				\
+       LOAD_REGS_##nr					\
+       register int _d0 __asm__ ("%d0") = name;		\
+       __asm__ __volatile__ ("trap #0"			\
+		     : "=d" (_d0)			\
+		     : "0" (_d0) ASM_ARGS_##nr		\
+		     : "memory");			\
+       _sys_result = _d0;				\
+     }							\
+     (int) _sys_result;					\
+   }) \
+)
+#define LOAD_ARGS_0()
+#define LOAD_REGS_0
+#define ASM_ARGS_0
+#define LOAD_ARGS_1(a1)				\
+  LOAD_ARGS_0 ()				\
+  int __arg1 = (int) (a1);
+#define LOAD_REGS_1				\
+  register int _d1 __asm__ ("d1") = __arg1;	\
+  LOAD_REGS_0
+#define ASM_ARGS_1	ASM_ARGS_0, "d" (_d1)
+#define LOAD_ARGS_2(a1, a2)			\
+  LOAD_ARGS_1 (a1)				\
+  int __arg2 = (int) (a2);
+#define LOAD_REGS_2				\
+  register int _d2 __asm__ ("d2") = __arg2;	\
+  LOAD_REGS_1
+#define ASM_ARGS_2	ASM_ARGS_1, "d" (_d2)
+#define LOAD_ARGS_3(a1, a2, a3)			\
+  LOAD_ARGS_2 (a1, a2)				\
+  int __arg3 = (int) (a3);
+#define LOAD_REGS_3				\
+  register int _d3 __asm__ ("d3") = __arg3;	\
+  LOAD_REGS_2
+#define ASM_ARGS_3	ASM_ARGS_2, "d" (_d3)
+#define LOAD_ARGS_4(a1, a2, a3, a4)		\
+  LOAD_ARGS_3 (a1, a2, a3)			\
+  int __arg4 = (int) (a4);
+#define LOAD_REGS_4				\
+  register int _d4 __asm__ ("d4") = __arg4;	\
+  LOAD_REGS_3
+#define ASM_ARGS_4	ASM_ARGS_3, "d" (_d4)
+#define LOAD_ARGS_5(a1, a2, a3, a4, a5)		\
+  LOAD_ARGS_4 (a1, a2, a3, a4)			\
+  int __arg5 = (int) (a5);
+#define LOAD_REGS_5				\
+  register int _d5 __asm__ ("d5") = __arg5;	\
+  LOAD_REGS_4
+#define ASM_ARGS_5	ASM_ARGS_4, "d" (_d5)
+#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6)	\
+  LOAD_ARGS_5 (a1, a2, a3, a4, a5)		\
+  int __arg6 = (int) (a6);
+#define LOAD_REGS_6				\
+  register int _a0 __asm__ ("a0") = __arg6;	\
+  LOAD_REGS_5
+#define ASM_ARGS_6	ASM_ARGS_5, "a" (_a0)
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..518fb39
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/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 */
+#if defined(__mc68000__)
+# define __UCLIBC_ABORT_INSTRUCTION__ ".long 0xffffffff"
+#else /* defined(__m68k__) */
+# define __UCLIBC_ABORT_INSTRUCTION__ "illegal"
+#endif
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#define __UCLIBC_BROKEN_CREATE_MODULE__
+
+/* does your target have to worry about older [gs]etrlimit() ? */
+#define __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/m68k/bits/uClibc_page.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/uClibc_page.h
new file mode 100644
index 0000000..51c6f14
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/uClibc_page.h
@@ -0,0 +1,41 @@
+/*  Copyright (C) 2004     Erik Andersen
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supply an architecture specific value for PAGE_SIZE and friends.  */
+
+#ifndef _UCLIBC_PAGE_H
+#define _UCLIBC_PAGE_H
+
+/*
+#include <linux/config.h>
+*/
+
+/* PAGE_SHIFT determines the page size */
+
+/*
+#ifndef CONFIG_SUN3
+*/
+#define PAGE_SHIFT	(12)
+/*
+#else
+#define PAGE_SHIFT	(13)
+#endif
+*/
+#define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#define PAGE_MASK	(~(PAGE_SIZE-1))
+
+#endif /* _UCLIBC_PAGE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/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/m68k/brk.c b/ap/build/uClibc/libc/sysdeps/linux/m68k/brk.c
new file mode 100644
index 0000000..40ebf4f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/brk.c
@@ -0,0 +1,37 @@
+/* consider this code LGPL - davidm */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <errno.h>
+
+
+/* This must be initialized data because commons can't have aliases.  */
+void * __curbrk = 0;
+
+int brk (void *addr)
+{
+    void *newbrk;
+
+	__asm__ __volatile__ ("movel %2,%/d1\n\t"
+			  "moveq %1,%/d0\n\t"
+			  "trap  #0\n\t"
+			  "movel %/d0,%0"
+		:"=g" (newbrk)
+		:"i" (__NR_brk),"g" (addr) : "%d0", "%d1");
+
+    __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/m68k/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/m68k/bsd-_setjmp.S
new file mode 100644
index 0000000..0380c3d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bsd-_setjmp.S
@@ -0,0 +1,24 @@
+
+/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
+/* This file is released under the LGPL, any version you like */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+.globl _setjmp;
+.type  _setjmp,@function
+.align 4;
+
+_setjmp:
+	moveal	%sp@(4), %a0
+	movel	%sp@(0), %a0@(JB_PC)
+	moveml	%d2-%d7/%a2-%a7, %a0@(JB_REGS)
+#if defined(__HAVE_68881__) || defined(__HAVE_FPU__)
+	fmovemx %fp2-%fp7, %a0@(JB_FPREGS)
+#endif
+	clrl	%d0
+	movl	%d0, JB_SIZE(%a0) /* No signal mask set.  */
+	rts
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/m68k/bsd-setjmp.S
new file mode 100644
index 0000000..fdd7540
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/bsd-setjmp.S
@@ -0,0 +1,23 @@
+
+/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
+/* This file is released under the LGPL, any version you like */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+#include "m68k_pic.S"
+
+.globl setjmp;
+.type  setjmp,@function
+.align 4;
+
+setjmp:
+	moveal	%sp@(4), %a0
+	movel	%sp@(0), %a0@(JB_PC)
+	moveml	%d2-%d7/%a2-%a7, %a0@(JB_REGS)
+#if defined(__HAVE_68881__) || defined(__HAVE_FPU__)
+	fmovemx %fp2-%fp7, %a0@(JB_FPREGS)
+#endif
+	clrl	%d0
+	JUMP	__sigjmp_save,%a0
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/clone.S b/ap/build/uClibc/libc/sysdeps/linux/m68k/clone.S
new file mode 100644
index 0000000..7eddff1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/clone.S
@@ -0,0 +1,69 @@
+/* Adapted from glibc */
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. */
+
+/* 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 "m68k_pic.S"
+
+/* int _clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
+
+.text
+.align 4
+.type	clone,@function
+.globl	clone;
+clone:
+	/* Sanity check arguments.  */
+	movel   #-EINVAL, %d0
+	movel   4(%sp), %d1             /* no NULL function pointers */
+	movel	%d1, %a0
+	tstl    %d1
+	beq.w	__syscall_error_trampoline
+	movel   8(%sp), %d1             /* no NULL stack pointers */
+	movel	%d1, %a1
+	tstl    %d1
+	beq.w   __syscall_error_trampoline
+
+	/* Allocate space and copy the argument onto the new stack.  */
+	movel   16(%sp), -(%a1)
+
+	/* Do the system call */
+#if 1 /* defined (CONFIG_COLDFIRE) */
+	movel   %d2, %d1                /* save %d2 and get stack pointer */
+	movel   %a1, %d2
+	movel   %d1, %a1
+#else
+	exg     %d2, %a1                /* save %d2 and get stack pointer */
+#endif
+	movel   12(%sp), %d1            /* get flags */
+	movel   #__NR_clone, %d0
+	trap    #0
+#if 1 /* defined (CONFIG_COLDFIRE) */
+	movel   %d2, %d1                /* restore %d2 */
+	movel   %a1, %d2
+	movel   %d1, %a1
+#else
+	exg     %d2, %a1                /* restore %d2 */
+#endif
+
+	tstl    %d0
+	bmi.w   __syscall_error_trampoline
+	beq.w   thread_start
+
+	rts
+
+thread_start:
+	/*subl    %fp, %fp*/        /* terminate the stack frame */
+	jsr     (%a0)
+	movel   %d0, -(%sp)
+	movel	#__NR_exit, %d0
+	trap	#0
+	/*jsr    exit*/
+
+__syscall_error_trampoline:
+	JUMP	__syscall_error,%a0
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/m68k/crt1.S
new file mode 100644
index 0000000..a9cf001
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/crt1.S
@@ -0,0 +1,152 @@
+/* Startup code compliant to the ELF m68k ABI.
+   Copyright (C) 1996, 1997, 1998, 2001, 2002 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 <features.h>
+#include "m68k_pic.S"
+
+#ifndef L_Scrt1
+/* This is the canonical entry point, usually the first thing in the text
+   segment.  The SVR4/m68k ABI says that when the entry point runs,
+   most registers' values are unspecified, except for:
+
+   %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
+
+   The uclinux conventions are different.  %a1 is not defined on entry
+   and the stack is laid out as follows:
+
+		0(%sp)			argc
+		4(%sp)			argv
+		8(%sp)			envp
+*/
+
+	.text
+	.type	_init,%function
+	.type	_fini,%function
+#ifndef __UCLIBC_CTOR_DTOR__
+	.weak	_init
+	.weak	_fini
+#endif
+	.globl _start
+	.type _start,@function
+_start:
+	/* Clear the frame pointer.  The ABI suggests this be done, to mark
+	   the outermost frame obviously.  */
+	sub.l %fp, %fp
+
+#if !defined __ARCH_USE_MMU__ && defined __PIC__
+	/* Set up the global pointer.  The GOT is at the beginning of the
+	   data segment, whose address is in %d5.  */
+	move.l %d5,%a5
+	.equ have_current_got, 1
+#endif
+	
+#ifdef __UCLIBC_FORMAT_SHARED_FLAT__
+	CALL __shared_flat_add_library,%a1
+#endif
+
+	/* Extract the arguments as encoded on the stack and set up the
+	   arguments for `main': argc, argv.  envp will be determined
+	   later in __libc_start_main.  */
+	move.l (%sp)+, %d0	/* Pop the argument count.  */
+#ifndef __ARCH_USE_MMU__
+	move.l (%sp)+, %a0
+#else
+	move.l %sp, %a0		/* The argument vector starts just at the
+				   current stack top.  */
+#endif
+
+	/* Provide the highest stack address to the user code (for stacks
+	   which grow downward).  */
+	pea (%sp)
+
+#ifndef __ARCH_USE_MMU__
+	clr.l -(%sp)
+#else
+	pea (%a1)		/* Push address of the shared library
+				   termination function.  */
+#endif
+
+	/* Push the address of our own entry points to `.fini' and
+	   `.init'.  */
+#if defined __UCLIBC_FORMAT_SHARED_FLAT__
+	PEA_TEXT __shared_flat_fini,%a1
+	PEA_TEXT __shared_flat_init,%a1
+#else
+	PEA_TEXT _fini,%a1
+	PEA_TEXT _init,%a1
+#endif
+
+	pea (%a0)		/* Push second argument: argv.  */
+	move.l %d0, -(%sp)	/* Push first argument: argc.  */
+
+	PEA_TEXT main,%a1
+
+	/* Call the user's main function, and exit with its value.  But
+	   let the libc call main.  */
+	CALL __uClibc_main,%a1
+
+	illegal			/* Crash if somehow `exit' does return.  */
+#else
+	.text
+	.globl lib_main
+	.hidden lib_main
+	.type lib_main,@function
+lib_main:
+	move.l %d5,%a5
+	JUMP __shared_flat_add_library,%a0
+
+	.hidden _current_shared_library_a5_offset_
+#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/m68k/crti.S b/ap/build/uClibc/libc/sysdeps/linux/m68k/crti.S
new file mode 100644
index 0000000..1b4b643
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/crti.S
@@ -0,0 +1,17 @@
+#include "m68k_pic.S"
+
+	.section .init
+	.align	2
+	.globl	_init
+	.type	_init, @function
+_init:
+	link.w	%a6,#0
+	INIT_GP
+	
+	.section .fini
+	.align	2
+	.globl	_fini
+	.type	_fini, @function
+_fini:
+	link.w	%a6,#0
+	INIT_GP
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/m68k/crtn.S
new file mode 100644
index 0000000..2a29b87
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/crtn.S
@@ -0,0 +1,11 @@
+#include "m68k_pic.S"
+
+	.section .init
+	FINI_GP
+	unlk	%a6
+	rts
+	
+	.section .fini
+	FINI_GP
+	unlk	%a6
+	rts
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/float.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/float.h
new file mode 100644
index 0000000..7dbe4e9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/float.h
@@ -0,0 +1,96 @@
+/* float.h for target with IEEE 32 bit and 64 bit floating point formats */
+#ifndef _FLOAT_H_
+#define _FLOAT_H_
+/* Produced by enquire version 4.3, CWI, Amsterdam */
+
+   /* Radix of exponent representation */
+#undef FLT_RADIX
+#define FLT_RADIX 2
+   /* Number of base-FLT_RADIX digits in the significand of a float */
+#undef FLT_MANT_DIG
+#define FLT_MANT_DIG 24
+   /* Number of decimal digits of precision in a float */
+#undef FLT_DIG
+#define FLT_DIG 6
+   /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */
+#undef FLT_ROUNDS
+#define FLT_ROUNDS 1
+   /* Difference between 1.0 and the minimum float greater than 1.0 */
+#undef FLT_EPSILON
+#define FLT_EPSILON 1.19209290e-07F
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
+#undef FLT_MIN_EXP
+#define FLT_MIN_EXP (-125)
+   /* Minimum normalised float */
+#undef FLT_MIN
+#define FLT_MIN 1.17549435e-38F
+   /* Minimum int x such that 10**x is a normalised float */
+#undef FLT_MIN_10_EXP
+#define FLT_MIN_10_EXP (-37)
+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
+#undef FLT_MAX_EXP
+#define FLT_MAX_EXP 128
+   /* Maximum float */
+#undef FLT_MAX
+#define FLT_MAX 3.40282347e+38F
+   /* Maximum int x such that 10**x is a representable float */
+#undef FLT_MAX_10_EXP
+#define FLT_MAX_10_EXP 38
+
+   /* Number of base-FLT_RADIX digits in the significand of a double */
+#undef DBL_MANT_DIG
+#define DBL_MANT_DIG 53
+   /* Number of decimal digits of precision in a double */
+#undef DBL_DIG
+#define DBL_DIG 15
+   /* Difference between 1.0 and the minimum double greater than 1.0 */
+#undef DBL_EPSILON
+#define DBL_EPSILON 2.2204460492503131e-16
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
+#undef DBL_MIN_EXP
+#define DBL_MIN_EXP (-1021)
+   /* Minimum normalised double */
+#undef DBL_MIN
+#define DBL_MIN 2.2250738585072014e-308
+   /* Minimum int x such that 10**x is a normalised double */
+#undef DBL_MIN_10_EXP
+#define DBL_MIN_10_EXP (-307)
+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
+#undef DBL_MAX_EXP
+#define DBL_MAX_EXP 1024
+   /* Maximum double */
+#undef DBL_MAX
+#define DBL_MAX 1.7976931348623157e+308
+   /* Maximum int x such that 10**x is a representable double */
+#undef DBL_MAX_10_EXP
+#define DBL_MAX_10_EXP 308
+
+   /* Number of base-FLT_RADIX digits in the significand of a long double */
+#undef LDBL_MANT_DIG
+#define LDBL_MANT_DIG 53
+   /* Number of decimal digits of precision in a long double */
+#undef LDBL_DIG
+#define LDBL_DIG 15
+   /* Difference between 1.0 and the minimum long double greater than 1.0 */
+#undef LDBL_EPSILON
+#define LDBL_EPSILON 2.2204460492503131e-16L
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
+#undef LDBL_MIN_EXP
+#define LDBL_MIN_EXP (-1021)
+   /* Minimum normalised long double */
+#undef LDBL_MIN
+#define LDBL_MIN 2.2250738585072014e-308L
+   /* Minimum int x such that 10**x is a normalised long double */
+#undef LDBL_MIN_10_EXP
+#define LDBL_MIN_10_EXP (-307)
+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */
+#undef LDBL_MAX_EXP
+#define LDBL_MAX_EXP 1024
+   /* Maximum long double */
+#undef LDBL_MAX
+#define LDBL_MAX 1.7976931348623157e+308L
+   /* Maximum int x such that 10**x is a representable long double */
+#undef LDBL_MAX_10_EXP
+#define LDBL_MAX_10_EXP 308
+
+#endif /*  _FLOAT_H_ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/fpu_control.h
new file mode 100644
index 0000000..040e62c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/fpu_control.h
@@ -0,0 +1,103 @@
+/* 68k FPU control word definitions.
+   Copyright (C) 1996, 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.  */
+
+#ifndef _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+/*
+ * Motorola floating point control register bits.
+ *
+ * 31-16  -> reserved (read as 0, ignored on write)
+ * 15     -> enable trap for BSUN exception
+ * 14     -> enable trap for SNAN exception
+ * 13     -> enable trap for OPERR exception
+ * 12     -> enable trap for OVFL exception
+ * 11     -> enable trap for UNFL exception
+ * 10     -> enable trap for DZ exception
+ *  9     -> enable trap for INEX2 exception
+ *  8     -> enable trap for INEX1 exception
+ *  7-6   -> Precision Control
+ *  5-4   -> Rounding Control
+ *  3-0   -> zero (read as 0, write as 0)
+ *
+ *
+ * Precision Control:
+ * 00 - round to extended precision
+ * 01 - round to single precision
+ * 10 - round to double precision
+ * 11 - undefined
+ *
+ * Rounding Control:
+ * 00 - rounding to nearest (RN)
+ * 01 - rounding toward zero (RZ)
+ * 10 - rounding (down)toward minus infinity (RM)
+ * 11 - rounding (up) toward plus infinity (RP)
+ *
+ * The hardware default is 0x0000. I choose 0x5400.
+ */
+
+#include <features.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_BSUN  0x8000
+#define _FPU_MASK_SNAN  0x4000
+#define _FPU_MASK_OPERR 0x2000
+#define _FPU_MASK_OVFL  0x1000
+#define _FPU_MASK_UNFL  0x0800
+#define _FPU_MASK_DZ    0x0400
+#define _FPU_MASK_INEX1 0x0200
+#define _FPU_MASK_INEX2 0x0100
+
+/* precision control */
+#define _FPU_EXTENDED 0x00   /* RECOMMENDED */
+#define _FPU_DOUBLE   0x80
+#define _FPU_SINGLE   0x40     /* DO NOT USE */
+
+/* rounding control */
+#define _FPU_RC_NEAREST 0x00    /* RECOMMENDED */
+#define _FPU_RC_ZERO    0x10
+#define _FPU_RC_DOWN    0x20
+#define _FPU_RC_UP      0x30
+
+#define _FPU_RESERVED 0xFFFF000F  /* Reserved bits in fpucr */
+
+
+/* Now two recommended fpucr */
+
+/* The fdlibm code requires no interrupts for exceptions.  Don't
+   change the rounding mode, it would break long double I/O!  */
+#define _FPU_DEFAULT  0x00000000
+
+/* IEEE:  same as above, but exceptions.  We must make it non-zero so
+   that __setfpucw works.  This bit will be ignored.  */
+#define _FPU_IEEE     0x00000001
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
+
+/* Macros for accessing the hardware control word.  */
+#define _FPU_GETCW(cw) __asm__ ("fmove%.l %!, %0" : "=dm" (cw))
+#define _FPU_SETCW(cw) __asm__ __volatile__ ("fmove%.l %0, %!" : : "dm" (cw))
+
+#if 0
+/* Default control word set at startup.  */
+extern fpu_control_t __fpu_control;
+#endif
+
+#endif /* _M68K_FPU_CONTROL_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/m68k_pic.S b/ap/build/uClibc/libc/sysdeps/linux/m68k/m68k_pic.S
new file mode 100644
index 0000000..d41509e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/m68k_pic.S
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2006 CodeSourcery Inc
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ *
+ * This file defines some m68k assembly macros for handling the differences
+ * between PIC and non-PIC.
+ */
+#include <features.h>
+
+	/* When assembling code for shared flat libraries, this is nonzero
+	 * if %a5 points the current library's GOT.  */
+	.equ	have_current_got, 0
+
+	/* Perform the equivalent of "<op> <target>", where <target> is
+	 * a text address.  <tmp> is available as a temporary address
+	 * register.  */
+	.macro	DO_TEXT op,target,tmp
+#if defined __UCLIBC_FORMAT_SHARED_FLAT__
+	.ifne	have_current_got
+	move.l \target@GOT(%a5),\tmp
+	.else
+	move.l _current_shared_library_a5_offset_(%a5),\tmp
+	move.l \target@GOT(\tmp),\tmp
+	.endif
+	\op (\tmp)
+#elif defined __PIC__
+	lea \target-.-8,\tmp
+	\op (%pc,\tmp)
+#else
+	\op \target
+#endif
+	.endm
+
+	/* Do "pea <target>" when <target> is a text address.
+	 * <tmp> is available as a temporary register.  */
+	.macro PEA_TEXT target,tmp
+	DO_TEXT pea,\target,\tmp
+	.endm
+
+	/* Likewise jsr.  */
+	.macro CALL target,tmp
+	DO_TEXT jsr,\target,\tmp
+	.endm
+
+	/* Likewise jmp.  */
+	.macro JUMP target,tmp
+	DO_TEXT jmp,\target,\tmp
+	.endm
+
+	/* Initialize the global pointer, if functions need to do that.  */
+	.macro INIT_GP
+#if defined __UCLIBC_FORMAT_SHARED_FLAT__
+	move.l	%a5,-(%sp)
+	move.l _current_shared_library_a5_offset_(%a5),%a5
+#endif
+	.endm
+
+	/* Undo the effects of INIT_GP.  */
+	.macro FINI_GP
+#if defined __UCLIBC_FORMAT_SHARED_FLAT__
+	move.l	(%sp)+,%a5
+#endif
+	.endm
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/m68k/setjmp.S
new file mode 100644
index 0000000..4adda0a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/setjmp.S
@@ -0,0 +1,23 @@
+
+/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
+/* This file is released under the LGPL, any version you like */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+#include "m68k_pic.S"
+
+.globl __sigsetjmp;
+.type  __sigsetjmp,@function
+.align 4;
+
+__sigsetjmp:
+	moveal	%sp@(4), %a0
+	movel	%sp@(0), %a0@(JB_PC)
+	moveml	%d2-%d7/%a2-%a7, %a0@(JB_REGS)
+#if defined(__HAVE_68881__) || defined(__HAVE_FPU__)
+	fmovemx %fp2-%fp7, %a0@(JB_FPREGS)
+#endif
+	clrl	%d0
+	JUMP	__sigjmp_save,%a0
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/sys/procfs.h
new file mode 100644
index 0000000..27abf8e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/sys/procfs.h
@@ -0,0 +1,126 @@
+/* Copyright (C) 1996, 1997, 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_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_struct' 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_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers.  */
+typedef struct user_m68kfp_struct 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/m68k/sys/reg.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/sys/reg.h
new file mode 100644
index 0000000..418f832
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/sys/reg.h
@@ -0,0 +1,89 @@
+/* Copyright (C) 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.  */
+
+#ifndef _SYS_REG_H
+#define _SYS_REG_H	1
+
+/* Index into an array of 4 byte integers returned from ptrace for
+   location of the users' stored general purpose registers. */
+
+enum
+{
+  PT_D1 = 0,
+#define PT_D1 PT_D1
+  PT_D2 = 1,
+#define PT_D2 PT_D2
+  PT_D3 = 2,
+#define PT_D3 PT_D3
+  PT_D4 = 3,
+#define PT_D4 PT_D4
+  PT_D5 = 4,
+#define PT_D5 PT_D5
+  PT_D6 = 5,
+#define PT_D6 PT_D6
+  PT_D7 = 6,
+#define PT_D7 PT_D7
+  PT_A0 = 7,
+#define PT_A0 PT_A0
+  PT_A1 = 8,
+#define PT_A1 PT_A1
+  PT_A2 = 9,
+#define PT_A2 PT_A2
+  PT_A3 = 10,
+#define PT_A3 PT_A3
+  PT_A4 = 11,
+#define PT_A4 PT_A4
+  PT_A5 = 12,
+#define PT_A5 PT_A5
+  PT_A6 = 13,
+#define PT_A6 PT_A6
+  PT_D0 = 14,
+#define PT_D0 PT_D0
+  PT_USP = 15,
+#define PT_USP PT_USP
+  PT_ORIG_D0 = 16,
+#define PT_ORIG_D0 PT_ORIG_D0
+  PT_SR = 17,
+#define PT_SR PT_SR
+  PT_PC = 18,
+#define PT_PC PT_PC
+  PT_FP0 = 21,
+#define PT_FP0 PT_FP0
+  PT_FP1 = 24,
+#define PT_FP1 PT_FP1
+  PT_FP2 = 27,
+#define PT_FP2 PT_FP2
+  PT_FP3 = 30,
+#define PT_FP3 PT_FP3
+  PT_FP4 = 33,
+#define PT_FP4 PT_FP4
+  PT_FP5 = 36,
+#define PT_FP5 PT_FP5
+  PT_FP6 = 39,
+#define PT_FP6 PT_FP6
+  PT_FP7 = 42,
+#define PT_FP7 PT_FP7
+  PT_FPCR = 45,
+#define PT_FPCR PT_FPCR
+  PT_FPSR = 46,
+#define PT_FPSR PT_FPSR
+  PT_FPIAR = 47
+#define PT_FPIAR PT_FPIAR
+};
+
+#endif	/* _SYS_REG_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/sys/ucontext.h
new file mode 100644
index 0000000..3c441dc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/sys/ucontext.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 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.  */
+
+/* System V/m68k ABI compliant context switching support.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* Type for general register.  */
+typedef int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	18
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+/* Number of each register is the `gregset_t' array.  */
+enum
+{
+  R_D0 = 0,
+#define R_D0	R_D0
+  R_D1 = 1,
+#define R_D1	R_D1
+  R_D2 = 2,
+#define R_D2	R_D2
+  R_D3 = 3,
+#define R_D3	R_D3
+  R_D4 = 4,
+#define R_D4	R_D4
+  R_D5 = 5,
+#define R_D5	R_D5
+  R_D6 = 6,
+#define R_D6	R_D6
+  R_D7 = 7,
+#define R_D7	R_D7
+  R_A0 = 8,
+#define R_A0	R_A0
+  R_A1 = 9,
+#define R_A1	R_A1
+  R_A2 = 10,
+#define R_A2	R_A2
+  R_A3 = 11,
+#define R_A3	R_A3
+  R_A4 = 12,
+#define R_A4	R_A4
+  R_A5 = 13,
+#define R_A5	R_A5
+  R_A6 = 14,
+#define R_A6	R_A6
+  R_A7 = 15,
+#define R_A7	R_A7
+  R_SP = 15,
+#define R_SP	R_SP
+  R_PC = 16,
+#define R_PC	R_PC
+  R_PS = 17
+#define R_PS	R_PS
+};
+
+/* Structure to describe FPU registers.  */
+typedef struct fpregset
+{
+  int f_fpregs[8][3];
+  int f_pcr;
+  int f_psr;
+  int f_fpiaddr;
+} fpregset_t;
+
+/* Context to describe whole processor state.  */
+typedef struct
+{
+  int version;
+  gregset_t gregs;
+  fpregset_t fpregs;
+} mcontext_t;
+
+#define MCONTEXT_VERSION 2
+
+/* Userlevel context.  */
+typedef struct ucontext
+{
+  unsigned long int uc_flags;
+  struct ucontext *uc_link;
+  __sigset_t uc_sigmask;
+  stack_t uc_stack;
+  mcontext_t uc_mcontext;
+  long int uc_filler[174];
+} ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/m68k/sys/user.h
new file mode 100644
index 0000000..8114a2b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/sys/user.h
@@ -0,0 +1,90 @@
+#ifndef _M68K_USER_H
+#define _M68K_USER_H
+/*
+   This file was taken verbatim from linux-2.6.26.5.
+   The linux kernel is Copyright (C) Linus Torvalds et al.
+   and is licensed under the GNU General Public License, version 2.
+*/
+/* Core file format: The core file is written in such a way that gdb
+   can understand it and provide useful information to the user (under
+   linux we use the 'trad-core' bfd).  There are quite a number of
+   obstacles to being able to view the contents of the floating point
+   registers, and until these are solved you will not be able to view the
+   contents of them.  Actually, you can read in the core file and look at
+   the contents of the user struct to find out what the floating point
+   registers contain.
+   The actual file contents are as follows:
+   UPAGE: 1 page consisting of a user struct that tells gdb what is present
+   in the file.  Directly after this is a copy of the task_struct, which
+   is currently not used by gdb, but it may come in useful at some point.
+   All of the registers are stored as part of the upage.  The upage should
+   always be only one page.
+   DATA: The data area is stored.  We use current->end_text to
+   current->brk to pick up all of the user variables, plus any memory
+   that may have been malloced.  No attempt is made to determine if a page
+   is demand-zero or if a page is totally unused, we just cover the entire
+   range.  All of the addresses are rounded in such a way that an integral
+   number of pages is written.
+   STACK: We need the stack information in order to get a meaningful
+   backtrace.  We need to write the data from (esp) to
+   current->start_stack, so we round each of these off in order to be able
+   to write an integer number of pages.
+   The minimum core file size is 3 pages, or 12288 bytes.
+*/
+
+struct user_m68kfp_struct {
+	unsigned long  fpregs[8*3];	/* fp0-fp7 registers */
+	unsigned long  fpcntl[3];	/* fp control regs */
+};
+
+/* This is the old layout of "struct pt_regs" as of Linux 1.x, and
+   is still the layout used by user (the new pt_regs doesn't have
+   all registers). */
+struct user_regs_struct {
+	long d1,d2,d3,d4,d5,d6,d7;
+	long a0,a1,a2,a3,a4,a5,a6;
+	long d0;
+	long usp;
+	long orig_d0;
+	short stkadj;
+	short sr;
+	long pc;
+	short fmtvec;
+	short __fill;
+};
+
+
+/* When the kernel dumps core, it starts by dumping the user struct -
+   this will be used by gdb to figure out where the data and stack segments
+   are within the file, and what virtual addresses to use. */
+struct user{
+/* We start with the registers, to mimic the way that "memory" is returned
+   from the ptrace(3,...) function.  */
+  struct user_regs_struct regs;	/* Where the registers are actually stored */
+/* ptrace does not yet supply these.  Someday.... */
+  int u_fpvalid;		/* True if math co-processor being used. */
+                                /* for this mess. Not yet used. */
+  struct user_m68kfp_struct m68kfp; /* Math Co-processor registers. */
+/* The rest of this junk is to help gdb figure out what goes where */
+  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 area.
+				   This is actually the bottom of the stack,
+				   the top of the stack is always found in the
+				   esp register.  */
+  long int signal;		/* Signal that caused the core dump. */
+  int reserved;			/* No longer used */
+  unsigned long u_ar0;		/* Used by gdb to help find the values for */
+				/* the registers. */
+  struct user_m68kfp_struct* u_fpstate;	/* Math Co-processor pointer. */
+  unsigned long magic;		/* To uniquely identify a core file */
+  char u_comm[32];		/* User command that was responsible */
+};
+#define NBPG 4096
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/m68k/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/m68k/vfork.S
new file mode 100644
index 0000000..56d57f7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/m68k/vfork.S
@@ -0,0 +1,45 @@
+/*
+ * 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 <asm/unistd.h>
+
+#ifndef __NR_vfork
+#define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
+#endif
+
+#define IMM #
+
+	.text
+	.align 2
+	.globl errno
+	.globl	__vfork
+	.hidden	__vfork
+	.type	__vfork,@function
+
+__vfork:
+	movl	%sp@+, %a1               /* save the return address for later */
+	movl	IMM __NR_vfork,%d0
+	trap	#0
+	movl	IMM -4097, %d1
+	cmpl 	%d0, %d1
+	bcs     fix_errno
+	jmp		%a1@                     /* don't return,  just jmp directly */
+fix_errno:
+	negl	%d0
+#ifndef __PIC__					/* needs handling as the other archs */
+	movl	errno, %a0
+#else
+	movl	errno@GOT(%a5), %a0
+#endif
+	movl	%d0, %a0@
+	movl	IMM -1, %d0
+	jmp		%a1@                     /* don't return,  just jmp directly */
+
+.size __vfork,.-__vfork
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/Makefile b/ap/build/uClibc/libc/sysdeps/linux/microblaze/Makefile
new file mode 100644
index 0000000..338abc0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/Makefile
@@ -0,0 +1,25 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org>
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Library General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+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/microblaze/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/microblaze/Makefile.arch
new file mode 100644
index 0000000..c80c650
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/Makefile.arch
@@ -0,0 +1,12 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2001,2002  NEC Corporation
+# Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+CSRC := mmap.c clone.c fixdfsi.c
+
+SSRC := setjmp.S __longjmp.S vfork.S
+
+ARCH_HEADERS := floatlib.h
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/microblaze/__longjmp.S
new file mode 100644
index 0000000..c4423be
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/__longjmp.S
@@ -0,0 +1,49 @@
+/*
+ * libc/sysdeps/linux/microblaze/longjmp.S -- `longjmp' for microblaze
+ *
+ *  Copyright (C) 2003  John Williams <jwilliams@itee.uq.edu.au>
+ *  Copyright (C) 2001  NEC Corporation
+ *  Copyright (C) 2001  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+#include <libc-symbols.h>
+
+	.text
+	.globl C_SYMBOL_NAME(__longjmp)
+	.align 4
+C_SYMBOL_NAME(__longjmp):
+	/* load registers from memory to r5 (arg0) */
+	lwi	r1, r5, 0
+	lwi	r15, r5, 4
+	lwi	r2,  r5, 8
+	lwi	r13, r5, 12
+	lwi	r18, r5, 16
+	lwi	r19, r5, 20
+	lwi	r20, r5, 24
+	lwi	r21, r5, 28
+	lwi	r22, r5, 32
+	lwi	r23, r5, 36
+	lwi	r24, r5, 40
+	lwi	r25, r5, 44
+	lwi	r26, r5, 48
+	lwi	r27, r5, 52
+	lwi	r28, r5, 56
+	lwi	r29, r5, 60
+	lwi	r30, r5, 64
+	lwi	r31, r5, 68
+
+	addi	r3, r0, 1		/* return val */
+	rtsd	r15, 8			/* normal return */
+	nop
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/endian.h
new file mode 100644
index 0000000..56fcd5d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/endian.h
@@ -0,0 +1,27 @@
+/*
+ * libc/sysdeps/linux/microblaze/bits/endian.h -- Define processor endianess
+ *
+ *  Copyright (C) 2003  John Williams <jwilliams@itee.uq.edu.au>
+ *  Copyright (C) 2001  NEC Corporation
+ *  Copyright (C) 2001  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ * Microblaze port by John Williams
+ */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+/* Note: Toolchain supplies _BIG_ENDIAN or _LITTLE_ENDIAN */
+#if defined(_BIG_ENDIAN)
+# define __BYTE_ORDER __BIG_ENDIAN
+#elif defined(_LITTLE_ENDIAN)
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#else
+# error "Endianness is unknown"
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/fcntl.h
new file mode 100644
index 0000000..44e8f3f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/fcntl.h
@@ -0,0 +1,240 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   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.  */
+
+#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	 0200000	/* Must be a directory.	 */
+# define O_NOFOLLOW	0400000	/* Do not follow links.	 */
+# define O_DIRECT	040000	/* 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	0100000
+#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_XOPEN2K
+# 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.  */
+# define F_SETPIPE_SZ	1031	/* Set of pipe page size array */
+# define F_GETPIPE_SZ	1032	/* Get of pipe page size array */
+#endif
+
+/* For F_[GET|SET]FL.  */
+#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/microblaze/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_stat.h
new file mode 100644
index 0000000..c269509
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_stat.h
@@ -0,0 +1,48 @@
+/* Stat structure for linux/microblaze*/
+
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+struct kernel_stat
+{
+	unsigned long	st_dev;		/* Device.  */
+	unsigned long	st_ino;		/* File serial number.  */
+	unsigned int	st_mode;	/* File mode.  */
+	unsigned int	st_nlink;	/* Link count.  */
+	unsigned int	st_uid;		/* User ID of the file's owner.  */
+	unsigned int	st_gid;		/* Group ID of the file's group. */
+	unsigned long	st_rdev;	/* Device number, if device.  */
+	unsigned long	__pad1;
+	long		st_size;	/* Size of file, in bytes.  */
+	int		st_blksize;	/* Optimal block size for I/O.  */
+	int		__pad2;
+	long		st_blocks;	/* Number 512-byte blocks allocated. */
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned int	__unused4;
+	unsigned int	__unused5;
+};
+
+struct kernel_stat64
+{
+	unsigned long long st_dev;	/* Device.  */
+	unsigned long long st_ino;	/* File serial number.  */
+	unsigned int	st_mode;	/* File mode.  */
+	unsigned int	st_nlink;	/* Link count.  */
+	unsigned int	st_uid;		/* User ID of the file's owner.  */
+	unsigned int	st_gid;		/* Group ID of the file's group. */
+	unsigned long long st_rdev;	/* Device number, if device.  */
+	unsigned long long __pad1;
+	long long	st_size;	/* Size of file, in bytes.  */
+	int		st_blksize;	/* Optimal block size for I/O.  */
+	int		__pad2;
+	long long	st_blocks;	/* Number 512-byte blocks allocated. */
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned int	__unused4;
+	unsigned int	__unused5;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_types.h
new file mode 100644
index 0000000..a9f736b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_types.h
@@ -0,0 +1,62 @@
+/*
+ * sysdeps/linux/microblaze/bits/kernel_types.h -- Kernel versions of standard types
+ *
+ *  Copyright (C) 2003       John Williams <jwilliams@itee.uq.edu.au>
+ *  Copyright (C) 2001,2002  NEC Corporation
+ *  Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ * Microblaze port by John Williams
+ */
+
+#ifndef _ASM_MICROBLAZE_POSIX_TYPES_H
+#define _ASM_MICROBLAZE_POSIX_TYPES_H
+
+typedef unsigned long	__kernel_dev_t;
+typedef unsigned long	__kernel_ino_t;
+//typedef unsigned long long __kernel_ino64_t;
+typedef unsigned short	__kernel_mode_t;
+typedef unsigned long	__kernel_nlink_t;
+typedef long		__kernel_off_t;
+typedef int		__kernel_pid_t;
+typedef int		__kernel_ipc_pid_t;
+typedef unsigned int	__kernel_uid_t;
+typedef unsigned int	__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_timer_t;
+typedef int		__kernel_clockid_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 int	__kernel_old_uid_t;
+typedef unsigned int	__kernel_old_gid_t;
+typedef unsigned int	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+
+#ifdef __GNUC__
+typedef long long	__kernel_loff_t;
+#endif
+
+typedef struct {
+#ifdef __USE_ALL
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* _ASM_MICROBLAZE_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/poll.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/poll.h
new file mode 100644
index 0000000..78ee877
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/poll.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1997, 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_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for.  These bits may be set in `events'
+   to indicate the interesting event types; they will appear in `revents'
+   to indicate the status of the file descriptor.  */
+#define POLLIN		0x001		/* There is data to read.  */
+#define POLLPRI		0x002		/* There is urgent data to read.  */
+#define POLLOUT		0x004		/* Writing now will not block.  */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2.  */
+# define POLLRDNORM	0x0040		/* Normal data may be read.  */
+# define POLLRDBAND	0x0080		/* Priority data may be read.  */
+# define POLLWRNORM	0x0100		/* Writing now will not block.  */
+# define POLLWRBAND	0x0200		/* Priority data may be written.  */
+#endif
+
+/* Event types always implicitly polled for.  These bits need not be set in
+   `events', but they will appear in `revents' to indicate the status of
+   the file descriptor.  */
+#define POLLERR		0x008		/* Error condition.  */
+#define POLLHUP		0x010		/* Hung up.  */
+#define POLLNVAL	0x020		/* Invalid polling request.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/setjmp.h
new file mode 100644
index 0000000..0c0573c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/setjmp.h
@@ -0,0 +1,47 @@
+/*
+ * libc/sysdeps/linux/microblaze/bits/setjmp.h -- microblaze version of `jmp_buf' type
+ *
+ *  Copyright (C) 2003  John Williams <jwilliams@itee.uq.edu.au>
+ *  Copyright (C) 2001  NEC Corporation
+ *  Copyright (C) 2001  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#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
+typedef struct
+  {
+    /* Stack pointer.  */
+    void *__sp;
+
+    /* Link pointer.  */
+    void *__lp;
+
+    /* SDA pointers */
+    void *__SDA;
+    void *__SDA2;
+
+    /* Callee-saved registers r18-r31.  */
+    int __regs[14];
+  } __jmp_buf[1];
+#endif
+
+#define JB_SIZE		(4 * 18)
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[0].__sp)
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/stackinfo.h
new file mode 100644
index 0000000..819e819
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On microblaze the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/syscalls.h
new file mode 100644
index 0000000..535502b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/syscalls.h
@@ -0,0 +1,58 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\
+(__extension__ \
+	({								\
+		register int __ret __asm__("r3");			\
+		register int _scno __asm__("r12") = name;		\
+		LOAD_ARGS_##nr (args);					\
+		__asm__ __volatile__("brki	r14, 0x8"		\
+			      : "=r" (__ret)				\
+			      :  "r"(_scno) ASM_ARGS_##nr		\
+			      : __SYSCALL_CLOBBERS );			\
+		__ret;							\
+	}) \
+)
+#define INTERNAL_SYSCALL_ERROR_P(val, err)		\
+	((unsigned int)(val) >= 0xfffff001U)
+
+#define LOAD_ARGS_0() do { } while(0)
+#define ASM_ARGS_0
+#define LOAD_ARGS_1(a1)				\
+	register int _a1 __asm__("r5") = (int)(a1);	\
+	LOAD_ARGS_0()
+#define ASM_ARGS_1	ASM_ARGS_0, "r"(_a1)
+#define LOAD_ARGS_2(a1, a2)				\
+	register int _a2 __asm__("r6") = (int)(a2);	\
+	LOAD_ARGS_1(a1)
+#define ASM_ARGS_2	ASM_ARGS_1, "r"(_a2)
+#define LOAD_ARGS_3(a1, a2, a3)				\
+	register int _a3 __asm__("r7") = (int)(a3);	\
+	LOAD_ARGS_2(a1, a2)
+#define ASM_ARGS_3	ASM_ARGS_2, "r"(_a3)
+#define LOAD_ARGS_4(a1, a2, a3, a4)			\
+	register int _a4 __asm__("r8") = (int)(a4);	\
+	LOAD_ARGS_3(a1, a2, a3)
+#define ASM_ARGS_4	ASM_ARGS_3, "r"(_a4)
+#define LOAD_ARGS_5(a1, a2, a3, a4, a5)			\
+	register int _a5 __asm__("r9") = (int)(a5);	\
+	LOAD_ARGS_4(a1, a2, a3, a4)
+#define ASM_ARGS_5	ASM_ARGS_4, "r"(_a5)
+#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6)		\
+	register int _a6 __asm__("r10") = (int)(a6);	\
+	LOAD_ARGS_5(a1, a2, a3, a4, a5)
+#define ASM_ARGS_6	ASM_ARGS_5, "r"(_a6)
+
+#define __SYSCALL_CLOBBERS "r4", "r14", "cc", "memory"
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..86d0008
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/uClibc_arch_features.h
@@ -0,0 +1,48 @@
+/*
+ * 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__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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 ? */
+#undef __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/microblaze/bits/uClibc_page.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/uClibc_page.h
new file mode 100644
index 0000000..41b0422
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/uClibc_page.h
@@ -0,0 +1,43 @@
+/*  Copyright (C) 2004     Erik Andersen
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supply an architecture specific value for PAGE_SIZE and friends.  */
+
+#ifndef _UCLIBC_PAGE_H
+#define _UCLIBC_PAGE_H
+
+#include <linux/autoconf.h>
+
+#if   defined(CONFIG_MICROBLAZE_32K_PAGES)
+#define PAGE_SHIFT		15
+#elif defined(CONFIG_MICROBLAZE_16K_PAGES)
+#define PAGE_SHIFT		14
+#elif defined(CONFIG_MICROBLAZE_8K_PAGES)
+#define PAGE_SHIFT		13
+#elif defined(CONFIG_MICROBLAZE_4K_PAGES)
+#define PAGE_SHIFT		12
+#else
+#if !defined(CONFIG_MMU)
+#warning Missing CONFIG_MICROBLAZE_nnK_PAGES, assuming 4K
+#endif
+#define PAGE_SHIFT		12
+#endif
+
+#define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#define PAGE_MASK	(~(PAGE_SIZE-1))
+
+#endif /* _UCLIBC_PAGE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/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/microblaze/clone.c b/ap/build/uClibc/libc/sysdeps/linux/microblaze/clone.c
new file mode 100644
index 0000000..d921008
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/clone.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2004 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License.  See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#include <sched.h>
+#include <errno.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, ...)
+{
+	int rval = -EINVAL;
+	if (fn && child_stack)
+		rval = INTERNAL_SYSCALL(clone, 0, 2, flags, child_stack);
+
+	if (rval == 0)
+	{
+		int exitCode = fn(arg);
+		rval = INTERNAL_SYSCALL(exit, 0, 1, exitCode);
+	}
+
+	return rval;
+}
+
+#ifdef __NR_clone2
+int
+__clone2(int (*fn)(void *arg), void *child_stack, size_t stack_size,
+	 int flags, void *arg, ...)
+{
+	int rval = -EINVAL;
+	if (fn && child_stack)
+	{
+		rval = INTERNAL_SYSCALL(clone2, 0, 3, flags, child_stack, stack_size);
+	}
+
+	if (rval == 0)
+	{
+		int exitCode = fn(arg);
+		rval = INTERNAL_SYSCALL(exit, 0, 1, exitCode);
+	}
+
+	return rval;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/crt0.S b/ap/build/uClibc/libc/sysdeps/linux/microblaze/crt0.S
new file mode 100644
index 0000000..6be1e4d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/crt0.S
@@ -0,0 +1,52 @@
+/*
+ * libc/sysdeps/linux/microblaze/crt0.S -- Initial program entry point for linux/microblaze
+ *
+ *  Copyright (C) 2003       John Williams <jwilliams@itee.uq.edu.au>
+ *  Copyright (C) 2001,2002  NEC Corporation
+ *  Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <clinkage.h>
+
+/* Upon entry, the stack contains the following data:
+	argc, argv[0], ..., argv[argc-1], 0, envp[0], ..., 0
+*/
+
+	.text
+C_ENTRY(_start):
+	lw	r5, r0, r1	/* Arg 0: argc */
+
+	addi	r6, r1, 4	/* Arg 1: argv */
+
+				/* Arg 2: envp */
+	addi	r3, r5, 1	/* skip argc elements to get envp start */
+				/* ...plus the NULL at the end of argv */
+	add	r3, r3, r3	/* Make word offset */
+	add	r3, r3, r3
+	add	r7, r6, r3	/* add to argv to get offset */
+
+	/* tail-call uclibc's startup routine */
+	brid	C_SYMBOL_NAME(__uClibc_main)
+	nop
+
+
+/* Stick in a dummy reference to `main', so that if an application
+   is linking when the `main' function is in a static library (.a)
+   we can be sure that `main' actually gets linked in.  */
+L_dummy_main_reference:
+	.long	C_SYMBOL_NAME(main)
+
+/* 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/microblaze/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/microblaze/crt1.S
new file mode 100644
index 0000000..7bf8f64
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/crt1.S
@@ -0,0 +1,57 @@
+/*
+ * libc/sysdeps/linux/microblaze/crt1.S -- Initial program entry point for linux/microblaze
+ *
+ *  Copyright (C) 2009       Meyer Sound Laboratories
+ *  Copyright (C) 2003       John Williams <jwilliams@itee.uq.edu.au>
+ *  Copyright (C) 2001,2002  NEC Corporation
+ *  Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <libc-symbols.h>
+
+/* Upon entry, the stack contains the following data:
+	argc, argv[0], ..., argv[argc-1], 0, envp[0], ..., 0
+*/
+
+	.text
+	.globl C_SYMBOL_NAME(_start)
+	.align 4
+C_SYMBOL_NAME(_start):
+
+	/*
+	Preparing arguments for uClibc's startup routine.
+	The routine has 6 arguments, so 5 of them are placed
+	into registers, one on the stack
+	*/
+
+	la      r5, r0, C_SYMBOL_NAME(main) /* Arg 1: main() */
+	lw	r6, r0, r1		    /* Arg 2: argc   */
+	addi	r7, r1, 4		    /* Arg 3: argv   */
+	la	r8, r0, _init               /* Arg 4: init   */
+	la	r9, r0, _fini               /* Arg 5: fini   */
+	addk	r10,r0,r0                   /* Arg 6: rtld_fini = NULL */
+
+
+	/* Reserve space for __uClibc_main to save parameters
+	   (Microblaze ABI stack calling convention)
+	   and for stack_end argument to __uClibc_main  */
+	add 	r3, r1, r0
+	addi    r1, r1, -32
+
+	/* tail-call uClibc's startup routine */
+	brid	C_SYMBOL_NAME(__uClibc_main)
+	swi 	r3, r1, 28	/* Arg 7: stack end [DELAY SLOT] */
+
+/* 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/microblaze/crti.S b/ap/build/uClibc/libc/sysdeps/linux/microblaze/crti.S
new file mode 100644
index 0000000..e003968
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/crti.S
@@ -0,0 +1,41 @@
+/*
+ * libc/sysdeps/linux/microblaze/crti.S -- init/fini entry code for microblaze
+ *                                         (baselined with gcc 4.1.2)
+ *
+ *  Copyright (C) 2010       Digital Design Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ */
+
+#define END_INIT
+#define END_FINI
+#define ALIGN
+#include <libc-symbols.h>
+
+/*@HEADER_ENDS*/
+
+	.section .init
+	.align	2
+	.globl	_init
+_init:
+	addik	r1, r1, -32
+	swi	r19, r1, 28
+	addk	r19, r1, r0
+	swi	r15, r1, 0
+
+	ALIGN
+	END_INIT
+
+	.section .fini
+	.align	2
+	.globl	_fini
+_fini:
+	addik	r1, r1, -32
+	swi	r19, r1, 28
+	addk	r19, r1, r0
+	swi	r15, r1, 0
+
+	ALIGN
+	END_FINI
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/microblaze/crtn.S
new file mode 100644
index 0000000..6f4ef60
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/crtn.S
@@ -0,0 +1,43 @@
+/*
+ * libc/sysdeps/linux/microblaze/crtn.S -- init/fini exit code for microblaze
+ *                                         (baselined with gcc 4.1.2)
+ *
+ *  Copyright (C) 2010       Digital Design Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ */
+
+#define END_INIT
+#define END_FINI
+#define ALIGN
+#include <libc-symbols.h>
+
+	.section .init
+	.align	2
+	.globl	_init
+	.ent	_init
+
+	lwi	r15, r1, 0
+	lwi	r19, r1, 28
+	rtsd	r15, 8
+	addik	r1, r1, 32	# Delay slot
+
+	.end	_init
+$Lfe2:
+
+	.section .fini
+	.align	2
+	.globl	_fini
+	.ent	_fini
+
+	lwi	r15, r1, 0
+	lwi	r19, r1, 28
+	rtsd	r15, 8
+	addik	r1, r1, 32	# Delay slot
+
+	.end	_fini
+$Lfe3:
+
+/*@TRAILER_BEGINS*/
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/fixdfsi.c b/ap/build/uClibc/libc/sysdeps/linux/microblaze/fixdfsi.c
new file mode 100644
index 0000000..1611176
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/fixdfsi.c
@@ -0,0 +1,85 @@
+/*
+** libgcc support for software floating point.
+** Copyright (C) 1991 by Pipeline Associates, Inc.  All rights reserved.
+** Permission is granted to do *anything* you want with this file,
+** commercial or otherwise, provided this message remains intact.  So there!
+** I would appreciate receiving any updates/patches/changes that anyone
+** makes, and am willing to be the repository for said changes (am I
+** making a big mistake?).
+
+Warning! Only single-precision is actually implemented.  This file
+won't really be much use until double-precision is supported.
+
+However, once that is done, this file might eventually become a
+replacement for libgcc1.c.  It might also make possible
+cross-compilation for an IEEE target machine from a non-IEEE
+host such as a VAX.
+
+If you'd like to work on completing this, please talk to rms@gnu.ai.mit.edu.
+
+--> Double precision floating support added by James Carlson on 20 April 1998.
+
+**
+** Pat Wood
+** Pipeline Associates, Inc.
+** pipeline!phw@motown.com or
+** sun!pipeline!phw or
+** uunet!motown!pipeline!phw
+**
+** 05/01/91 -- V1.0 -- first release to gcc mailing lists
+** 05/04/91 -- V1.1 -- added float and double prototypes and return values
+**                  -- fixed problems with adding and subtracting zero
+**                  -- fixed rounding in truncdfsf2
+**                  -- fixed SWAP define and tested on 386
+*/
+
+/*
+** The following are routines that replace the libgcc soft floating point
+** routines that are called automatically when -msoft-float is selected.
+** The support single and double precision IEEE format, with provisions
+** for byte-swapped machines (tested on 386).  Some of the double-precision
+** routines work at full precision, but most of the hard ones simply punt
+** and call the single precision routines, producing a loss of accuracy.
+** long long support is not assumed or included.
+** Overall accuracy is close to IEEE (actually 68882) for single-precision
+** arithmetic.  I think there may still be a 1 in 1000 chance of a bit
+** being rounded the wrong way during a multiply.  I'm not fussy enough to
+** bother with it, but if anyone is, knock yourself out.
+**
+** Efficiency has only been addressed where it was obvious that something
+** would make a big difference.  Anyone who wants to do this right for
+** best speed should go in and rewrite in assembler.
+**
+** I have tested this only on a 68030 workstation and 386/ix integrated
+** in with -msoft-float.
+*/
+
+#include "floatlib.h"
+
+/* convert double to int */
+long
+__fixdfsi (double a1)
+{
+  register union double_long dl1;
+  register int exp;
+  register long l;
+
+  dl1.d = a1;
+
+  if (!dl1.l.upper && !dl1.l.lower)
+    return (0);
+
+  exp = EXPD (dl1) - EXCESSD - 31;
+  l = MANTD (dl1);
+
+  if (exp > 0)
+      return SIGND(dl1) ? (1<<31) : ((1ul<<31)-1);
+
+  /* shift down until exp = 0 or l = 0 */
+  if (exp < 0 && exp > -32 && l)
+    l >>= -exp;
+  else
+    return (0);
+
+  return (SIGND (dl1) ? -l : l);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/floatlib.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/floatlib.h
new file mode 100644
index 0000000..817ba7d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/floatlib.h
@@ -0,0 +1,140 @@
+/*
+** libgcc support for software floating point.
+** Copyright (C) 1991 by Pipeline Associates, Inc.  All rights reserved.
+** Permission is granted to do *anything* you want with this file,
+** commercial or otherwise, provided this message remains intact.  So there!
+** I would appreciate receiving any updates/patches/changes that anyone
+** makes, and am willing to be the repository for said changes (am I
+** making a big mistake?).
+
+Warning! Only single-precision is actually implemented.  This file
+won't really be much use until double-precision is supported.
+
+However, once that is done, this file might eventually become a
+replacement for libgcc1.c.  It might also make possible
+cross-compilation for an IEEE target machine from a non-IEEE
+host such as a VAX.
+
+If you'd like to work on completing this, please talk to rms@gnu.ai.mit.edu.
+
+--> Double precision floating support added by James Carlson on 20 April 1998.
+
+**
+** Pat Wood
+** Pipeline Associates, Inc.
+** pipeline!phw@motown.com or
+** sun!pipeline!phw or
+** uunet!motown!pipeline!phw
+**
+** 05/01/91 -- V1.0 -- first release to gcc mailing lists
+** 05/04/91 -- V1.1 -- added float and double prototypes and return values
+**                  -- fixed problems with adding and subtracting zero
+**                  -- fixed rounding in truncdfsf2
+**                  -- fixed SWAP define and tested on 386
+*/
+
+/*
+** The following are routines that replace the libgcc soft floating point
+** routines that are called automatically when -msoft-float is selected.
+** The support single and double precision IEEE format, with provisions
+** for byte-swapped machines (tested on 386).  Some of the double-precision
+** routines work at full precision, but most of the hard ones simply punt
+** and call the single precision routines, producing a loss of accuracy.
+** long long support is not assumed or included.
+** Overall accuracy is close to IEEE (actually 68882) for single-precision
+** arithmetic.  I think there may still be a 1 in 1000 chance of a bit
+** being rounded the wrong way during a multiply.  I'm not fussy enough to
+** bother with it, but if anyone is, knock yourself out.
+**
+** Efficiency has only been addressed where it was obvious that something
+** would make a big difference.  Anyone who wants to do this right for
+** best speed should go in and rewrite in assembler.
+**
+** I have tested this only on a 68030 workstation and 386/ix integrated
+** in with -msoft-float.
+*/
+
+#ifndef __FLOAT_LIB_H__
+#define __FLOAT_LIB_H__
+/* the following deal with IEEE single-precision numbers */
+#define EXCESS		126
+#define SIGNBIT		0x80000000
+#define HIDDEN		(1 << 23)
+#define SIGN(fp)	((fp) & SIGNBIT)
+#define EXP(fp)		(((fp) >> 23) & 0xFF)
+#define MANT(fp)	(((fp) & 0x7FFFFF) | HIDDEN)
+#define PACK(s,e,m)	((s) | ((e) << 23) | (m))
+
+/* the following deal with IEEE double-precision numbers */
+#define EXCESSD		1022
+#define HIDDEND		(1 << 20)
+#define EXPD(fp)	(((fp.l.upper) >> 20) & 0x7FF)
+#define SIGND(fp)	((fp.l.upper) & SIGNBIT)
+#define MANTD(fp)	(((((fp.l.upper) & 0xFFFFF) | HIDDEND) << 10) | \
+				(fp.l.lower >> 22))
+#define HIDDEND_LL	((long long)1 << 52)
+#define MANTD_LL(fp)	((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
+#define PACKD_LL(s,e,m)	(((long long)((s)+((e)<<20))<<32)|(m))
+
+/* define SWAP for 386/960 reverse-byte-order brain-damaged CPUs */
+union double_long {
+    double d;
+#ifdef SWAP
+    struct {
+      unsigned long lower;
+      long upper;
+    } l;
+#else
+    struct {
+      long upper;
+      unsigned long lower;
+    } l;
+#endif
+    long long ll;
+};
+
+union float_long
+  {
+    float f;
+    long l;
+  };
+
+#endif
+
+/* Functions defined in different files */
+
+float __addsf3 (float, float);
+float __subsf3 (float, float);
+long __cmpsf2 (float, float);
+float __mulsf3 (float, float);
+float __divsf3 (float, float);
+double __floatsidf (register long);
+double __floatdidf (register long long);
+float __floatsisf (register long );
+float __floatdisf (register long long );
+float __negsf2 (float);
+double __negdf2 (double);
+double __extendsfdf2 (float);
+float __truncdfsf2 (double);
+long __cmpdf2 (double, double);
+long __fixsfsi (float);
+long __fixdfsi (double);
+long long __fixdfdi (double);
+unsigned long __fixunsdfsi (double);
+unsigned long long __fixunsdfdi (double);
+double __adddf3 (double, double);
+double __subdf3 (double, double);
+double __muldf3 (double, double);
+double __divdf3 (double, double);
+int __gtdf2 (double, double);
+int __gedf2 (double, double);
+int __ltdf2 (double, double);
+int __ledf2 (double, double);
+int __eqdf2 (double, double);
+int __nedf2 (double, double);
+int __gtsf2 (float, float);
+int __gesf2 (float, float);
+int __ltsf2 (float, float);
+int __lesf2 (float, float);
+int __eqsf2 (float, float);
+int __nesf2 (float, float);
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/microblaze/mmap.c
new file mode 100644
index 0000000..41cf6f4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/mmap.c
@@ -0,0 +1,16 @@
+/* Use new style mmap for microblaze */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <errno.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+
+_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
+	   int, flags, int, fd, __off_t, offset)
+libc_hidden_def(mmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/microblaze/setjmp.S
new file mode 100644
index 0000000..d01c745
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/setjmp.S
@@ -0,0 +1,86 @@
+/*
+ * libc/sysdeps/linux/microblaze/setjmp.S -- `setjmp' for microblaze
+ *
+ *  Copyright (C) 2003       John Williams <jwilliams@itee.uq.edu.au>
+ *  Copyright (C) 2001,2002  NEC Corporation
+ *  Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ *
+ * PIC code based on glibc 2.3.6 */
+
+/*
+   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 _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+#include <libc-symbols.h>
+
+	.text
+	.globl C_SYMBOL_NAME(setjmp)
+	.align 4
+C_SYMBOL_NAME(setjmp):
+#ifdef __PIC__
+	brid	1f
+#else
+	braid	C_SYMBOL_NAME(__sigsetjmp)
+#endif
+	addi	r6, r0, 1			/* Save the signal mask.  */
+
+	.globl C_SYMBOL_NAME(_setjmp)
+C_SYMBOL_NAME(_setjmp):
+	and	r6, r0, r0			/* Don't save the signal mask.  */
+
+	.globl C_SYMBOL_NAME(__sigsetjmp)
+C_SYMBOL_NAME(__sigsetjmp):
+1:
+	/* Save registers relative to r5 (arg0)*/
+	swi	r1, r5, 0			/* stack pointer */
+	swi	r15, r5, 4			/* link register */
+	swi	r2,  r5, 8			/* SDA and SDA2 ptrs */
+	swi	r13, r5, 12
+	swi	r18, r5, 16			/* assembler temp */
+	swi	r19, r5, 20			/* now call-preserved regs */
+	swi	r20, r5, 24
+	swi	r21, r5, 28
+	swi	r22, r5, 32
+	swi	r23, r5, 36
+	swi	r24, r5, 40
+	swi	r25, r5, 44
+	swi	r26, r5, 48
+	swi	r27, r5, 52
+	swi	r28, r5, 56
+	swi	r29, r5, 60
+	swi	r30, r5, 64
+	swi	r31, r5, 68
+
+	/* Make a tail call to __sigjmp_save; it takes the same args.  */
+#ifdef __PIC__
+	mfs   r12,rpc
+	addik r12,r12,_GLOBAL_OFFSET_TABLE_+8
+	lwi   r12,r12,__sigjmp_save@GOT
+	brad  r12
+	nop
+#else
+	braid	C_SYMBOL_NAME(__sigjmp_save)
+	nop
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/procfs.h
new file mode 100644
index 0000000..8fb87ef
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/procfs.h
@@ -0,0 +1,145 @@
+/* Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002 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>
+
+
+/* Type for a general-purpose register.  */
+#ifndef ELF_GREG_T
+#define ELF_GREG_T
+typedef unsigned long elf_greg_t;
+#endif
+
+/* This is exactly the same as `struct pt_regs' in the kernel.  */
+struct elf_gregset
+{
+	elf_greg_t gpr[32];	/* General purpose registers.  */
+
+	elf_greg_t pc;		/* program counter */
+	elf_greg_t psw;		/* program status word */
+	elf_greg_t ear;		/* Exception address register */
+	elf_greg_t esr;		/* Excep[tion Status Register */
+	elf_greg_t fsr;		/* FPU Status register */
+
+	elf_greg_t kernel_mode;	/* 1 if in `kernel mode', 0 if user mode */
+	elf_greg_t single_step;	/* 1 if in single step mode */
+};
+
+#ifndef ELF_NGREG
+#define ELF_NGREG (sizeof (struct elf_gregset) / sizeof(elf_greg_t))
+#endif
+
+#ifndef ELF_GREGSET_T
+#define ELF_GREGSET_T
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+#endif
+
+/* Register set for the floating-point registers.  */
+#ifndef ELF_FPREGSET_T
+#define ELF_FPREGSET_T
+typedef elf_greg_t elf_fpregset_t;
+#endif
+
+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.
+ * Fields present but not used are marked with "XXX".
+ */
+struct elf_prstatus
+{
+	struct elf_siginfo pr_info;	/* Info associated with signal */
+	short	pr_cursig;		/* Current signal */
+	unsigned long pr_sigpend;	/* Set of pending signals */
+	unsigned long pr_sighold;	/* Set of held signals */
+	__kernel_pid_t	pr_pid;
+	__kernel_pid_t	pr_ppid;
+	__kernel_pid_t	pr_pgrp;
+	__kernel_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 co-processor 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 pr_flag;	/* flags */
+	__kernel_uid_t	pr_uid;
+	__kernel_gid_t	pr_gid;
+	__kernel_pid_t	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 __kernel_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;
+
+
+#endif	/* sys/procfs.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/ptrace.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/ptrace.h
new file mode 100644
index 0000000..26d153c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/ptrace.h
@@ -0,0 +1,98 @@
+/* `ptrace' debugger support interface.  Linux/microblaze version.
+   Copyright (C) 2001, 2002 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_PTRACE_H
+#define _SYS_PTRACE_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.'  */
+enum __ptrace_request
+{
+  /* Indicate that the process making this request should be traced.
+     All signals received by this process can be intercepted by its
+     parent, and its parent can use the other `ptrace' requests.  */
+  PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+  /* Return the word in the process's text space at address ADDR.  */
+  PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+  /* Return the word in the process's data space at address ADDR.  */
+  PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+  /* Return the word in the process's user area at offset ADDR.  */
+  PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+  /* Write the word DATA into the process's text space at address ADDR.  */
+  PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+  /* Write the word DATA into the process's data space at address ADDR.  */
+  PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+  /* Write the word DATA into the process's user area at offset ADDR.  */
+  PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+  /* Continue the process.  */
+  PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+  /* Kill the process.  */
+  PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+  /* Single step the process.  */
+  PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+  /* Attach to a process that is already running. */
+  PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+  /* Detach from a process attached to with PTRACE_ATTACH.  */
+  PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+  /* Continue and stop at the next (return from) syscall.  */
+  PTRACE_SYSCALL = 24
+#define PT_SYSCALL PTRACE_SYSCALL
+};
+
+/* Perform process tracing functions.  REQUEST is one of the values
+   above, and determines the action to be taken.
+   For all requests except PTRACE_TRACEME, PID specifies the process to be
+   traced.
+
+   PID and the other arguments described above for the various requests should
+   appear (those that are used for the particular request) as:
+     pid_t PID, void *ADDR, int DATA, void *ADDR2
+   after REQUEST.  */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/ucontext.h
new file mode 100644
index 0000000..07f0933
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/ucontext.h
@@ -0,0 +1,41 @@
+/* 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 _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+typedef struct sigcontext mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/user.h
new file mode 100644
index 0000000..987a694
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/sys/user.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 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 _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
+{
+  long int cwd;
+  long int swd;
+  long int twd;
+  long int fip;
+  long int fcs;
+  long int foo;
+  long int fos;
+  long int st_space [20];
+};
+
+struct user_regs_struct
+{
+  unsigned int gpr[32];
+  unsigned int pc;
+  unsigned int msr;
+  unsigned int ear;
+  unsigned int esr;
+  unsigned int fsr;
+  unsigned int btr;
+  unsigned int pvr[12];
+};
+
+struct user
+{
+  struct user_regs_struct	regs;
+  int				u_fpvalid;
+  struct user_fpregs_struct	i387;
+  unsigned long int		u_tsize;
+  unsigned long int		u_dsize;
+  unsigned long int		u_ssize;
+  unsigned long			start_code;
+  unsigned long			start_stack;
+  long int			signal;
+  int				reserved;
+  struct user_regs_struct*	u_ar0;
+  struct user_fpregs_struct*	u_fpstate;
+  unsigned long int		magic;
+  char				u_comm [32];
+  int				u_debugreg [8];
+};
+
+#define PAGE_SHIFT		12
+#define PAGE_SIZE		(1UL << PAGE_SHIFT)
+#define PAGE_MASK		(~(PAGE_SIZE-1))
+#define NBPG			PAGE_SIZE
+#define UPAGES			1
+#define HOST_TEXT_START_ADDR	(u.start_code)
+#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
+
+#endif	/* _SYS_USER_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/microblaze/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/microblaze/vfork.S
new file mode 100644
index 0000000..57db5e5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/microblaze/vfork.S
@@ -0,0 +1,53 @@
+/*
+ * libc/sysdeps/linux/microblaze/vfork.S -- `vfork' syscall for linux/microblaze
+ *
+ * Copyright (C) 2003  John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2001  NEC Corporation
+ * Copyright (C) 2001  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ * Microblaze port by John Williams
+ */
+
+#define _ERRNO_H	1
+#include <bits/errno.h>
+#define _SYSCALL_H
+#include <bits/sysnum.h>
+
+#include <libc-symbols.h>
+
+/* Clone the calling process, but without copying the whole address space.
+   The calling process is suspended until the new process exits or is
+   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
+   and the process ID of the new process to the old process.  */
+
+.global C_SYMBOL_NAME(errno)
+
+	.globl __vfork
+	.align 4
+__vfork:
+	addi	r12, r0, SYS_vfork
+	brki	r14, 0x08;
+	addi	r4, r3, 125		/* minimum err value */
+	blti	r4, 1f			/* is r3 < -125? */
+	bri	2f			/* normal return */
+1:	sub 	r3, r3, r0		/* r3 = -r3 */
+#ifdef __PIC__
+	mfs	r3,rpc
+	addik	r3,r3,_GLOBAL_OFFSET_TABLE_+8
+	lwi	r3,r3,C_SYMBOL_NAME(errno)@GOT
+	sw	r3, r0, r3
+#else
+	swi	r3, r0, C_SYMBOL_NAME(errno);
+#endif
+					/* state restore etc */
+2:	rtsd	r15, 8			/* error return */
+	nop
+       .size   __vfork, .-__vfork
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/Makefile b/ap/build/uClibc/libc/sysdeps/linux/mips/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/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/mips/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/mips/Makefile.arch
new file mode 100644
index 0000000..738cdd0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/Makefile.arch
@@ -0,0 +1,26 @@
+# 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 := \
+	__longjmp.c  brk.c setjmp_aux.c mmap.c \
+	cacheflush.c pread_write.c sigaction.c sysmips.c _test_and_set.c \
+	readahead.c
+
+SSRC := bsd-_setjmp.S bsd-setjmp.S setjmp.S syscall.S pipe.S syscall_error.S
+
+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),y)
+CSRC += posix_fadvise.c posix_fadvise64.c
+endif
+
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+SSRC += vfork.S clone.S
+endif
+
+ASFLAGS-syscall_error.S += -D_LIBC_REENTRANT
+
+ARCH_HEADERS := sgidefs.h
+# regdef.h
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/__longjmp.c b/ap/build/uClibc/libc/sysdeps/linux/mips/__longjmp.c
new file mode 100644
index 0000000..9dc09f2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/__longjmp.c
@@ -0,0 +1,128 @@
+/* Copyright (C) 1992, 1995, 1997, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Brendan Kehoe (brendan@zen.org).
+
+   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 <setjmp.h>
+#include <stdlib.h>
+#include <sgidefs.h>
+
+#ifndef	__GNUC__
+  #error This file uses GNU C extensions; you must compile with GCC.
+#endif
+
+extern void __longjmp (__jmp_buf __env, int __val) attribute_noreturn;
+libc_hidden_proto(__longjmp)
+
+void __longjmp (__jmp_buf env, int val_arg)
+{
+    /* gcc 1.39.19 miscompiled the longjmp routine (as it did setjmp before
+       the hack around it); force it to use $a1 for the longjmp value.
+       Without this it saves $a1 in a register which gets clobbered
+       along the way.  */
+    register int val __asm__ ("a1");
+
+    /* Pull back the floating point callee-saved registers.  */
+#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+    __asm__ __volatile__ ("l.d $f24, %0" : : "m" (env[0].__fpregs[0]));
+    __asm__ __volatile__ ("l.d $f25, %0" : : "m" (env[0].__fpregs[1]));
+    __asm__ __volatile__ ("l.d $f26, %0" : : "m" (env[0].__fpregs[2]));
+    __asm__ __volatile__ ("l.d $f27, %0" : : "m" (env[0].__fpregs[3]));
+    __asm__ __volatile__ ("l.d $f28, %0" : : "m" (env[0].__fpregs[4]));
+    __asm__ __volatile__ ("l.d $f29, %0" : : "m" (env[0].__fpregs[5]));
+    __asm__ __volatile__ ("l.d $f30, %0" : : "m" (env[0].__fpregs[6]));
+    __asm__ __volatile__ ("l.d $f31, %0" : : "m" (env[0].__fpregs[7]));
+#else /* O32 || N32 */
+    __asm__ __volatile__ ("l.d $f20, %0" : : "m" (env[0].__fpregs[0]));
+    __asm__ __volatile__ ("l.d $f22, %0" : : "m" (env[0].__fpregs[1]));
+    __asm__ __volatile__ ("l.d $f24, %0" : : "m" (env[0].__fpregs[2]));
+    __asm__ __volatile__ ("l.d $f26, %0" : : "m" (env[0].__fpregs[3]));
+    __asm__ __volatile__ ("l.d $f28, %0" : : "m" (env[0].__fpregs[4]));
+    __asm__ __volatile__ ("l.d $f30, %0" : : "m" (env[0].__fpregs[5]));
+#endif /* O32 || N32 */
+
+    /* Get and reconstruct the floating point csr.  */
+    __asm__ __volatile__ ("lw $2, %0" : : "m" (env[0].__fpc_csr));
+    __asm__ __volatile__ ("ctc1 $2, $31");
+#endif
+
+    /* Get the GP. */
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+    __asm__ __volatile__ ("ld $gp, %0" : : "m" (env[0].__gp));
+#else /* O32 || N32 */
+    __asm__ __volatile__ ("lw $gp, %0" : : "m" (env[0].__gp));
+#endif /* O32 || N32 */
+
+    /* Get the callee-saved registers.  */
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+    __asm__ __volatile__ ("lw $16, %0" : : "m" (env[0].__regs[0]));
+    __asm__ __volatile__ ("lw $17, %0" : : "m" (env[0].__regs[1]));
+    __asm__ __volatile__ ("lw $18, %0" : : "m" (env[0].__regs[2]));
+    __asm__ __volatile__ ("lw $19, %0" : : "m" (env[0].__regs[3]));
+    __asm__ __volatile__ ("lw $20, %0" : : "m" (env[0].__regs[4]));
+    __asm__ __volatile__ ("lw $21, %0" : : "m" (env[0].__regs[5]));
+    __asm__ __volatile__ ("lw $22, %0" : : "m" (env[0].__regs[6]));
+    __asm__ __volatile__ ("lw $23, %0" : : "m" (env[0].__regs[7]));
+#else /* N32 || N64 */
+    __asm__ __volatile__ ("ld $16, %0" : : "m" (env[0].__regs[0]));
+    __asm__ __volatile__ ("ld $17, %0" : : "m" (env[0].__regs[1]));
+    __asm__ __volatile__ ("ld $18, %0" : : "m" (env[0].__regs[2]));
+    __asm__ __volatile__ ("ld $19, %0" : : "m" (env[0].__regs[3]));
+    __asm__ __volatile__ ("ld $20, %0" : : "m" (env[0].__regs[4]));
+    __asm__ __volatile__ ("ld $21, %0" : : "m" (env[0].__regs[5]));
+    __asm__ __volatile__ ("ld $22, %0" : : "m" (env[0].__regs[6]));
+    __asm__ __volatile__ ("ld $23, %0" : : "m" (env[0].__regs[7]));
+#endif /* N32 || N64 */
+
+    /* Get the PC.  */
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+    __asm__ __volatile__ ("lw $25, %0" : : "m" (env[0].__pc));
+#elif _MIPS_SIM == _MIPS_SIM_NABI32
+    __asm__ __volatile__ ("lw $31, %0" : : "m" (env[0].__pc));
+#else /* N64 */
+    __asm__ __volatile__ ("ld $31, %0" : : "m" (env[0].__pc));
+#endif /* N64 */
+
+    /* Restore the stack pointer and the FP.  They have to be restored
+       last and in a single asm as gcc, depending on options used, may
+       use either of them to access env.  */
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+    __asm__ __volatile__ ("ld $29, %0\n\t"
+	    "ld $30, %1\n\t" : : "m" (env[0].__sp), "m" (env[0].__fp));
+#else /* O32 || N32 */
+    __asm__ __volatile__ ("lw $29, %0\n\t"
+	    "lw $30, %1\n\t" : : "m" (env[0].__sp), "m" (env[0].__fp));
+#endif /* O32 || N32 */
+
+    /* Give setjmp 1 if given a 0, or what they gave us if non-zero.  */
+    if (val == 0)
+	__asm__ __volatile__ ("li $2, 1");
+    else
+	__asm__ __volatile__ ("move $2, %0" : : "r" (val));
+
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+    __asm__ __volatile__ ("jr $25");
+#else /* N32 || N64 */
+    __asm__ __volatile__ ("jr $31");
+#endif /* N32 || N64 */
+
+    /* Avoid `volatile function does return' warnings.  */
+    for (;;);
+}
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/__syscall_error.c b/ap/build/uClibc/libc/sysdeps/linux/mips/__syscall_error.c
new file mode 100644
index 0000000..5e109a8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/__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/mips/_test_and_set.c b/ap/build/uClibc/libc/sysdeps/linux/mips/_test_and_set.c
new file mode 100644
index 0000000..9fd48f7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/_test_and_set.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000.
+
+   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 real-function versions of all inline functions
+   defined in sys/tas.h  */
+
+#include <features.h>
+
+#define _EXTERN_INLINE
+#ifndef __USE_EXTERN_INLINES
+# define __USE_EXTERN_INLINES 1
+#endif
+
+#include "sys/tas.h"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/atomic.h
new file mode 100644
index 0000000..3fab829
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/atomic.h
@@ -0,0 +1,329 @@
+/* Low-level functions for atomic operations. Mips version.
+   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.  */
+
+#ifndef _MIPS_BITS_ATOMIC_H
+#define _MIPS_BITS_ATOMIC_H 1
+
+#include <inttypes.h>
+#include <sgidefs.h>
+
+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 int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+typedef int_fast64_t atomic_fast64_t;
+typedef uint_fast64_t uatomic_fast64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+#if _MIPS_SIM == _ABIO32
+#define MIPS_PUSH_MIPS2 ".set	mips2\n\t"
+#else
+#define MIPS_PUSH_MIPS2
+#endif
+
+/* See the comments in <sys/asm.h> about the use of the sync instruction.  */
+#ifndef MIPS_SYNC
+# define MIPS_SYNC	sync
+#endif
+
+/* Certain revisions of the R10000 Processor need an LL/SC Workaround
+   enabled.  Revisions before 3.0 misbehave on atomic operations, and
+   Revs 2.6 and lower deadlock after several seconds due to other errata.
+
+   To quote the R10K Errata:
+      Workaround: The basic idea is to inhibit the four instructions
+      from simultaneously becoming active in R10000. Padding all
+      ll/sc sequences with nops or changing the looping branch in the
+      routines to a branch likely (which is always predicted taken
+      by R10000) will work. The nops should go after the loop, and the
+      number of them should be 28. This number could be decremented for
+      each additional instruction in the ll/sc loop such as the lock
+      modifier(s) between the ll and sc, the looping branch and its
+      delay slot. For typical short routines with one ll/sc loop, any
+      instructions after the loop could also count as a decrement. The
+      nop workaround pollutes the cache more but would be a few cycles
+      faster if all the code is in the cache and the looping branch
+      is predicted not taken.  */
+
+
+#ifdef _MIPS_ARCH_R10000
+#define R10K_BEQZ_INSN "beqzl"
+#else
+#define R10K_BEQZ_INSN "beqz"
+#endif
+
+#define MIPS_SYNC_STR_2(X) #X
+#define MIPS_SYNC_STR_1(X) MIPS_SYNC_STR_2(X)
+#define MIPS_SYNC_STR MIPS_SYNC_STR_1(MIPS_SYNC)
+
+/* Compare and exchange.  For all of the "xxx" routines, we expect a
+   "__prev" and a "__cmp" variable to be provided by the enclosing scope,
+   in which values are returned.  */
+
+#define __arch_compare_and_exchange_xxx_8_int(mem, newval, oldval, rel, acq) \
+  (abort (), __prev = __cmp = 0)
+
+#define __arch_compare_and_exchange_xxx_16_int(mem, newval, oldval, rel, acq) \
+  (abort (), __prev = __cmp = 0)
+
+#define __arch_compare_and_exchange_xxx_32_int(mem, newval, oldval, rel, acq) \
+     __asm__ __volatile__ (						      \
+     ".set	push\n\t"						      \
+     MIPS_PUSH_MIPS2							      \
+     rel	"\n"							      \
+     "1:\t"								      \
+     "ll	%0,%5\n\t"						      \
+     "move	%1,$0\n\t"						      \
+     "bne	%0,%3,2f\n\t"						      \
+     "move	%1,%4\n\t"						      \
+     "sc	%1,%2\n\t"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
+     acq	"\n\t"							      \
+     ".set	pop\n"							      \
+     "2:\n\t"								      \
+	      : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem)		      \
+	      : "r" (oldval), "r" (newval), "m" (*mem)			      \
+	      : "memory")
+
+#if _MIPS_SIM == _ABIO32
+/* We can't do an atomic 64-bit operation in O32.  */
+#define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \
+  (abort (), __prev = __cmp = 0)
+#else
+#define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \
+     __asm__ __volatile__ ("\n"						      \
+     ".set	push\n\t"						      \
+     MIPS_PUSH_MIPS2							      \
+     rel	"\n"							      \
+     "1:\t"								      \
+     "lld	%0,%5\n\t"						      \
+     "move	%1,$0\n\t"						      \
+     "bne	%0,%3,2f\n\t"						      \
+     "move	%1,%4\n\t"						      \
+     "scd	%1,%2\n\t"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
+     acq	"\n\t"							      \
+     ".set	pop\n"							      \
+     "2:\n\t"								      \
+	      : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem)		      \
+	      : "r" (oldval), "r" (newval), "m" (*mem)			      \
+	      : "memory")
+#endif
+
+/* For all "bool" routines, we return FALSE if exchange succesful.  */
+
+#define __arch_compare_and_exchange_bool_8_int(mem, new, old, rel, acq)	\
+({ __typeof (*mem) __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq);	\
+   !__cmp; })
+
+#define __arch_compare_and_exchange_bool_16_int(mem, new, old, rel, acq) \
+({ __typeof (*mem) __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq);	\
+   !__cmp; })
+
+#define __arch_compare_and_exchange_bool_32_int(mem, new, old, rel, acq) \
+({ __typeof (*mem) __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq);	\
+   !__cmp; })
+
+#define __arch_compare_and_exchange_bool_64_int(mem, new, old, rel, acq) \
+({ __typeof (*mem) __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq);	\
+   !__cmp; })
+
+/* For all "val" routines, return the old value whether exchange
+   successful or not.  */
+
+#define __arch_compare_and_exchange_val_8_int(mem, new, old, rel, acq)	\
+({ __typeof (*mem) __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq);	\
+   (__typeof (*mem))__prev; })
+
+#define __arch_compare_and_exchange_val_16_int(mem, new, old, rel, acq) \
+({ __typeof (*mem) __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq);	\
+   (__typeof (*mem))__prev; })
+
+#define __arch_compare_and_exchange_val_32_int(mem, new, old, rel, acq) \
+({ __typeof (*mem) __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq);	\
+   (__typeof (*mem))__prev; })
+
+#define __arch_compare_and_exchange_val_64_int(mem, new, old, rel, acq) \
+({ __typeof (*mem) __prev; int __cmp;					\
+   __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq);	\
+   (__typeof (*mem))__prev; })
+
+/* Compare and exchange with "acquire" semantics, ie barrier after.  */
+
+#define atomic_compare_and_exchange_bool_acq(mem, new, old)	\
+  __atomic_bool_bysize (__arch_compare_and_exchange_bool, int,	\
+		        mem, new, old, "", MIPS_SYNC_STR)
+
+#define atomic_compare_and_exchange_val_acq(mem, new, old)	\
+  __atomic_val_bysize (__arch_compare_and_exchange_val, int,	\
+		       mem, new, old, "", MIPS_SYNC_STR)
+
+/* Compare and exchange with "release" semantics, ie barrier before.  */
+
+#define atomic_compare_and_exchange_bool_rel(mem, new, old)	\
+  __atomic_bool_bysize (__arch_compare_and_exchange_bool, int,	\
+		        mem, new, old, MIPS_SYNC_STR, "")
+
+#define atomic_compare_and_exchange_val_rel(mem, new, old)	\
+  __atomic_val_bysize (__arch_compare_and_exchange_val, int,	\
+		       mem, new, old, MIPS_SYNC_STR, "")
+
+
+
+/* Atomic exchange (without compare).  */
+
+#define __arch_exchange_xxx_8_int(mem, newval, rel, acq) \
+  (abort (), 0)
+
+#define __arch_exchange_xxx_16_int(mem, newval, rel, acq) \
+  (abort (), 0)
+
+#define __arch_exchange_xxx_32_int(mem, newval, rel, acq) \
+({ __typeof (*mem) __prev; int __cmp;					      \
+     __asm__ __volatile__ ("\n"						      \
+     ".set	push\n\t"						      \
+     MIPS_PUSH_MIPS2							      \
+     rel	"\n"							      \
+     "1:\t"								      \
+     "ll	%0,%4\n\t"						      \
+     "move	%1,%3\n\t"						      \
+     "sc	%1,%2\n\t"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
+     acq	"\n\t"							      \
+     ".set	pop\n"							      \
+     "2:\n\t"								      \
+	      : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem)		      \
+	      : "r" (newval), "m" (*mem)				      \
+	      : "memory");						      \
+  __prev; })
+
+#if _MIPS_SIM == _ABIO32
+/* We can't do an atomic 64-bit operation in O32.  */
+#define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \
+  (abort (), 0)
+#else
+#define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \
+({ __typeof (*mem) __prev; int __cmp;					      \
+     __asm__ __volatile__ ("\n"						      \
+     ".set	push\n\t"						      \
+     MIPS_PUSH_MIPS2							      \
+     rel	"\n"							      \
+     "1:\n"								      \
+     "lld	%0,%4\n\t"						      \
+     "move	%1,%3\n\t"						      \
+     "scd	%1,%2\n\t"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
+     acq	"\n\t"							      \
+     ".set	pop\n"							      \
+     "2:\n\t"								      \
+	      : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem)		      \
+	      : "r" (newval), "m" (*mem)				      \
+	      : "memory");						      \
+  __prev; })
+#endif
+
+#define atomic_exchange_acq(mem, value) \
+  __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, "", MIPS_SYNC_STR)
+
+#define atomic_exchange_rel(mem, value) \
+  __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, MIPS_SYNC_STR, "")
+
+
+/* Atomically add value and return the previous (unincremented) value.  */
+
+#define __arch_exchange_and_add_8_int(mem, newval, rel, acq) \
+  (abort (), (__typeof(*mem)) 0)
+
+#define __arch_exchange_and_add_16_int(mem, newval, rel, acq) \
+  (abort (), (__typeof(*mem)) 0)
+
+#define __arch_exchange_and_add_32_int(mem, value, rel, acq) \
+({ __typeof (*mem) __prev; int __cmp;					      \
+     __asm__ __volatile__ ("\n"						      \
+     ".set	push\n\t"						      \
+     MIPS_PUSH_MIPS2							      \
+     rel	"\n"							      \
+     "1:\t"								      \
+     "ll	%0,%4\n\t"						      \
+     "addu	%1,%0,%3\n\t"						      \
+     "sc	%1,%2\n\t"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
+     acq	"\n\t"							      \
+     ".set	pop\n"							      \
+     "2:\n\t"								      \
+	      : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem)		      \
+	      : "r" (value), "m" (*mem)					      \
+	      : "memory");						      \
+  __prev; })
+
+#if _MIPS_SIM == _ABIO32
+/* We can't do an atomic 64-bit operation in O32.  */
+#define __arch_exchange_and_add_64_int(mem, value, rel, acq) \
+  (abort (), (__typeof(*mem)) 0)
+#else
+#define __arch_exchange_and_add_64_int(mem, value, rel, acq) \
+({ __typeof (*mem) __prev; int __cmp;					      \
+     __asm__ __volatile__ (						      \
+     ".set	push\n\t"						      \
+     MIPS_PUSH_MIPS2							      \
+     rel	"\n"							      \
+     "1:\t"								      \
+     "lld	%0,%4\n\t"						      \
+     "daddu	%1,%0,%3\n\t"						      \
+     "scd	%1,%2\n\t"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
+     acq	"\n\t"							      \
+     ".set	pop\n"							      \
+     "2:\n\t"								      \
+	      : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem)		      \
+	      : "r" (value), "m" (*mem)					      \
+	      : "memory");						      \
+  __prev; })
+#endif
+
+/* ??? Barrier semantics for atomic_exchange_and_add appear to be
+   undefined.  Use full barrier for now, as that's safe.  */
+#define atomic_exchange_and_add(mem, value) \
+  __atomic_val_bysize (__arch_exchange_and_add, int, mem, value,	      \
+		       MIPS_SYNC_STR, MIPS_SYNC_STR)
+
+/* TODO: More atomic operations could be implemented efficiently; only the
+   basic requirements are done.  */
+
+#define atomic_full_barrier() \
+  __asm__ __volatile__ (".set push\n\t"					      \
+			MIPS_PUSH_MIPS2					      \
+			MIPS_SYNC_STR "\n\t"				      \
+			".set pop" : : : "memory")
+
+#endif /* bits/atomic.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/dirent.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/dirent.h
new file mode 100644
index 0000000..014e011
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/dirent.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 1996, 1997 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 _DIRENT_H
+# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
+#endif
+#include <errno.h>
+#include <sys/syscall.h>
+
+struct dirent
+  {
+#if defined(__USE_FILE_OFFSET64) && defined(__NR_getdents64)
+    __ino64_t d_ino;
+    __off64_t d_off;
+#else
+    __ino_t d_ino;
+    __off_t d_off;
+#endif
+    unsigned short int d_reclen;
+    unsigned char d_type;
+    char d_name[256];		/* We must not include limits.h! */
+  };
+
+#ifdef __USE_LARGEFILE64
+struct dirent64
+  {
+#ifdef __NR_getdents64
+    __ino64_t d_ino;
+    __off64_t d_off;
+#else
+    /* dirent64 is the same as dirent.  */
+    __ino_t d_ino;
+    __off_t d_off;
+#endif
+    unsigned short int d_reclen;
+    unsigned char d_type;
+    char d_name[256];		/* We must not include limits.h! */
+  };
+#endif
+
+#define d_fileno	d_ino	/* Backwards compatibility.  */
+
+#undef  _DIRENT_HAVE_D_NAMLEN
+#define _DIRENT_HAVE_D_RECLEN
+#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/dlfcn.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/dlfcn.h
new file mode 100644
index 0000000..3d81693
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/dlfcn.h
@@ -0,0 +1,68 @@
+/* System dependent definitions for run-time dynamic loading.
+   Copyright (C) 1996, 1997, 1999, 2000, 2001, 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 _DLFCN_H
+# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
+#endif
+
+/* The MODE argument to `dlopen' contains one of the following: */
+#define RTLD_LAZY	0x0001	/* Lazy function call binding.  */
+#define RTLD_NOW	0x0002	/* Immediate function call binding.  */
+#define RTLD_BINDING_MASK  0x3	/* Mask of binding time value.  */
+#define RTLD_NOLOAD	0x00008	/* Do not load the object.  */
+#if 0 /* uClibc doesnt support these */
+#define RTLD_DEEPBIND	0x00010	/* Use deep binding.  */
+#endif
+
+/* If the following bit is set in the MODE argument to `dlopen',
+   the symbols of the loaded object and its dependencies are made
+   visible as if the object were linked directly into the program.  */
+#define RTLD_GLOBAL	0x0004
+
+/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
+   The implementation does this by default and so we can define the
+   value to zero.  */
+#define RTLD_LOCAL      0
+
+/* Do not delete object when closed.  */
+#define RTLD_NODELETE	0x01000
+
+#if 0 /*def __USE_GNU*/
+/* To support profiling of shared objects it is a good idea to call
+   the function found using `dlsym' using the following macro since
+   these calls do not use the PLT.  But this would mean the dynamic
+   loader has no chance to find out when the function is called.  The
+   macro applies the necessary magic so that profiling is possible.
+   Rewrite
+	foo = (*fctp) (arg1, arg2);
+   into
+        foo = DL_CALL_FCT (fctp, (arg1, arg2));
+*/
+# define DL_CALL_FCT(fctp, args) \
+  (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args)
+
+__BEGIN_DECLS
+
+/* This function calls the profiling functions.  */
+extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW;
+
+__END_DECLS
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/endian.h
new file mode 100644
index 0000000..0a3d2fa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/endian.h
@@ -0,0 +1,16 @@
+/* The MIPS architecture has selectable endianness.
+   Linux/MIPS exists in two both little and big endian flavours and we
+   want to be able to share the installed headerfiles between both,
+   so we define __BYTE_ORDER based on GCC's predefines.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#ifdef __MIPSEB__
+# define __BYTE_ORDER __BIG_ENDIAN
+#else
+# ifdef __MIPSEL__
+#  define __BYTE_ORDER __LITTLE_ENDIAN
+# endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/epoll.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/epoll.h
new file mode 100644
index 0000000..4c6eb3b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/epoll.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_EPOLL_H
+# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+#endif
+
+/* Flags to be passed to epoll_create1.  */
+enum
+  {
+    EPOLL_CLOEXEC = 02000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 00000200
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/fcntl.h
new file mode 100644
index 0000000..f0072fd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/fcntl.h
@@ -0,0 +1,262 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004, 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.  */
+
+#ifndef	_FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <sgidefs.h>
+#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_APPEND	 0x0008
+#define O_SYNC		 0x0010
+#define O_NONBLOCK	 0x0080
+#define O_NDELAY	O_NONBLOCK
+#define O_CREAT		 0x0100	/* not fcntl */
+#define O_TRUNC		 0x0200	/* not fcntl */
+#define O_EXCL		 0x0400	/* not fcntl */
+#define O_NOCTTY	 0x0800	/* not fcntl */
+#define O_FSYNC		 O_SYNC
+#define O_ASYNC		 0x1000
+
+#ifdef __USE_GNU
+# define O_NOFOLLOW	0x20000	/* Do not follow links.	 */
+# define O_DIRECT	0x8000	/* Direct disk access hint.  */
+# define O_DIRECTORY	0x10000	/* Must be a directory.	 */
+# define O_NOATIME	0x40000	/* Do not set atime.  */
+# define O_CLOEXEC	02000000 /* set close_on_exec */
+#endif
+
+/* For now Linux has no 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
+# if __WORDSIZE == 64
+#  define O_LARGEFILE	0
+# else
+#  define O_LARGEFILE	0x2000	/* Allow large file opens.  */
+# endif
+#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	14	/* 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
+
+#if __WORDSIZE == 64
+# define F_GETLK64	14	/* Get record locking info.  */
+# define F_SETLK64	6	/* Set record locking info (non-blocking).  */
+# define F_SETLKW64	7	/* Set record locking info (blocking).	*/
+#else
+# define F_GETLK64	33	/* Get record locking info.  */
+# define F_SETLK64	34	/* Set record locking info (non-blocking).  */
+# define F_SETLKW64	35	/* Set record locking info (blocking).	*/
+#endif
+
+#if defined __USE_BSD || defined __USE_UNIX98
+# define F_SETOWN	24	/* Get owner of socket (receiver of SIGIO).  */
+# define F_GETOWN	23	/* 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]FL.  */
+#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.  */
+#if _MIPS_SIM != _ABI64
+    /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit
+       fcntls in o32 and n32, never has this field.  */
+    long int l_sysid;
+#endif
+#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.  */
+#if ! defined __USE_FILE_OFFSET64 && _MIPS_SIM != _ABI64
+    /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit
+       flock in o32 and n32, never has this field.  */
+    long int pad[4];
+#endif
+  };
+typedef struct flock flock_t;
+
+#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/mips/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/fenv.h
new file mode 100644
index 0000000..24e0694
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/fenv.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 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.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Define bits representing the exception.  We use the bit positions
+   of the appropriate bits in the FPU control word.  */
+enum
+  {
+    FE_INEXACT = 0x04,
+#define FE_INEXACT	FE_INEXACT
+    FE_UNDERFLOW = 0x08,
+#define FE_UNDERFLOW	FE_UNDERFLOW
+    FE_OVERFLOW = 0x10,
+#define FE_OVERFLOW	FE_OVERFLOW
+    FE_DIVBYZERO = 0x20,
+#define FE_DIVBYZERO	FE_DIVBYZERO
+    FE_INVALID = 0x40,
+#define FE_INVALID	FE_INVALID
+  };
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The MIPS FPU supports all of the four defined rounding modes.  We
+   use again the bit positions in the FPU control word as the values
+   for the appropriate macros.  */
+enum
+  {
+    FE_TONEAREST = 0x0,
+#define FE_TONEAREST	FE_TONEAREST
+    FE_TOWARDZERO = 0x1,
+#define FE_TOWARDZERO	FE_TOWARDZERO
+    FE_UPWARD = 0x2,
+#define FE_UPWARD	FE_UPWARD
+    FE_DOWNWARD = 0x3
+#define FE_DOWNWARD	FE_DOWNWARD
+  };
+
+
+/* Type representing exception flags.  */
+typedef unsigned short int fexcept_t;
+
+
+/* Type representing floating-point environment.  This function corresponds
+   to the layout of the block written by the `fstenv'.  */
+typedef struct
+  {
+    unsigned int __fp_control_register;
+  }
+fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((__const fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exception is masked.  */
+# define FE_NOMASK_ENV  ((__const fenv_t *) -2)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/inotify.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/inotify.h
new file mode 100644
index 0000000..67d648b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/inotify.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2005-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_INOTIFY_H
+# error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead."
+#endif
+
+/* Flags for the parameter of inotify_init1.  */
+enum
+  {
+    IN_CLOEXEC = 02000000,
+#define IN_CLOEXEC IN_CLOEXEC
+    IN_NONBLOCK = 00000200
+#define IN_NONBLOCK IN_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/ioctl-types.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/ioctl-types.h
new file mode 100644
index 0000000..a8dcf24
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/ioctl-types.h
@@ -0,0 +1,76 @@
+/* Structure types for pre-termios terminal ioctls.  Linux/MIPS version.
+   Copyright (C) 1997, 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_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Get definition of constants for use with `ioctl'.  */
+#include <asm/ioctls.h>
+
+struct winsize
+  {
+    unsigned short int ws_row;
+    unsigned short int ws_col;
+    unsigned short int ws_xpixel;
+    unsigned short int ws_ypixel;
+  };
+
+#define NCC	8
+struct termio
+  {
+    unsigned short int c_iflag;		/* input mode flags */
+    unsigned short int c_oflag;		/* output mode flags */
+    unsigned short int c_cflag;		/* control mode flags */
+    unsigned short int c_lflag;		/* local mode flags */
+    char c_line;			/* line discipline */
+    /* Yes, this is really NCCS.  */
+    unsigned char c_cc[32 /* NCCS */]; /* control characters */
+  };
+
+/* modem lines */
+#define TIOCM_LE	0x001		/* line enable */
+#define TIOCM_DTR	0x002		/* data terminal ready */
+#define TIOCM_RTS	0x004		/* request to send */
+#define TIOCM_ST	0x010		/* secondary transmit */
+#define TIOCM_SR	0x020		/* secondary receive */
+#define TIOCM_CTS	0x040		/* clear to send */
+#define TIOCM_CAR	0x100		/* carrier detect */
+#define TIOCM_CD	TIOCM_CAR
+#define TIOCM_RNG	0x200		/* ring */
+#define TIOCM_RI	TIOCM_RNG
+#define TIOCM_DSR	0x400		/* data set ready */
+
+/* line disciplines */
+#define N_TTY		0
+#define N_SLIP		1
+#define N_MOUSE		2
+#define N_PPP		3
+#define N_STRIP		4
+#define N_AX25		5
+#define N_X25		6	/* X.25 async  */
+#define N_6PACK		7
+#define N_MASC		8	/* Mobitex module  */
+#define N_R3964		9	/* Simatic R3964 module  */
+#define N_PROFIBUS_FDL	10	/* Profibus  */
+#define N_IRDA		11	/* Linux IR  */
+#define N_SMSBLOCK	12	/* SMS block mode  */
+#define N_HDLC		13	/* synchronous HDLC  */
+#define N_SYNC_PPP	14	/* synchronous PPP  */
+#define	N_HCI		15	/* Bluetooth HCI UART  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/ipc.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/ipc.h
new file mode 100644
index 0000000..1f629ce
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/ipc.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 1995, 96, 97, 98, 99, 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_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.	*/
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#ifdef __USE_GNU
+# define IPC_INFO	3		/* See ipcs.  */
+#endif
+
+/* Special key values.	*/
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.	 */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;			/* Key.  */
+    unsigned int uid;			/* Owner's user ID.  */
+    unsigned int gid;			/* Owner's group ID.  */
+    unsigned int cuid;			/* Creator's user ID.  */
+    unsigned int cgid;			/* Creator's group ID.	*/
+    unsigned int mode;			/* Read/write permission.  */
+    unsigned short int __seq;		/* Sequence number.  */
+    unsigned short int __pad1;
+    unsigned long int __unused1;
+    unsigned long int __unused2;
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/kernel_sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/kernel_sigaction.h
new file mode 100644
index 0000000..2048095
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/kernel_sigaction.h
@@ -0,0 +1,35 @@
+#ifndef _BITS_SIGACTION_STRUCT_H
+#define _BITS_SIGACTION_STRUCT_H
+
+/* This is the sigaction structure from the Linux 2.1.24 kernel.  */
+
+#include <sgidefs.h>
+
+#define HAVE_SA_RESTORER
+
+struct old_kernel_sigaction {
+	unsigned int	sa_flags;
+	__sighandler_t	k_sa_handler;
+	unsigned long	sa_mask;
+	unsigned int    __pad0[3]; /* reserved, keep size constant */
+
+	/* Abi says here follows reserved int[2] */
+	void		(*sa_restorer)(void);
+#if (_MIPS_SZPTR < 64)
+	/*
+	 * For 32 bit code we have to pad struct sigaction to get
+	 * constant size for the ABI
+	 */
+	int		pad1[1]; /* reserved */
+#endif
+};
+
+/* In uclibc, userspace struct sigaction is identical to
+ * "new" struct kernel_sigaction (one from the Linux 2.1.68 kernel).
+ * See sigaction.h
+ */
+
+extern int __syscall_rt_sigaction (int, const struct sigaction *,
+	struct sigaction *, size_t) attribute_hidden;
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/kernel_stat.h
new file mode 100644
index 0000000..655c089
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/kernel_stat.h
@@ -0,0 +1,94 @@
+#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... */
+
+#include <sgidefs.h>
+
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+/* The memory layout is the same as of struct stat64 of the 32-bit kernel.  */
+struct kernel_stat {
+	__kernel_dev_t	st_dev;
+	unsigned int	st_pad1[3];
+	__kernel_ino_t	st_ino;
+	__kernel_mode_t	st_mode;
+	__kernel_nlink_t st_nlink;
+	__kernel_uid_t	st_uid;
+	__kernel_gid_t	st_gid;
+	__kernel_dev_t	st_rdev;
+	unsigned int	st_pad2[3];
+	__kernel_off_t	st_size;
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned int	st_blksize;
+	unsigned int	reserved3;
+	unsigned long	st_blocks;
+};
+#define kernel_stat64 kernel_stat
+#elif _MIPS_SIM == _MIPS_SIM_NABI32
+/* The memory layout is the same as of struct stat64 of the 32-bit kernel.  */
+struct kernel_stat {
+	unsigned int	st_dev;
+	unsigned int	st_pad1[3];
+	unsigned long long	st_ino;
+	__kernel_mode_t	st_mode;
+	__kernel_nlink_t st_nlink;
+	__kernel_uid_t	st_uid;
+	__kernel_gid_t	st_gid;
+	unsigned int	st_rdev;
+	unsigned int	st_pad2[3];
+	unsigned long long	st_size;
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned int	st_blksize;
+	unsigned int	reserved3;
+	unsigned long long	st_blocks;
+};
+#define kernel_stat64 kernel_stat
+#else /* O32 */
+struct kernel_stat {
+	__kernel_dev_t	st_dev;
+	long		st_pad1[3];
+	__kernel_ino_t	st_ino;
+	__kernel_mode_t	st_mode;
+	__kernel_nlink_t st_nlink;
+	__kernel_uid_t	st_uid;
+	__kernel_gid_t	st_gid;
+	__kernel_dev_t	st_rdev;
+	long		st_pad2[2];
+	__kernel_off_t	st_size;
+	long		st_pad3;
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	long		st_blksize;
+	long		st_blocks;
+	long		st_pad4[14];
+};
+
+struct kernel_stat64 {
+	unsigned long	st_dev;
+	unsigned long	st_pad0[3];	/* Reserved for st_dev expansion  */
+	unsigned long long	st_ino;
+	__kernel_mode_t	st_mode;
+	__kernel_nlink_t st_nlink;
+	__kernel_uid_t	st_uid;
+	__kernel_gid_t	st_gid;
+	unsigned long	st_rdev;
+	unsigned long	st_pad1[3];	/* Reserved for st_rdev expansion  */
+	long long	st_size;
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned long	st_blksize;
+	unsigned long	st_pad2;
+	long long	st_blocks;
+};
+#endif	/* O32 */
+
+#endif	/*  _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/kernel_types.h
new file mode 100644
index 0000000..97faeac
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/kernel_types.h
@@ -0,0 +1,83 @@
+/* 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 _ASM_POSIX_TYPES_H
+#define _ASM_POSIX_TYPES_H
+
+# if __WORDSIZE == 64
+typedef unsigned int	__kernel_dev_t;
+typedef unsigned long	__kernel_ino_t;
+typedef unsigned int	__kernel_mode_t;
+typedef unsigned int	__kernel_nlink_t;
+typedef long		__kernel_off_t;
+typedef int		__kernel_pid_t;
+typedef long int		__kernel_ipc_pid_t;
+typedef int		__kernel_uid_t;
+typedef int		__kernel_gid_t;
+typedef unsigned long	__kernel_size_t;
+typedef long		__kernel_ssize_t;
+typedef long		__kernel_ptrdiff_t;
+typedef long		__kernel_time_t;
+typedef long		__kernel_suseconds_t;
+typedef long		__kernel_clock_t;
+typedef long		__kernel_daddr_t;
+typedef char *		__kernel_caddr_t;
+typedef unsigned short	__kernel_uid16_t;
+typedef unsigned short	__kernel_gid16_t;
+typedef int		__kernel_uid32_t;
+typedef int		__kernel_gid32_t;
+typedef __kernel_uid_t	__kernel_old_uid_t;
+typedef __kernel_gid_t	__kernel_old_gid_t;
+typedef __kernel_dev_t	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+typedef long long      __kernel_loff_t;
+#else
+typedef unsigned int	__kernel_dev_t;
+typedef unsigned long	__kernel_ino_t;
+typedef unsigned int	__kernel_mode_t;
+
+/* Linux 2.4.20 include/asm-mips/posix_types.h has this:
+but apparently that is an error?!?!?
+*/
+#if 0
+typedef int            __kernel_nlink_t;
+#else
+/* So use this instead */
+typedef unsigned long  __kernel_nlink_t;
+#endif
+
+typedef long		__kernel_off_t;
+typedef int		__kernel_pid_t;
+typedef long int		__kernel_ipc_pid_t;
+typedef int		__kernel_uid_t;
+typedef int		__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 long		__kernel_daddr_t;
+typedef char *		__kernel_caddr_t;
+typedef unsigned short	__kernel_uid16_t;
+typedef unsigned short	__kernel_gid16_t;
+typedef int		__kernel_uid32_t;
+typedef int		__kernel_gid32_t;
+typedef __kernel_uid_t	__kernel_old_uid_t;
+typedef __kernel_gid_t	__kernel_old_gid_t;
+typedef __kernel_dev_t	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+typedef long long      __kernel_loff_t;
+#endif
+
+
+typedef struct {
+	long val[2];
+} __kernel_fsid_t;
+
+#endif /* _ASM_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/mathdef.h
new file mode 100644
index 0000000..331da13
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/mathdef.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
+	Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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
+
+#include <sgidefs.h>
+
+#if defined  __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
+# define _MATH_H_MATHDEF	1
+
+/* Normally, there is no long double type and the `float' and `double'
+   expressions are evaluated as `double'.  */
+typedef double float_t;		/* `float' expressions are evaluated as
+				   `double'.  */
+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 */
+
+#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32
+/* Signal that we do not really have a `long double'.  This disables the
+   declaration of all the `long double' function variants.  */
+# define __NO_LONG_DOUBLE_MATH	1
+#elif !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/mman.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/mman.h
new file mode 100644
index 0000000..c480be4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/mman.h
@@ -0,0 +1,108 @@
+/* Definitions for POSIX memory map interface.  Linux/MIPS version.
+   Copyright (C) 1997, 2000, 2003, 2004, 2005, 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.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+   But the kernel header is not namespace clean.  */
+
+
+/* Protections are chosen from these bits, OR'd together.  The
+   implementation does not necessarily support PROT_EXEC or PROT_WRITE
+   without PROT_READ.  The only guarantees are that no writing will be
+   allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ	0x1		/* Page can be read.  */
+#define PROT_WRITE	0x2		/* Page can be written.  */
+#define PROT_EXEC	0x4		/* Page can be executed.  */
+#define PROT_NONE	0x0		/* Page can not be accessed.  */
+#define PROT_GROWSDOWN	0x01000000	/* Extend change to start of
+					   growsdown vma (mprotect only).  */
+#define PROT_GROWSUP	0x02000000	/* Extend change to start of
+					   growsup vma (mprotect only).  */
+
+/* Sharing types (must choose one and only one of these).  */
+#define MAP_SHARED	0x01		/* Share changes.  */
+#define MAP_PRIVATE	0x02		/* Changes are private.  */
+#ifdef __USE_MISC
+# define MAP_TYPE	0x0f		/* Mask for type of mapping.  */
+#endif
+
+/* Other flags.  */
+#define MAP_FIXED	0x10		/* Interpret addr exactly.  */
+#ifdef __USE_MISC
+# define MAP_FILE	0
+# define MAP_ANONYMOUS	0x0800		/* Don't use a file.  */
+# define MAP_ANON	MAP_ANONYMOUS
+# define MAP_RENAME	MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific.  */
+#ifdef __USE_MISC
+# define MAP_NORESERVE	0x0400		/* don't check for reservations */
+# define MAP_ANONYMOUS	0x0800		/* don't use a file */
+# define MAP_GROWSDOWN	0x1000		/* stack-like segment */
+# define MAP_DENYWRITE	0x2000		/* ETXTBSY */
+# define MAP_EXECUTABLE	0x4000		/* mark it as an executable */
+# define MAP_LOCKED	0x8000		/* pages are locked */
+# define MAP_POPULATE   0x10000         /* populate (prefault) pagetables */
+# define MAP_NONBLOCK   0x20000         /* do not block on IO */
+# define MAP_UNINITIALIZE 0x4000000     /* For anonymous mmap, memory could
+					   be uninitialized. */
+#endif
+
+/* Flags to `msync'.  */
+#define MS_ASYNC	1		/* Sync memory asynchronously.  */
+#define MS_SYNC		4		/* Synchronous memory sync.  */
+#define MS_INVALIDATE	2		/* Invalidate the caches.  */
+
+/* Flags for `mlockall'.  */
+#define MCL_CURRENT	1		/* Lock all currently mapped pages.  */
+#define MCL_FUTURE	2		/* Lock all additions to address
+					   space.  */
+
+/* Flags for `mremap'.  */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE	1
+# define MREMAP_FIXED	2
+#endif
+
+/* Advice to `madvise'.  */
+#ifdef __USE_BSD
+# define MADV_NORMAL	 0	/* No further special treatment.  */
+# define MADV_RANDOM	 1	/* Expect random page references.  */
+# define MADV_SEQUENTIAL 2	/* Expect sequential page references.  */
+# define MADV_WILLNEED	 3	/* Will need these pages.  */
+# define MADV_DONTNEED	 4	/* Don't need these pages.  */
+# define MADV_REMOVE	 9	/* Remove these pages and resources.  */
+# define MADV_DONTFORK	 10	/* Do not inherit across fork.  */
+# define MADV_DOFORK	 11	/* Do inherit across fork.  */
+#endif
+
+/* The POSIX people had to invent similar names for the same things.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_MADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_MADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+# define POSIX_MADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_MADV_DONTNEED	4 /* Don't need these pages.  */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/msq.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/msq.h
new file mode 100644
index 0000000..2b0d38e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/msq.h
@@ -0,0 +1,93 @@
+/* Copyright (C) 2002 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_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Define options for message queue functions.  */
+#define MSG_NOERROR	010000	/* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT	020000	/* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition.  */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+
+/* Structure of record for one message inside the kernel.
+   The type `struct msg' is opaque.  */
+struct msqid_ds
+{
+  struct ipc_perm msg_perm;	/* structure describing operation permission */
+#if (__WORDSIZE == 32) && !defined(__MIPSEL__)
+	unsigned long	__unused1;
+#endif
+  __time_t msg_stime;		/* time of last msgsnd command */
+#if (__WORDSIZE == 32) && defined(__MIPSEL__)
+	unsigned long	__unused1;
+#endif
+#if (__WORDSIZE == 32) && !defined(__MIPSEL__)
+	unsigned long	__unused2;
+#endif
+  __time_t msg_rtime;		/* time of last msgrcv command */
+#if (__WORDSIZE == 32) && defined(__MIPSEL__)
+	unsigned long	__unused2;
+#endif
+#if (__WORDSIZE == 32) && !defined(__MIPSEL__)
+	unsigned long	__unused3;
+#endif
+  __time_t msg_ctime;		/* time of last change */
+#if (__WORDSIZE == 32) && defined(__MIPSEL__)
+	unsigned long	__unused3;
+#endif
+  unsigned long int __msg_cbytes; /* current number of bytes on queue */
+  msgqnum_t msg_qnum;		/* number of messages currently on queue */
+  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
+  __pid_t msg_lspid;		/* pid of last msgsnd() */
+  __pid_t msg_lrpid;		/* pid of last msgrcv() */
+  unsigned long int __unused4;
+  unsigned long int __unused5;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes	__msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+  {
+    int msgpool;
+    int msgmap;
+    int msgmax;
+    int msgmnb;
+    int msgmni;
+    int msgssz;
+    int msgtql;
+    unsigned short int msgseg;
+  };
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/poll.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/poll.h
new file mode 100644
index 0000000..eee4ea2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/poll.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1997, 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.  */
+
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for.  These bits may be set in `events'
+   to indicate the interesting event types; they will appear in `revents'
+   to indicate the status of the file descriptor.  */
+#define POLLIN		0x001		/* There is data to read.  */
+#define POLLPRI		0x002		/* There is urgent data to read.  */
+#define POLLOUT		0x004		/* Writing now will not block.  */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2.  */
+# define POLLRDNORM	0x040		/* Normal data may be read.  */
+# define POLLRDBAND	0x080		/* Priority data may be read.  */
+# define POLLWRNORM	POLLOUT		/* Writing now will not block.  */
+# define POLLWRBAND	0x100		/* Priority data may be written.  */
+#endif
+
+#ifdef __USE_GNU
+/* These are extensions for Linux.  */
+# define POLLMSG	0x400
+# define POLLREMOVE	0x1000
+# define POLLRDHUP	0x2000
+#endif
+
+/* Event types always implicitly polled for.  These bits need not be set in
+   `events', but they will appear in `revents' to indicate the status of
+   the file descriptor.  */
+#define POLLERR		0x008		/* Error condition.  */
+#define POLLHUP		0x010		/* Hung up.  */
+#define POLLNVAL	0x020		/* Invalid polling request.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/resource.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/resource.h
new file mode 100644
index 0000000..1c8b99a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/resource.h
@@ -0,0 +1,233 @@
+/* Bit values & structures for resource limits.  Linux/MIPS version.
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 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.  */
+
+#ifndef _SYS_RESOURCE_H
+# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Transmute defines to enumerations.  The macro re-definitions are
+   necessary because some programs want to test for operating system
+   features with #ifdef RUSAGE_SELF.  In ISO C the reflexive
+   definition is a no-op.  */
+
+/* Kinds of resource limit.  */
+enum __rlimit_resource
+{
+  /* Per-process CPU limit, in seconds.  */
+  RLIMIT_CPU = 0,
+#define RLIMIT_CPU RLIMIT_CPU
+
+  /* Largest file that can be created, in bytes.  */
+  RLIMIT_FSIZE = 1,
+#define	RLIMIT_FSIZE RLIMIT_FSIZE
+
+  /* Maximum size of data segment, in bytes.  */
+  RLIMIT_DATA = 2,
+#define	RLIMIT_DATA RLIMIT_DATA
+
+  /* Maximum size of stack segment, in bytes.  */
+  RLIMIT_STACK = 3,
+#define	RLIMIT_STACK RLIMIT_STACK
+
+  /* Largest core file that can be created, in bytes.  */
+  RLIMIT_CORE = 4,
+#define	RLIMIT_CORE RLIMIT_CORE
+
+  /* Largest resident set size, in bytes.
+     This affects swapping; processes that are exceeding their
+     resident set size will be more likely to have physical memory
+     taken from them.  */
+  __RLIMIT_RSS = 7,
+#define	RLIMIT_RSS __RLIMIT_RSS
+
+  /* Number of open files.  */
+  RLIMIT_NOFILE = 5,
+  __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same.  */
+#define RLIMIT_NOFILE RLIMIT_NOFILE
+#define RLIMIT_OFILE __RLIMIT_OFILE
+
+  /* Address space limit (?) */
+  RLIMIT_AS = 6,
+#define RLIMIT_AS RLIMIT_AS
+
+  /* Number of processes.  */
+  __RLIMIT_NPROC = 8,
+#define RLIMIT_NPROC __RLIMIT_NPROC
+
+  /* Locked-in-memory address space.  */
+  __RLIMIT_MEMLOCK = 9,
+#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK
+
+  /* Maximum number of file locks.  */
+  __RLIMIT_LOCKS = 10,
+#define RLIMIT_LOCKS __RLIMIT_LOCKS
+
+  /* Maximum number of pending signals.  */
+  __RLIMIT_SIGPENDING = 11,
+#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING
+
+  /* Maximum bytes in POSIX message queues.  */
+  __RLIMIT_MSGQUEUE = 12,
+#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
+
+  /* Maximum nice priority allowed to raise to.
+     Nice levels 19 .. -20 correspond to 0 .. 39
+     values of this resource limit.  */
+  __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+  /* Maximum realtime priority allowed for non-priviledged
+     processes.  */
+  __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
+
+  __RLIMIT_NLIMITS = 15,
+  __RLIM_NLIMITS = __RLIMIT_NLIMITS
+#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
+#define RLIM_NLIMITS __RLIM_NLIMITS
+};
+
+/* Value to indicate that there is no limit.  */
+#if _MIPS_SIM == _ABI64
+/* The N64 syscall uses this value.  */
+# define RLIM_INFINITY 0xffffffffffffffffUL
+# ifdef __USE_LARGEFILE64
+#  define RLIM64_INFINITY 0xffffffffffffffffUL
+# endif
+#else
+/* The O32 and N32 syscalls use 0x7fffffff.  */
+# ifndef __USE_FILE_OFFSET64
+#  define RLIM_INFINITY ((long int)(~0UL >> 1))
+# else
+#  define RLIM_INFINITY 0x7fffffffffffffffULL
+# endif
+# ifdef __USE_LARGEFILE64
+#  define RLIM64_INFINITY 0x7fffffffffffffffULL
+# endif
+#endif
+
+/* We can represent all limits.  */
+#define RLIM_SAVED_MAX	RLIM_INFINITY
+#define RLIM_SAVED_CUR	RLIM_INFINITY
+
+
+/* Type for resource quantity measurement.  */
+#ifndef __USE_FILE_OFFSET64
+typedef __rlim_t rlim_t;
+#else
+typedef __rlim64_t rlim_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef __rlim64_t rlim64_t;
+#endif
+
+struct rlimit
+  {
+    /* The current (soft) limit.  */
+    rlim_t rlim_cur;
+    /* The hard limit.  */
+    rlim_t rlim_max;
+  };
+
+#ifdef __USE_LARGEFILE64
+struct rlimit64
+  {
+    /* The current (soft) limit.  */
+    rlim64_t rlim_cur;
+    /* The hard limit.  */
+    rlim64_t rlim_max;
+ };
+#endif
+
+/* Whose usage statistics do you want?  */
+enum __rusage_who
+{
+  /* The calling process.  */
+  RUSAGE_SELF = 0,
+#define RUSAGE_SELF RUSAGE_SELF
+
+  /* All of its terminated child processes.  */
+  RUSAGE_CHILDREN = -1
+#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+};
+
+#define __need_timeval
+#include <bits/time.h>		/* For `struct timeval'.  */
+
+/* Structure which says how much of each resource has been used.  */
+struct rusage
+  {
+    /* Total amount of user time used.  */
+    struct timeval ru_utime;
+    /* Total amount of system time used.  */
+    struct timeval ru_stime;
+    /* Maximum resident set size (in kilobytes).  */
+    long int ru_maxrss;
+    /* Amount of sharing of text segment memory
+       with other processes (kilobyte-seconds).  */
+    long int ru_ixrss;
+    /* Amount of data segment memory used (kilobyte-seconds).  */
+    long int ru_idrss;
+    /* Amount of stack memory used (kilobyte-seconds).  */
+    long int ru_isrss;
+    /* Number of soft page faults (i.e. those serviced by reclaiming
+       a page from the list of pages awaiting reallocation.  */
+    long int ru_minflt;
+    /* Number of hard page faults (i.e. those that required I/O).  */
+    long int ru_majflt;
+    /* Number of times a process was swapped out of physical memory.  */
+    long int ru_nswap;
+    /* Number of input operations via the file system.  Note: This
+       and `ru_oublock' do not include operations with the cache.  */
+    long int ru_inblock;
+    /* Number of output operations via the file system.  */
+    long int ru_oublock;
+    /* Number of IPC messages sent.  */
+    long int ru_msgsnd;
+    /* Number of IPC messages received.  */
+    long int ru_msgrcv;
+    /* Number of signals delivered.  */
+    long int ru_nsignals;
+    /* Number of voluntary context switches, i.e. because the process
+       gave up the process before it had to (usually to wait for some
+       resource to be available).  */
+    long int ru_nvcsw;
+    /* Number of involuntary context switches, i.e. a higher priority process
+       became runnable or the current process used up its time slice.  */
+    long int ru_nivcsw;
+  };
+
+/* Priority limits.  */
+#define PRIO_MIN	-20	/* Minimum priority a process can have.  */
+#define PRIO_MAX	20	/* Maximum priority a process can have.  */
+
+/* The type of the WHICH argument to `getpriority' and `setpriority',
+   indicating what flavor of entity the WHO argument specifies.  */
+enum __priority_which
+{
+  PRIO_PROCESS = 0,		/* WHO is a process ID.  */
+#define PRIO_PROCESS PRIO_PROCESS
+  PRIO_PGRP = 1,		/* WHO is a process group ID.  */
+#define PRIO_PGRP PRIO_PGRP
+  PRIO_USER = 2			/* WHO is a user ID.  */
+#define PRIO_USER PRIO_USER
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sem.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sem.h
new file mode 100644
index 0000000..6282de9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sem.h
@@ -0,0 +1,85 @@
+/* Copyright (C) 1995, 1996, 1997, 1998, 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_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'.  */
+#define SEM_UNDO	0x1000		/* undo the operation on exit */
+
+/* Commands for `semctl'.  */
+#define GETPID		11		/* get sempid */
+#define GETVAL		12		/* get semval */
+#define GETALL		13		/* get all semval's */
+#define GETNCNT		14		/* get semncnt */
+#define GETZCNT		15		/* get semzcnt */
+#define SETVAL		16		/* set semval */
+#define SETALL		17		/* set all semval's */
+
+
+/* Data structure describing a set of semaphores.  */
+struct semid_ds
+{
+  struct ipc_perm sem_perm;		/* operation permission struct */
+  __time_t sem_otime;			/* last semop() time */
+  __time_t sem_ctime;			/* last time changed by semctl() */
+  unsigned long int sem_nsems;		/* number of semaphores in set */
+  unsigned long int __unused1;
+  unsigned long int __unused2;
+};
+
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;				<= value for SETVAL
+     struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;		<= array for GETALL & SETALL
+     struct seminfo *__buf;		<= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED	1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct  seminfo
+{
+  int semmap;
+  int semmni;
+  int semmns;
+  int semmnu;
+  int semmsl;
+  int semopm;
+  int semume;
+  int semusz;
+  int semvmx;
+  int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/setjmp.h
new file mode 100644
index 0000000..08e74fe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/setjmp.h
@@ -0,0 +1,72 @@
+/* Define the machine-dependent type `jmp_buf'.  MIPS version.
+   Copyright (C) 1992,93,95,97,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 _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
+
+#include <sgidefs.h>
+
+typedef struct
+  {
+    /* Program counter.  */
+    void * __pc;
+
+    /* Stack pointer.  */
+    void * __sp;
+
+    /* Callee-saved registers s0 through s7.  */
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+    int __regs[8];
+#else
+    long long __regs[8];
+#endif
+
+    /* The frame pointer.  */
+    void * __fp;
+
+    /* The global pointer.  */
+    void * __gp;
+
+    /* Floating point status register.  */
+    int __fpc_csr;
+
+    /* Callee-saved floating point registers.  */
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+    double __fpregs[8];
+#else /* N32 || O32 */
+    double __fpregs[6];
+#endif /* N32 || O32 */
+  } __jmp_buf[1];
+
+#ifdef __USE_MISC
+/* Offset to the program counter in `jmp_buf'.  */
+# define JB_PC	0
+#endif
+
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[0].__sp)
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/shm.h
new file mode 100644
index 0000000..b308334
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/shm.h
@@ -0,0 +1,94 @@
+/* Copyright (C) 1995,1996,1997,2000,2001,2002,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _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) */
+
+/* Segment low boundary address multiple.  */
+#define SHMLBA		0x40000
+
+
+/* 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() */
+    __time_t shm_dtime;			/* time of last shmdt() */
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+    __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 __unused1;
+    unsigned long int __unused2;
+  };
+
+#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 */
+
+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 */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigaction.h
new file mode 100644
index 0000000..cc689d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigaction.h
@@ -0,0 +1,74 @@
+/* The proper definitions for Linux/MIPS's sigaction.
+   Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999, 2000, 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 _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives.  */
+struct sigaction {
+	unsigned        sa_flags;
+#ifdef __USE_POSIX199309
+	union {
+		__sighandler_t sa_handler;
+		void (*sa_sigaction)(int, siginfo_t *, void *);
+	} __sigaction_handler;
+# define sa_handler     __sigaction_handler.sa_handler
+# define sa_sigaction   __sigaction_handler.sa_sigaction
+#else
+	__sighandler_t  sa_handler;
+#endif
+	sigset_t        sa_mask;
+	void            (*sa_restorer)(void);
+	/*int           s_resv[1]; - reserved [deleted in uclibc] */
+};
+
+/* Bits in `sa_flags'.  */
+/* Please note that some Linux kernels versions use different values for these
+   flags which is a bug in those kernel versions.  */
+#define SA_NOCLDSTOP  0x00000001 /* Don't send SIGCHLD when children stop.  */
+#define SA_NOCLDWAIT  0x00010000 /* Don't create zombie on child death.  */
+#define SA_SIGINFO    0x00000008 /* Invoke signal-catching function with
+				    three arguments instead of one.  */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK   0x08000000 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler.  */
+# define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
+# define SA_NODEFER   0x40000000 /* Don't automatically block the signal when
+				    its handler is being executed.  */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historical no-op.  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
+# define SA_STACK     SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'.  */
+#define SIG_NOP	      0		/* 0 is unused to catch errors */
+#define	SIG_BLOCK     1		/* Block signals.  */
+#define	SIG_UNBLOCK   2		/* Unblock signals.  */
+#define	SIG_SETMASK   3		/* Set the set of blocked signals.  */
+#ifdef __USE_MISC
+# define SIG_SETMASK32 256	/* Goodie from SGI for BSD compatibility:
+				   set only the low 32 bit of the sigset.  */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigcontext.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigcontext.h
new file mode 100644
index 0000000..99faeed
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigcontext.h
@@ -0,0 +1,84 @@
+/* Copyright (C) 1996, 1997, 1998, 2003, 2004, 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.  */
+
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#include <sgidefs.h>
+
+#if _MIPS_SIM == _ABIO32
+
+/* Certain unused fields were replaced with new ones in 2.6.12-rc4.
+   The changes were as follows:
+
+   sc_cause -> sc_hi1
+   sc_badvaddr -> sc_lo1
+   sc_sigset[0] -> sc_hi2
+   sc_sigset[1] -> sc_lo2
+   sc_sigset[2] -> sc_hi3
+   sc_sigset[3] -> sc_lo3
+
+   sc_regmask, sc_ownedfp and sc_fpc_eir are not used.  */
+struct sigcontext {
+  unsigned int sc_regmask;
+  unsigned int sc_status;
+  unsigned long long sc_pc;
+  unsigned long long sc_regs[32];
+  unsigned long long sc_fpregs[32];
+  unsigned int sc_ownedfp;
+  unsigned int sc_fpc_csr;
+  unsigned int sc_fpc_eir;
+  unsigned int sc_used_math;
+  unsigned int sc_dsp;
+  unsigned long long sc_mdhi;
+  unsigned long long sc_mdlo;
+  unsigned long sc_hi1;
+  unsigned long sc_lo1;
+  unsigned long sc_hi2;
+  unsigned long sc_lo2;
+  unsigned long sc_hi3;
+  unsigned long sc_lo3;
+};
+
+#else
+
+/* This structure changed in 2.6.12-rc4 when DSP support was added.  */
+struct sigcontext {
+  unsigned long long sc_regs[32];
+  unsigned long long sc_fpregs[32];
+  unsigned long long sc_mdhi;
+  unsigned long long sc_hi1;
+  unsigned long long sc_hi2;
+  unsigned long long sc_hi3;
+  unsigned long long sc_mdlo;
+  unsigned long long sc_lo1;
+  unsigned long long sc_lo2;
+  unsigned long long sc_lo3;
+  unsigned long long sc_pc;
+  unsigned int sc_fpc_csr;
+  unsigned int sc_used_math;
+  unsigned int sc_dsp;
+  unsigned int sc_reserved;
+};
+
+#endif /* _MIPS_SIM != _ABIO32 */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigcontextinfo.h
new file mode 100644
index 0000000..f453c8d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigcontextinfo.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Jaeger <aj@suse.de>, 2000.
+
+   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 <sgidefs.h>
+
+#if _MIPS_SIM == _ABIO32
+
+#define SIGCONTEXT unsigned long _code, struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS _code,
+#define GET_PC(ctx)	((void *) ctx->sc_pc)
+#define GET_FRAME(ctx)	((void *) ctx->sc_regs[30])
+#define GET_STACK(ctx)	((void *) ctx->sc_regs[29])
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
+
+#else
+
+#define SIGCONTEXT unsigned long _code, ucontext_t *
+#define SIGCONTEXT_EXTRA_ARGS _code,
+#define GET_PC(ctx)	((void *) ctx->uc_mcontext.pc)
+#define GET_FRAME(ctx)	((void *) ctx->uc_mcontext.gregs[30])
+#define GET_STACK(ctx)	((void *) ctx->uc_mcontext.gregs[29])
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/siginfo.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/siginfo.h
new file mode 100644
index 0000000..ba3e1f6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/siginfo.h
@@ -0,0 +1,311 @@
+/* siginfo_t, sigevent and constants.  Linux/MIPS version.
+   Copyright (C) 1997, 1998, 2000, 2001, 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 _SIGNAL_H && !defined __need_siginfo_t \
+    && !defined __need_sigevent_t
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+#if (!defined __have_sigval_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t \
+	 || defined __need_sigevent_t))
+# define __have_sigval_t	1
+
+/* Type for data associated with a signal.  */
+typedef union sigval
+  {
+    int sival_int;
+    void *sival_ptr;
+  } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t	1
+
+# define __SI_MAX_SIZE		128
+# if __WORDSIZE == 64
+#  define __SI_PAD_SIZE		((__SI_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SI_PAD_SIZE		((__SI_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+
+typedef struct siginfo
+  {
+    int si_signo;		/* Signal number.  */
+    int si_code;		/* Signal code.  */
+    int si_errno;		/* If non-zero, an errno value associated with
+				   this signal, as defined in <errno.h>.  */
+    int __pad0[__SI_MAX_SIZE / sizeof (int) - __SI_PAD_SIZE - 3];
+				/* Explicit padding.  */
+
+    union
+      {
+	int _pad[__SI_PAD_SIZE];
+
+	 /* kill().  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	  } _kill;
+
+	/* SIGCHLD.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Which child.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    int si_status;	/* Exit value or signal.  */
+	    __clock_t si_utime;
+	    __clock_t si_stime;
+	  } _sigchld;
+
+	/* SIGILL, SIGFPE, SIGSEGV, SIGBUS.  */
+	struct
+	  {
+	    void *si_addr;	/* Faulting insn/memory ref.  */
+	  } _sigfault;
+
+	/* SIGPOLL.  */
+	struct
+	  {
+	    int si_band;	/* Band event for SIGPOLL.  */
+	    int si_fd;
+	  } _sigpoll;
+
+	/* POSIX.1b timers.  */
+	struct
+	  {
+	    unsigned int _timer1;
+	    unsigned int _timer2;
+	  } _timer;
+
+	/* POSIX.1b signals.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _rt;
+      } _sifields;
+  } siginfo_t;
+
+
+/* X/Open requires some more fields with fixed names.  */
+# define si_pid		_sifields._kill.si_pid
+# define si_uid		_sifields._kill.si_uid
+# define si_status	_sifields._sigchld.si_status
+# define si_utime	_sifields._sigchld.si_utime
+# define si_stime	_sifields._sigchld.si_stime
+# define si_value	_sifields._rt.si_sigval
+# define si_int		_sifields._rt.si_sigval.sival_int
+# define si_ptr		_sifields._rt.si_sigval.sival_ptr
+# define si_addr	_sifields._sigfault.si_addr
+# define si_band	_sifields._sigpoll.si_band
+# define si_fd		_sifields._sigpoll.si_fd
+
+
+/* Values for `si_code'.  Positive values are reserved for kernel-generated
+   signals.  */
+enum
+{
+  SI_ASYNCNL = -60,		/* Sent by asynch name lookup completion.  */
+# define SI_ASYNCNL	SI_ASYNCNL
+  SI_TKILL = -6,		/* Sent by tkill.  */
+# define SI_TKILL	SI_TKILL
+  SI_SIGIO,			/* Sent by queued SIGIO.  */
+# define SI_SIGIO	SI_SIGIO
+  SI_MESGQ,			/* Sent by real time mesq state change.  */
+# define SI_MESGQ	SI_MESGQ
+  SI_TIMER,			/* Sent by real time mesq state change.  */
+# define SI_TIMER	SI_TIMER
+  SI_ASYNCIO,			/* Sent by AIO completion.  */
+# define SI_ASYNCIO	SI_ASYNCIO
+  SI_QUEUE,			/* Sent by sigqueue.  */
+# define SI_QUEUE	SI_QUEUE
+  SI_USER,			/* Sent by kill, sigsend, raise.  */
+# define SI_USER	SI_USER
+  SI_KERNEL = 0x80		/* Send by kernel.  */
+#define SI_KERNEL	SI_KERNEL
+};
+
+
+/* `si_code' values for SIGILL signal.  */
+enum
+{
+  ILL_ILLOPC = 1,		/* Illegal opcode.  */
+# define ILL_ILLOPC	ILL_ILLOPC
+  ILL_ILLOPN,			/* Illegal operand.  */
+# define ILL_ILLOPN	ILL_ILLOPN
+  ILL_ILLADR,			/* Illegal addressing mode.  */
+# define ILL_ILLADR	ILL_ILLADR
+  ILL_ILLTRP,			/* Illegal trap.  */
+# define ILL_ILLTRP	ILL_ILLTRP
+  ILL_PRVOPC,			/* Privileged opcode.  */
+# define ILL_PRVOPC	ILL_PRVOPC
+  ILL_PRVREG,			/* Privileged register.  */
+# define ILL_PRVREG	ILL_PRVREG
+  ILL_COPROC,			/* Coprocessor error.  */
+# define ILL_COPROC	ILL_COPROC
+  ILL_BADSTK			/* Internal stack error.  */
+# define ILL_BADSTK	ILL_BADSTK
+};
+
+/* `si_code' values for SIGFPE signal.  */
+enum
+{
+  FPE_INTDIV = 1,		/* Integer divide by zero.  */
+# define FPE_INTDIV	FPE_INTDIV
+  FPE_INTOVF,			/* Integer overflow.  */
+# define FPE_INTOVF	FPE_INTOVF
+  FPE_FLTDIV,			/* Floating point divide by zero.  */
+# define FPE_FLTDIV	FPE_FLTDIV
+  FPE_FLTOVF,			/* Floating point overflow.  */
+# define FPE_FLTOVF	FPE_FLTOVF
+  FPE_FLTUND,			/* Floating point underflow.  */
+# define FPE_FLTUND	FPE_FLTUND
+  FPE_FLTRES,			/* Floating point inexact result.  */
+# define FPE_FLTRES	FPE_FLTRES
+  FPE_FLTINV,			/* Floating point invalid operation.  */
+# define FPE_FLTINV	FPE_FLTINV
+  FPE_FLTSUB			/* Subscript out of range.  */
+# define FPE_FLTSUB	FPE_FLTSUB
+};
+
+/* `si_code' values for SIGSEGV signal.  */
+enum
+{
+  SEGV_MAPERR = 1,		/* Address not mapped to object.  */
+# define SEGV_MAPERR	SEGV_MAPERR
+  SEGV_ACCERR			/* Invalid permissions for mapped object.  */
+# define SEGV_ACCERR	SEGV_ACCERR
+};
+
+/* `si_code' values for SIGBUS signal.  */
+enum
+{
+  BUS_ADRALN = 1,		/* Invalid address alignment.  */
+# define BUS_ADRALN	BUS_ADRALN
+  BUS_ADRERR,			/* Non-existant physical address.  */
+# define BUS_ADRERR	BUS_ADRERR
+  BUS_OBJERR			/* Object specific hardware error.  */
+# define BUS_OBJERR	BUS_OBJERR
+};
+
+/* `si_code' values for SIGTRAP signal.  */
+enum
+{
+  TRAP_BRKPT = 1,		/* Process breakpoint.  */
+# define TRAP_BRKPT	TRAP_BRKPT
+  TRAP_TRACE			/* Process trace trap.  */
+# define TRAP_TRACE	TRAP_TRACE
+};
+
+/* `si_code' values for SIGCHLD signal.  */
+enum
+{
+  CLD_EXITED = 1,		/* Child has exited.  */
+# define CLD_EXITED	CLD_EXITED
+  CLD_KILLED,			/* Child was killed.  */
+# define CLD_KILLED	CLD_KILLED
+  CLD_DUMPED,			/* Child terminated abnormally.  */
+# define CLD_DUMPED	CLD_DUMPED
+  CLD_TRAPPED,			/* Traced child has trapped.  */
+# define CLD_TRAPPED	CLD_TRAPPED
+  CLD_STOPPED,			/* Child has stopped.  */
+# define CLD_STOPPED	CLD_STOPPED
+  CLD_CONTINUED			/* Stopped child has continued.  */
+# define CLD_CONTINUED	CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal.  */
+enum
+{
+  POLL_IN = 1,			/* Data input available.  */
+# define POLL_IN	POLL_IN
+  POLL_OUT,			/* Output buffers available.  */
+# define POLL_OUT	POLL_OUT
+  POLL_MSG,			/* Input message available.   */
+# define POLL_MSG	POLL_MSG
+  POLL_ERR,			/* I/O error.  */
+# define POLL_ERR	POLL_ERR
+  POLL_PRI,			/* High priority input available.  */
+# define POLL_PRI	POLL_PRI
+  POLL_HUP			/* Device disconnected.  */
+# define POLL_HUP	POLL_HUP
+};
+
+# undef __need_siginfo_t
+#endif	/* !have siginfo_t && (have _SIGNAL_H || need siginfo_t).  */
+
+
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+    && !defined __have_sigevent_t
+# define __have_sigevent_t	1
+
+/* Structure to transport application-defined values with signals.  */
+# define __SIGEV_MAX_SIZE	64
+# define __SIGEV_HEAD_SIZE	(sizeof(long) + 2*sizeof(int))
+# define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE - __SIGEV_HEAD_SIZE) / sizeof (int))
+
+/* Forward declaration of the `pthread_attr_t' type.  */
+struct __pthread_attr_s;
+
+/* XXX This one might need to change!!!  */
+typedef struct sigevent
+  {
+    sigval_t sigev_value;
+    int sigev_signo;
+    int sigev_notify;
+
+    union
+      {
+	int _pad[__SIGEV_PAD_SIZE];
+
+	struct
+	  {
+	    void (*_function) (sigval_t);	/* Function to start.  */
+	    void *_attribute;			/* Really pthread_attr_t.  */
+	  } _sigev_thread;
+      } _sigev_un;
+  } sigevent_t;
+
+/* POSIX names to access some of the members.  */
+# define sigev_notify_function   _sigev_un._sigev_thread._function
+# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+/* `sigev_notify' values.  */
+enum
+{
+  SIGEV_SIGNAL = 0,		/* Notify via signal.  */
+# define SIGEV_SIGNAL	SIGEV_SIGNAL
+  SIGEV_NONE,			/* Other notification: meaningless.  */
+# define SIGEV_NONE	SIGEV_NONE
+  SIGEV_THREAD,			/* Deliver via thread creation.  */
+# define SIGEV_THREAD	SIGEV_THREAD
+
+  SIGEV_THREAD_ID = 4		/* Send signal to specific thread.  */
+#define SIGEV_THREAD_ID	SIGEV_THREAD_ID
+};
+
+#endif	/* have _SIGNAL_H.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/signalfd.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/signalfd.h
new file mode 100644
index 0000000..c2bea76
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/signalfd.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2007-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_SIGNALFD_H
+# error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead."
+#endif
+
+/* Flags for signalfd.  */
+enum
+  {
+    SFD_CLOEXEC = 02000000,
+#define SFD_CLOEXEC SFD_CLOEXEC
+    SFD_NONBLOCK = 00000200
+#define SFD_NONBLOCK SFD_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/signum.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/signum.h
new file mode 100644
index 0000000..b9c64e6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/signum.h
@@ -0,0 +1,60 @@
+/* Signal number definitions.  Linux version.
+   Copyright (C) 1995, 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.  */
+
+#ifdef	_SIGNAL_H
+
+#define SIGHUP		 1	/* Hangup (POSIX).  */
+#define SIGINT		 2	/* Interrupt (ANSI).  */
+#define SIGQUIT		 3	/* Quit (POSIX).  */
+#define SIGILL		 4	/* Illegal instruction (ANSI).  */
+#define SIGTRAP		 5	/* Trace trap (POSIX).  */
+#define SIGIOT		 6	/* IOT trap (4.2 BSD).  */
+#define SIGABRT		 SIGIOT	/* Abort (ANSI).  */
+#define SIGEMT		 7
+#define SIGFPE		 8	/* Floating-point exception (ANSI).  */
+#define SIGKILL		 9	/* Kill, unblockable (POSIX).  */
+#define SIGBUS		10	/* BUS error (4.2 BSD).  */
+#define SIGSEGV		11	/* Segmentation violation (ANSI).  */
+#define SIGSYS		12
+#define SIGPIPE		13	/* Broken pipe (POSIX).  */
+#define SIGALRM		14	/* Alarm clock (POSIX).  */
+#define SIGTERM		15	/* Termination (ANSI).  */
+#define SIGUSR1		16	/* User-defined signal 1 (POSIX).  */
+#define SIGUSR2		17	/* User-defined signal 2 (POSIX).  */
+#define SIGCHLD		18	/* Child status has changed (POSIX).  */
+#define SIGCLD		SIGCHLD	/* Same as SIGCHLD (System V).  */
+#define SIGPWR		19	/* Power failure restart (System V).  */
+#define SIGWINCH	20	/* Window size change (4.3 BSD, Sun).  */
+#define SIGURG		21	/* Urgent condition on socket (4.2 BSD).  */
+#define SIGIO		22	/* I/O now possible (4.2 BSD).  */
+#define SIGPOLL		SIGIO	/* Pollable event occurred (System V).  */
+#define SIGSTOP		23	/* Stop, unblockable (POSIX).  */
+#define SIGTSTP		24	/* Keyboard stop (POSIX).  */
+#define SIGCONT		25	/* Continue (POSIX).  */
+#define SIGTTIN		26	/* Background read from tty (POSIX).  */
+#define SIGTTOU		27	/* Background write to tty (POSIX).  */
+#define SIGVTALRM	28	/* Virtual alarm clock (4.2 BSD).  */
+#define SIGPROF		29	/* Profiling alarm clock (4.2 BSD).  */
+#define SIGXCPU		30	/* CPU limit exceeded (4.2 BSD).  */
+#define SIGXFSZ		31	/* File size limit exceeded (4.2 BSD).  */
+
+/* Biggest signal number + 1 (including real-time signals).  */
+#define _NSIG		129
+
+#endif	/* <signal.h> included.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigstack.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigstack.h
new file mode 100644
index 0000000..64643d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/sigstack.h
@@ -0,0 +1,57 @@
+/* sigstack, sigaltstack definitions.
+   Copyright (C) 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.  */
+
+#ifndef _SIGNAL_H
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+
+#if defined __UCLIBC_SUSV4_LEGACY__ || !defined __UCLIBC_STRICT_HEADERS__
+/* Structure describing a signal stack (obsolete).  */
+struct sigstack
+  {
+    void *ss_sp;		/* Signal stack pointer.  */
+    int ss_onstack;		/* Nonzero if executing on this stack.  */
+  };
+#endif
+
+
+/* Possible values for `ss_flags.'.  */
+enum
+{
+  SS_ONSTACK = 1,
+#define SS_ONSTACK	SS_ONSTACK
+  SS_DISABLE
+#define SS_DISABLE	SS_DISABLE
+};
+
+/* Minimum stack size for a signal handler.  */
+#define MINSIGSTKSZ	2048
+
+/* System default stack size.  */
+#define SIGSTKSZ	8192
+
+
+/* Alternate, preferred interface.  */
+typedef struct sigaltstack
+  {
+    void *ss_sp;
+    size_t ss_size;
+    int ss_flags;
+  } stack_t;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/socket.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/socket.h
new file mode 100644
index 0000000..27ceafa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/socket.h
@@ -0,0 +1,369 @@
+/* System-specific socket constants and types.  Linux/MIPS version.
+   Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 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.  */
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H
+
+#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+#define	__need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#include <limits.h>
+#include <sys/types.h>
+
+/* Type for length arguments in socket calls.  */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+/* Types of sockets.  */
+enum __socket_type
+{
+  SOCK_DGRAM = 1,		/* Connectionless, unreliable datagrams
+				   of fixed maximum length.  */
+#define SOCK_DGRAM SOCK_DGRAM
+  SOCK_STREAM = 2,		/* Sequenced, reliable, connection-based
+				   byte streams.  */
+#define SOCK_STREAM SOCK_STREAM
+  SOCK_RAW = 3,			/* Raw protocol interface.  */
+#define SOCK_RAW SOCK_RAW
+  SOCK_RDM = 4,			/* Reliably-delivered messages.  */
+#define SOCK_RDM SOCK_RDM
+  SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based,
+				   datagrams of fixed maximum length.  */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+  SOCK_DCCP = 6,
+#define SOCK_DCCP SOCK_DCCP	/* Datagram Congestion Control Protocol.  */
+  SOCK_PACKET = 10,		/* Linux specific way of getting packets
+				   at the dev level.  For writing rarp and
+				   other similar things on the user level. */
+#define SOCK_PACKET SOCK_PACKET
+  /* Flags to be ORed into the type parameter of socket and socketpair and
+     used for the flags parameter of paccept.  */
+
+  SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the
+                                   new descriptor(s).  */
+#define SOCK_CLOEXEC SOCK_CLOEXEC
+  SOCK_NONBLOCK = 0200		/* Atomically mark descriptor(s) as
+				   non-blocking.  */
+#define SOCK_NONBLOCK SOCK_NONBLOCK
+};
+
+/* Protocol families.  */
+#define	PF_UNSPEC	0	/* Unspecified.  */
+#define	PF_LOCAL	1	/* Local to host (pipes and file-domain).  */
+#define	PF_UNIX		PF_LOCAL /* Old BSD name for PF_LOCAL.  */
+#define	PF_FILE		PF_LOCAL /* Another non-standard name for PF_LOCAL.  */
+#define	PF_INET		2	/* IP protocol family.  */
+#define	PF_AX25		3	/* Amateur Radio AX.25.  */
+#define	PF_IPX		4	/* Novell Internet Protocol.  */
+#define	PF_APPLETALK	5	/* Appletalk DDP.  */
+#define	PF_NETROM	6	/* Amateur radio NetROM.  */
+#define	PF_BRIDGE	7	/* Multiprotocol bridge.  */
+#define	PF_ATMPVC	8	/* ATM PVCs.  */
+#define	PF_X25		9	/* Reserved for X.25 project.  */
+#define	PF_INET6	10	/* IP version 6.  */
+#define	PF_ROSE		11	/* Amateur Radio X.25 PLP.  */
+#define	PF_DECnet	12	/* Reserved for DECnet project.  */
+#define	PF_NETBEUI	13	/* Reserved for 802.2LLC project.  */
+#define	PF_SECURITY	14	/* Security callback pseudo AF.  */
+#define	PF_KEY		15	/* PF_KEY key management API.  */
+#define	PF_NETLINK	16
+#define	PF_ROUTE	PF_NETLINK /* Alias to emulate 4.4BSD.  */
+#define	PF_PACKET	17	/* Packet family.  */
+#define	PF_ASH		18	/* Ash.  */
+#define	PF_ECONET	19	/* Acorn Econet.  */
+#define	PF_ATMSVC	20	/* ATM SVCs.  */
+#define	PF_SNA		22	/* Linux SNA Project */
+#define	PF_IRDA		23	/* IRDA sockets.  */
+#define	PF_PPPOX	24	/* PPPoX sockets.  */
+#define	PF_WANPIPE	25	/* Wanpipe API sockets.  */
+#define	PF_LLC		26	/* Linux LLC.  */
+#define	PF_CAN		29	/* Controller Area Network.  */
+#define	PF_TIPC		30	/* TIPC sockets.  */
+#define	PF_BLUETOOTH	31	/* Bluetooth sockets.  */
+#define	PF_IUCV		32	/* IUCV sockets.  */
+#define	PF_RXRPC	33	/* RxRPC sockets.  */
+#define	PF_ISDN		34	/* mISDN sockets.  */
+#define	PF_PHONET	35	/* Phonet sockets.  */
+#define	PF_IEEE802154	36	/* IEEE 802.15.4 sockets.  */
+#define	PF_CAIF		37	/* CAIF sockets.  */
+#define	PF_ALG		38	/* Algorithm sockets.  */
+#define	PF_MAX		39	/* For now..  */
+
+/* Address families.  */
+#define	AF_UNSPEC	PF_UNSPEC
+#define	AF_LOCAL	PF_LOCAL
+#define	AF_UNIX		PF_UNIX
+#define	AF_FILE		PF_FILE
+#define	AF_INET		PF_INET
+#define	AF_AX25		PF_AX25
+#define	AF_IPX		PF_IPX
+#define	AF_APPLETALK	PF_APPLETALK
+#define	AF_NETROM	PF_NETROM
+#define	AF_BRIDGE	PF_BRIDGE
+#define	AF_ATMPVC	PF_ATMPVC
+#define	AF_X25		PF_X25
+#define	AF_INET6	PF_INET6
+#define	AF_ROSE		PF_ROSE
+#define	AF_DECnet	PF_DECnet
+#define	AF_NETBEUI	PF_NETBEUI
+#define	AF_SECURITY	PF_SECURITY
+#define	AF_KEY		PF_KEY
+#define	AF_NETLINK	PF_NETLINK
+#define	AF_ROUTE	PF_ROUTE
+#define	AF_PACKET	PF_PACKET
+#define	AF_ASH		PF_ASH
+#define	AF_ECONET	PF_ECONET
+#define	AF_ATMSVC	PF_ATMSVC
+#define	AF_SNA		PF_SNA
+#define	AF_IRDA		PF_IRDA
+#define	AF_PPPOX	PF_PPPOX
+#define	AF_WANPIPE	PF_WANPIPE
+#define	AF_LLC		PF_LLC
+#define	AF_CAN		PF_CAN
+#define	AF_TIPC		PF_TIPC
+#define	AF_BLUETOOTH	PF_BLUETOOTH
+#define	AF_IUCV		PF_IUCV
+#define	AF_RXRPC	PF_RXRPC
+#define	AF_ISDN		PF_ISDN
+#define	AF_PHONET	PF_PHONET
+#define	AF_IEEE802154	PF_IEEE802154
+#define	AF_CAIF		PF_CAIF
+#define	AF_ALG		PF_ALG
+#define	AF_MAX		PF_MAX
+
+/* Socket level values.  Others are defined in the appropriate headers.
+
+   XXX These definitions also should go into the appropriate headers as
+   far as they are available.  */
+#define SOL_RAW		255
+#define SOL_DECNET      261
+#define SOL_X25         262
+#define SOL_PACKET	263
+#define SOL_ATM		264	/* ATM layer (cell level).  */
+#define SOL_AAL		265	/* ATM Adaption Layer (packet level).  */
+#define SOL_IRDA	266
+
+/* Maximum queue length specifiable by listen.  */
+#define SOMAXCONN	128
+
+/* Get the definition of the macro to define the common sockaddr members.  */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address.  */
+struct sockaddr
+  {
+    __SOCKADDR_COMMON (sa_);	/* Common data: address family and length.  */
+    char sa_data[14];		/* Address data.  */
+  };
+
+
+/* Structure large enough to hold any socket address (with the historical
+   exception of AF_UNIX).  We reserve 128 bytes.  */
+#define __ss_aligntype	unsigned long int
+#define _SS_SIZE	128
+#define _SS_PADSIZE	(_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (ss_);	/* Address family, etc.  */
+    __ss_aligntype __ss_align;	/* Force desired alignment.  */
+    char __ss_padding[_SS_PADSIZE];
+  };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al.  */
+enum
+  {
+    MSG_OOB		= 0x01,	/* Process out-of-band data.  */
+#define MSG_OOB		MSG_OOB
+    MSG_PEEK		= 0x02,	/* Peek at incoming messages.  */
+#define MSG_PEEK	MSG_PEEK
+    MSG_DONTROUTE	= 0x04,	/* Don't use local routing.  */
+#define MSG_DONTROUTE	MSG_DONTROUTE
+#ifdef __USE_GNU
+    /* DECnet uses a different name.  */
+    MSG_TRYHARD		= MSG_DONTROUTE,
+# define MSG_TRYHARD	MSG_DONTROUTE
+#endif
+    MSG_CTRUNC		= 0x08,	/* Control data lost before delivery.  */
+#define MSG_CTRUNC	MSG_CTRUNC
+    MSG_PROXY		= 0x10,	/* Supply or ask second address.  */
+#define MSG_PROXY	MSG_PROXY
+    MSG_TRUNC		= 0x20,
+#define	MSG_TRUNC	MSG_TRUNC
+    MSG_DONTWAIT	= 0x40, /* Nonblocking IO.  */
+#define	MSG_DONTWAIT	MSG_DONTWAIT
+    MSG_EOR		= 0x80, /* End of record.  */
+#define	MSG_EOR		MSG_EOR
+    MSG_WAITALL		= 0x100, /* Wait for a full request.  */
+#define	MSG_WAITALL	MSG_WAITALL
+    MSG_FIN		= 0x200,
+#define	MSG_FIN		MSG_FIN
+    MSG_SYN		= 0x400,
+#define	MSG_SYN		MSG_SYN
+    MSG_CONFIRM		= 0x800, /* Confirm path validity.  */
+#define	MSG_CONFIRM	MSG_CONFIRM
+    MSG_RST		= 0x1000,
+#define	MSG_RST		MSG_RST
+    MSG_ERRQUEUE	= 0x2000, /* Fetch message from error queue.  */
+#define	MSG_ERRQUEUE	MSG_ERRQUEUE
+    MSG_NOSIGNAL	= 0x4000, /* Do not generate SIGPIPE.  */
+#define	MSG_NOSIGNAL	MSG_NOSIGNAL
+    MSG_MORE		= 0x8000, /* Sender will send more.  */
+#define	MSG_MORE	MSG_MORE
+    MSG_WAITFORONE      = 0x10000, /* Wait for at least one packet to return.*/
+#define MSG_WAITFORONE  MSG_WAITFORONE
+
+    MSG_CMSG_CLOEXEC    = 0x40000000    /* Set close_on_exit for file
+					   descriptor received through
+					   SCM_RIGHTS.  */
+#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
+  };
+
+
+/* Structure describing messages sent by
+   `sendmsg' and received by `recvmsg'.  */
+/* Note: do not change these members to match glibc; these match the
+   SuSv3 spec already (e.g. msg_iovlen/msg_controllen).
+   http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html */
+/* Note: linux kernel uses __kernel_size_t (which is 8bytes on 64bit
+   platforms, and 4bytes on 32bit platforms) for msg_iovlen/msg_controllen */
+struct msghdr
+  {
+    void *msg_name;		/* Address to send to/receive from.  */
+    socklen_t msg_namelen;	/* Length of address data.  */
+
+    struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
+#if __WORDSIZE == 32
+    int msg_iovlen;		/* Number of elements in the vector.  */
+#else
+    size_t msg_iovlen;		/* Number of elements in the vector.  */
+#endif
+
+    void *msg_control;		/* Ancillary data (eg BSD filedesc passing). */
+#if __WORDSIZE == 32
+    socklen_t msg_controllen;	/* Ancillary data buffer length.  */
+#else
+    size_t msg_controllen;	/* Ancillary data buffer length.  */
+#endif
+
+    int msg_flags;		/* Flags on received message.  */
+  };
+
+/* Structure used for storage of ancillary data object information.  */
+struct cmsghdr
+  {
+    size_t cmsg_len;		/* Length of data in cmsg_data plus length
+				   of cmsghdr structure.  */
+    int cmsg_level;		/* Originating protocol.  */
+    int cmsg_type;		/* Protocol specific type.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+    __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data.  */
+#endif
+  };
+
+/* Ancillary data object manipulation macros.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
+#endif
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+#define CMSG_FIRSTHDR(mhdr) \
+  ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)		      \
+   ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
+			 & (size_t) ~(sizeof (size_t) - 1))
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+				      struct cmsghdr *__cmsg) __THROW;
+libc_hidden_proto(__cmsg_nxthdr)
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+#  define _EXTERN_INLINE extern __inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+{
+  if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+    /* The kernel header does this so there may be a reason.  */
+    return 0;
+
+  __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+			       + CMSG_ALIGN (__cmsg->cmsg_len));
+  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+					+ __mhdr->msg_controllen)
+      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+    /* No more entries.  */
+    return 0;
+  return __cmsg;
+}
+#endif	/* Use `extern inline'.  */
+
+/* Socket level message types.  This must match the definitions in
+   <linux/socket.h>.  */
+enum
+  {
+    SCM_RIGHTS = 0x01		/* Transfer file descriptors.  */
+#define SCM_RIGHTS SCM_RIGHTS
+#ifdef __USE_BSD
+    , SCM_CREDENTIALS = 0x02	/* Credentials passing.  */
+# define SCM_CREDENTIALS SCM_CREDENTIALS
+#endif
+  };
+
+/* User visible structure for SCM_CREDENTIALS message */
+
+struct ucred
+{
+  pid_t pid;			/* PID of sending process.  */
+  uid_t uid;			/* UID of sending process.  */
+  gid_t gid;			/* GID of sending process.  */
+};
+
+/* Get socket manipulation related informations from kernel headers.  */
+#ifndef __GLIBC__
+#define __GLIBC__ 2
+#include <asm/socket.h>
+#undef __GLIBC__
+#else
+#include <asm/socket.h>
+#endif
+
+
+/* Structure used to manipulate the SO_LINGER option.  */
+struct linger
+  {
+    int l_onoff;		/* Nonzero to linger on close.  */
+    int l_linger;		/* Time to linger.  */
+  };
+
+#endif	/* bits/socket.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/stackinfo.h
new file mode 100644
index 0000000..86e3d62
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On MIPS the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/stat.h
new file mode 100644
index 0000000..b9e6bf4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/stat.h
@@ -0,0 +1,254 @@
+/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004,
+	2007, 2009 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_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+#include <sgidefs.h>
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_LINUX_OLD	1
+#define _STAT_VER_KERNEL	1
+#define _STAT_VER_SVR4		2
+#define _STAT_VER_LINUX		3
+#define _STAT_VER		_STAT_VER_LINUX /* The one defined below.  */
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	1
+#define _MKNOD_VER_SVR4		2
+#define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below.  */
+
+
+#if _MIPS_SIM == _ABIO32
+/* Structure describing file characteristics.  */
+struct stat
+  {
+	__dev_t st_dev;
+    long int st_pad1[2];
+#ifndef __USE_FILE_OFFSET64
+    __ino_t st_ino;		/* File serial number.		*/
+#else
+    __ino64_t st_ino;		/* File serial number.		*/
+#endif
+    __mode_t st_mode;		/* File mode.  */
+    __nlink_t st_nlink;		/* Link count.  */
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
+    __dev_t st_rdev;	/* Device number, if device.  */
+#ifndef __USE_FILE_OFFSET64
+    long int st_pad2[1];
+    __off_t st_size;		/* Size of file, in bytes.  */
+    /* SVR4 added this extra long to allow for expansion of off_t.  */
+    long int st_pad3;
+#else
+    long int st_pad2[2];
+    __off64_t st_size;		/* Size of file, in bytes.  */
+#endif
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;            /* Time of last access.  */
+    struct timespec st_mtim;            /* Time of last modification.  */
+    struct timespec st_ctim;            /* Time of last status change.  */
+# define st_atime st_atim.tv_sec        /* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;		/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;		/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;		/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+#ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.  */
+#else
+    long int st_pad4;
+    __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated.  */
+#endif
+    long int st_pad5[14];
+  };
+#else /* N32 || N64 */
+/* The memory layout is the same as of struct stat64 of the 32-bit kernel.  */
+struct stat {
+    unsigned int st_dev;
+    int st_pad1[3];
+    __ino_t st_ino;		/* File serial number.		*/
+    __mode_t st_mode;		/* File mode.  */
+    __nlink_t st_nlink;		/* Link count.  */
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
+    unsigned int st_rdev;	/* Device number, if device.  */
+    int st_pad2[3];
+    __off_t st_size;		/* Size of file, in bytes.  */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;            /* Time of last access.  */
+    struct timespec st_mtim;            /* Time of last modification.  */
+    struct timespec st_ctim;            /* Time of last status change.  */
+# define st_atime st_atim.tv_sec        /* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    int st_atime;
+    int st_atimensec;
+    int st_mtime;
+    int st_mtimensec;
+    int st_ctime;
+    int st_ctimensec;
+#endif
+    int st_blksize;	/* Optimal block size for I/O.  */
+    int st_pad3;
+    __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.  */
+    int st_pad4[14];
+};
+#endif /* N32 || N64 */
+
+#ifdef __USE_LARGEFILE64
+#if _MIPS_SIM == _ABIO32
+struct stat64
+  {
+    __dev_t st_dev;
+    long int st_pad1[2];
+    __ino64_t st_ino;		/* File serial number.		*/
+    __mode_t st_mode;		/* File mode.  */
+    __nlink_t st_nlink;		/* Link count.  */
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
+    __dev_t st_rdev;	/* Device number, if device.  */
+    long int st_pad2[2];
+    __off64_t st_size;		/* Size of file, in bytes.  */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;            /* Time of last access.  */
+    struct timespec st_mtim;            /* Time of last modification.  */
+    struct timespec st_ctim;            /* Time of last status change.  */
+# define st_atime st_atim.tv_sec        /* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;		/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;		/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;		/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+    long int st_pad3;
+    __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated.  */
+    long int st_pad4[14];
+  };
+#else	/* N32 || N64 */
+/* stat64 of N32/N64 is just an alias of stat syscall. */
+struct stat64 {
+    unsigned int st_dev;
+    int st_pad1[3];
+    __ino_t st_ino;		/* File serial number.		*/
+    __mode_t st_mode;		/* File mode.  */
+    __nlink_t st_nlink;		/* Link count.  */
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
+    unsigned int st_rdev;	/* Device number, if device.  */
+    int st_pad2[3];
+    __off_t st_size;		/* Size of file, in bytes.  */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;            /* Time of last access.  */
+    struct timespec st_mtim;            /* Time of last modification.  */
+    struct timespec st_ctim;            /* Time of last status change.  */
+# define st_atime st_atim.tv_sec        /* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    int st_atime;
+    int st_atimensec;
+    int st_mtime;
+    int st_mtimensec;
+    int st_ctime;
+    int st_ctimensec;
+#endif
+    int st_blksize;	/* Optimal block size for I/O.  */
+    int st_pad3;
+    __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.  */
+    int st_pad4[14];
+};
+#endif	/* N32 || N64 */
+#endif
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define	_STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/statfs.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/statfs.h
new file mode 100644
index 0000000..2f9bd54
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/statfs.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 1997, 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 _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
+
+#include <bits/types.h>  /* for __fsid_t and __fsblkcnt_t*/
+
+struct statfs
+  {
+    long int f_type;
+#define f_fstyp f_type
+    long int f_bsize;
+    long int f_frsize;	/* Fragment size - unsupported */
+#ifndef __USE_FILE_OFFSET64
+    __fsblkcnt_t f_blocks;
+    __fsblkcnt_t f_bfree;
+    __fsblkcnt_t f_files;
+    __fsblkcnt_t f_ffree;
+    __fsblkcnt_t f_bavail;
+#else
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_files;
+    __fsblkcnt64_t f_ffree;
+    __fsblkcnt64_t f_bavail;
+#endif
+
+	/* Linux specials */
+    __fsid_t f_fsid;
+    long int f_namelen;
+    long int f_spare[6];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+  {
+    long int f_type;
+#define f_fstyp f_type
+    long int f_bsize;
+    long int f_frsize;	/* Fragment size - unsupported */
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_files;
+    __fsblkcnt64_t f_ffree;
+    __fsblkcnt64_t f_bavail;
+
+	/* Linux specials */
+    __fsid_t f_fsid;
+    long int f_namelen;
+    long int f_spare[6];
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define _STATFS_F_NAMELEN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/syscalls.h
new file mode 100644
index 0000000..944d038
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/syscalls.h
@@ -0,0 +1,326 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#include <sgidefs.h>
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+/*
+ * Import from:
+ *	glibc-ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+ *	glibc-ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+ *	glibc-ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+ */
+
+/* Define a macro which expands into the inline wrapper code for a system
+   call.  */
+#define INLINE_SYSCALL(name, nr, args...)                               \
+  ({ INTERNAL_SYSCALL_DECL(err);					\
+     long result_var = INTERNAL_SYSCALL(name, err, nr, args);		\
+     if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) )			\
+       {								\
+	 __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err));	\
+	 result_var = -1L;						\
+       }								\
+     result_var; })
+
+#define INTERNAL_SYSCALL_DECL(err) long err
+
+#define INTERNAL_SYSCALL_ERROR_P(val, err)   ((long) (err))
+
+#define INTERNAL_SYSCALL_ERRNO(val, err)     (val)
+
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+	internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t",	\
+			      "i" (SYS_ify (name)), err, args)
+
+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+	internal_syscall##nr (= number, , "r" (__v0), err, args)
+
+#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABI64
+# define ARG_TYPE long
+#else
+# define ARG_TYPE long long
+#endif
+
+#define internal_syscall0(ncs_init, cs_init, input, err, dummy...)	\
+({									\
+	long _sys_result;						\
+									\
+	{								\
+	register ARG_TYPE __v0 __asm__("$2") ncs_init;			\
+	register ARG_TYPE __a3 __asm__("$7");				\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	".set reorder"							\
+	: "=r" (__v0), "=r" (__a3)					\
+	: input								\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#define internal_syscall1(ncs_init, cs_init, input, err, arg1)		\
+({									\
+	long _sys_result;						\
+									\
+	{								\
+	register ARG_TYPE __v0 __asm__("$2") ncs_init;			\
+	register ARG_TYPE __a0 __asm__("$4") = (ARG_TYPE) arg1;		\
+	register ARG_TYPE __a3 __asm__("$7");				\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	".set reorder"							\
+	: "=r" (__v0), "=r" (__a3)					\
+	: input, "r" (__a0)						\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2)	\
+({									\
+	long _sys_result;						\
+									\
+	{								\
+	register ARG_TYPE __v0 __asm__("$2") ncs_init;			\
+	register ARG_TYPE __a0 __asm__("$4") = (ARG_TYPE) arg1;		\
+	register ARG_TYPE __a1 __asm__("$5") = (ARG_TYPE) arg2;		\
+	register ARG_TYPE __a3 __asm__("$7");				\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	".set\treorder"						\
+	: "=r" (__v0), "=r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1)					\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3)\
+({									\
+	long _sys_result;						\
+									\
+	{								\
+	register ARG_TYPE __v0 __asm__("$2") ncs_init;			\
+	register ARG_TYPE __a0 __asm__("$4") = (ARG_TYPE) arg1;		\
+	register ARG_TYPE __a1 __asm__("$5") = (ARG_TYPE) arg2;		\
+	register ARG_TYPE __a2 __asm__("$6") = (ARG_TYPE) arg3;		\
+	register ARG_TYPE __a3 __asm__("$7");				\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	".set\treorder"						\
+	: "=r" (__v0), "=r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4)\
+({									\
+	long _sys_result;						\
+									\
+	{								\
+	register ARG_TYPE __v0 __asm__("$2") ncs_init;			\
+	register ARG_TYPE __a0 __asm__("$4") = (ARG_TYPE) arg1;		\
+	register ARG_TYPE __a1 __asm__("$5") = (ARG_TYPE) arg2;		\
+	register ARG_TYPE __a2 __asm__("$6") = (ARG_TYPE) arg3;		\
+	register ARG_TYPE __a3 __asm__("$7") = (ARG_TYPE) arg4;		\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	".set\treorder"						\
+	: "=r" (__v0), "+r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#if _MIPS_SIM == _ABIO32
+#include <alloca.h>
+/* We need to use a frame pointer for the functions in which we
+   adjust $sp around the syscall, or debug information and unwind
+   information will be $sp relative and thus wrong during the syscall.  As
+   of GCC 3.4.3, this is sufficient.  */
+#define FORCE_FRAME_POINTER alloca (4)
+
+#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5)\
+({									\
+	long _sys_result;						\
+									\
+	FORCE_FRAME_POINTER;						\
+	{								\
+	register long __v0 __asm__("$2") ncs_init;			\
+	register long __a0 __asm__("$4") = (long) arg1;			\
+	register long __a1 __asm__("$5") = (long) arg2;			\
+	register long __a2 __asm__("$6") = (long) arg3;			\
+	register long __a3 __asm__("$7") = (long) arg4;			\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	"subu\t$29, 32\n\t"						\
+	"sw\t%6, 16($29)\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	"addiu\t$29, 32\n\t"						\
+	".set\treorder"						\
+	: "=r" (__v0), "+r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2),			\
+	  "r" ((long)arg5)						\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6)\
+({									\
+	long _sys_result;						\
+									\
+	FORCE_FRAME_POINTER;						\
+	{								\
+	register long __v0 __asm__("$2") ncs_init;			\
+	register long __a0 __asm__("$4") = (long) arg1;			\
+	register long __a1 __asm__("$5") = (long) arg2;			\
+	register long __a2 __asm__("$6") = (long) arg3;			\
+	register long __a3 __asm__("$7") = (long) arg4;			\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	"subu\t$29, 32\n\t"						\
+	"sw\t%6, 16($29)\n\t"						\
+	"sw\t%7, 20($29)\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	"addiu\t$29, 32\n\t"						\
+	".set\treorder"						\
+	: "=r" (__v0), "+r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2),			\
+	  "r" ((long)arg5), "r" ((long)arg6)				\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#define internal_syscall7(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\
+({									\
+	long _sys_result;						\
+									\
+	FORCE_FRAME_POINTER;						\
+	{								\
+	register long __v0 __asm__("$2") ncs_init;			\
+	register long __a0 __asm__("$4") = (long) arg1;			\
+	register long __a1 __asm__("$5") = (long) arg2;			\
+	register long __a2 __asm__("$6") = (long) arg3;			\
+	register long __a3 __asm__("$7") = (long) arg4;			\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	"subu\t$29, 32\n\t"						\
+	"sw\t%6, 16($29)\n\t"						\
+	"sw\t%7, 20($29)\n\t"						\
+	"sw\t%8, 24($29)\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	"addiu\t$29, 32\n\t"						\
+	".set\treorder"						\
+	: "=r" (__v0), "+r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2),			\
+	  "r" ((long)arg5), "r" ((long)arg6), "r" ((long)arg7)		\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", \
+	"$14", "$15", "$24", "$25", "hi", "lo", "memory"
+
+#else /* N32 || N64 */
+
+#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \
+({ 									\
+	long _sys_result;						\
+									\
+	{								\
+	register ARG_TYPE __v0 __asm__("$2") ncs_init;			\
+	register ARG_TYPE __a0 __asm__("$4") = (ARG_TYPE) arg1; 	\
+	register ARG_TYPE __a1 __asm__("$5") = (ARG_TYPE) arg2; 	\
+	register ARG_TYPE __a2 __asm__("$6") = (ARG_TYPE) arg3; 	\
+	register ARG_TYPE __a3 __asm__("$7") = (ARG_TYPE) arg4; 	\
+	register ARG_TYPE __a4 __asm__("$8") = (ARG_TYPE) arg5; 	\
+	__asm__ __volatile__ ( 						\
+	".set\tnoreorder\n\t" 						\
+	cs_init								\
+	"syscall\n\t" 							\
+	".set\treorder" 						\
+	: "=r" (__v0), "+r" (__a3) 					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4)		\
+	: __SYSCALL_CLOBBERS); 						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \
+({ 									\
+	long _sys_result;						\
+									\
+	{								\
+	register ARG_TYPE __v0 __asm__("$2") ncs_init;			\
+	register ARG_TYPE __a0 __asm__("$4") = (ARG_TYPE) arg1; 	\
+	register ARG_TYPE __a1 __asm__("$5") = (ARG_TYPE) arg2; 	\
+	register ARG_TYPE __a2 __asm__("$6") = (ARG_TYPE) arg3; 	\
+	register ARG_TYPE __a3 __asm__("$7") = (ARG_TYPE) arg4; 	\
+	register ARG_TYPE __a4 __asm__("$8") = (ARG_TYPE) arg5; 	\
+	register ARG_TYPE __a5 __asm__("$9") = (ARG_TYPE) arg6; 	\
+	__asm__ __volatile__ ( 						\
+	".set\tnoreorder\n\t" 						\
+	cs_init								\
+	"syscall\n\t" 							\
+	".set\treorder" 						\
+	: "=r" (__v0), "+r" (__a3) 					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4),	\
+	  "r" (__a5)							\
+	: __SYSCALL_CLOBBERS); 						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
+	"$14", "$15", "$24", "$25", "hi", "lo", "memory"
+
+#endif
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/termios.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/termios.h
new file mode 100644
index 0000000..fb35199
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/termios.h
@@ -0,0 +1,218 @@
+/* termios type and macro definitions.  Linux/MIPS version.
+   Copyright (C) 1993, 94, 95, 96, 97, 99 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 _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char	cc_t;
+typedef unsigned int	speed_t;
+typedef unsigned int	tcflag_t;
+
+#define NCCS 32
+struct termios
+  {
+    tcflag_t c_iflag;		/* input mode flags */
+    tcflag_t c_oflag;		/* output mode flags */
+    tcflag_t c_cflag;		/* control mode flags */
+    tcflag_t c_lflag;		/* local mode flags */
+    cc_t c_line;		/* line discipline */
+    cc_t c_cc[NCCS];		/* control characters */
+  };
+
+/* c_cc characters */
+#define VINTR		0	/* Interrupt character [ISIG].  */
+#define VQUIT		1	/* Quit character [ISIG].  */
+#define VERASE		2	/* Erase character [ICANON].  */
+#define VKILL		3	/* Kill-line character [ICANON].  */
+#define VMIN		4	/* Minimum number of bytes read at once [!ICANON].  */
+#define VTIME		5	/* Time-out value (tenths of a second) [!ICANON].  */
+#define VEOL2		6	/* Second EOL character [ICANON].  */
+#define VSWTC		7
+#define VSWTCH		VSWTC
+#define VSTART		8	/* Start (X-ON) character [IXON, IXOFF].  */
+#define VSTOP		9	/* Stop (X-OFF) character [IXON, IXOFF].  */
+#define VSUSP		10	/* Suspend character [ISIG].  */
+				/* VDSUSP is not supported on Linux. */
+/* #define VDSUSP	11	/ * Delayed suspend character [ISIG].  */
+#define VREPRINT	12	/* Reprint-line character [ICANON].  */
+#define VDISCARD	13	/* Discard character [IEXTEN].  */
+#define VWERASE		14	/* Word-erase character [ICANON].  */
+#define VLNEXT		15	/* Literal-next character [IEXTEN].  */
+#define VEOF		16	/* End-of-file character [ICANON].  */
+#define VEOL		17	/* End-of-line character [ICANON].  */
+
+/* c_iflag bits */
+#define IGNBRK	0000001		/* Ignore break condition.  */
+#define BRKINT	0000002		/* Signal interrupt on break.  */
+#define IGNPAR	0000004		/* Ignore characters with parity errors.  */
+#define PARMRK	0000010		/* Mark parity and framing errors.  */
+#define INPCK	0000020		/* Enable input parity check.  */
+#define ISTRIP	0000040		/* Strip 8th bit off characters.  */
+#define INLCR	0000100		/* Map NL to CR on input.  */
+#define IGNCR	0000200		/* Ignore CR.  */
+#define ICRNL	0000400		/* Map CR to NL on input.  */
+#define IUCLC	0001000		/* Map upper case to lower case on input.  */
+#define IXON	0002000		/* Enable start/stop output control.  */
+#define IXANY	0004000		/* Any character will restart after stop.  */
+#define IXOFF	0010000		/* Enable start/stop input control.  */
+#define IMAXBEL 0020000		/* Ring bell when input queue is full.  */
+#define IUTF8   0040000		/* Input is UTF8.  */
+
+/* c_oflag bits */
+#define OPOST	0000001		/* Perform output processing.  */
+#define OLCUC	0000002		/* Map lower case to upper case on output.  */
+#define ONLCR	0000004		/* Map NL to CR-NL on output.  */
+#define OCRNL	0000010
+#define ONOCR	0000020
+#define ONLRET	0000040
+#define OFILL	0000100
+#define OFDEL	0000200
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY	0000400
+# define   NL0	0000000
+# define   NL1	0000400
+# define CRDLY	0003000
+# define   CR0	0000000
+# define   CR1	0001000
+# define   CR2	0002000
+# define   CR3	0003000
+# define TABDLY	0014000
+# define   TAB0	0000000
+# define   TAB1	0004000
+# define   TAB2	0010000
+# define   TAB3	0014000
+# define BSDLY	0020000
+# define   BS0	0000000
+# define   BS1	0020000
+# define FFDLY	0100000
+# define   FF0	0000000
+# define   FF1	0100000
+#endif
+
+#define VTDLY	0040000
+#define   VT0	0000000
+#define   VT1	0040000
+
+#ifdef __USE_MISC
+# define XTABS  0014000
+#endif
+
+/* c_cflag bit meaning */
+#ifdef __USE_MISC
+# define CBAUD	0010017
+#endif
+#define  B0	0000000		/* hang up */
+#define  B50	0000001
+#define  B75	0000002
+#define  B110	0000003
+#define  B134	0000004
+#define  B150	0000005
+#define  B200	0000006
+#define  B300	0000007
+#define  B600	0000010
+#define  B1200	0000011
+#define  B1800	0000012
+#define  B2400	0000013
+#define  B4800	0000014
+#define  B9600	0000015
+#define  B19200	0000016
+#define  B38400	0000017
+#ifdef __USE_MISC
+# define EXTA B19200
+# define EXTB B38400
+#endif
+#define CSIZE	0000060		/* Number of bits per byte (mask).  */
+#define   CS5	0000000		/* 5 bits per byte.  */
+#define   CS6	0000020		/* 6 bits per byte.  */
+#define   CS7	0000040		/* 7 bits per byte.  */
+#define   CS8	0000060		/* 8 bits per byte.  */
+#define CSTOPB	0000100		/* Two stop bits instead of one.  */
+#define CREAD	0000200		/* Enable receiver.  */
+#define PARENB	0000400		/* Parity enable.  */
+#define PARODD	0001000		/* Odd parity instead of even.  */
+#define HUPCL	0002000		/* Hang up on last close.  */
+#define CLOCAL	0004000		/* Ignore modem status lines.  */
+#ifdef __USE_MISC
+# define CBAUDEX   0010000
+#endif
+#define  B57600   0010001
+#define  B115200  0010002
+#define  B230400  0010003
+#define  B460800  0010004
+#define  B500000  0010005
+#define  B576000  0010006
+#define  B921600  0010007
+#define  B1000000 0010010
+#define  B1152000 0010011
+#define  B1500000 0010012
+#define  B2000000 0010013
+#define  B2500000 0010014
+#define  B3000000 0010015
+#define  B3500000 0010016
+#define  B4000000 0010017
+#define __MAX_BAUD B4000000
+#ifdef __USE_MISC
+# define CIBAUD	  002003600000	/* input baud rate (not used) */
+# define CRTSCTS  020000000000		/* flow control */
+#endif
+
+/* c_lflag bits */
+#define ISIG	0000001		/* Enable signals.  */
+#define ICANON	0000002		/* Do erase and kill processing.  */
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE	0000004
+#endif
+#define ECHO	0000010		/* Enable echo.  */
+#define ECHOE	0000020		/* Visual erase for ERASE.  */
+#define ECHOK	0000040		/* Echo NL after KILL.  */
+#define ECHONL	0000100		/* Echo NL even if ECHO is off.  */
+#define NOFLSH	0000200		/* Disable flush after interrupt.  */
+#define IEXTEN	0000400		/* Enable DISCARD and LNEXT.  */
+#ifdef __USE_MISC
+# define ECHOCTL 0001000	/* Echo control characters as ^X.  */
+# define ECHOPRT 0002000	/* Hardcopy visual erase.  */
+# define ECHOKE	 0004000	/* Visual erase for KILL.  */
+# define FLUSHO	0020000
+# define PENDIN	0040000		/* Retype pending input (state).  */
+#endif
+#define TOSTOP	0100000		/* Send SIGTTOU for background output.  */
+#define ITOSTOP	TOSTOP
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+#define TIOCSER_TEMT    0x01	/* Transmitter physically empty */
+
+/* tcflow() and TCXONC use these */
+#define	TCOOFF		0	/* Suspend output.  */
+#define	TCOON		1	/* Restart suspended output.  */
+#define	TCIOFF		2	/* Send a STOP character.  */
+#define	TCION		3	/* Send a START character.  */
+
+/* tcflush() and TCFLSH use these */
+#define	TCIFLUSH	0	/* Discard data received but not yet read.  */
+#define	TCOFLUSH	1	/* Discard data written but not yet sent.  */
+#define	TCIOFLUSH	2	/* Discard all pending data.  */
+
+/* tcsetattr uses these */
+#define	TCSANOW		0x540e	/* Same as TCSETS; change immediately.  */
+#define	TCSADRAIN	0x540f	/* Same as TCSETSW; change when pending output is written.  */
+#define	TCSAFLUSH	0x5410	/* Same as TCSETSF; flush pending input before changing.  */
+
+#define _IOT_termios /* Hurd ioctl type field.  */ \
+  _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/timerfd.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/timerfd.h
new file mode 100644
index 0000000..032735d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/timerfd.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2008-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_TIMERFD_H
+# error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead."
+#endif
+
+/* Bits to be set in the FLAGS parameter of `timerfd_create'.  */
+enum
+  {
+    TFD_CLOEXEC = 02000000,
+#define TFD_CLOEXEC TFD_CLOEXEC
+    TFD_NONBLOCK = 00000200
+#define TFD_NONBLOCK TFD_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..82f67bf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/uClibc_arch_features.h
@@ -0,0 +1,47 @@
+/*
+ * 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__ "break 255"
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#define __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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 ? */
+#undef __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/mips/bits/uClibc_page.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/uClibc_page.h
new file mode 100644
index 0000000..915918c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/uClibc_page.h
@@ -0,0 +1,35 @@
+/*  Copyright (C) 2004     Erik Andersen
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supply an architecture specific value for PAGE_SIZE and friends.  */
+
+#ifndef _UCLIBC_PAGE_H
+#define _UCLIBC_PAGE_H
+
+/* PAGE_SIZE of mips is sortof wierd, and depends on how the kernel
+ * happens to have been configured.  It might use 4KB, 16K or 64K
+ * pages.  To avoid using the current kernel configuration settings,
+ * uClibc will simply use 4KB on mips and call it good. */
+#if 0
+#define PAGE_SHIFT	16
+#define PAGE_SHIFT	14
+#endif
+#define PAGE_SHIFT	12
+#define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#define PAGE_MASK	(~(PAGE_SIZE-1))
+
+#endif /* _UCLIBC_PAGE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/wordsize.h
new file mode 100644
index 0000000..666c7ad
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bits/wordsize.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#define __WORDSIZE	_MIPS_SZPTR
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/brk.c b/ap/build/uClibc/libc/sysdeps/linux/mips/brk.c
new file mode 100644
index 0000000..f0462d6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/brk.c
@@ -0,0 +1,51 @@
+/* brk system call for Linux/MIPS.
+   Copyright (C) 2000, 2005, 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.  */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+void *__curbrk attribute_hidden = 0;
+
+int brk (void *addr)
+{
+  void *newbrk;
+
+  {
+    register long int res __asm__ ("$2");
+
+    __asm__ ("move\t$4,%2\n\t"
+	 "li\t%0,%1\n\t"
+	 "syscall"		/* Perform the system call.  */
+	 : "=r" (res)
+	 : "I" (__NR_brk), "r" (addr)
+	 : "$4", "$7", __SYSCALL_CLOBBERS);
+    newbrk = (void *) res;
+  }
+  __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/mips/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/mips/bsd-_setjmp.S
new file mode 100644
index 0000000..6853dea
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bsd-_setjmp.S
@@ -0,0 +1,56 @@
+/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'.  MIPS version.
+   Copyright (C) 1996, 1997, 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.  */
+
+/* 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.  */
+
+#include <sys/regdef.h>
+#include <sys/asm.h>
+
+#ifdef __PIC__
+	.option pic2
+#endif
+
+.text
+.global _setjmp
+.align 2;
+.ent _setjmp,0;
+.type _setjmp,@function
+
+_setjmp:
+#ifdef __PIC__
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+	.set	noreorder
+	.cpload t9
+	.set	reorder
+	la	t9, __sigsetjmp
+#else
+	.cpsetup t9, v0, _setjmp
+	PTR_LA	t9, __sigsetjmp
+	.cpreturn
+#endif
+#endif
+	move	a1,zero		/* Pass a second argument of zero.  */
+#ifdef __PIC__
+	jr	t9
+#else
+	j	__sigsetjmp
+#endif
+	.end	_setjmp;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/mips/bsd-setjmp.S
new file mode 100644
index 0000000..1f57a97
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/bsd-setjmp.S
@@ -0,0 +1,56 @@
+/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'.  MIPS version.
+   Copyright (C) 1996, 1997, 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.  */
+
+/* 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.  */
+
+#include <sys/regdef.h>
+#include <sys/asm.h>
+
+#ifdef __PIC__
+	.option pic2
+#endif
+
+.text
+.global setjmp
+.align 2;
+.ent setjmp,0;
+.type setjmp,@function
+
+setjmp:
+	.set	noreorder
+#ifdef __PIC__
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+	.cpload t9
+	.set	reorder
+	la	t9, __sigsetjmp
+#else	/* N32 */
+	.cpsetup t9, v0, setjmp
+	PTR_LA	t9, __sigsetjmp
+	.cprestore
+#endif	/* N32 */
+#endif
+	li	a1, 1		/* Pass a second argument of one.  */
+#ifdef __PIC__
+	jr	t9
+#else
+	j	__sigsetjmp
+#endif
+	.end	setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/cacheflush.c b/ap/build/uClibc/libc/sysdeps/linux/mips/cacheflush.c
new file mode 100644
index 0000000..235414d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/cacheflush.c
@@ -0,0 +1,30 @@
+/* _flush_cache system call for Linux/MIPS.
+   Copyright (C) 2003 Christophe Massiot <cmassiot@freebox.fr>
+
+   The uClibc 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 uClibc 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 uClibc 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>
+
+#ifdef __NR_cacheflush
+_syscall3(int, cacheflush, void *, addr, const int, nbytes, const int, op)
+strong_alias(cacheflush, _flush_cache)
+#endif
+
+#ifdef __NR_cachectl
+_syscall3(int, cachectl, void *, addr, const int, nbytes, const int, op)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/clone.S b/ap/build/uClibc/libc/sysdeps/linux/mips/clone.S
new file mode 100644
index 0000000..7148e9d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/clone.S
@@ -0,0 +1,173 @@
+/* Copyright (C) 1996, 1997, 2000, 2003, 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ralf Baechle <ralf@linux-mips.org>, 1996.
+
+   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.  */
+
+#include <features.h>
+#include <sys/asm.h>
+#include <sysdep.h>
+#define _ERRNO_H        1
+#include <bits/errno.h>
+#ifdef RESET_PID
+#include <tls.h>
+#endif
+
+#define CLONE_VM      0x00000100
+#define CLONE_THREAD  0x00010000
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
+	     void *parent_tidptr, void *tls, void *child_tidptr) */
+
+	.text
+#if _MIPS_SIM == _ABIO32
+# define EXTRA_LOCALS 1
+#else
+# define EXTRA_LOCALS 0
+#endif
+LOCALSZ= 4
+FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
+GPOFF= FRAMESZ-(1*SZREG)
+NESTED(clone,4*SZREG,sp)
+#ifdef __PIC__
+	SETUP_GP
+#endif
+	PTR_SUBU sp, FRAMESZ
+	SETUP_GP64 (GPOFF, clone)
+#ifdef __PIC__
+	SAVE_GP (GPOFF)
+#endif
+#ifdef PROF
+	.set		noat
+	move		$1,ra
+	jal		_mcount
+	.set		at
+#endif
+
+
+	/* Sanity check arguments.  */
+	li		v0,EINVAL
+	beqz		a0,L(error)	/* No NULL function pointers.  */
+	beqz		a1,L(error)	/* No NULL stack pointers.  */
+
+	PTR_SUBU	a1,32		/* Reserve argument save space.  */
+	PTR_S		a0,0(a1)	/* Save function pointer.  */
+	PTR_S		a3,PTRSIZE(a1)	/* Save argument pointer.  */
+#ifdef RESET_PID
+	LONG_S		a2,(PTRSIZE*2)(a1)	/* Save clone flags.  */
+#endif
+
+	move		a0,a2
+
+	/* Shuffle in the last three arguments - arguments 5, 6, and 7 to
+	   this function, but arguments 3, 4, and 5 to the syscall.  */
+#if _MIPS_SIM == _ABIO32
+	PTR_L		a2,(FRAMESZ+PTRSIZE+PTRSIZE+16)(sp)
+	PTR_S		a2,16(sp)
+	PTR_L		a2,(FRAMESZ+16)(sp)
+	PTR_L		a3,(FRAMESZ+PTRSIZE+16)(sp)
+#else
+	move		a2,a4
+	move		a3,a5
+	move		a4,a6
+#endif
+
+	/* Do the system call */
+	li		v0,__NR_clone
+	syscall
+
+	bnez		a3,L(error)
+	beqz		v0,L(thread_start)
+
+	/* Successful return from the parent */
+	RESTORE_GP64
+	PTR_ADDU	sp, FRAMESZ
+	j $31  ; nop
+
+	/* Something bad happened -- no child created */
+L(error):
+#ifdef __PIC__
+	PTR_LA		t9,__syscall_error
+	RESTORE_GP64
+	PTR_ADDU	sp, FRAMESZ
+	/* uClibc change -- start */
+	move            a0,v0           /* Pass return val to C function. */
+	/* uClibc change -- stop */
+	jr		t9
+#else
+	RESTORE_GP64
+	PTR_ADDU	sp, FRAMESZ
+	/* uClibc change -- start */
+	move            a0,v0           /* Pass return val to C function. */
+	/* uClibc change -- stop */
+	j		__syscall_error
+#endif
+	END(clone)
+
+/* Load up the arguments to the function.  Put this block of code in
+   its own function so that we can terminate the stack trace with our
+   debug info.  */
+
+ENTRY(__thread_start)
+L(thread_start):
+	/* cp is already loaded.  */
+	SAVE_GP (GPOFF)
+	/* The stackframe has been created on entry of clone().  */
+
+#ifdef RESET_PID
+	/* Check and see if we need to reset the PID.  */
+	LONG_L		a0,(PTRSIZE*2)(sp)
+	and		a1,a0,CLONE_THREAD
+	beqz		a1,L(restore_pid)
+L(donepid):
+#endif
+
+	/* Restore the arg for user's function.  */
+	PTR_L		t9,0(sp)	/* Function pointer.  */
+	PTR_L		a0,PTRSIZE(sp)	/* Argument pointer.  */
+
+	/* Call the user's function.  */
+	jal		t9
+
+	/* Call _exit rather than doing it inline for breakpoint purposes.  */
+	move		a0,v0
+#ifdef __PIC__
+	PTR_LA		t9,_exit
+	jalr		t9
+#else
+	jal		_exit
+#endif
+
+#ifdef RESET_PID
+L(restore_pid):
+	and		a1,a0,CLONE_VM
+	li		v0,-1
+	bnez		a1,L(gotpid)
+	li		v0,__NR_getpid
+	syscall
+L(gotpid):
+	READ_THREAD_POINTER(v1)
+	INT_S		v0,PID_OFFSET(v1)
+	INT_S		v0,TID_OFFSET(v1)
+	b		L(donepid)
+#endif
+
+	END(__thread_start)
+
+weak_alias(clone, __clone)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/mips/crt1.S
new file mode 100644
index 0000000..6a80412
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/crt1.S
@@ -0,0 +1,131 @@
+/* Startup code compliant to the ELF Mips ABI.
+   Copyright (C) 1995, 1997, 2000, 2001, 2002, 2003, 2004
+	Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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 <sys/regdef.h>
+#include <sys/asm.h>
+#include <features.h>
+
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.  The SVR4/Mips ABI (pages 3-31, 3-32) says that when the entry
+   point runs, most registers' values are unspecified, except for:
+
+   v0 ($2)	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 ($29)	The stack contains the arguments and environment:
+		0(%esp)			argc
+		4(%esp)			argv[0]
+		...
+		(4*argc)(%esp)		NULL
+		(4*(argc+1))(%esp)	envp[0]
+		...
+					NULL
+   ra ($31)	The return address register is set to zero so that programs
+		that search backword through stack frames recognize the last
+		stack frame.
+*/
+
+
+/* We need to call:
+   __uClibc_main (int (*main) (int, char **, char **), int argc,
+		      char **argv, void (*init) (void), void (*fini) (void),
+		      void (*rtld_fini) (void), void *stack_end)
+*/
+
+.text
+	.globl	__start
+	.type	__start,@function
+	.type	_init,@function
+	.type	_fini,@function
+#ifndef __UCLIBC_CTOR_DTOR__
+	.weak	_init
+	.weak	_fini
+#endif
+	.type	    main,@function
+	.type	    __uClibc_main,@function
+	.ent	__start
+
+__start:
+#ifdef __PIC__
+	SETUP_GPX($0)
+	SETUP_GPX64($25,$0)
+#else
+	PTR_LA $28, _gp             /* Setup GP correctly if we're non-PIC.  */
+	move $31, $0
+#endif
+
+	PTR_LA $4, main		/* main */
+	PTR_L $5, 0($29)		/* argc */
+	PTR_ADDIU $6, $29, PTRSIZE	/* argv  */
+
+	/* Allocate space on the stack for seven arguments and
+	 * make sure the stack is aligned to double words (8 bytes) */
+
+	and $29, -2 * SZREG
+
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+	PTR_SUBIU $29, 32
+#endif
+	PTR_LA $7, _init		/* init */
+	PTR_LA $8, _fini
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+	PTR_S $8, 16($29)		/* fini */
+	PTR_S $2, 20($29)		/* rtld_fini */
+	PTR_S $29, 24($29)		/* stack_end */
+#else
+	move $9, $2		/* rtld_fini */
+	move $10, $29		/* stack_end */
+#endif
+	jal __uClibc_main
+hlt:
+	/* Crash if somehow `__uClibc_main' returns anyway.  */
+	b   hlt
+.size __start,.-__start
+.end __start
+
+/* 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/mips/crti.S b/ap/build/uClibc/libc/sysdeps/linux/mips/crti.S
new file mode 100644
index 0000000..9311a73
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/crti.S
@@ -0,0 +1,158 @@
+#include "sgidefs.h"
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+	.file	1 "initfini.c"
+	.section .mdebug.abi32
+	.previous
+	.abicalls
+#APP
+	
+	.section .init
+#NO_APP
+	.align	2
+	.globl	_init
+	.ent	_init
+	.type	_init, @function
+_init:
+	.frame	$sp,32,$31		# vars= 0, regs= 2/0, args= 16, extra= 8
+	.mask	0x90000000,-4
+	.fmask	0x00000000,0
+	.set	noreorder
+	.cpload	$25
+	.set	reorder
+	subu	$sp,$sp,32
+	.cprestore 16
+	sw	$31,28($sp)
+	sw	$28,24($sp)
+#APP
+	
+	.align 2
+	.end _init
+	
+	.section .fini
+#NO_APP
+	.align	2
+	.globl	_fini
+	.ent	_fini
+	.type	_fini, @function
+_fini:
+	.frame	$sp,32,$31		# vars= 0, regs= 2/0, args= 16, extra= 8
+	.mask	0x90000000,-4
+	.fmask	0x00000000,0
+	.set	noreorder
+	.cpload	$25
+	.set	reorder
+	subu	$sp,$sp,32
+	.cprestore 16
+	sw	$31,28($sp)
+	sw	$28,24($sp)
+#APP
+	.align 2
+	.end _fini
+	
+	.ident	"GCC: (GNU) 3.3.2"
+#elif _MIPS_SIM == _MIPS_SIM_NABI32
+	.file	1 "initfini.c"
+	.section .mdebug.abiN32
+	.previous
+	.abicalls
+#APP
+	
+	.section .init
+#NO_APP
+	.align	2
+	.align	3
+	.globl	_init
+	.ent	_init
+	.type	_init, @function
+_init:
+	.frame	$sp,16,$31		# vars= 0, regs= 2/0, args= 0, gp= 0
+	.mask	0x90000000,-8
+	.fmask	0x00000000,0
+	addiu	$sp,$sp,-16
+	sd	$28,0($sp)
+	lui	$28,%hi(%neg(%gp_rel(_init)))
+	addu	$28,$28,$25
+	addiu	$28,$28,%lo(%neg(%gp_rel(_init)))
+	sd	$31,8($sp)
+#APP
+	
+	.align 3
+	.end _init
+
+	.section .fini
+#NO_APP
+	.align	2
+	.align	3
+	.globl	_fini
+	.ent	_fini
+	.type	_fini, @function
+_fini:
+	.frame	$sp,16,$31		# vars= 0, regs= 2/0, args= 0, gp= 0
+	.mask	0x90000000,-8
+	.fmask	0x00000000,0
+	addiu	$sp,$sp,-16
+	sd	$28,0($sp)
+	lui	$28,%hi(%neg(%gp_rel(_fini)))
+	addu	$28,$28,$25
+	addiu	$28,$28,%lo(%neg(%gp_rel(_fini)))
+	sd	$31,8($sp)
+#APP
+	.align 3
+	.end _fini
+	
+	.ident	"GCC: (GNU) 3.4.3"
+#else	/* N64 */
+	.file	1 "initfini.c"
+	.section .mdebug.abi64
+	.previous
+	.abicalls
+#APP
+	
+	
+	.section .init
+#NO_APP
+	.align	2
+	.globl	_init
+	.ent	_init
+	.type	_init, @function
+_init:
+	.frame	$sp,32,$31		# vars= 0, regs= 2/0, args= 0, extra= 16
+	.mask	0x90000000,-8
+	.fmask	0x00000000,0
+	dsubu	$sp,$sp,32
+	sd	$31,24($sp)
+	sd	$28,16($sp)
+	.set	noat
+	lui	$1,%hi(%neg(%gp_rel(_init)))
+	addiu	$1,$1,%lo(%neg(%gp_rel(_init)))
+	daddu	$gp,$1,$25
+	.set	at
+#APP
+	
+	.align 2
+	.end _init
+	
+	.section .fini
+#NO_APP
+	.align	2
+	.globl	_fini
+	.ent	_fini
+	.type	_fini, @function
+_fini:
+	.frame	$sp,32,$31		# vars= 0, regs= 2/0, args= 0, extra= 16
+	.mask	0x90000000,-8
+	.fmask	0x00000000,0
+	dsubu	$sp,$sp,32
+	sd	$31,24($sp)
+	sd	$28,16($sp)
+	.set	noat
+	lui	$1,%hi(%neg(%gp_rel(_fini)))
+	addiu	$1,$1,%lo(%neg(%gp_rel(_fini)))
+	daddu	$gp,$1,$25
+	.set	at
+#APP
+	.align 2
+	.end _fini
+	
+	.ident	"GCC: (GNU) 3.3.2"
+#endif	/* N64 */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/mips/crtn.S
new file mode 100644
index 0000000..f3756a2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/crtn.S
@@ -0,0 +1,130 @@
+#include "sgidefs.h"
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+	.file	1 "initfini.c"
+	.section .mdebug.abi32
+	.previous
+	.abicalls
+#APP
+	
+	.section .init
+#NO_APP
+	.align	2
+	.globl	_init
+	.type	_init, @function
+#NO_APP
+	lw	$31,28($sp)
+	#nop
+	.set	noreorder
+	.set	nomacro
+	j	$31
+	addu	$sp,$sp,32
+	.set	macro
+	.set	reorder
+
+#APP
+	
+	.section .fini
+#NO_APP
+	.align	2
+	.globl	_fini
+	.type	_fini, @function
+#NO_APP
+	lw	$31,28($sp)
+	#nop
+	.set	noreorder
+	.set	nomacro
+	j	$31
+	addu	$sp,$sp,32
+	.set	macro
+	.set	reorder
+
+#APP
+	
+	.ident	"GCC: (GNU) 3.3.2"
+#elif _MIPS_SIM == _MIPS_SIM_NABI32
+	.file	1 "initfini.c"
+	.section .mdebug.abiN32
+	.previous
+	.abicalls
+#APP
+	
+	.section .init
+#NO_APP
+	.align	3
+	.globl	_init
+	.type	_init, @function
+#NO_APP
+	ld	$31,8($sp)
+	ld	$28,0($sp)
+	.set	noreorder
+	.set	nomacro
+	j	$31
+	addiu	$sp,$sp,16
+	.set	macro
+	.set	reorder
+#APP
+	
+	.section .fini
+#NO_APP
+	.align	3
+	.globl	_fini
+	.type	_fini, @function
+#NO_APP
+	ld	$31,8($sp)
+	ld	$28,0($sp)
+	.set	noreorder
+	.set	nomacro
+	j	$31
+	addiu	$sp,$sp,16
+	.set	macro
+	.set	reorder
+
+#APP
+	
+	.ident	"GCC: (GNU) 3.4.3"
+#else /* N64 */
+	.file	1 "initfini.c"
+	.section .mdebug.abi64
+	.previous
+	.abicalls
+#APP
+	
+	
+	.section .init
+#NO_APP
+	.align	2
+	.globl	_init
+	.type	_init, @function
+#NO_APP
+	ld	$31,24($sp)
+	ld	$28,16($sp)
+	#nop
+	.set	noreorder
+	.set	nomacro
+	j	$31
+	daddu	$sp,$sp,32
+	.set	macro
+	.set	reorder
+
+#APP
+	
+	.section .fini
+#NO_APP
+	.align	2
+	.globl	_fini
+	.type	_fini, @function
+#NO_APP
+	ld	$31,24($sp)
+	ld	$28,16($sp)
+	#nop
+	.set	noreorder
+	.set	nomacro
+	j	$31
+	daddu	$sp,$sp,32
+	.set	macro
+	.set	reorder
+
+#APP
+	
+	.ident	"GCC: (GNU) 3.3.2"
+#endif	/* N64 */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/mips/fpu_control.h
new file mode 100644
index 0000000..c58b235
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/fpu_control.h
@@ -0,0 +1,100 @@
+/* FPU control word bits.  Mips version.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Olaf Flebbe and Ralf Baechle.
+
+   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
+
+/* MIPS FPU floating point control register bits.
+ *
+ * 31-25  -> floating point conditions code bits 7-1.  These bits are only
+ *           available in MIPS IV.
+ * 24     -> flush denormalized results to zero instead of
+ *           causing unimplemented operation exception.  This bit is only
+ *           available for MIPS III and newer.
+ * 23     -> Condition bit
+ * 22-18  -> reserved (read as 0, write with 0)
+ * 17     -> cause bit for unimplemented operation
+ * 16     -> cause bit for invalid exception
+ * 15     -> cause bit for division by zero exception
+ * 14     -> cause bit for overflow exception
+ * 13     -> cause bit for underflow exception
+ * 12     -> cause bit for inexact exception
+ * 11     -> enable exception for invalid exception
+ * 10     -> enable exception for division by zero exception
+ *  9     -> enable exception for overflow exception
+ *  8     -> enable exception for underflow exception
+ *  7     -> enable exception for inexact exception
+ *  6     -> flag invalid exception
+ *  5     -> flag division by zero exception
+ *  4     -> flag overflow exception
+ *  3     -> flag underflow exception
+ *  2     -> flag inexact exception
+ *  1-0   -> rounding control
+ *
+ *
+ * Rounding Control:
+ * 00 - rounding to nearest (RN)
+ * 01 - rounding toward zero (RZ)
+ * 10 - rounding (up) toward plus infinity (RP)
+ * 11 - rounding (down)toward minus infinity (RM)
+ */
+
+#include <features.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_V     0x0800  /* Invalid operation */
+#define _FPU_MASK_Z     0x0400  /* Division by zero  */
+#define _FPU_MASK_O     0x0200  /* Overflow          */
+#define _FPU_MASK_U     0x0100  /* Underflow         */
+#define _FPU_MASK_I     0x0080  /* Inexact operation */
+
+/* flush denormalized numbers to zero */
+#define _FPU_FLUSH_TZ   0x1000000
+
+/* rounding control */
+#define _FPU_RC_NEAREST 0x0     /* RECOMMENDED */
+#define _FPU_RC_ZERO    0x1
+#define _FPU_RC_UP      0x2
+#define _FPU_RC_DOWN    0x3
+
+#define _FPU_RESERVED 0xfe3c0000  /* Reserved bits in cw */
+
+
+/* The fdlibm code requires strict IEEE double precision arithmetic,
+   and no interrupts for exceptions, rounding to nearest.  */
+
+#define _FPU_DEFAULT  0x00000000
+
+/* IEEE:  same as above, but exceptions */
+#define _FPU_IEEE     0x00000F80
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
+
+/* Macros for accessing the hardware control word.  */
+#define _FPU_GETCW(cw) __asm__ ("cfc1 %0,$31" : "=r" (cw))
+#define _FPU_SETCW(cw) __asm__ ("ctc1 %0,$31" : : "r" (cw))
+
+#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/mips/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/mips/mmap.c
new file mode 100644
index 0000000..be96451
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/mmap.c
@@ -0,0 +1,26 @@
+/* Use new style mmap for mips */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <errno.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+
+#if 0
+/* For now, leave mmap using mmap1 since mmap2 seems
+ * to have issues (i.e. it doesn't work 100% properly).
+ */
+#ifdef __NR_mmap2
+# undef __NR_mmap
+# define __NR_mmap __NR_mmap2
+#endif
+#endif
+
+_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
+	   int, flags, int, fd, __off_t, offset)
+libc_hidden_def(mmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/pipe.S b/ap/build/uClibc/libc/sysdeps/linux/mips/pipe.S
new file mode 100644
index 0000000..8b30236
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/pipe.S
@@ -0,0 +1,45 @@
+/* pipe system call for Linux/MIPS */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+/*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
+
+#include <features.h>
+#include <sys/asm.h>
+#include <asm/unistd.h>
+#include <sys/regdef.h>
+
+	.globl	pipe
+	.ent	pipe, 0
+	.type pipe,@function
+pipe:
+#ifdef __PIC__
+	SETUP_GP
+#endif
+	li	v0,__NR_pipe
+	syscall
+	bnez	a3, 1f
+	sw	v0, 0(a0)
+	sw	v1, 4(a0)
+	li	v0, 0
+	j	ra
+1:
+	/* uClibc change -- start */
+	move		a0,v0		/* Pass return val to C function. */
+	/* uClibc change -- stop */
+
+#ifdef __PIC__
+	SETUP_GP64(v0, pipe)
+	PTR_LA	t9, __syscall_error
+	RESTORE_GP64
+	jr	t9
+#else
+	j	__syscall_error
+#endif
+1:
+	.end	pipe
+	.size	pipe,.-pipe
+libc_hidden_def(pipe)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/posix_fadvise.c b/ap/build/uClibc/libc/sysdeps/linux/mips/posix_fadvise.c
new file mode 100644
index 0000000..8546d96
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/posix_fadvise.c
@@ -0,0 +1,39 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise() for MIPS 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>
+
+int posix_fadvise(int fd, off_t offset, off_t len, int advice)
+{
+/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */
+#ifdef __NR_fadvise64
+	INTERNAL_SYSCALL_DECL(err);
+# if _MIPS_SIM == _ABIO32
+	int ret = INTERNAL_SYSCALL(fadvise64, err, 7, fd, 0,
+		__LONG_LONG_PAIR ((long) (offset >> 31), (long) offset),
+		__LONG_LONG_PAIR ((long) (len >> 31), (long) len),
+		advice);
+# else /* N32 || N64 */
+	int ret = INTERNAL_SYSCALL(fadvise64, err, 4, fd, offset, len, advice);
+# endif
+	if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+		return INTERNAL_SYSCALL_ERRNO (ret, err);
+	return 0;
+#else
+	return ENOSYS;
+#endif
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/posix_fadvise64.c b/ap/build/uClibc/libc/sysdeps/linux/mips/posix_fadvise64.c
new file mode 100644
index 0000000..d9b89d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/posix_fadvise64.c
@@ -0,0 +1,43 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise64() for MIPS 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__
+
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
+{
+/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */
+#ifdef __NR_fadvise64
+	INTERNAL_SYSCALL_DECL(err);
+# if _MIPS_SIM == _MIPS_SIM_ABI32
+	int ret = INTERNAL_SYSCALL(fadvise64, err, 7, fd, 0,
+		__LONG_LONG_PAIR ((long) (offset >> 32), (long) offset),
+		__LONG_LONG_PAIR ((long) (len >> 32), (long) len),
+		advice);
+# else /* N32 || N64 */
+	int ret = INTERNAL_SYSCALL(fadvise64, err, 4, fd, offset, len, advice);
+# endif
+	if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+		return INTERNAL_SYSCALL_ERRNO (ret, err);
+	return 0;
+#else
+	return ENOSYS;
+#endif
+}
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/pread_write.c b/ap/build/uClibc/libc/sysdeps/linux/mips/pread_write.c
new file mode 100644
index 0000000..ea6b15f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/pread_write.c
@@ -0,0 +1,115 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/*
+ * Based in part on the files
+ *		./sysdeps/unix/sysv/linux/pwrite.c,
+ *		./sysdeps/unix/sysv/linux/pread.c,
+ *		sysdeps/posix/pread.c
+ *		sysdeps/posix/pwrite.c
+ * from GNU libc 2.2.5, but reworked considerably...
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <endian.h>
+#include <sgidefs.h>
+
+#ifdef __NR_pread64             /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pread
+#  error "__NR_pread and __NR_pread64 both defined???"
+# endif
+# define __NR_pread __NR_pread64
+#endif
+
+extern __typeof(pread) __libc_pread;
+extern __typeof(pwrite) __libc_pwrite;
+#ifdef __UCLIBC_HAS_LFS__
+extern __typeof(pread64) __libc_pread64;
+extern __typeof(pwrite64) __libc_pwrite64;
+#endif
+
+#include <bits/kernel_types.h>
+
+
+#ifdef __NR_pread
+
+# if _MIPS_SIM == _MIPS_SIM_ABI64
+#  define __NR___libc_pread __NR_pread
+_syscall4(ssize_t, __libc_pread, int, fd, void *, buf, size_t, count, off_t, offset)
+weak_alias (__libc_pread, pread)
+#  ifdef __UCLIBC_HAS_LFS__
+#   define __NR___libc_pread64 __NR_pread
+_syscall4(ssize_t, __libc_pread64, int, fd, void *, buf, size_t, count, off64_t, offset)
+weak_alias (__libc_pread64, pread64)
+#  endif /* __UCLIBC_HAS_LFS__ */
+# else /* O32 || N32 */
+#  define __NR___syscall_pread __NR_pread
+static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf,
+		size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return(__syscall_pread(fd,buf,count,0,__LONG_LONG_PAIR(offset>>31,offset)));
+}
+weak_alias(__libc_pread,pread)
+
+#  ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
+{
+	uint32_t low = offset & 0xffffffff;
+	uint32_t high = offset >> 32;
+	return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR (high, low)));
+}
+weak_alias(__libc_pread64,pread64)
+#  endif /* __UCLIBC_HAS_LFS__  */
+# endif /* O32 || N32 */
+
+#endif /* __NR_pread */
+
+/**********************************************************************/
+
+#ifdef __NR_pwrite64            /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pwrite
+#  error "__NR_pwrite and __NR_pwrite64 both defined???"
+# endif
+# define __NR_pwrite __NR_pwrite64
+#endif
+
+#ifdef __NR_pwrite
+
+# if _MIPS_SIM == _MIPS_SIM_ABI64
+#  define __NR___libc_pwrite __NR_pwrite
+_syscall4(ssize_t, __libc_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset)
+weak_alias (__libc_pwrite, pwrite)
+#  ifdef __UCLIBC_HAS_LFS__
+#   define __NR___libc_pwrite64 __NR_pwrite
+_syscall4(ssize_t, __libc_pwrite64, int, fd, const void *, buf, size_t, count, off64_t, offset)
+weak_alias (__libc_pwrite64, pwrite64)
+#  endif /* __UCLIBC_HAS_LFS__  */
+# else /* O32 || N32 */
+#  define __NR___syscall_pwrite __NR_pwrite
+static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf,
+		size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+	return(__syscall_pwrite(fd,buf,count,0,__LONG_LONG_PAIR(offset>>31,offset)));
+}
+weak_alias(__libc_pwrite,pwrite)
+
+#  ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
+{
+	uint32_t low = offset & 0xffffffff;
+	uint32_t high = offset >> 32;
+	return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR (high, low)));
+}
+weak_alias(__libc_pwrite64,pwrite64)
+#  endif /* __UCLIBC_HAS_LFS__  */
+# endif /* O32 || N32 */
+#endif /* __NR_pwrite */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/readahead.c b/ap/build/uClibc/libc/sysdeps/linux/mips/readahead.c
new file mode 100644
index 0000000..9157c27
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/readahead.c
@@ -0,0 +1,41 @@
+/* Provide kernel hint to read ahead.
+   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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 <fcntl.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+#include <_lfs_64.h>
+# ifdef __NR_readahead
+
+ssize_t readahead(int fd, off64_t offset, size_t count)
+{
+#  if _MIPS_SIM == _ABIO32
+	return INLINE_SYSCALL (readahead, 5, fd, 0,
+		__LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) offset),
+		count);
+#  else /* N32 || N64 */
+	return INLINE_SYSCALL (readahead, 3, fd, offset, count);
+#  endif
+}
+
+# endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/mips/setjmp.S
new file mode 100644
index 0000000..226f755
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/setjmp.S
@@ -0,0 +1,61 @@
+/* Copyright (C) 1996, 1997, 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 <sys/regdef.h>
+#include <sys/asm.h>
+
+/* The function __sigsetjmp_aux saves all the registers, but it can't
+   reliably access the stack or frame pointers, so we pass them in as
+   extra arguments.  */
+#ifdef __PIC__
+	.option pic2
+#endif
+
+
+.text
+.global __sigsetjmp
+.align 2;
+.ent __sigsetjmp,0;
+.type __sigsetjmp,@function
+
+__sigsetjmp:
+#ifdef __PIC__
+	.set	noreorder
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+	.cpload	t9
+#else
+	.cpsetup t9, v0, __sigsetjmp
+#endif
+	.set	reorder
+#endif
+	move	a2, sp
+#ifdef fp
+	move	a3, fp
+#else
+	move	a3, $fp
+#endif
+#ifdef __PIC__
+	PTR_LA	t9, __sigsetjmp_aux
+#if _MIPS_SIM != _MIPS_SIM_ABI32
+	.cpreturn
+#endif
+	jr	t9
+#else
+	j	__sigsetjmp_aux
+#endif
+	.end __sigsetjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/setjmp_aux.c b/ap/build/uClibc/libc/sysdeps/linux/mips/setjmp_aux.c
new file mode 100644
index 0000000..751b32d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/setjmp_aux.c
@@ -0,0 +1,108 @@
+/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Brendan Kehoe (brendan@zen.org).
+
+   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 <setjmp.h>
+#include <sgidefs.h>
+#include <sys/asm.h>
+
+/* This function is only called via the assembly language routine
+   __sigsetjmp, which arranges to pass in the stack pointer and the frame
+   pointer.  We do things this way because it's difficult to reliably
+   access them in C.  */
+
+extern int __sigjmp_save (sigjmp_buf, int);
+
+int
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+__sigsetjmp_aux (jmp_buf env, int savemask, long sp, long fp)
+#else /* O32 || N32 */
+__sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp)
+#endif /* O32 || N32 */
+{
+#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+  /* Store the floating point callee-saved registers...  */
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+  __asm__ __volatile__ ("s.d $f24, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0]));
+  __asm__ __volatile__ ("s.d $f25, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1]));
+  __asm__ __volatile__ ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[2]));
+  __asm__ __volatile__ ("s.d $f27, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3]));
+  __asm__ __volatile__ ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4]));
+  __asm__ __volatile__ ("s.d $f29, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5]));
+  __asm__ __volatile__ ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[6]));
+  __asm__ __volatile__ ("s.d $f31, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[7]));
+#else /* O32 || N32 */
+  __asm__ __volatile__ ("s.d $f20, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0]));
+  __asm__ __volatile__ ("s.d $f22, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1]));
+  __asm__ __volatile__ ("s.d $f24, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[2]));
+  __asm__ __volatile__ ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3]));
+  __asm__ __volatile__ ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4]));
+  __asm__ __volatile__ ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5]));
+#endif /* O32 || N32 */
+#endif
+
+  /* .. and the PC;  */
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+  __asm__ __volatile__ ("sd $31, %0" : : "m" (env[0].__jmpbuf[0].__pc));
+#else
+  __asm__ __volatile__ ("sw $31, %0" : : "m" (env[0].__jmpbuf[0].__pc));
+#endif
+
+  /* .. and the stack pointer;  */
+  env[0].__jmpbuf[0].__sp = (void *) sp;
+
+  /* .. and the FP; it'll be in s8. */
+  env[0].__jmpbuf[0].__fp = (void *) fp;
+
+  /* .. and the GP; */
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+  __asm__ __volatile__ ("sd $gp, %0" : : "m" (env[0].__jmpbuf[0].__gp));
+#else
+  __asm__ __volatile__ ("sw $gp, %0" : : "m" (env[0].__jmpbuf[0].__gp));
+#endif
+
+  /* .. and the callee-saved registers; */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+  __asm__ __volatile__ ("sw $16, %0" : : "m" (env[0].__jmpbuf[0].__regs[0]));
+  __asm__ __volatile__ ("sw $17, %0" : : "m" (env[0].__jmpbuf[0].__regs[1]));
+  __asm__ __volatile__ ("sw $18, %0" : : "m" (env[0].__jmpbuf[0].__regs[2]));
+  __asm__ __volatile__ ("sw $19, %0" : : "m" (env[0].__jmpbuf[0].__regs[3]));
+  __asm__ __volatile__ ("sw $20, %0" : : "m" (env[0].__jmpbuf[0].__regs[4]));
+  __asm__ __volatile__ ("sw $21, %0" : : "m" (env[0].__jmpbuf[0].__regs[5]));
+  __asm__ __volatile__ ("sw $22, %0" : : "m" (env[0].__jmpbuf[0].__regs[6]));
+  __asm__ __volatile__ ("sw $23, %0" : : "m" (env[0].__jmpbuf[0].__regs[7]));
+#else	/* N32 || N64 */
+  __asm__ __volatile__ ("sd $16, %0" : : "m" (env[0].__jmpbuf[0].__regs[0]));
+  __asm__ __volatile__ ("sd $17, %0" : : "m" (env[0].__jmpbuf[0].__regs[1]));
+  __asm__ __volatile__ ("sd $18, %0" : : "m" (env[0].__jmpbuf[0].__regs[2]));
+  __asm__ __volatile__ ("sd $19, %0" : : "m" (env[0].__jmpbuf[0].__regs[3]));
+  __asm__ __volatile__ ("sd $20, %0" : : "m" (env[0].__jmpbuf[0].__regs[4]));
+  __asm__ __volatile__ ("sd $21, %0" : : "m" (env[0].__jmpbuf[0].__regs[5]));
+  __asm__ __volatile__ ("sd $22, %0" : : "m" (env[0].__jmpbuf[0].__regs[6]));
+  __asm__ __volatile__ ("sd $23, %0" : : "m" (env[0].__jmpbuf[0].__regs[7]));
+#endif	/* N32 || N64 */
+
+#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+  /* .. and finally get and reconstruct the floating point csr.  */
+  __asm__ ("cfc1 %0, $31" : "=r" (env[0].__jmpbuf[0].__fpc_csr));
+#endif
+
+  /* Save the signal mask if requested.  */
+  return __sigjmp_save (env, savemask);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sgidefs.h b/ap/build/uClibc/libc/sysdeps/linux/mips/sgidefs.h
new file mode 100644
index 0000000..74509fd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sgidefs.h
@@ -0,0 +1,73 @@
+/* Copyright (C) 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ralf Baechle <ralf@gnu.org>.
+
+   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 _SGIDEFS_H
+#define _SGIDEFS_H	1
+
+/*
+ * A crude hack to stop <asm/sgidefs.h>
+ */
+#undef __ASM_SGIDEFS_H
+#define __ASM_SGIDEFS_H
+
+/*
+ * And remove any damage it might have already done
+ */
+#undef _MIPS_ISA_MIPS1
+#undef _MIPS_ISA_MIPS2
+#undef _MIPS_ISA_MIPS3
+#undef _MIPS_ISA_MIPS4
+#undef _MIPS_ISA_MIPS5
+#undef _MIPS_ISA_MIPS32
+#undef _MIPS_ISA_MIPS64
+
+#undef _MIPS_SIM_ABI32
+#undef _MIPS_SIM_NABI32
+#undef _MIPS_SIM_ABI64
+
+/*
+ * Definitions for the ISA level
+ */
+#define _MIPS_ISA_MIPS1 1
+#define _MIPS_ISA_MIPS2 2
+#define _MIPS_ISA_MIPS3 3
+#define _MIPS_ISA_MIPS4 4
+#define _MIPS_ISA_MIPS5 5
+#define _MIPS_ISA_MIPS32 6
+#define _MIPS_ISA_MIPS64 7
+
+/*
+ * Subprogram calling convention
+ */
+#ifndef _ABIO32
+# define _ABIO32		1
+#endif
+#define _MIPS_SIM_ABI32		_ABIO32
+
+#ifndef _ABIN32
+# define _ABIN32		2
+#endif
+#define _MIPS_SIM_NABI32	_ABIN32
+
+#ifndef _ABI64
+# define _ABI64			3
+#endif
+#define _MIPS_SIM_ABI64		_ABI64
+
+#endif /* sgidefs.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/mips/sigaction.c
new file mode 100644
index 0000000..bb07eee
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sigaction.c
@@ -0,0 +1,138 @@
+/* Copyright (C) 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+
+   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 __typeof(sigaction) __libc_sigaction;
+
+
+#ifdef __NR_rt_sigaction
+
+# if _MIPS_SIM != _ABIO32
+#  ifdef __NR_rt_sigreturn
+static void restore_rt(void) __asm__ ("__restore_rt");
+#  endif
+#  ifdef __NR_sigreturn
+static void restore(void) __asm__ ("__restore");
+#  endif
+# endif
+
+/* 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)
+{
+# if _MIPS_SIM != _ABIO32
+	struct sigaction kact;
+	if (act) {
+		memcpy(&kact, act, sizeof(kact));
+		kact.sa_restorer = &restore_rt;
+		act = &kact;
+	}
+# endif
+
+	/* 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
+
+extern void restore(void) __asm__ ("__restore") attribute_hidden;
+
+/* 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 _MIPS_SIM == _ABIO32
+		kact.sa_restorer = act->sa_restorer;
+# else
+		kact.sa_restorer = &restore_rt;
+# endif
+	}
+	result = __syscall_sigaction(sig,
+			act ? &kact : NULL,
+			oact ? &koact : NULL);
+	if (result < 0) {
+		__set_errno(-result);
+		return -1;
+	}
+	if (oact) {
+		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
+
+
+/* NOTE: Please think twice before making any changes to the bits of
+   code below.  GDB needs some intimate knowledge about it to
+   recognize them as signal trampolines, and make backtraces through
+   signal handlers work right.  Important are both the names
+   (__restore_rt) and the exact instruction sequence.
+   If you ever feel the need to make any changes, please notify the
+   appropriate GDB maintainer.  */
+
+#define RESTORE(name, syscall) RESTORE2(name, syscall)
+#define RESTORE2(name, syscall) \
+__asm__ (						\
+	".align 4\n"					\
+	"__" #name ":\n"				\
+	"	li	$2, " #syscall "\n"		\
+	"	syscall\n"				\
+);
+
+/* The return code for realtime-signals.  */
+#if _MIPS_SIM != _ABIO32
+# ifdef __NR_rt_sigreturn
+RESTORE(restore_rt, __NR_rt_sigreturn)
+# endif
+# ifdef __NR_sigreturn
+RESTORE(restore, __NR_sigreturn)
+# endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sys/asm.h b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/asm.h
new file mode 100644
index 0000000..d424ed3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/asm.h
@@ -0,0 +1,491 @@
+/* Copyright (C) 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ralf Baechle <ralf@gnu.org>.
+
+   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_ASM_H
+#define _SYS_ASM_H
+
+#include <sgidefs.h>
+
+#ifndef CAT
+# ifdef __STDC__
+#  define __CAT(str1,str2) str1##str2
+# else
+#  define __CAT(str1,str2) str1/**/str2
+# endif
+# define CAT(str1,str2) __CAT(str1,str2)
+#endif
+
+/*
+ * Macros to handle different pointer/register sizes for 32/64-bit code
+ *
+ * 64 bit address space isn't used yet, so we may use the R3000 32 bit
+ * defines for now.
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
+# define PTR .word
+# define PTRSIZE 4
+# define PTRLOG 2
+#elif (_MIPS_SIM == _MIPS_SIM_ABI64)
+# define PTR .dword
+# define PTRSIZE 8
+# define PTRLOG 3
+#endif
+
+/*
+ * PIC specific declarations
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+# ifdef __PIC__
+#  define CPRESTORE(register) \
+		.cprestore register
+#  define CPLOAD(register) \
+		.cpload register
+# else
+#  define CPRESTORE(register)
+#  define CPLOAD(register)
+# endif
+
+# define CPADD(register) \
+		.cpadd	register
+
+/*
+ * Set gp when at 1st instruction
+ */
+# define SETUP_GP					\
+		.set noreorder;				\
+		.cpload $25;				\
+		.set reorder
+/* Set gp when not at 1st instruction */
+# define SETUP_GPX(r)					\
+		.set noreorder;				\
+		move r, $31;	 /* Save old ra.  */	\
+		bal 10f; /* Find addr of cpload.  */	\
+		nop;					\
+10:							\
+		.cpload $31;				\
+		move $31, r;				\
+		.set reorder
+# define SETUP_GPX_L(r, l)				\
+		.set noreorder;				\
+		move r, $31;	 /* Save old ra.  */	\
+		bal l;   /* Find addr of cpload.  */	\
+		nop;					\
+l:							\
+		.cpload $31;				\
+		move $31, r;				\
+		.set reorder
+# define SAVE_GP(x) \
+		.cprestore x /* Save gp trigger t9/jalr conversion.	 */
+# define SETUP_GP64(a, b)
+# define SETUP_GPX64(a, b)
+# define SETUP_GPX64_L(cp_reg, ra_save, l)
+# define RESTORE_GP64
+# define USE_ALT_CP(a)
+# define L(label) $L ## label
+#else /* (_MIPS_SIM == _MIPS_SIM_ABI64) || (_MIPS_SIM == _MIPS_SIM_NABI32) */
+/*
+ * For callee-saved gp calling convention:
+ */
+# define SETUP_GP
+# define SETUP_GPX(r)
+# define SETUP_GPX_L(r, l)
+# define SAVE_GP(x)
+
+# define SETUP_GP64(gpoffset, proc) \
+		.cpsetup $25, gpoffset, proc
+# define SETUP_GPX64(cp_reg, ra_save)			\
+		move ra_save, $31; /* Save old ra.  */	\
+		.set noreorder;				\
+		bal 10f; /* Find addr of .cpsetup.  */	\
+		nop;					\
+10:							\
+		.set reorder;				\
+		.cpsetup $31, cp_reg, 10b;		\
+		move $31, ra_save
+# define SETUP_GPX64_L(cp_reg, ra_save, l)  \
+		move ra_save, $31; /* Save old ra.  */	\
+		.set noreorder;				\
+		bal l;   /* Find addr of .cpsetup.  */	\
+		nop;					\
+l:							\
+		.set reorder;				\
+		.cpsetup $31, cp_reg, l;		\
+		move $31, ra_save
+# define RESTORE_GP64 \
+		.cpreturn
+/* Use alternate register for context pointer.  */
+# define USE_ALT_CP(reg)	\
+		.cplocal reg
+# define L(label) .L ## label
+#endif /* _MIPS_SIM != _MIPS_SIM_ABI32 */
+
+/*
+ * Stack Frame Definitions
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+# define NARGSAVE 4 /* Space for 4 argument registers must be allocated.  */
+#endif
+#if (_MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32)
+# define NARGSAVE 0 /* No caller responsibilities.  */
+#endif
+
+
+/*
+ * LEAF - declare leaf routine
+ */
+#define	LEAF(symbol)                                    \
+		.globl	symbol;                         \
+		.align	2;                              \
+		.type	symbol,@function;               \
+		.ent	symbol,0;                       \
+symbol:		.frame	sp,0,ra
+
+/*
+ * NESTED - declare nested routine entry point
+ */
+#define	NESTED(symbol, framesize, rpc)                  \
+		.globl	symbol;                         \
+		.align	2;                              \
+		.type	symbol,@function;               \
+		.ent	symbol,0;                       \
+symbol:		.frame	sp, framesize, rpc
+
+/*
+ * END - mark end of function
+ */
+#ifndef END
+# define END(function)                                   \
+		.end	function;		        \
+		.size	function,.-function
+#endif
+
+/*
+ * EXPORT - export definition of symbol
+ */
+#define	EXPORT(symbol)                                  \
+		.globl	symbol;                         \
+symbol:
+
+/*
+ * ABS - export absolute symbol
+ */
+#define	ABS(symbol,value)                               \
+		.globl	symbol;                         \
+symbol		=	value
+
+#define	PANIC(msg)                                      \
+		.set	push;				\
+		.set	reorder;                        \
+		la	a0,8f;                          \
+		jal	panic;                          \
+9:		b	9b;                             \
+		.set	pop;				\
+		TEXT(msg)
+
+/*
+ * Print formated string
+ */
+#define PRINT(string)                                   \
+		.set	push;				\
+		.set	reorder;                        \
+		la	a0,8f;                          \
+		jal	printk;                         \
+		.set	pop;				\
+		TEXT(string)
+
+#define	TEXT(msg)                                       \
+		.data;                                  \
+8:		.asciiz	msg;                            \
+		.previous;
+
+/*
+ * Build text tables
+ */
+#define TTABLE(string)                                  \
+		.text;                                  \
+		.word	1f;                             \
+		.previous;                              \
+		.data;                                  \
+1:		.asciz	string;                         \
+		.previous
+
+/*
+ * MIPS IV pref instruction.
+ * Use with .set noreorder only!
+ *
+ * MIPS IV implementations are free to treat this as a nop.  The R5000
+ * is one of them.  So we should have an option not to use this instruction.
+ */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \
+    (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
+# define PREF(hint,addr)                                 \
+		pref	hint,addr
+# define PREFX(hint,addr)                                \
+		prefx	hint,addr
+#else
+# define PREF
+# define PREFX
+#endif
+
+/*
+ * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs.
+ */
+#if _MIPS_ISA == _MIPS_ISA_MIPS1
+# define MOVN(rd,rs,rt)					\
+		.set	push;				\
+		.set	reorder;			\
+		beqz	rt,9f;				\
+		move	rd,rs;				\
+		.set	pop;				\
+9:
+# define MOVZ(rd,rs,rt)					\
+		.set	push;				\
+		.set	reorder;			\
+		bnez	rt,9f;				\
+		move	rd,rt;				\
+		.set	pop;				\
+9:
+#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3)
+# define MOVN(rd,rs,rt)					\
+		.set	push;				\
+		.set	noreorder;			\
+		bnezl	rt,9f;				\
+		move	rd,rs;				\
+		.set	pop;				\
+9:
+# define MOVZ(rd,rs,rt)					\
+		.set	push;				\
+		.set	noreorder;			\
+		beqzl	rt,9f;				\
+		movz	rd,rs;				\
+		.set	pop;				\
+9:
+#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \
+    (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
+# define MOVN(rd,rs,rt)					\
+		movn	rd,rs,rt
+# define MOVZ(rd,rs,rt)					\
+		movz	rd,rs,rt
+#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) */
+
+/*
+ * Stack alignment
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI64) || (_MIPS_SIM == _MIPS_SIM_NABI32)
+# define ALSZ	15
+# define ALMASK	~15
+#else
+# define ALSZ	7
+# define ALMASK	~7
+#endif
+
+/*
+ * Size of a register
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI64) || (_MIPS_SIM == _MIPS_SIM_NABI32)
+# define SZREG	8
+#else
+# define SZREG	4
+#endif
+
+/*
+ * Use the following macros in assemblercode to load/store registers,
+ * pointers etc.
+ */
+#if (SZREG == 4)
+# define REG_S sw
+# define REG_L lw
+#else
+# define REG_S sd
+# define REG_L ld
+#endif
+
+/*
+ * How to add/sub/load/store/shift C int variables.
+ */
+#if (_MIPS_SZINT == 32)
+# define INT_ADD	add
+# define INT_ADDI	addi
+# define INT_ADDU	addu
+# define INT_ADDIU	addiu
+# define INT_SUB	add
+# define INT_SUBI	subi
+# define INT_SUBU	subu
+# define INT_SUBIU	subu
+# define INT_L		lw
+# define INT_S		sw
+#endif
+
+#if (_MIPS_SZINT == 64)
+# define INT_ADD	dadd
+# define INT_ADDI	daddi
+# define INT_ADDU	daddu
+# define INT_ADDIU	daddiu
+# define INT_SUB	dadd
+# define INT_SUBI	dsubi
+# define INT_SUBU	dsubu
+# define INT_SUBIU	dsubu
+# define INT_L		ld
+# define INT_S		sd
+#endif
+
+/*
+ * How to add/sub/load/store/shift C long variables.
+ */
+#if (_MIPS_SZLONG == 32)
+# define LONG_ADD	add
+# define LONG_ADDI	addi
+# define LONG_ADDU	addu
+# define LONG_ADDIU	addiu
+# define LONG_SUB	add
+# define LONG_SUBI	subi
+# define LONG_SUBU	subu
+# define LONG_SUBIU	subu
+# define LONG_L		lw
+# define LONG_S		sw
+# define LONG_SLL	sll
+# define LONG_SLLV	sllv
+# define LONG_SRL	srl
+# define LONG_SRLV	srlv
+# define LONG_SRA	sra
+# define LONG_SRAV	srav
+#endif
+
+#if (_MIPS_SZLONG == 64)
+# define LONG_ADD	dadd
+# define LONG_ADDI	daddi
+# define LONG_ADDU	daddu
+# define LONG_ADDIU	daddiu
+# define LONG_SUB	dadd
+# define LONG_SUBI	dsubi
+# define LONG_SUBU	dsubu
+# define LONG_SUBIU	dsubu
+# define LONG_L		ld
+# define LONG_S		sd
+# define LONG_SLL	dsll
+# define LONG_SLLV	dsllv
+# define LONG_SRL	dsrl
+# define LONG_SRLV	dsrlv
+# define LONG_SRA	dsra
+# define LONG_SRAV	dsrav
+#endif
+
+/*
+ * How to add/sub/load/store/shift pointers.
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32 && _MIPS_SZPTR == 32)
+# define PTR_ADD	add
+# define PTR_ADDI	addi
+# define PTR_ADDU	addu
+# define PTR_ADDIU	addiu
+# define PTR_SUB	add
+# define PTR_SUBI	subi
+# define PTR_SUBU	subu
+# define PTR_SUBIU	subu
+# define PTR_L		lw
+# define PTR_LA		la
+# define PTR_S		sw
+# define PTR_SLL	sll
+# define PTR_SLLV	sllv
+# define PTR_SRL	srl
+# define PTR_SRLV	srlv
+# define PTR_SRA	sra
+# define PTR_SRAV	srav
+
+# define PTR_SCALESHIFT	2
+#endif
+
+#if _MIPS_SIM == _MIPS_SIM_NABI32
+# define PTR_ADD	add
+# define PTR_ADDI	addi
+# define PTR_ADDU	add /* no u */
+# define PTR_ADDIU	addi /* no u */
+# define PTR_SUB	add
+# define PTR_SUBI	subi
+# define PTR_SUBU	sub /* no u */
+# define PTR_SUBIU	sub /* no u */
+# define PTR_L		lw
+# define PTR_LA		la
+# define PTR_S		sw
+# define PTR_SLL	sll
+# define PTR_SLLV	sllv
+# define PTR_SRL	srl
+# define PTR_SRLV	srlv
+# define PTR_SRA	sra
+# define PTR_SRAV	srav
+
+# define PTR_SCALESHIFT	2
+#endif
+
+#if (_MIPS_SIM == _MIPS_SIM_ABI32 && _MIPS_SZPTR == 64 /* o64??? */) \
+    || _MIPS_SIM == _MIPS_SIM_ABI64
+# define PTR_ADD	dadd
+# define PTR_ADDI	daddi
+# define PTR_ADDU	daddu
+# define PTR_ADDIU	daddiu
+# define PTR_SUB	dadd
+# define PTR_SUBI	dsubi
+# define PTR_SUBU	dsubu
+# define PTR_SUBIU	dsubu
+# define PTR_L		ld
+# define PTR_LA		dla
+# define PTR_S		sd
+# define PTR_SLL	dsll
+# define PTR_SLLV	dsllv
+# define PTR_SRL	dsrl
+# define PTR_SRLV	dsrlv
+# define PTR_SRA	dsra
+# define PTR_SRAV	dsrav
+
+# define PTR_SCALESHIFT	3
+#endif
+
+/*
+ * Some cp0 registers were extended to 64bit for MIPS III.
+ */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
+    (_MIPS_ISA == _MIPS_ISA_MIPS32)
+# define MFC0	mfc0
+# define MTC0	mtc0
+#endif
+#if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
+    (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
+# define MFC0	dmfc0
+# define MTC0	dmtc0
+#endif
+
+/* The MIPS archtectures do not have a uniform memory model.  Particular
+   platforms may provide additional guarantees - for instance, the R4000
+   LL and SC instructions implicitly perform a SYNC, and the 4K promises
+   strong ordering.
+
+   However, in the absence of those guarantees, we must assume weak ordering
+   and SYNC explicitly where necessary.
+
+   Some obsolete MIPS processors may not support the SYNC instruction.  This
+   applies to "true" MIPS I processors; most of the processors which compile
+   using MIPS I implement parts of MIPS II.  */
+
+#ifndef MIPS_SYNC
+# define MIPS_SYNC      sync
+#endif
+
+#endif /* sys/asm.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sys/cachectl.h b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/cachectl.h
new file mode 100644
index 0000000..a93e1fb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/cachectl.h
@@ -0,0 +1,42 @@
+/* Copyright (C) 1995, 1996, 1997, 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 _SYS_CACHECTL_H
+#define _SYS_CACHECTL_H 1
+
+#include <features.h>
+
+/*
+ * Get the kernel definition for the op bits.
+ */
+#include <asm/cachectl.h>
+
+__BEGIN_DECLS
+
+#ifdef __USE_MISC
+extern int cachectl (void *addr, __const int nbytes, __const int op) __THROW;
+#endif
+extern int __cachectl (void *addr, __const int nbytes, __const int op) __THROW;
+#ifdef __USE_MISC
+extern int cacheflush (void *addr, __const int nbytes, __const int op) __THROW;
+#endif
+extern int _flush_cache (char *addr, __const int nbytes, __const int op) __THROW;
+
+__END_DECLS
+
+#endif /* sys/cachectl.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sys/fpregdef.h b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/fpregdef.h
new file mode 100644
index 0000000..3781152
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/fpregdef.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 1991, 92, 94, 95, 96, 97, 98 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_FPREGDEF_H
+#define _SYS_FPREGDEF_H
+
+/*
+ * These definitions only cover the R3000-ish 16/32 register model.
+ * But we're trying to be R3000 friendly anyway ...
+ */
+#define fv0	$f0      /* return value */
+#define fv0f	$f1
+#define fv1	$f2
+#define fv1f	$f3
+#define fa0	$f12     /* argument registers */
+#define fa0f	$f13
+#define fa1	$f14
+#define fa1f	$f15
+#define ft0	$f4      /* caller saved */
+#define ft0f	$f5
+#define ft1	$f6
+#define ft1f	$f7
+#define ft2	$f8
+#define ft2f	$f9
+#define ft3	$f10
+#define ft3f	$f11
+#define ft4	$f16
+#define ft4f	$f17
+#define ft5	$f18
+#define ft5f	$f19
+#define fs0	$f20     /* callee saved */
+#define fs0f	$f21
+#define fs1	$f22
+#define fs1f	$f23
+#define fs2	$f24
+#define fs2f	$f25
+#define fs3	$f26
+#define fs3f	$f27
+#define fs4	$f28
+#define fs4f	$f29
+#define fs5	$f30
+#define fs5f	$f31
+
+#define fcr31	$31      /* FPU status register */
+
+#endif /* sys/fpregdef.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/procfs.h
new file mode 100644
index 0000000..a21652e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/procfs.h
@@ -0,0 +1,112 @@
+/* Copyright (C) 1996, 1997, 1999, 2000, 2002 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 somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/user.h>
+
+/* ELF register definitions */
+#define ELF_NGREG	45
+#define ELF_NFPREG	33
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef double elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+__BEGIN_DECLS
+
+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.  Fields present but not used are
+   marked with "XXX".  */
+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.  */
+    long pr_uid;
+    long 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.  */
+  };
+
+
+/* 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 habe only ine PID type.  */
+typedef __pid_t lwpid_t;
+
+
+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/mips/sys/regdef.h b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/regdef.h
new file mode 100644
index 0000000..2d94130
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/regdef.h
@@ -0,0 +1,82 @@
+/* Copyright (C) 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ralf Baechle <ralf@gnu.org>.
+
+   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_REGDEF_H
+#define _SYS_REGDEF_H
+
+#include <sgidefs.h>
+
+/*
+ * Symbolic register names for 32 bit ABI
+ */
+#define zero    $0      /* wired zero */
+#define AT      $1      /* assembler temp  - uppercase because of ".set at" */
+#define v0      $2      /* return value */
+#define v1      $3
+#define a0      $4      /* argument registers */
+#define a1      $5
+#define a2      $6
+#define a3      $7
+#if _MIPS_SIM != _MIPS_SIM_ABI32
+#define a4      $8
+#define a5      $9
+#define a6      $10
+#define a7      $11
+#define t0      $12
+#define t1      $13
+#define t2      $14
+#define t3      $15
+#define ta0     a4
+#define ta1     a5
+#define ta2     a6
+#define ta3     a7
+#else /* if _MIPS_SIM == _MIPS_SIM_ABI32 */
+#define t0      $8      /* caller saved */
+#define t1      $9
+#define t2      $10
+#define t3      $11
+#define t4      $12
+#define t5      $13
+#define t6      $14
+#define t7      $15
+#define ta0     t4
+#define ta1     t5
+#define ta2     t6
+#define ta3     t7
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
+#define s0      $16     /* callee saved */
+#define s1      $17
+#define s2      $18
+#define s3      $19
+#define s4      $20
+#define s5      $21
+#define s6      $22
+#define s7      $23
+#define t8      $24     /* caller saved */
+#define t9      $25
+#define jp      $25     /* PIC jump register */
+#define k0      $26     /* kernel scratch */
+#define k1      $27
+#define gp      $28     /* global pointer */
+#define sp      $29     /* stack pointer */
+#define fp      $30     /* frame pointer */
+#define s8	$30	/* same like fp! */
+#define ra      $31     /* return address */
+
+#endif /* _SYS_REGDEF_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sys/sysmips.h b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/sysmips.h
new file mode 100644
index 0000000..6a63dc2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/sysmips.h
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991, 92, 94, 95, 96, 97, 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 _SYS_SYSMIPS_H
+#define _SYS_SYSMIPS_H 1
+
+#include <features.h>
+
+/*
+ * Commands for the sysmips(2) call
+ *
+ * sysmips(2) is deprecated - though some existing software uses it.
+ * We only support the following commands.  Sysmips exists for compatibility
+ * purposes only so new software should avoid it.
+ */
+#define SETNAME                   1	/* set hostname                  */
+#define FLUSH_CACHE		   3	/* writeback and invalidate caches */
+#define MIPS_FIXADE               7	/* control address error fixing  */
+#define MIPS_RDNVRAM              10	/* read NVRAM			 */
+#define MIPS_ATOMIC_SET		2001	/* atomically set variable       */
+
+__BEGIN_DECLS
+
+extern int sysmips (__const int cmd, __const long arg1,
+		    __const int arg2, __const int arg3) __THROW;
+
+__END_DECLS
+
+#endif /* sys/sysmips.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sys/tas.h b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/tas.h
new file mode 100644
index 0000000..1183b86
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/tas.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000.
+
+   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_TAS_H
+#define _SYS_TAS_H 1
+
+#include <features.h>
+#include <sgidefs.h>
+
+__BEGIN_DECLS
+
+extern int _test_and_set (int *p, int v) __THROW;
+
+#ifdef __USE_EXTERN_INLINES
+
+# ifndef _EXTERN_INLINE
+#  define _EXTERN_INLINE extern __inline
+# endif
+
+_EXTERN_INLINE int
+__NTH (_test_and_set (int *p, int v))
+{
+  int r, t;
+
+  __asm__ __volatile__
+    ("/* Inline test and set */\n"
+     "1:\n\t"
+     ".set	push\n\t"
+#if _MIPS_SIM == _ABIO32
+     ".set	mips2\n\t"
+#endif
+     "ll	%0,%3\n\t"
+     "move	%1,%4\n\t"
+     "beq	%0,%4,2f\n\t"
+     "sc	%1,%2\n\t"
+     ".set	pop\n\t"
+     "beqz	%1,1b\n"
+     "2:\n\t"
+     "/* End test and set */"
+     : "=&r" (r), "=&r" (t), "=m" (*p)
+     : "m" (*p), "r" (v)
+     : "memory");
+
+  return r;
+}
+
+#endif /* __USE_EXTERN_INLINES */
+
+__END_DECLS
+
+#endif /* sys/tas.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/ucontext.h
new file mode 100644
index 0000000..ac496f3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/ucontext.h
@@ -0,0 +1,117 @@
+/* Copyright (C) 1997, 1998, 2000, 2003, 2004, 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.  */
+
+/* Don't rely on this, the interface is currently messed up and may need to
+   be broken to be fixed.  */
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <sgidefs.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+/* Type for general register.  Even in o32 we assume 64-bit registers,
+   like the kernel.  */
+__extension__ typedef unsigned long long int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	32
+#define NFPREG	32
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+/* Container for all FPU registers.  */
+typedef struct fpregset {
+	union {
+		double	fp_dregs[NFPREG];
+		struct {
+			float		_fp_fregs;
+			unsigned int	_fp_pad;
+		} fp_fregs[NFPREG];
+	} fp_r;
+} fpregset_t;
+
+
+/* Context to describe whole processor state.  */
+#if _MIPS_SIM == _ABIO32
+/* Earlier versions of glibc for mips had an entirely different
+   definition of mcontext_t, that didn't even resemble the
+   corresponding kernel data structure.  Since all legitimate uses of
+   ucontext_t in glibc mustn't have accessed anything beyond
+   uc_mcontext and, even then, taking a pointer to it, casting it to
+   sigcontext_t, and accessing it as such, which is what it has always
+   been, this can still be rectified.  Fortunately, makecontext,
+   [gs]etcontext et all have never been implemented.  */
+typedef struct
+  {
+    unsigned int regmask;
+    unsigned int status;
+    greg_t pc;
+    gregset_t gregs;
+    fpregset_t fpregs;
+    unsigned int fp_owned;
+    unsigned int fpc_csr;
+    unsigned int fpc_eir;
+    unsigned int used_math;
+    unsigned int dsp;
+    greg_t mdhi;
+    greg_t mdlo;
+    unsigned long hi1;
+    unsigned long lo1;
+    unsigned long hi2;
+    unsigned long lo2;
+    unsigned long hi3;
+    unsigned long lo3;
+  } mcontext_t;
+#else
+typedef struct
+  {
+    gregset_t gregs;
+    fpregset_t fpregs;
+    greg_t mdhi;
+    greg_t hi1;
+    greg_t hi2;
+    greg_t hi3;
+    greg_t mdlo;
+    greg_t lo1;
+    greg_t lo2;
+    greg_t lo3;
+    greg_t pc;
+    unsigned int fpc_csr;
+    unsigned int used_math;
+    unsigned int dsp;
+    unsigned int reserved;
+  } mcontext_t;
+#endif
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/user.h
new file mode 100644
index 0000000..5d88094
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sys/user.h
@@ -0,0 +1,217 @@
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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
+
+#include <sgidefs.h>
+
+/* 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 <asm/reg.h> */
+/* Instead of including the kernel header, that will vary depending on
+   whether the 32- or the 64-bit kernel is installed, we paste its
+   contents here.  Note that the fact that the file is inline here,
+   instead of included separately, doesn't change in any way the
+   licensing status of a program that includes user.h.  Since this is
+   for gdb alone, and gdb is GPLed, no surprises here.  */
+#if _MIPS_SIM == _ABIO32
+/*
+ * Various register offset definitions for debuggers, core file
+ * examiners and whatnot.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1999 by Ralf Baechle
+ */
+#ifndef __ASM_MIPS_REG_H
+#define __ASM_MIPS_REG_H
+
+/*
+ * This defines/structures correspond to the register layout on stack -
+ * if the order here is changed, it needs to be updated in
+ * include/asm-mips/stackframe.h
+ */
+#define EF_REG0			6
+#define EF_REG1			7
+#define EF_REG2			8
+#define EF_REG3			9
+#define EF_REG4			10
+#define EF_REG5			11
+#define EF_REG6			12
+#define EF_REG7			13
+#define EF_REG8			14
+#define EF_REG9			15
+#define EF_REG10		16
+#define EF_REG11		17
+#define EF_REG12		18
+#define EF_REG13		19
+#define EF_REG14		20
+#define EF_REG15		21
+#define EF_REG16		22
+#define EF_REG17		23
+#define EF_REG18		24
+#define EF_REG19		25
+#define EF_REG20		26
+#define EF_REG21		27
+#define EF_REG22		28
+#define EF_REG23		29
+#define EF_REG24		30
+#define EF_REG25		31
+/*
+ * k0/k1 unsaved
+ */
+#define EF_REG28		34
+#define EF_REG29		35
+#define EF_REG30		36
+#define EF_REG31		37
+
+/*
+ * Saved special registers
+ */
+#define EF_LO			38
+#define EF_HI			39
+
+#define EF_CP0_EPC		40
+#define EF_CP0_BADVADDR		41
+#define EF_CP0_STATUS		42
+#define EF_CP0_CAUSE		43
+
+#define EF_SIZE			180	/* size in bytes */
+
+#endif /* __ASM_MIPS_REG_H */
+
+#else /* _MIPS_SIM != _ABIO32 */
+
+/*
+ * Various register offset definitions for debuggers, core file
+ * examiners and whatnot.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1999 Ralf Baechle
+ * Copyright (C) 1995, 1999 Silicon Graphics
+ */
+#ifndef _ASM_REG_H
+#define _ASM_REG_H
+
+/*
+ * This defines/structures correspond to the register layout on stack -
+ * if the order here is changed, it needs to be updated in
+ * include/asm-mips/stackframe.h
+ */
+#define EF_REG0			 0
+#define EF_REG1			 1
+#define EF_REG2			 2
+#define EF_REG3			 3
+#define EF_REG4			 4
+#define EF_REG5			 5
+#define EF_REG6			 6
+#define EF_REG7			 7
+#define EF_REG8			 8
+#define EF_REG9			 9
+#define EF_REG10		10
+#define EF_REG11		11
+#define EF_REG12		12
+#define EF_REG13		13
+#define EF_REG14		14
+#define EF_REG15		15
+#define EF_REG16		16
+#define EF_REG17		17
+#define EF_REG18		18
+#define EF_REG19		19
+#define EF_REG20		20
+#define EF_REG21		21
+#define EF_REG22		22
+#define EF_REG23		23
+#define EF_REG24		24
+#define EF_REG25		25
+/*
+ * k0/k1 unsaved
+ */
+#define EF_REG28		28
+#define EF_REG29		29
+#define EF_REG30		30
+#define EF_REG31		31
+
+/*
+ * Saved special registers
+ */
+#define EF_LO			32
+#define EF_HI			33
+
+#define EF_CP0_EPC		34
+#define EF_CP0_BADVADDR		35
+#define EF_CP0_STATUS		36
+#define EF_CP0_CAUSE		37
+
+#define EF_SIZE			304	/* size in bytes */
+
+#endif /* _ASM_REG_H */
+
+#endif /* _MIPS_SIM != _ABIO32 */
+
+#if _MIPS_SIM == _ABIO32
+
+struct user
+{
+  unsigned long	regs[EF_SIZE/4+64];	/* integer and fp regs */
+  size_t	u_tsize;		/* text size (pages) */
+  size_t	u_dsize;		/* data size (pages) */
+  size_t	u_ssize;		/* stack size (pages) */
+  unsigned long	start_code;		/* text starting address */
+  unsigned long	start_data;		/* data starting address */
+  unsigned long	start_stack;		/* stack starting address */
+  long int	signal;			/* signal causing core dump */
+  void*		u_ar0;			/* help gdb find registers */
+  unsigned long	magic;			/* identifies a core file */
+  char		u_comm[32];		/* user command name */
+};
+
+#else
+
+struct user {
+  __extension__ unsigned long	regs[EF_SIZE/8+64]; /* integer and fp regs */
+  __extension__ unsigned long	u_tsize;	/* text size (pages) */
+  __extension__ unsigned long	u_dsize;	/* data size (pages) */
+  __extension__ unsigned long	u_ssize;	/* stack size (pages) */
+  __extension__ unsigned long long start_code;	/* text starting address */
+  __extension__ unsigned long long start_data;	/* data starting address */
+  __extension__ unsigned long long start_stack;	/* stack starting address */
+  __extension__ long long	signal;		/* signal causing core dump */
+  __extension__ unsigned long long u_ar0;	/* help gdb find registers */
+  __extension__ unsigned long long magic;	/* identifies a core file */
+  char		u_comm[32];		/* user command name */
+};
+
+#endif
+
+#include <bits/uClibc_page.h>
+#define NBPG			PAGE_SIZE
+#define UPAGES			1
+#define HOST_TEXT_START_ADDR	(u.start_code)
+#define HOST_DATA_START_ADDR	(u.start_data)
+#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
+
+#endif	/* _SYS_USER_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/syscall.S b/ap/build/uClibc/libc/sysdeps/linux/mips/syscall.S
new file mode 100644
index 0000000..acb9101
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/syscall.S
@@ -0,0 +1,80 @@
+/* Copyright (C) 1996, 1997 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 <sys/asm.h>
+#include <sys/regdef.h>
+
+#ifdef __PIC__
+	.option pic2
+#endif
+.text
+.align  2
+.globl  syscall
+.type   syscall,@function
+.ent    syscall
+syscall:
+#ifdef __PIC__
+	SETUP_GP
+#endif
+	move	v0, a0		/* Load system call number from first arg.  */
+	move	a0, a1		/* Move the next three args up a register.  */
+	move	a1, a2
+	move	a2, a3
+     	/* Load the remaining possible args (up to 7) from the stack.  */
+#ifdef __mips64
+	move	a3, a4
+	move	a4, a5
+	move	a5, a6
+	move	a6, a7
+	daddiu	sp,sp,-16
+	sd	v0,0*8(sp)
+	ld	v0,0*8(sp)	/* for system call restarts */
+#else
+	lw	a3,4*4(sp)
+	lw	t0,5*4(sp)
+	lw	t1,6*4(sp)
+	lw	t2,7*4(sp)
+	addiu	sp,sp,-32
+	sw	t0,4*4(sp)
+	sw	t1,5*4(sp)
+	sw	t2,6*4(sp)
+	sw	v0,7*4(sp)
+	lw	v0,7*4(sp)	/* for system call restarts */
+#endif
+	syscall			/* Do the system call.  */
+#ifdef __mips64
+	daddiu	sp,sp,16
+#else
+	addiu	sp,sp,32
+#endif
+	bnez	a3, 1f
+     	j ra			/* Return to caller.  */
+1:
+	move	a0,v0		/* Pass return val to C function. */
+
+#ifdef __PIC__
+	SETUP_GP64(v0, syscall)
+	PTR_LA	t9, __syscall_error
+	RESTORE_GP64
+	jr	t9
+#else
+	j	__syscall_error
+#endif
+.end    syscall
+.size   syscall,.-syscall
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/syscall_error.S b/ap/build/uClibc/libc/sysdeps/linux/mips/syscall_error.S
new file mode 100644
index 0000000..51a8efa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/syscall_error.S
@@ -0,0 +1,84 @@
+/* Copyright (C) 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2002, 2003
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Brendan Kehoe (brendan@zen.org).
+
+   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/asm.h>
+#include <sysdep.h>
+#include <bits/errno.h>
+
+#ifdef _LIBC_REENTRANT
+
+LOCALSZ= 3
+FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
+RAOFF= FRAMESZ-(1*SZREG)
+GPOFF= FRAMESZ-(2*SZREG)
+V0OFF= FRAMESZ-(3*SZREG)
+
+ENTRY(__syscall_error)
+#ifdef __PIC__
+	.set noat
+	SETUP_GPX (AT)
+	.set at
+#endif
+	PTR_SUBU sp, FRAMESZ
+	.set noat
+	SETUP_GPX64(GPOFF,AT)
+	.set at
+#ifdef __PIC__
+	SAVE_GP(GPOFF)
+#endif
+	REG_S	v0, V0OFF(sp)
+	REG_S	ra, RAOFF(sp)
+
+	/* Find our per-thread errno address  */
+	jal	__errno_location
+
+	/* Store the error value.  */
+	REG_L	t0, V0OFF(sp)
+	sw	t0, 0(v0)
+
+	/* And just kick back a -1.  */
+	REG_L	ra, RAOFF(sp)
+	RESTORE_GP64
+	PTR_ADDU sp, FRAMESZ
+	li	v0, -1
+	j	ra
+	END(__syscall_error)
+
+#else /* __LIBC_REENTRANT */
+
+
+ENTRY(__syscall_error)
+#ifdef __PIC__
+	.set noat
+	SETUP_GPX (AT)
+	.set at
+#endif
+	SETUP_GPX64 (t9, AT)
+
+	/* Store it in errno... */
+	sw v0, errno
+
+	/* And just kick back a -1.  */
+	li v0, -1
+
+	RESTORE_GP64
+	j ra
+	END(__syscall_error)
+#endif  /* _LIBC_REENTRANT*/
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/mips/sysdep.h
new file mode 100644
index 0000000..9de4f1a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sysdep.h
@@ -0,0 +1,393 @@
+/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003, 2004
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Brendan Kehoe (brendan@zen.org).
+
+   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_MIPS_SYSDEP_H
+#define _LINUX_MIPS_SYSDEP_H 1
+
+#include <sgidefs.h>
+#include <common/sysdep.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
+#ifdef __STDC__
+# define SYS_ify(syscall_name)	__NR_##syscall_name
+#else
+# define SYS_ify(syscall_name)	__NR_/**/syscall_name
+#endif
+
+#ifdef __ASSEMBLER__
+
+#include <sys/regdef.h>
+
+#define ENTRY(name) 					\
+  .globl name;						\
+  .align 2;						\
+  .ent name,0;						\
+  name##:
+
+#undef END
+#define	END(function)					\
+		.end	function;			\
+		.size	function,.-function
+
+#define ret	j ra ; nop
+
+#undef PSEUDO_END
+#define PSEUDO_END(sym) .end sym; .size sym,.-sym
+
+#define PSEUDO_NOERRNO(name, syscall_name, args)	\
+  .align 2;						\
+  ENTRY(name)						\
+  .set noreorder;					\
+  li v0, SYS_ify(syscall_name);				\
+  syscall
+
+#undef PSEUDO_END_NOERRNO
+#define PSEUDO_END_NOERRNO(sym) .end sym; .size sym,.-sym
+
+#define ret_NOERRNO ret
+
+#define PSEUDO_ERRVAL(name, syscall_name, args)		\
+  .align 2;						\
+  ENTRY(name)						\
+  .set noreorder;					\
+  li v0, SYS_ify(syscall_name);				\
+  syscall
+
+#undef PSEUDO_END_ERRVAL
+#define PSEUDO_END_ERRVAL(sym) .end sym; .size sym,.-sym
+
+#define ret_ERRVAL ret
+
+#define r0	v0
+#define r1	v1
+/* The mips move insn is d,s.  */
+#define MOVE(x,y)	move y , x
+
+#if _MIPS_SIM == _ABIO32
+# define L(label) $L ## label
+#else
+# define L(label) .L ## label
+#endif
+
+/* Note that while it's better structurally, going back to call __syscall_error
+   can make things confusing if you're debugging---it looks like it's jumping
+   backwards into the previous fn.  */
+
+#ifdef __PIC__
+#define PSEUDO(name, syscall_name, args) 		\
+  .align 2;						\
+  99: move a0, v0;					\
+  la t9,__syscall_error;				\
+  jr t9;						\
+  ENTRY(name)						\
+  .set noreorder;					\
+  .cpload t9;						\
+  li v0, SYS_ify(syscall_name);				\
+  syscall;						\
+  .set reorder;						\
+  bne a3, zero, 99b;					\
+L(syse1):
+#else
+#define PSEUDO(name, syscall_name, args) 		\
+  .set noreorder;					\
+  .align 2;						\
+  99: move a0, v0;					\
+  j __syscall_error;					\
+  nop;							\
+  ENTRY(name)						\
+  .set noreorder;					\
+  li v0, SYS_ify(syscall_name);				\
+  syscall;						\
+  .set reorder;						\
+  bne a3, zero, 99b;					\
+L(syse1):
+#endif
+
+/* We don't want the label for the error handler to be visible in the symbol
+   table when we define it here.  */
+#ifdef __PIC__
+# define SYSCALL_ERROR_LABEL 99b
+#endif
+
+#else   /* ! __ASSEMBLER__ */
+
+/* Define a macro which expands into the inline wrapper code for a system
+   call.  */
+#undef INLINE_SYSCALL
+#define INLINE_SYSCALL(name, nr, args...)				\
+  ({ INTERNAL_SYSCALL_DECL(err);					\
+     long result_var = INTERNAL_SYSCALL (name, err, nr, args);		\
+     if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) )			\
+       {								\
+	 __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err));	\
+	 result_var = -1L;						\
+       }								\
+     result_var; })
+
+#undef INTERNAL_SYSCALL_DECL
+#define INTERNAL_SYSCALL_DECL(err) long err
+
+#undef INTERNAL_SYSCALL_ERROR_P
+#define INTERNAL_SYSCALL_ERROR_P(val, err)   ((long) (err))
+
+#undef INTERNAL_SYSCALL_ERRNO
+#define INTERNAL_SYSCALL_ERRNO(val, err)     (val)
+
+#undef INTERNAL_SYSCALL
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+	internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t",	\
+			      "i" (SYS_ify (name)), err, args)
+
+#undef INTERNAL_SYSCALL_NCS
+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+	internal_syscall##nr (= number, , "r" (__v0), err, args)
+#undef internal_syscall0
+#define internal_syscall0(ncs_init, cs_init, input, err, dummy...)	\
+({									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __v0 __asm__("$2") ncs_init;			\
+	register long __a3 __asm__("$7");				\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	".set reorder"							\
+	: "=r" (__v0), "=r" (__a3)					\
+	: input								\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#undef internal_syscall1
+#define internal_syscall1(ncs_init, cs_init, input, err, arg1)		\
+({									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __v0 __asm__("$2") ncs_init;			\
+	register long __a0 __asm__("$4") = (long) arg1;			\
+	register long __a3 __asm__("$7");				\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	".set reorder"							\
+	: "=r" (__v0), "=r" (__a3)					\
+	: input, "r" (__a0)						\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#undef internal_syscall2
+#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2)	\
+({									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __v0 __asm__("$2") ncs_init;			\
+	register long __a0 __asm__("$4") = (long) arg1;			\
+	register long __a1 __asm__("$5") = (long) arg2;			\
+	register long __a3 __asm__("$7");				\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	".set\treorder"							\
+	: "=r" (__v0), "=r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1)					\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#undef internal_syscall3
+#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3)\
+({									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __v0 __asm__("$2") ncs_init;			\
+	register long __a0 __asm__("$4") = (long) arg1;			\
+	register long __a1 __asm__("$5") = (long) arg2;			\
+	register long __a2 __asm__("$6") = (long) arg3;			\
+	register long __a3 __asm__("$7");				\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	".set\treorder"							\
+	: "=r" (__v0), "=r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#undef internal_syscall4
+#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4)\
+({									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __v0 __asm__("$2") ncs_init;			\
+	register long __a0 __asm__("$4") = (long) arg1;			\
+	register long __a1 __asm__("$5") = (long) arg2;			\
+	register long __a2 __asm__("$6") = (long) arg3;			\
+	register long __a3 __asm__("$7") = (long) arg4;			\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	".set\treorder"							\
+	: "=r" (__v0), "+r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+/* We need to use a frame pointer for the functions in which we
+   adjust $sp around the syscall, or debug information and unwind
+   information will be $sp relative and thus wrong during the syscall.  As
+   of GCC 3.4.3, this is sufficient.  */
+#define FORCE_FRAME_POINTER alloca (4)
+
+#undef internal_syscall5
+#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5)\
+({									\
+	long _sys_result;						\
+									\
+	FORCE_FRAME_POINTER;						\
+	{								\
+	register long __v0 __asm__("$2") ncs_init;			\
+	register long __a0 __asm__("$4") = (long) arg1;			\
+	register long __a1 __asm__("$5") = (long) arg2;			\
+	register long __a2 __asm__("$6") = (long) arg3;			\
+	register long __a3 __asm__("$7") = (long) arg4;			\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	"subu\t$29, 32\n\t"						\
+	"sw\t%6, 16($29)\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	"addiu\t$29, 32\n\t"						\
+	".set\treorder"							\
+	: "=r" (__v0), "+r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2),			\
+	  "r" ((long)arg5)						\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#undef internal_syscall6
+#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6)\
+({									\
+	long _sys_result;						\
+									\
+	FORCE_FRAME_POINTER;						\
+	{								\
+	register long __v0 __asm__("$2") ncs_init;			\
+	register long __a0 __asm__("$4") = (long) arg1;			\
+	register long __a1 __asm__("$5") = (long) arg2;			\
+	register long __a2 __asm__("$6") = (long) arg3;			\
+	register long __a3 __asm__("$7") = (long) arg4;			\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	"subu\t$29, 32\n\t"						\
+	"sw\t%6, 16($29)\n\t"						\
+	"sw\t%7, 20($29)\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	"addiu\t$29, 32\n\t"						\
+	".set\treorder"							\
+	: "=r" (__v0), "+r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2),			\
+	  "r" ((long)arg5), "r" ((long)arg6)				\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#undef internal_syscall7
+#define internal_syscall7(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\
+({									\
+	long _sys_result;						\
+									\
+	FORCE_FRAME_POINTER;						\
+	{								\
+	register long __v0 __asm__("$2") ncs_init;			\
+	register long __a0 __asm__("$4") = (long) arg1;			\
+	register long __a1 __asm__("$5") = (long) arg2;			\
+	register long __a2 __asm__("$6") = (long) arg3;			\
+	register long __a3 __asm__("$7") = (long) arg4;			\
+	__asm__ __volatile__ (						\
+	".set\tnoreorder\n\t"						\
+	"subu\t$29, 32\n\t"						\
+	"sw\t%6, 16($29)\n\t"						\
+	"sw\t%7, 20($29)\n\t"						\
+	"sw\t%8, 24($29)\n\t"						\
+	cs_init								\
+	"syscall\n\t"							\
+	"addiu\t$29, 32\n\t"						\
+	".set\treorder"							\
+	: "=r" (__v0), "+r" (__a3)					\
+	: input, "r" (__a0), "r" (__a1), "r" (__a2),			\
+	  "r" ((long)arg5), "r" ((long)arg6), "r" ((long)arg7)		\
+	: __SYSCALL_CLOBBERS);						\
+	err = __a3;							\
+	_sys_result = __v0;						\
+	}								\
+	_sys_result;							\
+})
+
+#undef __SYSCALL_CLOBBERS
+#define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", \
+	"$14", "$15", "$24", "$25", "memory"
+
+/* Pointer mangling is not yet supported for MIPS.  */
+#define PTR_MANGLE(var) (void) (var)
+#define PTR_DEMANGLE(var) (void) (var)
+
+#endif  /* __ASSEMBLER__ */
+#endif /* _LINUX_MIPS_SYSDEP_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/sysmips.c b/ap/build/uClibc/libc/sysdeps/linux/mips/sysmips.c
new file mode 100644
index 0000000..1384782
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/sysmips.c
@@ -0,0 +1,7 @@
+#include <errno.h>
+#include <sys/syscall.h>
+#include <sys/sysmips.h>
+
+#ifdef __NR_sysmips
+_syscall4(int, sysmips, const int, cmd, const long, arg1, const int, arg2, const int, arg3)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/mips/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/mips/vfork.S
new file mode 100644
index 0000000..b307447
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/mips/vfork.S
@@ -0,0 +1,100 @@
+/* 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.  */
+
+/* vfork() is just a special case of clone().  */
+
+#include <sys/asm.h>
+#include <sysdep.h>
+
+#ifndef SAVE_PID
+#define SAVE_PID
+#endif
+
+#ifndef RESTORE_PID
+#define RESTORE_PID
+#endif
+
+#ifdef __NR_fork
+
+/* int vfork() */
+
+	.text
+LOCALSZ= 1
+FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
+GPOFF= FRAMESZ-(1*SZREG)
+NESTED(__vfork,FRAMESZ,sp)
+#ifdef __PIC__
+	SETUP_GP
+#endif
+	PTR_SUBU sp, FRAMESZ
+	SETUP_GP64 (a5, __vfork)
+#ifdef __PIC__
+	SAVE_GP (GPOFF)
+#endif
+#ifdef PROF
+# if (_MIPS_SIM != _ABIO32)
+	PTR_S		a5, GPOFF(sp)
+# endif
+	.set		noat
+	move		$1, ra
+# if (_MIPS_SIM == _ABIO32)
+	subu		sp,sp,8
+# endif
+	jal		_mcount
+	.set		at
+# if (_MIPS_SIM != _ABIO32)
+	PTR_L		a5, GPOFF(sp)
+# endif
+#endif
+
+	PTR_ADDU	sp, FRAMESZ
+
+	SAVE_PID
+
+	li		a0, 0x4112	/* CLONE_VM | CLONE_VFORK | SIGCHLD */
+	move		a1, sp
+
+	/* Do the system call */
+	li		v0,__NR_clone
+	syscall
+
+	RESTORE_PID
+
+	bnez		a3,L(error)
+
+	/* Successful return from the parent or child.  */
+	RESTORE_GP64
+	j		ra
+	nop
+
+	/* Something bad happened -- no child created.  */
+L(error):
+#ifdef __PIC__
+	PTR_LA		t9, __syscall_error
+	RESTORE_GP64
+	jr		t9
+#else
+	RESTORE_GP64
+	j		__syscall_error
+#endif
+	END(__vfork)
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/Makefile b/ap/build/uClibc/libc/sysdeps/linux/nios/Makefile
new file mode 100644
index 0000000..3970f62
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/Makefile
@@ -0,0 +1,13 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2006 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/nios/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/nios/Makefile.arch
new file mode 100644
index 0000000..6a2c323
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/Makefile.arch
@@ -0,0 +1,12 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+CSRC := brk.c crtbegin.c crtend.c
+
+SSRC := \
+	__longjmp.S bsd-_setjmp.S bsd-setjmp.S setjmp.S \
+	clone.S vfork.S
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/NM_Macros.S b/ap/build/uClibc/libc/sysdeps/linux/nios/NM_Macros.S
new file mode 100644
index 0000000..da61365
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/NM_Macros.S
@@ -0,0 +1,473 @@
+
+;------------------------------
+; Macros I: Faux Instructions
+;
+; The following "faux instructions" are
+; implemented here as macros:
+;
+; MOVIP register,constant		MOVI with optional PFX & MOVHI, or BGEN
+; ADDIP register,constant		PFX and ADDI with optional PFX
+; SUBIP register,constant		PFX and SUBI with optional PFX
+; CMPIP register,constant		PFX and CMPI with optional PFX
+;
+; MOVI16 register,constant		PFX and MOVI
+; MOVI32 register,constant		PFX, MOVI, PFX, and MOVHI
+; MOVIA  register,constant		PFX and MOVHI on Nios32, and PFX and MOVI
+;
+; ANDIP register,constant		PFX and ANDI
+; ANDNIP register,constant		PFX and ANDN
+; ORIP register,constant		PFX and ORI
+; XORIP register,constant		PFX and XORI
+;
+; _BSR address						MOVIP address to %g7, and CALL
+; _BR address						MOVIP address to %g7, and JMP
+;
+; BEQ address						SKPS cc_nz and BR, has delay slot
+; BNE address						SKPS cc_z and BR, has delay slot
+; BLE address						SKPS cc_gt and BR, has delay slot
+; BLT address						SKPS cc_ge and BR, has delay slot
+; RESTRET							RESTORE and JMP %i7 
+;
+;-------------------------------
+; Macros II: Printing
+;
+; These macros are guaranteed *not*
+; to have branch delay slot after them.
+;
+; NM_PrintChar char
+; NM_Print "string"
+; NM_PrintLn "string"			Follows it with a carriage return
+; NM_PrintRegister reg			For debugging, prints register name & value
+;
+;-------------------------------
+; Macros III: Inline Debugging
+;
+; These macros print various information
+; using large sections of expanded inline code.
+; They each use either few or no registers.
+; Thus, they may be safely used in interrupt handlers.
+;
+; NM_D_TxChar char			print char to UART, affects no registers
+; NM_D_TxRegister char,char,register	prints the two characters, and the hex register value
+
+; --------------------------------------
+
+
+		.macro	_pfx_op	OP,reg,val,pForce=0
+		.if		(\pForce) || ((\val) > (31)) || ((\val) < (0))
+		PFX		%hi(\val)
+		.endif
+		\OP		\reg,%lo(\val)
+		.endm
+
+		.macro	_bgen reg,val,bit
+		.if ((\val)==(1<<\bit))
+		BGEN	\reg,\bit
+		.equ	_bgenBit,1
+		.endif
+		.endm
+
+	;------------------------
+	; MOVIP %reg,32-bit-value
+		.macro	MOVIP reg,val
+		; Methodically test every BGEN possibility...
+		.equ	_bgenBit,0
+.if 1
+		_bgen \reg,\val,0
+		_bgen \reg,\val,1
+		_bgen \reg,\val,2
+		_bgen \reg,\val,3
+		_bgen \reg,\val,4
+		_bgen \reg,\val,5
+		_bgen \reg,\val,6
+		_bgen \reg,\val,7
+		_bgen \reg,\val,8
+		_bgen \reg,\val,9
+		_bgen \reg,\val,10
+		_bgen \reg,\val,11
+		_bgen \reg,\val,12
+		_bgen \reg,\val,13
+		_bgen \reg,\val,14
+		_bgen \reg,\val,15
+		_bgen \reg,\val,16
+		_bgen \reg,\val,17
+		_bgen \reg,\val,18
+		_bgen \reg,\val,19
+		_bgen \reg,\val,20
+		_bgen \reg,\val,21
+		_bgen \reg,\val,22
+		_bgen \reg,\val,23
+		_bgen \reg,\val,24
+		_bgen \reg,\val,25
+		_bgen \reg,\val,26
+		_bgen \reg,\val,27
+		_bgen \reg,\val,28
+		_bgen \reg,\val,29
+		_bgen \reg,\val,30
+		_bgen \reg,\val,31
+
+		; If no bgen fit...
+.endif
+		.if !_bgenBit
+			.if ((\val) & 0xFFE0)
+				PFX %hi(\val)
+			.endif
+			MOVI \reg,%lo(\val)
+			.if __nios32__
+				.if ((\val) & 0xffff0000)
+					.if ((\val) & 0xFFE00000)
+						PFX %xhi(\val)
+					.endif
+					MOVHI \reg,%xlo(\val)
+				.endif
+			.endif
+		.endif
+
+		.endm
+
+	; ADDIP %reg,16-bit-value
+		.macro	ADDIP reg,val
+		_pfx_op	ADDI,\reg,\val
+		.endm
+
+	; SUBIP %reg,16-bit-value
+		.macro	SUBIP reg,val
+		_pfx_op	SUBI,\reg,\val
+		.endm
+
+	; CMPIP %reg,16-bit-value
+		.macro	CMPIP reg,val
+		_pfx_op	CMPI,\reg,\val
+		.endm
+
+	; ANDIP %reg,16-bit-value
+		.macro	ANDIP reg,val
+		PFX		%hi(\val)
+		AND		\reg,%lo(\val)
+		.endm
+
+	; ANDNIP %reg,16-bit-value
+		.macro	ANDNIP reg,val
+		PFX		%hi(\val)
+		ANDN		\reg,%lo(\val)
+		.endm
+
+	; ORIP %reg,16-bit-value
+		.macro	ORIP reg,val
+		PFX		%hi(\val)
+		OR			\reg,%lo(\val)
+		.endm
+
+	; XORIP %reg,16-bit-value
+		.macro	XORIP reg,val
+		PFX		%hi(\val)
+		XOR		\reg,%lo(\val)
+		.endm
+
+	; BEQ addr
+		.macro	BEQ addr
+		IFS		cc_eq
+		BR			\addr
+		.endm
+
+	; BNE addr
+		.macro	BNE addr
+		IFS		cc_ne
+		BR			\addr
+		.endm
+
+	; BLE addr
+		.macro	BLE addr
+		SKPS		cc_gt
+		BR			\addr
+		.endm
+
+	; BLT addr
+		.macro	BLT addr
+		SKPS		cc_ge
+		BR			\addr
+		.endm
+
+		.macro	digitToChar reg
+		ANDIP	\reg,0x000f
+		CMPI	\reg,10
+		SKPS	cc_lt
+		ADDI	\reg,'A'-'0'-10
+		PFX		%hi('0')
+		ADDI	\reg,%lo('0')
+		.endm
+
+; PUSHRET == dec sp, and stash return addr
+	.macro	PUSHRET
+	SUBI		%sp,2
+	ST			[%sp],%o7
+	.endm
+; POPRET == pop and jump
+	.macro	POPRET
+	LD			%o7,[%sp]
+	JMP		%o7
+	ADDI		%sp,2		; branch delay slot
+	.endm
+
+; RESTRET = restore & return
+	.macro	RESTRET
+	JMP		%i7
+	RESTORE
+	.endm
+
+	;--------------------
+	; MOVI16 %reg,Address
+	;
+	.macro	MOVI16	reg,val
+	PFX	%hi(\val)
+	MOVI	\reg,%lo(\val)
+	.endm
+
+	;--------------------
+	; MOVI32 %reg,Address
+	;
+	.macro	MOVI32	reg,val
+	PFX	%hi(\val)
+	MOVI	\reg,%lo(\val)
+	PFX	%xhi(\val)
+	MOVHI	\reg,%xlo(\val)
+	.endm
+
+	;--------------------
+	; MOVIA %reg,Address
+	;
+	.macro	MOVIA		reg,val
+	.if __nios32__
+		MOVI32 \reg,\val
+	.else
+		MOVI16 \reg,\val
+	.endif
+	.endm
+
+	;--------------------
+	; _BR
+
+	.macro _BR target,viaRegister=%g7
+	MOVIA	\viaRegister,\target@h
+	JMP	\viaRegister
+	.endm
+
+	;--------------------
+	; _BSR
+
+	.macro _BSR target,viaRegister=%g7
+	MOVIA	\viaRegister,\target@h
+	CALL	\viaRegister
+	.endm
+
+	;---------------------
+	; NM_Print "Your String Here"
+	;
+	.macro	NM_Print	string
+
+	BR		pastStringData\@
+	NOP
+
+stringData\@:
+	.asciz	"\string"
+	.align 1		; aligns by 2^n
+pastStringData\@:
+	MOVIA		%o0,stringData\@
+	_BSR		NR_TxString
+	NOP
+	.endm
+
+	.macro	NM_PrintLn string
+	NM_Print	"\string"
+	_BSR		NR_TxCR
+	NOP
+	.endm
+
+	.macro	NM_PrintRegister reg	; affects %g0 & %g1 & %g7, but thrashes the CWP a bit
+	SAVE		%sp,-16
+	NM_Print	"\reg = "
+	RESTORE
+	MOV		%g0,\reg
+	SAVE		%sp,-16
+	MOV		%o0,%g0
+	_BSR		NR_TxHex
+	NOP
+	_BSR		NR_TxCR
+	NOP
+	RESTORE
+	.endm
+
+	.macro	NM_PrintChar char
+	MOVIP		%o0,\char
+	_BSR		NR_TxChar
+	NOP
+	.endm
+
+	.macro	NM_Print2Chars char1,char2
+	MOVIP		%o0,(\char2<<8)+\char1
+	_BSR		NR_TxChar
+	NOP
+	_BSR		NR_TxChar
+	LSRI		%o0,8
+	.endm
+
+
+
+; ---------------------------
+; Completely inline UART sends
+; Send the char, or %g7 if not there.
+; Trashes %g5 and %g6 and %g7...
+
+	.macro	NM_TxChar char=0
+;NM_D_Delay 1000
+	MOVIA	%g6,NA_UARTBase
+txCharLoop\@:
+	PFX	2
+.if \char
+	LD	%g7,[%g6]
+	SKP1	%g7,6
+.else
+	LD	%g5,[%g6]
+	SKP1	%g5,6
+.endif
+	BR	txCharLoop\@
+	NOP
+.if \char
+	MOVIP	%g7,\char
+.endif
+	PFX	1
+	ST	[%g6],%g7
+;NM_D_Delay 4
+	.endm
+
+		.macro NM_TxCR
+		NM_TxChar 13
+		NM_TxChar 10
+		.endm
+
+		.macro NM_TxHexDigit,reg,shift
+		MOV		%g7,\reg
+		LSRI		%g7,\shift
+		ANDIP		%g7,0x000f
+		CMPI		%g7,10
+		SKPS		cc_lt
+		ADDIP		%g7,'A'-'0'-10
+		ADDIP		%g7,'0'
+		NM_TxChar
+		.endm
+
+		.macro NM_TxHex
+
+	.if __nios32__
+		NM_TxHexDigit %g0,28
+		NM_TxHexDigit %g0,24
+		NM_TxHexDigit %g0,20
+		NM_TxHexDigit %g0,16
+	.endif
+
+		NM_TxHexDigit %g0,12
+		NM_TxHexDigit %g0,8
+		NM_TxHexDigit %g0,4
+		NM_TxHexDigit %g0,0
+		.endm
+
+
+
+
+
+
+
+
+
+
+; ----------------------
+; The following macros are
+; rather mighty. They expand
+; to large inline code for
+; printing various things to
+; the serial port. They are
+; useful for debugging
+; trap handlers, where you
+; can't just go and call
+; NR_TxChar and such, because,
+; well, the CWP might be
+; off limits!
+;
+; They do, however, presume
+; that the stack is in good
+; working order.
+
+
+.macro NM_D_PushGRegisters
+ 	SUBIP %sp,16+69				; oddball number so if we accidentally see it, it looks funny.
+	STS	[%sp,16+0],%g0
+	STS	[%sp,16+1],%g1
+	STS	[%sp,16+2],%g2
+	STS	[%sp,16+3],%g3
+	STS	[%sp,16+4],%g4
+	STS	[%sp,16+5],%g5
+	STS	[%sp,16+6],%g6
+	STS	[%sp,16+7],%g7
+	.endm
+
+.macro NM_D_PopGRegisters
+	LDS	%g0,[%sp,16+0]
+	LDS	%g1,[%sp,16+1]
+	LDS	%g2,[%sp,16+2]
+	LDS	%g3,[%sp,16+3]
+	LDS	%g4,[%sp,16+4]
+	LDS	%g5,[%sp,16+5]
+	LDS	%g6,[%sp,16+6]
+	LDS	%g7,[%sp,16+7]
+	ADDIP	%sp,16+69				; must match the push
+	.endm
+
+
+.macro NM_D_TxChar	c
+	SUBI	%sp,16+8		; 32 or 16 bit, that's enough space
+	STS	[%sp,16+0],%g6
+	STS	[%sp,16+0],%g7
+	NM_TxChar \c
+	LDS	%g6,[%sp,16+0]
+	LDS	%g7,[%sp,16+1]
+	ADDI	%sp,16+8
+	.endm
+
+.macro NM_D_TxChar3 c1,c2,c3
+ NM_D_TxChar '<'
+ NM_D_TxChar \c1
+ NM_D_TxChar \c2
+ NM_D_TxChar \c3
+ NM_D_TxChar '>'
+.endm
+
+.macro NM_D_TxRegister r,n,reg
+ NM_D_PushGRegisters
+ NM_TxChar '('
+ NM_TxChar \r
+ NM_TxChar \n
+ NM_TxChar ':'
+ MOV		%g0,\reg
+ NM_TxHex
+ NM_TxChar ')'
+ NM_D_PopGRegisters
+.endm
+
+.macro NM_D_TxReg r,n,reg
+	NM_D_TxRegister \r,\n,\reg
+.endm
+
+; Do a delay loop, affects no registers.
+
+.macro NM_D_Delay d
+	SUBI	%sp,16+4
+	STS	[%sp,16+0],%g0
+	MOVIP	%g0,\d
+NM_D_DelayLoop\@:
+	IFRnz	%g0
+	 BR	NM_D_DelayLoop\@
+	SUBI	%g0,1
+	LDS	%g0,[%sp,16+0]
+	ADDI	%sp,16+4
+.endm
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/NR_Math1.S b/ap/build/uClibc/libc/sysdeps/linux/nios/NR_Math1.S
new file mode 100644
index 0000000..5d5169b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/NR_Math1.S
@@ -0,0 +1,63 @@
+
+
+	.include "NM_Macros.S"
+
+	.file	"okmul.c"
+gcc2_compiled.:
+	.text
+	.p2align 1
+	.globl __mulsi3
+	.type	 __mulsi3,@function
+__mulsi3:
+
+	;SKP0	%o0,31
+	;NEG	%o1
+	;ABS	%o0
+
+		.MACRO ZSTEP bit
+		SKP0	%o0,\bit
+		ADD	%g0,%o1
+		LSLI	%o1,1
+		.ENDM
+
+	MOVI	%g0,0
+	ZSTEP	0
+	ZSTEP	1
+	ZSTEP	2
+	ZSTEP	3
+	ZSTEP	4
+	ZSTEP	5
+	ZSTEP	6
+	ZSTEP	7
+	ZSTEP	8
+	ZSTEP	9
+	ZSTEP	10
+	ZSTEP	11
+	ZSTEP	12
+	ZSTEP	13
+	ZSTEP	14
+	ZSTEP	15
+	ZSTEP	16
+	ZSTEP	17
+	ZSTEP	18
+	ZSTEP	19
+	ZSTEP	20
+	ZSTEP	21
+	ZSTEP	22
+	ZSTEP	23
+	ZSTEP	24
+	ZSTEP	25
+	ZSTEP	26
+	ZSTEP	27
+	ZSTEP	28
+	ZSTEP	29
+	ZSTEP	30
+	ZSTEP	31
+	; No bit 31: we already set %o0 to positive
+
+	JMP	%o7
+	MOV	%o0,%g0
+
+.Lfe1:
+	.size	 __mulsi3,.Lfe1-__mulsi3
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/nios/__longjmp.S
new file mode 100644
index 0000000..d7d1cdd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/__longjmp.S
@@ -0,0 +1,103 @@
+/* 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <features.h>
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+
+;----------------------------------------
+;         Name: __longjmp
+;  Description: Restore the current context
+;               as saved by a previous nr_setjmp
+;        Input: %o0: jmp_buf (ptr to) array to restore context from
+;               %o1: integer to return
+;       Output: %o0 = 0 the first time we're called, or
+;               whatever longjmp returns later
+; Side Effects: uses %g0, %g1 & %g2
+;    CWP Depth: 0
+;
+
+	.align 2
+	.global	__longjmp
+__longjmp:
+	;
+	; The way we'll do this is by executing
+	; RESTORE instructions until the old
+	; return address matches. Then we'll
+	; jump to where setjmp was called from.
+	;
+	; Since we're moving the window pointer
+	; all over the place, we'll naturally
+	; only use the %g registers.
+	;
+
+	mov	%g0,%o0		; %g0 -> jmp_buf
+	mov	%g1,%o1		; %g1 = return value
+	pfx	jmpbuf_callersret
+	ld	%g2,[%g0]	; %g2 = old return address
+__longjmp_loop:
+	cmp	%g2,%i7		; Are we there yet?
+	skps	cc_ne
+	 br	__longjmp_done
+	 nop			; (delay slot)
+
+	br	__longjmp_loop
+	restore			; (delay slot)
+	;
+	; One might put in a watchdog counter here, to
+	; prevent a runaway stack crawl... but what would that
+	; accomplish? What error can we throw? To whom?
+	;
+
+__longjmp_done:
+	pfx	jmpbuf_l0	; Restore local register l0
+	ld	%l0,[%g0]
+	pfx	jmpbuf_l1	; Restore local register l1
+	ld	%l1,[%g0]
+	pfx	jmpbuf_l2	; Restore local register l2
+	ld	%l2,[%g0]
+	pfx	jmpbuf_l3	; Restore local register l3
+	ld	%l3,[%g0]
+	pfx	jmpbuf_l4	; Restore local register l4
+	ld	%l4,[%g0]
+	pfx	jmpbuf_l5	; Restore local register l5
+	ld	%l5,[%g0]
+	pfx	jmpbuf_l6	; Restore local register l6
+	ld	%l6,[%g0]
+	pfx	jmpbuf_l7	; Restore local register l7
+	ld	%l7,[%g0]
+	pfx	jmpbuf_i0	; Restore input register i0
+	ld	%i0,[%g0]
+	pfx	jmpbuf_i1	; Restore input register i1
+	ld	%i1,[%g0]
+	pfx	jmpbuf_i2	; Restore input register i2
+	ld	%i2,[%g0]
+	pfx	jmpbuf_i3	; Restore input register i3
+	ld	%i3,[%g0]
+	pfx	jmpbuf_i4	; Restore input register i4
+	ld	%i4,[%g0]
+	pfx	jmpbuf_i5	; Restore input register i5
+	ld	%i5,[%g0]
+	pfx	jmpbuf_jmpret
+	ld	%o7,[%g0]	; set fake return address
+	jmp	%o7		; and kinda return there.
+	mov	%o0,%g1		; (delay slot) return value
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/endian.h
new file mode 100644
index 0000000..34ea91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/endian.h
@@ -0,0 +1,8 @@
+/* nios is little-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+/*mle */
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/fcntl.h
new file mode 100644
index 0000000..0656dd6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/fcntl.h
@@ -0,0 +1,236 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995, 1996, 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#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.	*/
+#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_XOPEN2K
+# 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]FL.  */
+#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/nios/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/kernel_types.h
new file mode 100644
index 0000000..e66f42d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/kernel_types.h
@@ -0,0 +1,43 @@
+/* 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_NIOS_POSIX_TYPES_H
+#define __ARCH_NIOS_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 struct {
+#ifdef __USE_ALL
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* __ARCH_NIOS2_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/mathdef.h
new file mode 100644
index 0000000..e013e74
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/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/nios/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/setjmp.h
new file mode 100644
index 0000000..807ebea
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/setjmp.h
@@ -0,0 +1,76 @@
+/* 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'.  Nios 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
+
+#include <signal.h>
+
+typedef struct
+  {
+    /* There are eight 4-byte local registers saved.  */
+    long int __lregs[8];
+
+    /* There are six 4-byte input registers saved.  */
+    long int __iregs[6];
+
+    /* The SP, return address to caller (also for longjmp)
+       and return address of caller are saved.  */
+    int *__sp;
+    int *__jmpret;
+    int *__callersret;
+
+  } __jmp_buf[1];
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)->__sp)
+
+#else /* _ASM */
+
+#define jmpbuf_l0 0x00
+#define jmpbuf_l1 0x01
+#define jmpbuf_l2 0x02
+#define jmpbuf_l3 0x03
+#define jmpbuf_l4 0x04
+#define jmpbuf_l5 0x05
+#define jmpbuf_l6 0x06
+#define jmpbuf_l7 0x07
+
+#define jmpbuf_i0 0x08
+#define jmpbuf_i1 0x09
+#define jmpbuf_i2 0x0a
+#define jmpbuf_i3 0x0b
+#define jmpbuf_i4 0x0c
+#define jmpbuf_i5 0x0d
+
+#define jmpbuf_sp 0x0e
+#define jmpbuf_jmpret 0x0f
+#define jmpbuf_callersret 0x10
+
+#endif /* _ASM */
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/sigcontextinfo.h
new file mode 100644
index 0000000..caf1cf4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/sigcontextinfo.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 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.  */
+
+#define SIGCONTEXT struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS
+#define GET_PC(ctx)	((void *) ((ctx)->regs.pc))
+
+/* now way for nios to do GET_FRAME(ctx), it is not saved in ctx */
+#define GET_STACK(ctx)	((void *) (ctx)->regs.u_regs[14])
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/stackinfo.h
new file mode 100644
index 0000000..e7fbf56
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On nios II the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/stat.h
new file mode 100644
index 0000000..d299ff1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/stat.h
@@ -0,0 +1,168 @@
+/* Copyright (C) 1992,95,96,97,98,99,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_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_LINUX_OLD	1
+#define _STAT_VER_KERNEL	1
+#define _STAT_VER_SVR4		2
+#define _STAT_VER_LINUX		3
+#define _STAT_VER		_STAT_VER_LINUX	/* The one defined below.  */
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	1
+#define _MKNOD_VER_SVR4		2
+#define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below.  */
+
+
+struct stat
+  {
+    __dev_t st_dev;			/* Device.  */
+    unsigned short int __pad1;
+#ifndef __USE_FILE_OFFSET64
+    __ino_t st_ino;			/* File serial number.	*/
+#else
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+#endif
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned short int __pad2;
+#ifndef __USE_FILE_OFFSET64
+    __off_t st_size;			/* Size of file, in bytes.  */
+#else
+    __off64_t st_size;			/* Size of file, in bytes.  */
+#endif
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+#ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+#else
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#endif
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+#ifndef __USE_FILE_OFFSET64
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+#else
+    __ino64_t st_ino;			/* File serial number.	*/
+#endif
+  };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;			/* Device.  */
+    unsigned short int __pad1;
+
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned short int __pad2;
+    __off64_t st_size;			/* Size of file, in bytes.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    __ino64_t st_ino;			/* File serial number.		*/
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/syscalls.h
new file mode 100644
index 0000000..c2b6b97
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/syscalls.h
@@ -0,0 +1,13 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#include <features.h>
+/* Do something very evil for now.  Until we include our out syscall
+ * macros, short circuit bits/syscall.h  and use asm/unistd.h instead */
+#include <asm/unistd.h>
+
+#endif /* _BITS_SYSCALLS_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..2a9422e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/uClibc_arch_features.h
@@ -0,0 +1,48 @@
+/*
+ * 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__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/nios/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/nios/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/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/nios/brk.c b/ap/build/uClibc/libc/sysdeps/linux/nios/brk.c
new file mode 100644
index 0000000..c88b692
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/brk.c
@@ -0,0 +1,44 @@
+/* brk system call for Linux/Nios2.
+   Copyright (C) 1995, 1996, 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 <unistd.h>
+#include <sys/syscall.h>
+#include <errno.h>
+
+/* This must be initialized data because commons can't have aliases.  */
+void *__curbrk attribute_hidden = 0;
+
+int brk (void *addr)
+{
+    void *newbrk;
+    register int g1 __asm__("%g1") = __NR_brk;
+    register void *o0 __asm__("%o0") = addr;
+
+    __asm__ __volatile__ ("trap 63\n\t" : "=r"(newbrk) : "0"(o0), "r"(g1));
+
+    __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/nios/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/nios/bsd-_setjmp.S
new file mode 100644
index 0000000..f2f0f23
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/bsd-_setjmp.S
@@ -0,0 +1 @@
+/* _setjmp in setjmp.S */
\ No newline at end of file
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/nios/bsd-setjmp.S
new file mode 100644
index 0000000..36f2bab
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/bsd-setjmp.S
@@ -0,0 +1 @@
+/* setjmp in setjmp.S */
\ No newline at end of file
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/clone.S b/ap/build/uClibc/libc/sysdeps/linux/nios/clone.S
new file mode 100644
index 0000000..39eb540
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/clone.S
@@ -0,0 +1,88 @@
+/* Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@tamu.edu).
+
+   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.  */
+
+#include <asm/errno.h>
+#include <sys/syscall.h>
+#include "NM_Macros.S"
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
+
+	.text
+	.align	2
+	.globl	clone
+	.type	clone,@function
+
+clone:
+	save	%sp,-16
+
+	MOVIP	%l0, -EINVAL
+	/* sanity check arguments */
+	skprnz	%i0				/* no NULL function pointers */
+	 br	CLONE_ERROR_LABEL
+	mov	%o0, %i2
+
+	skprnz  %i1				/* no NULL stack pointers */
+	 br	CLONE_ERROR_LABEL
+	mov	%o1, %i1
+
+	/* Do the system call */
+	MOVIP	%g1, __NR_clone
+	trap	63
+
+	/* if ret >=0? */
+	cmpi %o0, 0
+	skps cc_pl
+	 br CLONE_ERROR_LABEL
+	 mov %l0, %o0
+
+	/* Start thread */
+	skprz  %o1
+	 br __thread_start
+	 nop
+	mov %i0, %o0
+	ret
+	 restore
+
+CLONE_ERROR_LABEL:
+	neg %l0
+	MOVIA	%g1, __errno_location@h
+	call	%g1
+	 nop
+	st	[%o0], %l0		/* store errno */
+
+	xor %i0, %i0
+	dec %i0				/* retval=-1 */
+	ret
+	 restore
+
+	.size	clone, .-clone
+
+	.type	__thread_start,@function
+
+__thread_start:
+	call	%i0
+	 mov	%o0, %i3
+	MOVIA	%g1, _exit@h
+	call	%g1
+	 nop
+
+	.size	__thread_start, .-__thread_start
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/nios/crt1.S
new file mode 100644
index 0000000..e80a821
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/crt1.S
@@ -0,0 +1,59 @@
+/* Copyright (C) 1991, 1992 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 Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#include <features.h>
+#include <asm/unistd.h>
+#include "NM_Macros.S"
+#define __ASSEMBLY__
+#include <asm/ptrace.h>		/* for REGWIN_SZ */
+
+    .global _start
+    .type   __start,@function
+    .weak   _init
+    .weak   _fini
+    .type   main,@function
+    .type   __uClibc_main,@function
+    .type   __h_errno_location, @function
+    .type   _stdio_init, @function
+    .type   _stdio_term, @function
+
+	.text
+
+_start:
+	nop
+	nop
+
+	MOVIA	%o0, main@h
+	lds	%o1,[%sp, (REGWIN_SZ / 4) + 0]	/* main's argc */
+	lds	%o2,[%sp, (REGWIN_SZ / 4) + 1]	/* main's argv */
+
+	MOVIA	%o3, _init@h
+	MOVIA	%o4, _fini@h
+	mov	%o5, %i0	/* rtld_fini */
+	mov	%o6, %sp	/* stack_end */
+	MOVIA	%o7, __uClibc_main@h
+
+	call	%o7
+	nop
+
+
+	/* If that didn't kill us, ... */
+__exit:
+	MOVIP	%g1, __NR_exit
+	trap	63
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/crtbegin.c b/ap/build/uClibc/libc/sysdeps/linux/nios/crtbegin.c
new file mode 100644
index 0000000..ac3f23f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/crtbegin.c
@@ -0,0 +1,37 @@
+#include <errno.h>
+#include <stdlib.h>
+/*
+static void (*__CTOR_LIST__[1]) __P((void))
+    __attribute__((__unused__))
+    __attribute__((section(".ctors"))) = { (void *)0 };
+
+static void (*__DTOR_LIST__[1]) __P((void))
+    __attribute__((section(".dtors"))) = { (void *)-1 };
+*/
+extern void (*__DTOR_LIST__[]) __P((void));
+static void	__do_global_dtors_aux __P((void));
+
+static void
+__do_global_dtors_aux()
+{
+	void (**p)(void) = __DTOR_LIST__ + 1;
+
+	while (*p)
+		(**p++)();
+}
+
+static void dummy_fini(void) __attribute__((section(".trash")));
+
+void
+dummy_fini(void)
+{
+	static void (* volatile call__dtors)(void) = __do_global_dtors_aux;
+	/*
+	 * Call global destructors.
+	 */
+	/* prevent function pointer constant propagation */
+	__asm__ __volatile__ (".section .fini");
+	(*call__dtors)();
+	__asm__ __volatile__ (".section .trash");
+
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/crtend.c b/ap/build/uClibc/libc/sysdeps/linux/nios/crtend.c
new file mode 100644
index 0000000..775eb0f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/crtend.c
@@ -0,0 +1,44 @@
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+/*
+static void (*__CTOR_END__[1]) __P((void))
+    __attribute__((section(".ctors"))) = { (void *)-1 };
+
+static void (*__DTOR_END__[1]) __P((void))
+    __attribute__((__unused__))
+    __attribute__((section(".dtors"))) = { (void *)0 };
+*/
+extern void (*__CTOR_END__[]) __P((void));
+static void	__do_global_ctors_aux __P((void));
+
+static void
+__do_global_ctors_aux()
+{
+	void (**p)(void) = __CTOR_END__ - 1;
+
+	while (*p)
+		(**p--)();
+}
+
+static void dummy_init(void) __attribute__((section(".trash")));
+
+void
+dummy_init(void)
+{
+	static smallint initialized;
+	static void (*volatile call__ctors)(void) = __do_global_ctors_aux;
+	/*
+	 * Call global constructors.
+	 * Arrange to call global destructors at exit.
+	 */
+	/* prevent function pointer constant propagation */
+	__asm__ __volatile__ (".section .init");
+
+	if (!initialized) {
+		initialized = 1;
+		(*call__ctors)();
+	}
+	__asm__ __volatile__ (".section .trash");
+
+}
\ No newline at end of file
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/nios/fpu_control.h
new file mode 100644
index 0000000..9c31745
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/fpu_control.h
@@ -0,0 +1,99 @@
+/* FPU control word bits.  Nios2 version.
+   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.  */
+
+#ifndef _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+/* MIPS FPU floating point control register bits.
+ *
+ * 31-25  -> floating point conditions code bits 7-1.  These bits are only
+ *           available in MIPS IV.
+ * 24     -> flush denormalized results to zero instead of
+ *           causing unimplemented operation exception.  This bit is only
+ *           available for MIPS III and newer.
+ * 23     -> Condition bit
+ * 22-18  -> reserved (read as 0, write with 0)
+ * 17     -> cause bit for unimplemented operation
+ * 16     -> cause bit for invalid exception
+ * 15     -> cause bit for division by zero exception
+ * 14     -> cause bit for overflow exception
+ * 13     -> cause bit for underflow exception
+ * 12     -> cause bit for inexact exception
+ * 11     -> enable exception for invalid exception
+ * 10     -> enable exception for division by zero exception
+ *  9     -> enable exception for overflow exception
+ *  8     -> enable exception for underflow exception
+ *  7     -> enable exception for inexact exception
+ *  6     -> flag invalid exception
+ *  5     -> flag division by zero exception
+ *  4     -> flag overflow exception
+ *  3     -> flag underflow exception
+ *  2     -> flag inexact exception
+ *  1-0   -> rounding control
+ *
+ *
+ * Rounding Control:
+ * 00 - rounding to nearest (RN)
+ * 01 - rounding toward zero (RZ)
+ * 10 - rounding (up) toward plus infinity (RP)
+ * 11 - rounding (down)toward minus infinity (RM)
+ */
+
+#include <features.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_V     0x0800  /* Invalid operation */
+#define _FPU_MASK_Z     0x0400  /* Division by zero  */
+#define _FPU_MASK_O     0x0200  /* Overflow          */
+#define _FPU_MASK_U     0x0100  /* Underflow         */
+#define _FPU_MASK_I     0x0080  /* Inexact operation */
+
+/* flush denormalized numbers to zero */
+#define _FPU_FLUSH_TZ   0x1000000
+
+/* rounding control */
+#define _FPU_RC_NEAREST 0x0     /* RECOMMENDED */
+#define _FPU_RC_ZERO    0x1
+#define _FPU_RC_UP      0x2
+#define _FPU_RC_DOWN    0x3
+
+#define _FPU_RESERVED 0xfe3c0000  /* Reserved bits in cw */
+
+
+/* The fdlibm code requires strict IEEE double precision arithmetic,
+   and no interrupts for exceptions, rounding to nearest.  */
+
+#define _FPU_DEFAULT  0x00000000
+
+/* IEEE:  same as above, but exceptions */
+#define _FPU_IEEE     0x00000F80
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
+
+/* Macros for accessing the hardware control word.  */
+#define _FPU_GETCW(cw) __asm__ ("cfc1 %0,$31" : "=r" (cw))
+#define _FPU_SETCW(cw) __asm__ ("ctc1 %0,$31" : : "r" (cw))
+
+#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/nios/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/nios/setjmp.S
new file mode 100644
index 0000000..c285146
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/setjmp.S
@@ -0,0 +1,102 @@
+/* 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <features.h>
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+#include "NM_Macros.S"
+
+;----------------------------------------
+;         Name: __sigsetjmp
+;  Description: Save the current context so
+;               a nr_longjmp works later.
+;        Input: %o0: jmp_buf: (ptr to) array to store context in
+;       Output: %o0 = 0 the first time we're called, or
+;               whatever longjmp returns later
+; Side Effects: Uses %g0
+;    CWP Depth: 0
+;
+
+	.align	2
+	.global	_setjmp
+	
+_setjmp:
+	br	__sigsetjmp
+	 movi	%o1,0		; (Delay slot) Set signal mask to zero
+
+	.align	2
+	.global	setjmp
+	
+setjmp:
+	MOVIP	%o1,1		; Set signal mask to 1 to save mask
+
+	.align	2
+	.global	__sigsetjmp
+
+__sigsetjmp:
+	pfx	jmpbuf_callersret ; present return address
+	st	[%o0],%i7	
+	pfx	jmpbuf_jmpret	; where the longjmp will later execute from
+	st	[%o0],%o7	
+	pfx	jmpbuf_sp	; Save stack pointer
+	st	[%o0],%o6
+	pfx	jmpbuf_l0	; Save local register l0
+	st	[%o0],%l0
+	pfx	jmpbuf_l1	; Save local register l1
+	st	[%o0],%l1
+	pfx	jmpbuf_l2	; Save local register l2
+	st	[%o0],%l2
+	pfx	jmpbuf_l3	; Save local register l3
+	st	[%o0],%l3
+	pfx	jmpbuf_l4	; Save local register l4
+	st	[%o0],%l4
+	pfx	jmpbuf_l5	; Save local register l5
+	st	[%o0],%l5
+	pfx	jmpbuf_l6	; Save local register l6
+	st	[%o0],%l6
+	pfx	jmpbuf_l7	; Save local register l7
+	st	[%o0],%l7
+	pfx	jmpbuf_i0	; Save input register i0
+	st	[%o0],%i0
+	pfx	jmpbuf_i1	; Save input register i1
+	st	[%o0],%i1
+	pfx	jmpbuf_i2	; Save input register i2
+	st	[%o0],%i2
+	pfx	jmpbuf_i3	; Save input register i3
+	st	[%o0],%i3
+	pfx	jmpbuf_i4	; Save input register i4
+	st	[%o0],%i4
+	pfx	jmpbuf_i5	; Save input register i5
+	st	[%o0],%i5
+	pfx	%hi(__sigjmp_save@h)	  ; Load up %g0 with address
+	movi	%g0,%lo(__sigjmp_save@h)
+	pfx	%xhi(__sigjmp_save@h)
+	movhi	%g0,%xlo(__sigjmp_save@h)
+	jmp	%g0
+	 nop			; (delay slot)
+
+
+
+
+
+
+
+
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/nios/sys/procfs.h
new file mode 100644
index 0000000..8cbaa41
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/sys/procfs.h
@@ -0,0 +1,123 @@
+/* Copyright (C) 1996, 1997, 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.  */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+#include <bits/wordsize.h>
+
+__BEGIN_DECLS
+
+#define ELF_NGREG		38
+
+typedef struct
+  {
+    union
+      {
+	unsigned long	pr_regs[32];
+	double		pr_dregs[16];
+      }			pr_fr;
+    unsigned long	__unused;
+    unsigned long	pr_fsr;
+    unsigned char	pr_qcnt;
+    unsigned char	pr_q_entrysize;
+    unsigned char	pr_en;
+    unsigned int	pr_q[64];
+  } elf_fpregset_t;
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+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.  Fields present but not used are
+   marked with "XXX".  */
+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.  */
+  };
+
+/* 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;
+
+
+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/nios/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/nios/sys/ucontext.h
new file mode 100644
index 0000000..1805b4e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/sys/ucontext.h
@@ -0,0 +1,104 @@
+/* Copyright (C) 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_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+/*
+ * Location of the users' stored registers relative to R0.
+ * Usage is as an index into a gregset_t array or as u.u_ar0[XX].
+ */
+#define REG_PSR (0)
+#define REG_PC  (1)
+#define REG_SPARE   (2)
+#define REG_WVALID  (3)
+#define REG_G1  (4)
+#define REG_G2  (5)
+#define REG_G3  (6)
+#define REG_G4  (7)
+#define REG_G5  (8)
+#define REG_G6  (9)
+#define REG_G7  (10)
+#define REG_O0  (11)
+#define REG_O1  (12)
+#define REG_O2  (13)
+#define REG_O3  (14)
+#define REG_O4  (15)
+#define REG_O5  (16)
+#define REG_O6  (17)
+#define REG_O7  (18)
+#define REG_GLOBALS (19)
+
+/*
+ * A gregset_t is defined as an array type for compatibility with the reference
+ * source. This is important due to differences in the way the C language
+ * treats arrays and structures as parameters.
+ *
+ * Note that NGREG is really (sizeof (struct regs) / sizeof (greg_t)),
+ * but that the ABI defines it absolutely to be 21 (resp. 19).
+ */
+
+#define NGREG   20
+typedef int greg_t;
+
+typedef greg_t  gregset_t[NGREG];
+
+/*
+ * The following structures define how a register window can appear on the
+ * stack. This structure is available (when required) through the `gwins'
+ * field of an mcontext (nested within ucontext). NIOS_MAXWINDOW is the
+ * maximum number of outstanding register windows defined in the NIOS
+ * architecture (*not* implementation).
+ */
+#define NIOS_MAXREGWINDOW	31	/* max windows in NIOS arch. */
+struct  rwindow
+  {
+    greg_t rw_local[8];			/* locals */
+    greg_t rw_in[8];			/* ins */
+  };
+
+#define rw_fp   rw_in[6]		/* frame pointer */
+#define rw_rtn  rw_in[7]		/* return address */
+
+typedef struct gwindows
+  {
+    int            wbcnt;
+    int           *spbuf[NIOS_MAXREGWINDOW];
+    struct rwindow wbuf[NIOS_MAXREGWINDOW];
+  } gwindows_t;
+
+typedef struct
+  {
+    gregset_t   gregs;		/* general register set */
+    gwindows_t  *gwins;		/* POSSIBLE pointer to register windows */
+  } mcontext_t;
+
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long   uc_flags;
+    struct ucontext *uc_link;
+    __sigset_t	    uc_sigmask;
+    stack_t         uc_stack;
+    mcontext_t      uc_mcontext;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/nios/vfork.S
new file mode 100644
index 0000000..f8a6d03
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios/vfork.S
@@ -0,0 +1,54 @@
+/*
+ * libc/sysdeps/linux/nios/vfork.S -- `vfork' syscall for linux/nios
+ *
+ *  Copyright (C) 2004  Microtronix Datacom Ltd
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ * 
+ * Written by Wentao Xu <wentao@microtronix.com>
+ */
+
+#include <features.h>
+
+#include <bits/errno.h>
+#include <sys/syscall.h>
+#include "NM_Macros.S"
+
+#ifndef __NR_vfork
+#define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
+#endif
+
+   .text
+   .align 2
+   .globl __vfork
+  .hidden __vfork
+  .type   __vfork,@function
+__vfork:
+	MOVIP	%g1, __NR_vfork
+	trap	63
+	
+	bgen	%g1, 12
+	not		%g1			/* (unsigned long) -4096 */
+	cmp		%o0, %g1
+	skps	cc_hi
+	jmp		%o7
+	nop
+	
+fix_errno:
+	neg		%o0
+	save	%sp, -16
+	MOVIA	%g1, __errno_location@h
+	call	%g1
+	nop
+	st	[%o0], %i0		/* store errno */
+	
+	xor %i0, %i0
+	subi %i0, 1		/* retval=-1 */
+	ret
+	restore
+
+.size __vfork,.-__vfork
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/Makefile b/ap/build/uClibc/libc/sysdeps/linux/nios2/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/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/nios2/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/nios2/Makefile.arch
new file mode 100644
index 0000000..a0c485a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/Makefile.arch
@@ -0,0 +1,12 @@
+# 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 syscall.c
+
+SSRC := \
+	__longjmp.S bsd-_setjmp.S bsd-setjmp.S setjmp.S \
+	vfork.S clone.S
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/nios2/__longjmp.S
new file mode 100644
index 0000000..4b6508e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/__longjmp.S
@@ -0,0 +1,50 @@
+/*
+ * libc/sysdeps/linux/nios2/__longjmp.S
+ *
+ *  Copyright (C) 2004,05,06  Microtronix Datacom Ltd
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ * 
+ * Written by Wentao Xu <wentao@microtronix.com>
+ * 
+ */
+
+#include <features.h>
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+.globl __longjmp
+.type  __longjmp,@function
+.balign 4
+
+__longjmp:
+    /* return value is in r5*/
+    mov     r2,  r5
+  
+    /* jmp_buf in r4, restore regs.  */
+    ldw     r16, (JB_REGS+ 0)(r4)
+    ldw     r17, (JB_REGS+ 4)(r4)
+    ldw     r18, (JB_REGS+ 8)(r4)
+    ldw     r19, (JB_REGS+12)(r4)
+    ldw     r20, (JB_REGS+16)(r4)
+    ldw     r21, (JB_REGS+20)(r4)
+    ldw     r22, (JB_REGS+24)(r4)
+    ldw     r23, (JB_REGS+28)(r4)
+    
+    ldw     ra, JB_PC(r4)
+    ldw     fp, JB_FP(r4)
+    ldw     gp, JB_GP(r4)
+    ldw     sp, JB_SP(r4)
+    
+#if defined(__HAVE_FPU__)
+    RESTORE_FPU r4 JB_FPREGS
+#endif
+
+  /* return to saved RA */    
+    ret
+
+.size __longjmp,.-__longjmp
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/endian.h
new file mode 100644
index 0000000..de60add
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/endian.h
@@ -0,0 +1,7 @@
+/* Nios II is little-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/fcntl.h
new file mode 100644
index 0000000..e564b42
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/fcntl.h
@@ -0,0 +1,238 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 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	_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]FL.  */
+#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/nios2/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/kernel_stat.h
new file mode 100644
index 0000000..99a6cba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/kernel_stat.h
@@ -0,0 +1,50 @@
+#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 {
+	unsigned short st_dev;
+	unsigned short __pad1;
+	unsigned long st_ino;
+	unsigned short st_mode;
+	unsigned short st_nlink;
+	unsigned short st_uid;
+	unsigned short st_gid;
+	unsigned short st_rdev;
+	unsigned short __pad2;
+	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 short	st_dev;
+	unsigned char	__pad0[10];
+#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 short	st_rdev;
+	unsigned char	__pad3[10];
+	long long	st_size;
+	unsigned long	st_blksize;
+	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
+	unsigned long	__pad4;		/* future possible st_blocks high bits */
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned long long	st_ino;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/kernel_types.h
new file mode 100644
index 0000000..3c030e7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/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 _ASM_NIOS2_POSIX_TYPES_H
+#define _ASM_NIOS2_POSIX_TYPES_H
+
+typedef unsigned long	__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 unsigned short	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+typedef long long	__kernel_loff_t;
+
+typedef struct {
+#ifdef __USE_ALL
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* _ASM_NIOS2_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/mathdef.h
new file mode 100644
index 0000000..e013e74
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/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/nios2/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/setjmp.h
new file mode 100644
index 0000000..fcff031
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/setjmp.h
@@ -0,0 +1,72 @@
+/* Define the machine-dependent type `jmp_buf'.  Nios2 version.
+   Copyright (C) 1992,93,95,97,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 _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
+typedef struct
+{
+    /* Callee-saved registers r16 through r23.  */
+    unsigned long __regs[8];
+
+    /* Program counter.  */
+    unsigned long __pc;
+
+    /* Stack pointer.  */
+    unsigned long __sp;
+
+    /* The frame pointer.  */
+    unsigned long __fp;
+
+    /* The global pointer.  */
+    unsigned long __gp;
+
+	/* floating point regs, if any */
+#if defined __HAVE_FPU__
+    unsigned long __fpregs[64];
+#endif
+} __jmp_buf[1];
+
+#endif
+
+#define JB_REGS		0
+#define JB_PC		32
+#define JB_SP		36
+#define JB_FP		40
+#define JB_GP		44
+#define JB_FPREGS 	48
+
+#if defined __HAVE_FPU__
+# define JB_SIZE 304
+#else
+# define JB_SIZE 48
+#endif
+
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void*)(jmpbuf)->__sp)
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/sigcontextinfo.h
new file mode 100644
index 0000000..d6383b9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/sigcontextinfo.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>, 1998.
+
+   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 SIGCONTEXT struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS
+#define GET_PC(ctx)	((void *) (ctx)->regs.ea)
+#define GET_FRAME(ctx)	((void *) (ctx)->regs.sp)
+#define GET_STACK(ctx)	((void *) (ctx)->regs.fp)
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/stackinfo.h
new file mode 100644
index 0000000..e7fbf56
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On nios II the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/stat.h
new file mode 100644
index 0000000..d380eee
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/stat.h
@@ -0,0 +1,168 @@
+/* Copyright (C) 1992,95,96,97,98,99,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_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_LINUX_OLD	1
+#define _STAT_VER_KERNEL	1
+#define _STAT_VER_SVR4		2
+#define _STAT_VER_LINUX		3
+#define _STAT_VER		_STAT_VER_LINUX	/* The one defined below.  */
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	1
+#define _MKNOD_VER_SVR4		2
+#define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below.  */
+
+
+struct stat
+  {
+    __dev_t st_dev;			/* Device.  */
+    unsigned short int __pad1;
+#ifndef __USE_FILE_OFFSET64
+    __ino_t st_ino;			/* File serial number.	*/
+#else
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+#endif
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned short int __pad2;
+#ifndef __USE_FILE_OFFSET64
+    __off_t st_size;			/* Size of file, in bytes.  */
+#else
+    __off64_t st_size;			/* Size of file, in bytes.  */
+#endif
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+#ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+#else
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#endif
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+#ifndef __USE_FILE_OFFSET64
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+#else
+    __ino64_t st_ino;			/* File serial number.	*/
+#endif
+  };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;			/* Device.  */
+    unsigned int __pad1;
+
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned int __pad2;
+    __off64_t st_size;			/* Size of file, in bytes.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    __ino64_t st_ino;			/* File serial number.		*/
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/syscalls.h
new file mode 100644
index 0000000..3214e3c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/syscalls.h
@@ -0,0 +1,108 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+#include <asm/traps.h>
+
+#define __syscall_return(type, res)					\
+	do {								\
+		if (unlikely(INTERNAL_SYSCALL_ERROR_P(res, ))) {	\
+			__set_errno(INTERNAL_SYSCALL_ERRNO(res, ));	\
+			res = (unsigned long) -1;			\
+		}							\
+		return (type) (res);					\
+	} while (0)
+
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\
+(__extension__ \
+	({								\
+		long __res;						\
+		__asm__ __volatile__ (					\
+			"movi    r2,    %2\n\t"   /* TRAP_ID_SYSCALL */ \
+			"movi    r3,    %1\n\t"   /* __NR_##name     */	\
+			ASM_ARGS_##nr					\
+			"trap\n\t"					\
+			"mov     %0,    r2\n\t"   /* syscall return  */	\
+			:   "=r" (__res)          /* %0              */	\
+			:   "i" (name)            /* %1              */	\
+			  , "i" (TRAP_ID_SYSCALL) /* %2              */	\
+			  MAP_ARGS_##nr (args)    /* %3-%8           */	\
+			:   "r2"					\
+			  , "r3"					\
+			  CLOB_ARGS_##nr          /* Clobbered       */ \
+		);							\
+		__res;							\
+	}) \
+)
+
+#define INTERNAL_SYSCALL_ERROR_P(val, err)	\
+	((unsigned long)(val) >= (unsigned long)(-125))
+
+#define ASM_ARGS_0
+#define MAP_ARGS_0()
+#define CLOB_ARGS_0
+
+#define ASM_ARGS_1		\
+	"mov     r4,    %3\n\t"
+#define MAP_ARGS_1(a)		\
+	, "r" ((long) a)
+#define CLOB_ARGS_1		\
+	, "r4"
+
+#define ASM_ARGS_2		\
+	ASM_ARGS_1		\
+	"mov     r5,    %4\n\t"
+#define MAP_ARGS_2(a, b)	\
+	MAP_ARGS_1(a)		\
+	, "r" ((long) b)
+#define CLOB_ARGS_2		\
+	CLOB_ARGS_1		\
+	, "r5"
+
+#define ASM_ARGS_3		\
+	ASM_ARGS_2		\
+	"mov     r6,    %5\n\t"
+#define MAP_ARGS_3(a, b, c)	\
+	MAP_ARGS_2(a, b)	\
+	, "r" ((long) c)
+#define CLOB_ARGS_3		\
+	CLOB_ARGS_2		\
+	, "r6"
+
+#define ASM_ARGS_4		\
+	ASM_ARGS_3		\
+	"mov     r7,    %6\n\t"
+#define MAP_ARGS_4(a, b, c, d)	\
+	MAP_ARGS_3(a, b, c)	\
+	, "r" ((long) d)
+#define CLOB_ARGS_4		\
+	CLOB_ARGS_3		\
+	, "r7"
+
+#define ASM_ARGS_5		\
+	ASM_ARGS_4		\
+	"mov     r8,    %7\n\t"
+#define MAP_ARGS_5(a, b, c, d, e)	\
+	MAP_ARGS_4(a, b, c, d)		\
+	, "r" ((long) e)
+#define CLOB_ARGS_5		\
+	CLOB_ARGS_4		\
+	, "r8"
+
+#define ASM_ARGS_6		\
+	ASM_ARGS_5		\
+	"mov     r9,    %8\n\t"
+#define MAP_ARGS_6(a, b, c, d, e, f)	\
+	MAP_ARGS_5(a, b, c, d, e)	\
+	, "r" ((long) f)
+#define CLOB_ARGS_6		\
+	CLOB_ARGS_5		\
+	, "r9"
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..2a9422e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/uClibc_arch_features.h
@@ -0,0 +1,48 @@
+/*
+ * 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__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/nios2/bits/uClibc_page.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/uClibc_page.h
new file mode 100644
index 0000000..311dd40
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/uClibc_page.h
@@ -0,0 +1,29 @@
+/*  Copyright (C) 2004     Erik Andersen
+ *
+ *  This 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.
+ */
+
+/* Supply an architecture specific value for PAGE_SIZE and friends.  */
+
+#ifndef _UCLIBC_PAGE_H
+#define _UCLIBC_PAGE_H
+
+/* PAGE_SHIFT determines the page size -- in this case 4096 */
+#define PAGE_SHIFT	(12)
+#define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#define PAGE_MASK	(~(PAGE_SIZE-1))
+
+#endif /* _UCLIBC_PAGE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/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/nios2/brk.c b/ap/build/uClibc/libc/sysdeps/linux/nios2/brk.c
new file mode 100644
index 0000000..24bd719
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/brk.c
@@ -0,0 +1,45 @@
+/* brk system call for Linux/Nios2.
+   Copyright (C) 1995, 1996, 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 <unistd.h>
+#include <sys/syscall.h>
+#include <errno.h>
+
+/* This must be initialized data because commons can't have aliases.  */
+void *__curbrk attribute_hidden = 0;
+
+int brk (void *addr)
+{
+    void *newbrk;
+    register int r2 __asm__("r2") = TRAP_ID_SYSCALL;
+    register int r3 __asm__("r3") = __NR_brk;
+    register void *r4 __asm__("r4") = addr;
+
+    __asm__ __volatile__ ("trap\n\t" : "=r"(newbrk) : "0"(r2), "r"(r3), "r"(r4));
+
+    __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/nios2/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/nios2/bsd-_setjmp.S
new file mode 100644
index 0000000..ed4061c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bsd-_setjmp.S
@@ -0,0 +1,45 @@
+/*
+ * libc/sysdeps/linux/nios2/bsd-_setjmp.S
+ *
+ *  Copyright (C) 2004,05,06  Microtronix Datacom Ltd
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ * 
+ * Written by Wentao Xu <wentao@microtronix.com>
+ * 
+ */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+   .globl _setjmp
+   .type  _setjmp,@function
+   .balign 4
+
+_setjmp:
+    stw     r16, (JB_REGS+ 0)(r4)
+    stw     r17, (JB_REGS+ 4)(r4)
+    stw     r18, (JB_REGS+ 8)(r4)
+    stw     r19, (JB_REGS+12)(r4)
+    stw     r20, (JB_REGS+16)(r4)
+    stw     r21, (JB_REGS+20)(r4)
+    stw     r22, (JB_REGS+24)(r4)
+    stw     r23, (JB_REGS+28)(r4)
+    
+    stw     ra, JB_PC(r4)
+    stw     sp, JB_SP(r4)
+    stw     fp, JB_FP(r4)
+    stw     gp, JB_GP(r4)
+    
+#if defined(__HAVE_FPU__)
+    SAVE_FPU r4 JB_FPREGS
+#endif
+    stw     r0, JB_SIZE(r4) /* signal mask is not saved */
+    mov     r2, zero
+    ret
+
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/nios2/bsd-setjmp.S
new file mode 100644
index 0000000..ac99bfe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/bsd-setjmp.S
@@ -0,0 +1,52 @@
+/*
+ * libc/sysdeps/linux/nios2/bsd-setjmp.S
+ *
+ *  Copyright (C) 2004,05,06  Microtronix Datacom Ltd
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ * 
+ * Written by Wentao Xu <wentao@microtronix.com>
+ * 
+ */
+
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+   .globl setjmp
+   .type  setjmp,@function
+   .balign 4
+
+setjmp:
+    stw     r16, (JB_REGS+ 0)(r4)
+    stw     r17, (JB_REGS+ 4)(r4)
+    stw     r18, (JB_REGS+ 8)(r4)
+    stw     r19, (JB_REGS+12)(r4)
+    stw     r20, (JB_REGS+16)(r4)
+    stw     r21, (JB_REGS+20)(r4)
+    stw     r22, (JB_REGS+24)(r4)
+    stw     r23, (JB_REGS+28)(r4)
+    
+    stw     ra, JB_PC(r4)
+    stw     sp, JB_SP(r4)
+    stw     fp, JB_FP(r4)
+    stw     gp, JB_GP(r4)
+    
+#if defined(__HAVE_FPU__)
+    SAVE_FPU r4 JB_FPREGS
+#endif
+
+    movui r5, 1
+#ifdef __PIC__
+    /* just pray 16 bit offset is enough */
+    br __sigjmp_save
+#else
+    movhi r8, %hi(__sigjmp_save)
+    ori r8, r8, %lo(__sigjmp_save)    
+    jmp r8
+#endif
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/clone.S b/ap/build/uClibc/libc/sysdeps/linux/nios2/clone.S
new file mode 100644
index 0000000..4afcb7d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/clone.S
@@ -0,0 +1,70 @@
+/*
+ * libc/sysdeps/linux/nios2/clone.S -- `clone' syscall for linux/nios2
+ *
+ *  Copyright (C) 2004  Microtronix Datacom Ltd
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ * 
+ * Written by Wentao Xu <wentao@microtronix.com>
+ */
+
+#define _ERRNO_H
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_clone
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
+
+.text
+.global clone
+.type   clone,%function
+.align 4
+clone:
+	addi    sp,sp,-8
+	mov     r8,r4
+	stw     ra,4(sp)
+	stw     r16,0(sp)
+
+	mov     r4,r6
+	movi    r2,-EINVAL
+	
+	/* sanity check */
+	beq     r8,zero,CLONE_ERROR_LABEL
+	beq     r5,zero,CLONE_ERROR_LABEL
+	
+	/* system call */
+	movi    r2,TRAP_ID_SYSCALL
+	movi    r3,__NR_clone
+	trap
+	
+	/* child call the function */
+	mov     r4,r7
+	bne     r2,zero,CLONE_ERROR_LABEL
+	callr   r8
+	
+	/* exit if it returns */
+	mov     r4,r2
+	movi    r3,__NR_exit
+	trap
+	
+CLONE_ERROR_LABEL: 
+	movi    r3,-4096
+	sub     r16,zero,r2
+	bgeu    r3,r2,CLONE_OK
+	
+	/* store errno */
+	call    __errno_location
+	stw     r16,0(r2)
+	movi    r2,-1
+
+CLONE_OK:
+	ldw     ra,4(sp)
+	ldw     r16,0(sp)
+	addi    sp,sp,8
+	ret
+
+.size clone,.-clone
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/clone.c b/ap/build/uClibc/libc/sysdeps/linux/nios2/clone.c
new file mode 100644
index 0000000..eec9f42
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/clone.c
@@ -0,0 +1,50 @@
+/*
+ * libc/sysdeps/linux/nios2/clone.c -- `clone' syscall for linux/nios2
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ *
+ *
+ *  Copyright (C) 2004,05  Microtronix Datacom Ltd
+ *  Copyright (C) 2002,03  NEC Electronics Corporation
+ *  Copyright (C) 2002,03  Miles Bader <miles@gnu.org>
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ * Nios2 port by Wentao Xu
+ */
+
+#include <errno.h>
+#include <sched.h>
+#include <sys/syscall.h>
+
+int clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg, ...)
+{
+  register unsigned long rval __asm__ ("r2") = -EINVAL;
+
+  if (fn && child_stack) {
+      register unsigned long syscall __asm__ ("r3");
+      register unsigned long arg0 __asm__ ("r4");
+      register unsigned long arg1 __asm__ ("r5");
+
+      /* Clone this thread.  */
+      rval = TRAP_ID_SYSCALL;
+      syscall = __NR_clone;
+      arg0 = flags;
+      arg1 = (unsigned long)child_stack;
+      __asm__ __volatile__ ("trap "
+         : "=r" (rval), "=r" (syscall)
+         : "0" (rval),"1" (syscall), "r" (arg0), "r" (arg1)
+         );
+
+      if (rval == 0) {
+         /* In child thread, call fn and exit.  */
+         arg0 = (*fn) (arg);
+         syscall = __NR_exit;
+         __asm__ __volatile__ ("trap "
+          : "=r" (rval), "=r" (syscall)
+          : "1" (syscall), "r" (arg0));
+      }
+   }
+
+  __syscall_return (int, rval);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/nios2/crt1.S
new file mode 100644
index 0000000..0ba8d59
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/crt1.S
@@ -0,0 +1,73 @@
+/*
+ * libc/sysdeps/linux/nios2/crt0.S -- entry point for linux/nios2
+ *
+ *  Copyright (C) 2004,05,06  Microtronix Datacom Ltd
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ * 
+ * Written by Wentao Xu <wentao@microtronix.com>
+ * Updated by Thomas Chou <thomas@wytron.com.tw> for crt1.S
+ * 
+ */
+
+#include <features.h>
+#include <asm/unistd.h>
+
+    .global _start
+    .type   _start,@function
+    .type	_init,%function
+    .type	_fini,%function
+#ifndef __UCLIBC_CTOR_DTOR__
+    .weak   _init
+    .weak   _fini
+#endif
+    .type   main,@function
+    .type   __uClibc_main,@function
+    .type   __h_errno_location, @function
+    .type   _stdio_init, @function
+    .type   _stdio_term, @function
+    .text
+	.balign 4
+_start:
+    nop
+    br 0f
+0:
+    /* load gp */
+    movhi gp, %hiadj(_gp)
+    addi gp, gp, %lo(_gp)
+
+    /* load main, argc, argv from stack */
+    movhi r4, %hi(main)
+    ori  r4, r4, %lo(main)	/* main */
+    ldw r5, 0(sp)		/* argc */
+    ldw r6, 4(sp)		/* argv */
+
+    /* load the 4th arg */
+    movhi r7, %hi(_init)
+    ori  r7, r7, %lo(_init)
+
+    /* Allocate space on the stack for 6-7th arg, reuse 5th space */
+    addi sp,sp,-8
+    /* push 5-7th args on stack */
+    movhi r8, %hi(_fini)
+    ori  r8, r8, %lo(_fini)
+    stw  r8, 0(sp)
+
+    stw  r2, 4(sp)		/* rtld_fini */
+    stw  sp, 8(sp)		/* stack_end */
+
+    /* call uClibc_main, shouldn't return */
+#ifdef __PIC__
+    /* just pray 16 bit offset is enough */
+    br __uClibc_main
+#else
+    call __uClibc_main
+#endif
+
+    /* crash in the event of return */
+__exit:
+    movui r2, TRAP_ID_SYSCALL
+    movui r3, __NR_exit
+    trap
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/crti.S b/ap/build/uClibc/libc/sysdeps/linux/nios2/crti.S
new file mode 100644
index 0000000..26c55c9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/crti.S
@@ -0,0 +1,22 @@
+
+   .section .init
+   .balign 4
+   .global _init
+   .type   _init, @function
+_init:
+    addi sp, sp, -8
+    stw  ra, 0(sp)
+    stw  fp, 4(sp)
+
+   .balign 4
+   
+   
+   .section .fini
+   .balign 4
+   .global _fini
+   .type   _fini, @function
+_fini:
+    addi sp, sp, -8
+    stw  ra, 0(sp)
+    stw  fp, 4(sp)
+  .balign 4
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/nios2/crtn.S
new file mode 100644
index 0000000..de00fd1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/crtn.S
@@ -0,0 +1,14 @@
+
+   .section .init
+
+    ldw ra, 0(sp)
+    ldw fp, 4(sp)
+    addi sp, sp, 8
+    ret
+
+   .section .fini
+
+    ldw ra, 0(sp)
+    ldw fp, 4(sp)
+    addi sp, sp, 8
+    ret
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/fpu_control.h
new file mode 100644
index 0000000..9c31745
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/fpu_control.h
@@ -0,0 +1,99 @@
+/* FPU control word bits.  Nios2 version.
+   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.  */
+
+#ifndef _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+/* MIPS FPU floating point control register bits.
+ *
+ * 31-25  -> floating point conditions code bits 7-1.  These bits are only
+ *           available in MIPS IV.
+ * 24     -> flush denormalized results to zero instead of
+ *           causing unimplemented operation exception.  This bit is only
+ *           available for MIPS III and newer.
+ * 23     -> Condition bit
+ * 22-18  -> reserved (read as 0, write with 0)
+ * 17     -> cause bit for unimplemented operation
+ * 16     -> cause bit for invalid exception
+ * 15     -> cause bit for division by zero exception
+ * 14     -> cause bit for overflow exception
+ * 13     -> cause bit for underflow exception
+ * 12     -> cause bit for inexact exception
+ * 11     -> enable exception for invalid exception
+ * 10     -> enable exception for division by zero exception
+ *  9     -> enable exception for overflow exception
+ *  8     -> enable exception for underflow exception
+ *  7     -> enable exception for inexact exception
+ *  6     -> flag invalid exception
+ *  5     -> flag division by zero exception
+ *  4     -> flag overflow exception
+ *  3     -> flag underflow exception
+ *  2     -> flag inexact exception
+ *  1-0   -> rounding control
+ *
+ *
+ * Rounding Control:
+ * 00 - rounding to nearest (RN)
+ * 01 - rounding toward zero (RZ)
+ * 10 - rounding (up) toward plus infinity (RP)
+ * 11 - rounding (down)toward minus infinity (RM)
+ */
+
+#include <features.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_V     0x0800  /* Invalid operation */
+#define _FPU_MASK_Z     0x0400  /* Division by zero  */
+#define _FPU_MASK_O     0x0200  /* Overflow          */
+#define _FPU_MASK_U     0x0100  /* Underflow         */
+#define _FPU_MASK_I     0x0080  /* Inexact operation */
+
+/* flush denormalized numbers to zero */
+#define _FPU_FLUSH_TZ   0x1000000
+
+/* rounding control */
+#define _FPU_RC_NEAREST 0x0     /* RECOMMENDED */
+#define _FPU_RC_ZERO    0x1
+#define _FPU_RC_UP      0x2
+#define _FPU_RC_DOWN    0x3
+
+#define _FPU_RESERVED 0xfe3c0000  /* Reserved bits in cw */
+
+
+/* The fdlibm code requires strict IEEE double precision arithmetic,
+   and no interrupts for exceptions, rounding to nearest.  */
+
+#define _FPU_DEFAULT  0x00000000
+
+/* IEEE:  same as above, but exceptions */
+#define _FPU_IEEE     0x00000F80
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
+
+/* Macros for accessing the hardware control word.  */
+#define _FPU_GETCW(cw) __asm__ ("cfc1 %0,$31" : "=r" (cw))
+#define _FPU_SETCW(cw) __asm__ ("ctc1 %0,$31" : : "r" (cw))
+
+#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/nios2/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/nios2/setjmp.S
new file mode 100644
index 0000000..8acd220
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/setjmp.S
@@ -0,0 +1,51 @@
+/*
+ * libc/sysdeps/linux/nios2/setjmp.S
+ *
+ *  Copyright (C) 2004,05,06  Microtronix Datacom Ltd
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ * 
+ * Written by Wentao Xu <wentao@microtronix.com>
+ * 
+ */
+
+#include <features.h>
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+.globl __sigsetjmp
+.type  __sigsetjmp,@function
+.balign 4
+
+__sigsetjmp:
+    stw     r16, (JB_REGS+ 0)(r4)
+    stw     r17, (JB_REGS+ 4)(r4)
+    stw     r18, (JB_REGS+ 8)(r4)
+    stw     r19, (JB_REGS+12)(r4)
+    stw     r20, (JB_REGS+16)(r4)
+    stw     r21, (JB_REGS+20)(r4)
+    stw     r22, (JB_REGS+24)(r4)
+    stw     r23, (JB_REGS+28)(r4)
+    
+    stw     ra, JB_PC(r4)
+    stw     sp, JB_SP(r4)
+    stw     fp, JB_FP(r4)
+    stw     gp, JB_GP(r4)
+    
+#if defined(__HAVE_FPU__)
+    SAVE_FPU r4 JB_FPREGS
+#endif
+
+#ifdef   __PIC__
+    /* just pray 16 bit offset is enough */
+    br __sigjmp_save
+#else
+    movhi r8, %hi(__sigjmp_save)
+    ori r8, r8, %lo(__sigjmp_save)    
+    jmp r8
+#endif
+
+.size __sigsetjmp,.-__sigsetjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/sys/procfs.h
new file mode 100644
index 0000000..8cbaa41
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/sys/procfs.h
@@ -0,0 +1,123 @@
+/* Copyright (C) 1996, 1997, 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.  */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+#include <bits/wordsize.h>
+
+__BEGIN_DECLS
+
+#define ELF_NGREG		38
+
+typedef struct
+  {
+    union
+      {
+	unsigned long	pr_regs[32];
+	double		pr_dregs[16];
+      }			pr_fr;
+    unsigned long	__unused;
+    unsigned long	pr_fsr;
+    unsigned char	pr_qcnt;
+    unsigned char	pr_q_entrysize;
+    unsigned char	pr_en;
+    unsigned int	pr_q[64];
+  } elf_fpregset_t;
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+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.  Fields present but not used are
+   marked with "XXX".  */
+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.  */
+  };
+
+/* 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;
+
+
+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/nios2/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/sys/ucontext.h
new file mode 100644
index 0000000..1805b4e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/sys/ucontext.h
@@ -0,0 +1,104 @@
+/* Copyright (C) 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_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+/*
+ * Location of the users' stored registers relative to R0.
+ * Usage is as an index into a gregset_t array or as u.u_ar0[XX].
+ */
+#define REG_PSR (0)
+#define REG_PC  (1)
+#define REG_SPARE   (2)
+#define REG_WVALID  (3)
+#define REG_G1  (4)
+#define REG_G2  (5)
+#define REG_G3  (6)
+#define REG_G4  (7)
+#define REG_G5  (8)
+#define REG_G6  (9)
+#define REG_G7  (10)
+#define REG_O0  (11)
+#define REG_O1  (12)
+#define REG_O2  (13)
+#define REG_O3  (14)
+#define REG_O4  (15)
+#define REG_O5  (16)
+#define REG_O6  (17)
+#define REG_O7  (18)
+#define REG_GLOBALS (19)
+
+/*
+ * A gregset_t is defined as an array type for compatibility with the reference
+ * source. This is important due to differences in the way the C language
+ * treats arrays and structures as parameters.
+ *
+ * Note that NGREG is really (sizeof (struct regs) / sizeof (greg_t)),
+ * but that the ABI defines it absolutely to be 21 (resp. 19).
+ */
+
+#define NGREG   20
+typedef int greg_t;
+
+typedef greg_t  gregset_t[NGREG];
+
+/*
+ * The following structures define how a register window can appear on the
+ * stack. This structure is available (when required) through the `gwins'
+ * field of an mcontext (nested within ucontext). NIOS_MAXWINDOW is the
+ * maximum number of outstanding register windows defined in the NIOS
+ * architecture (*not* implementation).
+ */
+#define NIOS_MAXREGWINDOW	31	/* max windows in NIOS arch. */
+struct  rwindow
+  {
+    greg_t rw_local[8];			/* locals */
+    greg_t rw_in[8];			/* ins */
+  };
+
+#define rw_fp   rw_in[6]		/* frame pointer */
+#define rw_rtn  rw_in[7]		/* return address */
+
+typedef struct gwindows
+  {
+    int            wbcnt;
+    int           *spbuf[NIOS_MAXREGWINDOW];
+    struct rwindow wbuf[NIOS_MAXREGWINDOW];
+  } gwindows_t;
+
+typedef struct
+  {
+    gregset_t   gregs;		/* general register set */
+    gwindows_t  *gwins;		/* POSSIBLE pointer to register windows */
+  } mcontext_t;
+
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long   uc_flags;
+    struct ucontext *uc_link;
+    __sigset_t	    uc_sigmask;
+    stack_t         uc_stack;
+    mcontext_t      uc_mcontext;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/nios2/sys/user.h
new file mode 100644
index 0000000..b34e93e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/sys/user.h
@@ -0,0 +1,93 @@
+#ifndef _SYS_USER_H
+#define _SYS_USER_H     1
+
+/*
+   This file was taken from the nios2 port of the Linux Kernel.
+
+   Copyright (c) 2008 Atle Nissestad <atle@nissestad.no>
+   Copyright (c) 2010 Tobias Klauser <tklauser@distanz.ch>
+
+   This file is licensed under the terms of the GNU General Public License,
+   Version 2.
+ */
+
+#include <bits/uClibc_page.h>
+
+/* Core file format: The core file is written in such a way that gdb
+   can understand it and provide useful information to the user (under
+   linux we use the 'trad-core' bfd).  There are quite a number of
+   obstacles to being able to view the contents of the floating point
+   registers, and until these are solved you will not be able to view the
+   contents of them.  Actually, you can read in the core file and look at
+   the contents of the user struct to find out what the floating point
+   registers contain.
+   The actual file contents are as follows:
+   UPAGE: 1 page consisting of a user struct that tells gdb what is present
+   in the file.  Directly after this is a copy of the task_struct, which
+   is currently not used by gdb, but it may come in useful at some point.
+   All of the registers are stored as part of the upage.  The upage should
+   always be only one page.
+   DATA: The data area is stored.  We use current->end_text to
+   current->brk to pick up all of the user variables, plus any memory
+   that may have been malloced.  No attempt is made to determine if a page
+   is demand-zero or if a page is totally unused, we just cover the entire
+   range.  All of the addresses are rounded in such a way that an integral
+   number of pages is written.
+   STACK: We need the stack information in order to get a meaningful
+   backtrace.  We need to write the data from (esp) to
+   current->start_stack, so we round each of these off in order to be able
+   to write an integer number of pages.
+   The minimum core file size is 3 pages, or 12288 bytes.
+*/
+
+struct user_nios2fp_struct {
+};
+
+/* This is the old layout of "struct pt_regs" as of Linux 1.x, and
+   is still the layout used by user (the new pt_regs doesn't have
+   all registers). */
+struct user_regs_struct {
+	long r1,r2,r3,r4,r5,r6,r7,r8;
+	long r9,r10,r11,r12,r13,r14,r15;
+	long r16,r17,r18,r19,r20,r21,r22,r23;
+	long gp;
+	long sp;
+	long ra;
+	long fp;
+	long orig_r2;
+	long estatus;
+	long status_extension;
+	long ea;
+};
+
+/* When the kernel dumps core, it starts by dumping the user struct -
+   this will be used by gdb to figure out where the data and stack segments
+   are within the file, and what virtual addresses to use. */
+struct user {
+/* We start with the registers, to mimic the way that "memory" is returned
+   from the ptrace(3,...) function.  */
+	struct user_regs_struct regs;	/* Where the registers are actually stored */
+
+/* The rest of this junk is to help gdb figure out what goes where */
+	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 area.
+					   This is actually the bottom of the stack,
+					   the top of the stack is always found in the
+					   esp register.  */
+	long int signal;		/* Signal that caused the core dump. */
+	int reserved;			/* No longer used */
+	unsigned long u_ar0;		/* Used by gdb to help find the values for */
+					/* the registers. */
+	unsigned long magic;		/* To uniquely identify a core file */
+	char u_comm[32];		/* User command that was responsible */
+};
+
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/syscall.c b/ap/build/uClibc/libc/sysdeps/linux/nios2/syscall.c
new file mode 100644
index 0000000..c3eb002
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/syscall.c
@@ -0,0 +1,47 @@
+/*
+ * libc/sysdeps/linux/nios2/syscall.c -- generic syscall function for linux/nios2
+ *
+ * Copyright (C) 2004 Microtronix Datacom Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#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)
+{
+    register long _r2 __asm__("r2")=(long)TRAP_ID_SYSCALL;
+    register long _r3 __asm__("r3")=(long)sysnum;
+
+    register long _r4 __asm__("r4")=(long)(a);
+    register long _r5 __asm__("r5")=(long)(b);
+    register long _r6 __asm__("r6")=(long)(c);
+    register long _r7 __asm__("r7")=(long)(d);
+    register long _r8 __asm__("r8")=(long)(e);
+    register long _r9 __asm__("r9")=(long)(f);
+    __asm__ __volatile__(
+	    "trap "
+	    : "=r"(_r2), "=r"(_r3)
+	    : "0"(_r2), "1"(_r3),
+	      "r"(_r4), "r"(_r5), "r"(_r6), "r"(_r7), "r"(_r8), "r"(_r9)
+	    : "memory");
+
+  __syscall_return (long, _r2);
+}
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/nios2/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/nios2/vfork.S
new file mode 100644
index 0000000..5d275ff
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/nios2/vfork.S
@@ -0,0 +1,56 @@
+/*
+ * libc/sysdeps/linux/nios2/vfork.S -- `vfork' syscall for linux/nios2
+ *
+ *  Copyright (C) 2004  Microtronix Datacom Ltd
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ * 
+ * Written by Wentao Xu <wentao@microtronix.com>
+ */
+
+#include <features.h>
+
+#define _ERRNO_H
+#include <bits/errno.h>
+#include <asm/unistd.h>
+
+#ifndef __NR_vfork
+#define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
+#endif
+
+.text
+.global	__vfork
+.hidden	__vfork
+.type	__vfork,%function
+.align 4
+__vfork:
+    movui   r2, TRAP_ID_SYSCALL
+    movui   r3, __NR_vfork
+    trap
+    movi    r8, -4096
+    bltu    r8, r2, fix_errno
+    ret
+fix_errno:
+    sub     r8, r0, r2
+    
+    addi    sp, sp, -8
+    stw     ra, 4(sp)
+    stw     r8, 0(sp)
+#ifndef __PIC__
+    call    __errno_location
+#else
+    
+#endif
+    ldw     ra, 4(sp)
+    ldw     r8, 0(sp)
+    stw     r8, 0(r2)
+    
+    addi    r2, r0, -1
+    addi  sp, sp, 8
+    ret
+
+.size __vfork,.-__vfork
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/Makefile b/ap/build/uClibc/libc/sysdeps/linux/powerpc/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/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/powerpc/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/powerpc/Makefile.arch
new file mode 100644
index 0000000..cdb35ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/Makefile.arch
@@ -0,0 +1,23 @@
+# 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 := __syscall_error.c pread_write.c ioctl.c
+
+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),y)
+CSRC += posix_fadvise.c posix_fadvise64.c
+endif
+
+SSRC := \
+	__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \
+	__uClibc_syscall.S syscall.S
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+SSRC += clone.S vfork.S
+endif
+
+ifeq ($(CONFIG_E500),y)
+ARCH_HEADERS := fenv.h
+endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/README.bits b/ap/build/uClibc/libc/sysdeps/linux/powerpc/README.bits
new file mode 100644
index 0000000..c0542e5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/README.bits
@@ -0,0 +1,14 @@
+
+include/bits is mostly the same as glibc-2.2.4.  The glibc-2.2.4
+versions can be accessed with the tag glibc224.
+
+Major differences:
+
+  - termios.h is from the Linux kernel, not glibc, because glibc has
+    a very strange legacy conversion layer, which we ignore.
+
+  - syscall.h is deleted; instead, sysnum.h is autogenerated in uClibc
+
+  - syscalls.h is added.
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/__longjmp.S
new file mode 100644
index 0000000..765a873
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/__longjmp.S
@@ -0,0 +1,94 @@
+/* longjmp for PowerPC and PowerPC e500.
+   Copyright (C) 1995, 1996, 1997, 1999, 2000, 2004
+   Free Software Foundation, Inc.
+   e500 contributed by Aldy Hernandez <aldyh@redhat.com>.
+   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 "ppc_asm.h"
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+
+#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+#define FP(x...) x
+#else
+#define FP(x...)
+#endif
+
+#if defined __CONFIG_E500__
+#define LFD(reg) evldd r##reg
+#define STFD(reg) evstdd r##reg
+#else
+#define LFD(reg) lfd fp##reg
+#define STFD(reg) stfd fp##reg
+#endif /* __CONFIG_E500__ */
+
+.globl      __longjmp;
+.type      __longjmp, @function;
+.align  2;
+
+__longjmp:    
+	lwz r1,(JB_GPR1*4)(r3)
+	lwz r2,(JB_GPR2*4)(r3)
+	lwz r0,(JB_LR*4)(r3)
+	lwz r14,((JB_GPRS+0)*4)(r3)
+FP(     LFD (14),((JB_FPRS+0*2)*4)(r3))
+        lwz r15,((JB_GPRS+1)*4)(r3)
+FP(     LFD (15),((JB_FPRS+1*2)*4)(r3))
+        lwz r16,((JB_GPRS+2)*4)(r3)
+FP(     LFD (16),((JB_FPRS+2*2)*4)(r3))
+        lwz r17,((JB_GPRS+3)*4)(r3)
+FP(     LFD (17),((JB_FPRS+3*2)*4)(r3))
+        lwz r18,((JB_GPRS+4)*4)(r3)
+FP(     LFD (18),((JB_FPRS+4*2)*4)(r3))
+        lwz r19,((JB_GPRS+5)*4)(r3)
+FP(     LFD (19),((JB_FPRS+5*2)*4)(r3))
+        lwz r20,((JB_GPRS+6)*4)(r3)
+FP(     LFD (20),((JB_FPRS+6*2)*4)(r3))
+        mtlr r0
+        lwz r21,((JB_GPRS+7)*4)(r3)
+FP(     LFD (21),((JB_FPRS+7*2)*4)(r3))
+        lwz r22,((JB_GPRS+8)*4)(r3)
+FP(     LFD (22),((JB_FPRS+8*2)*4)(r3))
+        lwz r0,(JB_CR*4)(r3)
+        lwz r23,((JB_GPRS+9)*4)(r3)
+FP(     LFD (23),((JB_FPRS+9*2)*4)(r3))
+        lwz r24,((JB_GPRS+10)*4)(r3)
+FP(     LFD (24),((JB_FPRS+10*2)*4)(r3))
+        lwz r25,((JB_GPRS+11)*4)(r3)
+FP(     LFD (25),((JB_FPRS+11*2)*4)(r3))
+        mtcrf 0xFF,r0
+        lwz r26,((JB_GPRS+12)*4)(r3)
+FP(     LFD (26),((JB_FPRS+12*2)*4)(r3))
+        lwz r27,((JB_GPRS+13)*4)(r3)
+FP(     LFD (27),((JB_FPRS+13*2)*4)(r3))
+        lwz r28,((JB_GPRS+14)*4)(r3)
+FP(     LFD (28),((JB_FPRS+14*2)*4)(r3))
+        lwz r29,((JB_GPRS+15)*4)(r3)
+FP(     LFD (29),((JB_FPRS+15*2)*4)(r3))
+        lwz r30,((JB_GPRS+16)*4)(r3)
+FP(     LFD (30),((JB_FPRS+16*2)*4)(r3))
+        lwz r31,((JB_GPRS+17)*4)(r3)
+FP(     LFD (31),((JB_FPRS+17*2)*4)(r3))
+	mr r3,r4
+	blr
+.size     __longjmp,.-__longjmp
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/__syscall_error.c b/ap/build/uClibc/libc/sysdeps/linux/powerpc/__syscall_error.c
new file mode 100644
index 0000000..5e109a8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/__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/powerpc/__uClibc_syscall.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/__uClibc_syscall.S
new file mode 100644
index 0000000..5a14c94
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/__uClibc_syscall.S
@@ -0,0 +1,12 @@
+	.text
+	.align 2
+	.globl __uClibc_syscall
+	.type	__uClibc_syscall,@function
+__uClibc_syscall:
+.Lsize:
+	sc
+	bnslr
+
+	b	__syscall_error
+
+	.size	__uClibc_syscall,.Lsize-__uClibc_syscall
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/atomic.h
new file mode 100644
index 0000000..dba1136
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/atomic.h
@@ -0,0 +1,630 @@
+/* Atomic operations.  PowerPC Common version.
+   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
+
+   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/wordsize.h>
+
+#if __WORDSIZE == 64
+/* Atomic operations.  PowerPC64 version.
+   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
+
+   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 32-bit exchange_bool is different on powerpc64 because the subf
+   does signed 64-bit arthmatic while the lwarx is 32-bit unsigned
+   (a load word and zero (high 32) form) load.
+   In powerpc64 register values are 64-bit by default,  including oldval.
+   The value in old val unknown sign extension, lwarx loads the 32-bit
+   value as unsigned.  So we explicitly clear the high 32 bits in oldval.  */
+# define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
+({									      \
+  unsigned int __tmp, __tmp2;						      \
+  __asm__ __volatile__ ("   clrldi  %1,%1,32\n"				      \
+		    "1:	lwarx	%0,0,%2\n"				      \
+		    "	subf.	%0,%1,%0\n"				      \
+		    "	bne	2f\n"					      \
+		    "	stwcx.	%4,0,%2\n"				      \
+		    "	bne-	1b\n"					      \
+		    "2:	" __ARCH_ACQ_INSTR				      \
+		    : "=&r" (__tmp), "=r" (__tmp2)			      \
+		    : "b" (mem), "1" (oldval), "r" (newval)		      \
+		    : "cr0", "memory");					      \
+  __tmp != 0;								      \
+})
+
+# define __arch_compare_and_exchange_bool_32_rel(mem, newval, oldval) \
+({									      \
+  unsigned int __tmp, __tmp2;						      \
+  __asm__ __volatile__ (__ARCH_REL_INSTR "\n"				      \
+		    "   clrldi  %1,%1,32\n"				      \
+		    "1:	lwarx	%0,0,%2\n"				      \
+		    "	subf.	%0,%1,%0\n"				      \
+		    "	bne	2f\n"					      \
+		    "	stwcx.	%4,0,%2\n"				      \
+		    "	bne-	1b\n"					      \
+		    "2:	"						      \
+		    : "=&r" (__tmp), "=r" (__tmp2)			      \
+		    : "b" (mem), "1" (oldval), "r" (newval)		      \
+		    : "cr0", "memory");					      \
+  __tmp != 0;								      \
+})
+
+/*
+ * Only powerpc64 processors support Load doubleword and reserve index (ldarx)
+ * and Store doubleword conditional indexed (stdcx) instructions.  So here
+ * we define the 64-bit forms.
+ */
+# define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \
+({									      \
+  unsigned long	__tmp;							      \
+  __asm__ __volatile__ (							      \
+		    "1:	ldarx	%0,0,%1\n"				      \
+		    "	subf.	%0,%2,%0\n"				      \
+		    "	bne	2f\n"					      \
+		    "	stdcx.	%3,0,%1\n"				      \
+		    "	bne-	1b\n"					      \
+		    "2:	" __ARCH_ACQ_INSTR				      \
+		    : "=&r" (__tmp)					      \
+		    : "b" (mem), "r" (oldval), "r" (newval)		      \
+		    : "cr0", "memory");					      \
+  __tmp != 0;								      \
+})
+
+# define __arch_compare_and_exchange_bool_64_rel(mem, newval, oldval) \
+({									      \
+  unsigned long	__tmp;							      \
+  __asm__ __volatile__ (__ARCH_REL_INSTR "\n"				      \
+		    "1:	ldarx	%0,0,%1\n"				      \
+		    "	subf.	%0,%2,%0\n"				      \
+		    "	bne	2f\n"					      \
+		    "	stdcx.	%3,0,%1\n"				      \
+		    "	bne-	1b\n"					      \
+		    "2:	"						      \
+		    : "=&r" (__tmp)					      \
+		    : "b" (mem), "r" (oldval), "r" (newval)		      \
+		    : "cr0", "memory");					      \
+  __tmp != 0;								      \
+})
+
+#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+  ({									      \
+      __typeof (*(mem)) __tmp;						      \
+      __typeof (mem)  __memp = (mem);					      \
+      __asm__ __volatile__ (						      \
+		        "1:	ldarx	%0,0,%1\n"			      \
+		        "	cmpd	%0,%2\n"			      \
+		        "	bne	2f\n"				      \
+		        "	stdcx.	%3,0,%1\n"			      \
+		        "	bne-	1b\n"				      \
+		        "2:	" __ARCH_ACQ_INSTR			      \
+		        : "=&r" (__tmp)					      \
+		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
+		        : "cr0", "memory");				      \
+      __tmp;								      \
+  })
+
+#define __arch_compare_and_exchange_val_64_rel(mem, newval, oldval) \
+  ({									      \
+      __typeof (*(mem)) __tmp;						      \
+      __typeof (mem)  __memp = (mem);					      \
+      __asm__ __volatile__ (__ARCH_REL_INSTR "\n"				      \
+		        "1:	ldarx	%0,0,%1\n"			      \
+		        "	cmpd	%0,%2\n"			      \
+		        "	bne	2f\n"				      \
+		        "	stdcx.	%3,0,%1\n"			      \
+		        "	bne-	1b\n"				      \
+		        "2:	"					      \
+		        : "=&r" (__tmp)					      \
+		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
+		        : "cr0", "memory");				      \
+      __tmp;								      \
+  })
+
+# define __arch_atomic_exchange_64_acq(mem, value) \
+    ({									      \
+      __typeof (*mem) __val;						      \
+      __asm__ __volatile__ (__ARCH_REL_INSTR "\n"				      \
+			"1:	ldarx	%0,0,%2\n"			      \
+			"	stdcx.	%3,0,%2\n"			      \
+			"	bne-	1b\n"				      \
+		  " " __ARCH_ACQ_INSTR					      \
+			: "=&r" (__val), "=m" (*mem)			      \
+			: "b" (mem), "r" (value), "m" (*mem)		      \
+			: "cr0", "memory");				      \
+      __val;								      \
+    })
+
+# define __arch_atomic_exchange_64_rel(mem, value) \
+    ({									      \
+      __typeof (*mem) __val;						      \
+      __asm__ __volatile__ (__ARCH_REL_INSTR "\n"				      \
+			"1:	ldarx	%0,0,%2\n"			      \
+			"	stdcx.	%3,0,%2\n"			      \
+			"	bne-	1b"				      \
+			: "=&r" (__val), "=m" (*mem)			      \
+			: "b" (mem), "r" (value), "m" (*mem)		      \
+			: "cr0", "memory");				      \
+      __val;								      \
+    })
+
+# define __arch_atomic_exchange_and_add_64(mem, value) \
+    ({									      \
+      __typeof (*mem) __val, __tmp;					      \
+      __asm__ __volatile__ ("1:	ldarx	%0,0,%3\n"			      \
+			"	add	%1,%0,%4\n"			      \
+			"	stdcx.	%1,0,%3\n"			      \
+			"	bne-	1b"				      \
+			: "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
+			: "b" (mem), "r" (value), "m" (*mem)		      \
+			: "cr0", "memory");				      \
+      __val;								      \
+    })
+
+# define __arch_atomic_increment_val_64(mem) \
+    ({									      \
+      __typeof (*(mem)) __val;						      \
+      __asm__ __volatile__ ("1:	ldarx	%0,0,%2\n"			      \
+			"	addi	%0,%0,1\n"			      \
+			"	stdcx.	%0,0,%2\n"			      \
+			"	bne-	1b"				      \
+			: "=&b" (__val), "=m" (*mem)			      \
+			: "b" (mem), "m" (*mem)				      \
+			: "cr0", "memory");				      \
+      __val;								      \
+    })
+
+# define __arch_atomic_decrement_val_64(mem) \
+    ({									      \
+      __typeof (*(mem)) __val;						      \
+      __asm__ __volatile__ ("1:	ldarx	%0,0,%2\n"			      \
+			"	subi	%0,%0,1\n"			      \
+			"	stdcx.	%0,0,%2\n"			      \
+			"	bne-	1b"				      \
+			: "=&b" (__val), "=m" (*mem)			      \
+			: "b" (mem), "m" (*mem)				      \
+			: "cr0", "memory");				      \
+      __val;								      \
+    })
+
+# define __arch_atomic_decrement_if_positive_64(mem) \
+  ({ int __val, __tmp;							      \
+     __asm__ __volatile__ ("1:	ldarx	%0,0,%3\n"			      \
+		       "	cmpdi	0,%0,0\n"			      \
+		       "	addi	%1,%0,-1\n"			      \
+		       "	ble	2f\n"				      \
+		       "	stdcx.	%1,0,%3\n"			      \
+		       "	bne-	1b\n"				      \
+		       "2:	" __ARCH_ACQ_INSTR			      \
+		       : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
+		       : "b" (mem), "m" (*mem)				      \
+		       : "cr0", "memory");				      \
+     __val;								      \
+  })
+
+/*
+ * All powerpc64 processors support the new "light weight"  sync (lwsync).
+ */
+# define atomic_read_barrier()	__asm__ ("lwsync" ::: "memory")
+/*
+ * "light weight" sync can also be used for the release barrier.
+ */
+# ifndef UP
+#  define __ARCH_REL_INSTR	"lwsync"
+# endif
+
+#else
+/* Atomic operations.  PowerPC32 version.
+   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
+
+   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 32-bit exchange_bool is different on powerpc64 because the subf
+ * does signed 64-bit arthmatic while the lwarx is 32-bit unsigned
+ * (a load word and zero (high 32) form).  So powerpc64 has a slightly
+ * different version in sysdeps/powerpc/powerpc64/bits/atomic.h.
+ */
+# define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval)         \
+({									      \
+  unsigned int __tmp;							      \
+  __asm__ __volatile__ (							      \
+		    "1:	lwarx	%0,0,%1\n"				      \
+		    "	subf.	%0,%2,%0\n"				      \
+		    "	bne	2f\n"					      \
+		    "	stwcx.	%3,0,%1\n"				      \
+		    "	bne-	1b\n"					      \
+		    "2:	" __ARCH_ACQ_INSTR				      \
+		    : "=&r" (__tmp)					      \
+		    : "b" (mem), "r" (oldval), "r" (newval)		      \
+		    : "cr0", "memory");					      \
+  __tmp != 0;								      \
+})
+
+# define __arch_compare_and_exchange_bool_32_rel(mem, newval, oldval)	      \
+({									      \
+  unsigned int __tmp;							      \
+  __asm__ __volatile__ (__ARCH_REL_INSTR "\n"				      \
+		    "1:	lwarx	%0,0,%1\n"				      \
+		    "	subf.	%0,%2,%0\n"				      \
+		    "	bne	2f\n"					      \
+		    "	stwcx.	%3,0,%1\n"				      \
+		    "	bne-	1b\n"					      \
+		    "2:	"						      \
+		    : "=&r" (__tmp)					      \
+		    : "b" (mem), "r" (oldval), "r" (newval)		      \
+		    : "cr0", "memory");					      \
+  __tmp != 0;								      \
+})
+
+/* Powerpc32 processors don't implement the 64-bit (doubleword) forms of
+   load and reserve (ldarx) and store conditional (stdcx.) instructions.
+   So for powerpc32 we stub out the 64-bit forms.  */
+# define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \
+  (abort (), 0)
+
+# define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+  (abort (), (__typeof (*mem)) 0)
+
+# define __arch_compare_and_exchange_bool_64_rel(mem, newval, oldval) \
+  (abort (), 0)
+
+# define __arch_compare_and_exchange_val_64_rel(mem, newval, oldval) \
+  (abort (), (__typeof (*mem)) 0)
+
+# define __arch_atomic_exchange_64_acq(mem, value) \
+    ({ abort (); (*mem) = (value); })
+
+# define __arch_atomic_exchange_64_rel(mem, value) \
+    ({ abort (); (*mem) = (value); })
+
+# define __arch_atomic_exchange_and_add_64(mem, value) \
+    ({ abort (); (*mem) = (value); })
+
+# define __arch_atomic_increment_val_64(mem) \
+    ({ abort (); (*mem)++; })
+
+# define __arch_atomic_decrement_val_64(mem) \
+    ({ abort (); (*mem)--; })
+
+# define __arch_atomic_decrement_if_positive_64(mem) \
+    ({ abort (); (*mem)--; })
+
+#ifdef _ARCH_PWR4
+/*
+ * Newer powerpc64 processors support the new "light weight" sync (lwsync)
+ * So if the build is using -mcpu=[power4,power5,power5+,970] we can
+ * safely use lwsync.
+ */
+# define atomic_read_barrier()	__asm__ ("lwsync" ::: "memory")
+/*
+ * "light weight" sync can also be used for the release barrier.
+ */
+# ifndef UP
+#  define __ARCH_REL_INSTR	"lwsync"
+# endif
+#else
+
+/*
+ * Older powerpc32 processors don't support the new "light weight"
+ * sync (lwsync).  So the only safe option is to use normal sync
+ * for all powerpc32 applications.
+ */
+# define atomic_read_barrier()	__asm__ ("sync" ::: "memory")
+#endif
+
+#endif
+
+#include <stdint.h>
+
+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 int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+typedef int_fast64_t atomic_fast64_t;
+typedef uint_fast64_t uatomic_fast64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+/*
+ * Powerpc does not have byte and halfword forms of load and reserve and
+ * store conditional. So for powerpc we stub out the 8- and 16-bit forms.
+ */
+#define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval) \
+  (abort (), 0)
+
+#define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval) \
+  (abort (), 0)
+
+#define __arch_compare_and_exchange_bool_8_rel(mem, newval, oldval) \
+  (abort (), 0)
+
+#define __arch_compare_and_exchange_bool_16_rel(mem, newval, oldval) \
+  (abort (), 0)
+
+#ifdef UP
+# define __ARCH_ACQ_INSTR	""
+# define __ARCH_REL_INSTR	""
+#else
+# define __ARCH_ACQ_INSTR	"isync"
+# ifndef __ARCH_REL_INSTR
+#  define __ARCH_REL_INSTR	"sync"
+# endif
+#endif
+
+#ifndef MUTEX_HINT_ACQ
+# define MUTEX_HINT_ACQ
+#endif
+#ifndef MUTEX_HINT_REL
+# define MUTEX_HINT_REL
+#endif
+
+#define atomic_full_barrier()	__asm__ ("sync" ::: "memory")
+#define atomic_write_barrier()	__asm__ ("eieio" ::: "memory")
+
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval)	      \
+  ({									      \
+      __typeof (*(mem)) __tmp;						      \
+      __typeof (mem)  __memp = (mem);					      \
+      __asm__ __volatile__ (						      \
+		        "1:	lwarx	%0,0,%1\n"			      \
+		        "	cmpw	%0,%2\n"			      \
+		        "	bne	2f\n"				      \
+		        "	stwcx.	%3,0,%1\n"			      \
+		        "	bne-	1b\n"				      \
+		        "2:	" __ARCH_ACQ_INSTR			      \
+		        : "=&r" (__tmp)					      \
+		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
+		        : "cr0", "memory");				      \
+      __tmp;								      \
+  })
+
+#define __arch_compare_and_exchange_val_32_rel(mem, newval, oldval)	      \
+  ({									      \
+      __typeof (*(mem)) __tmp;						      \
+      __typeof (mem)  __memp = (mem);					      \
+      __asm__ __volatile__ (__ARCH_REL_INSTR "\n"				      \
+		        "1:	lwarx	%0,0,%1\n"			      \
+		        "	cmpw	%0,%2\n"			      \
+		        "	bne	2f\n"				      \
+		        "	stwcx.	%3,0,%1\n"			      \
+		        "	bne-	1b\n"				      \
+		        "2:	"					      \
+		        : "=&r" (__tmp)					      \
+		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
+		        : "cr0", "memory");				      \
+      __tmp;								      \
+  })
+
+#define __arch_atomic_exchange_32_acq(mem, value)			      \
+  ({									      \
+    __typeof (*mem) __val;						      \
+    __asm__ __volatile__ (							      \
+		      "1:	lwarx	%0,0,%2\n"			      \
+		      "		stwcx.	%3,0,%2\n"			      \
+		      "		bne-	1b\n"				      \
+		      "   " __ARCH_ACQ_INSTR				      \
+		      : "=&r" (__val), "=m" (*mem)			      \
+		      : "b" (mem), "r" (value), "m" (*mem)		      \
+		      : "cr0", "memory");				      \
+    __val;								      \
+  })
+
+#define __arch_atomic_exchange_32_rel(mem, value) \
+  ({									      \
+    __typeof (*mem) __val;						      \
+    __asm__ __volatile__ (__ARCH_REL_INSTR "\n"				      \
+		      "1:	lwarx	%0,0,%2\n"			      \
+		      "		stwcx.	%3,0,%2\n"			      \
+		      "		bne-	1b"				      \
+		      : "=&r" (__val), "=m" (*mem)			      \
+		      : "b" (mem), "r" (value), "m" (*mem)		      \
+		      : "cr0", "memory");				      \
+    __val;								      \
+  })
+
+#define __arch_atomic_exchange_and_add_32(mem, value) \
+  ({									      \
+    __typeof (*mem) __val, __tmp;					      \
+    __asm__ __volatile__ ("1:	lwarx	%0,0,%3\n"			      \
+		      "		add	%1,%0,%4\n"			      \
+		      "		stwcx.	%1,0,%3\n"			      \
+		      "		bne-	1b"				      \
+		      : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
+		      : "b" (mem), "r" (value), "m" (*mem)		      \
+		      : "cr0", "memory");				      \
+    __val;								      \
+  })
+
+#define __arch_atomic_increment_val_32(mem) \
+  ({									      \
+    __typeof (*(mem)) __val;						      \
+    __asm__ __volatile__ ("1:	lwarx	%0,0,%2\n"			      \
+		      "		addi	%0,%0,1\n"			      \
+		      "		stwcx.	%0,0,%2\n"			      \
+		      "		bne-	1b"				      \
+		      : "=&b" (__val), "=m" (*mem)			      \
+		      : "b" (mem), "m" (*mem)				      \
+		      : "cr0", "memory");				      \
+    __val;								      \
+  })
+
+#define __arch_atomic_decrement_val_32(mem) \
+  ({									      \
+    __typeof (*(mem)) __val;						      \
+    __asm__ __volatile__ ("1:	lwarx	%0,0,%2\n"			      \
+		      "		subi	%0,%0,1\n"			      \
+		      "		stwcx.	%0,0,%2\n"			      \
+		      "		bne-	1b"				      \
+		      : "=&b" (__val), "=m" (*mem)			      \
+		      : "b" (mem), "m" (*mem)				      \
+		      : "cr0", "memory");				      \
+    __val;								      \
+  })
+
+#define __arch_atomic_decrement_if_positive_32(mem) \
+  ({ int __val, __tmp;							      \
+     __asm__ __volatile__ ("1:	lwarx	%0,0,%3\n"			      \
+		       "	cmpwi	0,%0,0\n"			      \
+		       "	addi	%1,%0,-1\n"			      \
+		       "	ble	2f\n"				      \
+		       "	stwcx.	%1,0,%3\n"			      \
+		       "	bne-	1b\n"				      \
+		       "2:	" __ARCH_ACQ_INSTR			      \
+		       : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
+		       : "b" (mem), "m" (*mem)				      \
+		       : "cr0", "memory");				      \
+     __val;								      \
+  })
+
+#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+  ({									      \
+    __typeof (*(mem)) __result;						      \
+    if (sizeof (*mem) == 4)						      \
+      __result = __arch_compare_and_exchange_val_32_acq(mem, newval, oldval); \
+    else if (sizeof (*mem) == 8)					      \
+      __result = __arch_compare_and_exchange_val_64_acq(mem, newval, oldval); \
+    else								      \
+       abort ();							      \
+    __result;								      \
+  })
+
+#define atomic_compare_and_exchange_val_rel(mem, newval, oldval) \
+  ({									      \
+    __typeof (*(mem)) __result;						      \
+    if (sizeof (*mem) == 4)						      \
+      __result = __arch_compare_and_exchange_val_32_rel(mem, newval, oldval); \
+    else if (sizeof (*mem) == 8)					      \
+      __result = __arch_compare_and_exchange_val_64_rel(mem, newval, oldval); \
+    else								      \
+       abort ();							      \
+    __result;								      \
+  })
+
+#define atomic_exchange_acq(mem, value) \
+  ({									      \
+    __typeof (*(mem)) __result;						      \
+    if (sizeof (*mem) == 4)						      \
+      __result = __arch_atomic_exchange_32_acq (mem, value);		      \
+    else if (sizeof (*mem) == 8)					      \
+      __result = __arch_atomic_exchange_64_acq (mem, value);		      \
+    else								      \
+       abort ();							      \
+    __result;								      \
+  })
+
+#define atomic_exchange_rel(mem, value) \
+  ({									      \
+    __typeof (*(mem)) __result;						      \
+    if (sizeof (*mem) == 4)						      \
+      __result = __arch_atomic_exchange_32_rel (mem, value);		      \
+    else if (sizeof (*mem) == 8)					      \
+      __result = __arch_atomic_exchange_64_rel (mem, value);		      \
+    else								      \
+       abort ();							      \
+    __result;								      \
+  })
+
+#define atomic_exchange_and_add(mem, value) \
+  ({									      \
+    __typeof (*(mem)) __result;						      \
+    if (sizeof (*mem) == 4)						      \
+      __result = __arch_atomic_exchange_and_add_32 (mem, value);	      \
+    else if (sizeof (*mem) == 8)					      \
+      __result = __arch_atomic_exchange_and_add_64 (mem, value);	      \
+    else								      \
+       abort ();							      \
+    __result;								      \
+  })
+
+#define atomic_increment_val(mem) \
+  ({									      \
+    __typeof (*(mem)) __result;						      \
+    if (sizeof (*(mem)) == 4)						      \
+      __result = __arch_atomic_increment_val_32 (mem);			      \
+    else if (sizeof (*(mem)) == 8)					      \
+      __result = __arch_atomic_increment_val_64 (mem);			      \
+    else								      \
+       abort ();							      \
+    __result;								      \
+  })
+
+#define atomic_increment(mem) ({ atomic_increment_val (mem); (void) 0; })
+
+#define atomic_decrement_val(mem) \
+  ({									      \
+    __typeof (*(mem)) __result;						      \
+    if (sizeof (*(mem)) == 4)						      \
+      __result = __arch_atomic_decrement_val_32 (mem);			      \
+    else if (sizeof (*(mem)) == 8)					      \
+      __result = __arch_atomic_decrement_val_64 (mem);			      \
+    else								      \
+       abort ();							      \
+    __result;								      \
+  })
+
+#define atomic_decrement(mem) ({ atomic_decrement_val (mem); (void) 0; })
+
+
+/* Decrement *MEM if it is > 0, and return the old value.  */
+#define atomic_decrement_if_positive(mem) \
+  ({ __typeof (*(mem)) __result;					      \
+    if (sizeof (*mem) == 4)						      \
+      __result = __arch_atomic_decrement_if_positive_32 (mem);		      \
+    else if (sizeof (*mem) == 8)					      \
+      __result = __arch_atomic_decrement_if_positive_64 (mem);		      \
+    else								      \
+       abort ();							      \
+    __result;								      \
+  })
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/endian.h
new file mode 100644
index 0000000..2a07934
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/endian.h
@@ -0,0 +1,37 @@
+/* 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.  */
+
+/* PowerPC can be little or big endian.  Hopefully gcc will know...  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN
+# if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN
+#  error Both BIG_ENDIAN and LITTLE_ENDIAN defined!
+# endif
+# define __BYTE_ORDER __BIG_ENDIAN
+#else
+# if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN
+#  define __BYTE_ORDER __LITTLE_ENDIAN
+# else
+#  warning Cannot determine current byte order, assuming big-endian.
+#  define __BYTE_ORDER __BIG_ENDIAN
+# endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/fcntl.h
new file mode 100644
index 0000000..0759c6a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/fcntl.h
@@ -0,0 +1,239 @@
+/* O_*, F_*, FD_* bit values for Linux/PowerPC.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007
+   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_DIRECT	0400000	/* Direct disk access.	*/
+# define O_DIRECTORY	 040000	/* Must be a directory.	 */
+# define O_NOFOLLOW	0100000	/* Do not follow links.	 */
+# define O_NOATIME	01000000 /* Do not set atime.  */
+# define O_CLOEXEC	02000000 /* Set close_on_exec.  */
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE	0200000
+#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
+
+/* 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/powerpc/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/fenv.h
new file mode 100644
index 0000000..b674965
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/fenv.h
@@ -0,0 +1,168 @@
+/* Copyright (C) 1997, 1998, 1999, 2004, 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.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+#include <features.h>
+
+#ifdef __CONFIG_E500__
+
+/* Define bits representing the exception.  We use the bit positions of
+   the appropriate bits in the SPEFSCR...  */
+enum
+  {
+    FE_INEXACT = 1 << (63 - 42),
+#define FE_INEXACT	FE_INEXACT
+    FE_INVALID = 1 << (63 - 43),
+#define FE_INVALID	FE_INVALID
+    FE_DIVBYZERO = 1 << (63 - 44),
+#define FE_DIVBYZERO	FE_DIVBYZERO
+    FE_UNDERFLOW = 1 << (63 - 45),
+#define FE_UNDERFLOW	FE_UNDERFLOW
+    FE_OVERFLOW = 1 << (63 - 46)
+#define FE_OVERFLOW	FE_OVERFLOW
+  };
+
+#else /* PowerPC 6xx floating-point.  */
+
+/* Define bits representing the exception.  We use the bit positions of
+   the appropriate bits in the FPSCR...  */
+enum
+  {
+    FE_INEXACT = 1 << (31 - 6),
+#define FE_INEXACT	FE_INEXACT
+    FE_DIVBYZERO = 1 << (31 - 5),
+#define FE_DIVBYZERO	FE_DIVBYZERO
+    FE_UNDERFLOW = 1 << (31 - 4),
+#define FE_UNDERFLOW	FE_UNDERFLOW
+    FE_OVERFLOW = 1 << (31 - 3),
+#define FE_OVERFLOW	FE_OVERFLOW
+
+    /* ... except for FE_INVALID, for which we use bit 31. FE_INVALID
+       actually corresponds to bits 7 through 12 and 21 through 23
+       in the FPSCR, but we can't use that because the current draft
+       says that it must be a power of 2.  Instead we use bit 2 which
+       is the summary bit for all the FE_INVALID exceptions, which
+       kind of makes sense.  */
+    FE_INVALID = 1 << (31 - 2),
+#define FE_INVALID	FE_INVALID
+
+#ifdef __USE_GNU
+    /* Breakdown of the FE_INVALID bits. Setting FE_INVALID on an
+       input to a routine is equivalent to setting all of these bits;
+       FE_INVALID will be set on output from a routine iff one of
+       these bits is set.  Note, though, that you can't disable or
+       enable these exceptions individually.  */
+
+    /* Operation with SNaN. */
+    FE_INVALID_SNAN = 1 << (31 - 7),
+# define FE_INVALID_SNAN	FE_INVALID_SNAN
+
+    /* Inf - Inf */
+    FE_INVALID_ISI = 1 << (31 - 8),
+# define FE_INVALID_ISI		FE_INVALID_ISI
+
+    /* Inf / Inf */
+    FE_INVALID_IDI = 1 << (31 - 9),
+# define FE_INVALID_IDI		FE_INVALID_IDI
+
+    /* 0 / 0 */
+    FE_INVALID_ZDZ = 1 << (31 - 10),
+# define FE_INVALID_ZDZ		FE_INVALID_ZDZ
+
+    /* Inf * 0 */
+    FE_INVALID_IMZ = 1 << (31 - 11),
+# define FE_INVALID_IMZ		FE_INVALID_IMZ
+
+    /* Comparison with NaN or SNaN.  */
+    FE_INVALID_COMPARE = 1 << (31 - 12),
+# define FE_INVALID_COMPARE	FE_INVALID_COMPARE
+
+    /* Invalid operation flag for software (not set by hardware).  */
+    /* Note that some chips don't have this implemented, presumably
+       because no-one expected anyone to write software for them %-).  */
+    FE_INVALID_SOFTWARE = 1 << (31 - 21),
+# define FE_INVALID_SOFTWARE	FE_INVALID_SOFTWARE
+
+    /* Square root of negative number (including -Inf).  */
+    /* Note that some chips don't have this implemented.  */
+    FE_INVALID_SQRT = 1 << (31 - 22),
+# define FE_INVALID_SQRT	FE_INVALID_SQRT
+
+    /* Conversion-to-integer of a NaN or a number too large or too small.  */
+    FE_INVALID_INTEGER_CONVERSION = 1 << (31 - 23)
+# define FE_INVALID_INTEGER_CONVERSION	FE_INVALID_INTEGER_CONVERSION
+
+# define FE_ALL_INVALID \
+        (FE_INVALID_SNAN | FE_INVALID_ISI | FE_INVALID_IDI | FE_INVALID_ZDZ \
+	 | FE_INVALID_IMZ | FE_INVALID_COMPARE | FE_INVALID_SOFTWARE \
+	 | FE_INVALID_SQRT | FE_INVALID_INTEGER_CONVERSION)
+#endif /* __USE_GNU */
+  };
+
+#endif /* __CONFIG_E500__ */
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* PowerPC chips support all of the four defined rounding modes.  We
+   use the bit pattern in the FPSCR as the values for the
+   appropriate macros.  */
+enum
+  {
+    FE_TONEAREST = 0,
+#define FE_TONEAREST	FE_TONEAREST
+    FE_TOWARDZERO = 1,
+#define FE_TOWARDZERO	FE_TOWARDZERO
+    FE_UPWARD = 2,
+#define FE_UPWARD	FE_UPWARD
+    FE_DOWNWARD = 3
+#define FE_DOWNWARD	FE_DOWNWARD
+  };
+
+/* Type representing exception flags.  */
+typedef unsigned int fexcept_t;
+
+/* Type representing floating-point environment.  We leave it as 'double'
+   for efficiency reasons (rather than writing it to a 32-bit integer). */
+typedef double fenv_t;
+
+/* If the default argument is used we use this value.  */
+extern const fenv_t __fe_dfl_env;
+#define FE_DFL_ENV	(&__fe_dfl_env)
+
+#ifdef __USE_GNU
+/* Floating-point environment where all exceptions are enabled.  Note that
+   this is not sufficient to give you SIGFPE.  */
+extern const fenv_t __fe_enabled_env;
+# define FE_ENABLED_ENV	(&__fe_enabled_env)
+
+/* Floating-point environment with (processor-dependent) non-IEEE floating
+   point.  */
+extern const fenv_t __fe_nonieee_env;
+# define FE_NONIEEE_ENV	(&__fe_nonieee_env)
+
+/* Floating-point environment with all exceptions enabled.  Note that
+   just evaluating this value will set the processor into 'FPU
+   exceptions imprecise recoverable' mode, which may cause a significant
+   performance penalty (but have no other visible effect).  */
+extern const fenv_t *__fe_nomask_env (void);
+# define FE_NOMASK_ENV	(__fe_nomask_env ())
+#endif /* __USE_GNU */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/fenvinline.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/fenvinline.h
new file mode 100644
index 0000000..8146479
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/fenvinline.h
@@ -0,0 +1,64 @@
+/* Inline floating-point environment handling functions for powerpc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 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.  */
+
+#include <features.h>
+
+#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_MATH_INLINES
+
+/* Inline definition for fegetround.  */
+# define fegetround() \
+  (__extension__  ({ int __fegetround_result;				      \
+		     __asm__ __volatile__				      \
+		       ("mcrfs 7,7 ; mfcr %0"				      \
+			: "=r"(__fegetround_result) : : "cr7");		      \
+		     __fegetround_result & 3; }))
+
+/* The weird 'i#*X' constraints on the following suppress a gcc
+   warning when __excepts is not a constant.  Otherwise, they mean the
+   same as just plain 'i'.  */
+
+/* Inline definition for feraiseexcept.  */
+# define feraiseexcept(__excepts) \
+  ((__builtin_constant_p (__excepts)					      \
+    && ((__excepts) & ((__excepts)-1)) == 0				      \
+    && (__excepts) != FE_INVALID)					      \
+   ? ((__excepts) != 0							      \
+      ? (__extension__ ({ __asm__ __volatile__				      \
+			  ("mtfsb1 %s0"					      \
+			   : : "i#*X"(__builtin_ffs (__excepts)));	      \
+			  0; }))					      \
+      : 0)								      \
+   : (feraiseexcept) (__excepts))
+
+/* Inline definition for feclearexcept.  */
+# define feclearexcept(__excepts) \
+  ((__builtin_constant_p (__excepts)					      \
+    && ((__excepts) & ((__excepts)-1)) == 0				      \
+    && (__excepts) != FE_INVALID)					      \
+   ? ((__excepts) != 0							      \
+      ? (__extension__ ({ __asm__ __volatile__				      \
+			  ("mtfsb0 %s0"					      \
+			   : : "i#*X"(__builtin_ffs (__excepts)));	      \
+			  0; }))					      \
+      : 0)								      \
+   : (feclearexcept) (__excepts))
+
+#endif /* __GNUC__ && !_SOFT_FLOAT */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/ioctl-types.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/ioctl-types.h
new file mode 100644
index 0000000..87b8265
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/ioctl-types.h
@@ -0,0 +1,5 @@
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+#include <termios.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/ipc.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/ipc.h
new file mode 100644
index 0000000..4f45aca
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/ipc.h
@@ -0,0 +1,62 @@
+/* Copyright (C) 1995-1999, 2000, 2002 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_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#ifdef __USE_GNU
+# define IPC_INFO	3		/* See ipcs.  */
+#endif
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;		/* Key.  */
+    __uid_t uid;		/* Owner's user ID.  */
+    __gid_t gid;		/* Owner's group ID.  */
+    __uid_t cuid;		/* Creator's user ID.  */
+    __gid_t cgid;		/* Creator's group ID.  */
+    __mode_t mode;		/* Read/write permission.  */
+#if 0
+    unsigned long __seq;	/* Sequence number. */
+    unsigned int __pad2;
+    unsigned long long int __unused1;
+    unsigned long long int __unused2;
+#else
+    __uint32_t __seq;		/* Sequence number.  */
+    __uint32_t __pad1;
+    __uint64_t __unused1;
+    __uint64_t __unused2;
+#endif
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/kernel_stat.h
new file mode 100644
index 0000000..579b5b4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/kernel_stat.h
@@ -0,0 +1,50 @@
+#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... */
+
+#if __WORDSIZE == 64
+#define kernel_stat kernel_stat64
+#else
+struct kernel_stat {
+	__kernel_dev_t	st_dev;
+	__kernel_ino_t	st_ino;
+	__kernel_mode_t	st_mode;
+	__kernel_nlink_t st_nlink;
+	__kernel_uid_t	st_uid;
+	__kernel_gid_t 	st_gid;
+	__kernel_dev_t	st_rdev;
+	__kernel_off_t	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;
+};
+#endif
+
+struct kernel_stat64 {
+	unsigned long long st_dev; 	/* Device.  */
+	unsigned long long st_ino;	/* File serial number.  */
+	unsigned int st_mode;		/* File mode.  */
+	unsigned int st_nlink;		/* Link count.  */
+	unsigned int st_uid;		/* User ID of the file's owner.  */
+	unsigned int st_gid;		/* Group ID of the file's group. */
+	unsigned long long st_rdev; 	/* Device number, if device.  */
+	unsigned short int __pad2;
+	long long st_size;		/* Size of file, in bytes.  */
+	long st_blksize;		/* Optimal block size for I/O.  */
+	long long st_blocks;		/* Number 512-byte blocks allocated. */
+	struct timespec st_atim;	/* Time of last access.  */
+	struct timespec st_mtim;	/* Time of last modification.  */
+	struct timespec st_ctim;	/* Time of last status change.  */
+	unsigned long int __unused4;
+	unsigned long int __unused5;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/kernel_types.h
new file mode 100644
index 0000000..1167de2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/kernel_types.h
@@ -0,0 +1,76 @@
+/* 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
+ */
+#if ! defined _PPC_POSIX_TYPES_H && ! defined _PPC64_POSIX_TYPES_H && \
+    ! defined _ASM_POWERPC_POSIX_TYPES_H
+#define _PPC_POSIX_TYPES_H
+#define _PPC64_POSIX_TYPES_H
+#define _ASM_POWERPC_POSIX_TYPES_H
+
+# if __WORDSIZE == 64
+typedef unsigned int	__kernel_dev_t;
+typedef unsigned int	__kernel_ino_t;
+typedef unsigned int  	__kernel_nlink_t;
+typedef unsigned int	__kernel_mode_t;
+typedef long		__kernel_off_t;
+typedef long long	__kernel_loff_t;
+typedef int		__kernel_pid_t;
+typedef int             __kernel_ipc_pid_t;
+typedef unsigned int	__kernel_uid_t;
+typedef unsigned int	__kernel_gid_t;
+typedef unsigned long	__kernel_size_t;
+typedef long		__kernel_ssize_t;
+typedef long		__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 int	__kernel_old_uid_t;
+typedef unsigned int	__kernel_old_gid_t;
+typedef __kernel_dev_t	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+#else
+typedef unsigned int	__kernel_dev_t;
+typedef unsigned int	__kernel_ino_t;
+typedef unsigned int	__kernel_mode_t;
+typedef unsigned short	__kernel_nlink_t;
+typedef long		__kernel_off_t;
+typedef int		__kernel_pid_t;
+typedef unsigned int	__kernel_uid_t;
+typedef unsigned int	__kernel_gid_t;
+typedef unsigned int	__kernel_size_t;
+typedef int		__kernel_ssize_t;
+typedef long		__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 short           __kernel_ipc_pid_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 int	__kernel_old_uid_t;
+typedef unsigned int	__kernel_old_gid_t;
+typedef __kernel_dev_t	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+typedef long long	__kernel_loff_t;
+#endif
+
+typedef struct {
+	int val[2];
+} __kernel_fsid_t;
+
+#endif /* ! defined _PPC_POSIX_TYPES_H && ! defined _PPC64_POSIX_TYPES_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/mathdef.h
new file mode 100644
index 0000000..c64b8a3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/mathdef.h
@@ -0,0 +1,54 @@
+/* Copyright (C) 1997,1998,1999,2000,2003,2004,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.  */
+
+#include <features.h>
+
+#if !defined _MATH_H && !defined _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#endif
+
+
+/* FIXME! This file describes properties of the compiler, not the machine;
+   it should not be part of libc!
+
+   FIXME! This file does not deal with the -fshort-double option of
+   gcc! */
+
+#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
+# define _MATH_H_MATHDEF	1
+
+/* PowerPC has both `float' and `double' arithmetic.  */
+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'.  The disables the
+   declaration of all the `long double' function variants.  */
+# if !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
+#  define __NO_LONG_DOUBLE_MATH	1
+# endif
+#endif  /* __NO_LONG_DOUBLE_MATH */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/mathinline.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/mathinline.h
new file mode 100644
index 0000000..d1b05f3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/mathinline.h
@@ -0,0 +1,185 @@
+/* Inline math functions for powerpc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 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.  */
+
+#include <features.h>
+
+#ifndef _MATH_H
+# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __cplusplus
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE extern __inline
+#endif  /* __cplusplus */
+
+#if defined __GNUC__ && !defined _SOFT_FLOAT
+
+#ifdef __USE_ISOC99
+# if !__GNUC_PREREQ (2,97)
+#  define __unordered_cmp(x, y) \
+  (__extension__							      \
+   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
+      unsigned __r;							      \
+      __asm__("fcmpu 7,%1,%2 ; mfcr %0" : "=r" (__r) : "f" (__x), "f"(__y)    \
+              : "cr7");  \
+      __r; }))
+
+#  undef isgreater
+#  undef isgreaterequal
+#  undef isless
+#  undef islessequal
+#  undef islessgreater
+#  undef isunordered
+
+#  define isgreater(x, y) (__unordered_cmp (x, y) >> 2 & 1)
+#  define isgreaterequal(x, y) ((__unordered_cmp (x, y) & 6) != 0)
+#  define isless(x, y) (__unordered_cmp (x, y) >> 3 & 1)
+#  define islessequal(x, y) ((__unordered_cmp (x, y) & 0xA) != 0)
+#  define islessgreater(x, y) ((__unordered_cmp (x, y) & 0xC) != 0)
+#  define isunordered(x, y) (__unordered_cmp (x, y) & 1)
+
+# endif /* __GNUC_PREREQ (2,97) */
+
+/* The gcc, version 2.7 or below, has problems with all this inlining
+   code.  So disable it for this version of the compiler.  */
+# if __GNUC_PREREQ (2, 8)
+/* Test for negative number.  Used in the signbit() macro.  */
+__MATH_INLINE int
+__NTH (__signbitf (float __x))
+{
+  __extension__ union { float __f; int __i; } __u = { __f: __x };
+  return __u.__i < 0;
+}
+__MATH_INLINE int
+__NTH (__signbit (double __x))
+{
+  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+  return __u.__i[0] < 0;
+}
+# endif
+#endif /* __USE_ISOC99 */
+
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+
+#ifdef __USE_ISOC99
+
+# ifndef __powerpc64__
+__MATH_INLINE long int lrint (double __x) __THROW;
+__MATH_INLINE long int
+__NTH (lrint (double __x))
+{
+  union {
+    double __d;
+    int __ll[2];
+  } __u;
+  __asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x));
+  return __u.__ll[1];
+}
+
+__MATH_INLINE long int lrintf (float __x) __THROW;
+__MATH_INLINE long int
+__NTH (lrintf (float __x))
+{
+  union {
+    double __d;
+    int __ll[2];
+  } __u;
+  __asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x));
+  return __u.__ll[1];
+}
+# endif
+
+__MATH_INLINE double fdim (double __x, double __y) __THROW;
+__MATH_INLINE double
+__NTH (fdim (double __x, double __y))
+{
+  return __x <= __y ? 0 : __x - __y;
+}
+
+__MATH_INLINE float fdimf (float __x, float __y) __THROW;
+__MATH_INLINE float
+__NTH (fdimf (float __x, float __y))
+{
+  return __x <= __y ? 0 : __x - __y;
+}
+
+#endif /* __USE_ISOC99 */
+#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
+
+/* This code is used internally in the GNU libc.  */
+#if 0 /*def __LIBC_INTERNAL_MATH_INLINES*/
+
+#include <sysdep.h>
+#include <ldsodefs.h>
+#include <dl-procinfo.h>
+
+# if __WORDSIZE == 64 || defined _ARCH_PWR4
+#  define __CPU_HAS_FSQRT 1
+# else
+#  define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
+# endif
+
+extern double __slow_ieee754_sqrt (double);
+__MATH_INLINE double
+__NTH (__ieee754_sqrt (double __x))
+{
+  double __z;
+
+  /* If the CPU is 64-bit we can use the optional FP instructions.  */
+  if (__CPU_HAS_FSQRT)
+  {
+    /* Volatile is required to prevent the compiler from moving the
+       fsqrt instruction above the branch.  */
+     __asm__ __volatile__ (
+	"	fsqrt	%0,%1\n"
+		: "=f" (__z)
+		: "f" (__x));
+  }
+  else
+     __z = __slow_ieee754_sqrt(__x);
+
+  return __z;
+}
+
+extern float __slow_ieee754_sqrtf (float);
+__MATH_INLINE float
+__NTH (__ieee754_sqrtf (float __x))
+{
+  float __z;
+
+  /* If the CPU is 64-bit we can use the optional FP instructions.  */
+  if (__CPU_HAS_FSQRT)
+  {
+    /* Volatile is required to prevent the compiler from moving the
+       fsqrts instruction above the branch.  */
+     __asm__ __volatile__ (
+	"	fsqrts	%0,%1\n"
+		: "=f" (__z)
+		: "f" (__x));
+  }
+  else
+     __z = __slow_ieee754_sqrtf(__x);
+
+  return __z;
+}
+#endif /* __LIBC_INTERNAL_MATH_INLINES */
+#endif /* __GNUC__ && !_SOFT_FLOAT */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/mman.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/mman.h
new file mode 100644
index 0000000..2d234c5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/mman.h
@@ -0,0 +1,106 @@
+/* Definitions for POSIX memory map interface.  Linux/PowerPC version.
+   Copyright (C) 1997, 2000, 2003, 2005, 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.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; iclude <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+   But the kernel header is not namespace clean.  */
+
+
+/* Protections are chosen from these bits, OR'd together.  The
+   implementation does not necessarily support PROT_EXEC or PROT_WRITE
+   without PROT_READ.  The only guarantees are that no writing will be
+   allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ	0x1		/* Page can be read.  */
+#define PROT_WRITE	0x2		/* Page can be written.  */
+#define PROT_EXEC	0x4		/* Page can be executed.  */
+#define PROT_NONE	0x0		/* Page can not be accessed.  */
+#define PROT_GROWSDOWN	0x01000000	/* Extend change to start of
+					   growsdown vma (mprotect only).  */
+#define PROT_GROWSUP	0x02000000	/* Extend change to start of
+					   growsup vma (mprotect only).  */
+
+/* Sharing types (must choose one and only one of these).  */
+#define MAP_SHARED	0x001		/* Share changes.  */
+#define MAP_PRIVATE	0x002		/* Changes are private.  */
+#ifdef __USE_MISC
+# define MAP_TYPE	0x00f		/* Mask for type of mapping.  */
+#endif
+
+/* Other flags.  */
+#define MAP_FIXED	0x010		/* Interpret addr exactly.  */
+#ifdef __USE_MISC
+# define MAP_FILE	0x000
+# define MAP_ANONYMOUS	0x020		/* Don't use a file.  */
+# define MAP_ANON	MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific.  */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN	0x00100		/* Stack-like segment.  */
+# define MAP_DENYWRITE	0x00800		/* ETXTBSY */
+# define MAP_EXECUTABLE	0x01000		/* Mark it as an executable.  */
+# define MAP_LOCKED	0x00080		/* Lock the mapping.  */
+# define MAP_NORESERVE	0x00040		/* Don't check for reservations.  */
+# define MAP_POPULATE	0x08000		/* Populate (prefault) pagetables.  */
+# define MAP_NONBLOCK	0x10000		/* Do not block on IO.  */
+# define MAP_UNINITIALIZE 0x4000000     /* For anonymous mmap, memory could
+					   be uninitialized. */
+#endif
+
+/* Flags to `msync'.  */
+#define MS_ASYNC	1		/* Sync memory asynchronously.  */
+#define MS_SYNC		4		/* Synchronous memory sync.  */
+#define MS_INVALIDATE	2		/* Invalidate the caches.  */
+
+/* Flags for `mlockall'.  */
+#define MCL_CURRENT	0x2000		/* Lock all currently mapped pages.  */
+#define MCL_FUTURE	0x4000		/* Lock all additions to address
+					   space.  */
+
+
+/* Flags for `mremap'.  */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE	1
+# define MREMAP_FIXED	2
+#endif
+
+/* Advice to `madvise'.  */
+#ifdef __USE_BSD
+# define MADV_NORMAL	 0	/* No further special treatment.  */
+# define MADV_RANDOM	 1	/* Expect random page references.  */
+# define MADV_SEQUENTIAL 2	/* Expect sequential page references.  */
+# define MADV_WILLNEED	 3	/* Will need these pages.  */
+# define MADV_DONTNEED	 4	/* Don't need these pages.  */
+# define MADV_REMOVE	 9	/* Remove these pages and resources.  */
+# define MADV_DONTFORK	 10	/* Do not inherit across fork.  */
+# define MADV_DOFORK	 11	/* Do inherit across fork.  */
+#endif
+
+/* The POSIX people had to invent similar names for the same things.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_MADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_MADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+# define POSIX_MADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_MADV_DONTNEED	4 /* Don't need these pages.  */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/msq.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/msq.h
new file mode 100644
index 0000000..f198844
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/msq.h
@@ -0,0 +1,83 @@
+/* Copyright (C) 1995, 1996, 1997, 2000, 2002 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_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Define options for message queue functions.  */
+#define MSG_NOERROR    010000  /* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT    020000  /* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition.  */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+
+/* Structure of record for one message inside the kernel.
+   The type `struct msg' is opaque.  */
+struct msqid_ds
+{
+  struct ipc_perm msg_perm;    /* structure describing operation permission */
+#if __WORDSIZE == 32
+  unsigned int __unused1;
+#endif
+  __time_t msg_stime;          /* time of last msgsnd command */
+#if __WORDSIZE == 32
+  unsigned int __unused2;
+#endif
+  __time_t msg_rtime;          /* time of last msgrcv command */
+#if __WORDSIZE == 32
+  unsigned int __unused3;
+#endif
+  __time_t msg_ctime;          /* time of last change */
+  unsigned long __msg_cbytes; /* current number of bytes on queue */
+  msgqnum_t msg_qnum;          /* number of messages currently on queue */
+  msglen_t msg_qbytes;         /* max number of bytes allowed on queue */
+  __pid_t msg_lspid;           /* pid of last msgsnd() */
+  __pid_t msg_lrpid;           /* pid of last msgrcv() */
+  unsigned long __unused4;
+  unsigned long __unused5;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes    __msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+  {
+    int msgpool;
+    int msgmap;
+    int msgmax;
+    int msgmnb;
+    int msgmni;
+    int msgssz;
+    int msgtql;
+    unsigned short int msgseg;
+  };
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/sem.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/sem.h
new file mode 100644
index 0000000..92a7a90
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/sem.h
@@ -0,0 +1,92 @@
+/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002
+   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_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'.  */
+#define SEM_UNDO       0x1000          /* undo the operation on exit */
+
+/* Commands for `semctl'.  */
+#define GETPID         11              /* get sempid */
+#define GETVAL         12              /* get semval */
+#define GETALL         13              /* get all semval's */
+#define GETNCNT                14              /* get semncnt */
+#define GETZCNT                15              /* get semzcnt */
+#define SETVAL         16              /* set semval */
+#define SETALL         17              /* set all semval's */
+
+
+/* Data structure describing a set of semaphores.  */
+struct semid_ds
+{
+  struct ipc_perm sem_perm;            /* operation permission struct */
+#if __WORDSIZE == 32
+  unsigned int __unused1;
+#endif
+  __time_t sem_otime;                  /* last semop() time */
+#if __WORDSIZE == 32
+  unsigned int __unused2;
+#endif
+  __time_t sem_ctime;                  /* last time changed by semctl() */
+  unsigned long int sem_nsems;         /* number of semaphores in set */
+  unsigned long __unused3;
+  unsigned long __unused4;
+};
+
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;                          <= value for SETVAL
+     struct semid_ds *buf;             <= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;                <= array for GETALL & SETALL
+     struct seminfo *__buf;            <= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED   1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct  seminfo
+{
+  int semmap;
+  int semmni;
+  int semmns;
+  int semmnu;
+  int semmsl;
+  int semopm;
+  int semume;
+  int semusz;
+  int semvmx;
+  int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/setjmp.h
new file mode 100644
index 0000000..dad90c7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/setjmp.h
@@ -0,0 +1,80 @@
+/* Copyright (C) 1997, 1998, 2000, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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'.  PowerPC 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
+
+/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
+   We use an array of 'long int' instead, to make writing the
+   assembler easier. Naturally, user code should not depend on
+   either representation. */
+
+#include <bits/wordsize.h>
+
+#if defined __USE_MISC || defined _ASM
+# define JB_GPR1   0  /* Also known as the stack pointer */
+# define JB_GPR2   1
+# define JB_LR     2  /* The address we will return to */
+# if __WORDSIZE == 64
+#  define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18*2 words total.  */
+#  define JB_CR     21 /* Condition code registers with the VRSAVE at */
+                       /* offset 172 (low half of the double word.  */
+#  define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total.  */
+#  define JB_SIZE   (64 * 8) /* As per PPC64-VMX ABI.  */
+#  define JB_VRSAVE 21 /* VRSAVE shares a double word with the CR at offset */
+                       /* 168 (high half of the double word).  */
+#  define JB_VRS    40 /* VRs 20 through 31 are saved, 12*4 words total.  */
+# else
+#  define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18 in total.  */
+#  define JB_CR     21 /* Condition code registers.  */
+#  define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total.  */
+#  define JB_SIZE   ((64 + (12 * 4)) * 4)
+#  define JB_VRSAVE 62
+#  define JB_VRS    64
+# endif
+#endif
+
+
+/* The current powerpc 32-bit Altivec ABI specifies for SVR4 ABI and EABI
+   the vrsave must be at byte 248 & v20 at byte 256.  So we must pad this
+   correctly on 32 bit.  It also insists that vecregs are only gauranteed
+   4 byte alignment so we need to use vperm in the setjmp/longjmp routines.
+   We have to version the code because members like  int __mask_was_saved
+   in the jmp_buf will move as jmp_buf is now larger than 248 bytes.  We
+   cannot keep the altivec jmp_buf backward compatible with the jmp_buf.  */
+#ifndef	_ASM
+# if __WORDSIZE == 64
+typedef long int __jmp_buf[64] __attribute__ ((__aligned__ (16)));
+# else
+/* The alignment is not essential, i.e.the buffer can be copied to a 4 byte
+   aligned buffer as per the ABI it is just added for performance reasons.  */
+typedef long int __jmp_buf[64 + (12 * 4)] __attribute__ ((__aligned__ (16)));
+# endif
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[JB_GPR1])
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/shm.h
new file mode 100644
index 0000000..62560c0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/shm.h
@@ -0,0 +1,113 @@
+/* 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 ())
+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 */
+#if __WORDSIZE == 32
+    unsigned int __unused1;
+#endif
+    __time_t shm_atime;                        /* time of last shmat() */
+#if __WORDSIZE == 32
+    unsigned int __unused2;
+#endif
+    __time_t shm_dtime;                        /* time of last shmdt() */
+#if __WORDSIZE == 32
+    unsigned int __unused3;
+#endif
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+#if __WORDSIZE == 32
+    unsigned int __unused4;
+#endif
+    size_t shm_segsz;                  /* size of segment in bytes */
+    __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 __unused5;
+    unsigned long __unused6;
+  };
+
+#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/powerpc/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/sigcontextinfo.h
new file mode 100644
index 0000000..138a15c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/sigcontextinfo.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 1998, 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.  */
+
+#include <signal.h>
+
+#define SIGCONTEXT struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS
+#define GET_PC(ctx)	((void *)((ctx)->regs->nip))
+#define GET_FRAME(ctx)	(*(void **)((ctx)->regs->gpr[1]))
+#define GET_STACK(ctx)	((void *)((ctx)->regs->gpr[1]))
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/stackinfo.h
new file mode 100644
index 0000000..839758a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* 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.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On PPC the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/stat.h
new file mode 100644
index 0000000..b6c82c5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/stat.h
@@ -0,0 +1,272 @@
+/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2009
+   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_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_LINUX_OLD	1
+#define _STAT_VER_KERNEL	1
+#define _STAT_VER_SVR4		2
+#define _STAT_VER_LINUX	  3
+#if __WORDSIZE == 32
+# define _STAT_VER		_STAT_VER_LINUX
+#else
+# define _STAT_VER		_STAT_VER_KERNEL
+#endif
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	1
+#define _MKNOD_VER_SVR4		2
+#define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below.  */
+
+
+#if __WORDSIZE == 32
+
+struct stat
+  {
+    __dev_t st_dev;			/* Device.  */
+# ifndef __USE_FILE_OFFSET64
+    unsigned short int __pad1;
+    __ino_t st_ino;			/* File serial number.	*/
+# else
+    __ino64_t st_ino;			/* File serial number.	*/
+# endif
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned short int __pad2;
+# ifndef __USE_FILE_OFFSET64
+    __off_t st_size;			/* Size of file, in bytes.  */
+# else
+    __off64_t st_size;			/* Size of file, in bytes.  */
+# endif
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+# ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+# else
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+# endif
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+  };
+
+
+# ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;			/* Device.  */
+    __ino64_t st_ino;			/* File serial number.	*/
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned short int __pad2;
+    __off64_t st_size;			/* Size of file, in bytes.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+  };
+# endif /* __USE_LARGEFILE64 */
+
+#else /* __WORDSIZE == 32 */
+
+struct stat
+  {
+    __dev_t st_dev;			/* Device.  */
+# ifndef __USE_FILE_OFFSET64
+    __ino_t st_ino;			/* File serial number.	*/
+# else
+    __ino64_t st_ino;			/* File serial number.	*/
+# endif
+    __nlink_t st_nlink;			/* Link count.  */
+    __mode_t st_mode;			/* File mode.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    int __pad2;
+    __dev_t st_rdev;			/* Device number, if device.  */
+# ifndef __USE_FILE_OFFSET64
+    __off_t st_size;			/* Size of file, in bytes.  */
+# else
+    __off64_t st_size;			/* Size of file, in bytes.  */
+# endif
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+# ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+# else
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+# endif
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+    unsigned long int __unused6;
+  };
+
+# ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;			/* Device.  */
+    __ino64_t st_ino;			/* File serial number.	*/
+    __nlink_t st_nlink;			/* Link count.  */
+    __mode_t st_mode;			/* File mode.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    int __pad2;
+    __dev_t st_rdev;			/* Device number, if device.  */
+    __off64_t st_size;			/* Size of file, in bytes.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+    unsigned long int __unused6;
+  };
+# endif /* __USE_LARGEFILE64 */
+#endif
+
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/syscalls.h
new file mode 100644
index 0000000..3e52b5d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/syscalls.h
@@ -0,0 +1,256 @@
+/* Copyright (C) 1992,1997-2003,2004,2005,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.  */
+
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+# include <errno.h>
+
+# ifdef SHARED
+#  define INLINE_VSYSCALL(name, nr, args...) \
+  ({									      \
+    __label__ out;							      \
+    __label__ iserr;							      \
+    INTERNAL_SYSCALL_DECL (sc_err);					      \
+    long int sc_ret;							      \
+									      \
+    if (__vdso_##name != NULL)						      \
+      {									      \
+	sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, nr, ##args);   \
+	if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err))			      \
+	  goto out;							      \
+	if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS)		      \
+	  goto iserr;							      \
+      }									      \
+									      \
+    sc_ret = INTERNAL_SYSCALL (name, sc_err, nr, ##args);		      \
+    if (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err))			      \
+      {									      \
+      iserr:								      \
+        __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err));		      \
+        sc_ret = -1L;							      \
+      }									      \
+  out:									      \
+    sc_ret;								      \
+  })
+# else
+#  define INLINE_VSYSCALL(name, nr, args...) \
+  INLINE_SYSCALL (name, nr, ##args)
+# endif
+
+# ifdef SHARED
+#  define INTERNAL_VSYSCALL(name, err, nr, args...) \
+  ({									      \
+    __label__ out;							      \
+    long int v_ret;							      \
+									      \
+    if (__vdso_##name != NULL)						      \
+      {									      \
+	v_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);	      \
+	if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err)			      \
+	    || INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS)		      \
+	  goto out;							      \
+      }									      \
+    v_ret = INTERNAL_SYSCALL (name, err, nr, ##args);			      \
+  out:									      \
+    v_ret;								      \
+  })
+# else
+#  define INTERNAL_VSYSCALL(name, err, nr, args...) \
+  INTERNAL_SYSCALL (name, err, nr, ##args)
+# endif
+
+# define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, nr, args...)	      \
+  ({									      \
+    long int sc_ret = ENOSYS;						      \
+									      \
+    if (__vdso_##name != NULL)						      \
+      sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);	      \
+    else								      \
+      err = 1 << 28;							      \
+    sc_ret;								      \
+  })
+
+/* List of system calls which are supported as vsyscalls.  */
+# define HAVE_CLOCK_GETRES_VSYSCALL	1
+# define HAVE_CLOCK_GETTIME_VSYSCALL	1
+
+/* Define a macro which expands inline into the wrapper code for a VDSO
+   call. This use is for internal calls that do not need to handle errors
+   normally. It will never touch errno.
+   On powerpc a system call basically clobbers the same registers like a
+   function call, with the exception of LR (which is needed for the
+   "sc; bnslr+" sequence) and CR (where only CR0.SO is clobbered to signal
+   an error return status).  */
+# define INTERNAL_VSYSCALL_NCS(funcptr, err, nr, args...) \
+  ({									      \
+    register void *r0  __asm__ ("r0");					      \
+    register long int r3  __asm__ ("r3");				      \
+    register long int r4  __asm__ ("r4");				      \
+    register long int r5  __asm__ ("r5");				      \
+    register long int r6  __asm__ ("r6");				      \
+    register long int r7  __asm__ ("r7");				      \
+    register long int r8  __asm__ ("r8");				      \
+    register long int r9  __asm__ ("r9");				      \
+    register long int r10 __asm__ ("r10");				      \
+    register long int r11 __asm__ ("r11");				      \
+    register long int r12 __asm__ ("r12");				      \
+    LOAD_ARGS_##nr (funcptr, args);					      \
+    __asm__ __volatile__						      \
+      ("mtctr %0\n\t"							      \
+       "bctrl\n\t"							      \
+       "mfcr %0"							      \
+       : "=&r" (r0),							      \
+	 "=&r" (r3), "=&r" (r4), "=&r" (r5),  "=&r" (r6),  "=&r" (r7),	      \
+	 "=&r" (r8), "=&r" (r9), "=&r" (r10), "=&r" (r11), "=&r" (r12)	      \
+       : ASM_INPUT_##nr							      \
+       : "cr0", "ctr", "lr", "memory");					      \
+    err = (long int) r0;						      \
+    (int) r3;								      \
+  })
+
+/* Define a macro which expands inline into the wrapper code for a system
+   call. This use is for internal calls that do not need to handle errors
+   normally. It will never touch errno.
+   On powerpc a system call basically clobbers the same registers like a
+   function call, with the exception of LR (which is needed for the
+   "sc; bnslr+" sequence) and CR (where only CR0.SO is clobbered to signal
+   an error return status).  */
+
+# define INTERNAL_SYSCALL_DECL(err) long int err
+
+# define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\
+(__extension__ \
+  ({									\
+    register long int r0  __asm__ ("r0");				\
+    register long int r3  __asm__ ("r3");				\
+    register long int r4  __asm__ ("r4");				\
+    register long int r5  __asm__ ("r5");				\
+    register long int r6  __asm__ ("r6");				\
+    register long int r7  __asm__ ("r7");				\
+    register long int r8  __asm__ ("r8");				\
+    register long int r9  __asm__ ("r9");				\
+    register long int r10 __asm__ ("r10");				\
+    register long int r11 __asm__ ("r11");				\
+    register long int r12 __asm__ ("r12");				\
+    LOAD_ARGS_##nr(name, args);						\
+    __asm__ __volatile__						\
+      ("sc   \n\t"							\
+       "mfcr %0"							\
+       : "=&r" (r0),							\
+	 "=&r" (r3), "=&r" (r4), "=&r" (r5),  "=&r" (r6),  "=&r" (r7),	\
+	 "=&r" (r8), "=&r" (r9), "=&r" (r10), "=&r" (r11), "=&r" (r12)	\
+       : ASM_INPUT_##nr							\
+       : "cr0", "ctr", "memory");					\
+    err = r0;								\
+    (int) r3;								\
+  }) \
+)
+# define INTERNAL_SYSCALL_ERROR_P(val, err) \
+  ((void) (val), __builtin_expect ((err) & (1 << 28), 0))
+
+# define INTERNAL_SYSCALL_ERRNO(val, err)     (val)
+
+extern void __illegally_sized_syscall_arg1(void);
+extern void __illegally_sized_syscall_arg2(void);
+extern void __illegally_sized_syscall_arg3(void);
+extern void __illegally_sized_syscall_arg4(void);
+extern void __illegally_sized_syscall_arg5(void);
+extern void __illegally_sized_syscall_arg6(void);
+
+# define LOAD_ARGS_0(name, dummy) \
+	r0 = name
+# define LOAD_ARGS_1(name, __arg1) \
+	long int arg1 = (long int) (__arg1); \
+	LOAD_ARGS_0(name, 0); \
+	if (__builtin_classify_type (__arg1) != 5 && sizeof (__arg1) > 4) \
+	  __illegally_sized_syscall_arg1 (); \
+	r3 = arg1
+# define LOAD_ARGS_2(name, __arg1, __arg2) \
+	long int arg2 = (long int) (__arg2); \
+	LOAD_ARGS_1(name, __arg1); \
+	if (__builtin_classify_type (__arg2) != 5 && sizeof (__arg2) > 4) \
+	  __illegally_sized_syscall_arg2 (); \
+	r4 = arg2
+# define LOAD_ARGS_3(name, __arg1, __arg2, __arg3) \
+	long int arg3 = (long int) (__arg3); \
+	LOAD_ARGS_2(name, __arg1, __arg2); \
+	if (__builtin_classify_type (__arg3) != 5 && sizeof (__arg3) > 4) \
+	  __illegally_sized_syscall_arg3 (); \
+	r5 = arg3
+# define LOAD_ARGS_4(name, __arg1, __arg2, __arg3, __arg4) \
+	long int arg4 = (long int) (__arg4); \
+	LOAD_ARGS_3(name, __arg1, __arg2, __arg3); \
+	if (__builtin_classify_type (__arg4) != 5 && sizeof (__arg4) > 4) \
+	  __illegally_sized_syscall_arg4 (); \
+	r6 = arg4
+# define LOAD_ARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5) \
+	long int arg5 = (long int) (__arg5); \
+	LOAD_ARGS_4(name, __arg1, __arg2, __arg3, __arg4); \
+	if (__builtin_classify_type (__arg5) != 5 && sizeof (__arg5) > 4) \
+	  __illegally_sized_syscall_arg5 (); \
+	r7 = arg5
+# define LOAD_ARGS_6(name, __arg1, __arg2, __arg3, __arg4, __arg5, __arg6) \
+	long int arg6 = (long int) (__arg6); \
+	LOAD_ARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5); \
+	if (__builtin_classify_type (__arg6) != 5 && sizeof (__arg6) > 4) \
+	  __illegally_sized_syscall_arg6 (); \
+	r8 = arg6
+
+# define ASM_INPUT_0 "0" (r0)
+# define ASM_INPUT_1 ASM_INPUT_0, "1" (r3)
+# define ASM_INPUT_2 ASM_INPUT_1, "2" (r4)
+# define ASM_INPUT_3 ASM_INPUT_2, "3" (r5)
+# define ASM_INPUT_4 ASM_INPUT_3, "4" (r6)
+# define ASM_INPUT_5 ASM_INPUT_4, "5" (r7)
+# define ASM_INPUT_6 ASM_INPUT_5, "6" (r8)
+
+#endif /* __ASSEMBLER__ */
+
+
+/* Pointer mangling support.  */
+#if defined NOT_IN_libc && defined IS_IN_rtld
+/* We cannot use the thread descriptor because in ld.so we use setjmp
+   earlier than the descriptor is initialized.  */
+#else
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE(reg, tmpreg) \
+	lwz	tmpreg,POINTER_GUARD(r2); \
+	xor	reg,tmpreg,reg
+#  define PTR_MANGLE2(reg, tmpreg) \
+	xor	reg,tmpreg,reg
+#  define PTR_MANGLE3(destreg, reg, tmpreg) \
+	lwz	tmpreg,POINTER_GUARD(r2); \
+	xor	destreg,tmpreg,reg
+#  define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg)
+#  define PTR_DEMANGLE2(reg, tmpreg) PTR_MANGLE2 (reg, tmpreg)
+#  define PTR_DEMANGLE3(destreg, reg, tmpreg) PTR_MANGLE3 (destreg, reg, tmpreg)
+# else
+#  define PTR_MANGLE(var) \
+  (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
+#  define PTR_DEMANGLE(var)	PTR_MANGLE (var)
+# endif
+#endif
+
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/termios.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/termios.h
new file mode 100644
index 0000000..12513e3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/termios.h
@@ -0,0 +1,321 @@
+/* Copyright (C) 1997,1999,2001,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.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char	cc_t;
+typedef unsigned int	speed_t;
+typedef unsigned int	tcflag_t;
+
+/*
+ * termios type and macro definitions.  Be careful about adding stuff
+ * to this file since it's used in GNU libc and there are strict rules
+ * concerning namespace pollution.
+ */
+
+#define NCCS 32
+struct termios {
+	tcflag_t c_iflag;		/* input mode flags */
+	tcflag_t c_oflag;		/* output mode flags */
+	tcflag_t c_cflag;		/* control mode flags */
+	tcflag_t c_lflag;		/* local mode flags */
+	cc_t c_line;			/* line discipline (== c_cc[19]) */
+	cc_t c_cc[NCCS];		/* control characters */
+	speed_t c_ispeed;		/* input speed */
+	speed_t c_ospeed;		/* output speed */
+#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
+#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
+};
+
+/* c_cc characters */
+#define VINTR	0
+#define VQUIT	1
+#define VERASE	2
+#define VKILL	3
+#define VEOF	4
+#define VMIN	5
+#define VEOL	6
+#define VTIME	7
+#define VEOL2	8
+#define VSWTC	9
+
+#define VWERASE	10
+#define VREPRINT	11
+#define VSUSP		12
+#define VSTART		13
+#define VSTOP		14
+#define VLNEXT		15
+#define VDISCARD	16
+
+/* c_iflag bits */
+#define IGNBRK	0000001
+#define BRKINT	0000002
+#define IGNPAR	0000004
+#define PARMRK	0000010
+#define INPCK	0000020
+#define ISTRIP	0000040
+#define INLCR	0000100
+#define IGNCR	0000200
+#define ICRNL	0000400
+#define IXON	0001000
+#define IXOFF	0002000
+#define IXANY	0004000
+#define IUCLC	0010000
+#define IMAXBEL	0020000
+#define IUTF8	0040000
+
+/* c_oflag bits */
+#define OPOST	0000001
+#define ONLCR	0000002
+#define OLCUC	0000004
+
+#define OCRNL	0000010
+#define ONOCR	0000020
+#define ONLRET	0000040
+
+#define OFILL	00000100
+#define OFDEL	00000200
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY	00001400
+# define   NL0	00000000
+# define   NL1	00000400
+# define   NL2	00001000
+# define   NL3	00001400
+# define TABDLY	00006000
+# define   TAB0	00000000
+# define   TAB1	00002000
+# define   TAB2	00004000
+# define   TAB3	00006000
+# define CRDLY	00030000
+# define   CR0	00000000
+# define   CR1	00010000
+# define   CR2	00020000
+# define   CR3	00030000
+# define FFDLY	00040000
+# define   FF0	00000000
+# define   FF1	00040000
+# define BSDLY	00100000
+# define   BS0	00000000
+# define   BS1	00100000
+#endif
+#define VTDLY	00200000
+#define   VT0	00000000
+#define   VT1	00200000
+
+#ifdef __USE_MISC
+# define XTABS	00006000
+#endif
+
+/* c_cflag bit meaning */
+#ifdef __USE_MISC
+# define CBAUD	0000377
+#endif
+#define  B0	0000000		/* hang up */
+#define  B50	0000001
+#define  B75	0000002
+#define  B110	0000003
+#define  B134	0000004
+#define  B150	0000005
+#define  B200	0000006
+#define  B300	0000007
+#define  B600	0000010
+#define  B1200	0000011
+#define  B1800	0000012
+#define  B2400	0000013
+#define  B4800	0000014
+#define  B9600	0000015
+#define  B19200	0000016
+#define  B38400	0000017
+#ifdef __USE_MISC
+# define EXTA B19200
+# define EXTB B38400
+# define CBAUDEX 0000020
+#endif
+#define  B57600   00020
+#define  B115200  00021
+#define  B230400  00022
+#define  B460800  00023
+#define  B500000  00024
+#define  B576000  00025
+#define  B921600  00026
+#define  B1000000 00027
+#define  B1152000 00030
+#define  B1500000 00031
+#define  B2000000 00032
+#define  B2500000 00033
+#define  B3000000 00034
+#define  B3500000 00035
+#define  B4000000 00036
+#define __MAX_BAUD B4000000
+
+#define CSIZE	00001400
+#define   CS5	00000000
+#define   CS6	00000400
+#define   CS7	00001000
+#define   CS8	00001400
+
+#define CSTOPB	00002000
+#define CREAD	00004000
+#define PARENB	00010000
+#define PARODD	00020000
+#define HUPCL	00040000
+
+#define CLOCAL	00100000
+#ifdef __USE_MISC
+# define CMSPAR   010000000000		/* mark or space (stick) parity */
+# define CRTSCTS  020000000000		/* flow control */
+#endif
+
+/* c_lflag bits */
+#define ISIG	0x00000080
+#define ICANON	0x00000100
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE	0x00004000
+#endif
+#define ECHO	0x00000008
+#define ECHOE	0x00000002
+#define ECHOK	0x00000004
+#define ECHONL	0x00000010
+#define NOFLSH	0x80000000
+#define TOSTOP	0x00400000
+#ifdef __USE_MISC
+# define ECHOCTL	0x00000040
+# define ECHOPRT	0x00000020
+# define ECHOKE	0x00000001
+# define FLUSHO	0x00800000
+# define PENDIN	0x20000000
+#endif
+#define IEXTEN	0x00000400
+
+/* Values for the ACTION argument to `tcflow'.  */
+#define	TCOOFF		0
+#define	TCOON		1
+#define	TCIOFF		2
+#define	TCION		3
+
+/* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
+#define	TCIFLUSH	0
+#define	TCOFLUSH	1
+#define	TCIOFLUSH	2
+
+/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */
+#define	TCSANOW		0
+#define	TCSADRAIN	1
+#define	TCSAFLUSH	2
+
+#ifndef __UCLIBC_STRICT_HEADERS__
+struct sgttyb {
+	char	sg_ispeed;
+	char	sg_ospeed;
+	char	sg_erase;
+	char	sg_kill;
+	short	sg_flags;
+};
+#endif
+
+struct tchars {
+	char	t_intrc;
+	char	t_quitc;
+	char	t_startc;
+	char	t_stopc;
+	char	t_eofc;
+	char	t_brkc;
+};
+
+struct ltchars {
+	char	t_suspc;
+	char	t_dsuspc;
+	char	t_rprntc;
+	char	t_flushc;
+	char	t_werasc;
+	char	t_lnextc;
+};
+
+/* Used for packet mode */
+#define TIOCPKT_DATA		 0
+#define TIOCPKT_FLUSHREAD	 1
+#define TIOCPKT_FLUSHWRITE	 2
+#define TIOCPKT_STOP		 4
+#define TIOCPKT_START		 8
+#define TIOCPKT_NOSTOP		16
+#define TIOCPKT_DOSTOP		32
+
+struct winsize {
+	unsigned short ws_row;
+	unsigned short ws_col;
+	unsigned short ws_xpixel;
+	unsigned short ws_ypixel;
+};
+
+#define NCC 10
+struct termio {
+	unsigned short c_iflag;		/* input mode flags */
+	unsigned short c_oflag;		/* output mode flags */
+	unsigned short c_cflag;		/* control mode flags */
+	unsigned short c_lflag;		/* local mode flags */
+	unsigned char c_line;		/* line discipline */
+	unsigned char c_cc[NCC];	/* control characters */
+};
+
+/* c_cc characters */
+#define _VINTR	0
+#define _VQUIT	1
+#define _VERASE	2
+#define _VKILL	3
+#define _VEOF	4
+#define _VMIN	5
+#define _VEOL	6
+#define _VTIME	7
+#define _VEOL2	8
+#define _VSWTC	9
+
+/* modem lines */
+#define TIOCM_LE	0x001
+#define TIOCM_DTR	0x002
+#define TIOCM_RTS	0x004
+#define TIOCM_ST	0x008
+#define TIOCM_SR	0x010
+#define TIOCM_CTS	0x020
+#define TIOCM_CAR	0x040
+#define TIOCM_RNG	0x080
+#define TIOCM_DSR	0x100
+#define TIOCM_CD	TIOCM_CAR
+#define TIOCM_RI	TIOCM_RNG
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+#define TIOCSER_TEMT    0x01	/* Transmitter physically empty */
+
+/* line disciplines */
+#define N_TTY		0
+#define N_SLIP		1
+#define N_MOUSE		2
+#define N_PPP		3
+#define N_STRIP		4
+#define N_AX25		5
+#define N_X25		6	/* X.25 async  */
+#define N_6PACK		7
+#define N_MASC		8	/* Mobitex module  */
+#define N_R3964		9	/* Simatic R3964 module  */
+#define N_PROFIBUS_FDL	10	/* Profibus  */
+#define N_IRDA		11	/* Linux IR  */
+#define N_SMSBLOCK	12	/* SMS block mode  */
+#define N_HDLC		13	/* synchronous HDLC  */
+#define N_SYNC_PPP	14	/* synchronous PPP  */
+#define	N_HCI		15	/* Bluetooth HCI UART  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..6f1f396
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/uClibc_arch_features.h
@@ -0,0 +1,47 @@
+/*
+ * 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__ ".long 0"
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#define __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/powerpc/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/wordsize.h
new file mode 100644
index 0000000..cf93423
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bits/wordsize.h
@@ -0,0 +1,19 @@
+/* Determine the wordsize from the preprocessor defines.  */
+
+#if defined __powerpc64__
+# define __WORDSIZE	64
+# define __WORDSIZE_COMPAT32	1
+#else
+# define __WORDSIZE	32
+#endif
+
+#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
+
+/* Signal the glibc ABI didn't used to have a `long double'.
+   The changes all the `long double' function variants to be redirects
+   to the double functions.  */
+# define __LONG_DOUBLE_MATH_OPTIONAL   1
+# ifndef __LONG_DOUBLE_128__
+#  define __NO_LONG_DOUBLE_MATH        1
+# endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/brk.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/brk.S
new file mode 100644
index 0000000..5fe8d40
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/brk.S
@@ -0,0 +1,80 @@
+/* brk system call for Linux/ppc.
+   Copyright (C) 1995, 1996, 1997, 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.  */
+
+#include <features.h>
+#include "ppc_asm.h"
+#define _ERRNO_H	1
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_brk
+
+#ifdef __PIC__
+.section .bss
+	.align 4
+	.globl __curbrk
+	.hidden __curbrk
+__curbrk: .skip 4
+	.type __curbrk,@object
+	.size __curbrk,4
+#else
+.comm __curbrk, 4,4
+#endif
+
+	.text
+	.globl	brk
+	.type	brk,@function
+	.align	2
+
+brk:
+	stwu    r1,-16(r1)
+	stw	r3,8(r1)
+	li 0, __NR_brk;   
+	sc
+	lwz     r6,8(r1)
+#ifdef __PIC__
+	mflr    r4
+# ifdef HAVE_ASM_PPC_REL16
+	bcl	20,31,1f
+1:	mflr	r5
+	addis	r5,r5,_GLOBAL_OFFSET_TABLE_-1b@ha
+	addi	r5,r5,_GLOBAL_OFFSET_TABLE_-1b@l
+# else	
+	bl      _GLOBAL_OFFSET_TABLE_@local-4
+	mflr    r5
+# endif
+	lwz     r5,__curbrk@got(r5)
+	mtlr    r4
+	stw     r3,0(r5)
+#else
+	lis     r4,__curbrk@ha
+	stw     r3,__curbrk@l(r4)
+#endif
+	cmplw   r6,r3
+	addi    r1,r1,16
+	li	r3,0
+	blelr+
+	li      r3,ENOMEM
+
+	b	__syscall_error
+
+	.size brk,.-brk
+
+libc_hidden_def(brk)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bsd-_setjmp.S
new file mode 100644
index 0000000..585878a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bsd-_setjmp.S
@@ -0,0 +1,35 @@
+/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'.  PowerPC version.
+   Copyright (C) 1994, 1997, 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.  */
+
+/* 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.  */
+
+#include "ppc_asm.h"
+
+.globl      _setjmp;
+.type      _setjmp, @function;
+.align  2;
+
+_setjmp:
+	li r4,0			/* Set second argument to 0.  */
+
+	b __sigsetjmp@local
+
+.size     _setjmp,.-_setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bsd-setjmp.S
new file mode 100644
index 0000000..f95d082
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/bsd-setjmp.S
@@ -0,0 +1,38 @@
+/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'.  PowerPC version.
+   Copyright (C) 1994, 1997, 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.  */
+
+/* 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.  */
+
+#include "ppc_asm.h"
+
+.globl      __setjmp;
+.type      __setjmp, @function;
+.align  2;
+
+__setjmp:
+	li r4,1			/* Set second argument to 1.  */
+
+	b __sigsetjmp@local
+
+.size     __setjmp,.-__setjmp
+
+.globl     setjmp;
+.set    setjmp,__setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/clone.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/clone.S
new file mode 100644
index 0000000..8583c66
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/clone.S
@@ -0,0 +1,145 @@
+/* Wrapper around clone system call.
+   Copyright (C) 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.  */
+
+#include <features.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+#include <sysdep.h>
+
+#define CLONE_VM	0x00000100
+#define CLONE_THREAD	0x00010000
+
+/* This is the only really unusual system call in PPC linux, but not
+   because of any weirdness in the system call itself; because of
+   all the freaky stuff we have to do to make the call useful.  */
+
+/* int [r3] clone(int (*fn)(void *arg) [r3], void *child_stack [r4],
+   		  int flags [r5], void *arg [r6], void *parent_tid [r7],
+   		  void *tls [r8], void *child_tid [r9]); */
+
+#ifdef __NR_clone
+	.globl __clone
+	.type __clone,@function
+	.align 2
+
+__clone:
+	/* Check for child_stack == NULL || fn == NULL.  */
+	cmpwi	cr0,r4,0
+	cmpwi	cr1,r3,0
+	cror	cr0*4+eq,cr1*4+eq,cr0*4+eq
+	beq-	cr0,.Lbadargs
+
+	/* Set up stack frame for parent.  */
+	stwu	r1,-32(r1)
+	cfi_adjust_cfa_offset (32)
+#ifdef RESET_PID
+	stmw	r28,16(r1)
+#else
+# ifndef __ASSUME_FIXED_CLONE_SYSCALL
+	stmw	r29,16(r1)
+# else
+	stmw	r30,16(r1)
+# endif
+#endif
+
+	/* Set up stack frame for child.  */
+	clrrwi	r4,r4,4
+	li	r0,0
+	stwu	r0,-16(r4)
+
+	/* Save fn, args, stack across syscall.  */
+	mr	r30,r3			/* Function in r30.  */
+#ifndef __ASSUME_FIXED_CLONE_SYSCALL
+	mr	r29,r4			/* Stack pointer in r29.  */
+#endif
+#ifdef RESET_PID
+	mr	r28,r5
+#endif
+	mr	r31,r6			/* Argument in r31.  */
+
+	/* 'flags' argument is first parameter to clone syscall. (The other
+	   argument is the stack pointer, already in r4.)  */
+	mr	r3,r5
+
+	/* Move the parent_tid, child_tid and tls arguments. */
+	mr	r5,r7
+	mr	r6,r8
+	mr	r7,r9
+
+	/* End FDE now, because in the child the unwind info will be wrong.  */
+	cfi_endproc
+
+	/* Do the call.  */
+	li 0, __NR_clone
+	sc
+
+	/* Check for child process.  */
+	cmpwi	cr1,r3,0
+	crandc	cr1*4+eq,cr1*4+eq,cr0*4+so
+	bne-	cr1,.Lparent		/* The '-' is to minimise the race.  */
+
+#ifndef __ASSUME_FIXED_CLONE_SYSCALL
+	/* On at least mklinux DR3a5, clone() doesn't actually change
+	   the stack pointer.  I'm pretty sure this is a bug, because
+	   it adds a race condition if a signal is sent to a thread
+	   just after it is created (in the previous three instructions).  */
+	mr	r1,r29
+#endif
+
+#ifdef RESET_PID
+	andis.	r0,r28,CLONE_THREAD>>16
+	bne+	r0,.Loldpid
+	andi.	r0,r28,CLONE_VM
+	li	r3,-1
+	bne-	r0,.Lnomoregetpid
+.Lnomoregetpid:
+	stw	r3,TID(r2)
+	stw	r3,PID(r2)
+.Loldpid:
+#endif
+	/* Call procedure.  */
+	mtctr	r30
+	mr	r3,r31
+	bctrl
+	/* Call _exit with result from procedure.  */
+	b	HIDDEN_JUMPTARGET(_exit)
+
+.Lparent:
+	/* Parent.  Restore registers & return.  */
+#ifdef RESET_PID
+	lmw	r28,16(r1)
+#else
+# ifndef __ASSUME_FIXED_CLONE_SYSCALL
+	lmw	r29,16(r1)
+# else
+	lmw	r30,16(r1)
+# endif
+#endif
+	addi	r1,r1,32
+	bnslr+
+	b	__syscall_error
+
+.Lbadargs:
+	li	r3,EINVAL
+	b	__syscall_error
+
+	cfi_startproc
+	.size __clone,.-__clone
+weak_alias(__clone, clone)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/crt1.S
new file mode 100644
index 0000000..4f1494a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/crt1.S
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2003 by Erik Andersen
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <features.h>
+/* Integer registers.  */
+#define r0      0
+#define r1      1
+#define r2      2
+#define r3      3
+#define r4      4
+#define r5      5
+#define r6      6
+#define r7      7
+#define r8      8
+#define r9      9
+#define r10     10
+#define r13     13
+#define r31     31
+
+.text
+	.globl	_start
+	.type	_start,%function
+	.type	_init,%function
+	.type	_fini,%function
+#ifndef __UCLIBC_CTOR_DTOR__
+	.weak _init
+	.weak _fini
+#endif
+	.type	main,%function
+	.type	__uClibc_main,%function
+
+_start:
+	mr	r9,r1 	/* Save the stack pointer and pass it to __uClibc_main */
+	clrrwi	r1,r1,4	/* Align stack ptr to 16 bytes */
+#ifdef __PIC__
+# ifdef HAVE_ASM_PPC_REL16
+	bcl	20,31,1f
+1:	mflr	r31
+	addis	r31,r31,_GLOBAL_OFFSET_TABLE_-1b@ha
+	addi	r31,r31,_GLOBAL_OFFSET_TABLE_-1b@l
+# else
+	bl	_GLOBAL_OFFSET_TABLE_-4@local
+	mflr	r31
+# endif
+#endif
+	/* Set up the small data pointer in r13.  */
+#ifdef __PIC__
+	lwz	r13,_SDA_BASE_@got(r31)
+#else
+	lis	r13,_SDA_BASE_@ha
+	addi	r13,r13,_SDA_BASE_@l
+#endif
+	/* Set up an initial stack frame, and clear the LR.  */
+	li	r0,0
+	stwu	r1,-16(r1)
+	mtlr	r0
+	stw	r0,0(r1)
+	/* find argc from the stack pointer */
+	lwz	r4,0(r9)
+	/* find argv one word offset from the stack pointer */
+	addi	r5,r9,4
+	mr	r8,r3 /* Pass _dl_fini from ldso or NULL if statically linked */
+		      /* Note: PPC depends on the kernel to zero r3 before */
+		      /* handing over to user space, otherwise static apps */
+		      /* will SEGV during exit() */
+
+	/* Ok, now run uClibc's main() -- shouldn't return */
+#ifdef __PIC__
+	lwz	r6,_init@got(r31)
+	lwz	r7,_fini@got(r31)
+	lwz	r3,main@got(r31)
+	b	__uClibc_main@plt
+#else
+	lis     r6,_init@ha	# load top 16 bits
+	addi    r6,r6,_init@l	# load bottom 16 bits
+	lis     r7,_fini@ha	# load top 16 bits
+	addi    r7,r7,_fini@l	# load bottom 16 bits
+	lis     r3,main@ha	# load top 16 bits
+	addi    r3,r3,main@l	# load bottom 16 bits
+	b	__uClibc_main
+#endif
+
+.size _start,.-_start
+
+/* 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/powerpc/crti.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/crti.S
new file mode 100644
index 0000000..09589ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/crti.S
@@ -0,0 +1,24 @@
+	.file	"initfini.c"
+	
+	.section .init
+	.align 2
+	.globl _init
+	.type	_init, @function
+_init:
+	stwu 1,-32(1)
+	mflr 0
+	stw 0,36(1)
+	
+	.align 2
+	
+	
+	.section .fini
+	.align 2
+	.globl _fini
+	.type	_fini, @function
+_fini:
+	stwu 1,-32(1)
+	mflr 0
+	stw 0,36(1)
+
+	.align 2
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/crtn.S
new file mode 100644
index 0000000..938367c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/crtn.S
@@ -0,0 +1,21 @@
+	.file	"initfini.c"
+	
+	.section .init
+	.align 2
+	.globl _init
+	.type	_init, @function
+
+	lwz 0,36(1)
+	addi 1,1,32
+	mtlr 0
+	blr
+	
+	.section .fini
+	.align 2
+	.globl _fini
+	.type	_fini, @function
+
+	lwz 0,36(1)
+	addi 1,1,32
+	mtlr 0
+	blr
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/fenv.h
new file mode 100644
index 0000000..8a06f02
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/fenv.h
@@ -0,0 +1,136 @@
+/* Copyright (C) 1997, 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.  */
+
+/*
+ * ISO C99 7.6: Floating-point environment	<fenv.h>
+ */
+
+#ifndef _FENV_H
+#define _FENV_H	1
+
+#include <features.h>
+
+/* Get the architecture dependend definitions.  The following definitions
+   are expected to be done:
+
+   fenv_t	type for object representing an entire floating-point
+		environment
+
+   FE_DFL_ENV	macro of type pointer to fenv_t to be used as the argument
+		to functions taking an argument of type fenv_t; in this
+		case the default environment will be used
+
+   fexcept_t	type for object representing the floating-point exception
+		flags including status associated with the flags
+
+   The following macros are defined iff the implementation supports this
+   kind of exception.
+   FE_INEXACT		inexact result
+   FE_DIVBYZERO		division by zero
+   FE_UNDERFLOW		result not representable due to underflow
+   FE_OVERFLOW		result not representable due to overflow
+   FE_INVALID		invalid operation
+
+   FE_ALL_EXCEPT	bitwise OR of all supported exceptions
+
+   The next macros are defined iff the appropriate rounding mode is
+   supported by the implementation.
+   FE_TONEAREST		round to nearest
+   FE_UPWARD		round toward +Inf
+   FE_DOWNWARD		round toward -Inf
+   FE_TOWARDZERO	round toward 0
+*/
+#include <bits/fenv.h>
+
+__BEGIN_DECLS
+
+/* Floating-point exception handling.  */
+
+/* Clear the supported exceptions represented by EXCEPTS.  */
+extern int feclearexcept (int __excepts) __THROW;
+
+/* Store implementation-defined representation of the exception flags
+   indicated by EXCEPTS in the object pointed to by FLAGP.  */
+extern int fegetexceptflag (fexcept_t *__flagp, int __excepts) __THROW;
+
+/* Raise the supported exceptions represented by EXCEPTS.  */
+extern int feraiseexcept (int __excepts) __THROW;
+
+/* Set complete status for exceptions indicated by EXCEPTS according to
+   the representation in the object pointed to by FLAGP.  */
+extern int fesetexceptflag (__const fexcept_t *__flagp, int __excepts) __THROW;
+
+/* Determine which of subset of the exceptions specified by EXCEPTS are
+   currently set.  */
+extern int fetestexcept (int __excepts) __THROW;
+
+
+/* Rounding control.  */
+
+/* Get current rounding direction.  */
+extern int fegetround (void) __THROW;
+
+/* Establish the rounding direction represented by ROUND.  */
+extern int fesetround (int __rounding_direction) __THROW;
+
+
+/* Floating-point environment.  */
+
+/* Store the current floating-point environment in the object pointed
+   to by ENVP.  */
+extern int fegetenv (fenv_t *__envp) __THROW;
+
+/* Save the current environment in the object pointed to by ENVP, clear
+   exception flags and install a non-stop mode (if available) for all
+   exceptions.  */
+extern int feholdexcept (fenv_t *__envp) __THROW;
+
+/* Establish the floating-point environment represented by the object
+   pointed to by ENVP.  */
+extern int fesetenv (__const fenv_t *__envp) __THROW;
+
+/* Save current exceptions in temporary storage, install environment
+   represented by object pointed to by ENVP and raise exceptions
+   according to saved exceptions.  */
+extern int feupdateenv (__const fenv_t *__envp) __THROW;
+
+
+/* Include optimization.  */
+#ifdef __OPTIMIZE__
+# include <bits/fenvinline.h>
+#endif
+
+#ifdef __USE_GNU
+
+/* Enable individual exceptions.  Will not enable more exceptions than
+   EXCEPTS specifies.  Returns the previous enabled exceptions if all
+   exceptions are successfully set, otherwise returns -1.  */
+extern int feenableexcept (int __excepts) __THROW;
+
+/* Disable individual exceptions.  Will not disable more exceptions than
+   EXCEPTS specifies.  Returns the previous enabled exceptions if all
+   exceptions are successfully disabled, otherwise returns -1.  */
+extern int fedisableexcept (int __excepts) __THROW;
+
+/* Return enabled exceptions.  */
+extern int fegetexcept (void) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* fenv.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/fpu_control.h
new file mode 100644
index 0000000..442da47
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/fpu_control.h
@@ -0,0 +1,94 @@
+/* FPU control word definitions.  PowerPC and PowerPC e500 versions.
+   Copyright (C) 1996, 1997, 1998, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   e500 parts contributed by Aldy Hernandez <aldy@redhat.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.  */
+
+#ifndef _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+#include <features.h>
+
+/* rounding control */
+#define _FPU_RC_NEAREST 0x00   /* RECOMMENDED */
+#define _FPU_RC_DOWN    0x03
+#define _FPU_RC_UP      0x02
+#define _FPU_RC_ZERO    0x01
+
+#define _FPU_MASK_NI  0x04 /* non-ieee mode */
+
+/* masking of interrupts */
+#define _FPU_MASK_ZM  0x10 /* zero divide */
+#define _FPU_MASK_OM  0x40 /* overflow */
+#define _FPU_MASK_UM  0x20 /* underflow */
+#define _FPU_MASK_XM  0x08 /* inexact */
+#define _FPU_MASK_IM  0x80 /* invalid operation */
+
+
+/* The fdlibm code requires no interrupts for exceptions.  */
+#define _FPU_DEFAULT  0x00000000 /* Default value.  */
+
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
+
+
+#ifdef __CONFIG_E500__
+#define _FPU_RESERVED 0xff3fff7f /* These bits are reserved are not changed. */
+/* IEEE:  same as above, but (some) exceptions;
+   we leave the 'inexact' exception off.
+ */
+#define _FPU_IEEE     0x000003c0
+
+/* Macros for accessing the hardware control word.  */
+#define _FPU_GETCW(__cw) ({ \
+  unsigned int env; \
+  __asm__ __volatile__ ("mfspefscr %0" : "=r" (env)); \
+  (__cw) = env; })
+#define _FPU_SETCW(__cw) ({ \
+  unsigned int env = __cw; \
+  __asm__ __volatile__ ("mtspefscr %0" : : "r" (env)); })
+#else
+#define _FPU_RESERVED 0xffffff00 /* These bits are reserved are not changed. */
+/* IEEE:  same as above, but (some) exceptions;
+   we leave the 'inexact' exception off.
+ */
+#define _FPU_IEEE     0x000000f0
+
+/* Macros for accessing the hardware control word.  */
+#define _FPU_GETCW(__cw) ( { \
+  union { double d; fpu_control_t cw[2]; } \
+    tmp __attribute__ ((__aligned__(8))); \
+  __asm__ ("mffs 0; stfd%U0 0,%0" : "=m" (tmp.d) : : "fr0"); \
+  (__cw)=tmp.cw[1]; \
+  tmp.cw[1]; } )
+#define _FPU_SETCW(__cw) { \
+  union { double d; fpu_control_t cw[2]; } \
+    tmp __attribute__ ((__aligned__(8))); \
+  tmp.cw[0] = 0xFFF80000; /* More-or-less arbitrary; this is a QNaN. */ \
+  tmp.cw[1] = __cw; \
+  __asm__ ("lfd%U0 0,%0; mtfsf 255,0" : : "m" (tmp.d) : "fr0"); \
+}
+
+#endif  /* __CONFIG_E500__ */
+
+#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/powerpc/ioctl.c b/ap/build/uClibc/libc/sysdeps/linux/powerpc/ioctl.c
new file mode 100644
index 0000000..26bab0d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/ioctl.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 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 <stdarg.h>
+#include <termios.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sys/syscall.h>
+
+
+
+/* The user-visible size of struct termios has changed.  Catch ioctl calls
+   using the new-style struct termios, and translate them to old-style.  */
+
+#define __NR___syscall_ioctl __NR_ioctl
+static __always_inline
+_syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg)
+
+
+int ioctl (int fd, unsigned long int request, ...)
+{
+    void *arg;
+    va_list ap;
+    int result;
+
+    va_start (ap, request);
+    arg = va_arg (ap, void *);
+
+    switch (request)
+    {
+	case TCGETS:
+	    result = tcgetattr (fd, (struct termios *) arg);
+	    break;
+
+	case TCSETS:
+	    result = tcsetattr (fd, TCSANOW, (struct termios *) arg);
+	    break;
+
+	case TCSETSW:
+	    result = tcsetattr (fd, TCSADRAIN, (struct termios *) arg);
+	    break;
+
+	case TCSETSF:
+	    result = tcsetattr (fd, TCSAFLUSH, (struct termios *) arg);
+	    break;
+
+	default:
+	    result = __syscall_ioctl (fd, request, arg);
+	    break;
+    }
+
+    va_end (ap);
+
+    return result;
+}
+libc_hidden_def(ioctl)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/posix_fadvise.c b/ap/build/uClibc/libc/sysdeps/linux/powerpc/posix_fadvise.c
new file mode 100644
index 0000000..ce3574f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/posix_fadvise.c
@@ -0,0 +1,36 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise() for 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>
+
+#ifdef __NR_fadvise64
+#define __NR_posix_fadvise __NR_fadvise64
+int posix_fadvise(int fd, off_t offset, off_t len, int advice)
+{
+	INTERNAL_SYSCALL_DECL(err);
+	int ret = (int) (INTERNAL_SYSCALL(posix_fadvise, err, 6, fd, 0,
+	 __LONG_LONG_PAIR (offset >> 31, offset), len, advice));
+    if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+      return INTERNAL_SYSCALL_ERRNO (ret, err);
+    return 0;
+}
+
+#if defined __UCLIBC_HAS_LFS__ && (!defined __NR_fadvise64_64 || !defined _syscall6)
+strong_alias(posix_fadvise,posix_fadvise64)
+#endif
+
+#else
+int posix_fadvise(int fd attribute_unused, off_t offset attribute_unused, off_t len attribute_unused, int advice attribute_unused)
+{
+#warning This is not correct as far as SUSv3 is concerned.
+	return ENOSYS;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/posix_fadvise64.c b/ap/build/uClibc/libc/sysdeps/linux/powerpc/posix_fadvise64.c
new file mode 100644
index 0000000..2c7d207
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/posix_fadvise64.c
@@ -0,0 +1,69 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise64() for 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__
+#ifdef __NR_fadvise64_64
+
+/* 64 bit implementation is cake ... or more like pie ... */
+#if __WORDSIZE == 64
+
+#define __NR_posix_fadvise64 __NR_fadvise64_64
+
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise)
+{
+  if (len != (off_t) len)
+    return EOVERFLOW;
+  INTERNAL_SYSCALL_DECL (err);
+  int ret = INTERNAL_SYSCALL (posix_fadvise64, err, 6, fd, 0,
+                               __LONG_LONG_PAIR ((long) (offset >> 32), (long) offset),
+                               (off_t) len, advise);
+  if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
+    return 0;
+  return INTERNAL_SYSCALL_ERRNO (ret, err);
+}
+
+/* 32 bit implementation is kind of a pita */
+#elif __WORDSIZE == 32
+
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise)
+{
+	INTERNAL_SYSCALL_DECL (err);
+	int ret = INTERNAL_SYSCALL (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;
+	return INTERNAL_SYSCALL_ERRNO (ret, err);
+}
+
+#else
+#error your machine is neither 32 bit or 64 bit ... it must be magical
+#endif
+
+#elif !defined __NR_fadvise64
+/* This is declared as a strong alias in posix_fadvise.c if __NR_fadvise64
+ * is defined.
+ */
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise)
+{
+#warning This is not correct as far as SUSv3 is concerned.
+	return ENOSYS;
+}
+#endif /* __NR_fadvise64_64 */
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/powerpc32/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/powerpc32/sysdep.h
new file mode 100644
index 0000000..3f6fefd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/powerpc32/sysdep.h
@@ -0,0 +1,151 @@
+/* Assembly macros for 32-bit PowerPC.
+   Copyright (C) 1999, 2001, 2002, 2003, 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., 51 Franklin Street, Fifth Floor, Boston MA
+   02110-1301 USA.  */
+
+#ifdef __ASSEMBLER__
+
+#ifdef __ELF__
+
+/* If compiled for profiling, call `_mcount' at the start of each
+   function.  */
+#ifdef	PROF
+/* The mcount code relies on a the return address being on the stack
+   to locate our caller and so it can restore it; so store one just
+   for its benefit.  */
+# define CALL_MCOUNT							      \
+  mflr  r0;								      \
+  stw   r0,4(r1);							      \
+  cfi_offset (lr, 4);	       						      \
+  bl    JUMPTARGET(_mcount);
+#else  /* PROF */
+# define CALL_MCOUNT		/* Do nothing.  */
+#endif /* PROF */
+
+#define	ENTRY(name)							      \
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);				      \
+  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)			      \
+  .align ALIGNARG(2);							      \
+  C_LABEL(name)								      \
+  cfi_startproc;							      \
+  CALL_MCOUNT
+
+#define EALIGN_W_0  /* No words to insert.  */
+#define EALIGN_W_1  nop
+#define EALIGN_W_2  nop;nop
+#define EALIGN_W_3  nop;nop;nop
+#define EALIGN_W_4  EALIGN_W_3;nop
+#define EALIGN_W_5  EALIGN_W_4;nop
+#define EALIGN_W_6  EALIGN_W_5;nop
+#define EALIGN_W_7  EALIGN_W_6;nop
+
+/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
+   past a 2^align boundary.  */
+#ifdef PROF
+# define EALIGN(name, alignt, words)					      \
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);				      \
+  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)			      \
+  .align ALIGNARG(2);							      \
+  C_LABEL(name)								      \
+  cfi_startproc;							      \
+  CALL_MCOUNT								      \
+  b 0f;									      \
+  .align ALIGNARG(alignt);						      \
+  EALIGN_W_##words;							      \
+  0:
+#else /* PROF */
+# define EALIGN(name, alignt, words)					      \
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);				      \
+  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)			      \
+  .align ALIGNARG(alignt);						      \
+  EALIGN_W_##words;							      \
+  C_LABEL(name)								      \
+  cfi_startproc;
+#endif
+
+#undef	END
+#define END(name)							      \
+  cfi_endproc;								      \
+  ASM_SIZE_DIRECTIVE(name)
+
+#define DO_CALL(syscall)				      		      \
+    li 0,syscall;						              \
+    sc
+
+#undef JUMPTARGET
+#ifdef PIC
+# define JUMPTARGET(name) name##@plt
+#else
+# define JUMPTARGET(name) name
+#endif
+
+#if defined SHARED && defined DO_VERSIONING && defined PIC \
+    && !defined NO_HIDDEN
+# undef HIDDEN_JUMPTARGET
+# define HIDDEN_JUMPTARGET(name) __GI_##name##@local
+#endif
+
+#define PSEUDO(name, syscall_name, args)				      \
+  .section ".text";							      \
+  ENTRY (name)								      \
+    DO_CALL (SYS_ify (syscall_name));
+
+#define PSEUDO_RET							      \
+    bnslr+;								      \
+    b __syscall_error@local
+#define ret PSEUDO_RET
+
+#undef	PSEUDO_END
+#define	PSEUDO_END(name)						      \
+  END (name)
+
+#define PSEUDO_NOERRNO(name, syscall_name, args)			      \
+  .section ".text";							      \
+  ENTRY (name)								      \
+    DO_CALL (SYS_ify (syscall_name));
+
+#define PSEUDO_RET_NOERRNO						      \
+    blr
+#define ret_NOERRNO PSEUDO_RET_NOERRNO
+
+#undef	PSEUDO_END_NOERRNO
+#define	PSEUDO_END_NOERRNO(name)					      \
+  END (name)
+
+#define PSEUDO_ERRVAL(name, syscall_name, args)				      \
+  .section ".text";							      \
+  ENTRY (name)								      \
+    DO_CALL (SYS_ify (syscall_name));
+
+#define PSEUDO_RET_ERRVAL						      \
+    blr
+#define ret_ERRVAL PSEUDO_RET_ERRVAL
+
+#undef	PSEUDO_END_ERRVAL
+#define	PSEUDO_END_ERRVAL(name)						      \
+  END (name)
+
+/* Local labels stripped out by the linker.  */
+#undef L
+#define L(x) .L##x
+
+/* Label in text section.  */
+#define C_TEXT(name) name
+
+#endif /* __ELF__ */
+
+#endif	/* __ASSEMBLER__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/powerpc64/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/powerpc64/sysdep.h
new file mode 100644
index 0000000..4672885
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/powerpc64/sysdep.h
@@ -0,0 +1,264 @@
+/* Assembly macros for 64-bit PowerPC.
+   Copyright (C) 2002, 2003, 2004, 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., 51 Franklin Street, Fifth Floor, Boston MA
+   02110-1301 USA.  */
+
+#ifdef __ELF__
+
+#ifdef __ASSEMBLER__
+
+/* Support macros for CALL_MCOUNT.  */
+	.macro SAVE_ARG NARG
+	.if \NARG
+	SAVE_ARG \NARG-1
+	std	2+\NARG,-72+8*(\NARG)(1)
+	.endif
+	.endm
+
+	.macro REST_ARG NARG
+	.if \NARG
+	REST_ARG \NARG-1
+	ld	2+\NARG,40+8*(\NARG)(1)
+	.endif
+	.endm
+
+/* If compiled for profiling, call `_mcount' at the start of each function.
+   see ppc-mcount.S for more details.  */
+	.macro CALL_MCOUNT NARG
+#ifdef	PROF
+	mflr	r0
+	SAVE_ARG \NARG
+	std	r0,16(r1)
+	stdu	r1,-112(r1)
+	bl	JUMPTARGET (_mcount)
+	ld	r0,128(r1)
+	REST_ARG \NARG
+	addi	r1,r1,112
+	mtlr	r0
+#endif
+	.endm
+
+#ifdef USE_PPC64_OVERLAPPING_OPD
+# define OPD_ENT(name)	.quad BODY_LABEL (name), .TOC.@tocbase
+#else
+# define OPD_ENT(name)	.quad BODY_LABEL (name), .TOC.@tocbase, 0
+#endif
+
+#define ENTRY_1(name)	\
+	.section	".text";		\
+	.type BODY_LABEL(name),@function;	\
+	.globl name;				\
+	.section ".opd","aw";			\
+	.align 3;				\
+name##: OPD_ENT (name);				\
+	.previous;
+
+#ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define DOT_LABEL(X) .##X
+# define BODY_LABEL(X) .##X
+# define ENTRY_2(name)	\
+	.globl BODY_LABEL(name);		\
+	ENTRY_1(name)				\
+	.size name, 24;
+# define END_2(name)	\
+	.size BODY_LABEL(name),.-BODY_LABEL(name);
+#else
+# define DOT_LABEL(X) X
+# define BODY_LABEL(X) .LY##X
+# define ENTRY_2(name)	\
+	.type name,@function;			\
+	ENTRY_1(name)
+# define END_2(name)	\
+	.size name,.-BODY_LABEL(name);		\
+	.size BODY_LABEL(name),.-BODY_LABEL(name);
+#endif
+
+#define ENTRY(name)	\
+	ENTRY_2(name)				\
+	.align ALIGNARG(2);			\
+BODY_LABEL(name):				\
+	cfi_startproc;
+
+#define EALIGN_W_0  /* No words to insert.  */
+#define EALIGN_W_1  nop
+#define EALIGN_W_2  nop;nop
+#define EALIGN_W_3  nop;nop;nop
+#define EALIGN_W_4  EALIGN_W_3;nop
+#define EALIGN_W_5  EALIGN_W_4;nop
+#define EALIGN_W_6  EALIGN_W_5;nop
+#define EALIGN_W_7  EALIGN_W_6;nop
+
+/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
+   past a 2^alignt boundary.  */
+#define EALIGN(name, alignt, words) \
+	ENTRY_2(name)				\
+	.align ALIGNARG(alignt);		\
+	EALIGN_W_##words;			\
+BODY_LABEL(name):				\
+	cfi_startproc;
+
+/* Local labels stripped out by the linker.  */
+#undef L
+#define L(x) .L##x
+
+#define tostring(s) #s
+#define stringify(s) tostring(s)
+#define XGLUE(a,b) a##b
+#define GLUE(a,b) XGLUE(a,b)
+#define LT_LABEL(name) GLUE(.LT,name)
+#define LT_LABELSUFFIX(name,suffix) GLUE(GLUE(.LT,name),suffix)
+
+/* Support Traceback tables */
+#define TB_ASM			0x000c000000000000
+#define TB_GLOBALLINK		0x0000800000000000
+#define TB_IS_EPROL		0x0000400000000000
+#define TB_HAS_TBOFF		0x0000200000000000
+#define TB_INT_PROC		0x0000100000000000
+#define TB_HAS_CTL		0x0000080000000000
+#define TB_TOCLESS		0x0000040000000000
+#define TB_FP_PRESENT		0x0000020000000000
+#define TB_LOG_ABORT		0x0000010000000000
+#define TB_INT_HANDL		0x0000008000000000
+#define TB_NAME_PRESENT		0x0000004000000000
+#define TB_USES_ALLOCA		0x0000002000000000
+#define TB_SAVES_CR		0x0000000200000000
+#define TB_SAVES_LR		0x0000000100000000
+#define TB_STORES_BC		0x0000000080000000
+#define TB_FIXUP		0x0000000040000000
+#define TB_FP_SAVED(fprs)	(((fprs) & 0x3f) << 24)
+#define TB_GPR_SAVED(gprs)	(((fprs) & 0x3f) << 16)
+#define TB_FIXEDPARMS(parms)	(((parms) & 0xff) << 8)
+#define TB_FLOATPARMS(parms)	(((parms) & 0x7f) << 1)
+#define TB_PARMSONSTK		0x0000000000000001
+
+#define PPC_HIGHER(v) 		(((v) >> 32) & 0xffff)
+#define TB_DEFAULT		TB_ASM | TB_HAS_TBOFF | TB_NAME_PRESENT
+
+#define TRACEBACK(name) \
+LT_LABEL(name): ; \
+	.long	0 ; \
+	.quad	TB_DEFAULT ; \
+	.long	LT_LABEL(name)-BODY_LABEL(name) ; \
+	.short	LT_LABELSUFFIX(name,_name_end)-LT_LABELSUFFIX(name,_name_start) ; \
+LT_LABELSUFFIX(name,_name_start): ;\
+	.ascii	stringify(name) ; \
+LT_LABELSUFFIX(name,_name_end): ; \
+	.align	2 ;
+
+#define TRACEBACK_MASK(name,mask) \
+LT_LABEL(name): ; \
+	.long	0 ; \
+	.quad	TB_DEFAULT | mask ; \
+	.long	LT_LABEL(name)-BODY_LABEL(name) ; \
+	.short	LT_LABELSUFFIX(name,_name_end)-LT_LABELSUFFIX(name,_name_start) ; \
+LT_LABELSUFFIX(name,_name_start): ;\
+	.ascii	stringify(name) ; \
+LT_LABELSUFFIX(name,_name_end): ; \
+	.align	2 ;
+
+/* END generates Traceback tables */
+#undef	END
+#define END(name) \
+  cfi_endproc;			\
+  TRACEBACK(name)		\
+  END_2(name)
+
+/* This form supports more informative traceback tables */
+#define END_GEN_TB(name,mask)	\
+  cfi_endproc;			\
+  TRACEBACK_MASK(name,mask)	\
+  END_2(name)
+
+#define DO_CALL(syscall) \
+    li 0,syscall; \
+    sc
+
+/* ppc64 is always PIC */
+#undef JUMPTARGET
+#define JUMPTARGET(name) DOT_LABEL(name)
+
+#define PSEUDO(name, syscall_name, args) \
+  .section ".text";	\
+  ENTRY (name) \
+  DO_CALL (SYS_ify (syscall_name));
+
+#define PSEUDO_RET \
+    bnslr+; \
+    b JUMPTARGET(__syscall_error)
+
+#define ret PSEUDO_RET
+
+#undef	PSEUDO_END
+#define	PSEUDO_END(name) \
+  END (name)
+
+#define PSEUDO_NOERRNO(name, syscall_name, args) \
+  .section ".text";	\
+  ENTRY (name) \
+  DO_CALL (SYS_ify (syscall_name));
+
+#define PSEUDO_RET_NOERRNO \
+    blr
+
+#define ret_NOERRNO PSEUDO_RET_NOERRNO
+
+#undef	PSEUDO_END_NOERRNO
+#define	PSEUDO_END_NOERRNO(name) \
+  END (name)
+
+#define PSEUDO_ERRVAL(name, syscall_name, args) \
+  .section ".text";	\
+  ENTRY (name) \
+  DO_CALL (SYS_ify (syscall_name));
+
+#define PSEUDO_RET_ERRVAL \
+    blr
+
+#define ret_ERRVAL PSEUDO_RET_ERRVAL
+
+#undef	PSEUDO_END_ERRVAL
+#define	PSEUDO_END_ERRVAL(name) \
+  END (name)
+
+#else /* !__ASSEMBLER__ */
+
+#ifdef USE_PPC64_OVERLAPPING_OPD
+# define OPD_ENT(name)	".quad " BODY_PREFIX #name ", .TOC.@tocbase;"
+#else
+# define OPD_ENT(name)	".quad " BODY_PREFIX #name ", .TOC.@tocbase, 0;"
+#endif
+
+#ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define DOT_PREFIX "."
+# define BODY_PREFIX "."
+# define ENTRY_2(name)	\
+	".globl " BODY_PREFIX #name ";\n"				\
+	".size  " #name ", 24;"
+# define END_2(name)	\
+	".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";"
+#else
+# define DOT_PREFIX ""
+# define BODY_PREFIX ".LY"
+# define ENTRY_2(name) ".type " #name ",@function;"
+# define END_2(name)	\
+	".size " #name ",.-" BODY_PREFIX #name ";\n"			\
+	".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";"
+#endif
+
+#endif	/* __ASSEMBLER__ */
+
+#endif /* __ELF__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/ppc_asm.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/ppc_asm.h
new file mode 100644
index 0000000..e51d88f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/ppc_asm.h
@@ -0,0 +1,137 @@
+/* Copyright (C) 1999, 2001, 2002 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.  */
+
+#ifdef __ASSEMBLER__
+
+/* Symbolic names for the registers.  The only portable way to write asm
+   code is to use number but this produces really unreadable code.
+   Therefore these symbolic names.  */
+
+/* Integer registers.  */
+#define r0	0
+#define r1	1
+#define r2	2
+#define r3	3
+#define r4	4
+#define r5	5
+#define r6	6
+#define r7	7
+#define r8	8
+#define r9	9
+#define r10	10
+#define r11	11
+#define r12	12
+#define r13	13
+#define r14	14
+#define r15	15
+#define r16	16
+#define r17	17
+#define r18	18
+#define r19	19
+#define r20	20
+#define r21	21
+#define r22	22
+#define r23	23
+#define r24	24
+#define r25	25
+#define r26	26
+#define r27	27
+#define r28	28
+#define r29	29
+#define r30	30
+#define r31	31
+
+/* Floating-point registers.  */
+#define fp0	0
+#define fp1	1
+#define fp2	2
+#define fp3	3
+#define fp4	4
+#define fp5	5
+#define fp6	6
+#define fp7	7
+#define fp8	8
+#define fp9	9
+#define fp10	10
+#define fp11	11
+#define fp12	12
+#define fp13	13
+#define fp14	14
+#define fp15	15
+#define fp16	16
+#define fp17	17
+#define fp18	18
+#define fp19	19
+#define fp20	20
+#define fp21	21
+#define fp22	22
+#define fp23	23
+#define fp24	24
+#define fp25	25
+#define fp26	26
+#define fp27	27
+#define fp28	28
+#define fp29	29
+#define fp30	30
+#define fp31	31
+
+/* Condition code registers.  */
+#define cr0	0
+#define cr1	1
+#define cr2	2
+#define cr3	3
+#define cr4	4
+#define cr5	5
+#define cr6	6
+#define cr7	7
+
+/* Vector registers. */
+#define v0	0
+#define v1	1
+#define v2	2
+#define v3	3
+#define v4	4
+#define v5	5
+#define v6	6
+#define v7	7
+#define v8	8
+#define v9	9
+#define v10	10
+#define v11	11
+#define v12	12
+#define v13	13
+#define v14	14
+#define v15	15
+#define v16	16
+#define v17	17
+#define v18	18
+#define v19	19
+#define v20	20
+#define v21	21
+#define v22	22
+#define v23	23
+#define v24	24
+#define v25	25
+#define v26	26
+#define v27	27
+#define v28	28
+#define v29	29
+#define v30	30
+#define v31	31
+
+#endif	/* __ASSEMBLER__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/pread_write.c b/ap/build/uClibc/libc/sysdeps/linux/powerpc/pread_write.c
new file mode 100644
index 0000000..7f988d3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/pread_write.c
@@ -0,0 +1,183 @@
+/* vi: set sw=4 ts=4:
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Based in part on the files
+ *		./sysdeps/unix/sysv/linux/pwrite.c,
+ *		./sysdeps/unix/sysv/linux/pread.c,
+ *		sysdeps/posix/pread.c
+ *		sysdeps/posix/pwrite.c
+ * from GNU libc 2.2.5, but reworked considerably...
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <endian.h>
+
+#ifndef __UCLIBC_HAS_LFS__
+# define off64_t off_t
+#endif
+
+#ifdef __NR_pread
+extern __typeof(pread) __libc_pread;
+# define __NR___syscall_pread __NR_pread
+static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd,
+		void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 31, offset)));
+}
+weak_alias(__libc_pread,pread)
+
+# ifdef __UCLIBC_HAS_LFS__
+extern __typeof(pread64) __libc_pread64;
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
+{
+	return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 32, offset)));
+}
+weak_alias(__libc_pread64,pread64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* __NR_pread */
+
+
+#ifdef __NR_pwrite
+extern __typeof(pwrite) __libc_pwrite;
+# define __NR___syscall_pwrite __NR_pwrite
+static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd,
+		const void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+	return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 31, offset)));
+}
+weak_alias(__libc_pwrite,pwrite)
+
+# ifdef __UCLIBC_HAS_LFS__
+extern __typeof(pwrite64) __libc_pwrite64;
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
+{
+	return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 32, offset)));
+}
+weak_alias(__libc_pwrite64,pwrite64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* __NR_pwrite */
+
+
+
+#if ! defined __NR_pread || ! defined __NR_pwrite
+
+static ssize_t __fake_pread_write(int fd, void *buf,
+		size_t count, off_t offset, int do_pwrite)
+{
+	int save_errno;
+	ssize_t result;
+	off_t old_offset;
+
+	/* Since we must not change the file pointer preserve the
+	 * value so that we can restore it later.  */
+	if ((old_offset=lseek(fd, 0, SEEK_CUR)) == (off_t) -1)
+		return -1;
+
+	/* Set to wanted position.  */
+	if (lseek (fd, offset, SEEK_SET) == (off_t) -1)
+		return -1;
+
+	if (do_pwrite == 1) {
+		/* Write the data.  */
+		result = write(fd, buf, count);
+	} else {
+		/* Read the data.  */
+		result = read(fd, buf, count);
+	}
+
+	/* Now we have to restore the position.  If this fails we
+	 * have to return this as an error.  */
+	save_errno = errno;
+	if (lseek(fd, old_offset, SEEK_SET) == (off_t) -1)
+	{
+		if (result == -1)
+			__set_errno(save_errno);
+		return -1;
+	}
+	__set_errno(save_errno);
+	return(result);
+}
+
+# ifdef __UCLIBC_HAS_LFS__
+
+static ssize_t __fake_pread_write64(int fd, void *buf,
+		size_t count, off64_t offset, int do_pwrite)
+{
+	int save_errno;
+	ssize_t result;
+	off64_t old_offset;
+
+	/* Since we must not change the file pointer preserve the
+	 * value so that we can restore it later.  */
+	if ((old_offset=lseek64(fd, 0, SEEK_CUR)) == (off64_t) -1)
+		return -1;
+
+	/* Set to wanted position.  */
+	if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1)
+		return -1;
+
+	if (do_pwrite == 1) {
+		/* Write the data.  */
+		result = write(fd, buf, count);
+	} else {
+		/* Read the data.  */
+		result = read(fd, buf, count);
+	}
+
+	/* Now we have to restore the position. */
+	save_errno = errno;
+	if (lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1) {
+		if (result == -1)
+			__set_errno (save_errno);
+		return -1;
+	}
+	__set_errno (save_errno);
+	return result;
+}
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /*  ! defined __NR_pread || ! defined __NR_pwrite */
+
+#ifndef __NR_pread
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset);
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return(__fake_pread_write(fd, buf, count, offset, 0));
+}
+weak_alias(__libc_pread,pread)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset);
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
+{
+	return(__fake_pread_write64(fd, buf, count, offset, 0));
+}
+weak_alias(__libc_pread64,pread64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* ! __NR_pread */
+
+
+#ifndef __NR_pwrite
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset);
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+	return(__fake_pread_write(fd, (void*)buf, count, offset, 1));
+}
+weak_alias(__libc_pwrite,pwrite)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset);
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
+{
+	return(__fake_pread_write64(fd, (void*)buf, count, offset, 1));
+}
+weak_alias(__libc_pwrite64,pwrite64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* ! __NR_pwrite */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/setjmp.S
new file mode 100644
index 0000000..04b06d6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/setjmp.S
@@ -0,0 +1,92 @@
+/* setjmp for PowerPC and PowerPC e500.
+   Copyright (C) 1995, 1996, 1997, 1999, 2000, 2004
+   Free Software Foundation, Inc.
+   e500 contributed by Aldy Hernandez <aldyh@redhat.com>.
+   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 "ppc_asm.h"
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+#define FP(x...) x
+#else
+#define FP(x...)
+#endif
+
+#if defined __CONFIG_E500__
+#define LFD(reg) evldd r##reg
+#define STFD(reg) evstdd r##reg
+#else
+#define LFD(reg) lfd fp##reg
+#define STFD(reg) stfd fp##reg
+#endif /* __CONFIG_E500__ */
+
+.globl      __sigsetjmp;
+.type      __sigsetjmp, @function;
+.align  2;        
+
+__sigsetjmp:   
+	stw  r1,(JB_GPR1*4)(3)
+	mflr r0
+	stw  r2,(JB_GPR2*4)(3)
+	stw  r14,((JB_GPRS+0)*4)(3)
+FP(     STFD (14),((JB_FPRS+0*2)*4)(3))
+        stw  r0,(JB_LR*4)(3)
+        stw  r15,((JB_GPRS+1)*4)(3)
+FP(     STFD (15),((JB_FPRS+1*2)*4)(3))
+        mfcr r0
+        stw  r16,((JB_GPRS+2)*4)(3)
+FP(     STFD (16),((JB_FPRS+2*2)*4)(3))
+        stw  r0,(JB_CR*4)(3)
+        stw  r17,((JB_GPRS+3)*4)(3)
+FP(     STFD (17),((JB_FPRS+3*2)*4)(3))
+        stw  r18,((JB_GPRS+4)*4)(3)
+FP(     STFD (18),((JB_FPRS+4*2)*4)(3))
+        stw  r19,((JB_GPRS+5)*4)(3)
+FP(     STFD (19),((JB_FPRS+5*2)*4)(3))
+        stw  r20,((JB_GPRS+6)*4)(3)
+FP(     STFD (20),((JB_FPRS+6*2)*4)(3))
+        stw  r21,((JB_GPRS+7)*4)(3)
+FP(     STFD (21),((JB_FPRS+7*2)*4)(3))
+        stw  r22,((JB_GPRS+8)*4)(3)
+FP(     STFD (22),((JB_FPRS+8*2)*4)(3))
+        stw  r23,((JB_GPRS+9)*4)(3)
+FP(     STFD (23),((JB_FPRS+9*2)*4)(3))
+        stw  r24,((JB_GPRS+10)*4)(3)
+FP(     STFD (24),((JB_FPRS+10*2)*4)(3))
+        stw  r25,((JB_GPRS+11)*4)(3)
+FP(     STFD (25),((JB_FPRS+11*2)*4)(3))
+        stw  r26,((JB_GPRS+12)*4)(3)
+FP(     STFD (26),((JB_FPRS+12*2)*4)(3))
+        stw  r27,((JB_GPRS+13)*4)(3)
+FP(     STFD (27),((JB_FPRS+13*2)*4)(3))
+        stw  r28,((JB_GPRS+14)*4)(3)
+FP(     STFD (28),((JB_FPRS+14*2)*4)(3))
+        stw  r29,((JB_GPRS+15)*4)(3)
+FP(     STFD (29),((JB_FPRS+15*2)*4)(3))
+        stw  r30,((JB_GPRS+16)*4)(3)
+FP(     STFD (30),((JB_FPRS+16*2)*4)(3))
+        stw  r31,((JB_GPRS+17)*4)(3)
+FP(     STFD (31),((JB_FPRS+17*2)*4)(3))
+
+	b __sigjmp_save@local
+
+.size     __sigsetjmp,.-__sigsetjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/sys/procfs.h
new file mode 100644
index 0000000..1184636
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/sys/procfs.h
@@ -0,0 +1,140 @@
+/* Copyright (C) 1996, 1997, 1999, 2002, 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.  */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+
+__BEGIN_DECLS
+
+/* These definitions are normally provided by ucontext.h via
+   asm/sigcontext.h, asm/ptrace.h, and asm/elf.h.  Otherwise we define
+   them here.  */
+#ifndef __PPC64_ELF_H
+#define ELF_NGREG       48      /* includes nip, msr, lr, etc. */
+#define ELF_NFPREG      33      /* includes fpscr */
+#if __WORDSIZE == 32
+# define ELF_NVRREG      33      /* includes vscr */
+#else
+# define ELF_NVRREG      34      /* includes vscr */
+#endif
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef double elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+/* Altivec registers */
+typedef struct {
+  unsigned int u[4];
+} __attribute__ ((aligned (16))) elf_vrreg_t;
+typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
+#endif
+
+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.  Fields present but not used are
+   marked with "XXX".  */
+struct elf_prstatus
+  {
+#if 0
+    long int pr_flags;			/* XXX Process flags.  */
+    short int pr_why;			/* XXX Reason for process halt.  */
+    short int pr_what;			/* XXX More detailed reason.  */
+#endif
+    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.  */
+#if 0
+    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
+    struct sigaction pr_action;		/* Signal action for current sig.  */
+#endif
+    __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.  */
+#if 0
+    long int pr_instr;			/* Current instruction.  */
+#endif
+    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.  */
+    __uid_t pr_uid;
+    __gid_t pr_gid;
+    __pid_t 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.  */
+  };
+
+/* 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 habe only ine PID type.  */
+typedef __pid_t lwpid_t;
+
+
+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/powerpc/sys/ptrace.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/sys/ptrace.h
new file mode 100644
index 0000000..91a8730
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/sys/ptrace.h
@@ -0,0 +1,99 @@
+/* `ptrace' debugger support interface.  Linux version.
+   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.  */
+
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.'  */
+enum __ptrace_request
+{
+  /* Indicate that the process making this request should be traced.
+     All signals received by this process can be intercepted by its
+     parent, and its parent can use the other `ptrace' requests.  */
+  PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+  /* Return the word in the process's text space at address ADDR.  */
+  PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+  /* Return the word in the process's data space at address ADDR.  */
+  PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+  /* Return the word in the process's user area at offset ADDR.  */
+  PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+  /* Write the word DATA into the process's text space at address ADDR.  */
+  PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+  /* Write the word DATA into the process's data space at address ADDR.  */
+  PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+  /* Write the word DATA into the process's user area at offset ADDR.  */
+  PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+  /* Continue the process.  */
+  PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+  /* Kill the process.  */
+  PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+  /* Single step the process.
+     This is not supported on all machines.  */
+  PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+  /* Attach to a process that is already running. */
+  PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+  /* Detach from a process attached to with PTRACE_ATTACH.  */
+  PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+  /* Continue and stop at the next (return from) syscall.  */
+  PTRACE_SYSCALL = 24
+#define PT_SYSCALL PTRACE_SYSCALL
+};
+
+/* Perform process tracing functions.  REQUEST is one of the values
+   above, and determines the action to be taken.
+   For all requests except PTRACE_TRACEME, PID specifies the process to be
+   traced.
+
+   PID and the other arguments described above for the various requests should
+   appear (those that are used for the particular request) as:
+     pid_t PID, void *ADDR, int DATA, void *ADDR2
+   after REQUEST.  */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/sys/ucontext.h
new file mode 100644
index 0000000..737512a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/sys/ucontext.h
@@ -0,0 +1,177 @@
+/* Copyright (C) 1998, 1999, 2002, 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.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+#if __WORDSIZE == 32
+
+/* Number of general registers.  */
+# define NGREG	48
+
+/* Container for all general registers.  */
+typedef unsigned long gregset_t[NGREG];
+
+/* Container for floating-point registers and status */
+typedef struct _libc_fpstate
+{
+	double fpregs[32];
+	double fpscr;
+	unsigned int _pad[2];
+} fpregset_t;
+
+/* Container for Altivec/VMX registers and status.
+   Needs to be aligned on a 16-byte boundary. */
+typedef struct _libc_vrstate
+{
+	unsigned int vrregs[32][4];
+	unsigned int vrsave;
+	unsigned int _pad[2];
+	unsigned int vscr;
+} vrregset_t;
+
+/* Context to describe whole processor state.  */
+typedef struct
+{
+	gregset_t gregs;
+	fpregset_t fpregs;
+	vrregset_t vrregs __attribute__((__aligned__(16)));
+} mcontext_t;
+
+#else
+
+/* For 64-bit kernels with Altivec support, a machine context is exactly
+ * a sigcontext.  For older kernel (without Altivec) the sigcontext matches
+ * the mcontext upto but not including the v_regs field.  For kernels that
+ * don't AT_HWCAP or return AT_HWCAP without PPC_FEATURE_HAS_ALTIVEC the
+ * v_regs field may not exit and should not be referenced.  The v_regd field
+ * can be refernced safely only after verifying that PPC_FEATURE_HAS_ALTIVEC
+ * is set in AT_HWCAP.  */
+
+/* Number of general registers.  */
+# define NGREG	48	/* includes r0-r31, nip, msr, lr, etc.   */
+# define NFPREG	33	/* includes fp0-fp31 &fpscr.  */
+# define NVRREG	34	/* includes v0-v31, vscr, & vrsave in split vectors */
+
+typedef unsigned long gregset_t[NGREG];
+typedef double fpregset_t[NFPREG];
+
+/* Container for Altivec/VMX Vector Status and Control Register.  Only 32-bits
+   but can only be copied to/from a 128-bit vector register.  So we allocated
+   a whole quadword speedup save/restore.  */
+typedef struct _libc_vscr
+{
+	unsigned int __pad[3];
+	unsigned int vscr_word;
+} vscr_t;
+
+/* Container for Altivec/VMX registers and status.
+   Must to be aligned on a 16-byte boundary. */
+typedef struct _libc_vrstate
+{
+	unsigned int	vrregs[32][4];
+	vscr_t		vscr;
+	unsigned int	vrsave;
+	unsigned int	__pad[3];
+} vrregset_t  __attribute__((__aligned__(16)));
+
+typedef struct {
+	unsigned long	__unused[4];
+	int		signal;
+	int		__pad0;
+	unsigned long	handler;
+	unsigned long	oldmask;
+	struct pt_regs	*regs;
+	gregset_t	gp_regs;
+	fpregset_t	fp_regs;
+/*
+ * To maintain compatibility with current implementations the sigcontext is
+ * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t)
+ * followed by an unstructured (vmx_reserve) field of 69 doublewords.  This
+ * allows the array of vector registers to be quadword aligned independent of
+ * the alignment of the containing sigcontext or ucontext. It is the
+ * responsibility of the code setting the sigcontext to set this pointer to
+ * either NULL (if this processor does not support the VMX feature) or the
+ * address of the first quadword within the allocated (vmx_reserve) area.
+ *
+ * The pointer (v_regs) of vector type (elf_vrreg_t) is essentually
+ * an array of 34 quadword entries.  The entries with
+ * indexes 0-31 contain the corresponding vector registers.  The entry with
+ * index 32 contains the vscr as the last word (offset 12) within the
+ * quadword.  This allows the vscr to be stored as either a quadword (since
+ * it must be copied via a vector register to/from storage) or as a word.
+ * The entry with index 33 contains the vrsave as the first word (offset 0)
+ * within the quadword.
+ */
+	vrregset_t	*v_regs;
+	long		vmx_reserve[NVRREG+NVRREG+1];
+} mcontext_t;
+
+#endif
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+#if __WORDSIZE == 32
+    /*
+     * These fields are set up this way to maximize source and
+     * binary compatibility with code written for the old
+     * ucontext_t definition, which didn't include space for the
+     * registers.
+     *
+     * Different versions of the kernel have stored the registers on
+     * signal delivery at different offsets from the ucontext struct.
+     * Programs should thus use the uc_mcontext.uc_regs pointer to
+     * find where the registers are actually stored.  The registers
+     * will be stored within the ucontext_t struct but not necessarily
+     * at a fixed address.  As a side-effect, this lets us achieve
+     * 16-byte alignment for the register storage space if the
+     * Altivec registers are to be saved, without requiring 16-byte
+     * alignment on the whole ucontext_t.
+     *
+     * The uc_mcontext.regs field is included for source compatibility
+     * with programs written against the older ucontext_t definition,
+     * and its name should therefore not change.  The uc_pad field
+     * is for binary compatibility with programs compiled against the
+     * old ucontext_t; it ensures that uc_mcontext.regs and uc_sigmask
+     * are at the same offset as previously.
+     */
+    int uc_pad[7];
+    union uc_regs_ptr {
+      struct pt_regs *regs;
+      mcontext_t *uc_regs;
+    } uc_mcontext;
+    sigset_t    uc_sigmask;
+    char uc_reg_space[sizeof(mcontext_t) + 12];  /* last for extensibility */
+#else /* 64-bit */
+    sigset_t    uc_sigmask;
+    mcontext_t  uc_mcontext;  /* last for extensibility */
+#endif
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/sys/user.h
new file mode 100644
index 0000000..e8a8aaa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/sys/user.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 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.  */
+
+#ifndef _SYS_USER_H
+
+#define _SYS_USER_H	1
+#include <features.h>
+
+#include <asm/ptrace.h>
+
+struct user {
+	struct pt_regs	regs;			/* entire machine state */
+	size_t		u_tsize;		/* text size (pages) */
+	size_t		u_dsize;		/* data size (pages) */
+	size_t		u_ssize;		/* stack size (pages) */
+	unsigned long	start_code;		/* text starting address */
+	unsigned long	start_data;		/* data starting address */
+	unsigned long	start_stack;		/* stack starting address */
+	long int	signal;			/* signal causing core dump */
+	struct regs *	u_ar0;			/* help gdb find registers */
+	unsigned long	magic;			/* identifies a core file */
+	char		u_comm[32];		/* user command name */
+};
+
+#endif  /* sys/user.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/syscall.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/syscall.S
new file mode 100644
index 0000000..b853984
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/syscall.S
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991, 1992, 1997, 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 <features.h>
+
+	.text
+	.globl	syscall
+	.type	syscall,@function
+	.align  2
+
+syscall:
+	mr 0,3
+	mr 3,4
+	mr 4,5
+	mr 5,6
+	mr 6,7
+	mr 7,8
+	sc
+	bnslr;
+
+	b __syscall_error
+
+	.size syscall,.-syscall
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/powerpc/sysdep.h
new file mode 100644
index 0000000..14b86ac
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/sysdep.h
@@ -0,0 +1,196 @@
+/* Copyright (C) 1999, 2001, 2002, 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.  */
+
+#include <common/sysdep.h>
+
+/* 
+ * Powerpc Feature masks for the Aux Vector Hardware Capabilities (AT_HWCAP). 
+ * This entry is copied to _dl_hwcap or rtld_global._dl_hwcap during startup.
+ * The following must match the kernels linux/asm/cputable.h.  
+ */
+#define PPC_FEATURE_32			0x80000000 /* 32-bit mode. */
+#define PPC_FEATURE_64			0x40000000 /* 64-bit mode. */
+#define PPC_FEATURE_601_INSTR		0x20000000 /* 601 chip, Old POWER ISA.  */
+#define PPC_FEATURE_HAS_ALTIVEC		0x10000000 /* SIMD/Vector Unit.  */
+#define PPC_FEATURE_HAS_FPU		0x08000000 /* Floating Point Unit.  */
+#define PPC_FEATURE_HAS_MMU		0x04000000 /* Memory Management Unit.  */
+#define PPC_FEATURE_HAS_4xxMAC		0x02000000 /* 4xx Multiply Accumulator.  */
+#define PPC_FEATURE_UNIFIED_CACHE	0x01000000 /* Unified I/D cache.  */
+#define PPC_FEATURE_HAS_SPE		0x00800000 /* Signal Processing ext.  */
+#define PPC_FEATURE_HAS_EFP_SINGLE	0x00400000 /* SPE Float.  */
+#define PPC_FEATURE_HAS_EFP_DOUBLE	0x00200000 /* SPE Double.  */
+#define PPC_FEATURE_NO_TB		0x00100000 /* 601/403gx have no timebase */
+#define PPC_FEATURE_POWER4		0x00080000 /* POWER4 ISA 2.00 */
+#define PPC_FEATURE_POWER5		0x00040000 /* POWER5 ISA 2.02 */
+#define PPC_FEATURE_POWER5_PLUS		0x00020000 /* POWER5+ ISA 2.03 */
+#define PPC_FEATURE_CELL_BE		0x00010000 /* CELL Broadband Engine */
+#define PPC_FEATURE_BOOKE		0x00008000
+#define PPC_FEATURE_SMT			0x00004000 /* Simultaneous Multi-Threading */
+#define PPC_FEATURE_ICACHE_SNOOP	0x00002000
+#define PPC_FEATURE_ARCH_2_05		0x00001000 /* ISA 2.05 */
+#define PPC_FEATURE_PA6T		0x00000800 /* PA Semi 6T Core */
+#define PPC_FEATURE_HAS_DFP		0x00000400 /* Decimal FP Unit */
+#define PPC_FEATURE_POWER6_EXT		0x00000200 /* P6 + mffgpr/mftgpr */
+#define PPC_FEATURE_ARCH_2_06	        0x00000100 /* ISA 2.06 */
+#define PPC_FEATURE_HAS_VSX		0x00000080 /* P7 Vector Extension.  */
+#define PPC_FEATURE_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC)
+
+#ifdef __ASSEMBLER__
+
+/* Symbolic names for the registers.  The only portable way to write asm
+   code is to use number but this produces really unreadable code.
+   Therefore these symbolic names.  */
+
+/* Integer registers.  */
+#define r0	0
+#define r1	1
+#define r2	2
+#define r3	3
+#define r4	4
+#define r5	5
+#define r6	6
+#define r7	7
+#define r8	8
+#define r9	9
+#define r10	10
+#define r11	11
+#define r12	12
+#define r13	13
+#define r14	14
+#define r15	15
+#define r16	16
+#define r17	17
+#define r18	18
+#define r19	19
+#define r20	20
+#define r21	21
+#define r22	22
+#define r23	23
+#define r24	24
+#define r25	25
+#define r26	26
+#define r27	27
+#define r28	28
+#define r29	29
+#define r30	30
+#define r31	31
+
+/* Floating-point registers.  */
+#define fp0	0
+#define fp1	1
+#define fp2	2
+#define fp3	3
+#define fp4	4
+#define fp5	5
+#define fp6	6
+#define fp7	7
+#define fp8	8
+#define fp9	9
+#define fp10	10
+#define fp11	11
+#define fp12	12
+#define fp13	13
+#define fp14	14
+#define fp15	15
+#define fp16	16
+#define fp17	17
+#define fp18	18
+#define fp19	19
+#define fp20	20
+#define fp21	21
+#define fp22	22
+#define fp23	23
+#define fp24	24
+#define fp25	25
+#define fp26	26
+#define fp27	27
+#define fp28	28
+#define fp29	29
+#define fp30	30
+#define fp31	31
+
+/* Condition code registers.  */
+#define cr0	0
+#define cr1	1
+#define cr2	2
+#define cr3	3
+#define cr4	4
+#define cr5	5
+#define cr6	6
+#define cr7	7
+
+/* Vector registers. */
+#define v0	0
+#define v1	1
+#define v2	2
+#define v3	3
+#define v4	4
+#define v5	5
+#define v6	6
+#define v7	7
+#define v8	8
+#define v9	9
+#define v10	10
+#define v11	11
+#define v12	12
+#define v13	13
+#define v14	14
+#define v15	15
+#define v16	16
+#define v17	17
+#define v18	18
+#define v19	19
+#define v20	20
+#define v21	21
+#define v22	22
+#define v23	23
+#define v24	24
+#define v25	25
+#define v26	26
+#define v27	27
+#define v28	28
+#define v29	29
+#define v30	30
+#define v31	31
+
+#define VRSAVE	256
+
+
+#ifdef __ELF__
+
+/* This seems to always be the case on PPC.  */
+#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
+
+#endif /* __ELF__ */
+
+# include <sys/syscall.h>
+# if defined(__powerpc64__)
+#  include "powerpc64/sysdep.h"
+# else
+#  include "powerpc32/sysdep.h"
+# endif
+
+#endif	/* __ASSEMBLER__ */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/powerpc/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/powerpc/vfork.S
new file mode 100644
index 0000000..0083742
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/powerpc/vfork.S
@@ -0,0 +1,30 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * 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>
+
+#ifndef __NR_vfork
+/* No vfork so use fork instead */
+# define __NR_vfork __NR_fork
+#endif
+
+.text
+.global __vfork
+.hidden __vfork
+.type   __vfork,@function
+.type   __syscall_error,@function
+
+__vfork:
+	li	0, __NR_vfork
+	sc
+	bnslr+
+	b	__syscall_error
+
+.size __vfork,.-__vfork
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/Makefile b/ap/build/uClibc/libc/sysdeps/linux/sh/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/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/sh/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/sh/Makefile.arch
new file mode 100644
index 0000000..6cbc681
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/Makefile.arch
@@ -0,0 +1,12 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2001 by Hewlett-Packard Australia
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+CSRC := \
+	mmap.c pipe.c __init_brk.c brk.c sbrk.c pread_write.c cacheflush.c
+
+SSRC := setjmp.S __longjmp.S ___fpscr_values.S vfork.S clone.S
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/___fpscr_values.S b/ap/build/uClibc/libc/sysdeps/linux/sh/___fpscr_values.S
new file mode 100644
index 0000000..3a1c831
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/___fpscr_values.S
@@ -0,0 +1,34 @@
+/* Startup code for SH & ELF.
+   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 2001 Hewlett-Packard Australia
+   Copyright (C) 2002 Stefan Allius
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Library General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+ details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <features.h>
+
+.data
+#ifdef __SH4__
+.global ___fpscr_values
+.type ___fpscr_values,@object
+.size ___fpscr_values,8
+___fpscr_values:
+	.long   0
+	.long   0x80000
+
+.weak __fpscr_values
+	__fpscr_values = ___fpscr_values
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/__init_brk.c b/ap/build/uClibc/libc/sysdeps/linux/sh/__init_brk.c
new file mode 100644
index 0000000..8a41eb3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/__init_brk.c
@@ -0,0 +1,26 @@
+/* From libc-5.3.12 */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+void * __curbrk attribute_hidden = 0;
+
+#define __NR__brk __NR_brk
+attribute_hidden _syscall1(void *, _brk, void *, ptr)
+
+extern int __init_brk (void) attribute_hidden;
+int
+__init_brk (void)
+{
+    if (__curbrk == 0)
+    {
+		__curbrk = _brk(0);
+		if (__curbrk == 0)
+		{
+		  __set_errno(ENOMEM);
+		  return -1;
+		}
+    }
+    return 0;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/sh/__longjmp.S
new file mode 100644
index 0000000..eb56991
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/__longjmp.S
@@ -0,0 +1,65 @@
+/* longjmp for SH.
+   Copyright (C) 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+#include <features.h>
+
+/* __longjmp(jmpbuf, val) */
+
+.text
+.align 4
+.type	__longjmp,@function
+.globl	__longjmp;
+__longjmp:
+	mov.l	@r4+, r8
+	mov.l	@r4+, r9
+	mov.l	@r4+, r10
+	mov.l	@r4+, r11
+	mov.l	@r4+, r12
+	mov.l	@r4+, r13
+	mov.l	@r4+, r14
+	mov.l	@r4+, r15
+#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+	lds.l	@r4+, pr
+	ldc.l	@r4+, gbr
+	lds.l	@r4+, fpscr
+	fmov.s	@r4+, fr12
+	fmov.s	@r4+, fr13
+	mov	r5, r0		/* get the return value in place */
+	tst	r0, r0
+	bf.s	1f
+	 fmov.s	@r4+, fr14
+	mov	#1,r0		/* can't let setjmp() return zero! */
+1:
+	rts
+	 fmov.s	@r4+, fr15
+#else
+	mov	r5, r0		/* get the return value in place */
+	tst	r0, r0
+	bf.s	1f
+	 lds.l	@r4+, pr
+	mov	#1,r0		/* can't let setjmp() return zero! */
+1:
+	rts
+	 ldc.l	@r4+, gbr
+#endif		
+.size __longjmp,.-__longjmp
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/atomic.h
new file mode 100644
index 0000000..fa6d0de
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/atomic.h
@@ -0,0 +1,293 @@
+/* Atomic operations used inside libc.  Linux/SH version.
+   Copyright (C) 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.  */
+
+#include <stdint.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 int16_t atomic16_t;
+typedef uint16_t uatomic16_t;
+typedef int_fast16_t atomic_fast16_t;
+typedef uint_fast16_t uatomic_fast16_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 int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+typedef int_fast64_t atomic_fast64_t;
+typedef uint_fast64_t uatomic_fast64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+/* SH kernel has implemented a gUSA ("g" User Space Atomicity) support
+   for the user space atomicity. The atomicity macros use this scheme.
+
+  Reference:
+    Niibe Yutaka, "gUSA: Simple and Efficient User Space Atomicity
+    Emulation with Little Kernel Modification", Linux Conference 2002,
+    Japan. http://lc.linux.or.jp/lc2002/papers/niibe0919h.pdf (in
+    Japanese).
+
+    Niibe Yutaka, "gUSA: User Space Atomicity with Little Kernel
+    Modification", LinuxTag 2003, Rome.
+    http://www.semmel.ch/Linuxtag-DVD/talks/170/paper.html (in English).
+
+    B.N. Bershad, D. Redell, and J. Ellis, "Fast Mutual Exclusion for
+    Uniprocessors",  Proceedings of the Fifth Architectural Support for
+    Programming Languages and Operating Systems (ASPLOS), pp. 223-233,
+    October 1992. http://www.cs.washington.edu/homes/bershad/Papers/Rcs.ps
+
+  SuperH ABI:
+      r15:    -(size of atomic instruction sequence) < 0
+      r0:     end point
+      r1:     saved stack pointer
+*/
+
+/* Avoid having lots of different versions of compare and exchange,
+   by having this one complicated version. Parameters:
+      bwl:     b, w or l for 8, 16 and 32 bit versions.
+      version: val or bool, depending on whether the result is the
+               previous value or a bool indicating whether the transfer
+               did happen (note this needs inverting before being
+               returned in atomic_compare_and_exchange_bool).
+*/
+
+#define __arch_compare_and_exchange_n(mem, newval, oldval, bwl, version) \
+  ({ signed long __arch_result; \
+     __asm__ __volatile__ ("\
+	.align 2\n\
+	mova 1f,r0\n\
+	nop\n\
+	mov r15,r1\n\
+	mov #-8,r15\n\
+     0: mov." #bwl " @%1,%0\n\
+	cmp/eq %0,%3\n\
+	bf 1f\n\
+	mov." #bwl " %2,@%1\n\
+     1: mov r1,r15\n\
+     .ifeqs \"bool\",\"" #version "\"\n\
+        movt %0\n\
+     .endif\n"					\
+	: "=&r" (__arch_result)			\
+	: "r" (mem), "r" (newval), "r" (oldval)	\
+	: "r0", "r1", "t", "memory");		\
+     __arch_result; })
+
+#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
+  __arch_compare_and_exchange_n(mem, newval, (int8_t)(oldval), b, val)
+
+#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
+  __arch_compare_and_exchange_n(mem, newval, (int16_t)(oldval), w, val)
+
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+  __arch_compare_and_exchange_n(mem, newval, (int32_t)(oldval), l, val)
+
+/* XXX We do not really need 64-bit compare-and-exchange.  At least
+   not in the moment.  Using it would mean causing portability
+   problems since not many other 32-bit architectures have support for
+   such an operation.  So don't define any code for now.  */
+
+# define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+  (abort (), 0)
+
+/* For "bool" routines, return if the exchange did NOT occur */
+
+#define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval) \
+  (! __arch_compare_and_exchange_n(mem, newval, (int8_t)(oldval), b, bool))
+
+#define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval) \
+  (! __arch_compare_and_exchange_n(mem, newval, (int16_t)(oldval), w, bool))
+
+#define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
+  (! __arch_compare_and_exchange_n(mem, newval, (int32_t)(oldval), l, bool))
+
+# define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \
+  (abort (), 0)
+
+/* Similar to the above, have one template which can be used in a
+   number of places. This version returns both the old and the new
+   values of the location. Parameters:
+      bwl:     b, w or l for 8, 16 and 32 bit versions.
+      oper:    The instruction to perform on the old value.
+   Note old is not sign extended, so should be an unsigned long.
+*/
+
+#define __arch_operate_old_new_n(mem, value, old, new, bwl, oper)	\
+  (void) ({ __asm__ __volatile__ ("\
+	.align 2\n\
+	mova 1f,r0\n\
+	mov r15,r1\n\
+	nop\n\
+	mov #-8,r15\n\
+     0: mov." #bwl " @%2,%0\n\
+	mov %0,%1\n\
+	" #oper " %3,%1\n\
+	mov." #bwl " %1,@%2\n\
+     1: mov r1,r15"			\
+	: "=&r" (old), "=&r"(new)	\
+	: "r" (mem), "r" (value)	\
+	: "r0", "r1", "memory");	\
+    })
+
+#define __arch_exchange_and_add_8_int(mem, value)			\
+  ({ int32_t __value = (value), __new, __old;				\
+    __arch_operate_old_new_n((mem), __value, __old, __new, b, add);	\
+    __old; })
+
+#define __arch_exchange_and_add_16_int(mem, value)			\
+  ({ int32_t __value = (value), __new, __old;				\
+    __arch_operate_old_new_n((mem), __value, __old, __new, w, add);	\
+    __old; })
+
+#define __arch_exchange_and_add_32_int(mem, value)			\
+  ({ int32_t __value = (value), __new, __old;				\
+    __arch_operate_old_new_n((mem), __value, __old, __new, l, add);	\
+    __old; })
+
+#define __arch_exchange_and_add_64_int(mem, value)			\
+  (abort (), 0)
+
+#define atomic_exchange_and_add(mem, value) \
+  __atomic_val_bysize (__arch_exchange_and_add, int, mem, value)
+
+
+/* Again, another template. We get a slight optimisation when the old value
+   does not need to be returned. Parameters:
+      bwl:     b, w or l for 8, 16 and 32 bit versions.
+      oper:    The instruction to perform on the old value.
+*/
+
+#define __arch_operate_new_n(mem, value, bwl, oper)	 \
+  ({ int32_t __value = (value), __new; \
+     __asm__ __volatile__ ("\
+	.align 2\n\
+	mova 1f,r0\n\
+	mov r15,r1\n\
+	mov #-6,r15\n\
+     0: mov." #bwl " @%1,%0\n\
+	" #oper " %2,%0\n\
+	mov." #bwl " %0,@%1\n\
+     1: mov r1,r15"			\
+	: "=&r" (__new)			\
+	: "r" (mem), "r" (__value)	\
+	: "r0", "r1", "memory");	\
+     __new;				\
+  })
+
+#define __arch_add_8_int(mem, value)		\
+  __arch_operate_new_n(mem, value, b, add)
+
+#define __arch_add_16_int(mem, value)		\
+  __arch_operate_new_n(mem, value, w, add)
+
+#define __arch_add_32_int(mem, value)		\
+  __arch_operate_new_n(mem, value, l, add)
+
+#define __arch_add_64_int(mem, value)		\
+  (abort (), 0)
+
+#define atomic_add(mem, value) \
+  ((void) __atomic_val_bysize (__arch_add, int, mem, value))
+
+
+#define __arch_add_negative_8_int(mem, value)		\
+  (__arch_operate_new_n(mem, value, b, add) < 0)
+
+#define __arch_add_negative_16_int(mem, value)		\
+  (__arch_operate_new_n(mem, value, w, add) < 0)
+
+#define __arch_add_negative_32_int(mem, value)		\
+  (__arch_operate_new_n(mem, value, l, add) < 0)
+
+#define __arch_add_negative_64_int(mem, value)		\
+  (abort (), 0)
+
+#define atomic_add_negative(mem, value) \
+  __atomic_bool_bysize (__arch_add_negative, int, mem, value)
+
+
+#define __arch_add_zero_8_int(mem, value)		\
+  (__arch_operate_new_n(mem, value, b, add) == 0)
+
+#define __arch_add_zero_16_int(mem, value)		\
+  (__arch_operate_new_n(mem, value, w, add) == 0)
+
+#define __arch_add_zero_32_int(mem, value)		\
+  (__arch_operate_new_n(mem, value, l, add) == 0)
+
+#define __arch_add_zero_64_int(mem, value)		\
+  (abort (), 0)
+
+#define atomic_add_zero(mem, value) \
+  __atomic_bool_bysize (__arch_add_zero, int, mem, value)
+
+
+#define atomic_increment_and_test(mem) atomic_add_zero((mem), 1)
+#define atomic_decrement_and_test(mem) atomic_add_zero((mem), -1)
+
+
+#define __arch_bit_set_8_int(mem, value)		\
+  __arch_operate_new_n(mem, 1<<(value), b, or)
+
+#define __arch_bit_set_16_int(mem, value)		\
+  __arch_operate_new_n(mem, 1<<(value), w, or)
+
+#define __arch_bit_set_32_int(mem, value)		\
+  __arch_operate_new_n(mem, 1<<(value), l, or)
+
+#define __arch_bit_set_64_int(mem, value)		\
+  (abort (), 0)
+
+#define __arch_add_64_int(mem, value)			\
+  (abort (), 0)
+
+#define atomic_bit_set(mem, value) \
+  ((void) __atomic_val_bysize (__arch_bit_set, int, mem, value))
+
+
+#define __arch_bit_test_set_8_int(mem, value)				\
+  ({ int32_t __value = 1<<(value), __new, __old;			\
+    __arch_operate_old_new_n((mem), __value, __old, __new, b, or);	\
+    __old & __value; })
+
+#define __arch_bit_test_set_16_int(mem, value)				\
+  ({ int32_t __value = 1<<(value), __new, __old;			\
+    __arch_operate_old_new_n((mem), __value, __old, __new, w, or);	\
+    __old & __value; })
+
+#define __arch_bit_test_set_32_int(mem, value)				\
+  ({ int32_t __value = 1<<(value), __new, __old;			\
+    __arch_operate_old_new_n((mem), __value, __old, __new, l, or);	\
+    __old & __value; })
+
+#define __arch_bit_test_set_64_int(mem, value)	\
+  (abort (), 0)
+
+#define atomic_bit_test_set(mem, value) \
+  __atomic_val_bysize (__arch_bit_test_set, int, mem, value)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/endian.h
new file mode 100644
index 0000000..1fef1ff
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/endian.h
@@ -0,0 +1,13 @@
+/* SH is bi-endian but with a big-endian FPU.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#ifdef __LITTLE_ENDIAN__
+#define __BYTE_ORDER __LITTLE_ENDIAN
+#define __FLOAT_WORD_ORDER __LITTLE_ENDIAN
+#else
+#define __BYTE_ORDER __BIG_ENDIAN
+#define __FLOAT_WORD_ORDER __BIG_ENDIAN
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/fcntl.h
new file mode 100644
index 0000000..adb7377
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/fcntl.h
@@ -0,0 +1,239 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007
+   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_DIRECT	 040000	/* Direct disk access.	*/
+# define O_DIRECTORY	0200000	/* Must be a directory.	 */
+# define O_NOFOLLOW	0400000	/* Do not follow links.	 */
+# define O_NOATIME     01000000 /* Do not set atime.  */
+# define O_CLOEXEC     02000000 /* Set close_on_exec.  */
+#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	0100000
+#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/sh/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/fenv.h
new file mode 100644
index 0000000..cbbad92
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/fenv.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 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.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Define bits representing the exception.  We use the bit positions
+   of the appropriate bits in the FPU control word.  */
+enum
+  {
+    FE_INEXACT = 0x04,
+#define FE_INEXACT	FE_INEXACT
+    FE_UNDERFLOW = 0x08,
+#define FE_UNDERFLOW	FE_UNDERFLOW
+    FE_OVERFLOW = 0x10,
+#define FE_OVERFLOW	FE_OVERFLOW
+    FE_DIVBYZERO = 0x20,
+#define FE_DIVBYZERO	FE_DIVBYZERO
+    FE_INVALID = 0x40,
+#define FE_INVALID	FE_INVALID
+  };
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The SH FPU supports all of the four defined rounding modes.  We
+   use again the bit positions in the FPU control word as the values
+   for the appropriate macros.  */
+enum
+  {
+    FE_TONEAREST = 0x0,
+#define FE_TONEAREST	FE_TONEAREST
+    FE_TOWARDZERO = 0x1,
+#define FE_TOWARDZERO	FE_TOWARDZERO
+    FE_UPWARD = 0x2,
+#define FE_UPWARD	FE_UPWARD
+    FE_DOWNWARD = 0x3
+#define FE_DOWNWARD	FE_DOWNWARD
+  };
+
+
+/* Type representing exception flags.  */
+typedef unsigned short int fexcept_t;
+
+
+/* Type representing floating-point environment.  This function corresponds
+   to the layout of the block written by the `fstenv'.  */
+typedef struct
+  {
+    unsigned int __fpscr;
+  }
+fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((fenv_t *) -1)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/bits/huge_val.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/huge_val.h
new file mode 100644
index 0000000..732b065
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/huge_val.h
@@ -0,0 +1,56 @@
+/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
+   Used by <stdlib.h> and <math.h> functions for overflow.
+   SH 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__
+
+#  define HUGE_VAL \
+  (__extension__							      \
+   ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
+    { __l: 0x000000007ff00000ULL }).__d)
+
+#else /* not GCC */
+
+# include <endian.h>
+
+typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
+
+# 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
+
+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/sh/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/kernel_stat.h
new file mode 100644
index 0000000..5b51b3c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/kernel_stat.h
@@ -0,0 +1,77 @@
+#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... */
+#include <endian.h>
+
+struct kernel_stat {
+	unsigned short st_dev;
+	unsigned short __pad1;
+	unsigned long st_ino;
+	unsigned short st_mode;
+	unsigned short st_nlink;
+	unsigned short st_uid;
+	unsigned short st_gid;
+	unsigned short st_rdev;
+	unsigned short __pad2;
+	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 {
+#if (__BYTE_ORDER == __BIG_ENDIAN)
+	unsigned char   __pad0b[6];
+	unsigned short	st_dev;
+#elif (__BYTE_ORDER == __LITTLE_ENDIAN)
+	unsigned short	st_dev;
+	unsigned char	__pad0b[6];
+#else
+#error Must know endian to build stat64 structure!
+#endif
+	unsigned char	__pad0[4];
+
+	unsigned long	st_ino;
+	unsigned int	st_mode;
+	unsigned int	st_nlink;
+
+	unsigned long	st_uid;
+	unsigned long	st_gid;
+
+#if (__BYTE_ORDER == __BIG_ENDIAN)
+	unsigned char	__pad3b[6];
+	unsigned short	st_rdev;
+#else /* Must be little */
+	unsigned short	st_rdev;
+	unsigned char	__pad3b[6];
+#endif
+	unsigned char	__pad3[4];
+
+	long long	st_size;
+	unsigned long	st_blksize;
+
+#if (__BYTE_ORDER == __BIG_ENDIAN)
+	unsigned long	__pad4;		/* Future possible st_blocks hi bits */
+	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
+#else /* Must be little */
+	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
+	unsigned long	__pad4;		/* Future possible st_blocks hi bits */
+#endif
+
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+
+	unsigned long	__unused1;
+	unsigned long	__unused2;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/kernel_types.h
new file mode 100644
index 0000000..ac97261
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/kernel_types.h
@@ -0,0 +1,47 @@
+/* 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
+ */
+#if !defined __ASM_SH_POSIX_TYPES_H && !defined __ASM_SH_POSIX_TYPES_32_H
+#define __ASM_SH_POSIX_TYPES_H
+#define __ASM_SH_POSIX_TYPES_32_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 __kernel_dev_t	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+typedef long long	__kernel_loff_t;
+
+typedef struct {
+#ifdef __USE_ALL
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* __ASM_SH_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/mathdef.h
new file mode 100644
index 0000000..70315dd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/mathdef.h
@@ -0,0 +1,49 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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
+
+
+/* FIXME! This file describes properties of the compiler, not the machine;
+   it should not be part of libc!
+
+   FIXME! This file does not deal with the -fshort-double option of
+   gcc! */
+
+#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
+# define _MATH_H_MATHDEF	1
+
+/* SH has both `float' and `double' arithmetic.  */
+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	0x80000001
+# define FP_ILOGBNAN	0x7fffffff
+
+#endif	/* ISO C99 */
+
+#ifndef __NO_LONG_DOUBLE_MATH
+/* Signal that we do not really have a `long double'.  The disables the
+   declaration of all the `long double' function variants.  */
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/setjmp.h
new file mode 100644
index 0000000..6458dfe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/setjmp.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 1999, 2000, 2003, 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.  */
+
+/* Define the machine-dependent type `jmp_buf'.  SH 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
+typedef struct
+  {
+    /* Callee-saved registers r8 through r15.  */
+    int __regs[8];
+
+    /* Program counter.  */
+    void * __pc;
+
+    /* The global pointer.  */
+    void * __gbr;
+
+    /* Floating point status register.  */
+    int __fpscr;
+
+    /* Callee-saved floating point registers fr12 through fr15.  */
+    int __fpregs[4];
+  } __jmp_buf[1];
+#endif
+
+#if defined __USE_MISC || defined _ASM
+# define JB_SIZE		(4 * 15)
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[0].__regs[7])
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/shm.h
new file mode 100644
index 0000000..ccf4b89
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/shm.h
@@ -0,0 +1,109 @@
+/* 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.  */
+/*
+ * XXX: This is misleading, SH-4 and SH-3 7705 in 32kb mode have dcache
+ * aliases to contend with in the 4k page case. This is not an issue for
+ * the other parts. Leave this bumped up for sanity until this can be
+ * accurately defined by the L1D shape through the auxiliary vector.
+ */
+#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/sh/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/sigcontextinfo.h
new file mode 100644
index 0000000..3e1f3e9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/sigcontextinfo.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 1999, 2000 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.  */
+
+#define SIGCONTEXT int _a2, int _a3, int _a4, struct sigcontext
+
+#define SIGCONTEXT_EXTRA_ARGS _a2, _a3, _a4,
+#define GET_PC(ctx)	((void *) ctx.sc_pc)
+#define GET_FRAME(ctx)	((void *) ctx.sc_regs[14])
+#define GET_STACK(ctx)	((void *) ctx.sc_regs[15])
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/stackinfo.h
new file mode 100644
index 0000000..e65338f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/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 SH the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/syscalls.h
new file mode 100644
index 0000000..b308276
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/syscalls.h
@@ -0,0 +1,135 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+/* The Linux kernel uses different trap numbers on sh-2.  */
+#if defined __sh2__ || defined __SH2A__
+# define __SH_SYSCALL_TRAP_BASE 0x20
+#else
+# define __SH_SYSCALL_TRAP_BASE 0x10
+#endif
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+#define SYSCALL_INST_STR(x)	"trapa #"__stringify(__SH_SYSCALL_TRAP_BASE + x)"\n\t"
+#define SYSCALL_INST_STR0	SYSCALL_INST_STR(0)
+#define SYSCALL_INST_STR1	SYSCALL_INST_STR(1)
+#define SYSCALL_INST_STR2	SYSCALL_INST_STR(2)
+#define SYSCALL_INST_STR3	SYSCALL_INST_STR(3)
+#define SYSCALL_INST_STR4	SYSCALL_INST_STR(4)
+#define SYSCALL_INST_STR5	SYSCALL_INST_STR(5)
+#define SYSCALL_INST_STR6	SYSCALL_INST_STR(6)
+
+# ifdef NEED_SYSCALL_INST_PAD
+#  define SYSCALL_INST_PAD "\
+	or r0,r0; or r0,r0; or r0,r0; or r0,r0; or r0,r0"
+# else
+#  define SYSCALL_INST_PAD
+# endif
+
+#define ASMFMT_0
+#define ASMFMT_1 \
+	, "r" (r4)
+#define ASMFMT_2 \
+	, "r" (r4), "r" (r5)
+#define ASMFMT_3 \
+	, "r" (r4), "r" (r5), "r" (r6)
+#define ASMFMT_4 \
+	, "r" (r4), "r" (r5), "r" (r6), "r" (r7)
+#define ASMFMT_5 \
+	, "r" (r4), "r" (r5), "r" (r6), "r" (r7), "0" (r0)
+#define ASMFMT_6 \
+	, "r" (r4), "r" (r5), "r" (r6), "r" (r7), "0" (r0), "r" (r1)
+#define ASMFMT_7 \
+	, "r" (r4), "r" (r5), "r" (r6), "r" (r7), "0" (r0), "r" (r1), "r" (r2)
+
+#define SUBSTITUTE_ARGS_0()
+#define SUBSTITUTE_ARGS_1(arg1) \
+	long int _arg1 = (long int) (arg1);				      \
+	register long int r4 __asm__ ("%r4") = (long int) (_arg1)
+#define SUBSTITUTE_ARGS_2(arg1, arg2) \
+	long int _arg1 = (long int) (arg1);				      \
+	long int _arg2 = (long int) (arg2);				      \
+	register long int r4 __asm__ ("%r4") = (long int) (_arg1);		      \
+	register long int r5 __asm__ ("%r5") = (long int) (_arg2)
+#define SUBSTITUTE_ARGS_3(arg1, arg2, arg3) \
+	long int _arg1 = (long int) (arg1);				      \
+	long int _arg2 = (long int) (arg2);				      \
+	long int _arg3 = (long int) (arg3);				      \
+	register long int r4 __asm__ ("%r4") = (long int) (_arg1);		      \
+	register long int r5 __asm__ ("%r5") = (long int) (_arg2);		      \
+	register long int r6 __asm__ ("%r6") = (long int) (_arg3)
+#define SUBSTITUTE_ARGS_4(arg1, arg2, arg3, arg4) \
+	long int _arg1 = (long int) (arg1);				      \
+	long int _arg2 = (long int) (arg2);				      \
+	long int _arg3 = (long int) (arg3);				      \
+	long int _arg4 = (long int) (arg4);				      \
+	register long int r4 __asm__ ("%r4") = (long int) (_arg1);		      \
+	register long int r5 __asm__ ("%r5") = (long int) (_arg2);		      \
+	register long int r6 __asm__ ("%r6") = (long int) (_arg3);		      \
+	register long int r7 __asm__ ("%r7") = (long int) (_arg4)
+#define SUBSTITUTE_ARGS_5(arg1, arg2, arg3, arg4, arg5) \
+	long int _arg1 = (long int) (arg1);				      \
+	long int _arg2 = (long int) (arg2);				      \
+	long int _arg3 = (long int) (arg3);				      \
+	long int _arg4 = (long int) (arg4);				      \
+	long int _arg5 = (long int) (arg5);				      \
+	register long int r4 __asm__ ("%r4") = (long int) (_arg1);		      \
+	register long int r5 __asm__ ("%r5") = (long int) (_arg2);		      \
+	register long int r6 __asm__ ("%r6") = (long int) (_arg3);		      \
+	register long int r7 __asm__ ("%r7") = (long int) (_arg4);		      \
+	register long int r0 __asm__ ("%r0") = (long int) (_arg5)
+#define SUBSTITUTE_ARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
+	long int _arg1 = (long int) (arg1);				      \
+	long int _arg2 = (long int) (arg2);				      \
+	long int _arg3 = (long int) (arg3);				      \
+	long int _arg4 = (long int) (arg4);				      \
+	long int _arg5 = (long int) (arg5);				      \
+	long int _arg6 = (long int) (arg6);				      \
+	register long int r4 __asm__ ("%r4") = (long int)(_arg1);		      \
+	register long int r5 __asm__ ("%r5") = (long int) (_arg2);		      \
+	register long int r6 __asm__ ("%r6") = (long int) (_arg3);		      \
+	register long int r7 __asm__ ("%r7") = (long int) (_arg4);		      \
+	register long int r0 __asm__ ("%r0") = (long int) (_arg5);		      \
+	register long int r1 __asm__ ("%r1") = (long int) (_arg6)
+#define SUBSTITUTE_ARGS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
+	long int _arg1 = (long int) (arg1);				      \
+	long int _arg2 = (long int) (arg2);				      \
+	long int _arg3 = (long int) (arg3);				      \
+	long int _arg4 = (long int) (arg4);				      \
+	long int _arg5 = (long int) (arg5);				      \
+	long int _arg6 = (long int) (arg6);				      \
+	long int _arg7 = (long int) (arg7);				      \
+	register long int r4 __asm__ ("%r4") = (long int) (_arg1);		      \
+	register long int r5 __asm__ ("%r5") = (long int) (_arg2);		      \
+	register long int r6 __asm__ ("%r6") = (long int) (_arg3);		      \
+	register long int r7 __asm__ ("%r7") = (long int) (_arg4);		      \
+	register long int r0 __asm__ ("%r0") = (long int) (_arg5);		      \
+	register long int r1 __asm__ ("%r1") = (long int) (_arg6);		      \
+	register long int r2 __asm__ ("%r2") = (long int) (_arg7)
+
+/* The _NCS variant allows non-constant syscall numbers.  */
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+(__extension__ \
+  ({															\
+    unsigned long int resultvar;								\
+    register long int r3 __asm__ ("%r3") = (name);				\
+    SUBSTITUTE_ARGS_##nr(args);									\
+    __asm__ __volatile__ (SYSCALL_INST_STR##nr SYSCALL_INST_PAD	\
+		  : "=z" (resultvar)									\
+		  : "r" (r3) ASMFMT_##nr								\
+		  : "memory"											\
+    );															\
+    (int) resultvar;											\
+   }) \
+)
+#define INTERNAL_SYSCALL_ERROR_P(val, err) \
+  ((unsigned int) (val) >= 0xfffff001u)
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..5e3528d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/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 */
+#ifdef __sh2__
+# define __UCLIBC_ABORT_INSTRUCTION__ "trapa #32"
+#else
+# define __UCLIBC_ABORT_INSTRUCTION__ "trapa #0xff"
+#endif
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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 */
+#define __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/sh/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/sh/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/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/sh/brk.c b/ap/build/uClibc/libc/sysdeps/linux/sh/brk.c
new file mode 100644
index 0000000..a98cd54
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/brk.c
@@ -0,0 +1,27 @@
+/* From libc-5.3.12 */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+extern void * __curbrk attribute_hidden;
+extern int __init_brk (void) attribute_hidden;
+extern void *_brk(void *ptr) attribute_hidden;
+
+int brk(void * end_data_seg)
+{
+    if (__init_brk () == 0)
+    {
+		__curbrk = _brk(end_data_seg);
+		if (__curbrk == end_data_seg)
+			return 0;
+		__set_errno(ENOMEM);
+    }
+    return -1;
+}
+libc_hidden_def(brk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/cacheflush.c b/ap/build/uClibc/libc/sysdeps/linux/sh/cacheflush.c
new file mode 100644
index 0000000..5822918
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/cacheflush.c
@@ -0,0 +1,15 @@
+/*
+ * cacheflush syscall for SUPERH
+ *
+ * Copyright (C) 2009 STMicroelectronics Ltd
+ * Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_cacheflush
+_syscall3(int, cacheflush, char *, addr, int, nbytes, int, op)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/clone.S b/ap/build/uClibc/libc/sysdeps/linux/sh/clone.S
new file mode 100644
index 0000000..423a6c2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/clone.S
@@ -0,0 +1,134 @@
+/* Copyright (C) 1999, 2000, 2003, 2004, 2007 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.  */
+
+/* clone() is even more special than fork() as it mucks with stacks
+   and invokes a function in the right context after its all over.  */
+
+#include <features.h>
+#include <asm/unistd.h>
+#include <sysdep.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+#ifdef RESET_PID
+#include <tcb-offsets.h>
+#endif
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
+	     pid_t *ptid, void *tls, pid_t *ctid); */
+
+	.text
+ENTRY(__clone)
+	/* sanity check arguments.  */
+	tst	r4, r4
+	bt/s	0f
+	 tst	r5, r5
+	bf	1f
+0:
+	bra	.Lsyscall_error
+	 mov	#-EINVAL,r0
+1:
+	/* insert the args onto the new stack */
+	mov.l	r7, @-r5
+	/* save the function pointer as the 0th element */
+	mov.l	r4, @-r5
+
+	/* do the system call */
+	mov	r6, r4
+	mov.l	@r15, r6
+	mov.l	@(8,r15), r7
+	mov.l	@(4,r15), r0
+	mov	#+SYS_ify(clone), r3
+	trapa	#0x15
+	mov     r0, r1
+	mov	#-12, r2
+	shad	r2, r1
+	not	r1, r1			// r1=0 means r0 = -1 to -4095
+	tst	r1, r1			// i.e. error in linux
+	bf	.Lclone_end
+.Lsyscall_error:
+	SYSCALL_ERROR_HANDLER
+.Lclone_end:
+	tst	r0, r0
+	bt	2f
+.Lpseudo_end:
+	rts
+	 nop
+2:
+	/* terminate the stack frame */
+	mov	#0, r14
+#ifdef RESET_PID
+	mov	r4, r0
+	shlr16	r0
+	tst	#1, r0			// CLONE_THREAD = (1 << 16)
+	bf/s	4f
+	 mov	r4, r0
+	/* new pid */
+	shlr8	r0
+	tst	#1, r0			// CLONE_VM = (1 << 8)
+	bf/s	3f
+	 mov	#-1, r0
+	mov	#+SYS_ify(getpid), r3
+	trapa	#0x15
+3:
+	stc	gbr, r1
+	mov.w	.Lpidoff, r2
+	add	r1, r2
+	mov.l	r0, @r2
+	mov.w	.Ltidoff, r2
+	add	r1, r2
+	mov.l	r0, @r2
+4:
+#endif
+	/* thread starts */
+	mov.l	@r15, r1
+	jsr	@r1
+	 mov.l	@(4,r15), r4
+
+	/* we are done, passing the return value through r0  */
+	mov.l	.L3, r1
+#ifdef SHARED
+	mov.l	r12, @-r15
+	sts.l	pr, @-r15
+	mov	r0, r4
+	mova	.LG, r0
+	mov.l	.LG, r12
+	add	r0, r12
+	mova	.L3, r0
+	add	r0, r1
+	jsr	@r1
+	 nop
+	lds.l	@r15+, pr
+	rts
+	 mov.l	@r15+, r12
+#else
+	jmp	@r1
+	 mov	r0, r4
+#endif
+	.align	2
+.LG:
+	.long	_GLOBAL_OFFSET_TABLE_
+.L3:
+	.long	PLTJMP(C_SYMBOL_NAME(_exit))
+#ifdef RESET_PID
+.Lpidoff:
+	.word	PID - TLS_PRE_TCB_SIZE
+.Ltidoff:
+	.word	TID - TLS_PRE_TCB_SIZE
+#endif
+PSEUDO_END (__clone)
+
+weak_alias (__clone, clone)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/sh/crt1.S
new file mode 100644
index 0000000..9707f83
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/crt1.S
@@ -0,0 +1,142 @@
+/* Startup code for SH & ELF.
+   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 2001 Hewlett-Packard Australia
+   Copyright (C) 2002 Stefan Allius
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Library General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+ details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.
+
+	At this entry point, most registers' values are unspecified, except:
+
+   r4	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
+*/
+
+#include <features.h>
+
+	.text
+	.globl _start
+	.type _start,%function
+	.type main,%function
+_start:
+	/* Clear the frame pointer since this is the outermost frame. */
+	mov #0, r14
+
+	/* Pop argc off the stack and save a pointer to argv */
+	mov.l @r15+,r5
+	mov r15, r6
+
+	/* Push the stack_end, rtld_fini and fini func onto the stack */
+	mov.l r6,@-r15
+	mov.l r4,@-r15
+
+#ifdef __PIC__
+	mova  L_got, r0
+	mov.l L_got, r12
+	add r0, r12
+
+	mov.l L_fini,r0
+	add r12, r0
+	mov.l r0,@-r15
+
+	/* Set up the main/init funcs that go in registers */
+	mov.l L_main, r4
+	add r12, r4
+	mov.l L_init, r7
+	add r12, r7
+
+	/* __uClibc_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
+
+	/* Let the libc call main and exit with its return code.  */
+	mov.l L_uClibc_main,r0
+	mov.l @(r0,r12),r1
+	jsr @r1
+	nop
+	/* We should not get here. */
+	mov.l L_abort,r0
+	mov.l @(r0,r12),r1
+	jsr @r1
+	nop
+#else
+	mov.l L_fini,r0
+	mov.l r0,@-r15
+
+	/* Set up the main/init funcs that go in registers */
+	mov.l L_main,r4
+	mov.l L_init,r7
+
+	/* __uClibc_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
+
+	/* Let the libc call main and exit with its return code.  */
+	mov.l L_uClibc_main,r1
+	jsr @r1
+	nop
+	/* We should not get here. */
+	mov.l L_abort,r1
+	jmp @r1
+	nop
+#endif
+
+	.size _start,.-_start
+	.align	2
+
+#ifdef __PIC__
+L_got:
+	.long	_GLOBAL_OFFSET_TABLE_
+L_main:
+	.long	main@GOTOFF
+L_init:
+	.long   _init@GOTOFF
+L_fini:
+	.long   _fini@GOTOFF
+L_uClibc_main:
+	.long   __uClibc_main@GOT
+L_abort:
+	.long   abort@GOT
+#else
+L_main:
+	.long   main
+L_init:
+	.long   _init
+L_fini:
+	.long   _fini
+L_uClibc_main:
+	.long   __uClibc_main
+L_abort:
+	.long   abort
+#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/sh/crti.S b/ap/build/uClibc/libc/sysdeps/linux/sh/crti.S
new file mode 100644
index 0000000..7fba266
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/crti.S
@@ -0,0 +1,32 @@
+	.file	"crti.S"
+	.text
+	
+	.section .init
+	.hidden  _init
+	.align 1
+	.global	_init
+	.type	_init, @function
+_init:
+	mov.l	r12,@-r15
+	mov.l	r14,@-r15
+	sts.l	pr,@-r15
+	mov	r15,r14
+	bra	1f
+	 nop
+	.align 2
+1:
+	
+	.section .fini
+	.hidden  _fini
+	.align 1
+	.global	_fini
+	.type	_fini, @function
+_fini:
+	mov.l	r12,@-r15
+	mov.l	r14,@-r15
+	sts.l	pr,@-r15
+	mov	r15,r14
+	bra	1f
+	 nop
+	.align 2
+1:
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/sh/crtn.S
new file mode 100644
index 0000000..e8be7e5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/crtn.S
@@ -0,0 +1,34 @@
+	.file	"crtn.S"
+	.text
+	
+	.section .init
+	.hidden  _init
+	.align 1
+	.global	_init
+	.type	_init, @function
+	mov	r14,r15
+	lds.l	@r15+,pr
+	mov.l	@r15+,r14
+	rts	
+	mov.l	@r15+,r12
+.L8:
+	.align 2
+.L6:
+.L7:
+	
+	.section .fini
+	.hidden  _fini
+	.align 1
+	.global	_fini
+	.type	_fini, @function
+	mov	r14,r15
+	lds.l	@r15+,pr
+	mov.l	@r15+,r14
+	rts	
+	mov.l	@r15+,r12
+.L13:
+	.align 2
+.L11:
+.L12:
+	
+	.ident	"GCC: (GNU) 3.3.2"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/sh/fpu_control.h
new file mode 100644
index 0000000..da01725
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/fpu_control.h
@@ -0,0 +1,64 @@
+/* FPU control word definitions.  SH version.
+   Copyright (C) 1999, 2000, 2009 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
+
+#ifndef __SH4__
+#error This file is only correct for sh4
+#endif
+
+/* masking of interrupts */
+#define _FPU_MASK_VM	0x0800	/* Invalid operation */
+#define _FPU_MASK_ZM	0x0400	/* Division by zero  */
+#define _FPU_MASK_OM	0x0200	/* Overflow	     */
+#define _FPU_MASK_UM	0x0100	/* Underflow	     */
+#define _FPU_MASK_IM	0x0080	/* Inexact operation */
+
+/* rounding control */
+#define _FPU_RC_NEAREST 0x0	/* RECOMMENDED */
+#define _FPU_RC_ZERO	0x1
+
+#define _FPU_RESERVED 0xffc00000  /* These bits are reserved.  */
+
+/* The fdlibm code requires strict IEEE double precision arithmetic,
+   and no interrupts for exceptions, rounding to nearest.  */
+#define _FPU_DEFAULT	0x00080000 /* Default value.  */
+#define _FPU_IEEE	0x00080f80 /* 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__ ("sts fpscr,%0" : "=r" (cw))
+
+#if defined __GNUC__
+/* GCC provides this function */
+extern void __set_fpscr (unsigned long);
+#define _FPU_SETCW(cw) __set_fpscr ((cw))
+#else
+#define _FPU_SETCW(cw) __asm__ ("lds %0,fpscr" : : "r" (cw))
+#endif
+
+#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/sh/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/sh/mmap.c
new file mode 100644
index 0000000..b14181c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/mmap.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 2001 Hewlett-Packard
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Library General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+ details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Derived in part from the Linux-8086 C library, the GNU C Library, and several
+ other sundry sources.  Files within this library are copyright by their
+ respective copyright holders.
+*/
+
+#include <unistd.h>
+#include <errno.h>
+#include <sys/mman.h>
+
+
+#ifdef HIOS
+# define __SH_SYSCALL6_TRAPA 0x2E
+#endif
+
+#include <sys/syscall.h>
+
+_syscall6(__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, __off_t, offset)
+libc_hidden_def(mmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/pipe.c b/ap/build/uClibc/libc/sysdeps/linux/sh/pipe.c
new file mode 100644
index 0000000..799f518
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/pipe.c
@@ -0,0 +1,39 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * pipe syscall for uClibc sh
+ *
+ * Copyright (C) 2001 Lineo, <davidm@lineo.com>
+ * 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 <unistd.h>
+#include <syscall.h>
+
+
+int pipe(int *fd)
+{
+	long __res, __res2;
+	__asm__ __volatile__ (
+	"mov	%2,	r3;"
+	"mov	%3,	r4;"
+	"trapa	%4;"
+	"mov    r1, %1;"
+	   : "=z" (__res),
+	     "=r" ((long) __res2)
+	   : "r" ((long) __NR_pipe),
+	     "r" ((long) fd),
+		 "i" (__SH_SYSCALL_TRAP_BASE + 3)
+	   : "cc", "memory", "r1", "r3", "r4");
+	if ((unsigned long)(__res) >= (unsigned long)(-125)) {
+		int __err = -(__res);
+		errno = __err;
+		return(-1);
+	}
+	fd[0] = __res;
+	fd[1] = __res2;
+	return(0);
+}
+libc_hidden_def(pipe)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/pread_write.c b/ap/build/uClibc/libc/sysdeps/linux/sh/pread_write.c
new file mode 100644
index 0000000..86feb9c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/pread_write.c
@@ -0,0 +1,125 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/*
+ * Based in part on the files
+ *		./sysdeps/unix/sysv/linux/pwrite.c,
+ *		./sysdeps/unix/sysv/linux/pread.c,
+ *		sysdeps/posix/pread.c
+ *		sysdeps/posix/pwrite.c
+ * from GNU libc 2.2.5, but reworked considerably...
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <endian.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+
+#ifdef __NR_pread64             /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pread
+#  error "__NR_pread and __NR_pread64 both defined???"
+# endif
+# define __NR_pread __NR_pread64
+#endif
+
+#ifdef __NR_pread
+extern __typeof(pread) __libc_pread;
+# define __NR___syscall_pread __NR_pread
+static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf,
+		size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	if (SINGLE_THREAD_P)
+		return(__syscall_pread(fd,buf,count,0,__LONG_LONG_PAIR(offset >> 31,offset)));
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	ssize_t result = __syscall_pread(fd,buf,count,0,__LONG_LONG_PAIR(offset >> 31,offset));
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+weak_alias(__libc_pread,pread)
+
+# ifdef __UCLIBC_HAS_LFS__
+extern __typeof(pread64) __libc_pread64;
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
+{
+	uint32_t low = offset & 0xffffffff;
+	uint32_t high = offset >> 32;
+
+	if (SINGLE_THREAD_P)
+		return __syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR (high, low));
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	ssize_t result = __syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR (high, low));
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+weak_alias(__libc_pread64,pread64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* __NR_pread */
+
+/**********************************************************************/
+
+#ifdef __NR_pwrite64            /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pwrite
+#  error "__NR_pwrite and __NR_pwrite64 both defined???"
+# endif
+# define __NR_pwrite __NR_pwrite64
+#endif
+
+#ifdef __NR_pwrite
+extern __typeof(pwrite) __libc_pwrite;
+# define __NR___syscall_pwrite __NR_pwrite
+static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf,
+		size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+	if (SINGLE_THREAD_P)
+		return __syscall_pwrite(fd,buf,count,0,__LONG_LONG_PAIR(offset >> 31,offset));
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	ssize_t result = __syscall_pwrite(fd,buf,count,0,__LONG_LONG_PAIR(offset >> 31,offset));
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+
+}
+weak_alias(__libc_pwrite,pwrite)
+
+# ifdef __UCLIBC_HAS_LFS__
+extern __typeof(pwrite64) __libc_pwrite64;
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
+{
+	uint32_t low = offset & 0xffffffff;
+	uint32_t high = offset >> 32;
+
+	if (SINGLE_THREAD_P)
+		return __syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR (high, low));
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	ssize_t result = __syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR (high, low));
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+weak_alias(__libc_pwrite64,pwrite64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* __NR_pwrite */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/sbrk.c b/ap/build/uClibc/libc/sysdeps/linux/sh/sbrk.c
new file mode 100644
index 0000000..2dc719a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/sbrk.c
@@ -0,0 +1,25 @@
+/* From libc-5.3.12 */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+extern void * __curbrk attribute_hidden;
+extern int __init_brk (void) attribute_hidden;
+extern void *_brk(void *ptr) attribute_hidden;
+
+void *
+sbrk(intptr_t increment)
+{
+    if (__init_brk () == 0)
+    {
+		char * tmp = (char*)__curbrk+increment;
+		__curbrk = _brk(tmp);
+		if (__curbrk == tmp)
+			return tmp-increment;
+		__set_errno(ENOMEM);
+		return ((void *) -1);
+    }
+    return ((void *) -1);
+}
+libc_hidden_def(sbrk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/sh/setjmp.S
new file mode 100644
index 0000000..0a81424
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/setjmp.S
@@ -0,0 +1,102 @@
+/* setjmp for SH3.
+   Copyright (C) 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <features.h>
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+	.text
+
+/* 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.  */
+
+	.align 4
+	.type	_setjmp,@function
+	.globl	_setjmp;
+_setjmp:
+	bra	__sigsetjmp_intern
+	 mov	#0, r1
+	.size _setjmp,.-_setjmp;
+
+/* 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.  */
+
+	.align 4
+	.type	setjmp,@function
+	.globl	setjmp;
+setjmp:	
+	bra	__sigsetjmp_intern
+	 mov	#1, r1
+	.size setjmp,.-setjmp;
+	
+	.align 4
+	.type	__sigsetjmp,@function
+	.globl	__sigsetjmp;
+__sigsetjmp:
+	mov     r0, r1
+	nop		/* align this guy */
+__sigsetjmp_intern:
+	/* Save registers */
+#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+	add	#(JB_SIZE), r4
+	fmov.s	fr15, @-r4
+	fmov.s	fr14, @-r4
+	fmov.s	fr13, @-r4
+	fmov.s	fr12, @-r4
+	sts.l   fpscr, @-r4
+#else
+	add	#(JB_SIZE-(5*4)), r4 /* this code doesn't do FP yet */
+#endif		
+	stc.l	gbr, @-r4
+	sts.l	pr, @-r4
+	mov.l	r15, @-r4
+	mov.l	r14, @-r4
+	mov.l	r13, @-r4
+	mov.l	r12, @-r4
+	mov.l	r11, @-r4
+	mov.l	r10, @-r4
+	mov.l	r9, @-r4
+	mov.l	r8, @-r4
+
+#ifdef __HAVE_SHARED__
+	mov.l	.LG, r2
+	mova	.LG, r0
+	add	r0, r2
+	/* Make a tail call to __sigjmp_save; it takes the same args.  */
+	mov.l	.L1, r0
+	mov.l   @(r0,r2),r0
+	jmp	@r0
+	 mov     r1, r0
+	.align	2
+.LG:	.long	_GLOBAL_OFFSET_TABLE_
+.L1:	.long	__sigjmp_save@GOT
+#else
+	/* Make a tail call to __sigjmp_save; it takes the same args.  */
+	mov.l	.L1, r0
+	braf	r0
+	 mov     r1, r0
+.jmp_loc:		
+	.align	2
+.L1:	.long	__sigjmp_save - .jmp_loc
+#endif	
+
+	.size __sigsetjmp,.-__sigsetjmp;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/sys/io.h b/ap/build/uClibc/libc/sysdeps/linux/sh/sys/io.h
new file mode 100644
index 0000000..f833c4e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/sys/io.h
@@ -0,0 +1,49 @@
+/* Copyright (C) 1996, 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.  */
+
+#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/sh/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/sh/sys/procfs.h
new file mode 100644
index 0000000..aad21e5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/sys/procfs.h
@@ -0,0 +1,126 @@
+/* Copyright (C) 1996, 1997, 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.  */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+
+__BEGIN_DECLS
+
+/*
+ * ELF register definitions...
+ */
+typedef unsigned long elf_greg_t;
+
+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct user_fpu_struct elf_fpregset_t;
+
+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.  Fields present but not used are
+   marked with "XXX".  */
+struct elf_prstatus
+  {
+#if 0
+    long int pr_flags;			/* XXX Process flags.  */
+    short int pr_why;			/* XXX Reason for process halt.  */
+    short int pr_what;			/* XXX More detailed reason.  */
+#endif
+    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.  */
+#if 0
+    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
+    struct sigaction pr_action;		/* Signal action for current sig.  */
+#endif
+    __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.  */
+#if 0
+    long int pr_instr;			/* Current instruction.  */
+#endif
+    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.  */
+    long pr_uid;
+    long 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.  */
+  };
+
+
+/* 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 habe only ine PID type.  */
+typedef __pid_t lwpid_t;
+
+
+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/sh/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/sh/sys/ucontext.h
new file mode 100644
index 0000000..4ed2484
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/sys/ucontext.h
@@ -0,0 +1,121 @@
+/* Copyright (C) 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.  */
+
+/* Where is System V/SH ABI?  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.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 NFPREG	16
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NFPREG];
+
+#ifdef __USE_GNU
+/* 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
+};
+#endif
+
+typedef int freg_t;
+
+/* Number of FPU registers.  */
+#define NFPREG	16
+
+/* Structure to describe FPU registers.  */
+typedef freg_t fpregset_t[NFPREG];
+
+/* Context to describe whole processor state.  */
+typedef struct
+  {
+    unsigned int oldmask;
+
+    /* CPU registers */
+    gregset_t gregs;
+    unsigned int pc;
+    unsigned int pr;
+    unsigned int sr;
+    unsigned int gbr;
+    unsigned int mach;
+    unsigned int macl;
+
+#ifdef __SH4__
+    /* FPU registers */
+    fpregset_t fpregs;
+    fpregset_t xfpregs;
+    unsigned int fpscr;
+    unsigned int fpul;
+    unsigned int ownedfp;
+#endif
+  } mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/sh/sys/user.h
new file mode 100644
index 0000000..91b0091
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/sys/user.h
@@ -0,0 +1,89 @@
+/* Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H	1
+
+#include <unistd.h>
+#include <asm/ptrace.h>
+
+/* asm/ptrace.h polutes the namespace.  */
+#undef PTRACE_GETREGS
+#undef PTRACE_SETREGS
+#undef PTRACE_GETFPREGS
+#undef PTRACE_SETFPREGS
+#undef PTRACE_GETFDPIC
+#undef PTRACE_GETFDPIC_EXEC
+#undef PTRACE_GETFDPIC_INTERP
+#undef PTRACE_GETDSPREGS
+#undef PTRACE_SETDSPREGS
+
+/*
+ * Core file format: The core file is written in such a way that gdb
+ * can understand it and provide useful information to the user (under
+ * linux we use the `trad-core' bfd).  The file contents are as follows:
+ *
+ *  upage: 1 page consisting of a user struct that tells gdb
+ *	what is present in the file.  Directly after this is a
+ *	copy of the task_struct, which is currently not used by gdb,
+ *	but it may come in handy at some point.  All of the registers
+ *	are stored as part of the upage.  The upage should always be
+ *	only one page long.
+ *  data: The data segment follows next.  We use current->end_text to
+ *	current->brk to pick up all of the user variables, plus any memory
+ *	that may have been sbrk'ed.  No attempt is made to determine if a
+ *	page is demand-zero or if a page is totally unused, we just cover
+ *	the entire range.  All of the addresses are rounded in such a way
+ *	that an integral number of pages is written.
+ *  stack: We need the stack information in order to get a meaningful
+ *	backtrace.  We need to write the data from usp to
+ *	current->start_stack, so we round each of these in order to be able
+ *	to write an integer number of pages.
+ */
+
+struct user_fpu_struct {
+	unsigned long fp_regs[16];
+	unsigned long xfp_regs[16];
+	unsigned long fpscr;
+	unsigned long fpul;
+};
+
+struct user {
+	struct pt_regs	regs;			/* entire machine state */
+	struct user_fpu_struct fpu;	/* Math Co-processor registers  */
+	int u_fpvalid;		/* True if math co-processor being used */
+	size_t		u_tsize;		/* text size (pages) */
+	size_t		u_dsize;		/* data size (pages) */
+	size_t		u_ssize;		/* stack size (pages) */
+	unsigned long	start_code;		/* text starting address */
+	unsigned long	start_data;		/* data starting address */
+	unsigned long	start_stack;		/* stack starting address */
+	long int	signal;			/* signal causing core dump */
+	struct regs *	u_ar0;			/* help gdb find registers */
+	struct user_fpu_struct* u_fpstate;	/* Math Co-processor pointer */
+	unsigned long	magic;			/* identifies a core file */
+	char		u_comm[32];		/* user command name */
+};
+
+#define NBPG			getpagesize()
+#define UPAGES			1
+#define HOST_TEXT_START_ADDR	(u.start_code)
+#define HOST_DATA_START_ADDR	(u.start_data)
+#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
+
+#endif  /* sys/user.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/syscall_error.S b/ap/build/uClibc/libc/sysdeps/linux/sh/syscall_error.S
new file mode 100644
index 0000000..7379503
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/syscall_error.S
@@ -0,0 +1,37 @@
+	.align 4
+__syscall_error:
+	/* Call errno_location, store '-r4' in errno and return -1 */
+	mov.l	r12, @-r15
+	sts.l	pr, @-r15
+#ifdef SHARED
+	mova	.LG, r0
+	mov.l	.LG, r12
+	add	r0, r12
+	mov.l	1f, r0
+	mov.l	@(r0,r12),r0
+ 	jsr	@r0
+	 neg	r4, r12
+#else	
+	mov.l	1f, r0
+	bsrf	r0
+	 neg	r4, r12
+.jmp_loc:		
+#endif
+	mov.l	r12, @r0
+	lds.l	@r15+, pr
+	mov.l	@r15+,r12
+
+	/* And just kick back a -1.  */
+	rts
+	 mov	#-1, r0
+
+	.align	4
+
+#ifdef SHARED
+1:	.long   __errno_location@GOT
+.LG:	.long	_GLOBAL_OFFSET_TABLE_
+#else
+1:	.long   __errno_location - .jmp_loc
+#endif		
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/sh/sysdep.h
new file mode 100644
index 0000000..8b3c682
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/sysdep.h
@@ -0,0 +1,297 @@
+/* Assembler macros for SH.
+   Copyright (C) 1999, 2000, 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 <common/sysdep.h>
+
+#include <features.h>
+#include <libc-internal.h>
+
+#ifdef	__ASSEMBLER__
+
+/* Syntactic details of assembler.  */
+
+#define LOCAL(X)	.L_##X
+#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
+
+#ifdef SHARED
+#define PLTJMP(_x)	_x##@PLT
+#else
+#define PLTJMP(_x)	_x
+#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(5);							      \
+  C_LABEL(name)								      \
+  cfi_startproc;							      \
+  CALL_MCOUNT
+
+#undef	END
+#define END(name)							      \
+  cfi_endproc;								      \
+  ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(name))
+
+/* If compiled for profiling, call `mcount' at the start of each function.  */
+#ifdef	PROF
+#define CALL_MCOUNT					\
+	mov.l	1f,r1;					\
+	sts.l	pr,@-r15;				\
+	cfi_adjust_cfa_offset (4);			\
+	cfi_rel_offset (pr, 0);				\
+	mova	2f,r0;					\
+	jmp	@r1;					\
+	 lds	r0,pr;					\
+	.align	2;					\
+1:	.long	mcount;					\
+2:	lds.l	@r15+,pr;				\
+	cfi_adjust_cfa_offset (-4);			\
+	cfi_restore (pr)
+
+#else
+#define CALL_MCOUNT		/* Do nothing.  */
+#endif
+
+#ifdef	__UCLIBC_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
+
+/* 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 SYS_ify(syscall_name)	(__NR_##syscall_name)
+
+#define ret	rts ; nop
+/* The sh move insn is s, d.  */
+#define MOVE(x,y)	mov x , y
+
+/* 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 savely
+   test with -4095.  */
+
+#define _IMM1 #-1
+#define _IMM12 #-12
+#undef	PSEUDO
+#define	PSEUDO(name, syscall_name, args) \
+ .text; \
+ ENTRY (name); \
+    DO_CALL (syscall_name, args); \
+    mov r0,r1; \
+    mov _IMM12,r2; \
+    shad r2,r1; \
+    not r1,r1; \
+    tst r1,r1; \
+    bf .Lpseudo_end; \
+    SYSCALL_ERROR_HANDLER; \
+ .Lpseudo_end:
+
+#undef	PSEUDO_END
+#define	PSEUDO_END(name) \
+  END (name)
+
+#undef	PSEUDO_NOERRNO
+#define	PSEUDO_NOERRNO(name, syscall_name, args) \
+ .text; \
+ ENTRY (name); \
+    DO_CALL (syscall_name, args)
+
+#undef	PSEUDO_END_NOERRNO
+#define	PSEUDO_END_NOERRNO(name) \
+  END (name)
+
+#define ret_NOERRNO ret
+
+#define	PSEUDO_ERRVAL(name, syscall_name, args) \
+ .text; \
+ ENTRY (name); \
+    DO_CALL (syscall_name, args);
+
+#undef	PSEUDO_END_ERRVAL
+#define	PSEUDO_END_ERRVAL(name) \
+  END (name)
+
+#define ret_ERRVAL ret
+
+#ifndef __PIC__
+# define SYSCALL_ERROR_HANDLER	\
+	mov.l 0f,r1; \
+	jmp @r1; \
+	 mov r0,r4; \
+	.align 2; \
+     0: .long __syscall_error
+
+#include <libc/sysdeps/linux/sh/syscall_error.S>
+#else
+# ifdef RTLD_PRIVATE_ERRNO
+
+#  define SYSCALL_ERROR_HANDLER	\
+	neg r0,r1; \
+	mov.l 0f,r12; \
+	mova 0f,r0; \
+	add r0,r12; \
+	mov.l 1f,r0; \
+	mov.l r1,@(r0,r12)
+	bra .Lpseudo_end; \
+	 mov _IMM1,r0; \
+	.align 2; \
+     0: .long _GLOBAL_OFFSET_TABLE_; \
+     1: .long rtld_errno@GOTOFF
+
+# elif defined _LIBC_REENTRANT
+
+#  if defined USE___THREAD
+
+#   ifndef NOT_IN_libc
+#    define SYSCALL_ERROR_ERRNO __libc_errno
+#   else
+#    define SYSCALL_ERROR_ERRNO errno
+#   endif
+#   define SYSCALL_ERROR_HANDLER \
+	neg r0,r1; \
+	mov r12,r2; \
+	mov.l 0f,r12; \
+	mova 0f,r0; \
+	add r0,r12; \
+	mov.l 1f,r0; \
+	stc gbr, r4; \
+	mov.l @(r0,r12),r0; \
+	bra .Lskip; \
+	add r4,r0; \
+	.align 2; \
+	1: .long SYSCALL_ERROR_ERRNO@GOTTPOFF; \
+	.Lskip: \
+	mov r2,r12; \
+	mov.l r1,@r0; \
+	bra .Lpseudo_end; \
+	mov _IMM1,r0; \
+	.align 2; \
+	0: .long _GLOBAL_OFFSET_TABLE_
+#  else
+
+#   define SYSCALL_ERROR_HANDLER \
+	neg r0,r1; \
+	mov.l r14,@-r15; \
+	mov.l r12,@-r15; \
+	mov.l r1,@-r15; \
+	mov.l 0f,r12; \
+	mova 0f,r0; \
+	add r0,r12; \
+	sts.l pr,@-r15; \
+	mov r15,r14; \
+	mov.l 1f,r1; \
+	bsrf r1; \
+         nop; \
+     2: mov r14,r15; \
+	lds.l @r15+,pr; \
+	mov.l @r15+,r1; \
+	mov.l r1,@r0; \
+	mov.l @r15+,r12; \
+	mov.l @r15+,r14; \
+	bra .Lpseudo_end; \
+	 mov _IMM1,r0; \
+	.align 2; \
+     0: .long _GLOBAL_OFFSET_TABLE_; \
+     1: .long PLTJMP(C_SYMBOL_NAME(__errno_location))-(2b-.)
+/* A quick note: it is assumed that the call to `__errno_location' does
+   not modify the stack!  */
+#  endif
+# else
+
+/* Store (-r0) into errno through the GOT.  */
+#  define SYSCALL_ERROR_HANDLER						      \
+	neg r0,r1; \
+	mov r12,r2; \
+	mov.l 0f,r12; \
+	mova 0f,r0; \
+	add r0,r12; \
+	mov.l 1f,r0; \
+	mov.l @(r0,r12),r0; \
+	mov r2,r12; \
+	mov.l r1,@r0; \
+	bra .Lpseudo_end; \
+	 mov _IMM1,r0; \
+	.align 2; \
+     0: .long _GLOBAL_OFFSET_TABLE_; \
+     1: .long errno@GOT
+# endif	/* _LIBC_REENTRANT */
+#endif	/* __PIC__ */
+
+# ifdef __SH4__
+#  define SYSCALL_INST_PAD \
+	or r0,r0; or r0,r0; or r0,r0; or r0,r0; or r0,r0
+# else
+#  define SYSCALL_INST_PAD
+# endif
+
+#define SYSCALL_INST0	trapa #0x10
+#define SYSCALL_INST1	trapa #0x11
+#define SYSCALL_INST2	trapa #0x12
+#define SYSCALL_INST3	trapa #0x13
+#define SYSCALL_INST4	trapa #0x14
+#define SYSCALL_INST5	mov.l @(0,r15),r0; trapa #0x15
+#define SYSCALL_INST6	mov.l @(0,r15),r0; mov.l @(4,r15),r1; trapa #0x16
+
+#undef	DO_CALL
+#define DO_CALL(syscall_name, args)	\
+    mov.l 1f,r3;			\
+    SYSCALL_INST##args;			\
+    SYSCALL_INST_PAD;			\
+    bra 2f;				\
+     nop;				\
+    .align 2;				\
+ 1: .long SYS_ify (syscall_name);	\
+ 2:
+#endif	/* __ASSEMBLER__ */
+
+/* Pointer mangling support.  */
+#if defined NOT_IN_libc && defined IS_IN_rtld
+/* We cannot use the thread descriptor because in ld.so we use setjmp
+   earlier than the descriptor is initialized.  Using a global variable
+   is too complicated here since we have no PC-relative addressing mode.  */
+#else
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE(reg, tmp) \
+     stc gbr,tmp; mov.l @(POINTER_GUARD,tmp),tmp; xor tmp,reg
+#  define PTR_MANGLE2(reg, tmp)	xor tmp,reg
+#  define PTR_DEMANGLE(reg, tmp)	PTR_MANGLE (reg, tmp)
+#  define PTR_DEMANGLE2(reg, tmp)	PTR_MANGLE2 (reg, tmp)
+# else
+#  define PTR_MANGLE(var) \
+     (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
+#  define PTR_DEMANGLE(var)	PTR_MANGLE (var)
+# endif
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/sh/vfork.S
new file mode 100644
index 0000000..d311bff
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh/vfork.S
@@ -0,0 +1,114 @@
+/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 2001 Hewlett-Packard Australia
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Library General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+ details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Derived in part from the Linux-8086 C library, the GNU C Library, and several
+ other sundry sources.  Files within this library are copyright by their
+ respective copyright holders.
+*/
+
+#include <features.h>
+#include <sys/syscall.h>
+#define _ERRNO_H
+#include <bits/errno.h>
+#include <bits/sysnum.h>
+
+/* Clone the calling process, but without copying the whole address space.
+   The calling process is suspended until the new process exits or is
+   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
+   and the process ID of the new process to the old process.  */
+
+.text
+.globl	__vfork
+.hidden	__vfork
+.type	__vfork,@function
+.align 4
+
+__vfork:
+	mov.w	.L2, r3
+	trapa	#__SH_SYSCALL_TRAP_BASE
+	mov     r0, r1
+#ifdef __sh2__
+/* 12 arithmetic shifts for the crappy sh2, because shad doesn't exist!	 */
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+#else
+	mov	#-12, r2
+	shad	r2, r1
+#endif
+
+	not	r1, r1			/* r1=0 means r0 = -1 to -4095 */
+	tst	r1, r1			/* i.e. error in linux */
+	bf	2f
+	mov.w	.L1, r1
+	cmp/eq	r1, r0
+	bf/s	__syscall_error
+	 mov	r0, r4
+
+	/* If we don't have vfork, use fork.  */
+	mov.w	.L3, r3
+	trapa	#__SH_SYSCALL_TRAP_BASE
+	mov     r0, r1
+#ifdef __sh2__
+/* 12 arithmetic shifts for the crappy sh2, because shad doesn't exist!	 */
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+	shar	r1
+#else
+	mov	#-12, r2
+	shad	r2, r1
+#endif
+
+	not	r1, r1			/* r1=0 means r0 = -1 to -4095 */
+	tst	r1, r1			/* i.e. error in linux */
+	bt/s	__syscall_error
+	 mov	r0, r4
+2:
+	rts
+	 nop
+
+	.align	2
+.L1:
+	.word	-ENOSYS
+.L2:
+	.word	__NR_vfork
+.L3:
+	.word	__NR_fork
+
+.size   __vfork, .-__vfork
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
+
+#include "syscall_error.S"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/Makefile b/ap/build/uClibc/libc/sysdeps/linux/sh64/Makefile
new file mode 100644
index 0000000..ecbf142
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/Makefile
@@ -0,0 +1,15 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2001 SuperH (UK) Ltd.
+# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.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
+TOPDIR=../../../../
+include $(TOPDIR)Rules.mak
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/sh64/Makefile.arch
new file mode 100644
index 0000000..4e12532
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/Makefile.arch
@@ -0,0 +1,10 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2008 Paul Mundt <lethal@linux-sh.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+CSRC := __init_brk.c brk.c sbrk.c syscall.c
+
+SSRC := setjmp.S __longjmp.S
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/__init_brk.c b/ap/build/uClibc/libc/sysdeps/linux/sh64/__init_brk.c
new file mode 100644
index 0000000..8a41eb3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/__init_brk.c
@@ -0,0 +1,26 @@
+/* From libc-5.3.12 */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+void * __curbrk attribute_hidden = 0;
+
+#define __NR__brk __NR_brk
+attribute_hidden _syscall1(void *, _brk, void *, ptr)
+
+extern int __init_brk (void) attribute_hidden;
+int
+__init_brk (void)
+{
+    if (__curbrk == 0)
+    {
+		__curbrk = _brk(0);
+		if (__curbrk == 0)
+		{
+		  __set_errno(ENOMEM);
+		  return -1;
+		}
+    }
+    return 0;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/sh64/__longjmp.S
new file mode 100644
index 0000000..ca7925f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/__longjmp.S
@@ -0,0 +1,141 @@
+/* __longjmp for SH-5.
+   Copyright (C) 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+
+#define	INTEGER(reg,offset)	ld.q	r2, offset*8, reg
+#define	DOUBLE(reg,offset)	fld.d	r2, offset*8, reg
+
+
+	.file	"__longjmp.S"
+
+	.section .text64,"xa"
+	.align 2
+
+	.global	__longjmp	
+	.type	__longjmp,@function
+
+__longjmp:
+	/*
+	 *	extern void __longjmp(jmp_buf env, int val);
+	 *
+	 *	r2 == env
+	 *	r3 == val
+	 *	r4 == temporary
+	 */
+
+			/* callee-save registers R10-R16 */
+	INTEGER(r10, __SETJMP_INT(0))
+	INTEGER(r11, __SETJMP_INT(1))
+	INTEGER(r12, __SETJMP_INT(2))
+	INTEGER(r13, __SETJMP_INT(3))
+	INTEGER(r14, __SETJMP_INT(4))
+	INTEGER(r15, __SETJMP_INT(5))
+	INTEGER(r16, __SETJMP_INT(6))
+
+			/* callee-save registers R28-R35 */
+	INTEGER(r28, __SETJMP_INT(7))
+	INTEGER(r29, __SETJMP_INT(8))
+	INTEGER(r30, __SETJMP_INT(9))
+	INTEGER(r31, __SETJMP_INT(10))
+	INTEGER(r32, __SETJMP_INT(11))
+	INTEGER(r33, __SETJMP_INT(12))
+	INTEGER(r34, __SETJMP_INT(13))
+	INTEGER(r35, __SETJMP_INT(14))
+
+			/* callee-save registers R44-R59 */
+	INTEGER(r44, __SETJMP_INT(15))
+	INTEGER(r45, __SETJMP_INT(16))
+	INTEGER(r46, __SETJMP_INT(17))
+	INTEGER(r47, __SETJMP_INT(18))
+	INTEGER(r48, __SETJMP_INT(19))
+	INTEGER(r49, __SETJMP_INT(20))
+	INTEGER(r50, __SETJMP_INT(21))
+	INTEGER(r51, __SETJMP_INT(22))
+	INTEGER(r52, __SETJMP_INT(23))
+	INTEGER(r53, __SETJMP_INT(24))
+	INTEGER(r54, __SETJMP_INT(25))
+	INTEGER(r55, __SETJMP_INT(26))
+	INTEGER(r56, __SETJMP_INT(27))
+	INTEGER(r57, __SETJMP_INT(28))
+	INTEGER(r58, __SETJMP_INT(29))
+	INTEGER(r59, __SETJMP_INT(30))
+
+	#if __SETJMP_NUM_INT != 31
+	#error	__SETJMP_NUM_INT does agree with expected value
+	#endif
+
+#if __SETJMP_NUM_DBL > 0
+			/* callee-save registers FR12-FR15 */
+	DOUBLE(d12, __SETJMP_DBL(0))
+	DOUBLE(d14, __SETJMP_DBL(1))
+
+			/* callee-save registers FR36-FR63 */
+	DOUBLE(d36, __SETJMP_DBL(2))
+	DOUBLE(d38, __SETJMP_DBL(3))
+	DOUBLE(d40, __SETJMP_DBL(4))
+	DOUBLE(d42, __SETJMP_DBL(5))
+	DOUBLE(d44, __SETJMP_DBL(6))
+	DOUBLE(d46, __SETJMP_DBL(7))
+	DOUBLE(d48, __SETJMP_DBL(8))
+	DOUBLE(d50, __SETJMP_DBL(9))
+	DOUBLE(d52, __SETJMP_DBL(10))
+	DOUBLE(d54, __SETJMP_DBL(11))
+	DOUBLE(d56, __SETJMP_DBL(12))
+	DOUBLE(d58, __SETJMP_DBL(13))
+	DOUBLE(d60, __SETJMP_DBL(14))
+	DOUBLE(d62, __SETJMP_DBL(15))
+
+	#if __SETJMP_NUM_DBL != 16
+	#error	__SETJMP_NUM_DBL does agree with expected value
+	#endif
+
+#endif	/* __SETJMP_NUM_DBL > 0 */
+
+			/* callee-save registers TR5-TR7 */
+	INTEGER(r4, __SETJMP_TRG(0))
+	ptabs	r4, tr5
+	INTEGER(r4, __SETJMP_TRG(1))
+	ptabs	r4, tr6
+	INTEGER(r4, __SETJMP_TRG(2))
+	ptabs	r4, tr7
+
+	#if __SETJMP_NUM_TRG != 3
+	#error	__SETJMP_NUM_TRG does agree with expected value
+	#endif
+
+			/* restore Linkage Register (LR) for __longjmp return */
+	INTEGER(r18, __SETJMP_LR)
+	ptabs/l	r18, tr0
+
+			/*
+			 *	must ensure __longjmp() never returns 0.
+			 *	if 'val' == 0, then return 1.
+			 */
+	cmpeq	r3, r63, r2	/* r2 = (r3==0) ? 1 : 0; */
+	add.l	r3, r2, r2	/* return value */
+
+			/* return to caller */
+	blink	tr0, r63
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/endian.h
new file mode 100644
index 0000000..ae7e3bb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/endian.h
@@ -0,0 +1,20 @@
+/*
+ * libc/sysdeps/linux/sh64/bits/endian.h
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#ifdef __LITTLE_ENDIAN__
+#  define __BYTE_ORDER __LITTLE_ENDIAN
+#else
+#  define __BYTE_ORDER __BIG_ENDIAN
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/fcntl.h
new file mode 100644
index 0000000..156df97
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/fcntl.h
@@ -0,0 +1,217 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995, 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	_FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+
+#include <sys/types.h>
+
+/* 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_DIRECT	 040000	/* Direct disk access.  */
+# define O_DIRECTORY	0200000	/* Must be a directory.  */
+# define O_NOFOLLOW	0400000	/* Do not follow links.  */
+# define O_NOATIME	01000000 /* Do not set atime.  */
+# define O_CLOEXEC	02000000 /* set close_on_exec */
+#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	0100000
+#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_XOPEN2K
+# 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]FL.  */
+#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
+
+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/sh64/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/kernel_stat.h
new file mode 100644
index 0000000..1a29433
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/kernel_stat.h
@@ -0,0 +1,55 @@
+/* Stat structure for Linux/sh64 */
+
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+struct kernel_stat {
+	unsigned short st_dev;
+	unsigned short __pad1;
+	unsigned long st_ino;
+	unsigned short st_mode;
+	unsigned short st_nlink;
+	unsigned short st_uid;
+	unsigned short st_gid;
+	unsigned short st_rdev;
+	unsigned short __pad2;
+	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 short	st_dev;
+	unsigned char	__pad0[10];
+
+	unsigned long	st_ino;
+	unsigned int	st_mode;
+	unsigned int	st_nlink;
+
+	unsigned long	st_uid;
+	unsigned long	st_gid;
+
+	unsigned short	st_rdev;
+	unsigned char	__pad3[10];
+
+	long long	st_size;
+	unsigned long	st_blksize;
+
+	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
+	unsigned long	__pad4;		/* future possible st_blocks high bits */
+
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+
+	unsigned long	__unused1;
+	unsigned long	__unused2;
+};
+
+#endif /* _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/kernel_types.h
new file mode 100644
index 0000000..8cc6c61
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/kernel_types.h
@@ -0,0 +1,58 @@
+/*
+ * sysdeps/linux/sh64/bits/kernel_types.h
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ */
+
+/*
+ * 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 __ASM_SH64_POSIX_TYPES_H
+#define __ASM_SH64_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 long 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 __kernel_dev_t	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+typedef long long       __kernel_loff_t;
+
+typedef struct {
+#ifdef __USE_ALL
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* __ASM_SH64_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/setjmp.h
new file mode 100644
index 0000000..ad1ec9d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/setjmp.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 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.  */
+
+/* Define the machine-dependent type `jmp_buf'.  SH-5 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
+
+#define	__SETJMP_NUM_INT	31		/* number of integer registers to save */
+#define	__SETJMP_NUM_DBL	0 /* 16 */	/* number of double registers to save */
+#define	__SETJMP_NUM_TRG	3		/* number of traget registers to save */
+
+#define	__SETJMP_INT(x)	(x)
+#define	__SETJMP_DBL(x)	(__SETJMP_NUM_INT+(x))
+#define	__SETJMP_TRG(x)	(__SETJMP_NUM_INT+__SETJMP_NUM_DBL+(x))
+#define	__SETJMP_LR	(__SETJMP_NUM_INT+__SETJMP_NUM_DBL+__SETJMP_NUM_TRG)
+
+
+#ifndef _ASM
+typedef struct
+  {
+	    /* Callee-saved registers.  */
+    unsigned long long __ints[__SETJMP_NUM_INT];	/* integer registers */
+#if __SETJMP_NUM_DBL > 0
+    unsigned long long __dbls[__SETJMP_NUM_DBL];	/* double registers */
+#endif
+    unsigned long long __trgs[__SETJMP_NUM_TRG];	/* traget registers */
+    unsigned long long __lr;				/* linkage register */
+  } __jmp_buf[1];
+#endif
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/shm.h
new file mode 100644
index 0000000..3a2e715
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/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/sh64/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/stackinfo.h
new file mode 100644
index 0000000..e65338f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/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 SH the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/syscalls.h
new file mode 100644
index 0000000..84877d0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/syscalls.h
@@ -0,0 +1,126 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+#define SYS_ify(syscall_name)  (__NR_##syscall_name)
+
+/* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */
+#define __syscall_return(type, res) \
+do { \
+	/* Note: when returning from kernel the return value is in r9	    \
+	**       This prevents conflicts between return value and arg1      \
+	**       when dispatching signal handler, in other words makes	    \
+	**       life easier in the system call epilogue (see entry.S)      \
+	*/								    \
+        register unsigned long __sr2 __asm__ ("r2") = res;		    \
+	if ((unsigned long)(res) >= (unsigned long)(-125)) { \
+		errno = -(res);						    \
+		__sr2 = -1; 						    \
+	} \
+	return (type) (__sr2); 						    \
+} while (0)
+
+/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
+
+#define _syscall0(type,name) \
+type name(void) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x10 << 16) | __NR_##name); \
+__asm__ __volatile__ ("trapa	%1" \
+	: "=r" (__sc0) 							    \
+	: "r" (__sc0) ); 						    \
+__syscall_return(type,__sc0); 						    \
+}
+
+#define _syscall1(type,name,type1,arg1) \
+type name(type1 arg1) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x11 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1;	    \
+__asm__ __volatile__ ("trapa	%1" \
+	: "=r" (__sc0) 							    \
+	: "r" (__sc0), "r" (__sc2));					    \
+__syscall_return(type,__sc0); 						    \
+}
+
+#define _syscall2(type,name,type1,arg1,type2,arg2) \
+type name(type1 arg1,type2 arg2) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x12 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1;	    \
+register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2;	    \
+__asm__ __volatile__ ("trapa	%1" \
+	: "=r" (__sc0) 							    \
+	: "r" (__sc0), "r" (__sc2), "r" (__sc3) );			    \
+__syscall_return(type,__sc0); 						    \
+}
+
+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
+type name(type1 arg1,type2 arg2,type3 arg3) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x13 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1;	    \
+register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2;	    \
+register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3;	    \
+__asm__ __volatile__ ("trapa	%1" \
+	: "=r" (__sc0) 							    \
+	: "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) );		    \
+__syscall_return(type,__sc0); 						    \
+}
+
+#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
+type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x14 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1;	    \
+register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2;	    \
+register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3;	    \
+register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4;	    \
+__asm__ __volatile__ ("trapa	%1" \
+	: "=r" (__sc0) 							    \
+	: "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5) );\
+__syscall_return(type,__sc0); 						    \
+}
+
+#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
+type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x15 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1;	    \
+register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2;	    \
+register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3;	    \
+register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4;	    \
+register unsigned long __sc6 __asm__ ("r6") = (unsigned long) arg5;	    \
+__asm__ __volatile__ ("trapa	%1" \
+	: "=r" (__sc0) 							    \
+	: "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \
+	  "r" (__sc6));							    \
+__syscall_return(type,__sc0); 						    \
+}
+
+#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5, type6, arg6) \
+type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x16 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1;	    \
+register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2;	    \
+register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3;	    \
+register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4;	    \
+register unsigned long __sc6 __asm__ ("r6") = (unsigned long) arg5;	    \
+register unsigned long __sc7 __asm__ ("r7") = (unsigned long) arg6;	    \
+__asm__ __volatile__ ("trapa	%1" \
+	: "=r" (__sc0) 							    \
+	: "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \
+	  "r" (__sc6), "r" (__sc7));					    \
+__syscall_return(type,__sc0); 						    \
+}
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..46bf23e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/uClibc_arch_features.h
@@ -0,0 +1,47 @@
+/*
+ * 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__ "movi 0x10, r9; shori 0xff, r9; trapa r9"
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/sh64/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/wordsize.h
new file mode 100644
index 0000000..7c2723b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/bits/wordsize.h
@@ -0,0 +1,12 @@
+/*
+ * libc/sysdeps/linux/sh64/bits/wordsize.h
+ *
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ */
+
+#define __WORDSIZE 32
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/brk.c b/ap/build/uClibc/libc/sysdeps/linux/sh64/brk.c
new file mode 100644
index 0000000..a98cd54
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/brk.c
@@ -0,0 +1,27 @@
+/* From libc-5.3.12 */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+extern void * __curbrk attribute_hidden;
+extern int __init_brk (void) attribute_hidden;
+extern void *_brk(void *ptr) attribute_hidden;
+
+int brk(void * end_data_seg)
+{
+    if (__init_brk () == 0)
+    {
+		__curbrk = _brk(end_data_seg);
+		if (__curbrk == end_data_seg)
+			return 0;
+		__set_errno(ENOMEM);
+    }
+    return -1;
+}
+libc_hidden_def(brk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/sh64/crt1.S
new file mode 100644
index 0000000..1822e2d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/crt1.S
@@ -0,0 +1,83 @@
+/* Startup code for SH5 & ELF.
+   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 2001 Hewlett-Packard Australia
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.
+
+	At this entry point, most registers' values are unspecified, except:
+
+   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
+*/
+
+	.file	"crt1.S"
+
+	.globl	_start
+	.type	_start,%function
+	.type	main,%function
+
+	.section .text64,"xa"
+	.align 2	/* 2^2 = 4 */
+
+_start:
+	/* __uClibc_main (main, argc, argv, init, fini) */
+	movi	__main, r18
+	or	r2, r63, r18	
+
+	/* Pop argc off the stack and save a pointer to argv */
+	ld.l	r15, 0, r3	/* argc */
+	addi	r15, 4, r4	/* argv */
+
+	movi	_init, r5
+	movi	_fini, r6
+
+	/* call main() */
+	movi	__uClibc_main, r17
+	ptabs/l	r17, tr0
+	blink	tr0, r18
+
+	/* should never get here....*/
+	movi	abort, r17
+	ptabs/l	r17, tr0
+	blink	tr0, r63	/* call abort() => (r63) do not come back ... */
+
+/*
+ *	The following is a stub to stop the GNU toolchain
+ *	from calling its C-RTL initialization routines.
+ */
+__main:
+	movi	main, r18
+	ptabs/l	r18, tr0
+	blink	tr0, r63
+
+/* 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/sh64/crti.S b/ap/build/uClibc/libc/sysdeps/linux/sh64/crti.S
new file mode 100644
index 0000000..597be36
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/crti.S
@@ -0,0 +1,42 @@
+	.file	"initfini.c"
+	.section	.text..SHmedia32,"ax"
+	.little
+	
+	.section .init
+	.hidden  _init
+	.align 2
+	.global	_init
+	.type	_init, @function
+_init:
+	addi.l	r15, -16, r15
+	st.l	r15, 4, r12
+	movi	(((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) >> 16) & 65535), r12
+	shori	((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) & 65535), r12
+	.LPCS0: ptrel/u	r12, tr0
+	st.l	r15, 8, r14
+	st.l	r15, 12, r18
+	add.l	r15, r63, r14
+	gettr	tr0, r12
+	
+	.align 2
+	
+	
+	.section .fini
+	.hidden  _fini
+	.align 2
+	.global	_fini
+	.type	_fini, @function
+_fini:
+	addi.l	r15, -16, r15
+	st.l	r15, 4, r12
+	movi	(((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS1-.)) >> 16) & 65535), r12
+	shori	((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS1-.)) & 65535), r12
+	.LPCS1: ptrel/u	r12, tr0
+	st.l	r15, 8, r14
+	st.l	r15, 12, r18
+	add.l	r15, r63, r14
+	gettr	tr0, r12
+	.align 2
+	
+	
+	.ident	"GCC: (GNU) 3.3.2"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/sh64/crtn.S
new file mode 100644
index 0000000..501fe91
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/crtn.S
@@ -0,0 +1,31 @@
+	.file	"initfini.c"
+	.section	.text..SHmedia32,"ax"
+	.little
+	
+	.section .init
+	.hidden  _init
+	.align 2
+	.global	_init
+	.type	_init, @function
+	add.l	r14, r63, r15
+	ld.l	r15, 12, r18
+	ld.l	r15, 4, r12
+	ld.l	r15, 8, r14
+	ptabs	r18, tr0
+	addi.l	r15, 16, r15
+	blink	tr0, r63
+	
+	.section .fini
+	.hidden  _fini
+	.align 2
+	.global	_fini
+	.type	_fini, @function
+	add.l	r14, r63, r15
+	ld.l	r15, 12, r18
+	ld.l	r15, 4, r12
+	ld.l	r15, 8, r14
+	ptabs	r18, tr0
+	addi.l	r15, 16, r15
+	blink	tr0, r63
+	
+	.ident	"GCC: (GNU) 3.3.2"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/sbrk.c b/ap/build/uClibc/libc/sysdeps/linux/sh64/sbrk.c
new file mode 100644
index 0000000..2dc719a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/sbrk.c
@@ -0,0 +1,25 @@
+/* From libc-5.3.12 */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+extern void * __curbrk attribute_hidden;
+extern int __init_brk (void) attribute_hidden;
+extern void *_brk(void *ptr) attribute_hidden;
+
+void *
+sbrk(intptr_t increment)
+{
+    if (__init_brk () == 0)
+    {
+		char * tmp = (char*)__curbrk+increment;
+		__curbrk = _brk(tmp);
+		if (__curbrk == tmp)
+			return tmp-increment;
+		__set_errno(ENOMEM);
+		return ((void *) -1);
+    }
+    return ((void *) -1);
+}
+libc_hidden_def(sbrk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/sh64/setjmp.S
new file mode 100644
index 0000000..11d76d3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/setjmp.S
@@ -0,0 +1,140 @@
+/* setjmp for SH-5.
+   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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+
+#define	INTEGER(reg,offset)	st.q	r2, offset*8, reg
+#define	DOUBLE(reg,offset)	fst.d	r2, offset*8, reg
+
+
+	.file	"setjmp.S"
+
+	.section .text64,"xa"
+	.align 2
+
+	.global	__sigsetjmp	
+	.type	__sigsetjmp,@function
+
+__sigsetjmp:
+	/*
+	 *	extern int __sigsetjmp(jmp_buf env, int savemask);
+	 *
+	 *	r2 == env
+	 *	r3 == savemask
+	 *	r4 == temporary
+	 */
+
+			/* callee-save registers R10-R16 */
+	INTEGER(r10, __SETJMP_INT(0))
+	INTEGER(r11, __SETJMP_INT(1))
+	INTEGER(r12, __SETJMP_INT(2))
+	INTEGER(r13, __SETJMP_INT(3))
+	INTEGER(r14, __SETJMP_INT(4))
+	INTEGER(r15, __SETJMP_INT(5))
+	INTEGER(r16, __SETJMP_INT(6))
+
+			/* callee-save registers R28-R35 */
+	INTEGER(r28, __SETJMP_INT(7))
+	INTEGER(r29, __SETJMP_INT(8))
+	INTEGER(r30, __SETJMP_INT(9))
+	INTEGER(r31, __SETJMP_INT(10))
+	INTEGER(r32, __SETJMP_INT(11))
+	INTEGER(r33, __SETJMP_INT(12))
+	INTEGER(r34, __SETJMP_INT(13))
+	INTEGER(r35, __SETJMP_INT(14))
+
+			/* callee-save registers R44-R59 */
+	INTEGER(r44, __SETJMP_INT(15))
+	INTEGER(r45, __SETJMP_INT(16))
+	INTEGER(r46, __SETJMP_INT(17))
+	INTEGER(r47, __SETJMP_INT(18))
+	INTEGER(r48, __SETJMP_INT(19))
+	INTEGER(r49, __SETJMP_INT(20))
+	INTEGER(r50, __SETJMP_INT(21))
+	INTEGER(r51, __SETJMP_INT(22))
+	INTEGER(r52, __SETJMP_INT(23))
+	INTEGER(r53, __SETJMP_INT(24))
+	INTEGER(r54, __SETJMP_INT(25))
+	INTEGER(r55, __SETJMP_INT(26))
+	INTEGER(r56, __SETJMP_INT(27))
+	INTEGER(r57, __SETJMP_INT(28))
+	INTEGER(r58, __SETJMP_INT(29))
+	INTEGER(r59, __SETJMP_INT(30))
+
+	#if __SETJMP_NUM_INT != 31
+	#error	__SETJMP_NUM_INT does agree with expected value
+	#endif
+
+#if __SETJMP_NUM_DBL > 0
+			/* callee-save registers FR12-FR15 */
+	DOUBLE(d12, __SETJMP_DBL(0))
+	DOUBLE(d14, __SETJMP_DBL(1))
+
+			/* callee-save registers FR36-FR63 */
+	DOUBLE(d36, __SETJMP_DBL(2))
+	DOUBLE(d38, __SETJMP_DBL(3))
+	DOUBLE(d40, __SETJMP_DBL(4))
+	DOUBLE(d42, __SETJMP_DBL(5))
+	DOUBLE(d44, __SETJMP_DBL(6))
+	DOUBLE(d46, __SETJMP_DBL(7))
+	DOUBLE(d48, __SETJMP_DBL(8))
+	DOUBLE(d50, __SETJMP_DBL(9))
+	DOUBLE(d52, __SETJMP_DBL(10))
+	DOUBLE(d54, __SETJMP_DBL(11))
+	DOUBLE(d56, __SETJMP_DBL(12))
+	DOUBLE(d58, __SETJMP_DBL(13))
+	DOUBLE(d60, __SETJMP_DBL(14))
+	DOUBLE(d62, __SETJMP_DBL(15))
+
+	#if __SETJMP_NUM_DBL != 16
+	#error	__SETJMP_NUM_DBL does agree with expected value
+	#endif
+
+#endif	/* __SETJMP_NUM_DBL > 0 */
+
+			/* callee-save registers TR5-TR7 */
+	gettr   tr5, r4
+	INTEGER(r4, __SETJMP_TRG(0))
+	gettr   tr6, r4
+	INTEGER(r4, __SETJMP_TRG(1))
+	gettr   tr7, r4
+	INTEGER(r4, __SETJMP_TRG(2))
+
+	#if __SETJMP_NUM_TRG != 3
+	#error	__SETJMP_NUM_TRG does agree with expected value
+	#endif
+
+			/* save Linkage Register (LR) for longjmp return */
+	INTEGER(r18, __SETJMP_LR)
+
+			/*
+			 *	return a value of zero if call is __sigsetjmp().
+			 *	This is so that caller of setjmp() knows
+			 *	we have retruned via setjmp, and not via longjmp.
+			 *	R0 is the result register.
+			 */
+
+	ptabs/l	r18, tr0	/* return to caller */
+	movi	0, r2	/* return value */
+	blink	tr0, r63
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/sys/procfs.h
new file mode 100644
index 0000000..aad21e5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/sys/procfs.h
@@ -0,0 +1,126 @@
+/* Copyright (C) 1996, 1997, 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.  */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+
+__BEGIN_DECLS
+
+/*
+ * ELF register definitions...
+ */
+typedef unsigned long elf_greg_t;
+
+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct user_fpu_struct elf_fpregset_t;
+
+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.  Fields present but not used are
+   marked with "XXX".  */
+struct elf_prstatus
+  {
+#if 0
+    long int pr_flags;			/* XXX Process flags.  */
+    short int pr_why;			/* XXX Reason for process halt.  */
+    short int pr_what;			/* XXX More detailed reason.  */
+#endif
+    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.  */
+#if 0
+    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
+    struct sigaction pr_action;		/* Signal action for current sig.  */
+#endif
+    __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.  */
+#if 0
+    long int pr_instr;			/* Current instruction.  */
+#endif
+    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.  */
+    long pr_uid;
+    long 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.  */
+  };
+
+
+/* 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 habe only ine PID type.  */
+typedef __pid_t lwpid_t;
+
+
+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/sh64/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/sh64/sys/ucontext.h
new file mode 100644
index 0000000..7440784
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/sys/ucontext.h
@@ -0,0 +1,205 @@
+/* Copyright (C) 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* Where is System V/SH ABI?  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+
+typedef long long greg_t;
+
+/* Number of general registers.  */
+#define NGREG	64
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+#ifdef __USE_GNU
+/* 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
+  R16 = 16,
+#define R16	R16
+  R17 = 17,
+#define R17	R17
+  R18 = 18,
+#define R18	R18
+  R19 = 19,
+#define R19	R19
+  R20 = 20,
+#define R20	R20
+  R21 = 21,
+#define R21	R21
+  R22 = 22,
+#define R22	R22
+  R23 = 23,
+#define R23	R23
+  R24 = 24,
+#define R24	R24
+  R25 = 25,
+#define R25	R25
+  R26 = 26,
+#define R26	R26
+  R27 = 27,
+#define R27	R27
+  R28 = 28,
+#define R28	R28
+  R29 = 29,
+#define R29	R29
+  R30 = 30,
+#define R30	R30
+  R31 = 31,
+#define R31	R31
+  R32 = 32,
+#define R32	R32
+  R33 = 33,
+#define R33	R33
+  R34 = 34,
+#define R34	R34
+  R35 = 35,
+#define R35	R35
+  R36 = 36,
+#define R36	R36
+  R37 = 37,
+#define R37	R37
+  R38 = 38,
+#define R38	R38
+  R39 = 39,
+#define R39	R39
+  R40 = 40,
+#define R40	R40
+  R41 = 41,
+#define R41	R41
+  R42 = 42,
+#define R42	R42
+  R43 = 43,
+#define R43	R43
+  R44 = 44,
+#define R44	R44
+  R45 = 45,
+#define R45	R45
+  R46 = 46,
+#define R46	R46
+  R47 = 47,
+#define R47	R47
+  R48 = 48,
+#define R48	R48
+  R49 = 49,
+#define R49	R49
+  R50 = 50,
+#define R50	R50
+  R51 = 51,
+#define R51	R51
+  R52 = 52,
+#define R52	R52
+  R53 = 53,
+#define R53	R53
+  R54 = 54,
+#define R54	R54
+  R55 = 55,
+#define R55	R55
+  R56 = 56,
+#define R56	R56
+  R57 = 57,
+#define R57	R57
+  R58 = 58,
+#define R58	R58
+  R59 = 59,
+#define R59	R59
+  R60 = 60,
+#define R60	R60
+  R61 = 61,
+#define R61	R61
+  R62 = 62,
+#define R62	R62
+  R63 = 63,
+#define R63	R63
+};
+#endif
+
+typedef int freg_t;
+
+/* Number of FPU registers.  */
+#define NFPREG	32
+
+/* Structure to describe FPU registers.  */
+typedef freg_t fpregset_t[NFPREG];
+
+/* Context to describe whole processor state.  */
+typedef struct
+  {
+    gregset_t gregs;
+    fpregset_t fpregs;
+    unsigned long long sc_tregs[8];
+    unsigned long long sc_pc;
+    unsigned long long sc_sr;
+    unsigned long long sc_fpscr;
+
+  } mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sh64/syscall.c b/ap/build/uClibc/libc/sysdeps/linux/sh64/syscall.c
new file mode 100644
index 0000000..a6c55eb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sh64/syscall.c
@@ -0,0 +1,24 @@
+
+
+#include <features.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+long syscall(long sysnum,
+		long arg1, long arg2, long arg3,
+		long arg4, long arg5, long arg6)
+{
+register long __sc0 __asm__ ("r9") = ((0x16 << 16) | sysnum);
+register long __sc2 __asm__ ("r2") = (long) arg1;
+register long __sc3 __asm__ ("r3") = (long) arg2;
+register long __sc4 __asm__ ("r4") = (long) arg3;
+register long __sc5 __asm__ ("r5") = (long) arg4;
+register long __sc6 __asm__ ("r6") = (long) arg5;
+register long __sc7 __asm__ ("r7") = (long) arg6;
+__asm__ __volatile__ ("trapa	%1" \
+	: "=r" (__sc0) \
+	: "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \
+	  "r" (__sc6), "r" (__sc7));
+__syscall_return(long,__sc0);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/Makefile b/ap/build/uClibc/libc/sysdeps/linux/sparc/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/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/sparc/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/sparc/Makefile.arch
new file mode 100644
index 0000000..aa58756
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/Makefile.arch
@@ -0,0 +1,29 @@
+# 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 __syscall_error.c sigaction.c
+
+SSRC := \
+	__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
+	syscall.S urem.S udiv.S umul.S sdiv.S rem.S pipe.S
+
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+SSRC += fork.S vfork.S clone.S
+endif
+
+# check weather __LONG_DOUBLE_128__ is defined (long double support)
+UCLIBC_SPARC_HAS_LONG_DOUBLE=$(shell if [ "x`$(CC) -E -dM -xc /dev/null 2>&1 | grep __LONG_DOUBLE_128__`" != "x" ]; then echo "y"; fi)
+ifeq ($(UCLIBC_SPARC_HAS_LONG_DOUBLE),y)
+CSRC += $(foreach f, \
+	q_div.c   q_fle.c    q_mul.c   q_qtoll.c   q_stoq.c    \
+	mp_clz_tab.c  q_dtoq.c  q_flt.c    q_neg.c   q_qtos.c    q_sub.c    \
+	q_add.c      q_feq.c   q_fne.c    q_qtod.c  q_qtou.c    q_ulltoq.c  \
+	q_cmp.c      q_fge.c   q_itoq.c   q_qtoull.c  q_util.c    \
+	q_cmpe.c     q_fgt.c   q_lltoq.c  q_qtoi.c  q_sqrt.c    q_utoq.c, soft-fp/$(f))
+else
+CSRC += qp_ops.c
+endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/__longjmp.S
new file mode 100644
index 0000000..c7d4f07
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/__longjmp.S
@@ -0,0 +1,89 @@
+/* Copyright (C) 1991, 93, 96, 97, 98, 99, 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>
+#include <sys/syscall.h>
+
+#define _ASM 1
+#define _SETJMP_H
+#include <bits/setjmp.h>
+#define ENV(base,reg) [%base + (reg * 4)]
+#define ST_FLUSH_WINDOWS 3
+#define RW_FP [%fp + 0x48]
+
+.global __longjmp
+.type   __longjmp,%function
+.align 4
+__longjmp:
+	.register %g2, #scratch
+	.register %g3, #scratch
+	/* Store our arguments in global registers so we can still
+	 * use them while unwinding frames and their register windows.  */
+
+	ld ENV(o0,JB_FP), %g3	/* Cache target FP in register %g3.  */
+	mov %o0, %g1		/* ENV in %g1 */
+	orcc %o1, %g0, %g2	/* VAL in %g2 */
+	be,a 0f			/* Branch if zero; else skip delay slot.  */
+	mov 1, %g2		/* Delay slot only hit if zero: VAL = 1.  */
+0:
+	xor %fp, %g3, %o0
+	add %fp, 512, %o1
+	andncc %o0, 4095, %o0
+	bne .Lthread
+	cmp %o1, %g3
+	bl .Lthread
+
+	/* Now we will loop, unwinding the register windows up the stack
+	 * until the restored %fp value matches the target value in %g3.  */
+
+.Lloop:
+	cmp %fp, %g3		/* Have we reached the target frame? */
+	bl,a .Lloop		/* Loop while current fp is below target.  */
+	 restore		/* Unwind register window in delay slot.  */
+	be,a .Lfound		/* Better have hit it exactly.  */
+	 ld ENV(g1,JB_SP), %o0	/* Delay slot: extract target SP.  */
+
+.Lthread:
+	/*
+	 * Do a "flush register windows trap".  The trap handler in the
+	 * kernel writes all the register windows to their stack slots, and
+	 * marks them all as invalid (needing to be sucked up from the
+	 * stack when used).  This ensures that all information needed to
+	 * unwind to these callers is in memory, not in the register
+	 * windows.
+	 */
+	ta	ST_FLUSH_WINDOWS
+	ld	ENV(g1,JB_PC), %o7 /* Set return PC. */
+	ld	ENV(g1,JB_SP), %fp /* Set saved SP on restore below. */
+	sub	%fp, 64, %sp	/* Allocate a register frame. */
+	st	%g3, RW_FP	/* Set saved FP on restore below. */
+	retl
+	restore %g2, 0, %o0	/* Restore values from above register frame. */
+
+.Lfound:
+	/* We have unwound register windows so %fp matches the target.  */
+	mov %o0, %sp		/* OK, install new SP.  */
+
+.Lsp_ok:
+	ld ENV(g1,JB_PC), %o0	/* Extract target return PC.  */
+	jmp %o0 + 8		/* Return there.  */
+	 mov %g2, %o0		/* Delay slot: set return value.  */
+
+.size __longjmp,.-__longjmp
+
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/__syscall_error.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/__syscall_error.c
new file mode 100644
index 0000000..5e109a8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/__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/sparc/_math_inc.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/_math_inc.h
new file mode 100644
index 0000000..1bf84f0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/_math_inc.h
@@ -0,0 +1,32 @@
+/*
+ * Setup some glibc defines so we can just drop in the
+ * asm files from glibc without any modification.
+ */
+
+#include <features.h>
+#include <bits/wordsize.h>
+
+#define __ASSEMBLY__
+#ifndef __sparc_v9__
+#include <asm/traps.h>
+#endif
+
+/* Is alignment really needed? */
+
+#if __WORDSIZE == 32
+# define ENTRY_ALIGN 4
+#else
+# define ENTRY_ALIGN 2
+#endif
+
+#define ENTRY(sym) \
+	.global sym; \
+	.align  ENTRY_ALIGN; \
+	.type   sym,%function; \
+	sym:
+
+#define LOC(sym) \
+	.L ## sym
+
+#define END(sym) \
+	.size sym,.-sym;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/atomic.h
new file mode 100644
index 0000000..16c3c78
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/atomic.h
@@ -0,0 +1,329 @@
+/* Atomic operations.  sparc32 version.
+   Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_ATOMIC_H
+#define _BITS_ATOMIC_H	1
+
+#include <stdint.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 int16_t atomic16_t;
+typedef uint16_t uatomic16_t;
+typedef int_fast16_t atomic_fast16_t;
+typedef uint_fast16_t uatomic_fast16_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 int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+typedef int_fast64_t atomic_fast64_t;
+typedef uint_fast64_t uatomic_fast64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+
+/* We have no compare and swap, just test and set.
+   The following implementation contends on 64 global locks
+   per library and assumes no variable will be accessed using atomic.h
+   macros from two different libraries.  */
+
+__make_section_unallocated
+  (".gnu.linkonce.b.__sparc32_atomic_locks, \"aw\", %nobits");
+
+volatile unsigned char __sparc32_atomic_locks[64]
+  __attribute__ ((nocommon, section (".gnu.linkonce.b.__sparc32_atomic_locks"
+				     __sec_comment),
+		  visibility ("hidden")));
+
+#define __sparc32_atomic_do_lock(addr) \
+  do								      \
+    {								      \
+      unsigned int __old_lock;					      \
+      unsigned int __idx = (((long) addr >> 2) ^ ((long) addr >> 12)) \
+			   & 63;				      \
+      do							      \
+	__asm__ __volatile__ ("ldstub %1, %0"			      \
+			  : "=r" (__old_lock),			      \
+			    "=m" (__sparc32_atomic_locks[__idx])      \
+			  : "m" (__sparc32_atomic_locks[__idx])	      \
+			  : "memory");				      \
+      while (__old_lock);					      \
+    }								      \
+  while (0)
+
+#define __sparc32_atomic_do_unlock(addr) \
+  do								      \
+    {								      \
+      __sparc32_atomic_locks[(((long) addr >> 2)		      \
+			      ^ ((long) addr >> 12)) & 63] = 0;	      \
+      __asm__ __volatile__ ("" ::: "memory");			      \
+    }								      \
+  while (0)
+
+#define __sparc32_atomic_do_lock24(addr) \
+  do								      \
+    {								      \
+      unsigned int __old_lock;					      \
+      do							      \
+	__asm__ __volatile__ ("ldstub %1, %0"			      \
+			  : "=r" (__old_lock), "=m" (*(addr))	      \
+			  : "m" (*(addr))			      \
+			  : "memory");				      \
+      while (__old_lock);					      \
+    }								      \
+  while (0)
+
+#define __sparc32_atomic_do_unlock24(addr) \
+  do								      \
+    {								      \
+      *(char *) (addr) = 0;					      \
+      __asm__ __volatile__ ("" ::: "memory");			      \
+    }								      \
+  while (0)
+
+
+#ifndef SHARED
+# define __v9_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+({									      \
+  register __typeof (*(mem)) __acev_tmp __asm__ ("%g6");			      \
+  register __typeof (mem) __acev_mem __asm__ ("%g1") = (mem);		      \
+  register __typeof (*(mem)) __acev_oldval __asm__ ("%g5");		      \
+  __acev_tmp = (newval);						      \
+  __acev_oldval = (oldval);						      \
+  /* .word 0xcde05005 is cas [%g1], %g5, %g6.  Can't use cas here though,     \
+     because as will then mark the object file as V8+ arch.  */		      \
+  __asm__ __volatile__ (".word 0xcde05005"					      \
+		    : "+r" (__acev_tmp), "=m" (*__acev_mem)		      \
+		    : "r" (__acev_oldval), "m" (*__acev_mem),		      \
+		      "r" (__acev_mem) : "memory");			      \
+  __acev_tmp; })
+#endif
+
+/* The only basic operation needed is compare and exchange.  */
+#define __v7_compare_and_exchange_val_acq(mem, newval, oldval) \
+  ({ __typeof (mem) __acev_memp = (mem);			      \
+     __typeof (*mem) __acev_ret;				      \
+     __typeof (*mem) __acev_newval = (newval);			      \
+								      \
+     __sparc32_atomic_do_lock (__acev_memp);			      \
+     __acev_ret = *__acev_memp;					      \
+     if (__acev_ret == (oldval))				      \
+       *__acev_memp = __acev_newval;				      \
+     __sparc32_atomic_do_unlock (__acev_memp);			      \
+     __acev_ret; })
+
+#define __v7_compare_and_exchange_bool_acq(mem, newval, oldval) \
+  ({ __typeof (mem) __aceb_memp = (mem);			      \
+     int __aceb_ret;						      \
+     __typeof (*mem) __aceb_newval = (newval);			      \
+								      \
+     __sparc32_atomic_do_lock (__aceb_memp);			      \
+     __aceb_ret = 0;						      \
+     if (*__aceb_memp == (oldval))				      \
+       *__aceb_memp = __aceb_newval;				      \
+     else							      \
+       __aceb_ret = 1;						      \
+     __sparc32_atomic_do_unlock (__aceb_memp);			      \
+     __aceb_ret; })
+
+#define __v7_exchange_acq(mem, newval) \
+  ({ __typeof (mem) __acev_memp = (mem);			      \
+     __typeof (*mem) __acev_ret;				      \
+     __typeof (*mem) __acev_newval = (newval);			      \
+								      \
+     __sparc32_atomic_do_lock (__acev_memp);			      \
+     __acev_ret = *__acev_memp;					      \
+     *__acev_memp = __acev_newval;				      \
+     __sparc32_atomic_do_unlock (__acev_memp);			      \
+     __acev_ret; })
+
+#define __v7_exchange_and_add(mem, value) \
+  ({ __typeof (mem) __acev_memp = (mem);			      \
+     __typeof (*mem) __acev_ret;				      \
+								      \
+     __sparc32_atomic_do_lock (__acev_memp);			      \
+     __acev_ret = *__acev_memp;					      \
+     *__acev_memp = __acev_ret + (value);			      \
+     __sparc32_atomic_do_unlock (__acev_memp);			      \
+     __acev_ret; })
+
+/* Special versions, which guarantee that top 8 bits of all values
+   are cleared and use those bits as the ldstub lock.  */
+#define __v7_compare_and_exchange_val_24_acq(mem, newval, oldval) \
+  ({ __typeof (mem) __acev_memp = (mem);			      \
+     __typeof (*mem) __acev_ret;				      \
+     __typeof (*mem) __acev_newval = (newval);			      \
+								      \
+     __sparc32_atomic_do_lock24 (__acev_memp);			      \
+     __acev_ret = *__acev_memp & 0xffffff;			      \
+     if (__acev_ret == (oldval))				      \
+       *__acev_memp = __acev_newval;				      \
+     else							      \
+       __sparc32_atomic_do_unlock24 (__acev_memp);		      \
+     __asm__ __volatile__ ("" ::: "memory");			      \
+     __acev_ret; })
+
+#define __v7_exchange_24_rel(mem, newval) \
+  ({ __typeof (mem) __acev_memp = (mem);			      \
+     __typeof (*mem) __acev_ret;				      \
+     __typeof (*mem) __acev_newval = (newval);			      \
+								      \
+     __sparc32_atomic_do_lock24 (__acev_memp);			      \
+     __acev_ret = *__acev_memp & 0xffffff;			      \
+     *__acev_memp = __acev_newval;				      \
+     __asm__ __volatile__ ("" ::: "memory");			      \
+     __acev_ret; })
+
+#ifdef SHARED
+
+/* When dynamically linked, we assume pre-v9 libraries are only ever
+   used on pre-v9 CPU.  */
+# define __atomic_is_v9 0
+
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+  __v7_compare_and_exchange_val_acq (mem, newval, oldval)
+
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+  __v7_compare_and_exchange_bool_acq (mem, newval, oldval)
+
+# define atomic_exchange_acq(mem, newval) \
+  __v7_exchange_acq (mem, newval)
+
+# define atomic_exchange_and_add(mem, value) \
+  __v7_exchange_and_add (mem, value)
+
+# define atomic_compare_and_exchange_val_24_acq(mem, newval, oldval) \
+  ({								      \
+     if (sizeof (*mem) != 4)					      \
+       abort ();						      \
+     __v7_compare_and_exchange_val_24_acq (mem, newval, oldval); })
+
+# define atomic_exchange_24_rel(mem, newval) \
+  ({								      \
+     if (sizeof (*mem) != 4)					      \
+       abort ();						      \
+     __v7_exchange_24_rel (mem, newval); })
+
+#else
+
+
+
+/*
+   Here's what we'd like to do:
+
+   In libc.a/libpthread.a etc. we don't know if we'll be run on
+   pre-v9 or v9 CPU.  To be interoperable with dynamically linked
+   apps on v9 CPUs e.g. with process shared primitives, use cas insn
+   on v9 CPUs and ldstub on pre-v9.
+
+   However, we have no good way to test at run time that I know of,
+   so resort to the lowest common denominator (v7 ops) -austinf
+ */
+#define __atomic_is_v9 0
+
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+  ({								      \
+     __typeof (*mem) __acev_wret;				      \
+     if (sizeof (*mem) != 4)					      \
+       abort ();						      \
+     if (__atomic_is_v9)					      \
+       __acev_wret						      \
+	 = __v9_compare_and_exchange_val_32_acq (mem, newval, oldval);\
+     else							      \
+       __acev_wret						      \
+	 = __v7_compare_and_exchange_val_acq (mem, newval, oldval);   \
+     __acev_wret; })
+
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+  ({								      \
+     int __acev_wret;						      \
+     if (sizeof (*mem) != 4)					      \
+       abort ();						      \
+     if (__atomic_is_v9)					      \
+       {							      \
+	 __typeof (oldval) __acev_woldval = (oldval);		      \
+	 __acev_wret						      \
+	   = __v9_compare_and_exchange_val_32_acq (mem, newval,	      \
+						   __acev_woldval)    \
+	     != __acev_woldval;					      \
+       }							      \
+     else							      \
+       __acev_wret						      \
+	 = __v7_compare_and_exchange_bool_acq (mem, newval, oldval);  \
+     __acev_wret; })
+
+# define atomic_exchange_rel(mem, newval) \
+  ({								      \
+     __typeof (*mem) __acev_wret;				      \
+     if (sizeof (*mem) != 4)					      \
+       abort ();						      \
+     if (__atomic_is_v9)					      \
+       {							      \
+	 __typeof (mem) __acev_wmemp = (mem);			      \
+	 __typeof (*(mem)) __acev_wval = (newval);		      \
+	 do							      \
+	   __acev_wret = *__acev_wmemp;				      \
+	 while (__builtin_expect				      \
+		  (__v9_compare_and_exchange_val_32_acq (__acev_wmemp,\
+							 __acev_wval, \
+							 __acev_wret) \
+		   != __acev_wret, 0));				      \
+       }							      \
+     else							      \
+       __acev_wret = __v7_exchange_acq (mem, newval);		      \
+     __acev_wret; })
+
+# define atomic_compare_and_exchange_val_24_acq(mem, newval, oldval) \
+  ({								      \
+     __typeof (*mem) __acev_wret;				      \
+     if (sizeof (*mem) != 4)					      \
+       abort ();						      \
+     if (__atomic_is_v9)					      \
+       __acev_wret						      \
+	 = __v9_compare_and_exchange_val_32_acq (mem, newval, oldval);\
+     else							      \
+       __acev_wret						      \
+	 = __v7_compare_and_exchange_val_24_acq (mem, newval, oldval);\
+     __acev_wret; })
+
+# define atomic_exchange_24_rel(mem, newval) \
+  ({								      \
+     __typeof (*mem) __acev_w24ret;				      \
+     if (sizeof (*mem) != 4)					      \
+       abort ();						      \
+     if (__atomic_is_v9)					      \
+       __acev_w24ret = atomic_exchange_rel (mem, newval);	      \
+     else							      \
+       __acev_w24ret = __v7_exchange_24_rel (mem, newval);	      \
+     __acev_w24ret; })
+
+#endif
+
+#endif	/* bits/atomic.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/endian.h
new file mode 100644
index 0000000..8acfdf5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/endian.h
@@ -0,0 +1,12 @@
+/* Sparc is big-endian, but v9 supports endian conversion on loads/stores
+   and GCC supports such a mode.  Be prepared.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#ifdef __LITTLE_ENDIAN__
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#else
+# define __BYTE_ORDER __BIG_ENDIAN
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/epoll.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/epoll.h
new file mode 100644
index 0000000..5324020
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/epoll.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_EPOLL_H
+# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+#endif
+
+/* Flags to be passed to epoll_create1.  */
+enum
+  {
+    EPOLL_CLOEXEC = 0x400000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 0x004000
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/fcntl.h
new file mode 100644
index 0000000..31a6d9b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/fcntl.h
@@ -0,0 +1,258 @@
+/* O_*, F_*, FD_* bit values for Linux/SPARC.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007
+   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>
+#include <bits/wordsize.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_RDONLY	0x0000
+#define O_WRONLY	0x0001
+#define O_RDWR		0x0002
+#define O_ACCMODE	0x0003
+#define O_APPEND	0x0008
+#define O_ASYNC		0x0040
+#define O_CREAT		0x0200	/* not fcntl */
+#define O_TRUNC		0x0400	/* not fcntl */
+#define O_EXCL		0x0800	/* not fcntl */
+#define O_SYNC		0x2000
+#define O_NONBLOCK	0x4000
+#define O_NDELAY	(0x0004 | O_NONBLOCK)
+#define O_NOCTTY	0x8000	/* not fcntl */
+
+#ifdef __USE_GNU
+# define O_DIRECTORY	0x10000 /* must be a directory */
+# define O_NOFOLLOW	0x20000 /* don't follow links */
+# define O_DIRECT	0x100000 /* direct disk access hint */
+# define O_NOATIME	0x200000 /* Do not set atime.  */
+# define O_CLOEXEC	0x400000 /* Set close_on_exit.  */
+#endif
+
+#ifdef __USE_LARGEFILE64
+# if __WORDSIZE == 64
+#  define O_LARGEFILE	0
+# else
+#  define O_LARGEFILE	0x40000
+# endif
+#endif
+
+/* For now Linux has no 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
+
+/* 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
+
+/* 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.  */
+#if defined __USE_BSD || defined __USE_UNIX98
+# define F_GETOWN	5	/* Get owner of socket (receiver of SIGIO).  */
+# define F_SETOWN	6	/* Set owner of socket (receiver of SIGIO).  */
+#endif
+#ifndef __USE_FILE_OFFSET64
+# define F_GETLK	7	/* Get record locking info.  */
+# define F_SETLK	8	/* Set record locking info (non-blocking).  */
+# define F_SETLKW	9	/* 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
+
+#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
+
+#if __WORDSIZE == 64
+# define F_GETLK64	7	/* Get record locking info.  */
+# define F_SETLK64	8	/* Set record locking info (non-blocking).  */
+# define F_SETLKW64	9	/* Set record locking info (blocking).  */
+#else
+# 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).  */
+#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		1	/* Read lock.  */
+#define F_WRLCK		2	/* Write lock.  */
+#define F_UNLCK		3	/* 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.  */
+    short int __unused;
+  };
+
+#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.  */
+    short int __unused;
+  };
+#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/sparc/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/fenv.h
new file mode 100644
index 0000000..d2ef97e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/fenv.h
@@ -0,0 +1,85 @@
+/* Copyright (C) 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.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+
+/* Define bits representing the exception.  We use the bit positions
+   of the appropriate accrued exception bits from the FSR.  */
+enum
+  {
+    FE_INVALID = 	(1 << 9),
+#define FE_INVALID	FE_INVALID
+    FE_OVERFLOW = 	(1 << 8),
+#define FE_OVERFLOW	FE_OVERFLOW
+    FE_UNDERFLOW = 	(1 << 7),
+#define FE_UNDERFLOW	FE_UNDERFLOW
+    FE_DIVBYZERO = 	(1 << 6),
+#define FE_DIVBYZERO	FE_DIVBYZERO
+    FE_INEXACT = 	(1 << 5)
+#define FE_INEXACT	FE_INEXACT
+  };
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The Sparc FPU supports all of the four defined rounding modes.  We
+   use again the bit positions in the FPU control word as the values
+   for the appropriate macros.  */
+enum
+  {
+    FE_TONEAREST = 	(0U << 30),
+#define FE_TONEAREST	FE_TONEAREST
+    FE_TOWARDZERO = 	(1U << 30),
+#define FE_TOWARDZERO	FE_TOWARDZERO
+    FE_UPWARD = 	(2U << 30),
+#define FE_UPWARD	FE_UPWARD
+    FE_DOWNWARD = 	(3U << 30)
+#define FE_DOWNWARD	FE_DOWNWARD
+  };
+
+#define __FE_ROUND_MASK	(3U << 30)
+
+
+/* Type representing exception flags.  */
+typedef unsigned long int fexcept_t;
+
+
+/* Type representing floating-point environment.  */
+typedef unsigned long int fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((__const fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exception is masked.  */
+# define FE_NOMASK_ENV	((__const fenv_t *) -2)
+#endif
+
+/* For internal use only: access the fp state register.  */
+#if __WORDSIZE == 64
+# define __fenv_stfsr(X)   __asm__ ("stx %%fsr,%0" : "=m" (X))
+# define __fenv_ldfsr(X)   __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (X))
+#else
+# define __fenv_stfsr(X)   __asm__ ("st %%fsr,%0" : "=m" (X))
+# define __fenv_ldfsr(X)   __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X))
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/inotify.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/inotify.h
new file mode 100644
index 0000000..ca62d89
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/inotify.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2005-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_INOTIFY_H
+# error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead."
+#endif
+
+/* Flags for the parameter of inotify_init1.  */
+enum
+  {
+    IN_CLOEXEC = 0x400000,
+#define IN_CLOEXEC IN_CLOEXEC
+    IN_NONBLOCK = 0x004000
+#define IN_NONBLOCK IN_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/ioctls.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/ioctls.h
new file mode 100644
index 0000000..e86c503
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/ioctls.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 1996, 1997 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_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Use the definitions from the kernel header files.  */
+#include <asm/ioctls.h>
+
+/* Oh well, this is necessary since the kernel data structure is
+   different from the user-level version.  */
+#undef  TCGETS
+#undef  TCSETS
+#undef  TCSETSW
+#undef  TCSETSF
+#define TCGETS	_IOR ('T', 8, char[36])
+#define TCSETS	_IOW ('T', 9, char[36])
+#define TCSETSW	_IOW ('T', 10, char[36])
+#define TCSETSF	_IOW ('T', 11, char[36])
+
+#include <linux/sockios.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/ipc.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/ipc.h
new file mode 100644
index 0000000..988dc12
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/ipc.h
@@ -0,0 +1,62 @@
+/* Copyright (C) 1995-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.  */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#ifdef __USE_GNU
+# define IPC_INFO	3		/* See ipcs.  */
+#endif
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;			/* Key.  */
+    __uid_t uid;			/* Owner's user ID.  */
+    __gid_t gid;			/* Owner's group ID.  */
+    __uid_t cuid;			/* Creator's user ID.  */
+    __gid_t cgid;			/* Creator's group ID.  */
+#if __WORDSIZE == 32
+    unsigned short int __pad1;
+    unsigned short int mode;		/* Read/write permission.  */
+    unsigned short int __pad2;
+#else
+    __mode_t mode;			/* Read/write permission.  */
+    unsigned short int __pad1;
+#endif
+    unsigned short int __seq;		/* Sequence number.  */
+    unsigned long long int __unused1;
+    unsigned long long int __unused2;
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/kernel_stat.h
new file mode 100644
index 0000000..f09ae37
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/kernel_stat.h
@@ -0,0 +1,51 @@
+#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... */
+
+#if __WORDSIZE == 64
+#define kernel_stat kernel_stat64
+#else
+struct kernel_stat {
+    unsigned short	st_dev;
+    unsigned long	st_ino;
+    unsigned short	st_mode;
+    short		st_nlink;
+    unsigned short	st_uid;
+    unsigned short	st_gid;
+    unsigned short	st_rdev;
+    long		st_size;
+    struct timespec	st_atim;
+    struct timespec	st_mtim;
+    struct timespec	st_ctim;
+    long		st_blksize;
+    long		st_blocks;
+    unsigned long	__unused4[2];
+};
+
+#endif
+
+struct kernel_stat64 {
+	unsigned long long	st_dev;
+	unsigned long long	st_ino;
+	unsigned int	st_mode;
+	unsigned int	st_nlink;
+	unsigned int	st_uid;
+	unsigned int	st_gid;
+	unsigned long long	st_rdev;
+	unsigned char	__pad3[8];
+	long long	st_size;
+	unsigned int	st_blksize;
+	unsigned char	__pad4[8];
+	unsigned int	st_blocks;
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned int	__unused4;
+	unsigned int	__unused5;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/kernel_types.h
new file mode 100644
index 0000000..a10e075
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/kernel_types.h
@@ -0,0 +1,81 @@
+/* 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
+ */
+#if ! defined __ARCH_SPARC_POSIX_TYPES_H && ! defined __ARCH_SPARC64_POSIX_TYPES_H && !defined __SPARC_POSIX_TYPES_H
+#define __ARCH_SPARC_POSIX_TYPES_H
+#define __ARCH_SPARC64_POSIX_TYPES_H
+#define __SPARC_POSIX_TYPES_H
+
+# if __WORDSIZE == 64
+typedef unsigned long          __kernel_size_t;
+typedef long                   __kernel_ssize_t;
+typedef long                   __kernel_ptrdiff_t;
+typedef long                   __kernel_time_t;
+typedef long                   __kernel_clock_t;
+typedef int                    __kernel_pid_t;
+typedef int                    __kernel_ipc_pid_t;
+typedef unsigned int           __kernel_uid_t;
+typedef unsigned int           __kernel_gid_t;
+typedef unsigned int           __kernel_dev_t;
+typedef unsigned long          __kernel_ino_t;
+typedef unsigned int           __kernel_mode_t;
+typedef unsigned short         __kernel_umode_t;
+typedef unsigned int           __kernel_nlink_t;
+typedef int                    __kernel_daddr_t;
+typedef long                   __kernel_off_t;
+typedef char *                 __kernel_caddr_t;
+typedef unsigned short	       __kernel_uid16_t;
+typedef unsigned short	       __kernel_gid16_t;
+typedef __kernel_uid_t 	       __kernel_old_uid_t;
+typedef __kernel_gid_t         __kernel_old_gid_t;
+typedef __kernel_dev_t         __kernel_old_dev_t;
+typedef long                   __kernel_long_t;
+typedef unsigned long          __kernel_ulong_t;
+typedef __kernel_uid_t	       __kernel_uid32_t;
+typedef __kernel_gid_t	       __kernel_gid32_t;
+typedef int		       __kernel_suseconds_t;
+typedef long long              __kernel_loff_t;
+#else
+typedef unsigned int           __kernel_size_t;
+typedef int                    __kernel_ssize_t;
+typedef long int               __kernel_ptrdiff_t;
+typedef long                   __kernel_time_t;
+typedef long		       __kernel_suseconds_t;
+typedef long                   __kernel_clock_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 short         __kernel_dev_t;
+typedef unsigned long          __kernel_ino_t;
+typedef unsigned short         __kernel_mode_t;
+typedef unsigned short         __kernel_umode_t;
+typedef short                  __kernel_nlink_t;
+typedef long                   __kernel_daddr_t;
+typedef long                   __kernel_off_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 __kernel_dev_t         __kernel_old_dev_t;
+typedef long                   __kernel_long_t;
+typedef unsigned long          __kernel_ulong_t;
+typedef long long              __kernel_loff_t;
+#endif
+
+typedef struct {
+#ifdef __USE_ALL
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* ! defined __ARCH_SPARC_POSIX_TYPES_H && ! defined __ARCH_SPARC64_POSIX_TYPES_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/mathdef.h
new file mode 100644
index 0000000..5cd126f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/mathdef.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2004, 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.  */
+
+#if !defined _MATH_H && !defined _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* FIXME! This file describes properties of the compiler, not the machine;
+   it should not be part of libc!  */
+
+#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
+# define _MATH_H_MATHDEF	1
+
+/* SPARC has both `float' and `double' arithmetic.  */
+typedef float float_t;
+typedef double double_t;
+
+/* 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
+
+# if __WORDSIZE == 32
+/* Signal that in 32bit ABI we do not really have a `long double'.
+   The disables the declaration of all the `long double' function
+   variants.  */
+#  define __NO_LONG_DOUBLE_MATH	1
+# elif !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
+#  define __NO_LONG_DOUBLE_MATH	1
+# endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/mathinline.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/mathinline.h
new file mode 100644
index 0000000..c774dea
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/mathinline.h
@@ -0,0 +1,292 @@
+/* Inline math functions for SPARC.
+   Copyright (C) 1999, 2000, 2001, 2002, 2004, 2006
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.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.  */
+
+#ifndef _MATH_H
+# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#ifdef __GNUC__
+
+#if defined __USE_ISOC99 && !__GNUC_PREREQ (3, 0)
+# undef isgreater
+# undef isgreaterequal
+# undef isless
+# undef islessequal
+# undef islessgreater
+# undef isunordered
+
+# if __WORDSIZE == 32
+
+#  ifndef __NO_LONG_DOUBLE_MATH
+
+#   define __unordered_cmp(x, y) \
+  (__extension__							      \
+   ({ unsigned __r;							      \
+      if (sizeof (x) == 4 && sizeof (y) == 4)				      \
+	{								      \
+	  float __x = (x); float __y = (y);				      \
+	  __asm__ ("fcmps %1,%2; st %%fsr, %0" : "=m" (__r) : "f" (__x),      \
+		   "f" (__y) : "cc");					      \
+	}								      \
+      else if (sizeof (x) <= 8 && sizeof (y) <= 8)			      \
+	{								      \
+	  double __x = (x); double __y = (y);				      \
+	  __asm__ ("fcmpd\t%1,%2\n\tst\t%%fsr,%0" : "=m" (__r) : "f" (__x),   \
+		   "f" (__y) : "cc");					      \
+	}								      \
+      else								      \
+	{								      \
+	  long double __x = (x); long double __y = (y);			      \
+	  extern int _Q_cmp (const long double a, const long double b);	      \
+	  __r = _Q_cmp (__x, __y) << 10;				      \
+	}								      \
+      __r; }))
+
+#  else
+
+#   define __unordered_cmp(x, y) \
+  (__extension__							      \
+   ({ unsigned __r;							      \
+      if (sizeof (x) == 4 && sizeof (y) == 4)				      \
+	{								      \
+	  float __x = (x); float __y = (y);				      \
+	  __asm__ ("fcmps %1,%2; st %%fsr, %0" : "=m" (__r) : "f" (__x),      \
+		   "f" (__y) : "cc");					      \
+	}								      \
+      else								      \
+	{								      \
+	  double __x = (x); double __y = (y);				      \
+	  __asm__ ("fcmpd\t%1,%2\n\tst\t%%fsr,%0" : "=m" (__r) : "f" (__x),   \
+		   "f" (__y) : "cc");					      \
+	}								      \
+      __r; }))
+
+#  endif
+
+#  define isgreater(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (2 << 10))
+#  define isgreaterequal(x, y) ((__unordered_cmp (x, y) & (1 << 10)) == 0)
+#  define isless(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (1 << 10))
+#  define islessequal(x, y) ((__unordered_cmp (x, y) & (2 << 10)) == 0)
+#  define islessgreater(x, y) (((__unordered_cmp (x, y) + (1 << 10)) & (2 << 10)) != 0)
+#  define isunordered(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (3 << 10))
+
+# else /* sparc64 */
+
+#  define __unordered_v9cmp(x, y, op, qop) \
+  (__extension__							      \
+   ({ unsigned __r;							      \
+      if (sizeof (x) == 4 && sizeof (y) == 4)				      \
+	{								      \
+	  float __x = (x); float __y = (y);				      \
+	  __asm__ ("fcmps\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0"	      \
+		   : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc");      \
+	}								      \
+      else if (sizeof (x) <= 8 && sizeof (y) <= 8)			      \
+	{								      \
+	  double __x = (x); double __y = (y);				      \
+	  __asm__ ("fcmpd\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0"	      \
+		   : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc");      \
+	}								      \
+      else								      \
+	{								      \
+	  long double __x = (x); long double __y = (y);			      \
+	  extern int _Qp_cmp (const long double *a, const long double *b);    \
+	  __r = qop;							      \
+	}								      \
+      __r; }))
+
+#  define isgreater(x, y) __unordered_v9cmp(x, y, "g", _Qp_cmp (&__x, &__y) == 2)
+#  define isgreaterequal(x, y) __unordered_v9cmp(x, y, "ge", (_Qp_cmp (&__x, &__y) & 1) == 0)
+#  define isless(x, y) __unordered_v9cmp(x, y, "l", _Qp_cmp (&__x, &__y) == 1)
+#  define islessequal(x, y) __unordered_v9cmp(x, y, "le", (_Qp_cmp (&__x, &__y) & 2) == 0)
+#  define islessgreater(x, y) __unordered_v9cmp(x, y, "lg", ((_Qp_cmp (&__x, &__y) + 1) & 2) != 0)
+#  define isunordered(x, y) __unordered_v9cmp(x, y, "u", _Qp_cmp (&__x, &__y) == 3)
+
+# endif /* sparc64 */
+
+#endif /* __USE_ISOC99 */
+
+#if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) && defined __OPTIMIZE__
+
+# ifdef __cplusplus
+#  define __MATH_INLINE __inline
+# else
+#  define __MATH_INLINE extern __inline
+# endif  /* __cplusplus */
+
+/* The gcc, version 2.7 or below, has problems with all this inlining
+   code.  So disable it for this version of the compiler.  */
+# if __GNUC_PREREQ (2, 8)
+
+#  ifdef __USE_ISOC99
+
+/* Test for negative number.  Used in the signbit() macro.  */
+__MATH_INLINE int
+__NTH (__signbitf (float __x))
+{
+  __extension__ union { float __f; int __i; } __u = { __f: __x };
+  return __u.__i < 0;
+}
+
+#   if __WORDSIZE == 32
+
+__MATH_INLINE int
+__NTH (__signbit (double __x))
+{
+  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+  return __u.__i[0] < 0;
+}
+
+#    ifndef __NO_LONG_DOUBLE_MATH
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
+{
+  __extension__ union { long double __l; int __i[4]; } __u = { __l: __x };
+  return __u.__i[0] < 0;
+}
+#    else
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
+{
+  return __signbit ((double)__x);
+}
+#    endif
+
+#   else /* sparc64 */
+
+__MATH_INLINE int
+__NTH (__signbit (double __x))
+{
+  __extension__ union { double __d; long int __i; } __u = { __d: __x };
+  return __u.__i < 0;
+}
+
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
+{
+  __extension__ union { long double __l; long int __i[2]; } __u = { __l: __x };
+  return __u.__i[0] < 0;
+}
+
+#   endif /* sparc64 */
+
+#  endif /* __USE_ISOC99 */
+
+#  if !defined __NO_MATH_INLINES && !__GNUC_PREREQ (3, 2)
+
+__MATH_INLINE double
+__NTH (sqrt (double __x))
+{
+  register double __r;
+  __asm__ ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x));
+  return __r;
+}
+
+__MATH_INLINE float
+__NTH (sqrtf (float __x))
+{
+  register float __r;
+  __asm__ ("fsqrts %1,%0" : "=f" (__r) : "f" (__x));
+  return __r;
+}
+
+#   if __WORDSIZE == 64
+__MATH_INLINE long double
+__NTH (sqrtl (long double __x))
+{
+  long double __r;
+  extern void _Qp_sqrt (long double *, __const__ long double *);
+  _Qp_sqrt (&__r, &__x);
+  return __r;
+}
+#   elif !defined __NO_LONG_DOUBLE_MATH
+__MATH_INLINE long double
+sqrtl (long double __x) __THROW
+{
+  extern long double _Q_sqrt (__const__ long double);
+  return _Q_sqrt (__x);
+}
+#   endif /* sparc64 */
+
+#  endif /* !__NO_MATH_INLINES && !GCC 3.2+ */
+
+/* This code is used internally in the GNU libc.  */
+#  ifdef __LIBC_INTERNAL_MATH_INLINES
+__MATH_INLINE double
+__ieee754_sqrt (double __x)
+{
+  register double __r;
+  __asm__ ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x));
+  return __r;
+}
+
+__MATH_INLINE float
+__ieee754_sqrtf (float __x)
+{
+  register float __r;
+  __asm__ ("fsqrts %1,%0" : "=f" (__r) : "f" (__x));
+  return __r;
+}
+
+#   if __WORDSIZE == 64
+__MATH_INLINE long double
+__ieee754_sqrtl (long double __x)
+{
+  long double __r;
+  extern void _Qp_sqrt (long double *, __const__ long double *);
+  _Qp_sqrt(&__r, &__x);
+  return __r;
+}
+#   elif !defined __NO_LONG_DOUBLE_MATH
+__MATH_INLINE long double
+__ieee754_sqrtl (long double __x)
+{
+  extern long double _Q_sqrt (__const__ long double);
+  return _Q_sqrt (__x);
+}
+#   endif /* sparc64 */
+#  endif /* __LIBC_INTERNAL_MATH_INLINES */
+# endif /* gcc 2.8+ */
+
+# ifdef __USE_ISOC99
+
+#  ifndef __NO_MATH_INLINES
+
+__MATH_INLINE double __NTH (fdim (double __x, double __y));
+__MATH_INLINE double
+__NTH (fdim (double __x, double __y))
+{
+  return __x <= __y ? 0 : __x - __y;
+}
+
+__MATH_INLINE float __NTH (fdimf (float __x, float __y));
+__MATH_INLINE float
+__NTH (fdimf (float __x, float __y))
+{
+  return __x <= __y ? 0 : __x - __y;
+}
+
+#  endif /* !__NO_MATH_INLINES */
+# endif /* __USE_ISOC99 */
+#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
+#endif /* __GNUC__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/mman.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/mman.h
new file mode 100644
index 0000000..74921e4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/mman.h
@@ -0,0 +1,108 @@
+/* Definitions for POSIX memory map interface.  Linux/SPARC version.
+   Copyright (C) 1997,1999,2000,2003,2005,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.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+   But the kernel header is not namespace clean.  */
+
+
+/* Protections are chosen from these bits, OR'd together.  The
+   implementation does not necessarily support PROT_EXEC or PROT_WRITE
+   without PROT_READ.  The only guarantees are that no writing will be
+   allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ	0x1		/* Page can be read.  */
+#define PROT_WRITE	0x2		/* Page can be written.  */
+#define PROT_EXEC	0x4		/* Page can be executed.  */
+#define PROT_NONE	0x0		/* Page can not be accessed.  */
+#define PROT_GROWSDOWN	0x01000000	/* Extend change to start of
+					   growsdown vma (mprotect only).  */
+#define PROT_GROWSUP	0x02000000	/* Extend change to start of
+					   growsup vma (mprotect only).  */
+
+/* Sharing types (must choose one and only one of these).  */
+#define MAP_SHARED	0x01		/* Share changes.  */
+#define MAP_PRIVATE	0x02		/* Changes are private.  */
+#ifdef __USE_MISC
+# define MAP_TYPE	0x0f		/* Mask for type of mapping.  */
+#endif
+
+/* Other flags.  */
+#define MAP_FIXED	0x10		/* Interpret addr exactly.  */
+#ifdef __USE_MISC
+# define MAP_FILE	0x00
+# define MAP_ANONYMOUS	0x20		/* Don't use a file.  */
+# define MAP_ANON	MAP_ANONYMOUS
+# define MAP_RENAME	MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific.  */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN	0x0200		/* Stack-like segment.  */
+# define MAP_DENYWRITE	0x0800		/* ETXTBSY */
+# define MAP_EXECUTABLE	0x1000		/* Mark it as an executable.  */
+# define MAP_LOCKED	0x0100		/* Lock the mapping.  */
+# define MAP_NORESERVE	0x0040		/* Don't check for reservations.  */
+# define _MAP_NEW	0x80000000	/* Binary compatibility with SunOS.  */
+# define MAP_POPULATE	0x8000		/* Populate (prefault) pagetables.  */
+# define MAP_NONBLOCK	0x10000		/* Do not block on IO.  */
+# define MAP_UNINITIALIZE 0x4000000     /* For anonymous mmap, memory could
+					   be uninitialized. */
+#endif
+
+/* Flags to `msync'.  */
+#define MS_ASYNC	1		/* Sync memory asynchronously.  */
+#define MS_SYNC		4		/* Synchronous memory sync.  */
+#define MS_INVALIDATE	2		/* Invalidate the caches.  */
+
+/* Flags for `mlockall'.  */
+#define MCL_CURRENT	0x2000		/* Lock all currently mapped pages.  */
+#define MCL_FUTURE	0x4000		/* Lock all additions to address
+					   space.  */
+
+/* Flags for `mremap'.  */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE	1
+# define MREMAP_FIXED	2
+#endif
+
+/* Advice to `madvise'.  */
+#ifdef __USE_BSD
+# define MADV_NORMAL	 0	/* No further special treatment.  */
+# define MADV_RANDOM	 1	/* Expect random page references.  */
+# define MADV_SEQUENTIAL 2	/* Expect sequential page references.  */
+# define MADV_WILLNEED	 3	/* Will need these pages.  */
+# define MADV_DONTNEED	 4	/* Don't need these pages.  */
+# define MADV_FREE	 5	/* Content can be freed (Solaris).  */
+# define MADV_REMOVE	 9	/* Remove these pages and resources.  */
+# define MADV_DONTFORK	 10	/* Do not inherit across fork.  */
+# define MADV_DOFORK	 11	/* Do inherit across fork.  */
+#endif
+
+/* The POSIX people had to invent similar names for the same things.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_MADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_MADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+# define POSIX_MADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_MADV_DONTNEED	4 /* Don't need these pages.  */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/msq.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/msq.h
new file mode 100644
index 0000000..1268dc8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/msq.h
@@ -0,0 +1,84 @@
+/* Copyright (C) 1995, 1996, 1997, 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 _SYS_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Define options for message queue functions.  */
+#define MSG_NOERROR	010000	/* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT	020000	/* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition.  */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+
+/* Structure of record for one message inside the kernel.
+   The type `struct msg' is opaque.  */
+struct msqid_ds
+{
+  struct ipc_perm msg_perm;	/* structure describing operation permission */
+#if __WORDSIZE == 32
+  unsigned int __pad1;
+#endif
+  __time_t msg_stime;		/* time of last msgsnd command */
+#if __WORDSIZE == 32
+  unsigned int __pad2;
+#endif
+  __time_t msg_rtime;		/* time of last msgrcv command */
+#if __WORDSIZE == 32
+  unsigned int __pad3;
+#endif
+  __time_t msg_ctime;		/* time of last change */
+  unsigned long int __msg_cbytes; /* current number of bytes on queue */
+  msgqnum_t msg_qnum;		/* number of messages currently on queue */
+  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
+  __pid_t msg_lspid;		/* pid of last msgsnd() */
+  __pid_t msg_lrpid;		/* pid of last msgrcv() */
+  unsigned long int __unused1;
+  unsigned long int __unused2;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes	__msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+  {
+    int msgpool;
+    int msgmap;
+    int msgmax;
+    int msgmnb;
+    int msgmni;
+    int msgssz;
+    int msgtql;
+    unsigned short int msgseg;
+  };
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/poll.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/poll.h
new file mode 100644
index 0000000..53b94bc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/poll.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1997, 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.  */
+
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for.  These bits may be set in `events'
+   to indicate the interesting event types; they will appear in `revents'
+   to indicate the status of the file descriptor.  */
+#define POLLIN		0x001		/* There is data to read.  */
+#define POLLPRI		0x002		/* There is urgent data to read.  */
+#define POLLOUT		0x004		/* Writing now will not block.  */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2.  */
+# define POLLRDNORM	0x040		/* Normal data may be read.  */
+# define POLLRDBAND	0x080		/* Priority data may be read.  */
+# define POLLWRNORM	POLLOUT		/* Writing now will not block.  */
+# define POLLWRBAND	0x100		/* Priority data may be written.  */
+#endif
+
+#ifdef __USE_GNU
+/* These are extensions for Linux.  */
+# define POLLMSG	0x200
+# define POLLREMOVE	0x400
+# define POLLRDHUP	0x800
+#endif
+
+/* Event types always implicitly polled for.  These bits need not be set in
+   `events', but they will appear in `revents' to indicate the status of
+   the file descriptor.  */
+#define POLLERR		0x008		/* Error condition.  */
+#define POLLHUP		0x010		/* Hung up.  */
+#define POLLNVAL	0x020		/* Invalid polling request.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/resource.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/resource.h
new file mode 100644
index 0000000..3f2c600
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/resource.h
@@ -0,0 +1,241 @@
+/* Bit values & structures for resource limits.  Linux/SPARC version.
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 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.  */
+
+#ifndef _SYS_RESOURCE_H
+# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Transmute defines to enumerations.  The macro re-definitions are
+   necessary because some programs want to test for operating system
+   features with #ifdef RUSAGE_SELF.  In ISO C the reflexive
+   definition is a no-op.  */
+
+/* Kinds of resource limit.  */
+enum __rlimit_resource
+{
+  /* Per-process CPU limit, in seconds.  */
+  RLIMIT_CPU = 0,
+#define RLIMIT_CPU RLIMIT_CPU
+
+  /* Largest file that can be created, in bytes.  */
+  RLIMIT_FSIZE = 1,
+#define	RLIMIT_FSIZE RLIMIT_FSIZE
+
+  /* Maximum size of data segment, in bytes.  */
+  RLIMIT_DATA = 2,
+#define	RLIMIT_DATA RLIMIT_DATA
+
+  /* Maximum size of stack segment, in bytes.  */
+  RLIMIT_STACK = 3,
+#define	RLIMIT_STACK RLIMIT_STACK
+
+  /* Largest core file that can be created, in bytes.  */
+  RLIMIT_CORE = 4,
+#define	RLIMIT_CORE RLIMIT_CORE
+
+  /* Largest resident set size, in bytes.
+     This affects swapping; processes that are exceeding their
+     resident set size will be more likely to have physical memory
+     taken from them.  */
+  __RLIMIT_RSS = 5,
+#define	RLIMIT_RSS __RLIMIT_RSS
+
+  /* Number of open files.  */
+  RLIMIT_NOFILE = 6,
+  __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same.  */
+#define RLIMIT_NOFILE RLIMIT_NOFILE
+#define RLIMIT_OFILE __RLIMIT_OFILE
+
+  /* Address space limit (?) */
+  RLIMIT_AS = 9,
+#define RLIMIT_AS RLIMIT_AS
+
+  /* Number of processes.  */
+  __RLIMIT_NPROC = 7,
+#define RLIMIT_NPROC __RLIMIT_NPROC
+
+  /* Locked-in-memory address space.  */
+  __RLIMIT_MEMLOCK = 8,
+#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK
+
+  /* Maximum number of file locks.  */
+  __RLIMIT_LOCKS = 10,
+#define RLIMIT_LOCKS __RLIMIT_LOCKS
+
+  /* Maximum number of pending signals.  */
+  __RLIMIT_SIGPENDING = 11,
+#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING
+
+  /* Maximum bytes in POSIX message queues.  */
+  __RLIMIT_MSGQUEUE = 12,
+#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
+
+  /* Maximum nice priority allowed to raise to.
+     Nice levels 19 .. -20 correspond to 0 .. 39
+     values of this resource limit.  */
+  __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+  /* Maximum realtime priority allowed for non-priviledged
+     processes.  */
+  __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
+
+  __RLIMIT_NLIMITS = 15,
+  __RLIM_NLIMITS = __RLIMIT_NLIMITS
+#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
+#define RLIM_NLIMITS __RLIM_NLIMITS
+};
+
+/* Value to indicate that there is no limit.  */
+#if __WORDSIZE == 64
+
+#ifndef __USE_FILE_OFFSET64
+# define RLIM_INFINITY ((unsigned long int)(~0UL))
+#else
+# define RLIM_INFINITY 0xffffffffffffffffuLL
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define RLIM64_INFINITY 0xffffffffffffffffuLL
+#endif
+
+#else
+
+#ifndef __USE_FILE_OFFSET64
+# define RLIM_INFINITY ((long int)(~0UL >> 1))
+#else
+# define RLIM_INFINITY 0x7fffffffffffffffLL
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define RLIM64_INFINITY 0x7fffffffffffffffLL
+#endif
+
+#endif
+
+/* We can represent all limits.  */
+#define RLIM_SAVED_MAX	RLIM_INFINITY
+#define RLIM_SAVED_CUR	RLIM_INFINITY
+
+
+/* Type for resource quantity measurement.  */
+#ifndef __USE_FILE_OFFSET64
+typedef __rlim_t rlim_t;
+#else
+typedef __rlim64_t rlim_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef __rlim64_t rlim64_t;
+#endif
+
+struct rlimit
+  {
+    /* The current (soft) limit.  */
+    rlim_t rlim_cur;
+    /* The hard limit.  */
+    rlim_t rlim_max;
+  };
+
+#ifdef __USE_LARGEFILE64
+struct rlimit64
+  {
+    /* The current (soft) limit.  */
+    rlim64_t rlim_cur;
+    /* The hard limit.  */
+    rlim64_t rlim_max;
+ };
+#endif
+
+/* Whose usage statistics do you want?  */
+enum __rusage_who
+{
+  /* The calling process.  */
+  RUSAGE_SELF = 0,
+#define RUSAGE_SELF RUSAGE_SELF
+
+  /* All of its terminated child processes.  */
+  RUSAGE_CHILDREN = -1
+#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+};
+
+#define __need_timeval
+#include <bits/time.h>		/* For `struct timeval'.  */
+
+/* Structure which says how much of each resource has been used.  */
+struct rusage
+  {
+    /* Total amount of user time used.  */
+    struct timeval ru_utime;
+    /* Total amount of system time used.  */
+    struct timeval ru_stime;
+    /* Maximum resident set size (in kilobytes).  */
+    long int ru_maxrss;
+    /* Amount of sharing of text segment memory
+       with other processes (kilobyte-seconds).  */
+    long int ru_ixrss;
+    /* Amount of data segment memory used (kilobyte-seconds).  */
+    long int ru_idrss;
+    /* Amount of stack memory used (kilobyte-seconds).  */
+    long int ru_isrss;
+    /* Number of soft page faults (i.e. those serviced by reclaiming
+       a page from the list of pages awaiting reallocation.  */
+    long int ru_minflt;
+    /* Number of hard page faults (i.e. those that required I/O).  */
+    long int ru_majflt;
+    /* Number of times a process was swapped out of physical memory.  */
+    long int ru_nswap;
+    /* Number of input operations via the file system.  Note: This
+       and `ru_oublock' do not include operations with the cache.  */
+    long int ru_inblock;
+    /* Number of output operations via the file system.  */
+    long int ru_oublock;
+    /* Number of IPC messages sent.  */
+    long int ru_msgsnd;
+    /* Number of IPC messages received.  */
+    long int ru_msgrcv;
+    /* Number of signals delivered.  */
+    long int ru_nsignals;
+    /* Number of voluntary context switches, i.e. because the process
+       gave up the process before it had to (usually to wait for some
+       resource to be available).  */
+    long int ru_nvcsw;
+    /* Number of involuntary context switches, i.e. a higher priority process
+       became runnable or the current process used up its time slice.  */
+    long int ru_nivcsw;
+  };
+
+/* Priority limits.  */
+#define PRIO_MIN	-20	/* Minimum priority a process can have.  */
+#define PRIO_MAX	20	/* Maximum priority a process can have.  */
+
+/* The type of the WHICH argument to `getpriority' and `setpriority',
+   indicating what flavor of entity the WHO argument specifies.  */
+enum __priority_which
+{
+  PRIO_PROCESS = 0,		/* WHO is a process ID.  */
+#define PRIO_PROCESS PRIO_PROCESS
+  PRIO_PGRP = 1,		/* WHO is a process group ID.  */
+#define PRIO_PGRP PRIO_PGRP
+  PRIO_USER = 2			/* WHO is a user ID.  */
+#define PRIO_USER PRIO_USER
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sem.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sem.h
new file mode 100644
index 0000000..2880765
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sem.h
@@ -0,0 +1,92 @@
+/* Copyright (C) 1995, 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 _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+#include <bits/wordsize.h>
+
+/* Flags for `semop'.  */
+#define SEM_UNDO	0x1000		/* undo the operation on exit */
+
+/* Commands for `semctl'.  */
+#define GETPID		11		/* get sempid */
+#define GETVAL		12		/* get semval */
+#define GETALL		13		/* get all semval's */
+#define GETNCNT		14		/* get semncnt */
+#define GETZCNT		15		/* get semzcnt */
+#define SETVAL		16		/* set semval */
+#define SETALL		17		/* set all semval's */
+
+
+/* Data structure describing a set of semaphores.  */
+struct semid_ds
+{
+  struct ipc_perm sem_perm;		/* operation permission struct */
+#if __WORDSIZE == 32
+  unsigned int __pad1;
+#endif
+  __time_t sem_otime;			/* last semop() time */
+#if __WORDSIZE == 32
+  unsigned int __pad2;
+#endif
+  __time_t sem_ctime;			/* last time changed by semctl() */
+  unsigned long int sem_nsems;		/* number of semaphores in set */
+  unsigned long int __unused1;
+  unsigned long int __unused2;
+};
+
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;				<= value for SETVAL
+     struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;		<= array for GETALL & SETALL
+     struct seminfo *__buf;		<= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED	1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct  seminfo
+{
+  int semmap;
+  int semmni;
+  int semmns;
+  int semmnu;
+  int semmsl;
+  int semopm;
+  int semume;
+  int semusz;
+  int semvmx;
+  int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/setjmp.h
new file mode 100644
index 0000000..ac5a4b2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/setjmp.h
@@ -0,0 +1,84 @@
+/* Copyright (C) 1997,1999,2000,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_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
+
+#include <bits/wordsize.h>
+
+#if 0 /*__WORDSIZE == 64*/
+
+#ifndef _ASM
+typedef struct __sparc64_jmp_buf
+  {
+    struct __sparc64_jmp_buf	*uc_link;
+    unsigned long		uc_flags;
+    unsigned long		uc_sigmask;
+    struct __sparc64_jmp_buf_mcontext
+      {
+	unsigned long		mc_gregs[19];
+	unsigned long		mc_fp;
+	unsigned long		mc_i7;
+	struct __sparc64_jmp_buf_fpu
+	  {
+	    union
+	      {
+		unsigned int	sregs[32];
+		unsigned long	dregs[32];
+		long double	qregs[16];
+	      }			mcfpu_fpregs;
+	    unsigned long	mcfpu_fprs;
+	    unsigned long	mcfpu_gsr;
+	    void		*mcfpu_fq;
+	    unsigned char	mcfpu_qcnt;
+	    unsigned char	mcfpu_qentsz;
+	    unsigned char	mcfpu_enab;
+	  }			mc_fpregs;
+      }				uc_mcontext;
+  } __jmp_buf[1];
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp)
+
+#else
+
+#if defined __USE_MISC || defined _ASM
+# define JB_SP  0
+# define JB_FP  1
+# define JB_PC  2
+#endif
+
+#ifndef _ASM
+typedef int __jmp_buf[3];
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((int) (address) < (jmpbuf)[JB_SP])
+
+#endif
+
+#endif  /* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/shm.h
new file mode 100644
index 0000000..03decb1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/shm.h
@@ -0,0 +1,111 @@
+/* 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>
+#include <bits/wordsize.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 ())
+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 */
+#if __WORDSIZE == 32
+    unsigned int __pad1;
+#endif
+    __time_t shm_atime;			/* time of last shmat() */
+#if __WORDSIZE == 32
+    unsigned int __pad2;
+#endif
+    __time_t shm_dtime;			/* time of last shmdt() */
+#if __WORDSIZE == 32
+    unsigned int __pad3;
+#endif
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+    size_t shm_segsz;			/* size of segment in bytes */
+    __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 __unused1;
+    unsigned long int __unused2;
+  };
+
+#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 shmmax;
+    unsigned long shmmin;
+    unsigned long shmmni;
+    unsigned long shmseg;
+    unsigned long shmall;
+    unsigned long __unused1;
+    unsigned long __unused2;
+    unsigned long __unused3;
+    unsigned long __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/sparc/bits/sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sigaction.h
new file mode 100644
index 0000000..be9bc02
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sigaction.h
@@ -0,0 +1,64 @@
+/* The proper definitions for Linux/SPARC sigaction.
+   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.  */
+
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives.  */
+struct sigaction {
+#ifdef __USE_POSIX199309
+	union {
+		__sighandler_t sa_handler;
+		void (*sa_sigaction)(int, siginfo_t *, void *);
+	} __sigaction_handler;
+# define sa_handler     __sigaction_handler.sa_handler
+# define sa_sigaction   __sigaction_handler.sa_sigaction
+#else
+	__sighandler_t  sa_handler;
+#endif
+	unsigned long   sa_flags;
+	void            (*sa_restorer)(void);
+	sigset_t        sa_mask;
+};
+
+
+/* Bits in `sa_flags'.  */
+#define	SA_NOCLDSTOP 0x00000008  /* Don't send SIGCHLD when children stop.  */
+#define SA_NOCLDWAIT 0x00000100  /* Don't create zombie on child death.  */
+#define SA_SIGINFO   0x00000200  /* Invoke signal-catching function with
+				    three arguments instead of one.  */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK   0x00000001 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART   0x00000002 /* Restart syscall on signal return.  */
+# define SA_INTERRUPT 0x00000010 /* Historical no-op.  */
+# define SA_NOMASK    0x00000020 /* Don't automatically block the signal when
+				    its handler is being executed.  */
+# define SA_ONESHOT   0x00000004 /* Reset to SIG_DFL on entry to handler.  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NODEFER   SA_NOMASK
+# define SA_RESETHAND SA_ONESHOT
+# define SA_STACK     SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'.  */
+#define	SIG_BLOCK     1		 /* Block signals.  */
+#define	SIG_UNBLOCK   2		 /* Unblock signals.  */
+#define	SIG_SETMASK   4		 /* Set the set of blocked signals.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sigcontext.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sigcontext.h
new file mode 100644
index 0000000..42eca54
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sigcontext.h
@@ -0,0 +1,78 @@
+/* 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.  */
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+
+/* It is quite hard to choose what to put here, because
+   Linux/sparc32 had at least 3 totally incompatible
+   signal stack layouts.
+   This one is for the "new" style signals, which are
+   now delivered unless SA_SIGINFO is requested.  */
+
+struct sigcontext
+  {
+    struct
+      {
+	unsigned int	psr;
+	unsigned int	pc;
+	unsigned int	npc;
+	unsigned int	y;
+	unsigned int	u_regs[16]; /* globals and ins */
+      }			si_regs;
+    int			si_mask;
+  };
+
+#else /* sparc64 */
+
+typedef struct
+  {
+    unsigned int	si_float_regs [64];
+    unsigned long	si_fsr;
+    unsigned long	si_gsr;
+    unsigned long	si_fprs;
+  } __siginfo_fpu_t;
+
+struct sigcontext
+  {
+    char		sigc_info[128];
+    struct
+      {
+	unsigned long	u_regs[16]; /* globals and ins */
+	unsigned long	tstate;
+	unsigned long	tpc;
+	unsigned long	tnpc;
+	unsigned int	y;
+	unsigned int	fprs;
+      }			sigc_regs;
+    __siginfo_fpu_t *	sigc_fpu_save;
+    struct
+      {
+	void *		ss_sp;
+	int		ss_flags;
+	unsigned long	ss_size;
+      }			sigc_stack;
+    unsigned long	sigc_mask;
+};
+
+#endif /* sparc64 */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sigcontextinfo.h
new file mode 100644
index 0000000..2c2770d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sigcontextinfo.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 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.  */
+
+#define SIGCONTEXT struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS
+#define GET_PC(__ctx)	((void *) ((__ctx)->si_regs.pc))
+#define ADVANCE_STACK_FRAME(__next) \
+	((void *) (((unsigned *)(__next))+14))
+
+#define GET_STACK(__ctx)	((void *) (__ctx)->si_regs.u_regs[14])
+#define GET_FRAME(__ctx)	ADVANCE_STACK_FRAME (GET_STACK(__ctx))
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/siginfo.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/siginfo.h
new file mode 100644
index 0000000..7ff1971
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/siginfo.h
@@ -0,0 +1,318 @@
+/* siginfo_t, sigevent and constants.  Linux/SPARC version.
+   Copyright (C) 1997-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.  */
+
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+    && !defined __need_sigevent_t
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+#if (!defined __have_sigval_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t \
+	 || defined __need_sigevent_t))
+# define __have_sigval_t	1
+
+/* Type for data associated with a signal.  */
+typedef union sigval
+  {
+    int sival_int;
+    void *sival_ptr;
+  } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t	1
+
+# define __SI_MAX_SIZE     128
+# if __WORDSIZE == 64
+#  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+typedef struct siginfo
+  {
+    int si_signo;		/* Signal number.  */
+    int si_errno;		/* If non-zero, an errno value associated with
+				   this signal, as defined in <errno.h>.  */
+    int si_code;		/* Signal code.  */
+
+    union
+      {
+	int _pad[__SI_PAD_SIZE];
+
+	 /* kill().  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	  } _kill;
+
+	/* POSIX.1b timers.  */
+	struct
+	  {
+	    int si_tid;		/* Timer ID.  */
+	    int si_overrun;	/* Overrun count.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _timer;
+
+	/* POSIX.1b signals.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _rt;
+
+	/* SIGCHLD.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Which child.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    int si_status;	/* Exit value or signal.  */
+	    __clock_t si_utime;
+	    __clock_t si_stime;
+	  } _sigchld;
+
+	/* SIGILL, SIGFPE, SIGSEGV, SIGBUS.  */
+	struct
+	  {
+	    void *si_addr;	/* Faulting insn/memory ref.  */
+	    int si_trapno;
+	  } _sigfault;
+
+	/* SIGPOLL.  */
+	struct
+	  {
+	    int si_band;	/* Band event for SIGPOLL.  */
+	    int si_fd;
+	  } _sigpoll;
+      } _sifields;
+  } siginfo_t;
+
+
+/* X/Open requires some more fields with fixed names.  */
+# define si_pid		_sifields._kill.si_pid
+# define si_uid		_sifields._kill.si_uid
+# define si_timerid	_sifields._timer.si_tid
+# define si_overrun	_sifields._timer.si_overrun
+# define si_status	_sifields._sigchld.si_status
+# define si_utime	_sifields._sigchld.si_utime
+# define si_stime	_sifields._sigchld.si_stime
+# define si_value	_sifields._rt.si_sigval
+# define si_int		_sifields._rt.si_sigval.sival_int
+# define si_ptr		_sifields._rt.si_sigval.sival_ptr
+# define si_addr	_sifields._sigfault.si_addr
+# define si_trapno	_sifields._sigfault.si_trapno
+# define si_band	_sifields._sigpoll.si_band
+# define si_fd		_sifields._sigpoll.si_fd
+
+
+/* Values for `si_code'.  Positive values are reserved for kernel-generated
+   signals.  */
+enum
+{
+  SI_ASYNCNL = -60,		/* Sent by asynch name lookup completion.  */
+# define SI_ASYNCNL	SI_ASYNCNL
+  SI_TKILL = -6,		/* Sent by tkill.  */
+# define SI_TKILL	SI_TKILL
+  SI_SIGIO,			/* Sent by queued SIGIO. */
+# define SI_SIGIO	SI_SIGIO
+  SI_ASYNCIO,			/* Sent by AIO completion.  */
+# define SI_ASYNCIO	SI_ASYNCIO
+  SI_MESGQ,			/* Sent by real time mesq state change.  */
+# define SI_MESGQ	SI_MESGQ
+  SI_TIMER,			/* Sent by timer expiration.  */
+# define SI_TIMER	SI_TIMER
+  SI_QUEUE,			/* Sent by sigqueue.  */
+# define SI_QUEUE	SI_QUEUE
+  SI_USER,			/* Sent by kill, sigsend, raise.  */
+# define SI_USER	SI_USER
+  SI_KERNEL = 0x80		/* Send by kernel.  */
+#define SI_KERNEL	SI_KERNEL
+};
+
+
+/* `si_code' values for SIGILL signal.  */
+enum
+{
+  ILL_ILLOPC = 1,		/* Illegal opcode.  */
+# define ILL_ILLOPC	ILL_ILLOPC
+  ILL_ILLOPN,			/* Illegal operand.  */
+# define ILL_ILLOPN	ILL_ILLOPN
+  ILL_ILLADR,			/* Illegal addressing mode.  */
+# define ILL_ILLADR	ILL_ILLADR
+  ILL_ILLTRP,			/* Illegal trap. */
+# define ILL_ILLTRP	ILL_ILLTRP
+  ILL_PRVOPC,			/* Privileged opcode.  */
+# define ILL_PRVOPC	ILL_PRVOPC
+  ILL_PRVREG,			/* Privileged register.  */
+# define ILL_PRVREG	ILL_PRVREG
+  ILL_COPROC,			/* Coprocessor error.  */
+# define ILL_COPROC	ILL_COPROC
+  ILL_BADSTK			/* Internal stack error.  */
+# define ILL_BADSTK	ILL_BADSTK
+};
+
+/* `si_code' values for SIGFPE signal.  */
+enum
+{
+  FPE_INTDIV = 1,		/* Integer divide by zero.  */
+# define FPE_INTDIV	FPE_INTDIV
+  FPE_INTOVF,			/* Integer overflow.  */
+# define FPE_INTOVF	FPE_INTOVF
+  FPE_FLTDIV,			/* Floating point divide by zero.  */
+# define FPE_FLTDIV	FPE_FLTDIV
+  FPE_FLTOVF,			/* Floating point overflow.  */
+# define FPE_FLTOVF	FPE_FLTOVF
+  FPE_FLTUND,			/* Floating point underflow.  */
+# define FPE_FLTUND	FPE_FLTUND
+  FPE_FLTRES,			/* Floating point inexact result.  */
+# define FPE_FLTRES	FPE_FLTRES
+  FPE_FLTINV,			/* Floating point invalid operation.  */
+# define FPE_FLTINV	FPE_FLTINV
+  FPE_FLTSUB			/* Subscript out of range.  */
+# define FPE_FLTSUB	FPE_FLTSUB
+};
+
+/* `si_code' values for SIGSEGV signal.  */
+enum
+{
+  SEGV_MAPERR = 1,		/* Address not mapped to object.  */
+# define SEGV_MAPERR	SEGV_MAPERR
+  SEGV_ACCERR			/* Invalid permissions for mapped object.  */
+# define SEGV_ACCERR	SEGV_ACCERR
+};
+
+/* `si_code' values for SIGBUS signal.  */
+enum
+{
+  BUS_ADRALN = 1,		/* Invalid address alignment.  */
+# define BUS_ADRALN	BUS_ADRALN
+  BUS_ADRERR,			/* Non-existant physical address.  */
+# define BUS_ADRERR	BUS_ADRERR
+  BUS_OBJERR			/* Object specific hardware error.  */
+# define BUS_OBJERR	BUS_OBJERR
+};
+
+/* `si_code' values for SIGTRAP signal.  */
+enum
+{
+  TRAP_BRKPT = 1,		/* Process breakpoint.  */
+# define TRAP_BRKPT	TRAP_BRKPT
+  TRAP_TRACE			/* Process trace trap.  */
+# define TRAP_TRACE	TRAP_TRACE
+};
+
+/* `si_code' values for SIGCHLD signal.  */
+enum
+{
+  CLD_EXITED = 1,		/* Child has exited.  */
+# define CLD_EXITED	CLD_EXITED
+  CLD_KILLED,			/* Child was killed.  */
+# define CLD_KILLED	CLD_KILLED
+  CLD_DUMPED,			/* Child terminated abnormally.  */
+# define CLD_DUMPED	CLD_DUMPED
+  CLD_TRAPPED,			/* Traced child has trapped.  */
+# define CLD_TRAPPED	CLD_TRAPPED
+  CLD_STOPPED,			/* Child has stopped.  */
+# define CLD_STOPPED	CLD_STOPPED
+  CLD_CONTINUED			/* Stopped child has continued.  */
+# define CLD_CONTINUED	CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal.  */
+enum
+{
+  POLL_IN = 1,			/* Data input available.  */
+# define POLL_IN	POLL_IN
+  POLL_OUT,			/* Output buffers available.  */
+# define POLL_OUT	POLL_OUT
+  POLL_MSG,			/* Input message available.   */
+# define POLL_MSG	POLL_MSG
+  POLL_ERR,			/* I/O error.  */
+# define POLL_ERR	POLL_ERR
+  POLL_PRI,			/* High priority input available.  */
+# define POLL_PRI	POLL_PRI
+  POLL_HUP			/* Device disconnected.  */
+# define POLL_HUP	POLL_HUP
+};
+
+/* `si_code' values for SIGEMT signal.  */
+enum
+{
+  EMT_TAGOVF = 1		/* Tag overflow.  */
+# define EMT_TAGOVF	EMT_TAGOVF
+};
+
+# undef __need_siginfo_t
+#endif	/* !have siginfo_t && (have _SIGNAL_H || need siginfo_t).  */
+
+
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+    && !defined __have_sigevent_t
+# define __have_sigevent_t	1
+
+/* Structure to transport application-defined values with signals.  */
+# define __SIGEV_MAX_SIZE	64
+# if __WORDSIZE == 64
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+typedef struct sigevent
+  {
+    sigval_t sigev_value;
+    int sigev_signo;
+    int sigev_notify;
+
+    union
+      {
+	int _pad[__SIGEV_PAD_SIZE];
+
+	struct
+	  {
+	    void (*_function) (sigval_t);	/* Function to start.  */
+	    void *_attribute;			/* Really pthread_attr_t.  */
+	  } _sigev_thread;
+      } _sigev_un;
+  } sigevent_t;
+
+/* POSIX names to access some of the members.  */
+# define sigev_notify_function   _sigev_un._sigev_thread._function
+# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+/* `sigev_notify' values.  */
+enum
+{
+  SIGEV_SIGNAL = 0,		/* Notify via signal.  */
+# define SIGEV_SIGNAL	SIGEV_SIGNAL
+  SIGEV_NONE,			/* Other notification: meaningless.  */
+# define SIGEV_NONE	SIGEV_NONE
+  SIGEV_THREAD,			/* Deliver via thread creation.  */
+# define SIGEV_THREAD	SIGEV_THREAD
+
+  SIGEV_THREAD_ID = 4		/* Send signal to specific thread.  */
+#define SIGEV_THREAD_ID	SIGEV_THREAD_ID
+};
+
+#endif	/* have _SIGNAL_H.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/signalfd.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/signalfd.h
new file mode 100644
index 0000000..1271e34
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/signalfd.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2007-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_SIGNALFD_H
+# error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead."
+#endif
+
+/* Flags for signalfd.  */
+enum
+  {
+    SFD_CLOEXEC = 0x400000,
+#define SFD_CLOEXEC SFD_CLOEXEC
+    SFD_NONBLOCK = 0x004000
+#define SFD_NONBLOCK SFD_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/signum.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/signum.h
new file mode 100644
index 0000000..2dcbb3c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/signum.h
@@ -0,0 +1,64 @@
+/* Signal number definitions.  Linux/SPARC version.
+   Copyright (C) 1996, 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.  */
+
+#ifdef	_SIGNAL_H
+
+/*
+ * Linux/SPARC has different signal numbers that Linux/i386: I'm trying
+ * to make it OSF/1 binary compatible, at least for normal binaries.
+ */
+#define SIGHUP		 1
+#define SIGINT		 2
+#define SIGQUIT		 3
+#define SIGILL		 4
+#define SIGTRAP		 5
+#define SIGABRT		 6
+#define SIGIOT		 6
+#define SIGEMT           7
+#define SIGFPE		 8
+#define SIGKILL		 9
+#define SIGBUS          10
+#define SIGSEGV		11
+#define SIGSYS		12
+#define SIGPIPE		13
+#define SIGALRM		14
+#define SIGTERM		15
+#define SIGURG          16
+
+/* SunOS values which deviate from the Linux/i386 ones */
+#define SIGSTOP		17
+#define SIGTSTP		18
+#define SIGCONT		19
+#define SIGCHLD		20
+#define SIGCLD		SIGCHLD	/* Same as SIGCHLD (System V).  */
+#define SIGTTIN		21
+#define SIGTTOU		22
+#define SIGIO		23
+#define SIGPOLL		SIGIO   /* SysV name for SIGIO */
+#define SIGXCPU		24
+#define SIGXFSZ		25
+#define SIGVTALRM	26
+#define SIGPROF		27
+#define SIGWINCH	28
+#define SIGLOST		29
+#define SIGPWR          SIGLOST
+#define SIGUSR1		30
+#define SIGUSR2		31
+
+#endif	/* <signal.h> included.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sigstack.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sigstack.h
new file mode 100644
index 0000000..432ec83
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/sigstack.h
@@ -0,0 +1,57 @@
+/* sigstack, sigaltstack definitions.
+   Copyright (C) 1998, 1999, 2002 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 _SIGNAL_H
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+
+#if defined __UCLIBC_SUSV4_LEGACY__ || !defined __STRICT_HEADERS__
+/* Structure describing a signal stack (obsolete).  */
+struct sigstack
+  {
+    void *ss_sp;		/* Signal stack pointer.  */
+    int ss_onstack;		/* Nonzero if executing on this stack.  */
+  };
+#endif
+
+
+/* Possible values for `ss_flags.'.  */
+enum
+{
+  SS_ONSTACK = 1,
+#define SS_ONSTACK	SS_ONSTACK
+  SS_DISABLE
+#define SS_DISABLE	SS_DISABLE
+};
+
+/* Minimum stack size for a signal handler.  */
+#define MINSIGSTKSZ	4096
+
+/* System default stack size.  */
+#define SIGSTKSZ	16384
+
+
+/* Alternate, preferred interface.  */
+typedef struct sigaltstack
+  {
+    void *ss_sp;
+    int ss_flags;
+    size_t ss_size;
+  } stack_t;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/socket.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/socket.h
new file mode 100644
index 0000000..64973e2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/socket.h
@@ -0,0 +1,376 @@
+/* System-specific socket constants and types.  Linux version.
+   Copyright (C) 1991,1992,1994-2001,2004,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.  */
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H
+
+#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+#define	__need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#include <limits.h>
+#include <sys/types.h>
+
+/* Type for length arguments in socket calls.  */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+/* Types of sockets.  */
+enum __socket_type
+{
+  SOCK_STREAM = 1,		/* Sequenced, reliable, connection-based
+				   byte streams.  */
+#define SOCK_STREAM SOCK_STREAM
+  SOCK_DGRAM = 2,		/* Connectionless, unreliable datagrams
+				   of fixed maximum length.  */
+#define SOCK_DGRAM SOCK_DGRAM
+  SOCK_RAW = 3,			/* Raw protocol interface.  */
+#define SOCK_RAW SOCK_RAW
+  SOCK_RDM = 4,			/* Reliably-delivered messages.  */
+#define SOCK_RDM SOCK_RDM
+  SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based,
+				   datagrams of fixed maximum length.  */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+  SOCK_PACKET = 10		/* Linux specific way of getting packets
+				   at the dev level.  For writing rarp and
+				   other similar things on the user level. */
+#define SOCK_PACKET SOCK_PACKET
+};
+
+/* Protocol families.  */
+#define	PF_UNSPEC	0	/* Unspecified.  */
+#define	PF_LOCAL	1	/* Local to host (pipes and file-domain).  */
+#define	PF_UNIX		PF_LOCAL /* Old BSD name for PF_LOCAL.  */
+#define	PF_FILE		PF_LOCAL /* Another non-standard name for PF_LOCAL.  */
+#define	PF_INET		2	/* IP protocol family.  */
+#define	PF_AX25		3	/* Amateur Radio AX.25.  */
+#define	PF_IPX		4	/* Novell Internet Protocol.  */
+#define	PF_APPLETALK	5	/* Appletalk DDP.  */
+#define	PF_NETROM	6	/* Amateur radio NetROM.  */
+#define	PF_BRIDGE	7	/* Multiprotocol bridge.  */
+#define	PF_ATMPVC	8	/* ATM PVCs.  */
+#define	PF_X25		9	/* Reserved for X.25 project.  */
+#define	PF_INET6	10	/* IP version 6.  */
+#define	PF_ROSE		11	/* Amateur Radio X.25 PLP.  */
+#define	PF_DECnet	12	/* Reserved for DECnet project.  */
+#define	PF_NETBEUI	13	/* Reserved for 802.2LLC project.  */
+#define	PF_SECURITY	14	/* Security callback pseudo AF.  */
+#define	PF_KEY		15	/* PF_KEY key management API.  */
+#define	PF_NETLINK	16
+#define	PF_ROUTE	PF_NETLINK /* Alias to emulate 4.4BSD.  */
+#define	PF_PACKET	17	/* Packet family.  */
+#define	PF_ASH		18	/* Ash.  */
+#define	PF_ECONET	19	/* Acorn Econet.  */
+#define	PF_ATMSVC	20	/* ATM SVCs.  */
+#define	PF_SNA		22	/* Linux SNA Project */
+#define	PF_IRDA		23	/* IRDA sockets.  */
+#define	PF_PPPOX	24	/* PPPoX sockets.  */
+#define	PF_WANPIPE	25	/* Wanpipe API sockets.  */
+#define	PF_LLC		26	/* Linux LLC.  */
+#define	PF_CAN		29	/* Controller Area Network.  */
+#define	PF_TIPC		30	/* TIPC sockets.  */
+#define	PF_BLUETOOTH	31	/* Bluetooth sockets.  */
+#define	PF_IUCV		32	/* IUCV sockets.  */
+#define	PF_RXRPC	33	/* RxRPC sockets.  */
+#define	PF_ISDN		34	/* mISDN sockets.  */
+#define	PF_PHONET	35	/* Phonet sockets.  */
+#define	PF_IEEE802154	36	/* IEEE 802.15.4 sockets.  */
+#define	PF_CAIF		37	/* CAIF sockets.  */
+#define	PF_ALG		38	/* Algorithm sockets.  */
+#define	PF_MAX		39	/* For now..  */
+
+/* Address families.  */
+#define	AF_UNSPEC	PF_UNSPEC
+#define	AF_LOCAL	PF_LOCAL
+#define	AF_UNIX		PF_UNIX
+#define	AF_FILE		PF_FILE
+#define	AF_INET		PF_INET
+#define	AF_AX25		PF_AX25
+#define	AF_IPX		PF_IPX
+#define	AF_APPLETALK	PF_APPLETALK
+#define	AF_NETROM	PF_NETROM
+#define	AF_BRIDGE	PF_BRIDGE
+#define	AF_ATMPVC	PF_ATMPVC
+#define	AF_X25		PF_X25
+#define	AF_INET6	PF_INET6
+#define	AF_ROSE		PF_ROSE
+#define	AF_DECnet	PF_DECnet
+#define	AF_NETBEUI	PF_NETBEUI
+#define	AF_SECURITY	PF_SECURITY
+#define	AF_KEY		PF_KEY
+#define	AF_NETLINK	PF_NETLINK
+#define	AF_ROUTE	PF_ROUTE
+#define	AF_PACKET	PF_PACKET
+#define	AF_ASH		PF_ASH
+#define	AF_ECONET	PF_ECONET
+#define	AF_ATMSVC	PF_ATMSVC
+#define	AF_SNA		PF_SNA
+#define	AF_IRDA		PF_IRDA
+#define	AF_PPPOX	PF_PPPOX
+#define	AF_WANPIPE	PF_WANPIPE
+#define	AF_LLC		PF_LLC
+#define	AF_CAN		PF_CAN
+#define	AF_TIPC		PF_TIPC
+#define	AF_BLUETOOTH	PF_BLUETOOTH
+#define	AF_IUCV		PF_IUCV
+#define	AF_RXRPC	PF_RXRPC
+#define	AF_ISDN		PF_ISDN
+#define	AF_PHONET	PF_PHONET
+#define	AF_IEEE802154	PF_IEEE802154
+#define	AF_CAIF		PF_CAIF
+#define	AF_ALG		PF_ALG
+#define	AF_MAX		PF_MAX
+
+/* Socket level values.  Others are defined in the appropriate headers.
+
+   XXX These definitions also should go into the appropriate headers as
+   far as they are available.  */
+#define SOL_RAW		255
+#define SOL_DECNET      261
+#define SOL_X25         262
+#define SOL_PACKET	263
+#define SOL_ATM		264	/* ATM layer (cell level).  */
+#define SOL_AAL		265	/* ATM Adaption Layer (packet level).  */
+#define SOL_IRDA	266
+
+/* Maximum queue length specifiable by listen.  */
+#define SOMAXCONN	128
+
+/* Get the definition of the macro to define the common sockaddr members.  */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address.  */
+struct sockaddr
+  {
+    __SOCKADDR_COMMON (sa_);	/* Common data: address family and length.  */
+    char sa_data[14];		/* Address data.  */
+  };
+
+
+/* Structure large enough to hold any socket address (with the historical
+   exception of AF_UNIX).  We reserve 128 bytes.  */
+#if ULONG_MAX > 0xffffffff
+# define __ss_aligntype	__uint64_t
+#else
+# define __ss_aligntype	__uint32_t
+#endif
+#define _SS_SIZE	128
+#define _SS_PADSIZE	(_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (ss_);	/* Address family, etc.  */
+    __ss_aligntype __ss_align;	/* Force desired alignment.  */
+    char __ss_padding[_SS_PADSIZE];
+  };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al.  */
+enum
+  {
+    MSG_OOB		= 0x01,	/* Process out-of-band data.  */
+#define MSG_OOB		MSG_OOB
+    MSG_PEEK		= 0x02,	/* Peek at incoming messages.  */
+#define MSG_PEEK	MSG_PEEK
+    MSG_DONTROUTE	= 0x04,	/* Don't use local routing.  */
+#define MSG_DONTROUTE	MSG_DONTROUTE
+#ifdef __USE_GNU
+    /* DECnet uses a different name.  */
+    MSG_TRYHARD		= MSG_DONTROUTE,
+# define MSG_TRYHARD	MSG_DONTROUTE
+#endif
+    MSG_CTRUNC		= 0x08,	/* Control data lost before delivery.  */
+#define MSG_CTRUNC	MSG_CTRUNC
+    MSG_PROXY		= 0x10,	/* Supply or ask second address.  */
+#define MSG_PROXY	MSG_PROXY
+    MSG_TRUNC		= 0x20,
+#define	MSG_TRUNC	MSG_TRUNC
+    MSG_DONTWAIT	= 0x40, /* Nonblocking IO.  */
+#define	MSG_DONTWAIT	MSG_DONTWAIT
+    MSG_EOR		= 0x80, /* End of record.  */
+#define	MSG_EOR		MSG_EOR
+    MSG_WAITALL		= 0x100, /* Wait for a full request.  */
+#define	MSG_WAITALL	MSG_WAITALL
+    MSG_FIN		= 0x200,
+#define	MSG_FIN		MSG_FIN
+    MSG_SYN		= 0x400,
+#define	MSG_SYN		MSG_SYN
+    MSG_CONFIRM		= 0x800, /* Confirm path validity.  */
+#define	MSG_CONFIRM	MSG_CONFIRM
+    MSG_RST		= 0x1000,
+#define	MSG_RST		MSG_RST
+    MSG_ERRQUEUE	= 0x2000, /* Fetch message from error queue.  */
+#define	MSG_ERRQUEUE	MSG_ERRQUEUE
+    MSG_NOSIGNAL	= 0x4000, /* Do not generate SIGPIPE.  */
+#define	MSG_NOSIGNAL	MSG_NOSIGNAL
+    MSG_MORE		= 0x8000  /* Sender will send more.  */
+#define	MSG_MORE	MSG_MORE
+  };
+
+
+/* Structure describing messages sent by
+   `sendmsg' and received by `recvmsg'.  */
+/* Note: do not change these members to match glibc; these match the
+   SuSv3 spec already (e.g. msg_iovlen/msg_controllen).
+   http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html */
+/* Note: linux kernel uses __kernel_size_t (which is 8bytes on 64bit
+   platforms, and 4bytes on 32bit platforms) for msg_iovlen/msg_controllen */
+struct msghdr
+  {
+    void *msg_name;		/* Address to send to/receive from.  */
+    socklen_t msg_namelen;	/* Length of address data.  */
+
+    struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
+#if __WORDSIZE == 32
+    int msg_iovlen;		/* Number of elements in the vector.  */
+#else
+    size_t msg_iovlen;		/* Number of elements in the vector.  */
+#endif
+
+    void *msg_control;		/* Ancillary data (eg BSD filedesc passing). */
+#if __WORDSIZE == 32
+    socklen_t msg_controllen;	/* Ancillary data buffer length.  */
+#else
+    size_t msg_controllen;	/* Ancillary data buffer length.  */
+#endif
+
+    int msg_flags;		/* Flags on received message.  */
+  };
+
+/* Structure used for storage of ancillary data object information.  */
+struct cmsghdr
+  {
+    size_t cmsg_len;		/* Length of data in cmsg_data plus length
+				   of cmsghdr structure.  */
+    int cmsg_level;		/* Originating protocol.  */
+    int cmsg_type;		/* Protocol specific type.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+    __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data.  */
+#endif
+  };
+
+/* Ancillary data object manipulation macros.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
+#endif
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+#define CMSG_FIRSTHDR(mhdr) \
+  ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)		      \
+   ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
+			 & (size_t) ~(sizeof (size_t) - 1))
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+				      struct cmsghdr *__cmsg) __THROW;
+libc_hidden_proto(__cmsg_nxthdr)
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+#  define _EXTERN_INLINE extern __inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+{
+  if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+    /* The kernel header does this so there may be a reason.  */
+    return 0;
+
+  __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+			       + CMSG_ALIGN (__cmsg->cmsg_len));
+  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+					+ __mhdr->msg_controllen)
+      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+    /* No more entries.  */
+    return 0;
+  return __cmsg;
+}
+#endif	/* Use `extern inline'.  */
+
+/* Socket level message types.  This must match the definitions in
+   <linux/socket.h>.  */
+enum
+  {
+    SCM_RIGHTS = 0x01		/* Transfer file descriptors.  */
+#define SCM_RIGHTS SCM_RIGHTS
+#ifdef __USE_BSD
+    , SCM_CREDENTIALS = 0x02	/* Credentials passing.  */
+# define SCM_CREDENTIALS SCM_CREDENTIALS
+#endif
+  };
+
+/* User visible structure for SCM_CREDENTIALS message */
+
+struct ucred
+{
+  pid_t pid;			/* PID of sending process.  */
+  uid_t uid;			/* UID of sending process.  */
+  gid_t gid;			/* GID of sending process.  */
+};
+
+/* Get socket manipulation related informations from kernel headers.  */
+#ifndef __GLIBC__
+#define __GLIBC__ 2
+#include <asm/socket.h>
+#undef __GLIBC__
+#else
+#include <asm/socket.h>
+#endif
+
+
+/* Structure used to manipulate the SO_LINGER option.  */
+struct linger
+  {
+    int l_onoff;		/* Nonzero to linger on close.  */
+    int l_linger;		/* Time to linger.  */
+  };
+
+/* Prefer socketcall over all these for sparc32, 
+   since it only has socketcall */
+#ifndef __arch64__
+ #undef __NR_accept
+ #undef __NR_bind
+ #undef __NR_connect
+ #undef __NR_getpeername
+ #undef __NR_getsockname
+ #undef __NR_getsockopt
+ #undef __NR_listen
+ #undef __NR_recv
+ #undef __NR_recvfrom
+ #undef __NR_recvmsg
+ #undef __NR_send
+ #undef __NR_sendmsg
+ #undef __NR_sendto
+ #undef __NR_setsockopt
+ #undef __NR_shutdown
+ #undef __NR_socket
+ #undef __NR_socketpair
+#endif
+
+#endif	/* bits/socket.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/stackinfo.h
new file mode 100644
index 0000000..fd34e2d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/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 sparc the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/stat.h
new file mode 100644
index 0000000..7426e16
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/stat.h
@@ -0,0 +1,169 @@
+/* Copyright (C) 1992, 1995-2002, 2006, 2009 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_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_LINUX_OLD	1
+#define _STAT_VER_KERNEL	1
+#define _STAT_VER_SVR4		2
+#define _STAT_VER_LINUX		3
+#define _STAT_VER		_STAT_VER_LINUX	/* The one defined below.  */
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	1
+#define _MKNOD_VER_SVR4		2
+#define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below.  */
+
+
+struct stat
+  {
+    __dev_t st_dev;			/* Device.  */
+#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+    unsigned short int __pad1;
+    __ino_t st_ino;			/* File serial number.	*/
+#else
+    __ino64_t st_ino;			/* File serial number.	*/
+#endif
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned short int __pad2;
+#ifndef __USE_FILE_OFFSET64
+    __off_t st_size;			/* Size of file, in bytes.  */
+#else
+    __off64_t st_size;			/* Size of file, in bytes.  */
+#endif
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+#ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+#else
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#endif
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+  };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;			/* Device.  */
+#if __WORDSIZE == 64
+    unsigned short int __pad1;
+#endif
+    __ino64_t st_ino;			/* File serial number.	*/
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned short int __pad2;
+    __off64_t st_size;			/* Size of file, in bytes.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/syscalls.h
new file mode 100644
index 0000000..948c2fa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/syscalls.h
@@ -0,0 +1,119 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#ifndef __ASSEMBLER__
+
+#if __WORDSIZE == 32
+# define __SYSCALL_STRING \
+	"t 0x10\n\t" \
+	"bcc 1f\n\t" \
+	"mov %%o0, %0\n\t" \
+	"sub %%g0, %%o0, %0\n\t" \
+	"1:\n\t"
+#elif __WORDSIZE == 64
+# define __SYSCALL_STRING \
+	"t 0x6d\n\t" \
+	"sub %%g0, %%o0, %0\n\t" \
+	"movcc %%xcc, %%o0, %0\n\t"
+#else
+# error unknown __WORDSIZE
+#endif
+
+#define __SYSCALL_CLOBBERS "cc", "memory"
+
+#ifndef NOT_IN_libc
+#define DEBUG_SYSCALL(name) { \
+      char d[64];\
+      write( 2, d, snprintf( d, 64, "syscall %d error %d\n", __NR_##name, _inline_sys_result)); \
+}
+#else
+#define DEBUG_SYSCALL(name) do{} while(0)
+#endif
+
+#define INTERNAL_SYSCALL_NCS(sys_num, err, nr, args...) \
+(__extension__ \
+    ({                                                      \
+        unsigned int __res;                                 \
+        {                                                   \
+            register long __o0 __asm__("o0");               \
+            register long __g1 __asm__("g1") = sys_num;     \
+            LOAD_ARGS_##nr(args)                            \
+            __asm__ __volatile__( __SYSCALL_STRING          \
+                : "=r" (__res), "=&r" (__o0)                \
+                : "1" (__o0) ASM_ARGS_##nr, "r" (__g1)     \
+                : __SYSCALL_CLOBBERS );                                   \
+        }                                                   \
+        (int)__res;                                         \
+     }) \
+)
+#define INTERNAL_SYSCALL_ERROR_P(val, err) \
+  ((unsigned int) (val) >= 0xfffff001u)
+
+# define CALL_ERRNO_LOCATION "call   __errno_location;"
+#define __CLONE_SYSCALL_STRING						\
+	"ta	0x10;"							\
+	"bcs	2f;"							\
+	" sub	%%o1, 1, %%o1;"						\
+	"and	%%o0, %%o1, %%o0;"					\
+	"1:"								\
+	".subsection 2;"						\
+	"2:"								\
+	"save	%%sp, -192, %%sp;"					\
+	CALL_ERRNO_LOCATION						\
+	" nop;"								\
+	"st	%%i0, [%%o0];"						\
+	"ba	1b;"							\
+	" restore %%g0, -1, %%o0;"					\
+	".previous;"
+
+#define INLINE_CLONE_SYSCALL(arg1,arg2,arg3,arg4,arg5)			\
+({									\
+	register long __o0 __asm__ ("o0") = (long)(arg1);		\
+	register long __o1 __asm__ ("o1") = (long)(arg2);		\
+	register long __o2 __asm__ ("o2") = (long)(arg3);		\
+	register long __o3 __asm__ ("o3") = (long)(arg4);		\
+	register long __o4 __asm__ ("o4") = (long)(arg5);		\
+	register long __g1 __asm__ ("g1") = __NR_clone;			\
+	__asm__ __volatile__ (__CLONE_SYSCALL_STRING :			\
+			  "=r" (__g1), "=r" (__o0), "=r" (__o1)	:	\
+			  "0" (__g1), "1" (__o0), "2" (__o1),		\
+			  "r" (__o2), "r" (__o3), "r" (__o4) :		\
+			  __SYSCALL_CLOBBERS);				\
+	__o0;								\
+})
+
+#define LOAD_ARGS_0()
+#define ASM_ARGS_0
+#define LOAD_ARGS_1(o0) \
+    __o0 = (int)o0;     \
+    LOAD_ARGS_0()
+#define ASM_ARGS_1 ASM_ARGS_0, "r" (__o0)
+#define LOAD_ARGS_2(o0, o1)			\
+  register int __o1 __asm__ ("o1") = (int) (o1);	\
+  LOAD_ARGS_1 (o0)
+#define ASM_ARGS_2	ASM_ARGS_1, "r" (__o1)
+#define LOAD_ARGS_3(o0, o1, o2)			\
+  register int __o2 __asm__ ("o2") = (int) (o2);	\
+  LOAD_ARGS_2 (o0, o1)
+#define ASM_ARGS_3	ASM_ARGS_2, "r" (__o2)
+#define LOAD_ARGS_4(o0, o1, o2, o3)		\
+  register int __o3 __asm__ ("o3") = (int) (o3);	\
+  LOAD_ARGS_3 (o0, o1, o2)
+#define ASM_ARGS_4	ASM_ARGS_3, "r" (__o3)
+#define LOAD_ARGS_5(o0, o1, o2, o3, o4)		\
+  register int __o4 __asm__ ("o4") = (int) (o4);	\
+  LOAD_ARGS_4 (o0, o1, o2, o3)
+#define ASM_ARGS_5	ASM_ARGS_4, "r" (__o4)
+#define LOAD_ARGS_6(o0, o1, o2, o3, o4, o5)	\
+  register int __o5 __asm__ ("o5") = (int) (o5);	\
+  LOAD_ARGS_5 (o0, o1, o2, o3, o4)
+#define ASM_ARGS_6	ASM_ARGS_5, "r" (__o5)
+
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/termios.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/termios.h
new file mode 100644
index 0000000..cea1322
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/termios.h
@@ -0,0 +1,233 @@
+/* termios type and macro definitions.  Linux/SPARC version.
+   Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 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.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+#define NCCS 17
+struct termios
+  {
+    tcflag_t c_iflag;		/* input mode flags */
+    tcflag_t c_oflag;		/* output mode flags */
+    tcflag_t c_cflag;		/* control mode flags */
+    tcflag_t c_lflag;		/* local mode flags */
+    cc_t c_line;		/* line discipline */
+    cc_t c_cc[NCCS];		/* control characters */
+  };
+
+/* c_cc characters */
+#define VINTR    0
+#define VQUIT    1
+#define VERASE   2
+#define VKILL    3
+#define VEOF     4
+#define VEOL     5
+#define VEOL2    6
+#define VSWTC    7
+#define VSTART   8
+#define VSTOP    9
+#define VSUSP    10
+#define VDSUSP   11		/* SunOS POSIX nicety I do believe... */
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE  14
+#define VLNEXT   15
+
+/* User apps assume vmin/vtime is shared with eof/eol */
+#define VMIN     VEOF
+#define VTIME    VEOL
+
+/* c_iflag bits */
+#define IGNBRK	0x00000001
+#define BRKINT	0x00000002
+#define IGNPAR	0x00000004
+#define PARMRK	0x00000008
+#define INPCK	0x00000010
+#define ISTRIP	0x00000020
+#define INLCR	0x00000040
+#define IGNCR	0x00000080
+#define ICRNL	0x00000100
+#define IUCLC	0x00000200
+#define IXON	0x00000400
+#define IXANY	0x00000800
+#define IXOFF	0x00001000
+#define IMAXBEL	0x00002000
+#define IUTF8	0x00004000
+
+/* c_oflag bits */
+#define OPOST	0x00000001
+#define OLCUC	0x00000002
+#define ONLCR	0x00000004
+#define OCRNL	0x00000008
+#define ONOCR	0x00000010
+#define ONLRET	0x00000020
+#define OFILL	0x00000040
+#define OFDEL	0x00000080
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY	0x00000100
+# define   NL0	0x00000000
+# define   NL1	0x00000100
+# define CRDLY	0x00000600
+# define   CR0	0x00000000
+# define   CR1	0x00000200
+# define   CR2	0x00000400
+# define   CR3	0x00000600
+# define TABDLY	0x00001800
+# define   TAB0	0x00000000
+# define   TAB1	0x00000800
+# define   TAB2	0x00001000
+# define   TAB3	0x00001800
+# define BSDLY	0x00002000
+# define   BS0	0x00000000
+# define   BS1	0x00002000
+#define FFDLY	0x00008000
+#define   FF0	0x00000000
+#define   FF1	0x00008000
+#endif
+#define VTDLY	0x00004000
+#define   VT0	0x00000000
+#define   VT1	0x00004000
+#define PAGEOUT 0x00010000	/* SUNOS specific */
+#define WRAP    0x00020000	/* SUNOS specific */
+
+#ifdef __USE_MISC
+# define   XTABS	0x00001800
+#endif
+
+/* c_cflag bit meaning */
+#ifdef __USE_MISC
+# define CBAUD	0x0000100f
+#endif
+#define  B0	0x00000000	/* hang up */
+#define  B50	0x00000001
+#define  B75	0x00000002
+#define  B110	0x00000003
+#define  B134	0x00000004
+#define  B150	0x00000005
+#define  B200	0x00000006
+#define  B300	0x00000007
+#define  B600	0x00000008
+#define  B1200	0x00000009
+#define  B1800	0x0000000a
+#define  B2400	0x0000000b
+#define  B4800	0x0000000c
+#define  B9600	0x0000000d
+#define  B19200	0x0000000e
+#define  B38400	0x0000000f
+#ifdef __USE_MISC
+# define EXTA    B19200
+# define EXTB    B38400
+#endif
+#define  CSIZE  0x00000030
+#define   CS5	0x00000000
+#define   CS6	0x00000010
+#define   CS7	0x00000020
+#define   CS8	0x00000030
+#define CSTOPB	0x00000040
+#define CREAD	0x00000080
+#define PARENB	0x00000100
+#define PARODD	0x00000200
+#define HUPCL	0x00000400
+#define CLOCAL	0x00000800
+#ifdef __USE_MISC
+# define CBAUDEX 0x00001000
+#endif
+#define  B57600  0x00001001
+#define  B115200 0x00001002
+#define  B230400 0x00001003
+#define  B460800 0x00001004
+#define  B76800  0x00001005
+#define  B153600 0x00001006
+#define  B307200 0x00001007
+#define  B614400 0x00001008
+#define  B921600 0x00001009
+#define  B500000 0x0000100a
+#define  B576000 0x0000100b
+#define B1000000 0x0000100c
+#define B1152000 0x0000100d
+#define B1500000 0x0000100e
+#define B2000000 0x0000100f
+#define __MAX_BAUD B2000000
+
+#ifdef __USE_MISC
+# define CIBAUD	 0x100f0000	/* input baud rate (not used) */
+# define CMSPAR	 0x40000000	/* mark or space (stick) parity */
+# define CRTSCTS 0x80000000	/* flow control */
+#endif
+
+/* c_lflag bits */
+#define ISIG	0x00000001
+#define ICANON	0x00000002
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE	0x00000004
+#endif
+#define ECHO	0x00000008
+#define ECHOE	0x00000010
+#define ECHOK	0x00000020
+#define ECHONL	0x00000040
+#define NOFLSH	0x00000080
+#define TOSTOP	0x00000100
+#ifdef __USE_MISC
+# define ECHOCTL	0x00000200
+# define ECHOPRT	0x00000400
+# define ECHOKE		0x00000800
+# define DEFECHO 	0x00001000	/* SUNOS thing, what is it? */
+# define FLUSHO		0x00002000
+# define PENDIN		0x00004000
+#endif
+#define IEXTEN	0x00008000
+
+/* modem lines */
+#define TIOCM_LE	0x001
+#define TIOCM_DTR	0x002
+#define TIOCM_RTS	0x004
+#define TIOCM_ST	0x008
+#define TIOCM_SR	0x010
+#define TIOCM_CTS	0x020
+#define TIOCM_CAR	0x040
+#define TIOCM_RNG	0x080
+#define TIOCM_DSR	0x100
+#define TIOCM_CD	TIOCM_CAR
+#define TIOCM_RI	TIOCM_RNG
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+#define TIOCSER_TEMT    0x01	/* Transmitter physically empty */
+
+
+/* tcflow() and TCXONC use these */
+#define	TCOOFF		0
+#define	TCOON		1
+#define	TCIOFF		2
+#define	TCION		3
+
+/* tcflush() and TCFLSH use these */
+#define	TCIFLUSH	0
+#define	TCOFLUSH	1
+#define	TCIOFLUSH	2
+
+/* tcsetattr uses these */
+#define	TCSANOW		0
+#define	TCSADRAIN	1
+#define	TCSAFLUSH	2
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/timerfd.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/timerfd.h
new file mode 100644
index 0000000..492e50c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/timerfd.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2008-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_TIMERFD_H
+# error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead."
+#endif
+
+/* Bits to be set in the FLAGS parameter of `timerfd_create'.  */
+enum
+  {
+    TFD_CLOEXEC = 0x400000,
+#define TFD_CLOEXEC TFD_CLOEXEC
+    TFD_NONBLOCK = 0x004000
+#define TFD_NONBLOCK TFD_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/typesizes.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/typesizes.h
new file mode 100644
index 0000000..b0dd1bd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/typesizes.h
@@ -0,0 +1,66 @@
+/* bits/typesizes.h -- underlying types for *_t.  Linux/SPARC version.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef	_BITS_TYPESIZES_H
+#define	_BITS_TYPESIZES_H	1
+
+/* See <bits/types.h> for the meaning of these macros.  This file exists so
+   that <bits/types.h> need not vary across different GNU platforms.  */
+
+#define __DEV_T_TYPE		__UQUAD_TYPE
+#define __UID_T_TYPE		__U32_TYPE
+#define __GID_T_TYPE		__U32_TYPE
+#define __INO_T_TYPE		__ULONGWORD_TYPE
+#define __INO64_T_TYPE		__UQUAD_TYPE
+#define __MODE_T_TYPE		__U32_TYPE
+#define __NLINK_T_TYPE		__U32_TYPE
+#define __OFF_T_TYPE		__SLONGWORD_TYPE
+#define __OFF64_T_TYPE		__SQUAD_TYPE
+#define __PID_T_TYPE		__S32_TYPE
+#define __RLIM_T_TYPE		__ULONGWORD_TYPE
+#define __RLIM64_T_TYPE		__UQUAD_TYPE
+#define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
+#define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
+#define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
+#define	__ID_T_TYPE		__U32_TYPE
+#define __CLOCK_T_TYPE		__SLONGWORD_TYPE
+#define __TIME_T_TYPE		__SLONGWORD_TYPE
+#define __USECONDS_T_TYPE	__U32_TYPE
+#define __SUSECONDS_T_TYPE	__S32_TYPE
+#define __DADDR_T_TYPE		__S32_TYPE
+#define __SWBLK_T_TYPE		__SLONGWORD_TYPE
+#define __KEY_T_TYPE		__S32_TYPE
+#define __CLOCKID_T_TYPE	__S32_TYPE
+#define __TIMER_T_TYPE		void *
+#define __BLKSIZE_T_TYPE	__SLONGWORD_TYPE
+#define __FSID_T_TYPE		struct { int __val[2]; }
+#define __SSIZE_T_TYPE		__SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'.  */
+#define	__FD_SETSIZE		1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..2d8cdd7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h
@@ -0,0 +1,47 @@
+/*
+ * 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__ "unimp 0xf00"
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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 */
+#define __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/sparc/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/wordsize.h
new file mode 100644
index 0000000..c0e600e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bits/wordsize.h
@@ -0,0 +1,20 @@
+/* Determine the wordsize from the preprocessor defines.  */
+
+#if defined __arch64__ || defined __sparcv9
+# define __WORDSIZE	64
+#else
+# define __WORDSIZE	32
+#endif
+
+#if 0 /* uClibc: done in mathdefs.h: !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL*/
+
+# if __WORDSIZE == 32
+/* Signal that in 32bit ABI we didn't used to have a `long double'.
+   The changes all the `long double' function variants to be redirects
+   to the double functions.  */
+#  define __LONG_DOUBLE_MATH_OPTIONAL   1
+#  ifndef __LONG_DOUBLE_128__
+#   define __NO_LONG_DOUBLE_MATH        1
+#  endif
+# endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/brk.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/brk.c
new file mode 100644
index 0000000..513975c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/brk.c
@@ -0,0 +1,49 @@
+/* brk system call for Linux/i386.
+   Copyright (C) 1995, 1996, 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 <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;
+
+    {
+	register void *o0 __asm__("%o0") = addr;
+	register int g1 __asm__("%g1") = 17 ;
+	__asm__ ("t 0x10" : "=r"(o0) : "r"(g1), "0"(o0) : "cc");
+	newbrk = o0;
+    }
+
+    __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/sparc/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/bsd-_setjmp.S
new file mode 100644
index 0000000..4e6a2da
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bsd-_setjmp.S
@@ -0,0 +1 @@
+/* _setjmp is in setjmp.S  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/bsd-setjmp.S
new file mode 100644
index 0000000..1da848d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/bsd-setjmp.S
@@ -0,0 +1 @@
+/* setjmp is in setjmp.S  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/clone.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/clone.S
new file mode 100644
index 0000000..2b66095
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/clone.S
@@ -0,0 +1,107 @@
+/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004, 2007
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@tamu.edu).
+
+   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.  */
+
+#include <asm/errno.h>
+#include <asm/unistd.h>
+#include <tcb-offsets.h>
+#include <sysdep.h>
+
+#define CLONE_VM	0x00000100
+#define CLONE_THREAD	0x00010000
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
+	     pid_t *ptid, void *tls, pid_t *ctid); */
+
+	.text
+ENTRY (__clone)
+	save	%sp,-96,%sp
+	cfi_def_cfa_register(%fp)
+	cfi_window_save
+	cfi_register(%o7, %i7)
+
+	/* sanity check arguments */
+	orcc	%i0,%g0,%g2
+	be	.Leinval
+	 orcc	%i1,%g0,%o1
+	be	.Leinval
+	 mov	%i2,%o0
+
+	/* The child_stack is the top of the stack, allocate one
+	   whole stack frame from that as this is what the kernel
+	   expects.  */
+	sub	%o1, 96, %o1
+	mov	%i3, %g3
+	mov	%i2, %g4
+
+	/* ptid */
+	mov	%i4,%o2
+	/* tls */
+	mov	%i5,%o3
+	/* ctid */
+	ld	[%fp+92],%o4
+
+	/* Do the system call */
+	set	__NR_clone,%g1
+	ta	0x10
+	bcs	.Lerror
+	 tst	%o1
+	bne	__thread_start
+	 nop
+	jmpl	%i7 + 8, %g0
+	 restore %o0,%g0,%o0
+
+.Leinval:
+	mov	EINVAL, %o0
+.Lerror:
+	call	__errno_location
+	 mov	%o0, %i0
+	st	%i0,[%o0]
+	jmpl	%i7 + 8, %g0
+	 restore %g0,-1,%o0
+END(__clone)
+
+	.type	__thread_start,@function
+__thread_start:
+#ifdef RESET_PID
+	sethi	%hi(CLONE_THREAD), %l0
+	andcc	%g4, %l0, %g0
+	bne	1f
+	 andcc	%g4, CLONE_VM, %g0
+	bne,a	2f
+	 mov	-1,%o0
+	set	__NR_getpid,%g1
+	ta	0x10
+2:
+	st	%o0,[%g7 + PID]
+	st	%o0,[%g7 + TID]
+1:
+#endif
+	mov	%g0, %fp	/* terminate backtrace */
+	call	%g2
+	 mov	%g3,%o0
+	call	exit,0
+	 nop
+
+	.size	__thread_start, .-__thread_start
+
+weak_alias (__clone, clone)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/crt1.S
new file mode 100644
index 0000000..f33a714
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/crt1.S
@@ -0,0 +1,134 @@
+/* Startup code for elf{32,64}-sparc
+   Copyright (C) 1997, 1998, 2002, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
+
+   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.  */
+
+/* Originally based on glibc's sysdeps/sparc/sparc{32,64}/elf/start.S */
+
+#include <features.h>
+#include <bits/wordsize.h>
+
+/* macro out the 32 / 64 bit differences */
+#if __WORDSIZE == 32
+# define STACK_BIAS 0
+# define ELE_SIZE 4
+# define LD ld
+#else
+# define STACK_BIAS 2047 /* see glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h */
+# define ELE_SIZE 8
+# define LD ldx
+#endif
+
+.text
+.align 4
+.global _start
+.type   _start,%function
+#if defined(__UCLIBC_CTOR_DTOR__)
+.type   _init,%function
+.type   _fini,%function
+#else
+.weak   _init
+.weak   _fini
+#endif
+.type   __uClibc_main,%function
+/* Stick in a dummy reference to main(), so that if an application
+ * is linking when the main() function is in a static library (.a)
+ * we can be sure that main() actually gets linked in */
+.global main
+.type   main,%function
+
+#ifdef __PIC__
+.LLGETPC0:
+	retl
+	add	%o7, %l7, %l7
+#endif
+
+_start:
+#ifdef __PIC__
+	sethi	%hi(_GLOBAL_OFFSET_TABLE_-4), %l7
+	call	.LLGETPC0
+	add	%l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
+#endif
+
+	/* Terminate the stack frame, and reserve space for functions to
+	 * drop their arguments.  */
+	mov	%g0, %fp
+	sub	%sp, 6*ELE_SIZE, %sp
+
+	/* Extract the arguments and environment as encoded on the stack.  The
+	 * argument info starts after one register window (16 words) past the SP.  */
+	LD	[%sp+STACK_BIAS+22*ELE_SIZE], %o1   /* %o1 = argc */
+	add	%sp, STACK_BIAS+23*ELE_SIZE, %o2    /* %o2 = argv */
+
+	/* Load the addresses of the user entry points.  */
+	sethi	%hi(main), %o0
+	sethi	%hi(_init), %o3
+	sethi	%hi(_fini), %o4
+	or	%o0, %lo(main), %o0
+	or	%o3, %lo(_init), %o3
+	or	%o4, %lo(_fini), %o4
+#ifdef __PIC__
+	/* Need a little more magic when building PIC to get addr of main */
+	LD	[%l7 + %o0], %o0
+	LD	[%l7 + %o3], %o3
+	LD	[%l7 + %o4], %o4
+#endif
+
+	/* When starting a binary via the dynamic linker, %g1 contains the
+	 * address of the shared library termination function, which will be
+	 * registered with atexit().  If we are statically linked, this will
+	 * be NULL.  */
+	mov	%g1, %o5
+
+	/* Let libc do the rest of the initialization, and call main.  */
+	call __uClibc_main
+	nop
+
+	/* Die very horribly if exit returns.  */
+#if __WORDSIZE == 32
+	unimp
+#else
+	illtrap 0
+#endif
+
+.size _start,.-_start
+
+/* Define a symbol for the first piece of initialized data. */
+.data
+.global __data_start
+__data_start:
+.long 0
+.weak data_start
+	data_start = __data_start
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/crti.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/crti.S
new file mode 100644
index 0000000..6dfc6c6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/crti.S
@@ -0,0 +1,23 @@
+	.file	"initfini.c"
+	
+	.section .init
+	.align 4
+	.global _init
+	.type	_init, %function
+	.proc	020
+_init:
+	!#PROLOGUE# 0
+	save	%sp, -104, %sp
+	
+	.align 4
+	
+	
+	.section .fini
+	.align 4
+	.global _fini
+	.type	_fini, %function
+	.proc	020
+_fini:
+	!#PROLOGUE# 0
+	save	%sp, -104, %sp
+	.align 4
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/crtn.S
new file mode 100644
index 0000000..d64ffd0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/crtn.S
@@ -0,0 +1,17 @@
+	.file	"initfini.c"
+	
+	.section .init
+	.align 4
+	.global _init
+	.type	_init, %function
+	.proc	020
+	ret
+	restore
+	
+	.section .fini
+	.align 4
+	.global _fini
+	.type	_fini, %function
+	.proc	020
+	ret
+	restore
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/fork.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/fork.S
new file mode 100644
index 0000000..7ead409
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/fork.S
@@ -0,0 +1,49 @@
+/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, 1997.
+
+   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.  */
+
+/* Code taken from glibc2.2.2/sysdeps/unix/sysv/linux/sparc/vfork.S */
+
+#include <features.h>
+#include <sys/syscall.h>
+
+.text
+.global	__libc_fork
+.type	__libc_fork,%function
+.align 4
+
+__libc_fork:
+	mov __NR_fork, %g1
+	ta	0x10
+	bcc,a	9000f
+	nop
+	save    %sp,-96,%sp
+	call HIDDEN_JUMPTARGET(__errno_location)
+	nop
+	st	%i0,[%o0]
+	jmpl	%i7+8,%g0
+	restore	%g0,-1,%o0
+
+9000:
+	sub	%o1, 1, %o1
+	retl
+	and	%o0, %o1, %o0
+
+.size __libc_fork,.-__libc_fork
+weak_alias(__libc_fork,fork)
+libc_hidden_weak(fork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/fpu_control.h
new file mode 100644
index 0000000..41ab0a9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/fpu_control.h
@@ -0,0 +1,75 @@
+/* FPU control word bits.  SPARC version.
+   Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Miguel de Icaza
+
+   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	1
+
+
+#include <features.h>
+#include <bits/wordsize.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_IM  0x08000000
+#define _FPU_MASK_OM  0x04000000
+#define _FPU_MASK_UM  0x02000000
+#define _FPU_MASK_ZM  0x01000000
+#define _FPU_MASK_PM  0x00800000
+
+/* precision control */
+#define _FPU_EXTENDED 0x00000000     /* RECOMMENDED */
+#define _FPU_DOUBLE   0x20000000
+#define _FPU_80BIT    0x30000000
+#define _FPU_SINGLE   0x10000000     /* DO NOT USE */
+
+/* rounding control / Sparc */
+#define _FPU_RC_DOWN    0xc0000000
+#define _FPU_RC_UP      0x80000000
+#define _FPU_RC_ZERO    0x40000000
+#define _FPU_RC_NEAREST 0x0        /* RECOMMENDED */
+
+#define _FPU_RESERVED   0x30300000  /* Reserved bits in cw */
+
+
+/* Now two recommended cw */
+
+/* Linux and IEEE default:
+     - extended precision
+     - rounding to nearest
+     - no exceptions  */
+#define _FPU_DEFAULT  0x0
+#define _FPU_IEEE     0x0
+
+/* Type of the control word.  */
+typedef unsigned long int fpu_control_t;
+
+#if __WORDSIZE == 64
+# define _FPU_GETCW(cw) __asm__ ("stx %%fsr,%0" : "=m" (*&cw))
+# define _FPU_SETCW(cw) __asm__ ("ldx %0,%%fsr" : : "m" (*&cw))
+#else
+# define _FPU_GETCW(cw) __asm__ ("st %%fsr,%0" : "=m" (*&cw))
+# define _FPU_SETCW(cw) __asm__ ("ld %0,%%fsr" : : "m" (*&cw))
+#endif
+
+#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/sparc/pipe.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/pipe.S
new file mode 100644
index 0000000..94913d4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/pipe.S
@@ -0,0 +1,62 @@
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 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.  
+ 
+   Ported to uClibc by:
+   Austin Foxley, Ceton Corporation <austinf@cetoncorp.com>
+ */
+
+#include <features.h>
+#include <sys/syscall.h>
+#include <asm/errno.h>
+
+.text
+.global	pipe
+.type	pipe, @function
+.align 4
+
+pipe:
+	save	%sp,-96,%sp
+
+	/* sanity check arguments */
+	tst	%i0
+	be	.Lerror
+	 orcc	%i1,%g0,%o1
+	be	.Lerror
+	 mov	%i2,%o0
+
+	/* Do the system call */
+	set	__NR_pipe,%g1
+	ta	0x10
+	bcs	.Lerror
+	 nop
+ 
+    st %o0,[%i0]
+    st %o1,[%i0+4]
+	ret
+	 restore %g0,%g0,%o0
+
+.Lerror:
+	call	HIDDEN_JUMPTARGET(__errno_location)
+	 or	%g0,EINVAL,%i0
+	st	%i0,[%o0]
+	ret
+	 restore %g0,-1,%o0
+
+.size pipe,.-pipe
+libc_hidden_def(pipe)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/qp_ops.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/qp_ops.c
new file mode 100644
index 0000000..123be53
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/qp_ops.c
@@ -0,0 +1,47 @@
+/* XXX add ops from glibc sysdeps/sparc/sparc64/soft-fp */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static void fakedef(void)
+{
+	fputs("Unimplemented _Q* func called, exiting\n", stderr);
+	exit(-1);
+}
+
+#ifdef __sparc_v9__
+# define fakedef(sym) strong_alias(fakedef, _Qp_##sym)
+#else
+# define fakedef(sym) strong_alias(fakedef, _Q_##sym)
+#endif
+
+fakedef(fne)
+fakedef(feq)
+fakedef(div)
+fakedef(flt)
+fakedef(fgt)
+fakedef(mul)
+fakedef(fge)
+fakedef(qtoux)
+fakedef(uxtoq)
+fakedef(sub)
+fakedef(dtoq)
+fakedef(qtod)
+fakedef(qtos)
+fakedef(stoq)
+fakedef(itoq)
+fakedef(add)
+#ifndef __sparc_v9__
+fakedef(qtou)
+fakedef(utoq)
+fakedef(cmp)
+fakedef(cmpe)
+fakedef(fle)
+fakedef(lltoq)
+fakedef(neg)
+fakedef(qtoi)
+fakedef(qtoll)
+fakedef(qtoull)
+fakedef(sqrt)
+fakedef(ulltoq)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/rem.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/rem.S
new file mode 100644
index 0000000..595e8ea
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/rem.S
@@ -0,0 +1,9 @@
+#include "_math_inc.h"
+
+#if defined(__CONFIG_SPARC_V9__) || defined(__CONFIG_SPARC_V9B__)
+# include "sparcv9/rem.S"
+#elif defined(__CONFIG_SPARC_V8__)
+# include "sparcv8/rem.S"
+#else
+# include "sparcv7/rem.S"
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sdiv.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sdiv.S
new file mode 100644
index 0000000..7e9a9c9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sdiv.S
@@ -0,0 +1,9 @@
+#include "_math_inc.h"
+
+#if defined(__CONFIG_SPARC_V9__) || defined(__CONFIG_SPARC_V9B__)
+# include "sparcv9/sdiv.S"
+#elif defined(__CONFIG_SPARC_V8__)
+# include "sparcv8/sdiv.S"
+#else
+# include "sparcv7/sdiv.S"
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/setjmp.S
new file mode 100644
index 0000000..796abc7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/setjmp.S
@@ -0,0 +1,70 @@
+/* Copyright (C) 1991, 93, 94, 96, 97, 98 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>
+
+#define _ASM 1
+#define _SETJMP_H
+#include <bits/setjmp.h>
+#define ST_FLUSH_WINDOWS 3
+
+.global _setjmp
+.type   _setjmp,%function
+.align 4
+_setjmp: 
+	b	1f
+	set	0, %o1
+.size _setjmp,.-_setjmp
+
+
+
+
+
+.global setjmp
+.type   setjmp,%function
+.align 4
+setjmp: 
+	set	1, %o1
+.size setjmp,.-setjmp
+
+
+
+
+
+.global __sigsetjmp
+.type   __sigsetjmp,%function
+.align 4
+__sigsetjmp: 
+1:
+	/* Save our PC, SP and FP.  Save the signal mask if requested with
+	   a tail-call for simplicity; it always returns zero.  */
+	ta	ST_FLUSH_WINDOWS
+
+	st	%o7, [%o0 + (JB_PC * 4)]
+	st	%sp, [%o0 + (JB_SP * 4)]
+	st	%fp, [%o0 + (JB_FP * 4)]
+
+	mov	%o7, %g1
+	call	__sigjmp_save
+	mov	%g1, %o7
+.size __sigsetjmp,.-__sigsetjmp
+
+
+
+.weak _setjmp
+.weak setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/sigaction.c
new file mode 100644
index 0000000..a4adb1d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sigaction.c
@@ -0,0 +1,99 @@
+/* POSIX.1 sigaction call for Linux/SPARC.
+   Copyright (C) 1997-2000,2002,2003,2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Miguel de Icaza (miguel@nuclecu.unam.mx), 1997.
+
+   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.
+
+       Ported to uClibc from glibc: 090520:
+               Jan Buchholz, KIP, Uni Heidelberg <jan.buchholz@kip.uni-heidelberg.de>
+               Austin Foxley, Ceton Corporation <austinf@cetoncorp.com>
+*/
+
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+#include <sys/syscall.h>
+#include <bits/kernel_sigaction.h>
+
+
+_syscall5(int, rt_sigaction, int, a, int, b, int, c, int, d, int, e)
+static void __rt_sigreturn_stub(void);
+static void __sigreturn_stub(void);
+
+int __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
+{
+	int ret;
+	struct sigaction kact, koact;
+	unsigned long stub = 0;
+
+	if (act) {
+		kact.sa_handler = act->sa_handler;
+		memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+		if (((kact.sa_flags = act->sa_flags) & SA_SIGINFO) != 0)
+			stub = (unsigned long) &__rt_sigreturn_stub;
+		else
+			stub = (unsigned long) &__sigreturn_stub;
+		stub -= 8;
+		kact.sa_restorer = NULL;
+	}
+	
+	/* XXX The size argument hopefully will have to be changed to the
+	 * real size of the user-level sigset_t.  */
+	ret = INLINE_SYSCALL (rt_sigaction, 5, sig, act ? &kact : 0,
+			oact ? &koact : 0, stub, _NSIG / 8);
+	
+	if (oact && ret >= 0) {
+		oact->sa_handler = koact.sa_handler;
+		memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+		oact->sa_flags = koact.sa_flags;
+		oact->sa_restorer = koact.sa_restorer;
+	}
+	return ret;
+}
+
+
+#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
+
+
+static void
+__rt_sigreturn_stub(void)
+{
+	__asm__(
+		"mov %0, %%g1\n\t"
+		"ta  0x10\n\t"
+		: /* no outputs */
+		: "i" (__NR_rt_sigreturn)
+	);
+}
+static void
+__sigreturn_stub(void)
+{
+	__asm__(
+		"mov %0, %%g1\n\t"
+		"ta  0x10\n\t"
+		: /* no outputs */
+		: "i" (__NR_sigreturn)
+	);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/double.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/double.h
new file mode 100644
index 0000000..b012d9d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/double.h
@@ -0,0 +1,264 @@
+/* Software floating-point emulation.
+   Definitions for IEEE Double Precision
+   Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com),
+		  Jakub Jelinek (jj@ultra.linux.cz),
+		  David S. Miller (davem@redhat.com) and
+		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
+
+   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 into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser 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.)
+
+   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, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#if _FP_W_TYPE_SIZE < 32
+#error "Here's a nickel kid.  Go buy yourself a real computer."
+#endif
+
+#if _FP_W_TYPE_SIZE < 64
+#define _FP_FRACTBITS_D		(2 * _FP_W_TYPE_SIZE)
+#else
+#define _FP_FRACTBITS_D		_FP_W_TYPE_SIZE
+#endif
+
+#define _FP_FRACBITS_D		53
+#define _FP_FRACXBITS_D		(_FP_FRACTBITS_D - _FP_FRACBITS_D)
+#define _FP_WFRACBITS_D		(_FP_WORKBITS + _FP_FRACBITS_D)
+#define _FP_WFRACXBITS_D	(_FP_FRACTBITS_D - _FP_WFRACBITS_D)
+#define _FP_EXPBITS_D		11
+#define _FP_EXPBIAS_D		1023
+#define _FP_EXPMAX_D		2047
+
+#define _FP_QNANBIT_D		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE)
+#define _FP_QNANBIT_SH_D		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_D-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_D		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_SH_D		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_D-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
+#define _FP_OVERFLOW_D		\
+	((_FP_W_TYPE)1 << _FP_WFRACBITS_D % _FP_W_TYPE_SIZE)
+
+typedef float DFtype __attribute__((mode(DF)));
+
+#if _FP_W_TYPE_SIZE < 64
+
+union _FP_UNION_D
+{
+  DFtype flt;
+  struct {
+#if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned sign  : 1;
+    unsigned exp   : _FP_EXPBITS_D;
+    unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE;
+    unsigned frac0 : _FP_W_TYPE_SIZE;
+#else
+    unsigned frac0 : _FP_W_TYPE_SIZE;
+    unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE;
+    unsigned exp   : _FP_EXPBITS_D;
+    unsigned sign  : 1;
+#endif
+  } bits __attribute__((packed));
+};
+
+#define FP_DECL_D(X)		_FP_DECL(2,X)
+#define FP_UNPACK_RAW_D(X,val)	_FP_UNPACK_RAW_2(D,X,val)
+#define FP_UNPACK_RAW_DP(X,val)	_FP_UNPACK_RAW_2_P(D,X,val)
+#define FP_PACK_RAW_D(val,X)	_FP_PACK_RAW_2(D,val,X)
+#define FP_PACK_RAW_DP(val,X)		\
+  do {					\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_2_P(D,val,X);	\
+  } while (0)
+
+#define FP_UNPACK_D(X,val)		\
+  do {					\
+    _FP_UNPACK_RAW_2(D,X,val);		\
+    _FP_UNPACK_CANONICAL(D,2,X);	\
+  } while (0)
+
+#define FP_UNPACK_DP(X,val)		\
+  do {					\
+    _FP_UNPACK_RAW_2_P(D,X,val);	\
+    _FP_UNPACK_CANONICAL(D,2,X);	\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_D(X,val)	\
+  do {					\
+    _FP_UNPACK_RAW_2(D,X,val);		\
+    _FP_UNPACK_SEMIRAW(D,2,X);		\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_DP(X,val)	\
+  do {					\
+    _FP_UNPACK_RAW_2_P(D,X,val);	\
+    _FP_UNPACK_SEMIRAW(D,2,X);		\
+  } while (0)
+
+#define FP_PACK_D(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(D,2,X);		\
+    _FP_PACK_RAW_2(D,val,X);		\
+  } while (0)
+
+#define FP_PACK_DP(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(D,2,X);		\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_2_P(D,val,X);	\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_D(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(D,2,X);		\
+    _FP_PACK_RAW_2(D,val,X);		\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_DP(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(D,2,X);		\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_2_P(D,val,X);	\
+  } while (0)
+
+#define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN(D,2,X)
+#define FP_NEG_D(R,X)			_FP_NEG(D,2,R,X)
+#define FP_ADD_D(R,X,Y)			_FP_ADD(D,2,R,X,Y)
+#define FP_SUB_D(R,X,Y)			_FP_SUB(D,2,R,X,Y)
+#define FP_MUL_D(R,X,Y)			_FP_MUL(D,2,R,X,Y)
+#define FP_DIV_D(R,X,Y)			_FP_DIV(D,2,R,X,Y)
+#define FP_SQRT_D(R,X)			_FP_SQRT(D,2,R,X)
+#define _FP_SQRT_MEAT_D(R,S,T,X,Q)	_FP_SQRT_MEAT_2(R,S,T,X,Q)
+
+#define FP_CMP_D(r,X,Y,un)	_FP_CMP(D,2,r,X,Y,un)
+#define FP_CMP_EQ_D(r,X,Y)	_FP_CMP_EQ(D,2,r,X,Y)
+#define FP_CMP_UNORD_D(r,X,Y)	_FP_CMP_UNORD(D,2,r,X,Y)
+
+#define FP_TO_INT_D(r,X,rsz,rsg)	_FP_TO_INT(D,2,r,X,rsz,rsg)
+#define FP_FROM_INT_D(X,r,rs,rt)	_FP_FROM_INT(D,2,X,r,rs,rt)
+
+#define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_2(X)
+#define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_2(X)
+
+#else
+
+union _FP_UNION_D
+{
+  DFtype flt;
+  struct {
+#if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned sign   : 1;
+    unsigned exp    : _FP_EXPBITS_D;
+    _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+#else
+    _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+    unsigned exp    : _FP_EXPBITS_D;
+    unsigned sign   : 1;
+#endif
+  } bits __attribute__((packed));
+};
+
+#define FP_DECL_D(X)		_FP_DECL(1,X)
+#define FP_UNPACK_RAW_D(X,val)	_FP_UNPACK_RAW_1(D,X,val)
+#define FP_UNPACK_RAW_DP(X,val)	_FP_UNPACK_RAW_1_P(D,X,val)
+#define FP_PACK_RAW_D(val,X)	_FP_PACK_RAW_1(D,val,X)
+#define FP_PACK_RAW_DP(val,X)		\
+  do {					\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_1_P(D,val,X);	\
+  } while (0)
+
+#define FP_UNPACK_D(X,val)		\
+  do {					\
+    _FP_UNPACK_RAW_1(D,X,val);		\
+    _FP_UNPACK_CANONICAL(D,1,X);	\
+  } while (0)
+
+#define FP_UNPACK_DP(X,val)		\
+  do {					\
+    _FP_UNPACK_RAW_1_P(D,X,val);	\
+    _FP_UNPACK_CANONICAL(D,1,X);	\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_D(X,val)	\
+  do {					\
+    _FP_UNPACK_RAW_2(1,X,val);		\
+    _FP_UNPACK_SEMIRAW(D,1,X);		\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_DP(X,val)	\
+  do {					\
+    _FP_UNPACK_RAW_2_P(1,X,val);	\
+    _FP_UNPACK_SEMIRAW(D,1,X);		\
+  } while (0)
+
+#define FP_PACK_D(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(D,1,X);		\
+    _FP_PACK_RAW_1(D,val,X);		\
+  } while (0)
+
+#define FP_PACK_DP(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(D,1,X);		\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_1_P(D,val,X);	\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_D(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(D,1,X);		\
+    _FP_PACK_RAW_1(D,val,X);		\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_DP(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(D,1,X);		\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_1_P(D,val,X);	\
+  } while (0)
+
+#define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN(D,1,X)
+#define FP_NEG_D(R,X)			_FP_NEG(D,1,R,X)
+#define FP_ADD_D(R,X,Y)			_FP_ADD(D,1,R,X,Y)
+#define FP_SUB_D(R,X,Y)			_FP_SUB(D,1,R,X,Y)
+#define FP_MUL_D(R,X,Y)			_FP_MUL(D,1,R,X,Y)
+#define FP_DIV_D(R,X,Y)			_FP_DIV(D,1,R,X,Y)
+#define FP_SQRT_D(R,X)			_FP_SQRT(D,1,R,X)
+#define _FP_SQRT_MEAT_D(R,S,T,X,Q)	_FP_SQRT_MEAT_1(R,S,T,X,Q)
+
+/* The implementation of _FP_MUL_D and _FP_DIV_D should be chosen by
+   the target machine.  */
+
+#define FP_CMP_D(r,X,Y,un)	_FP_CMP(D,1,r,X,Y,un)
+#define FP_CMP_EQ_D(r,X,Y)	_FP_CMP_EQ(D,1,r,X,Y)
+#define FP_CMP_UNORD_D(r,X,Y)	_FP_CMP_UNORD(D,1,r,X,Y)
+
+#define FP_TO_INT_D(r,X,rsz,rsg)	_FP_TO_INT(D,1,r,X,rsz,rsg)
+#define FP_FROM_INT_D(X,r,rs,rt)	_FP_FROM_INT(D,1,X,r,rs,rt)
+
+#define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_1(X)
+#define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_1(X)
+
+#endif /* W_TYPE_SIZE < 64 */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/extended.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/extended.h
new file mode 100644
index 0000000..e5f16de
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/extended.h
@@ -0,0 +1,431 @@
+/* Software floating-point emulation.
+   Definitions for IEEE Extended Precision.
+   Copyright (C) 1999,2006,2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser 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.)
+
+   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, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#if _FP_W_TYPE_SIZE < 32
+#error "Here's a nickel, kid. Go buy yourself a real computer."
+#endif
+
+#if _FP_W_TYPE_SIZE < 64
+#define _FP_FRACTBITS_E         (4*_FP_W_TYPE_SIZE)
+#else
+#define _FP_FRACTBITS_E		(2*_FP_W_TYPE_SIZE)
+#endif
+
+#define _FP_FRACBITS_E		64
+#define _FP_FRACXBITS_E		(_FP_FRACTBITS_E - _FP_FRACBITS_E)
+#define _FP_WFRACBITS_E		(_FP_WORKBITS + _FP_FRACBITS_E)
+#define _FP_WFRACXBITS_E	(_FP_FRACTBITS_E - _FP_WFRACBITS_E)
+#define _FP_EXPBITS_E		15
+#define _FP_EXPBIAS_E		16383
+#define _FP_EXPMAX_E		32767
+
+#define _FP_QNANBIT_E		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_E-2) % _FP_W_TYPE_SIZE)
+#define _FP_QNANBIT_SH_E		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_E-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_E		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_E-1) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_SH_E		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_E-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
+#define _FP_OVERFLOW_E		\
+	((_FP_W_TYPE)1 << (_FP_WFRACBITS_E % _FP_W_TYPE_SIZE))
+
+typedef float XFtype __attribute__((mode(XF)));
+
+#if _FP_W_TYPE_SIZE < 64
+
+union _FP_UNION_E
+{
+   XFtype flt;
+   struct 
+   {
+#if __BYTE_ORDER == __BIG_ENDIAN
+      unsigned long pad1 : _FP_W_TYPE_SIZE;
+      unsigned long pad2 : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
+      unsigned long sign : 1;
+      unsigned long exp : _FP_EXPBITS_E;
+      unsigned long frac1 : _FP_W_TYPE_SIZE;
+      unsigned long frac0 : _FP_W_TYPE_SIZE;
+#else
+      unsigned long frac0 : _FP_W_TYPE_SIZE;
+      unsigned long frac1 : _FP_W_TYPE_SIZE;
+      unsigned exp : _FP_EXPBITS_E;
+      unsigned sign : 1;
+#endif /* not bigendian */
+   } bits __attribute__((packed));
+};
+
+
+#define FP_DECL_E(X)		_FP_DECL(4,X)
+
+#define FP_UNPACK_RAW_E(X, val)				\
+  do {							\
+    union _FP_UNION_E _flo; _flo.flt = (val);		\
+							\
+    X##_f[2] = 0; X##_f[3] = 0;				\
+    X##_f[0] = _flo.bits.frac0;				\
+    X##_f[1] = _flo.bits.frac1;				\
+    X##_e  = _flo.bits.exp;				\
+    X##_s  = _flo.bits.sign;				\
+  } while (0)
+
+#define FP_UNPACK_RAW_EP(X, val)			\
+  do {							\
+    union _FP_UNION_E *_flo =				\
+    (union _FP_UNION_E *)(val);				\
+							\
+    X##_f[2] = 0; X##_f[3] = 0;				\
+    X##_f[0] = _flo->bits.frac0;			\
+    X##_f[1] = _flo->bits.frac1;			\
+    X##_e  = _flo->bits.exp;				\
+    X##_s  = _flo->bits.sign;				\
+  } while (0)
+
+#define FP_PACK_RAW_E(val, X)				\
+  do {							\
+    union _FP_UNION_E _flo;				\
+							\
+    if (X##_e) X##_f[1] |= _FP_IMPLBIT_E;		\
+    else X##_f[1] &= ~(_FP_IMPLBIT_E);			\
+    _flo.bits.frac0 = X##_f[0];				\
+    _flo.bits.frac1 = X##_f[1];				\
+    _flo.bits.exp   = X##_e;				\
+    _flo.bits.sign  = X##_s;				\
+							\
+    (val) = _flo.flt;					\
+  } while (0)
+
+#define FP_PACK_RAW_EP(val, X)				\
+  do {							\
+    if (!FP_INHIBIT_RESULTS)				\
+      {							\
+	union _FP_UNION_E *_flo =			\
+	  (union _FP_UNION_E *)(val);			\
+							\
+	if (X##_e) X##_f[1] |= _FP_IMPLBIT_E;		\
+	else X##_f[1] &= ~(_FP_IMPLBIT_E);		\
+	_flo->bits.frac0 = X##_f[0];			\
+	_flo->bits.frac1 = X##_f[1];			\
+	_flo->bits.exp   = X##_e;			\
+	_flo->bits.sign  = X##_s;			\
+      }							\
+  } while (0)
+
+#define FP_UNPACK_E(X,val)		\
+  do {					\
+    FP_UNPACK_RAW_E(X,val);		\
+    _FP_UNPACK_CANONICAL(E,4,X);	\
+  } while (0)
+
+#define FP_UNPACK_EP(X,val)		\
+  do {					\
+    FP_UNPACK_RAW_EP(X,val);		\
+    _FP_UNPACK_CANONICAL(E,4,X);	\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_E(X,val)	\
+  do {					\
+    FP_UNPACK_RAW_E(X,val);		\
+    _FP_UNPACK_SEMIRAW(E,4,X);		\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_EP(X,val)	\
+  do {					\
+    FP_UNPACK_RAW_EP(X,val);		\
+    _FP_UNPACK_SEMIRAW(E,4,X);		\
+  } while (0)
+
+#define FP_PACK_E(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(E,4,X);		\
+    FP_PACK_RAW_E(val,X);		\
+  } while (0)
+
+#define FP_PACK_EP(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(E,4,X);		\
+    FP_PACK_RAW_EP(val,X);		\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_E(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(E,4,X);		\
+    FP_PACK_RAW_E(val,X);		\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_EP(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(E,4,X);		\
+    FP_PACK_RAW_EP(val,X);		\
+  } while (0)
+
+#define FP_ISSIGNAN_E(X)	_FP_ISSIGNAN(E,4,X)
+#define FP_NEG_E(R,X)		_FP_NEG(E,4,R,X)
+#define FP_ADD_E(R,X,Y)		_FP_ADD(E,4,R,X,Y)
+#define FP_SUB_E(R,X,Y)		_FP_SUB(E,4,R,X,Y)
+#define FP_MUL_E(R,X,Y)		_FP_MUL(E,4,R,X,Y)
+#define FP_DIV_E(R,X,Y)		_FP_DIV(E,4,R,X,Y)
+#define FP_SQRT_E(R,X)		_FP_SQRT(E,4,R,X)
+
+/*
+ * Square root algorithms:
+ * We have just one right now, maybe Newton approximation
+ * should be added for those machines where division is fast.
+ * This has special _E version because standard _4 square
+ * root would not work (it has to start normally with the
+ * second word and not the first), but as we have to do it
+ * anyway, we optimize it by doing most of the calculations
+ * in two UWtype registers instead of four.
+ */
+ 
+#define _FP_SQRT_MEAT_E(R, S, T, X, q)			\
+  do {							\
+    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);		\
+    _FP_FRAC_SRL_4(X, (_FP_WORKBITS));			\
+    while (q)						\
+      {							\
+	T##_f[1] = S##_f[1] + q;			\
+	if (T##_f[1] <= X##_f[1])			\
+	  {						\
+	    S##_f[1] = T##_f[1] + q;			\
+	    X##_f[1] -= T##_f[1];			\
+	    R##_f[1] += q;				\
+	  }						\
+	_FP_FRAC_SLL_2(X, 1);				\
+	q >>= 1;					\
+      }							\
+    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);		\
+    while (q)						\
+      {							\
+	T##_f[0] = S##_f[0] + q;			\
+	T##_f[1] = S##_f[1];				\
+	if (T##_f[1] < X##_f[1] || 			\
+	    (T##_f[1] == X##_f[1] &&			\
+	     T##_f[0] <= X##_f[0]))			\
+	  {						\
+	    S##_f[0] = T##_f[0] + q;			\
+	    S##_f[1] += (T##_f[0] > S##_f[0]);		\
+	    _FP_FRAC_DEC_2(X, T);			\
+	    R##_f[0] += q;				\
+	  }						\
+	_FP_FRAC_SLL_2(X, 1);				\
+	q >>= 1;					\
+      }							\
+    _FP_FRAC_SLL_4(R, (_FP_WORKBITS));			\
+    if (X##_f[0] | X##_f[1])				\
+      {							\
+	if (S##_f[1] < X##_f[1] || 			\
+	    (S##_f[1] == X##_f[1] &&			\
+	     S##_f[0] < X##_f[0]))			\
+	  R##_f[0] |= _FP_WORK_ROUND;			\
+	R##_f[0] |= _FP_WORK_STICKY;			\
+      }							\
+  } while (0)
+
+#define FP_CMP_E(r,X,Y,un)	_FP_CMP(E,4,r,X,Y,un)
+#define FP_CMP_EQ_E(r,X,Y)	_FP_CMP_EQ(E,4,r,X,Y)
+#define FP_CMP_UNORD_E(r,X,Y)	_FP_CMP_UNORD(E,4,r,X,Y)
+
+#define FP_TO_INT_E(r,X,rsz,rsg)	_FP_TO_INT(E,4,r,X,rsz,rsg)
+#define FP_FROM_INT_E(X,r,rs,rt)	_FP_FROM_INT(E,4,X,r,rs,rt)
+
+#define _FP_FRAC_HIGH_E(X)	(X##_f[2])
+#define _FP_FRAC_HIGH_RAW_E(X)	(X##_f[1])
+
+#else   /* not _FP_W_TYPE_SIZE < 64 */
+union _FP_UNION_E
+{
+  XFtype flt;
+  struct {
+#if __BYTE_ORDER == __BIG_ENDIAN
+    _FP_W_TYPE pad  : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
+    unsigned sign   : 1;
+    unsigned exp    : _FP_EXPBITS_E;
+    _FP_W_TYPE frac : _FP_W_TYPE_SIZE;
+#else
+    _FP_W_TYPE frac : _FP_W_TYPE_SIZE;
+    unsigned exp    : _FP_EXPBITS_E;
+    unsigned sign   : 1;
+#endif
+  } bits;
+};
+
+#define FP_DECL_E(X)		_FP_DECL(2,X)
+
+#define FP_UNPACK_RAW_E(X, val)					\
+  do {								\
+    union _FP_UNION_E _flo; _flo.flt = (val);			\
+								\
+    X##_f0 = _flo.bits.frac;					\
+    X##_f1 = 0;							\
+    X##_e = _flo.bits.exp;					\
+    X##_s = _flo.bits.sign;					\
+  } while (0)
+
+#define FP_UNPACK_RAW_EP(X, val)				\
+  do {								\
+    union _FP_UNION_E *_flo =					\
+      (union _FP_UNION_E *)(val);				\
+								\
+    X##_f0 = _flo->bits.frac;					\
+    X##_f1 = 0;							\
+    X##_e = _flo->bits.exp;					\
+    X##_s = _flo->bits.sign;					\
+  } while (0)
+
+#define FP_PACK_RAW_E(val, X)					\
+  do {								\
+    union _FP_UNION_E _flo;					\
+								\
+    if (X##_e) X##_f0 |= _FP_IMPLBIT_E;				\
+    else X##_f0 &= ~(_FP_IMPLBIT_E);				\
+    _flo.bits.frac = X##_f0;					\
+    _flo.bits.exp  = X##_e;					\
+    _flo.bits.sign = X##_s;					\
+								\
+    (val) = _flo.flt;						\
+  } while (0)
+
+#define FP_PACK_RAW_EP(fs, val, X)				\
+  do {								\
+    if (!FP_INHIBIT_RESULTS)					\
+      {								\
+	union _FP_UNION_E *_flo =				\
+	  (union _FP_UNION_E *)(val);				\
+								\
+	if (X##_e) X##_f0 |= _FP_IMPLBIT_E;			\
+	else X##_f0 &= ~(_FP_IMPLBIT_E);			\
+	_flo->bits.frac = X##_f0;				\
+	_flo->bits.exp  = X##_e;				\
+	_flo->bits.sign = X##_s;				\
+      }								\
+  } while (0)
+
+
+#define FP_UNPACK_E(X,val)		\
+  do {					\
+    FP_UNPACK_RAW_E(X,val);		\
+    _FP_UNPACK_CANONICAL(E,2,X);	\
+  } while (0)
+
+#define FP_UNPACK_EP(X,val)		\
+  do {					\
+    FP_UNPACK_RAW_EP(X,val);		\
+    _FP_UNPACK_CANONICAL(E,2,X);	\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_E(X,val)	\
+  do {					\
+    FP_UNPACK_RAW_E(X,val);		\
+    _FP_UNPACK_SEMIRAW(E,2,X);		\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_EP(X,val)	\
+  do {					\
+    FP_UNPACK_RAW_EP(X,val);		\
+    _FP_UNPACK_SEMIRAW(E,2,X);		\
+  } while (0)
+
+#define FP_PACK_E(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(E,2,X);		\
+    FP_PACK_RAW_E(val,X);		\
+  } while (0)
+
+#define FP_PACK_EP(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(E,2,X);		\
+    FP_PACK_RAW_EP(val,X);		\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_E(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(E,2,X);		\
+    FP_PACK_RAW_E(val,X);		\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_EP(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(E,2,X);		\
+    FP_PACK_RAW_EP(val,X);		\
+  } while (0)
+
+#define FP_ISSIGNAN_E(X)	_FP_ISSIGNAN(E,2,X)
+#define FP_NEG_E(R,X)		_FP_NEG(E,2,R,X)
+#define FP_ADD_E(R,X,Y)		_FP_ADD(E,2,R,X,Y)
+#define FP_SUB_E(R,X,Y)		_FP_SUB(E,2,R,X,Y)
+#define FP_MUL_E(R,X,Y)		_FP_MUL(E,2,R,X,Y)
+#define FP_DIV_E(R,X,Y)		_FP_DIV(E,2,R,X,Y)
+#define FP_SQRT_E(R,X)		_FP_SQRT(E,2,R,X)
+
+/*
+ * Square root algorithms:
+ * We have just one right now, maybe Newton approximation
+ * should be added for those machines where division is fast.
+ * We optimize it by doing most of the calculations
+ * in one UWtype registers instead of two, although we don't
+ * have to.
+ */
+#define _FP_SQRT_MEAT_E(R, S, T, X, q)			\
+  do {							\
+    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);		\
+    _FP_FRAC_SRL_2(X, (_FP_WORKBITS));			\
+    while (q)						\
+      {							\
+        T##_f0 = S##_f0 + q;				\
+        if (T##_f0 <= X##_f0)				\
+          {						\
+            S##_f0 = T##_f0 + q;			\
+            X##_f0 -= T##_f0;				\
+            R##_f0 += q;				\
+          }						\
+        _FP_FRAC_SLL_1(X, 1);				\
+        q >>= 1;					\
+      }							\
+    _FP_FRAC_SLL_2(R, (_FP_WORKBITS));			\
+    if (X##_f0)						\
+      {							\
+	if (S##_f0 < X##_f0)				\
+	  R##_f0 |= _FP_WORK_ROUND;			\
+	R##_f0 |= _FP_WORK_STICKY;			\
+      }							\
+  } while (0)
+ 
+#define FP_CMP_E(r,X,Y,un)	_FP_CMP(E,2,r,X,Y,un)
+#define FP_CMP_EQ_E(r,X,Y)	_FP_CMP_EQ(E,2,r,X,Y)
+#define FP_CMP_UNORD_E(r,X,Y)	_FP_CMP_UNORD(E,2,r,X,Y)
+
+#define FP_TO_INT_E(r,X,rsz,rsg)	_FP_TO_INT(E,2,r,X,rsz,rsg)
+#define FP_FROM_INT_E(X,r,rs,rt)	_FP_FROM_INT(E,2,X,r,rs,rt)
+
+#define _FP_FRAC_HIGH_E(X)	(X##_f1)
+#define _FP_FRAC_HIGH_RAW_E(X)	(X##_f0)
+
+#endif /* not _FP_W_TYPE_SIZE < 64 */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/longlong.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/longlong.h
new file mode 100644
index 0000000..a2f38ae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/longlong.h
@@ -0,0 +1,1461 @@
+/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
+   Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2002, 2003, 2004, 2005, 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.  */
+
+/* You have to define the following before including this file:
+
+   UWtype -- An unsigned type, default type for operations (typically a "word")
+   UHWtype -- An unsigned type, at least half the size of UWtype.
+   UDWtype -- An unsigned type, at least twice as large a UWtype
+   W_TYPE_SIZE -- size in bits of UWtype
+
+   UQItype -- Unsigned 8 bit type.
+   SItype, USItype -- Signed and unsigned 32 bit types.
+   DItype, UDItype -- Signed and unsigned 64 bit types.
+
+   On a 32 bit machine UWtype should typically be USItype;
+   on a 64 bit machine, UWtype should typically be UDItype.  */
+
+#define __BITS4 (W_TYPE_SIZE / 4)
+#define __ll_B ((UWtype) 1 << (W_TYPE_SIZE / 2))
+#define __ll_lowpart(t) ((UWtype) (t) & (__ll_B - 1))
+#define __ll_highpart(t) ((UWtype) (t) >> (W_TYPE_SIZE / 2))
+
+#ifndef W_TYPE_SIZE
+#define W_TYPE_SIZE	32
+#define UWtype		USItype
+#define UHWtype		USItype
+#define UDWtype		UDItype
+#endif
+
+extern const UQItype __clz_tab[256] attribute_hidden;
+
+/* Define auxiliary asm macros.
+
+   1) umul_ppmm(high_prod, low_prod, multiplier, multiplicand) multiplies two
+   UWtype integers MULTIPLIER and MULTIPLICAND, and generates a two UWtype
+   word product in HIGH_PROD and LOW_PROD.
+
+   2) __umulsidi3(a,b) multiplies two UWtype integers A and B, and returns a
+   UDWtype product.  This is just a variant of umul_ppmm.
+
+   3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
+   denominator) divides a UDWtype, composed by the UWtype integers
+   HIGH_NUMERATOR and LOW_NUMERATOR, by DENOMINATOR and places the quotient
+   in QUOTIENT and the remainder in REMAINDER.  HIGH_NUMERATOR must be less
+   than DENOMINATOR for correct operation.  If, in addition, the most
+   significant bit of DENOMINATOR must be 1, then the pre-processor symbol
+   UDIV_NEEDS_NORMALIZATION is defined to 1.
+
+   4) sdiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
+   denominator).  Like udiv_qrnnd but the numbers are signed.  The quotient
+   is rounded towards 0.
+
+   5) count_leading_zeros(count, x) counts the number of zero-bits from the
+   msb to the first nonzero bit in the UWtype X.  This is the number of
+   steps X needs to be shifted left to set the msb.  Undefined for X == 0,
+   unless the symbol COUNT_LEADING_ZEROS_0 is defined to some value.
+
+   6) count_trailing_zeros(count, x) like count_leading_zeros, but counts
+   from the least significant end.
+
+   7) add_ssaaaa(high_sum, low_sum, high_addend_1, low_addend_1,
+   high_addend_2, low_addend_2) adds two UWtype integers, composed by
+   HIGH_ADDEND_1 and LOW_ADDEND_1, and HIGH_ADDEND_2 and LOW_ADDEND_2
+   respectively.  The result is placed in HIGH_SUM and LOW_SUM.  Overflow
+   (i.e. carry out) is not stored anywhere, and is lost.
+
+   8) sub_ddmmss(high_difference, low_difference, high_minuend, low_minuend,
+   high_subtrahend, low_subtrahend) subtracts two two-word UWtype integers,
+   composed by HIGH_MINUEND_1 and LOW_MINUEND_1, and HIGH_SUBTRAHEND_2 and
+   LOW_SUBTRAHEND_2 respectively.  The result is placed in HIGH_DIFFERENCE
+   and LOW_DIFFERENCE.  Overflow (i.e. carry out) is not stored anywhere,
+   and is lost.
+
+   If any of these macros are left undefined for a particular CPU,
+   C macros are used.  */
+
+/* The CPUs come in alphabetical order below.
+
+   Please add support for more CPUs here, or improve the current support
+   for the CPUs below!
+   (E.g. WE32100, IBM360.)  */
+
+#if defined (__GNUC__) && !defined (NO_ASM)
+
+/* We sometimes need to clobber "cc" with gcc2, but that would not be
+   understood by gcc1.  Use cpp to avoid major code duplication.  */
+#if __GNUC__ < 2
+#define __CLOBBER_CC
+#define __AND_CLOBBER_CC
+#else /* __GNUC__ >= 2 */
+#define __CLOBBER_CC : "cc"
+#define __AND_CLOBBER_CC , "cc"
+#endif /* __GNUC__ < 2 */
+
+#if defined (__alpha) && W_TYPE_SIZE == 64
+#define umul_ppmm(ph, pl, m0, m1) \
+  do {									\
+    UDItype __m0 = (m0), __m1 = (m1);					\
+    (ph) = __builtin_alpha_umulh (__m0, __m1);				\
+    (pl) = __m0 * __m1;							\
+  } while (0)
+#define UMUL_TIME 46
+#ifndef LONGLONG_STANDALONE
+#define udiv_qrnnd(q, r, n1, n0, d) \
+  do { UDItype __r;							\
+    (q) = __udiv_qrnnd (&__r, (n1), (n0), (d));				\
+    (r) = __r;								\
+  } while (0)
+extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDItype, UDItype);
+#define UDIV_TIME 220
+#endif /* LONGLONG_STANDALONE */
+#ifdef __alpha_cix__
+#define count_leading_zeros(COUNT,X)	((COUNT) = __builtin_clzl (X))
+#define count_trailing_zeros(COUNT,X)	((COUNT) = __builtin_ctzl (X))
+#define COUNT_LEADING_ZEROS_0 64
+#else
+#define count_leading_zeros(COUNT,X) \
+  do {									\
+    UDItype __xr = (X), __t, __a;					\
+    __t = __builtin_alpha_cmpbge (0, __xr);				\
+    __a = __clz_tab[__t ^ 0xff] - 1;					\
+    __t = __builtin_alpha_extbl (__xr, __a);				\
+    (COUNT) = 64 - (__clz_tab[__t] + __a*8);				\
+  } while (0)
+#define count_trailing_zeros(COUNT,X) \
+  do {									\
+    UDItype __xr = (X), __t, __a;					\
+    __t = __builtin_alpha_cmpbge (0, __xr);				\
+    __t = ~__t & -~__t;							\
+    __a = ((__t & 0xCC) != 0) * 2;					\
+    __a += ((__t & 0xF0) != 0) * 4;					\
+    __a += ((__t & 0xAA) != 0);						\
+    __t = __builtin_alpha_extbl (__xr, __a);				\
+    __a <<= 3;								\
+    __t &= -__t;							\
+    __a += ((__t & 0xCC) != 0) * 2;					\
+    __a += ((__t & 0xF0) != 0) * 4;					\
+    __a += ((__t & 0xAA) != 0);						\
+    (COUNT) = __a;							\
+  } while (0)
+#endif /* __alpha_cix__ */
+#endif /* __alpha */
+
+#if defined (__arc__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("add.f	%1, %4, %5\n\tadc	%0, %2, %3"		\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "%r" ((USItype) (ah)),					\
+	     "rIJ" ((USItype) (bh)),					\
+	     "%r" ((USItype) (al)),					\
+	     "rIJ" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("sub.f	%1, %4, %5\n\tsbc	%0, %2, %3"		\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "r" ((USItype) (ah)),					\
+	     "rIJ" ((USItype) (bh)),					\
+	     "r" ((USItype) (al)),					\
+	     "rIJ" ((USItype) (bl)))
+/* Call libgcc routine.  */
+#define umul_ppmm(w1, w0, u, v) \
+do {									\
+  DWunion __w;								\
+  __w.ll = __umulsidi3 (u, v);						\
+  w1 = __w.s.high;							\
+  w0 = __w.s.low;							\
+} while (0)
+#define __umulsidi3 __umulsidi3
+UDItype __umulsidi3 (USItype, USItype);
+#endif
+
+#if defined (__arm__) && !defined (__thumb__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("adds	%1, %4, %5\n\tadc	%0, %2, %3"		\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "%r" ((USItype) (ah)),					\
+	     "rI" ((USItype) (bh)),					\
+	     "%r" ((USItype) (al)),					\
+	     "rI" ((USItype) (bl)) __CLOBBER_CC)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("subs	%1, %4, %5\n\tsbc	%0, %2, %3"		\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "r" ((USItype) (ah)),					\
+	     "rI" ((USItype) (bh)),					\
+	     "r" ((USItype) (al)),					\
+	     "rI" ((USItype) (bl)) __CLOBBER_CC)
+#define umul_ppmm(xh, xl, a, b) \
+{register USItype __t0, __t1, __t2;					\
+  __asm__ ("%@ Inlined umul_ppmm\n"					\
+	   "	mov	%2, %5, lsr #16\n"				\
+	   "	mov	%0, %6, lsr #16\n"				\
+	   "	bic	%3, %5, %2, lsl #16\n"				\
+	   "	bic	%4, %6, %0, lsl #16\n"				\
+	   "	mul	%1, %3, %4\n"					\
+	   "	mul	%4, %2, %4\n"					\
+	   "	mul	%3, %0, %3\n"					\
+	   "	mul	%0, %2, %0\n"					\
+	   "	adds	%3, %4, %3\n"					\
+	   "	addcs	%0, %0, #65536\n"				\
+	   "	adds	%1, %1, %3, lsl #16\n"				\
+	   "	adc	%0, %0, %3, lsr #16"				\
+	   : "=&r" ((USItype) (xh)),					\
+	     "=r" ((USItype) (xl)),					\
+	     "=&r" (__t0), "=&r" (__t1), "=r" (__t2)			\
+	   : "r" ((USItype) (a)),					\
+	     "r" ((USItype) (b)) __CLOBBER_CC );}
+#define UMUL_TIME 20
+#define UDIV_TIME 100
+#endif /* __arm__ */
+
+#if defined(__arm__)
+/* Let gcc decide how best to implement count_leading_zeros.  */
+#define count_leading_zeros(COUNT,X)	((COUNT) = __builtin_clz (X))
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+
+#if defined (__CRIS__) && __CRIS_arch_version >= 3
+#define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clz (X))
+#if __CRIS_arch_version >= 8
+#define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctz (X))
+#endif
+#endif /* __CRIS__ */
+
+#if defined (__hppa) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("add %4,%5,%1\n\taddc %2,%3,%0"				\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "%rM" ((USItype) (ah)),					\
+	     "rM" ((USItype) (bh)),					\
+	     "%rM" ((USItype) (al)),					\
+	     "rM" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("sub %4,%5,%1\n\tsubb %2,%3,%0"				\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "rM" ((USItype) (ah)),					\
+	     "rM" ((USItype) (bh)),					\
+	     "rM" ((USItype) (al)),					\
+	     "rM" ((USItype) (bl)))
+#if defined (_PA_RISC1_1)
+#define umul_ppmm(w1, w0, u, v) \
+  do {									\
+    union								\
+      {									\
+	UDItype __f;							\
+	struct {USItype __w1, __w0;} __w1w0;				\
+      } __t;								\
+    __asm__ ("xmpyu %1,%2,%0"						\
+	     : "=x" (__t.__f)						\
+	     : "x" ((USItype) (u)),					\
+	       "x" ((USItype) (v)));					\
+    (w1) = __t.__w1w0.__w1;						\
+    (w0) = __t.__w1w0.__w0;						\
+     } while (0)
+#define UMUL_TIME 8
+#else
+#define UMUL_TIME 30
+#endif
+#define UDIV_TIME 40
+#define count_leading_zeros(count, x) \
+  do {									\
+    USItype __tmp;							\
+    __asm__ (								\
+       "ldi		1,%0\n"						\
+"	extru,=		%1,15,16,%%r0		; Bits 31..16 zero?\n"	\
+"	extru,tr	%1,15,16,%1		; No.  Shift down, skip add.\n"\
+"	ldo		16(%0),%0		; Yes.  Perform add.\n"	\
+"	extru,=		%1,23,8,%%r0		; Bits 15..8 zero?\n"	\
+"	extru,tr	%1,23,8,%1		; No.  Shift down, skip add.\n"\
+"	ldo		8(%0),%0		; Yes.  Perform add.\n"	\
+"	extru,=		%1,27,4,%%r0		; Bits 7..4 zero?\n"	\
+"	extru,tr	%1,27,4,%1		; No.  Shift down, skip add.\n"\
+"	ldo		4(%0),%0		; Yes.  Perform add.\n"	\
+"	extru,=		%1,29,2,%%r0		; Bits 3..2 zero?\n"	\
+"	extru,tr	%1,29,2,%1		; No.  Shift down, skip add.\n"\
+"	ldo		2(%0),%0		; Yes.  Perform add.\n"	\
+"	extru		%1,30,1,%1		; Extract bit 1.\n"	\
+"	sub		%0,%1,%0		; Subtract it.\n"	\
+	: "=r" (count), "=r" (__tmp) : "1" (x));			\
+  } while (0)
+#endif
+
+#if (defined (__i370__) || defined (__s390__) || defined (__mvs__)) && W_TYPE_SIZE == 32
+#define smul_ppmm(xh, xl, m0, m1) \
+  do {									\
+    union {DItype __ll;							\
+	   struct {USItype __h, __l;} __i;				\
+	  } __x;							\
+    __asm__ ("lr %N0,%1\n\tmr %0,%2"					\
+	     : "=&r" (__x.__ll)						\
+	     : "r" (m0), "r" (m1));					\
+    (xh) = __x.__i.__h; (xl) = __x.__i.__l;				\
+  } while (0)
+#define sdiv_qrnnd(q, r, n1, n0, d) \
+  do {									\
+    union {DItype __ll;							\
+	   struct {USItype __h, __l;} __i;				\
+	  } __x;							\
+    __x.__i.__h = n1; __x.__i.__l = n0;					\
+    __asm__ ("dr %0,%2"							\
+	     : "=r" (__x.__ll)						\
+	     : "0" (__x.__ll), "r" (d));				\
+    (q) = __x.__i.__l; (r) = __x.__i.__h;				\
+  } while (0)
+#endif
+
+#if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("add{l} {%5,%1|%1,%5}\n\tadc{l} {%3,%0|%0,%3}"		\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "%0" ((USItype) (ah)),					\
+	     "g" ((USItype) (bh)),					\
+	     "%1" ((USItype) (al)),					\
+	     "g" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("sub{l} {%5,%1|%1,%5}\n\tsbb{l} {%3,%0|%0,%3}"		\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "0" ((USItype) (ah)),					\
+	     "g" ((USItype) (bh)),					\
+	     "1" ((USItype) (al)),					\
+	     "g" ((USItype) (bl)))
+#define umul_ppmm(w1, w0, u, v) \
+  __asm__ ("mul{l} %3"							\
+	   : "=a" ((USItype) (w0)),					\
+	     "=d" ((USItype) (w1))					\
+	   : "%0" ((USItype) (u)),					\
+	     "rm" ((USItype) (v)))
+#define udiv_qrnnd(q, r, n1, n0, dv) \
+  __asm__ ("div{l} %4"							\
+	   : "=a" ((USItype) (q)),					\
+	     "=d" ((USItype) (r))					\
+	   : "0" ((USItype) (n0)),					\
+	     "1" ((USItype) (n1)),					\
+	     "rm" ((USItype) (dv)))
+#define count_leading_zeros(count, x)	((count) = __builtin_clz (x))
+#define count_trailing_zeros(count, x)	((count) = __builtin_ctz (x))
+#define UMUL_TIME 40
+#define UDIV_TIME 40
+#endif /* 80x86 */
+
+#if (defined (__x86_64__) || defined (__i386__)) && W_TYPE_SIZE == 64
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("add{q} {%5,%1|%1,%5}\n\tadc{q} {%3,%0|%0,%3}"		\
+	   : "=r" ((UDItype) (sh)),					\
+	     "=&r" ((UDItype) (sl))					\
+	   : "%0" ((UDItype) (ah)),					\
+	     "rme" ((UDItype) (bh)),					\
+	     "%1" ((UDItype) (al)),					\
+	     "rme" ((UDItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("sub{q} {%5,%1|%1,%5}\n\tsbb{q} {%3,%0|%0,%3}"		\
+	   : "=r" ((UDItype) (sh)),					\
+	     "=&r" ((UDItype) (sl))					\
+	   : "0" ((UDItype) (ah)),					\
+	     "rme" ((UDItype) (bh)),					\
+	     "1" ((UDItype) (al)),					\
+	     "rme" ((UDItype) (bl)))
+#define umul_ppmm(w1, w0, u, v) \
+  __asm__ ("mul{q} %3"							\
+	   : "=a" ((UDItype) (w0)),					\
+	     "=d" ((UDItype) (w1))					\
+	   : "%0" ((UDItype) (u)),					\
+	     "rm" ((UDItype) (v)))
+#define udiv_qrnnd(q, r, n1, n0, dv) \
+  __asm__ ("div{q} %4"							\
+	   : "=a" ((UDItype) (q)),					\
+	     "=d" ((UDItype) (r))					\
+	   : "0" ((UDItype) (n0)),					\
+	     "1" ((UDItype) (n1)),					\
+	     "rm" ((UDItype) (dv)))
+#define count_leading_zeros(count, x)	((count) = __builtin_clzl (x))
+#define count_trailing_zeros(count, x)	((count) = __builtin_ctzl (x))
+#define UMUL_TIME 40
+#define UDIV_TIME 40
+#endif /* x86_64 */
+
+#if defined (__i960__) && W_TYPE_SIZE == 32
+#define umul_ppmm(w1, w0, u, v) \
+  ({union {UDItype __ll;						\
+	   struct {USItype __l, __h;} __i;				\
+	  } __xx;							\
+  __asm__ ("emul	%2,%1,%0"					\
+	   : "=d" (__xx.__ll)						\
+	   : "%dI" ((USItype) (u)),					\
+	     "dI" ((USItype) (v)));					\
+  (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
+#define __umulsidi3(u, v) \
+  ({UDItype __w;							\
+    __asm__ ("emul	%2,%1,%0"					\
+	     : "=d" (__w)						\
+	     : "%dI" ((USItype) (u)),					\
+	       "dI" ((USItype) (v)));					\
+    __w; })
+#endif /* __i960__ */
+
+#if defined (__M32R__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  /* The cmp clears the condition bit.  */ \
+  __asm__ ("cmp %0,%0\n\taddx %1,%5\n\taddx %0,%3"			\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "0" ((USItype) (ah)),					\
+	     "r" ((USItype) (bh)),					\
+	     "1" ((USItype) (al)),					\
+	     "r" ((USItype) (bl))					\
+	   : "cbit")
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  /* The cmp clears the condition bit.  */ \
+  __asm__ ("cmp %0,%0\n\tsubx %1,%5\n\tsubx %0,%3"			\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "0" ((USItype) (ah)),					\
+	     "r" ((USItype) (bh)),					\
+	     "1" ((USItype) (al)),					\
+	     "r" ((USItype) (bl))					\
+	   : "cbit")
+#endif /* __M32R__ */
+
+#if defined (__mc68000__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("add%.l %5,%1\n\taddx%.l %3,%0"				\
+	   : "=d" ((USItype) (sh)),					\
+	     "=&d" ((USItype) (sl))					\
+	   : "%0" ((USItype) (ah)),					\
+	     "d" ((USItype) (bh)),					\
+	     "%1" ((USItype) (al)),					\
+	     "g" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("sub%.l %5,%1\n\tsubx%.l %3,%0"				\
+	   : "=d" ((USItype) (sh)),					\
+	     "=&d" ((USItype) (sl))					\
+	   : "0" ((USItype) (ah)),					\
+	     "d" ((USItype) (bh)),					\
+	     "1" ((USItype) (al)),					\
+	     "g" ((USItype) (bl)))
+
+/* The '020, '030, '040, '060 and CPU32 have 32x32->64 and 64/32->32q-32r.  */
+#if (defined (__mc68020__) && !defined (__mc68060__))
+#define umul_ppmm(w1, w0, u, v) \
+  __asm__ ("mulu%.l %3,%1:%0"						\
+	   : "=d" ((USItype) (w0)),					\
+	     "=d" ((USItype) (w1))					\
+	   : "%0" ((USItype) (u)),					\
+	     "dmi" ((USItype) (v)))
+#define UMUL_TIME 45
+#define udiv_qrnnd(q, r, n1, n0, d) \
+  __asm__ ("divu%.l %4,%1:%0"						\
+	   : "=d" ((USItype) (q)),					\
+	     "=d" ((USItype) (r))					\
+	   : "0" ((USItype) (n0)),					\
+	     "1" ((USItype) (n1)),					\
+	     "dmi" ((USItype) (d)))
+#define UDIV_TIME 90
+#define sdiv_qrnnd(q, r, n1, n0, d) \
+  __asm__ ("divs%.l %4,%1:%0"						\
+	   : "=d" ((USItype) (q)),					\
+	     "=d" ((USItype) (r))					\
+	   : "0" ((USItype) (n0)),					\
+	     "1" ((USItype) (n1)),					\
+	     "dmi" ((USItype) (d)))
+
+#elif defined (__mcoldfire__) /* not mc68020 */
+
+#define umul_ppmm(xh, xl, a, b) \
+  __asm__ ("| Inlined umul_ppmm\n"					\
+	   "	move%.l	%2,%/d0\n"					\
+	   "	move%.l	%3,%/d1\n"					\
+	   "	move%.l	%/d0,%/d2\n"					\
+	   "	swap	%/d0\n"						\
+	   "	move%.l	%/d1,%/d3\n"					\
+	   "	swap	%/d1\n"						\
+	   "	move%.w	%/d2,%/d4\n"					\
+	   "	mulu	%/d3,%/d4\n"					\
+	   "	mulu	%/d1,%/d2\n"					\
+	   "	mulu	%/d0,%/d3\n"					\
+	   "	mulu	%/d0,%/d1\n"					\
+	   "	move%.l	%/d4,%/d0\n"					\
+	   "	clr%.w	%/d0\n"						\
+	   "	swap	%/d0\n"						\
+	   "	add%.l	%/d0,%/d2\n"					\
+	   "	add%.l	%/d3,%/d2\n"					\
+	   "	jcc	1f\n"						\
+	   "	add%.l	%#65536,%/d1\n"					\
+	   "1:	swap	%/d2\n"						\
+	   "	moveq	%#0,%/d0\n"					\
+	   "	move%.w	%/d2,%/d0\n"					\
+	   "	move%.w	%/d4,%/d2\n"					\
+	   "	move%.l	%/d2,%1\n"					\
+	   "	add%.l	%/d1,%/d0\n"					\
+	   "	move%.l	%/d0,%0"					\
+	   : "=g" ((USItype) (xh)),					\
+	     "=g" ((USItype) (xl))					\
+	   : "g" ((USItype) (a)),					\
+	     "g" ((USItype) (b))					\
+	   : "d0", "d1", "d2", "d3", "d4")
+#define UMUL_TIME 100
+#define UDIV_TIME 400
+#else /* not ColdFire */
+/* %/ inserts REGISTER_PREFIX, %# inserts IMMEDIATE_PREFIX.  */
+#define umul_ppmm(xh, xl, a, b) \
+  __asm__ ("| Inlined umul_ppmm\n"					\
+	   "	move%.l	%2,%/d0\n"					\
+	   "	move%.l	%3,%/d1\n"					\
+	   "	move%.l	%/d0,%/d2\n"					\
+	   "	swap	%/d0\n"						\
+	   "	move%.l	%/d1,%/d3\n"					\
+	   "	swap	%/d1\n"						\
+	   "	move%.w	%/d2,%/d4\n"					\
+	   "	mulu	%/d3,%/d4\n"					\
+	   "	mulu	%/d1,%/d2\n"					\
+	   "	mulu	%/d0,%/d3\n"					\
+	   "	mulu	%/d0,%/d1\n"					\
+	   "	move%.l	%/d4,%/d0\n"					\
+	   "	eor%.w	%/d0,%/d0\n"					\
+	   "	swap	%/d0\n"						\
+	   "	add%.l	%/d0,%/d2\n"					\
+	   "	add%.l	%/d3,%/d2\n"					\
+	   "	jcc	1f\n"						\
+	   "	add%.l	%#65536,%/d1\n"					\
+	   "1:	swap	%/d2\n"						\
+	   "	moveq	%#0,%/d0\n"					\
+	   "	move%.w	%/d2,%/d0\n"					\
+	   "	move%.w	%/d4,%/d2\n"					\
+	   "	move%.l	%/d2,%1\n"					\
+	   "	add%.l	%/d1,%/d0\n"					\
+	   "	move%.l	%/d0,%0"					\
+	   : "=g" ((USItype) (xh)),					\
+	     "=g" ((USItype) (xl))					\
+	   : "g" ((USItype) (a)),					\
+	     "g" ((USItype) (b))					\
+	   : "d0", "d1", "d2", "d3", "d4")
+#define UMUL_TIME 100
+#define UDIV_TIME 400
+
+#endif /* not mc68020 */
+
+/* The '020, '030, '040 and '060 have bitfield insns.
+   cpu32 disguises as a 68020, but lacks them.  */
+#if defined (__mc68020__) && !defined (__mcpu32__)
+#define count_leading_zeros(count, x) \
+  __asm__ ("bfffo %1{%b2:%b2},%0"					\
+	   : "=d" ((USItype) (count))					\
+	   : "od" ((USItype) (x)), "n" (0))
+/* Some ColdFire architectures have a ff1 instruction supported via
+   __builtin_clz. */
+#elif defined (__mcfisaaplus__) || defined (__mcfisac__)
+#define count_leading_zeros(count,x) ((count) = __builtin_clz (x))
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+#endif /* mc68000 */
+
+#if defined (__m88000__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("addu.co %1,%r4,%r5\n\taddu.ci %0,%r2,%r3"			\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "%rJ" ((USItype) (ah)),					\
+	     "rJ" ((USItype) (bh)),					\
+	     "%rJ" ((USItype) (al)),					\
+	     "rJ" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("subu.co %1,%r4,%r5\n\tsubu.ci %0,%r2,%r3"			\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "rJ" ((USItype) (ah)),					\
+	     "rJ" ((USItype) (bh)),					\
+	     "rJ" ((USItype) (al)),					\
+	     "rJ" ((USItype) (bl)))
+#define count_leading_zeros(count, x) \
+  do {									\
+    USItype __cbtmp;							\
+    __asm__ ("ff1 %0,%1"						\
+	     : "=r" (__cbtmp)						\
+	     : "r" ((USItype) (x)));					\
+    (count) = __cbtmp ^ 31;						\
+  } while (0)
+#define COUNT_LEADING_ZEROS_0 63 /* sic */
+#if defined (__mc88110__)
+#define umul_ppmm(wh, wl, u, v) \
+  do {									\
+    union {UDItype __ll;						\
+	   struct {USItype __h, __l;} __i;				\
+	  } __xx;							\
+    __asm__ ("mulu.d	%0,%1,%2"					\
+	     : "=r" (__xx.__ll)						\
+	     : "r" ((USItype) (u)),					\
+	       "r" ((USItype) (v)));					\
+    (wh) = __xx.__i.__h;						\
+    (wl) = __xx.__i.__l;						\
+  } while (0)
+#define udiv_qrnnd(q, r, n1, n0, d) \
+  ({union {UDItype __ll;						\
+	   struct {USItype __h, __l;} __i;				\
+	  } __xx;							\
+  USItype __q;								\
+  __xx.__i.__h = (n1); __xx.__i.__l = (n0);				\
+  __asm__ ("divu.d %0,%1,%2"						\
+	   : "=r" (__q)							\
+	   : "r" (__xx.__ll),						\
+	     "r" ((USItype) (d)));					\
+  (r) = (n0) - __q * (d); (q) = __q; })
+#define UMUL_TIME 5
+#define UDIV_TIME 25
+#else
+#define UMUL_TIME 17
+#define UDIV_TIME 150
+#endif /* __mc88110__ */
+#endif /* __m88000__ */
+
+#if defined (__mips__) && W_TYPE_SIZE == 32
+#define umul_ppmm(w1, w0, u, v)						\
+  do {									\
+    UDItype __x = (UDItype) (USItype) (u) * (USItype) (v);		\
+    (w1) = (USItype) (__x >> 32);					\
+    (w0) = (USItype) (__x);						\
+  } while (0)
+#define UMUL_TIME 10
+#define UDIV_TIME 100
+
+#if (__mips == 32 || __mips == 64) && ! __mips16
+#define count_leading_zeros(COUNT,X)	((COUNT) = __builtin_clz (X))
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+#endif /* __mips__ */
+
+#if defined (__ns32000__) && W_TYPE_SIZE == 32
+#define umul_ppmm(w1, w0, u, v) \
+  ({union {UDItype __ll;						\
+	   struct {USItype __l, __h;} __i;				\
+	  } __xx;							\
+  __asm__ ("meid %2,%0"							\
+	   : "=g" (__xx.__ll)						\
+	   : "%0" ((USItype) (u)),					\
+	     "g" ((USItype) (v)));					\
+  (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
+#define __umulsidi3(u, v) \
+  ({UDItype __w;							\
+    __asm__ ("meid %2,%0"						\
+	     : "=g" (__w)						\
+	     : "%0" ((USItype) (u)),					\
+	       "g" ((USItype) (v)));					\
+    __w; })
+#define udiv_qrnnd(q, r, n1, n0, d) \
+  ({union {UDItype __ll;						\
+	   struct {USItype __l, __h;} __i;				\
+	  } __xx;							\
+  __xx.__i.__h = (n1); __xx.__i.__l = (n0);				\
+  __asm__ ("deid %2,%0"							\
+	   : "=g" (__xx.__ll)						\
+	   : "0" (__xx.__ll),						\
+	     "g" ((USItype) (d)));					\
+  (r) = __xx.__i.__l; (q) = __xx.__i.__h; })
+#define count_trailing_zeros(count,x) \
+  do {									\
+    __asm__ ("ffsd     %2,%0"						\
+            : "=r" ((USItype) (count))					\
+            : "0" ((USItype) 0),					\
+              "r" ((USItype) (x)));					\
+  } while (0)
+#endif /* __ns32000__ */
+
+/* FIXME: We should test _IBMR2 here when we add assembly support for the
+   system vendor compilers.
+   FIXME: What's needed for gcc PowerPC VxWorks?  __vxworks__ is not good
+   enough, since that hits ARM and m68k too.  */
+#if (defined (_ARCH_PPC)	/* AIX */				\
+     || defined (_ARCH_PWR)	/* AIX */				\
+     || defined (_ARCH_COM)	/* AIX */				\
+     || defined (__powerpc__)	/* gcc */				\
+     || defined (__POWERPC__)	/* BEOS */				\
+     || defined (__ppc__)	/* Darwin */				\
+     || (defined (PPC) && ! defined (CPU_FAMILY)) /* gcc 2.7.x GNU&SysV */    \
+     || (defined (PPC) && defined (CPU_FAMILY)    /* VxWorks */               \
+         && CPU_FAMILY == PPC)                                                \
+     ) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  do {									\
+    if (__builtin_constant_p (bh) && (bh) == 0)				\
+      __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2"		\
+	     : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
+    else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0)		\
+      __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2"		\
+	     : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
+    else								\
+      __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3"		\
+	     : "=r" (sh), "=&r" (sl)					\
+	     : "%r" (ah), "r" (bh), "%r" (al), "rI" (bl));		\
+  } while (0)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  do {									\
+    if (__builtin_constant_p (ah) && (ah) == 0)				\
+      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2"	\
+	       : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
+    else if (__builtin_constant_p (ah) && (ah) == ~(USItype) 0)		\
+      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2"	\
+	       : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
+    else if (__builtin_constant_p (bh) && (bh) == 0)			\
+      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2"		\
+	       : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
+    else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0)		\
+      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2"		\
+	       : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
+    else								\
+      __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2"	\
+	       : "=r" (sh), "=&r" (sl)					\
+	       : "r" (ah), "r" (bh), "rI" (al), "r" (bl));		\
+  } while (0)
+#define count_leading_zeros(count, x) \
+  __asm__ ("{cntlz|cntlzw} %0,%1" : "=r" (count) : "r" (x))
+#define COUNT_LEADING_ZEROS_0 32
+#if defined (_ARCH_PPC) || defined (__powerpc__) || defined (__POWERPC__) \
+  || defined (__ppc__)                                                    \
+  || (defined (PPC) && ! defined (CPU_FAMILY)) /* gcc 2.7.x GNU&SysV */       \
+  || (defined (PPC) && defined (CPU_FAMILY)    /* VxWorks */                  \
+         && CPU_FAMILY == PPC)
+#define umul_ppmm(ph, pl, m0, m1) \
+  do {									\
+    USItype __m0 = (m0), __m1 = (m1);					\
+    __asm__ ("mulhwu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1));	\
+    (pl) = __m0 * __m1;							\
+  } while (0)
+#define UMUL_TIME 15
+#define smul_ppmm(ph, pl, m0, m1) \
+  do {									\
+    SItype __m0 = (m0), __m1 = (m1);					\
+    __asm__ ("mulhw %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1));	\
+    (pl) = __m0 * __m1;							\
+  } while (0)
+#define SMUL_TIME 14
+#define UDIV_TIME 120
+#elif defined (_ARCH_PWR)
+#define UMUL_TIME 8
+#define smul_ppmm(xh, xl, m0, m1) \
+  __asm__ ("mul %0,%2,%3" : "=r" (xh), "=q" (xl) : "r" (m0), "r" (m1))
+#define SMUL_TIME 4
+#define sdiv_qrnnd(q, r, nh, nl, d) \
+  __asm__ ("div %0,%2,%4" : "=r" (q), "=q" (r) : "r" (nh), "1" (nl), "r" (d))
+#define UDIV_TIME 100
+#endif
+#endif /* 32-bit POWER architecture variants.  */
+
+/* We should test _IBMR2 here when we add assembly support for the system
+   vendor compilers.  */
+#if (defined (_ARCH_PPC64) || defined (__powerpc64__)) && W_TYPE_SIZE == 64
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  do {									\
+    if (__builtin_constant_p (bh) && (bh) == 0)				\
+      __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2"		\
+	     : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
+    else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0)		\
+      __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2"		\
+	     : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
+    else								\
+      __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3"		\
+	     : "=r" (sh), "=&r" (sl)					\
+	     : "%r" (ah), "r" (bh), "%r" (al), "rI" (bl));		\
+  } while (0)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  do {									\
+    if (__builtin_constant_p (ah) && (ah) == 0)				\
+      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2"	\
+	       : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
+    else if (__builtin_constant_p (ah) && (ah) == ~(UDItype) 0)		\
+      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2"	\
+	       : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
+    else if (__builtin_constant_p (bh) && (bh) == 0)			\
+      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2"		\
+	       : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
+    else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0)		\
+      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2"		\
+	       : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
+    else								\
+      __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2"	\
+	       : "=r" (sh), "=&r" (sl)					\
+	       : "r" (ah), "r" (bh), "rI" (al), "r" (bl));		\
+  } while (0)
+#define count_leading_zeros(count, x) \
+  __asm__ ("cntlzd %0,%1" : "=r" (count) : "r" (x))
+#define COUNT_LEADING_ZEROS_0 64
+#define umul_ppmm(ph, pl, m0, m1) \
+  do {									\
+    UDItype __m0 = (m0), __m1 = (m1);					\
+    __asm__ ("mulhdu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1));	\
+    (pl) = __m0 * __m1;							\
+  } while (0)
+#define UMUL_TIME 15
+#define smul_ppmm(ph, pl, m0, m1) \
+  do {									\
+    DItype __m0 = (m0), __m1 = (m1);					\
+    __asm__ ("mulhd %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1));	\
+    (pl) = __m0 * __m1;							\
+  } while (0)
+#define SMUL_TIME 14  /* ??? */
+#define UDIV_TIME 120 /* ??? */
+#endif /* 64-bit PowerPC.  */
+
+#if defined (__ibm032__) /* RT/ROMP */ && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("a %1,%5\n\tae %0,%3"					\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "%0" ((USItype) (ah)),					\
+	     "r" ((USItype) (bh)),					\
+	     "%1" ((USItype) (al)),					\
+	     "r" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("s %1,%5\n\tse %0,%3"					\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "0" ((USItype) (ah)),					\
+	     "r" ((USItype) (bh)),					\
+	     "1" ((USItype) (al)),					\
+	     "r" ((USItype) (bl)))
+#define umul_ppmm(ph, pl, m0, m1) \
+  do {									\
+    USItype __m0 = (m0), __m1 = (m1);					\
+    __asm__ (								\
+       "s	r2,r2\n"						\
+"	mts	r10,%2\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	m	r2,%3\n"						\
+"	cas	%0,r2,r0\n"						\
+"	mfs	r10,%1"							\
+	     : "=r" ((USItype) (ph)),					\
+	       "=r" ((USItype) (pl))					\
+	     : "%r" (__m0),						\
+		"r" (__m1)						\
+	     : "r2");							\
+    (ph) += ((((SItype) __m0 >> 31) & __m1)				\
+	     + (((SItype) __m1 >> 31) & __m0));				\
+  } while (0)
+#define UMUL_TIME 20
+#define UDIV_TIME 200
+#define count_leading_zeros(count, x) \
+  do {									\
+    if ((x) >= 0x10000)							\
+      __asm__ ("clz	%0,%1"						\
+	       : "=r" ((USItype) (count))				\
+	       : "r" ((USItype) (x) >> 16));				\
+    else								\
+      {									\
+	__asm__ ("clz	%0,%1"						\
+		 : "=r" ((USItype) (count))				\
+		 : "r" ((USItype) (x)));					\
+	(count) += 16;							\
+      }									\
+  } while (0)
+#endif
+
+#if defined(__sh__) && !__SHMEDIA__ && W_TYPE_SIZE == 32
+#ifndef __sh1__
+#define umul_ppmm(w1, w0, u, v) \
+  __asm__ (								\
+       "dmulu.l	%2,%3\n\tsts%M1	macl,%1\n\tsts%M0	mach,%0"	\
+	   : "=r<" ((USItype)(w1)),					\
+	     "=r<" ((USItype)(w0))					\
+	   : "r" ((USItype)(u)),					\
+	     "r" ((USItype)(v))						\
+	   : "macl", "mach")
+#define UMUL_TIME 5
+#endif
+
+/* This is the same algorithm as __udiv_qrnnd_c.  */
+#define UDIV_NEEDS_NORMALIZATION 1
+
+#define udiv_qrnnd(q, r, n1, n0, d) \
+  do {									\
+    extern UWtype __udiv_qrnnd_16 (UWtype, UWtype)			\
+                        __attribute__ ((visibility ("hidden")));	\
+    /* r0: rn r1: qn */ /* r0: n1 r4: n0 r5: d r6: d1 */ /* r2: __m */	\
+    __asm__ (								\
+	"mov%M4 %4,r5\n"						\
+"	swap.w %3,r4\n"							\
+"	swap.w r5,r6\n"							\
+"	jsr @%5\n"							\
+"	shll16 r6\n"							\
+"	swap.w r4,r4\n"							\
+"	jsr @%5\n"							\
+"	swap.w r1,%0\n"							\
+"	or r1,%0"							\
+	: "=r" (q), "=&z" (r)						\
+	: "1" (n1), "r" (n0), "rm" (d), "r" (&__udiv_qrnnd_16)		\
+	: "r1", "r2", "r4", "r5", "r6", "pr");				\
+  } while (0)
+
+#define UDIV_TIME 80
+
+#define sub_ddmmss(sh, sl, ah, al, bh, bl)				\
+  __asm__ ("clrt;subc %5,%1; subc %4,%0"				\
+	   : "=r" (sh), "=r" (sl)					\
+	   : "0" (ah), "1" (al), "r" (bh), "r" (bl))
+
+#endif /* __sh__ */
+
+#if defined (__SH5__) && __SHMEDIA__ && W_TYPE_SIZE == 32
+#define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
+#define count_leading_zeros(count, x) \
+  do									\
+    {									\
+      UDItype x_ = (USItype)(x);					\
+      SItype c_;							\
+									\
+      __asm__ ("nsb %1, %0" : "=r" (c_) : "r" (x_));			\
+      (count) = c_ - 31;						\
+    }									\
+  while (0)
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+
+#if defined (__sparc__) && !defined (__arch64__) && !defined (__sparcv9) \
+    && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("addcc %r4,%5,%1\n\taddx %r2,%3,%0"				\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "%rJ" ((USItype) (ah)),					\
+	     "rI" ((USItype) (bh)),					\
+	     "%rJ" ((USItype) (al)),					\
+	     "rI" ((USItype) (bl))					\
+	   __CLOBBER_CC)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("subcc %r4,%5,%1\n\tsubx %r2,%3,%0"				\
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "rJ" ((USItype) (ah)),					\
+	     "rI" ((USItype) (bh)),					\
+	     "rJ" ((USItype) (al)),					\
+	     "rI" ((USItype) (bl))					\
+	   __CLOBBER_CC)
+#if defined (__sparc_v8__)
+#define umul_ppmm(w1, w0, u, v) \
+  __asm__ ("umul %2,%3,%1;rd %%y,%0"					\
+	   : "=r" ((USItype) (w1)),					\
+	     "=r" ((USItype) (w0))					\
+	   : "r" ((USItype) (u)),					\
+	     "r" ((USItype) (v)))
+#define udiv_qrnnd(__q, __r, __n1, __n0, __d) \
+  __asm__ ("mov %2,%%y;nop;nop;nop;udiv %3,%4,%0;umul %0,%4,%1;sub %3,%1,%1"\
+	   : "=&r" ((USItype) (__q)),					\
+	     "=&r" ((USItype) (__r))					\
+	   : "r" ((USItype) (__n1)),					\
+	     "r" ((USItype) (__n0)),					\
+	     "r" ((USItype) (__d)))
+#else
+#if defined (__sparclite__)
+/* This has hardware multiply but not divide.  It also has two additional
+   instructions scan (ffs from high bit) and divscc.  */
+#define umul_ppmm(w1, w0, u, v) \
+  __asm__ ("umul %2,%3,%1;rd %%y,%0"					\
+	   : "=r" ((USItype) (w1)),					\
+	     "=r" ((USItype) (w0))					\
+	   : "r" ((USItype) (u)),					\
+	     "r" ((USItype) (v)))
+#define udiv_qrnnd(q, r, n1, n0, d) \
+  __asm__ ("! Inlined udiv_qrnnd\n"					\
+"	wr	%%g0,%2,%%y	! Not a delayed write for sparclite\n"	\
+"	tst	%%g0\n"							\
+"	divscc	%3,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%%g1\n"						\
+"	divscc	%%g1,%4,%0\n"						\
+"	rd	%%y,%1\n"						\
+"	bl,a 1f\n"							\
+"	add	%1,%4,%1\n"						\
+"1:	! End of inline udiv_qrnnd"					\
+	   : "=r" ((USItype) (q)),					\
+	     "=r" ((USItype) (r))					\
+	   : "r" ((USItype) (n1)),					\
+	     "r" ((USItype) (n0)),					\
+	     "rI" ((USItype) (d))					\
+	   : "g1" __AND_CLOBBER_CC)
+#define UDIV_TIME 37
+#define count_leading_zeros(count, x) \
+  do {                                                                  \
+  __asm__ ("scan %1,1,%0"                                               \
+           : "=r" ((USItype) (count))                                   \
+           : "r" ((USItype) (x)));					\
+  } while (0)
+/* Early sparclites return 63 for an argument of 0, but they warn that future
+   implementations might change this.  Therefore, leave COUNT_LEADING_ZEROS_0
+   undefined.  */
+#else
+/* SPARC without integer multiplication and divide instructions.
+   (i.e. at least Sun4/20,40,60,65,75,110,260,280,330,360,380,470,490) */
+#define umul_ppmm(w1, w0, u, v) \
+  __asm__ ("! Inlined umul_ppmm\n"					\
+"	wr	%%g0,%2,%%y	! SPARC has 0-3 delay insn after a wr\n"\
+"	sra	%3,31,%%o5	! Don't move this insn\n"		\
+"	and	%2,%%o5,%%o5	! Don't move this insn\n"		\
+"	andcc	%%g0,0,%%g1	! Don't move this insn\n"		\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,%3,%%g1\n"						\
+"	mulscc	%%g1,0,%%g1\n"						\
+"	add	%%g1,%%o5,%0\n"						\
+"	rd	%%y,%1"							\
+	   : "=r" ((USItype) (w1)),					\
+	     "=r" ((USItype) (w0))					\
+	   : "%rI" ((USItype) (u)),					\
+	     "r" ((USItype) (v))						\
+	   : "g1", "o5" __AND_CLOBBER_CC)
+#define UMUL_TIME 39		/* 39 instructions */
+/* It's quite necessary to add this much assembler for the sparc.
+   The default udiv_qrnnd (in C) is more than 10 times slower!  */
+#define udiv_qrnnd(__q, __r, __n1, __n0, __d) \
+  __asm__ ("! Inlined udiv_qrnnd\n"					\
+"	mov	32,%%g1\n"						\
+"	subcc	%1,%2,%%g0\n"						\
+"1:	bcs	5f\n"							\
+"	 addxcc %0,%0,%0	! shift n1n0 and a q-bit in lsb\n"	\
+"	sub	%1,%2,%1	! this kills msb of n\n"		\
+"	addx	%1,%1,%1	! so this can't give carry\n"		\
+"	subcc	%%g1,1,%%g1\n"						\
+"2:	bne	1b\n"							\
+"	 subcc	%1,%2,%%g0\n"						\
+"	bcs	3f\n"							\
+"	 addxcc %0,%0,%0	! shift n1n0 and a q-bit in lsb\n"	\
+"	b	3f\n"							\
+"	 sub	%1,%2,%1	! this kills msb of n\n"		\
+"4:	sub	%1,%2,%1\n"						\
+"5:	addxcc	%1,%1,%1\n"						\
+"	bcc	2b\n"							\
+"	 subcc	%%g1,1,%%g1\n"						\
+"! Got carry from n.  Subtract next step to cancel this carry.\n"	\
+"	bne	4b\n"							\
+"	 addcc	%0,%0,%0	! shift n1n0 and a 0-bit in lsb\n"	\
+"	sub	%1,%2,%1\n"						\
+"3:	xnor	%0,0,%0\n"						\
+"	! End of inline udiv_qrnnd"					\
+	   : "=&r" ((USItype) (__q)),					\
+	     "=&r" ((USItype) (__r))					\
+	   : "r" ((USItype) (__d)),					\
+	     "1" ((USItype) (__n1)),					\
+	     "0" ((USItype) (__n0)) : "g1" __AND_CLOBBER_CC)
+#define UDIV_TIME (3+7*32)	/* 7 instructions/iteration. 32 iterations.  */
+#endif /* __sparclite__ */
+#endif /* __sparc_v8__ */
+#endif /* sparc32 */
+
+#if ((defined (__sparc__) && defined (__arch64__)) || defined (__sparcv9)) \
+    && W_TYPE_SIZE == 64
+#define add_ssaaaa(sh, sl, ah, al, bh, bl)				\
+  __asm__ ("addcc %r4,%5,%1\n\t"					\
+   	   "add %r2,%3,%0\n\t"						\
+   	   "bcs,a,pn %%xcc, 1f\n\t"					\
+   	   "add %0, 1, %0\n"						\
+	   "1:"								\
+	   : "=r" ((UDItype)(sh)),				      	\
+	     "=&r" ((UDItype)(sl))				      	\
+	   : "%rJ" ((UDItype)(ah)),				     	\
+	     "rI" ((UDItype)(bh)),				      	\
+	     "%rJ" ((UDItype)(al)),				     	\
+	     "rI" ((UDItype)(bl))				       	\
+	   __CLOBBER_CC)
+
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) 				\
+  __asm__ ("subcc %r4,%5,%1\n\t"					\
+   	   "sub %r2,%3,%0\n\t"						\
+   	   "bcs,a,pn %%xcc, 1f\n\t"					\
+   	   "sub %0, 1, %0\n\t"						\
+	   "1:"								\
+	   : "=r" ((UDItype)(sh)),				      	\
+	     "=&r" ((UDItype)(sl))				      	\
+	   : "rJ" ((UDItype)(ah)),				     	\
+	     "rI" ((UDItype)(bh)),				      	\
+	     "rJ" ((UDItype)(al)),				     	\
+	     "rI" ((UDItype)(bl))				       	\
+	   __CLOBBER_CC)
+
+#define umul_ppmm(wh, wl, u, v)						\
+  do {									\
+	  UDItype tmp1, tmp2, tmp3, tmp4;				\
+	  __asm__ __volatile__ (					\
+		   "srl %7,0,%3\n\t"					\
+		   "mulx %3,%6,%1\n\t"					\
+		   "srlx %6,32,%2\n\t"					\
+		   "mulx %2,%3,%4\n\t"					\
+		   "sllx %4,32,%5\n\t"					\
+		   "srl %6,0,%3\n\t"					\
+		   "sub %1,%5,%5\n\t"					\
+		   "srlx %5,32,%5\n\t"					\
+		   "addcc %4,%5,%4\n\t"					\
+		   "srlx %7,32,%5\n\t"					\
+		   "mulx %3,%5,%3\n\t"					\
+		   "mulx %2,%5,%5\n\t"					\
+		   "sethi %%hi(0x80000000),%2\n\t"			\
+		   "addcc %4,%3,%4\n\t"					\
+		   "srlx %4,32,%4\n\t"					\
+		   "add %2,%2,%2\n\t"					\
+		   "movcc %%xcc,%%g0,%2\n\t"				\
+		   "addcc %5,%4,%5\n\t"					\
+		   "sllx %3,32,%3\n\t"					\
+		   "add %1,%3,%1\n\t"					\
+		   "add %5,%2,%0"					\
+	   : "=r" ((UDItype)(wh)),					\
+	     "=&r" ((UDItype)(wl)),					\
+	     "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4)	\
+	   : "r" ((UDItype)(u)),					\
+	     "r" ((UDItype)(v))						\
+	   __CLOBBER_CC);						\
+  } while (0)
+#define UMUL_TIME 96
+#define UDIV_TIME 230
+#endif /* sparc64 */
+
+#if defined (__vax__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("addl2 %5,%1\n\tadwc %3,%0"					\
+	   : "=g" ((USItype) (sh)),					\
+	     "=&g" ((USItype) (sl))					\
+	   : "%0" ((USItype) (ah)),					\
+	     "g" ((USItype) (bh)),					\
+	     "%1" ((USItype) (al)),					\
+	     "g" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("subl2 %5,%1\n\tsbwc %3,%0"					\
+	   : "=g" ((USItype) (sh)),					\
+	     "=&g" ((USItype) (sl))					\
+	   : "0" ((USItype) (ah)),					\
+	     "g" ((USItype) (bh)),					\
+	     "1" ((USItype) (al)),					\
+	     "g" ((USItype) (bl)))
+#define umul_ppmm(xh, xl, m0, m1) \
+  do {									\
+    union {								\
+	UDItype __ll;							\
+	struct {USItype __l, __h;} __i;					\
+      } __xx;								\
+    USItype __m0 = (m0), __m1 = (m1);					\
+    __asm__ ("emul %1,%2,$0,%0"						\
+	     : "=r" (__xx.__ll)						\
+	     : "g" (__m0),						\
+	       "g" (__m1));						\
+    (xh) = __xx.__i.__h;						\
+    (xl) = __xx.__i.__l;						\
+    (xh) += ((((SItype) __m0 >> 31) & __m1)				\
+	     + (((SItype) __m1 >> 31) & __m0));				\
+  } while (0)
+#define sdiv_qrnnd(q, r, n1, n0, d) \
+  do {									\
+    union {DItype __ll;							\
+	   struct {SItype __l, __h;} __i;				\
+	  } __xx;							\
+    __xx.__i.__h = n1; __xx.__i.__l = n0;				\
+    __asm__ ("ediv %3,%2,%0,%1"						\
+	     : "=g" (q), "=g" (r)					\
+	     : "g" (__xx.__ll), "g" (d));				\
+  } while (0)
+#endif /* __vax__ */
+
+#if defined (__xtensa__) && W_TYPE_SIZE == 32
+/* This code is not Xtensa-configuration-specific, so rely on the compiler
+   to expand builtin functions depending on what configuration features
+   are available.  This avoids library calls when the operation can be
+   performed in-line.  */
+#define umul_ppmm(w1, w0, u, v)						\
+  do {									\
+    DWunion __w;							\
+    __w.ll = __builtin_umulsidi3 (u, v);				\
+    w1 = __w.s.high;							\
+    w0 = __w.s.low;							\
+  } while (0)
+#define __umulsidi3(u, v)		__builtin_umulsidi3 (u, v)
+#define count_leading_zeros(COUNT, X)	((COUNT) = __builtin_clz (X))
+#define count_trailing_zeros(COUNT, X)	((COUNT) = __builtin_ctz (X))
+#endif /* __xtensa__ */
+
+#if defined (__z8000__) && W_TYPE_SIZE == 16
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("add	%H1,%H5\n\tadc	%H0,%H3"				\
+	   : "=r" ((unsigned int)(sh)),					\
+	     "=&r" ((unsigned int)(sl))					\
+	   : "%0" ((unsigned int)(ah)),					\
+	     "r" ((unsigned int)(bh)),					\
+	     "%1" ((unsigned int)(al)),					\
+	     "rQR" ((unsigned int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("sub	%H1,%H5\n\tsbc	%H0,%H3"				\
+	   : "=r" ((unsigned int)(sh)),					\
+	     "=&r" ((unsigned int)(sl))					\
+	   : "0" ((unsigned int)(ah)),					\
+	     "r" ((unsigned int)(bh)),					\
+	     "1" ((unsigned int)(al)),					\
+	     "rQR" ((unsigned int)(bl)))
+#define umul_ppmm(xh, xl, m0, m1) \
+  do {									\
+    union {long int __ll;						\
+	   struct {unsigned int __h, __l;} __i;				\
+	  } __xx;							\
+    unsigned int __m0 = (m0), __m1 = (m1);				\
+    __asm__ ("mult	%S0,%H3"					\
+	     : "=r" (__xx.__i.__h),					\
+	       "=r" (__xx.__i.__l)					\
+	     : "%1" (__m0),						\
+	       "rQR" (__m1));						\
+    (xh) = __xx.__i.__h; (xl) = __xx.__i.__l;				\
+    (xh) += ((((signed int) __m0 >> 15) & __m1)				\
+	     + (((signed int) __m1 >> 15) & __m0));			\
+  } while (0)
+#endif /* __z8000__ */
+
+#endif /* __GNUC__ */
+
+/* If this machine has no inline assembler, use C macros.  */
+
+#if !defined (add_ssaaaa)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  do {									\
+    UWtype __x;								\
+    __x = (al) + (bl);							\
+    (sh) = (ah) + (bh) + (__x < (al));					\
+    (sl) = __x;								\
+  } while (0)
+#endif
+
+#if !defined (sub_ddmmss)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  do {									\
+    UWtype __x;								\
+    __x = (al) - (bl);							\
+    (sh) = (ah) - (bh) - (__x > (al));					\
+    (sl) = __x;								\
+  } while (0)
+#endif
+
+/* If we lack umul_ppmm but have smul_ppmm, define umul_ppmm in terms of
+   smul_ppmm.  */
+#if !defined (umul_ppmm) && defined (smul_ppmm)
+#define umul_ppmm(w1, w0, u, v)						\
+  do {									\
+    UWtype __w1;							\
+    UWtype __xm0 = (u), __xm1 = (v);					\
+    smul_ppmm (__w1, w0, __xm0, __xm1);					\
+    (w1) = __w1 + (-(__xm0 >> (W_TYPE_SIZE - 1)) & __xm1)		\
+		+ (-(__xm1 >> (W_TYPE_SIZE - 1)) & __xm0);		\
+  } while (0)
+#endif
+
+/* If we still don't have umul_ppmm, define it using plain C.  */
+#if !defined (umul_ppmm)
+#define umul_ppmm(w1, w0, u, v)						\
+  do {									\
+    UWtype __x0, __x1, __x2, __x3;					\
+    UHWtype __ul, __vl, __uh, __vh;					\
+									\
+    __ul = __ll_lowpart (u);						\
+    __uh = __ll_highpart (u);						\
+    __vl = __ll_lowpart (v);						\
+    __vh = __ll_highpart (v);						\
+									\
+    __x0 = (UWtype) __ul * __vl;					\
+    __x1 = (UWtype) __ul * __vh;					\
+    __x2 = (UWtype) __uh * __vl;					\
+    __x3 = (UWtype) __uh * __vh;					\
+									\
+    __x1 += __ll_highpart (__x0);/* this can't give carry */		\
+    __x1 += __x2;		/* but this indeed can */		\
+    if (__x1 < __x2)		/* did we get it? */			\
+      __x3 += __ll_B;		/* yes, add it in the proper pos.  */	\
+									\
+    (w1) = __x3 + __ll_highpart (__x1);					\
+    (w0) = __ll_lowpart (__x1) * __ll_B + __ll_lowpart (__x0);		\
+  } while (0)
+#endif
+
+#if !defined (__umulsidi3)
+#define __umulsidi3(u, v) \
+  ({DWunion __w;							\
+    umul_ppmm (__w.s.high, __w.s.low, u, v);				\
+    __w.ll; })
+#endif
+
+/* Define this unconditionally, so it can be used for debugging.  */
+#define __udiv_qrnnd_c(q, r, n1, n0, d) \
+  do {									\
+    UWtype __d1, __d0, __q1, __q0;					\
+    UWtype __r1, __r0, __m;						\
+    __d1 = __ll_highpart (d);						\
+    __d0 = __ll_lowpart (d);						\
+									\
+    __r1 = (n1) % __d1;							\
+    __q1 = (n1) / __d1;							\
+    __m = (UWtype) __q1 * __d0;						\
+    __r1 = __r1 * __ll_B | __ll_highpart (n0);				\
+    if (__r1 < __m)							\
+      {									\
+	__q1--, __r1 += (d);						\
+	if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\
+	  if (__r1 < __m)						\
+	    __q1--, __r1 += (d);					\
+      }									\
+    __r1 -= __m;							\
+									\
+    __r0 = __r1 % __d1;							\
+    __q0 = __r1 / __d1;							\
+    __m = (UWtype) __q0 * __d0;						\
+    __r0 = __r0 * __ll_B | __ll_lowpart (n0);				\
+    if (__r0 < __m)							\
+      {									\
+	__q0--, __r0 += (d);						\
+	if (__r0 >= (d))						\
+	  if (__r0 < __m)						\
+	    __q0--, __r0 += (d);					\
+      }									\
+    __r0 -= __m;							\
+									\
+    (q) = (UWtype) __q1 * __ll_B | __q0;				\
+    (r) = __r0;								\
+  } while (0)
+
+/* If the processor has no udiv_qrnnd but sdiv_qrnnd, go through
+   __udiv_w_sdiv (defined in libgcc or elsewhere).  */
+#if !defined (udiv_qrnnd) && defined (sdiv_qrnnd)
+#define udiv_qrnnd(q, r, nh, nl, d) \
+  do {									\
+    USItype __r;							\
+    (q) = __udiv_w_sdiv (&__r, nh, nl, d);				\
+    (r) = __r;								\
+  } while (0)
+#endif
+
+/* If udiv_qrnnd was not defined for this processor, use __udiv_qrnnd_c.  */
+#if !defined (udiv_qrnnd)
+#define UDIV_NEEDS_NORMALIZATION 1
+#define udiv_qrnnd __udiv_qrnnd_c
+#endif
+
+#if !defined (count_leading_zeros)
+#define count_leading_zeros(count, x) \
+  do {									\
+    UWtype __xr = (x);							\
+    UWtype __a;								\
+									\
+    if (W_TYPE_SIZE <= 32)						\
+      {									\
+	__a = __xr < ((UWtype)1<<2*__BITS4)				\
+	  ? (__xr < ((UWtype)1<<__BITS4) ? 0 : __BITS4)			\
+	  : (__xr < ((UWtype)1<<3*__BITS4) ?  2*__BITS4 : 3*__BITS4);	\
+      }									\
+    else								\
+      {									\
+	for (__a = W_TYPE_SIZE - 8; __a > 0; __a -= 8)			\
+	  if (((__xr >> __a) & 0xff) != 0)				\
+	    break;							\
+      }									\
+									\
+    (count) = W_TYPE_SIZE - (__clz_tab[__xr >> __a] + __a);		\
+  } while (0)
+#define COUNT_LEADING_ZEROS_0 W_TYPE_SIZE
+#endif
+
+#if !defined (count_trailing_zeros)
+/* Define count_trailing_zeros using count_leading_zeros.  The latter might be
+   defined in asm, but if it is not, the C version above is good enough.  */
+#define count_trailing_zeros(count, x) \
+  do {									\
+    UWtype __ctz_x = (x);						\
+    UWtype __ctz_c;							\
+    count_leading_zeros (__ctz_c, __ctz_x & -__ctz_x);			\
+    (count) = W_TYPE_SIZE - 1 - __ctz_c;				\
+  } while (0)
+#endif
+
+#ifndef UDIV_NEEDS_NORMALIZATION
+#define UDIV_NEEDS_NORMALIZATION 0
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/mp_clz_tab.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/mp_clz_tab.c
new file mode 100644
index 0000000..2220299
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/mp_clz_tab.c
@@ -0,0 +1,37 @@
+/* __clz_tab -- support for longlong.h
+   Copyright (C) 1991, 1993, 1994, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.  Its master source is NOT part of
+   the C library, however.  The master source lives in the GNU MP 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 0
+#include <gmp.h>
+#include "gmp-impl.h"
+#endif
+
+const
+unsigned char __clz_tab[] =
+{
+  0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+  6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-1.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-1.h
new file mode 100644
index 0000000..35cd0ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-1.h
@@ -0,0 +1,302 @@
+/* Software floating-point emulation.
+   Basic one-word fraction declaration and manipulation.
+   Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com),
+		  Jakub Jelinek (jj@ultra.linux.cz),
+		  David S. Miller (davem@redhat.com) and
+		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
+
+   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 into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser 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.)
+
+   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, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#define _FP_FRAC_DECL_1(X)	_FP_W_TYPE X##_f
+#define _FP_FRAC_COPY_1(D,S)	(D##_f = S##_f)
+#define _FP_FRAC_SET_1(X,I)	(X##_f = I)
+#define _FP_FRAC_HIGH_1(X)	(X##_f)
+#define _FP_FRAC_LOW_1(X)	(X##_f)
+#define _FP_FRAC_WORD_1(X,w)	(X##_f)
+
+#define _FP_FRAC_ADDI_1(X,I)	(X##_f += I)
+#define _FP_FRAC_SLL_1(X,N)			\
+  do {						\
+    if (__builtin_constant_p(N) && (N) == 1)	\
+      X##_f += X##_f;				\
+    else					\
+      X##_f <<= (N);				\
+  } while (0)
+#define _FP_FRAC_SRL_1(X,N)	(X##_f >>= N)
+
+/* Right shift with sticky-lsb.  */
+#define _FP_FRAC_SRST_1(X,S,N,sz)	__FP_FRAC_SRST_1(X##_f, S, N, sz)
+#define _FP_FRAC_SRS_1(X,N,sz)	__FP_FRAC_SRS_1(X##_f, N, sz)
+
+#define __FP_FRAC_SRST_1(X,S,N,sz)			\
+do {							\
+  S = (__builtin_constant_p(N) && (N) == 1		\
+       ? X & 1 : (X << (_FP_W_TYPE_SIZE - (N))) != 0);	\
+  X = X >> (N);						\
+} while (0)
+
+#define __FP_FRAC_SRS_1(X,N,sz)						\
+   (X = (X >> (N) | (__builtin_constant_p(N) && (N) == 1		\
+		     ? X & 1 : (X << (_FP_W_TYPE_SIZE - (N))) != 0)))
+
+#define _FP_FRAC_ADD_1(R,X,Y)	(R##_f = X##_f + Y##_f)
+#define _FP_FRAC_SUB_1(R,X,Y)	(R##_f = X##_f - Y##_f)
+#define _FP_FRAC_DEC_1(X,Y)	(X##_f -= Y##_f)
+#define _FP_FRAC_CLZ_1(z, X)	__FP_CLZ(z, X##_f)
+
+/* Predicates */
+#define _FP_FRAC_NEGP_1(X)	((_FP_WS_TYPE)X##_f < 0)
+#define _FP_FRAC_ZEROP_1(X)	(X##_f == 0)
+#define _FP_FRAC_OVERP_1(fs,X)	(X##_f & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_1(fs,X)	(X##_f &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_EQ_1(X, Y)	(X##_f == Y##_f)
+#define _FP_FRAC_GE_1(X, Y)	(X##_f >= Y##_f)
+#define _FP_FRAC_GT_1(X, Y)	(X##_f > Y##_f)
+
+#define _FP_ZEROFRAC_1		0
+#define _FP_MINFRAC_1		1
+#define _FP_MAXFRAC_1		(~(_FP_WS_TYPE)0)
+
+/*
+ * Unpack the raw bits of a native fp value.  Do not classify or
+ * normalize the data.
+ */
+
+#define _FP_UNPACK_RAW_1(fs, X, val)				\
+  do {								\
+    union _FP_UNION_##fs _flo; _flo.flt = (val);		\
+								\
+    X##_f = _flo.bits.frac;					\
+    X##_e = _flo.bits.exp;					\
+    X##_s = _flo.bits.sign;					\
+  } while (0)
+
+#define _FP_UNPACK_RAW_1_P(fs, X, val)				\
+  do {								\
+    union _FP_UNION_##fs *_flo =				\
+      (union _FP_UNION_##fs *)(val);				\
+								\
+    X##_f = _flo->bits.frac;					\
+    X##_e = _flo->bits.exp;					\
+    X##_s = _flo->bits.sign;					\
+  } while (0)
+
+/*
+ * Repack the raw bits of a native fp value.
+ */
+
+#define _FP_PACK_RAW_1(fs, val, X)				\
+  do {								\
+    union _FP_UNION_##fs _flo;					\
+								\
+    _flo.bits.frac = X##_f;					\
+    _flo.bits.exp  = X##_e;					\
+    _flo.bits.sign = X##_s;					\
+								\
+    (val) = _flo.flt;						\
+  } while (0)
+
+#define _FP_PACK_RAW_1_P(fs, val, X)				\
+  do {								\
+    union _FP_UNION_##fs *_flo =				\
+      (union _FP_UNION_##fs *)(val);				\
+								\
+    _flo->bits.frac = X##_f;					\
+    _flo->bits.exp  = X##_e;					\
+    _flo->bits.sign = X##_s;					\
+  } while (0)
+
+
+/*
+ * Multiplication algorithms:
+ */
+
+/* Basic.  Assuming the host word size is >= 2*FRACBITS, we can do the
+   multiplication immediately.  */
+
+#define _FP_MUL_MEAT_1_imm(wfracbits, R, X, Y)				\
+  do {									\
+    R##_f = X##_f * Y##_f;						\
+    /* Normalize since we know where the msb of the multiplicands	\
+       were (bit B), we know that the msb of the of the product is	\
+       at either 2B or 2B-1.  */					\
+    _FP_FRAC_SRS_1(R, wfracbits-1, 2*wfracbits);			\
+  } while (0)
+
+/* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
+
+#define _FP_MUL_MEAT_1_wide(wfracbits, R, X, Y, doit)			\
+  do {									\
+    _FP_W_TYPE _Z_f0, _Z_f1;						\
+    doit(_Z_f1, _Z_f0, X##_f, Y##_f);					\
+    /* Normalize since we know where the msb of the multiplicands	\
+       were (bit B), we know that the msb of the of the product is	\
+       at either 2B or 2B-1.  */					\
+    _FP_FRAC_SRS_2(_Z, wfracbits-1, 2*wfracbits);			\
+    R##_f = _Z_f0;							\
+  } while (0)
+
+/* Finally, a simple widening multiply algorithm.  What fun!  */
+
+#define _FP_MUL_MEAT_1_hard(wfracbits, R, X, Y)				\
+  do {									\
+    _FP_W_TYPE _xh, _xl, _yh, _yl, _z_f0, _z_f1, _a_f0, _a_f1;		\
+									\
+    /* split the words in half */					\
+    _xh = X##_f >> (_FP_W_TYPE_SIZE/2);					\
+    _xl = X##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1);		\
+    _yh = Y##_f >> (_FP_W_TYPE_SIZE/2);					\
+    _yl = Y##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1);		\
+									\
+    /* multiply the pieces */						\
+    _z_f0 = _xl * _yl;							\
+    _a_f0 = _xh * _yl;							\
+    _a_f1 = _xl * _yh;							\
+    _z_f1 = _xh * _yh;							\
+									\
+    /* reassemble into two full words */				\
+    if ((_a_f0 += _a_f1) < _a_f1)					\
+      _z_f1 += (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2);			\
+    _a_f1 = _a_f0 >> (_FP_W_TYPE_SIZE/2);				\
+    _a_f0 = _a_f0 << (_FP_W_TYPE_SIZE/2);				\
+    _FP_FRAC_ADD_2(_z, _z, _a);						\
+									\
+    /* normalize */							\
+    _FP_FRAC_SRS_2(_z, wfracbits - 1, 2*wfracbits);			\
+    R##_f = _z_f0;							\
+  } while (0)
+
+
+/*
+ * Division algorithms:
+ */
+
+/* Basic.  Assuming the host word size is >= 2*FRACBITS, we can do the
+   division immediately.  Give this macro either _FP_DIV_HELP_imm for
+   C primitives or _FP_DIV_HELP_ldiv for the ISO function.  Which you
+   choose will depend on what the compiler does with divrem4.  */
+
+#define _FP_DIV_MEAT_1_imm(fs, R, X, Y, doit)		\
+  do {							\
+    _FP_W_TYPE _q, _r;					\
+    X##_f <<= (X##_f < Y##_f				\
+	       ? R##_e--, _FP_WFRACBITS_##fs		\
+	       : _FP_WFRACBITS_##fs - 1);		\
+    doit(_q, _r, X##_f, Y##_f);				\
+    R##_f = _q | (_r != 0);				\
+  } while (0)
+
+/* GCC's longlong.h defines a 2W / 1W => (1W,1W) primitive udiv_qrnnd
+   that may be useful in this situation.  This first is for a primitive
+   that requires normalization, the second for one that does not.  Look
+   for UDIV_NEEDS_NORMALIZATION to tell which your machine needs.  */
+
+#define _FP_DIV_MEAT_1_udiv_norm(fs, R, X, Y)				\
+  do {									\
+    _FP_W_TYPE _nh, _nl, _q, _r, _y;					\
+									\
+    /* Normalize Y -- i.e. make the most significant bit set.  */	\
+    _y = Y##_f << _FP_WFRACXBITS_##fs;					\
+									\
+    /* Shift X op correspondingly high, that is, up one full word.  */	\
+    if (X##_f < Y##_f)							\
+      {									\
+	R##_e--;							\
+	_nl = 0;							\
+	_nh = X##_f;							\
+      }									\
+    else								\
+      {									\
+	_nl = X##_f << (_FP_W_TYPE_SIZE - 1);				\
+	_nh = X##_f >> 1;						\
+      }									\
+    									\
+    udiv_qrnnd(_q, _r, _nh, _nl, _y);					\
+    R##_f = _q | (_r != 0);						\
+  } while (0)
+
+#define _FP_DIV_MEAT_1_udiv(fs, R, X, Y)		\
+  do {							\
+    _FP_W_TYPE _nh, _nl, _q, _r;			\
+    if (X##_f < Y##_f)					\
+      {							\
+	R##_e--;					\
+	_nl = X##_f << _FP_WFRACBITS_##fs;		\
+	_nh = X##_f >> _FP_WFRACXBITS_##fs;		\
+      }							\
+    else						\
+      {							\
+	_nl = X##_f << (_FP_WFRACBITS_##fs - 1);	\
+	_nh = X##_f >> (_FP_WFRACXBITS_##fs + 1);	\
+      }							\
+    udiv_qrnnd(_q, _r, _nh, _nl, Y##_f);		\
+    R##_f = _q | (_r != 0);				\
+  } while (0)
+  
+  
+/*
+ * Square root algorithms:
+ * We have just one right now, maybe Newton approximation
+ * should be added for those machines where division is fast.
+ */
+ 
+#define _FP_SQRT_MEAT_1(R, S, T, X, q)			\
+  do {							\
+    while (q != _FP_WORK_ROUND)				\
+      {							\
+        T##_f = S##_f + q;				\
+        if (T##_f <= X##_f)				\
+          {						\
+            S##_f = T##_f + q;				\
+            X##_f -= T##_f;				\
+            R##_f += q;					\
+          }						\
+        _FP_FRAC_SLL_1(X, 1);				\
+        q >>= 1;					\
+      }							\
+    if (X##_f)						\
+      {							\
+	if (S##_f < X##_f)				\
+	  R##_f |= _FP_WORK_ROUND;			\
+	R##_f |= _FP_WORK_STICKY;			\
+      }							\
+  } while (0)
+
+/*
+ * Assembly/disassembly for converting to/from integral types.  
+ * No shifting or overflow handled here.
+ */
+
+#define _FP_FRAC_ASSEMBLE_1(r, X, rsize)	(r = X##_f)
+#define _FP_FRAC_DISASSEMBLE_1(X, r, rsize)	(X##_f = r)
+
+
+/*
+ * Convert FP values between word sizes
+ */
+
+#define _FP_FRAC_COPY_1_1(D, S)		(D##_f = S##_f)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-2.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-2.h
new file mode 100644
index 0000000..3a3b3aa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-2.h
@@ -0,0 +1,617 @@
+/* Software floating-point emulation.
+   Basic two-word fraction declaration and manipulation.
+   Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com),
+		  Jakub Jelinek (jj@ultra.linux.cz),
+		  David S. Miller (davem@redhat.com) and
+		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
+
+   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 into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser 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.)
+
+   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, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#define _FP_FRAC_DECL_2(X)	_FP_W_TYPE X##_f0, X##_f1
+#define _FP_FRAC_COPY_2(D,S)	(D##_f0 = S##_f0, D##_f1 = S##_f1)
+#define _FP_FRAC_SET_2(X,I)	__FP_FRAC_SET_2(X, I)
+#define _FP_FRAC_HIGH_2(X)	(X##_f1)
+#define _FP_FRAC_LOW_2(X)	(X##_f0)
+#define _FP_FRAC_WORD_2(X,w)	(X##_f##w)
+
+#define _FP_FRAC_SLL_2(X,N)						    \
+(void)(((N) < _FP_W_TYPE_SIZE)						    \
+       ? ({								    \
+	    if (__builtin_constant_p(N) && (N) == 1)			    \
+	      {								    \
+		X##_f1 = X##_f1 + X##_f1 + (((_FP_WS_TYPE)(X##_f0)) < 0);   \
+		X##_f0 += X##_f0;					    \
+	      }								    \
+	    else							    \
+	      {								    \
+		X##_f1 = X##_f1 << (N) | X##_f0 >> (_FP_W_TYPE_SIZE - (N)); \
+		X##_f0 <<= (N);						    \
+	      }								    \
+	    0;								    \
+	  })								    \
+       : ({								    \
+	    X##_f1 = X##_f0 << ((N) - _FP_W_TYPE_SIZE);			    \
+	    X##_f0 = 0;							    \
+	  }))
+
+
+#define _FP_FRAC_SRL_2(X,N)						\
+(void)(((N) < _FP_W_TYPE_SIZE)						\
+       ? ({								\
+	    X##_f0 = X##_f0 >> (N) | X##_f1 << (_FP_W_TYPE_SIZE - (N));	\
+	    X##_f1 >>= (N);						\
+	  })								\
+       : ({								\
+	    X##_f0 = X##_f1 >> ((N) - _FP_W_TYPE_SIZE);			\
+	    X##_f1 = 0;							\
+	  }))
+
+/* Right shift with sticky-lsb.  */
+#define _FP_FRAC_SRST_2(X,S, N,sz)					  \
+(void)(((N) < _FP_W_TYPE_SIZE)						  \
+       ? ({								  \
+	    S = (__builtin_constant_p(N) && (N) == 1			  \
+		 ? X##_f0 & 1						  \
+		 : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0);		  \
+	    X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N)); \
+	    X##_f1 >>= (N);						  \
+	  })								  \
+       : ({								  \
+	    S = ((((N) == _FP_W_TYPE_SIZE				  \
+		   ? 0							  \
+		   : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N))))		  \
+		  | X##_f0) != 0);					  \
+	    X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE));		  \
+	    X##_f1 = 0;							  \
+	  }))
+
+#define _FP_FRAC_SRS_2(X,N,sz)						  \
+(void)(((N) < _FP_W_TYPE_SIZE)						  \
+       ? ({								  \
+	    X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) | \
+		      (__builtin_constant_p(N) && (N) == 1		  \
+		       ? X##_f0 & 1					  \
+		       : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0));	  \
+	    X##_f1 >>= (N);						  \
+	  })								  \
+       : ({								  \
+	    X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE) |		  \
+		      ((((N) == _FP_W_TYPE_SIZE				  \
+			 ? 0						  \
+			 : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N))))	  \
+			| X##_f0) != 0));				  \
+	    X##_f1 = 0;							  \
+	  }))
+
+#define _FP_FRAC_ADDI_2(X,I)	\
+  __FP_FRAC_ADDI_2(X##_f1, X##_f0, I)
+
+#define _FP_FRAC_ADD_2(R,X,Y)	\
+  __FP_FRAC_ADD_2(R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_SUB_2(R,X,Y)	\
+  __FP_FRAC_SUB_2(R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_DEC_2(X,Y)	\
+  __FP_FRAC_DEC_2(X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_CLZ_2(R,X)	\
+  do {				\
+    if (X##_f1)			\
+      __FP_CLZ(R,X##_f1);	\
+    else 			\
+    {				\
+      __FP_CLZ(R,X##_f0);	\
+      R += _FP_W_TYPE_SIZE;	\
+    }				\
+  } while(0)
+
+/* Predicates */
+#define _FP_FRAC_NEGP_2(X)	((_FP_WS_TYPE)X##_f1 < 0)
+#define _FP_FRAC_ZEROP_2(X)	((X##_f1 | X##_f0) == 0)
+#define _FP_FRAC_OVERP_2(fs,X)	(_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_2(fs,X)	(_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_EQ_2(X, Y)	(X##_f1 == Y##_f1 && X##_f0 == Y##_f0)
+#define _FP_FRAC_GT_2(X, Y)	\
+  (X##_f1 > Y##_f1 || (X##_f1 == Y##_f1 && X##_f0 > Y##_f0))
+#define _FP_FRAC_GE_2(X, Y)	\
+  (X##_f1 > Y##_f1 || (X##_f1 == Y##_f1 && X##_f0 >= Y##_f0))
+
+#define _FP_ZEROFRAC_2		0, 0
+#define _FP_MINFRAC_2		0, 1
+#define _FP_MAXFRAC_2		(~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0)
+
+/*
+ * Internals 
+ */
+
+#define __FP_FRAC_SET_2(X,I1,I0)	(X##_f0 = I0, X##_f1 = I1)
+
+#define __FP_CLZ_2(R, xh, xl)	\
+  do {				\
+    if (xh)			\
+      __FP_CLZ(R,xh);		\
+    else 			\
+    {				\
+      __FP_CLZ(R,xl);		\
+      R += _FP_W_TYPE_SIZE;	\
+    }				\
+  } while(0)
+
+#if 0
+
+#ifndef __FP_FRAC_ADDI_2
+#define __FP_FRAC_ADDI_2(xh, xl, i)	\
+  (xh += ((xl += i) < i))
+#endif
+#ifndef __FP_FRAC_ADD_2
+#define __FP_FRAC_ADD_2(rh, rl, xh, xl, yh, yl)	\
+  (rh = xh + yh + ((rl = xl + yl) < xl))
+#endif
+#ifndef __FP_FRAC_SUB_2
+#define __FP_FRAC_SUB_2(rh, rl, xh, xl, yh, yl)	\
+  (rh = xh - yh - ((rl = xl - yl) > xl))
+#endif
+#ifndef __FP_FRAC_DEC_2
+#define __FP_FRAC_DEC_2(xh, xl, yh, yl)	\
+  do {					\
+    UWtype _t = xl;			\
+    xh -= yh + ((xl -= yl) > _t);	\
+  } while (0)
+#endif
+
+#else
+
+#undef __FP_FRAC_ADDI_2
+#define __FP_FRAC_ADDI_2(xh, xl, i)	add_ssaaaa(xh, xl, xh, xl, 0, i)
+#undef __FP_FRAC_ADD_2
+#define __FP_FRAC_ADD_2			add_ssaaaa
+#undef __FP_FRAC_SUB_2
+#define __FP_FRAC_SUB_2			sub_ddmmss
+#undef __FP_FRAC_DEC_2
+#define __FP_FRAC_DEC_2(xh, xl, yh, yl)	sub_ddmmss(xh, xl, xh, xl, yh, yl)
+
+#endif
+
+/*
+ * Unpack the raw bits of a native fp value.  Do not classify or
+ * normalize the data.
+ */
+
+#define _FP_UNPACK_RAW_2(fs, X, val)			\
+  do {							\
+    union _FP_UNION_##fs _flo; _flo.flt = (val);	\
+							\
+    X##_f0 = _flo.bits.frac0;				\
+    X##_f1 = _flo.bits.frac1;				\
+    X##_e  = _flo.bits.exp;				\
+    X##_s  = _flo.bits.sign;				\
+  } while (0)
+
+#define _FP_UNPACK_RAW_2_P(fs, X, val)			\
+  do {							\
+    union _FP_UNION_##fs *_flo =			\
+      (union _FP_UNION_##fs *)(val);			\
+							\
+    X##_f0 = _flo->bits.frac0;				\
+    X##_f1 = _flo->bits.frac1;				\
+    X##_e  = _flo->bits.exp;				\
+    X##_s  = _flo->bits.sign;				\
+  } while (0)
+
+
+/*
+ * Repack the raw bits of a native fp value.
+ */
+
+#define _FP_PACK_RAW_2(fs, val, X)			\
+  do {							\
+    union _FP_UNION_##fs _flo;				\
+							\
+    _flo.bits.frac0 = X##_f0;				\
+    _flo.bits.frac1 = X##_f1;				\
+    _flo.bits.exp   = X##_e;				\
+    _flo.bits.sign  = X##_s;				\
+							\
+    (val) = _flo.flt;					\
+  } while (0)
+
+#define _FP_PACK_RAW_2_P(fs, val, X)			\
+  do {							\
+    union _FP_UNION_##fs *_flo =			\
+      (union _FP_UNION_##fs *)(val);			\
+							\
+    _flo->bits.frac0 = X##_f0;				\
+    _flo->bits.frac1 = X##_f1;				\
+    _flo->bits.exp   = X##_e;				\
+    _flo->bits.sign  = X##_s;				\
+  } while (0)
+
+
+/*
+ * Multiplication algorithms:
+ */
+
+/* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
+
+#define _FP_MUL_MEAT_2_wide(wfracbits, R, X, Y, doit)			\
+  do {									\
+    _FP_FRAC_DECL_4(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	\
+									\
+    doit(_FP_FRAC_WORD_4(_z,1), _FP_FRAC_WORD_4(_z,0), X##_f0, Y##_f0);	\
+    doit(_b_f1, _b_f0, X##_f0, Y##_f1);					\
+    doit(_c_f1, _c_f0, X##_f1, Y##_f0);					\
+    doit(_FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2), X##_f1, Y##_f1);	\
+									\
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
+		    _FP_FRAC_WORD_4(_z,1), 0, _b_f1, _b_f0,		\
+		    _FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
+		    _FP_FRAC_WORD_4(_z,1));				\
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
+		    _FP_FRAC_WORD_4(_z,1), 0, _c_f1, _c_f0,		\
+		    _FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
+		    _FP_FRAC_WORD_4(_z,1));				\
+									\
+    /* Normalize since we know where the msb of the multiplicands	\
+       were (bit B), we know that the msb of the of the product is	\
+       at either 2B or 2B-1.  */					\
+    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
+    R##_f0 = _FP_FRAC_WORD_4(_z,0);					\
+    R##_f1 = _FP_FRAC_WORD_4(_z,1);					\
+  } while (0)
+
+/* Given a 1W * 1W => 2W primitive, do the extended multiplication.
+   Do only 3 multiplications instead of four. This one is for machines
+   where multiplication is much more expensive than subtraction.  */
+
+#define _FP_MUL_MEAT_2_wide_3mul(wfracbits, R, X, Y, doit)		\
+  do {									\
+    _FP_FRAC_DECL_4(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	\
+    _FP_W_TYPE _d;							\
+    int _c1, _c2;							\
+									\
+    _b_f0 = X##_f0 + X##_f1;						\
+    _c1 = _b_f0 < X##_f0;						\
+    _b_f1 = Y##_f0 + Y##_f1;						\
+    _c2 = _b_f1 < Y##_f0;						\
+    doit(_d, _FP_FRAC_WORD_4(_z,0), X##_f0, Y##_f0);			\
+    doit(_FP_FRAC_WORD_4(_z,2), _FP_FRAC_WORD_4(_z,1), _b_f0, _b_f1);	\
+    doit(_c_f1, _c_f0, X##_f1, Y##_f1);					\
+									\
+    _b_f0 &= -_c2;							\
+    _b_f1 &= -_c1;							\
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
+		    _FP_FRAC_WORD_4(_z,1), (_c1 & _c2), 0, _d,		\
+		    0, _FP_FRAC_WORD_4(_z,2), _FP_FRAC_WORD_4(_z,1));	\
+    __FP_FRAC_ADDI_2(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
+		     _b_f0);						\
+    __FP_FRAC_ADDI_2(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
+		     _b_f1);						\
+    __FP_FRAC_DEC_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
+		    _FP_FRAC_WORD_4(_z,1),				\
+		    0, _d, _FP_FRAC_WORD_4(_z,0));			\
+    __FP_FRAC_DEC_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
+		    _FP_FRAC_WORD_4(_z,1), 0, _c_f1, _c_f0);		\
+    __FP_FRAC_ADD_2(_FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2),	\
+		    _c_f1, _c_f0,					\
+		    _FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2));	\
+									\
+    /* Normalize since we know where the msb of the multiplicands	\
+       were (bit B), we know that the msb of the of the product is	\
+       at either 2B or 2B-1.  */					\
+    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
+    R##_f0 = _FP_FRAC_WORD_4(_z,0);					\
+    R##_f1 = _FP_FRAC_WORD_4(_z,1);					\
+  } while (0)
+
+#define _FP_MUL_MEAT_2_gmp(wfracbits, R, X, Y)				\
+  do {									\
+    _FP_FRAC_DECL_4(_z);						\
+    _FP_W_TYPE _x[2], _y[2];						\
+    _x[0] = X##_f0; _x[1] = X##_f1;					\
+    _y[0] = Y##_f0; _y[1] = Y##_f1;					\
+									\
+    mpn_mul_n(_z_f, _x, _y, 2);						\
+									\
+    /* Normalize since we know where the msb of the multiplicands	\
+       were (bit B), we know that the msb of the of the product is	\
+       at either 2B or 2B-1.  */					\
+    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
+    R##_f0 = _z_f[0];							\
+    R##_f1 = _z_f[1];							\
+  } while (0)
+
+/* Do at most 120x120=240 bits multiplication using double floating
+   point multiplication.  This is useful if floating point
+   multiplication has much bigger throughput than integer multiply.
+   It is supposed to work for _FP_W_TYPE_SIZE 64 and wfracbits
+   between 106 and 120 only.  
+   Caller guarantees that X and Y has (1LLL << (wfracbits - 1)) set.
+   SETFETZ is a macro which will disable all FPU exceptions and set rounding
+   towards zero,  RESETFE should optionally reset it back.  */
+
+#define _FP_MUL_MEAT_2_120_240_double(wfracbits, R, X, Y, setfetz, resetfe)	\
+  do {										\
+    static const double _const[] = {						\
+      /* 2^-24 */ 5.9604644775390625e-08,					\
+      /* 2^-48 */ 3.5527136788005009e-15,					\
+      /* 2^-72 */ 2.1175823681357508e-22,					\
+      /* 2^-96 */ 1.2621774483536189e-29,					\
+      /* 2^28 */ 2.68435456e+08,						\
+      /* 2^4 */ 1.600000e+01,							\
+      /* 2^-20 */ 9.5367431640625e-07,						\
+      /* 2^-44 */ 5.6843418860808015e-14,					\
+      /* 2^-68 */ 3.3881317890172014e-21,					\
+      /* 2^-92 */ 2.0194839173657902e-28,					\
+      /* 2^-116 */ 1.2037062152420224e-35};					\
+    double _a240, _b240, _c240, _d240, _e240, _f240, 				\
+	   _g240, _h240, _i240, _j240, _k240;					\
+    union { double d; UDItype i; } _l240, _m240, _n240, _o240,			\
+				   _p240, _q240, _r240, _s240;			\
+    UDItype _t240, _u240, _v240, _w240, _x240, _y240 = 0;			\
+										\
+    if (wfracbits < 106 || wfracbits > 120)					\
+      abort();									\
+										\
+    setfetz;									\
+										\
+    _e240 = (double)(long)(X##_f0 & 0xffffff);					\
+    _j240 = (double)(long)(Y##_f0 & 0xffffff);					\
+    _d240 = (double)(long)((X##_f0 >> 24) & 0xffffff);				\
+    _i240 = (double)(long)((Y##_f0 >> 24) & 0xffffff);				\
+    _c240 = (double)(long)(((X##_f1 << 16) & 0xffffff) | (X##_f0 >> 48));	\
+    _h240 = (double)(long)(((Y##_f1 << 16) & 0xffffff) | (Y##_f0 >> 48));	\
+    _b240 = (double)(long)((X##_f1 >> 8) & 0xffffff);				\
+    _g240 = (double)(long)((Y##_f1 >> 8) & 0xffffff);				\
+    _a240 = (double)(long)(X##_f1 >> 32);					\
+    _f240 = (double)(long)(Y##_f1 >> 32);					\
+    _e240 *= _const[3];								\
+    _j240 *= _const[3];								\
+    _d240 *= _const[2];								\
+    _i240 *= _const[2];								\
+    _c240 *= _const[1];								\
+    _h240 *= _const[1];								\
+    _b240 *= _const[0];								\
+    _g240 *= _const[0];								\
+    _s240.d =							      _e240*_j240;\
+    _r240.d =						_d240*_j240 + _e240*_i240;\
+    _q240.d =				  _c240*_j240 + _d240*_i240 + _e240*_h240;\
+    _p240.d =		    _b240*_j240 + _c240*_i240 + _d240*_h240 + _e240*_g240;\
+    _o240.d = _a240*_j240 + _b240*_i240 + _c240*_h240 + _d240*_g240 + _e240*_f240;\
+    _n240.d = _a240*_i240 + _b240*_h240 + _c240*_g240 + _d240*_f240;		\
+    _m240.d = _a240*_h240 + _b240*_g240 + _c240*_f240;				\
+    _l240.d = _a240*_g240 + _b240*_f240;					\
+    _k240 =   _a240*_f240;							\
+    _r240.d += _s240.d;								\
+    _q240.d += _r240.d;								\
+    _p240.d += _q240.d;								\
+    _o240.d += _p240.d;								\
+    _n240.d += _o240.d;								\
+    _m240.d += _n240.d;								\
+    _l240.d += _m240.d;								\
+    _k240 += _l240.d;								\
+    _s240.d -= ((_const[10]+_s240.d)-_const[10]);				\
+    _r240.d -= ((_const[9]+_r240.d)-_const[9]);					\
+    _q240.d -= ((_const[8]+_q240.d)-_const[8]);					\
+    _p240.d -= ((_const[7]+_p240.d)-_const[7]);					\
+    _o240.d += _const[7];							\
+    _n240.d += _const[6];							\
+    _m240.d += _const[5];							\
+    _l240.d += _const[4];							\
+    if (_s240.d != 0.0) _y240 = 1;						\
+    if (_r240.d != 0.0) _y240 = 1;						\
+    if (_q240.d != 0.0) _y240 = 1;						\
+    if (_p240.d != 0.0) _y240 = 1;						\
+    _t240 = (DItype)_k240;							\
+    _u240 = _l240.i;								\
+    _v240 = _m240.i;								\
+    _w240 = _n240.i;								\
+    _x240 = _o240.i;								\
+    R##_f1 = (_t240 << (128 - (wfracbits - 1)))					\
+	     | ((_u240 & 0xffffff) >> ((wfracbits - 1) - 104));			\
+    R##_f0 = ((_u240 & 0xffffff) << (168 - (wfracbits - 1)))			\
+    	     | ((_v240 & 0xffffff) << (144 - (wfracbits - 1)))			\
+    	     | ((_w240 & 0xffffff) << (120 - (wfracbits - 1)))			\
+    	     | ((_x240 & 0xffffff) >> ((wfracbits - 1) - 96))			\
+    	     | _y240;								\
+    resetfe;									\
+  } while (0)
+
+/*
+ * Division algorithms:
+ */
+
+#define _FP_DIV_MEAT_2_udiv(fs, R, X, Y)				\
+  do {									\
+    _FP_W_TYPE _n_f2, _n_f1, _n_f0, _r_f1, _r_f0, _m_f1, _m_f0;		\
+    if (_FP_FRAC_GT_2(X, Y))						\
+      {									\
+	_n_f2 = X##_f1 >> 1;						\
+	_n_f1 = X##_f1 << (_FP_W_TYPE_SIZE - 1) | X##_f0 >> 1;		\
+	_n_f0 = X##_f0 << (_FP_W_TYPE_SIZE - 1);			\
+      }									\
+    else								\
+      {									\
+	R##_e--;							\
+	_n_f2 = X##_f1;							\
+	_n_f1 = X##_f0;							\
+	_n_f0 = 0;							\
+      }									\
+									\
+    /* Normalize, i.e. make the most significant bit of the 		\
+       denominator set. */						\
+    _FP_FRAC_SLL_2(Y, _FP_WFRACXBITS_##fs);				\
+									\
+    udiv_qrnnd(R##_f1, _r_f1, _n_f2, _n_f1, Y##_f1);			\
+    umul_ppmm(_m_f1, _m_f0, R##_f1, Y##_f0);				\
+    _r_f0 = _n_f0;							\
+    if (_FP_FRAC_GT_2(_m, _r))						\
+      {									\
+	R##_f1--;							\
+	_FP_FRAC_ADD_2(_r, Y, _r);					\
+	if (_FP_FRAC_GE_2(_r, Y) && _FP_FRAC_GT_2(_m, _r))		\
+	  {								\
+	    R##_f1--;							\
+	    _FP_FRAC_ADD_2(_r, Y, _r);					\
+	  }								\
+      }									\
+    _FP_FRAC_DEC_2(_r, _m);						\
+									\
+    if (_r_f1 == Y##_f1)						\
+      {									\
+	/* This is a special case, not an optimization			\
+	   (_r/Y##_f1 would not fit into UWtype).			\
+	   As _r is guaranteed to be < Y,  R##_f0 can be either		\
+	   (UWtype)-1 or (UWtype)-2.  But as we know what kind		\
+	   of bits it is (sticky, guard, round),  we don't care.	\
+	   We also don't care what the reminder is,  because the	\
+	   guard bit will be set anyway.  -jj */			\
+	R##_f0 = -1;							\
+      }									\
+    else								\
+      {									\
+	udiv_qrnnd(R##_f0, _r_f1, _r_f1, _r_f0, Y##_f1);		\
+	umul_ppmm(_m_f1, _m_f0, R##_f0, Y##_f0);			\
+	_r_f0 = 0;							\
+	if (_FP_FRAC_GT_2(_m, _r))					\
+	  {								\
+	    R##_f0--;							\
+	    _FP_FRAC_ADD_2(_r, Y, _r);					\
+	    if (_FP_FRAC_GE_2(_r, Y) && _FP_FRAC_GT_2(_m, _r))		\
+	      {								\
+		R##_f0--;						\
+		_FP_FRAC_ADD_2(_r, Y, _r);				\
+	      }								\
+	  }								\
+	if (!_FP_FRAC_EQ_2(_r, _m))					\
+	  R##_f0 |= _FP_WORK_STICKY;					\
+      }									\
+  } while (0)
+
+
+#define _FP_DIV_MEAT_2_gmp(fs, R, X, Y)					\
+  do {									\
+    _FP_W_TYPE _x[4], _y[2], _z[4];					\
+    _y[0] = Y##_f0; _y[1] = Y##_f1;					\
+    _x[0] = _x[3] = 0;							\
+    if (_FP_FRAC_GT_2(X, Y))						\
+      {									\
+	R##_e++;							\
+	_x[1] = (X##_f0 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE) |	\
+		 X##_f1 >> (_FP_W_TYPE_SIZE -				\
+			    (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE)));	\
+	_x[2] = X##_f1 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE);	\
+      }									\
+    else								\
+      {									\
+	_x[1] = (X##_f0 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE) |	\
+		 X##_f1 >> (_FP_W_TYPE_SIZE -				\
+			    (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE)));	\
+	_x[2] = X##_f1 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE);	\
+      }									\
+									\
+    (void) mpn_divrem (_z, 0, _x, 4, _y, 2);				\
+    R##_f1 = _z[1];							\
+    R##_f0 = _z[0] | ((_x[0] | _x[1]) != 0);				\
+  } while (0)
+
+
+/*
+ * Square root algorithms:
+ * We have just one right now, maybe Newton approximation
+ * should be added for those machines where division is fast.
+ */
+ 
+#define _FP_SQRT_MEAT_2(R, S, T, X, q)			\
+  do {							\
+    while (q)						\
+      {							\
+	T##_f1 = S##_f1 + q;				\
+	if (T##_f1 <= X##_f1)				\
+	  {						\
+	    S##_f1 = T##_f1 + q;			\
+	    X##_f1 -= T##_f1;				\
+	    R##_f1 += q;				\
+	  }						\
+	_FP_FRAC_SLL_2(X, 1);				\
+	q >>= 1;					\
+      }							\
+    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);		\
+    while (q != _FP_WORK_ROUND)				\
+      {							\
+	T##_f0 = S##_f0 + q;				\
+	T##_f1 = S##_f1;				\
+	if (T##_f1 < X##_f1 || 				\
+	    (T##_f1 == X##_f1 && T##_f0 <= X##_f0))	\
+	  {						\
+	    S##_f0 = T##_f0 + q;			\
+	    S##_f1 += (T##_f0 > S##_f0);		\
+	    _FP_FRAC_DEC_2(X, T);			\
+	    R##_f0 += q;				\
+	  }						\
+	_FP_FRAC_SLL_2(X, 1);				\
+	q >>= 1;					\
+      }							\
+    if (X##_f0 | X##_f1)				\
+      {							\
+	if (S##_f1 < X##_f1 || 				\
+	    (S##_f1 == X##_f1 && S##_f0 < X##_f0))	\
+	  R##_f0 |= _FP_WORK_ROUND;			\
+	R##_f0 |= _FP_WORK_STICKY;			\
+      }							\
+  } while (0)
+
+
+/*
+ * Assembly/disassembly for converting to/from integral types.  
+ * No shifting or overflow handled here.
+ */
+
+#define _FP_FRAC_ASSEMBLE_2(r, X, rsize)	\
+(void)((rsize <= _FP_W_TYPE_SIZE)		\
+       ? ({ r = X##_f0; })			\
+       : ({					\
+	    r = X##_f1;				\
+	    r <<= _FP_W_TYPE_SIZE;		\
+	    r += X##_f0;			\
+	  }))
+
+#define _FP_FRAC_DISASSEMBLE_2(X, r, rsize)				\
+  do {									\
+    X##_f0 = r;								\
+    X##_f1 = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE);	\
+  } while (0)
+
+/*
+ * Convert FP values between word sizes
+ */
+
+#define _FP_FRAC_COPY_1_2(D, S)		(D##_f = S##_f0)
+
+#define _FP_FRAC_COPY_2_1(D, S)		((D##_f0 = S##_f), (D##_f1 = 0))
+
+#define _FP_FRAC_COPY_2_2(D,S)		_FP_FRAC_COPY_2(D,S)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-4.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-4.h
new file mode 100644
index 0000000..70b9faf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-4.h
@@ -0,0 +1,688 @@
+/* Software floating-point emulation.
+   Basic four-word fraction declaration and manipulation.
+   Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com),
+		  Jakub Jelinek (jj@ultra.linux.cz),
+		  David S. Miller (davem@redhat.com) and
+		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
+
+   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 into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser 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.)
+
+   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, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#define _FP_FRAC_DECL_4(X)	_FP_W_TYPE X##_f[4]
+#define _FP_FRAC_COPY_4(D,S)			\
+  (D##_f[0] = S##_f[0], D##_f[1] = S##_f[1],	\
+   D##_f[2] = S##_f[2], D##_f[3] = S##_f[3])
+#define _FP_FRAC_SET_4(X,I)	__FP_FRAC_SET_4(X, I)
+#define _FP_FRAC_HIGH_4(X)	(X##_f[3])
+#define _FP_FRAC_LOW_4(X)	(X##_f[0])
+#define _FP_FRAC_WORD_4(X,w)	(X##_f[w])
+
+#define _FP_FRAC_SLL_4(X,N)						\
+  do {									\
+    _FP_I_TYPE _up, _down, _skip, _i;					\
+    _skip = (N) / _FP_W_TYPE_SIZE;					\
+    _up = (N) % _FP_W_TYPE_SIZE;					\
+    _down = _FP_W_TYPE_SIZE - _up;					\
+    if (!_up)								\
+      for (_i = 3; _i >= _skip; --_i)					\
+	X##_f[_i] = X##_f[_i-_skip];					\
+    else								\
+      {									\
+	for (_i = 3; _i > _skip; --_i)					\
+	  X##_f[_i] = X##_f[_i-_skip] << _up				\
+		      | X##_f[_i-_skip-1] >> _down;			\
+	X##_f[_i--] = X##_f[0] << _up; 					\
+      }									\
+    for (; _i >= 0; --_i)						\
+      X##_f[_i] = 0;							\
+  } while (0)
+
+/* This one was broken too */
+#define _FP_FRAC_SRL_4(X,N)						\
+  do {									\
+    _FP_I_TYPE _up, _down, _skip, _i;					\
+    _skip = (N) / _FP_W_TYPE_SIZE;					\
+    _down = (N) % _FP_W_TYPE_SIZE;					\
+    _up = _FP_W_TYPE_SIZE - _down;					\
+    if (!_down)								\
+      for (_i = 0; _i <= 3-_skip; ++_i)					\
+	X##_f[_i] = X##_f[_i+_skip];					\
+    else								\
+      {									\
+	for (_i = 0; _i < 3-_skip; ++_i)				\
+	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
+		      | X##_f[_i+_skip+1] << _up;			\
+	X##_f[_i++] = X##_f[3] >> _down;				\
+      }									\
+    for (; _i < 4; ++_i)						\
+      X##_f[_i] = 0;							\
+  } while (0)
+
+
+/* Right shift with sticky-lsb. 
+ * What this actually means is that we do a standard right-shift,
+ * but that if any of the bits that fall off the right hand side
+ * were one then we always set the LSbit.
+ */
+#define _FP_FRAC_SRST_4(X,S,N,size)			\
+  do {							\
+    _FP_I_TYPE _up, _down, _skip, _i;			\
+    _FP_W_TYPE _s;					\
+    _skip = (N) / _FP_W_TYPE_SIZE;			\
+    _down = (N) % _FP_W_TYPE_SIZE;			\
+    _up = _FP_W_TYPE_SIZE - _down;			\
+    for (_s = _i = 0; _i < _skip; ++_i)			\
+      _s |= X##_f[_i];					\
+    if (!_down)						\
+      for (_i = 0; _i <= 3-_skip; ++_i)			\
+	X##_f[_i] = X##_f[_i+_skip];			\
+    else						\
+      {							\
+	_s |= X##_f[_i] << _up;				\
+	for (_i = 0; _i < 3-_skip; ++_i)		\
+	  X##_f[_i] = X##_f[_i+_skip] >> _down		\
+		      | X##_f[_i+_skip+1] << _up;	\
+	X##_f[_i++] = X##_f[3] >> _down;		\
+      }							\
+    for (; _i < 4; ++_i)				\
+      X##_f[_i] = 0;					\
+    S = (_s != 0);					\
+  } while (0)
+
+#define _FP_FRAC_SRS_4(X,N,size)		\
+  do {						\
+    int _sticky;				\
+    _FP_FRAC_SRST_4(X, _sticky, N, size);	\
+    X##_f[0] |= _sticky;			\
+  } while (0)
+
+#define _FP_FRAC_ADD_4(R,X,Y)						\
+  __FP_FRAC_ADD_4(R##_f[3], R##_f[2], R##_f[1], R##_f[0],		\
+		  X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
+		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_SUB_4(R,X,Y)						\
+  __FP_FRAC_SUB_4(R##_f[3], R##_f[2], R##_f[1], R##_f[0],		\
+		  X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
+		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_DEC_4(X,Y)						\
+  __FP_FRAC_DEC_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
+		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_ADDI_4(X,I)						\
+  __FP_FRAC_ADDI_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0], I)
+
+#define _FP_ZEROFRAC_4  0,0,0,0
+#define _FP_MINFRAC_4   0,0,0,1
+#define _FP_MAXFRAC_4	(~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0)
+
+#define _FP_FRAC_ZEROP_4(X)     ((X##_f[0] | X##_f[1] | X##_f[2] | X##_f[3]) == 0)
+#define _FP_FRAC_NEGP_4(X)      ((_FP_WS_TYPE)X##_f[3] < 0)
+#define _FP_FRAC_OVERP_4(fs,X)  (_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_4(fs,X)  (_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs)
+
+#define _FP_FRAC_EQ_4(X,Y)				\
+ (X##_f[0] == Y##_f[0] && X##_f[1] == Y##_f[1]		\
+  && X##_f[2] == Y##_f[2] && X##_f[3] == Y##_f[3])
+
+#define _FP_FRAC_GT_4(X,Y)				\
+ (X##_f[3] > Y##_f[3] ||				\
+  (X##_f[3] == Y##_f[3] && (X##_f[2] > Y##_f[2] ||	\
+   (X##_f[2] == Y##_f[2] && (X##_f[1] > Y##_f[1] ||	\
+    (X##_f[1] == Y##_f[1] && X##_f[0] > Y##_f[0])	\
+   ))							\
+  ))							\
+ )
+
+#define _FP_FRAC_GE_4(X,Y)				\
+ (X##_f[3] > Y##_f[3] ||				\
+  (X##_f[3] == Y##_f[3] && (X##_f[2] > Y##_f[2] ||	\
+   (X##_f[2] == Y##_f[2] && (X##_f[1] > Y##_f[1] ||	\
+    (X##_f[1] == Y##_f[1] && X##_f[0] >= Y##_f[0])	\
+   ))							\
+  ))							\
+ )
+
+
+#define _FP_FRAC_CLZ_4(R,X)		\
+  do {					\
+    if (X##_f[3])			\
+    {					\
+	__FP_CLZ(R,X##_f[3]);		\
+    }					\
+    else if (X##_f[2])			\
+    {					\
+	__FP_CLZ(R,X##_f[2]);		\
+	R += _FP_W_TYPE_SIZE;		\
+    }					\
+    else if (X##_f[1])			\
+    {					\
+	__FP_CLZ(R,X##_f[1]);		\
+	R += _FP_W_TYPE_SIZE*2;		\
+    }					\
+    else				\
+    {					\
+	__FP_CLZ(R,X##_f[0]);		\
+	R += _FP_W_TYPE_SIZE*3;		\
+    }					\
+  } while(0)
+
+
+#define _FP_UNPACK_RAW_4(fs, X, val)				\
+  do {								\
+    union _FP_UNION_##fs _flo; _flo.flt = (val);		\
+    X##_f[0] = _flo.bits.frac0;					\
+    X##_f[1] = _flo.bits.frac1;					\
+    X##_f[2] = _flo.bits.frac2;					\
+    X##_f[3] = _flo.bits.frac3;					\
+    X##_e  = _flo.bits.exp;					\
+    X##_s  = _flo.bits.sign;					\
+  } while (0)
+
+#define _FP_UNPACK_RAW_4_P(fs, X, val)				\
+  do {								\
+    union _FP_UNION_##fs *_flo =				\
+      (union _FP_UNION_##fs *)(val);				\
+								\
+    X##_f[0] = _flo->bits.frac0;				\
+    X##_f[1] = _flo->bits.frac1;				\
+    X##_f[2] = _flo->bits.frac2;				\
+    X##_f[3] = _flo->bits.frac3;				\
+    X##_e  = _flo->bits.exp;					\
+    X##_s  = _flo->bits.sign;					\
+  } while (0)
+
+#define _FP_PACK_RAW_4(fs, val, X)				\
+  do {								\
+    union _FP_UNION_##fs _flo;					\
+    _flo.bits.frac0 = X##_f[0];					\
+    _flo.bits.frac1 = X##_f[1];					\
+    _flo.bits.frac2 = X##_f[2];					\
+    _flo.bits.frac3 = X##_f[3];					\
+    _flo.bits.exp   = X##_e;					\
+    _flo.bits.sign  = X##_s;					\
+    (val) = _flo.flt;				   		\
+  } while (0)
+
+#define _FP_PACK_RAW_4_P(fs, val, X)				\
+  do {								\
+    union _FP_UNION_##fs *_flo =				\
+      (union _FP_UNION_##fs *)(val);				\
+								\
+    _flo->bits.frac0 = X##_f[0];				\
+    _flo->bits.frac1 = X##_f[1];				\
+    _flo->bits.frac2 = X##_f[2];				\
+    _flo->bits.frac3 = X##_f[3];				\
+    _flo->bits.exp   = X##_e;					\
+    _flo->bits.sign  = X##_s;					\
+  } while (0)
+
+/*
+ * Multiplication algorithms:
+ */
+
+/* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
+
+#define _FP_MUL_MEAT_4_wide(wfracbits, R, X, Y, doit)			    \
+  do {									    \
+    _FP_FRAC_DECL_8(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	    \
+    _FP_FRAC_DECL_2(_d); _FP_FRAC_DECL_2(_e); _FP_FRAC_DECL_2(_f);	    \
+									    \
+    doit(_FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0), X##_f[0], Y##_f[0]); \
+    doit(_b_f1, _b_f0, X##_f[0], Y##_f[1]);				    \
+    doit(_c_f1, _c_f0, X##_f[1], Y##_f[0]);				    \
+    doit(_d_f1, _d_f0, X##_f[1], Y##_f[1]);				    \
+    doit(_e_f1, _e_f0, X##_f[0], Y##_f[2]);				    \
+    doit(_f_f1, _f_f0, X##_f[2], Y##_f[0]);				    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
+		    _FP_FRAC_WORD_8(_z,1), 0,_b_f1,_b_f0,		    \
+		    0,0,_FP_FRAC_WORD_8(_z,1));				    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
+		    _FP_FRAC_WORD_8(_z,1), 0,_c_f1,_c_f0,		    \
+		    _FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
+		    _FP_FRAC_WORD_8(_z,1));				    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
+		    _FP_FRAC_WORD_8(_z,2), 0,_d_f1,_d_f0,		    \
+		    0,_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2));	    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
+		    _FP_FRAC_WORD_8(_z,2), 0,_e_f1,_e_f0,		    \
+		    _FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
+		    _FP_FRAC_WORD_8(_z,2));				    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
+		    _FP_FRAC_WORD_8(_z,2), 0,_f_f1,_f_f0,		    \
+		    _FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
+		    _FP_FRAC_WORD_8(_z,2));				    \
+    doit(_b_f1, _b_f0, X##_f[0], Y##_f[3]);				    \
+    doit(_c_f1, _c_f0, X##_f[3], Y##_f[0]);				    \
+    doit(_d_f1, _d_f0, X##_f[1], Y##_f[2]);				    \
+    doit(_e_f1, _e_f0, X##_f[2], Y##_f[1]);				    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
+		    _FP_FRAC_WORD_8(_z,3), 0,_b_f1,_b_f0,		    \
+		    0,_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3));	    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
+		    _FP_FRAC_WORD_8(_z,3), 0,_c_f1,_c_f0,		    \
+		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
+		    _FP_FRAC_WORD_8(_z,3));				    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
+		    _FP_FRAC_WORD_8(_z,3), 0,_d_f1,_d_f0,		    \
+		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
+		    _FP_FRAC_WORD_8(_z,3));				    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
+		    _FP_FRAC_WORD_8(_z,3), 0,_e_f1,_e_f0,		    \
+		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
+		    _FP_FRAC_WORD_8(_z,3));				    \
+    doit(_b_f1, _b_f0, X##_f[2], Y##_f[2]);				    \
+    doit(_c_f1, _c_f0, X##_f[1], Y##_f[3]);				    \
+    doit(_d_f1, _d_f0, X##_f[3], Y##_f[1]);				    \
+    doit(_e_f1, _e_f0, X##_f[2], Y##_f[3]);				    \
+    doit(_f_f1, _f_f0, X##_f[3], Y##_f[2]);				    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
+		    _FP_FRAC_WORD_8(_z,4), 0,_b_f1,_b_f0,		    \
+		    0,_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4));	    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
+		    _FP_FRAC_WORD_8(_z,4), 0,_c_f1,_c_f0,		    \
+		    _FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
+		    _FP_FRAC_WORD_8(_z,4));				    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
+		    _FP_FRAC_WORD_8(_z,4), 0,_d_f1,_d_f0,		    \
+		    _FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
+		    _FP_FRAC_WORD_8(_z,4));				    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
+		    _FP_FRAC_WORD_8(_z,5), 0,_e_f1,_e_f0,		    \
+		    0,_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5));	    \
+    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
+		    _FP_FRAC_WORD_8(_z,5), 0,_f_f1,_f_f0,		    \
+		    _FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
+		    _FP_FRAC_WORD_8(_z,5));				    \
+    doit(_b_f1, _b_f0, X##_f[3], Y##_f[3]);				    \
+    __FP_FRAC_ADD_2(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
+		    _b_f1,_b_f0,					    \
+		    _FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6));	    \
+									    \
+    /* Normalize since we know where the msb of the multiplicands	    \
+       were (bit B), we know that the msb of the of the product is	    \
+       at either 2B or 2B-1.  */					    \
+    _FP_FRAC_SRS_8(_z, wfracbits-1, 2*wfracbits);			    \
+    __FP_FRAC_SET_4(R, _FP_FRAC_WORD_8(_z,3), _FP_FRAC_WORD_8(_z,2),	    \
+		    _FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0));	    \
+  } while (0)
+
+#define _FP_MUL_MEAT_4_gmp(wfracbits, R, X, Y)				    \
+  do {									    \
+    _FP_FRAC_DECL_8(_z);						    \
+									    \
+    mpn_mul_n(_z_f, _x_f, _y_f, 4);					    \
+									    \
+    /* Normalize since we know where the msb of the multiplicands	    \
+       were (bit B), we know that the msb of the of the product is	    \
+       at either 2B or 2B-1.  */					    \
+    _FP_FRAC_SRS_8(_z, wfracbits-1, 2*wfracbits);	 		    \
+    __FP_FRAC_SET_4(R, _FP_FRAC_WORD_8(_z,3), _FP_FRAC_WORD_8(_z,2),	    \
+		    _FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0));	    \
+  } while (0)
+
+/*
+ * Helper utility for _FP_DIV_MEAT_4_udiv:
+ * pppp = m * nnn
+ */
+#define umul_ppppmnnn(p3,p2,p1,p0,m,n2,n1,n0)				    \
+  do {									    \
+    UWtype _t;								    \
+    umul_ppmm(p1,p0,m,n0);						    \
+    umul_ppmm(p2,_t,m,n1);						    \
+    __FP_FRAC_ADDI_2(p2,p1,_t);						    \
+    umul_ppmm(p3,_t,m,n2);						    \
+    __FP_FRAC_ADDI_2(p3,p2,_t);						    \
+  } while (0)
+
+/*
+ * Division algorithms:
+ */
+
+#define _FP_DIV_MEAT_4_udiv(fs, R, X, Y)				    \
+  do {									    \
+    int _i;								    \
+    _FP_FRAC_DECL_4(_n); _FP_FRAC_DECL_4(_m);				    \
+    _FP_FRAC_SET_4(_n, _FP_ZEROFRAC_4);					    \
+    if (_FP_FRAC_GT_4(X, Y))						    \
+      {									    \
+	_n_f[3] = X##_f[0] << (_FP_W_TYPE_SIZE - 1);			    \
+	_FP_FRAC_SRL_4(X, 1);						    \
+      }									    \
+    else								    \
+      R##_e--;								    \
+									    \
+    /* Normalize, i.e. make the most significant bit of the 		    \
+       denominator set. */						    \
+    _FP_FRAC_SLL_4(Y, _FP_WFRACXBITS_##fs);				    \
+									    \
+    for (_i = 3; ; _i--)						    \
+      {									    \
+        if (X##_f[3] == Y##_f[3])					    \
+          {								    \
+            /* This is a special case, not an optimization		    \
+               (X##_f[3]/Y##_f[3] would not fit into UWtype).		    \
+               As X## is guaranteed to be < Y,  R##_f[_i] can be either	    \
+               (UWtype)-1 or (UWtype)-2.  */				    \
+            R##_f[_i] = -1;						    \
+            if (!_i)							    \
+	      break;							    \
+            __FP_FRAC_SUB_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0],	    \
+			    Y##_f[2], Y##_f[1], Y##_f[0], 0,		    \
+			    X##_f[2], X##_f[1], X##_f[0], _n_f[_i]);	    \
+            _FP_FRAC_SUB_4(X, Y, X);					    \
+            if (X##_f[3] > Y##_f[3])					    \
+              {								    \
+                R##_f[_i] = -2;						    \
+                _FP_FRAC_ADD_4(X, Y, X);				    \
+              }								    \
+          }								    \
+        else								    \
+          {								    \
+            udiv_qrnnd(R##_f[_i], X##_f[3], X##_f[3], X##_f[2], Y##_f[3]);  \
+            umul_ppppmnnn(_m_f[3], _m_f[2], _m_f[1], _m_f[0],		    \
+			  R##_f[_i], Y##_f[2], Y##_f[1], Y##_f[0]);	    \
+            X##_f[2] = X##_f[1];					    \
+            X##_f[1] = X##_f[0];					    \
+            X##_f[0] = _n_f[_i];					    \
+            if (_FP_FRAC_GT_4(_m, X))					    \
+              {								    \
+                R##_f[_i]--;						    \
+                _FP_FRAC_ADD_4(X, Y, X);				    \
+                if (_FP_FRAC_GE_4(X, Y) && _FP_FRAC_GT_4(_m, X))	    \
+                  {							    \
+		    R##_f[_i]--;					    \
+		    _FP_FRAC_ADD_4(X, Y, X);				    \
+                  }							    \
+              }								    \
+            _FP_FRAC_DEC_4(X, _m);					    \
+            if (!_i)							    \
+	      {								    \
+		if (!_FP_FRAC_EQ_4(X, _m))				    \
+		  R##_f[0] |= _FP_WORK_STICKY;				    \
+		break;							    \
+	      }								    \
+          }								    \
+      }									    \
+  } while (0)
+
+
+/*
+ * Square root algorithms:
+ * We have just one right now, maybe Newton approximation
+ * should be added for those machines where division is fast.
+ */
+ 
+#define _FP_SQRT_MEAT_4(R, S, T, X, q)				\
+  do {								\
+    while (q)							\
+      {								\
+	T##_f[3] = S##_f[3] + q;				\
+	if (T##_f[3] <= X##_f[3])				\
+	  {							\
+	    S##_f[3] = T##_f[3] + q;				\
+	    X##_f[3] -= T##_f[3];				\
+	    R##_f[3] += q;					\
+	  }							\
+	_FP_FRAC_SLL_4(X, 1);					\
+	q >>= 1;						\
+      }								\
+    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
+    while (q)							\
+      {								\
+	T##_f[2] = S##_f[2] + q;				\
+	T##_f[3] = S##_f[3];					\
+	if (T##_f[3] < X##_f[3] || 				\
+	    (T##_f[3] == X##_f[3] && T##_f[2] <= X##_f[2]))	\
+	  {							\
+	    S##_f[2] = T##_f[2] + q;				\
+	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	    __FP_FRAC_DEC_2(X##_f[3], X##_f[2],			\
+			    T##_f[3], T##_f[2]);		\
+	    R##_f[2] += q;					\
+	  }							\
+	_FP_FRAC_SLL_4(X, 1);					\
+	q >>= 1;						\
+      }								\
+    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
+    while (q)							\
+      {								\
+	T##_f[1] = S##_f[1] + q;				\
+	T##_f[2] = S##_f[2];					\
+	T##_f[3] = S##_f[3];					\
+	if (T##_f[3] < X##_f[3] || 				\
+	    (T##_f[3] == X##_f[3] && (T##_f[2] < X##_f[2] ||	\
+	     (T##_f[2] == X##_f[2] && T##_f[1] <= X##_f[1]))))	\
+	  {							\
+	    S##_f[1] = T##_f[1] + q;				\
+	    S##_f[2] += (T##_f[1] > S##_f[1]);			\
+	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	    __FP_FRAC_DEC_3(X##_f[3], X##_f[2], X##_f[1],	\
+	    		    T##_f[3], T##_f[2], T##_f[1]);	\
+	    R##_f[1] += q;					\
+	  }							\
+	_FP_FRAC_SLL_4(X, 1);					\
+	q >>= 1;						\
+      }								\
+    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
+    while (q != _FP_WORK_ROUND)					\
+      {								\
+	T##_f[0] = S##_f[0] + q;				\
+	T##_f[1] = S##_f[1];					\
+	T##_f[2] = S##_f[2];					\
+	T##_f[3] = S##_f[3];					\
+	if (_FP_FRAC_GE_4(X,T))					\
+	  {							\
+	    S##_f[0] = T##_f[0] + q;				\
+	    S##_f[1] += (T##_f[0] > S##_f[0]);			\
+	    S##_f[2] += (T##_f[1] > S##_f[1]);			\
+	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	    _FP_FRAC_DEC_4(X, T);				\
+	    R##_f[0] += q;					\
+	  }							\
+	_FP_FRAC_SLL_4(X, 1);					\
+	q >>= 1;						\
+      }								\
+    if (!_FP_FRAC_ZEROP_4(X))					\
+      {								\
+	if (_FP_FRAC_GT_4(X,S))					\
+	  R##_f[0] |= _FP_WORK_ROUND;				\
+	R##_f[0] |= _FP_WORK_STICKY;				\
+      }								\
+  } while (0)
+
+
+/*
+ * Internals 
+ */
+
+#define __FP_FRAC_SET_4(X,I3,I2,I1,I0)					\
+  (X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0)
+
+#ifndef __FP_FRAC_ADD_3
+#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0)		\
+  do {								\
+    _FP_W_TYPE _c1, _c2;					\
+    r0 = x0 + y0;						\
+    _c1 = r0 < x0;						\
+    r1 = x1 + y1;						\
+    _c2 = r1 < x1;						\
+    r1 += _c1;							\
+    _c2 |= r1 < _c1;						\
+    r2 = x2 + y2 + _c2;						\
+  } while (0)
+#endif
+
+#ifndef __FP_FRAC_ADD_4
+#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)	\
+  do {								\
+    _FP_W_TYPE _c1, _c2, _c3;					\
+    r0 = x0 + y0;						\
+    _c1 = r0 < x0;						\
+    r1 = x1 + y1;						\
+    _c2 = r1 < x1;						\
+    r1 += _c1;							\
+    _c2 |= r1 < _c1;						\
+    r2 = x2 + y2;						\
+    _c3 = r2 < x2;						\
+    r2 += _c2;							\
+    _c3 |= r2 < _c2;						\
+    r3 = x3 + y3 + _c3;						\
+  } while (0)
+#endif
+
+#ifndef __FP_FRAC_SUB_3
+#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0)		\
+  do {								\
+    _FP_W_TYPE _c1, _c2;					\
+    r0 = x0 - y0;						\
+    _c1 = r0 > x0;						\
+    r1 = x1 - y1;						\
+    _c2 = r1 > x1;						\
+    r1 -= _c1;							\
+    _c2 |= _c1 && (y1 == x1);					\
+    r2 = x2 - y2 - _c2;						\
+  } while (0)
+#endif
+
+#ifndef __FP_FRAC_SUB_4
+#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)	\
+  do {								\
+    _FP_W_TYPE _c1, _c2, _c3;					\
+    r0 = x0 - y0;						\
+    _c1 = r0 > x0;						\
+    r1 = x1 - y1;						\
+    _c2 = r1 > x1;						\
+    r1 -= _c1;							\
+    _c2 |= _c1 && (y1 == x1);					\
+    r2 = x2 - y2;						\
+    _c3 = r2 > x2;						\
+    r2 -= _c2;							\
+    _c3 |= _c2 && (y2 == x2);					\
+    r3 = x3 - y3 - _c3;						\
+  } while (0)
+#endif
+
+#ifndef __FP_FRAC_DEC_3
+#define __FP_FRAC_DEC_3(x2,x1,x0,y2,y1,y0)				\
+  do {									\
+    UWtype _t0, _t1, _t2;						\
+    _t0 = x0, _t1 = x1, _t2 = x2;					\
+    __FP_FRAC_SUB_3 (x2, x1, x0, _t2, _t1, _t0, y2, y1, y0);		\
+  } while (0)
+#endif
+
+#ifndef __FP_FRAC_DEC_4
+#define __FP_FRAC_DEC_4(x3,x2,x1,x0,y3,y2,y1,y0)			\
+  do {									\
+    UWtype _t0, _t1, _t2, _t3;						\
+    _t0 = x0, _t1 = x1, _t2 = x2, _t3 = x3;				\
+    __FP_FRAC_SUB_4 (x3,x2,x1,x0,_t3,_t2,_t1,_t0, y3,y2,y1,y0);		\
+  } while (0)
+#endif
+
+#ifndef __FP_FRAC_ADDI_4
+#define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i)					\
+  do {									\
+    UWtype _t;								\
+    _t = ((x0 += i) < i);						\
+    x1 += _t; _t = (x1 < _t);						\
+    x2 += _t; _t = (x2 < _t);						\
+    x3 += _t;								\
+  } while (0)
+#endif
+
+/* Convert FP values between word sizes. This appears to be more
+ * complicated than I'd have expected it to be, so these might be
+ * wrong... These macros are in any case somewhat bogus because they
+ * use information about what various FRAC_n variables look like 
+ * internally [eg, that 2 word vars are X_f0 and x_f1]. But so do
+ * the ones in op-2.h and op-1.h. 
+ */
+#define _FP_FRAC_COPY_1_4(D, S)		(D##_f = S##_f[0])
+
+#define _FP_FRAC_COPY_2_4(D, S)			\
+do {						\
+  D##_f0 = S##_f[0];				\
+  D##_f1 = S##_f[1];				\
+} while (0)
+
+/* Assembly/disassembly for converting to/from integral types.  
+ * No shifting or overflow handled here.
+ */
+/* Put the FP value X into r, which is an integer of size rsize. */
+#define _FP_FRAC_ASSEMBLE_4(r, X, rsize)				\
+  do {									\
+    if (rsize <= _FP_W_TYPE_SIZE)					\
+      r = X##_f[0];							\
+    else if (rsize <= 2*_FP_W_TYPE_SIZE)				\
+    {									\
+      r = X##_f[1];							\
+      r <<= _FP_W_TYPE_SIZE;						\
+      r += X##_f[0];							\
+    }									\
+    else								\
+    {									\
+      /* I'm feeling lazy so we deal with int == 3words (implausible)*/	\
+      /* and int == 4words as a single case.			 */	\
+      r = X##_f[3];							\
+      r <<= _FP_W_TYPE_SIZE;						\
+      r += X##_f[2];							\
+      r <<= _FP_W_TYPE_SIZE;						\
+      r += X##_f[1];							\
+      r <<= _FP_W_TYPE_SIZE;						\
+      r += X##_f[0];							\
+    }									\
+  } while (0)
+
+/* "No disassemble Number Five!" */
+/* move an integer of size rsize into X's fractional part. We rely on
+ * the _f[] array consisting of words of size _FP_W_TYPE_SIZE to avoid
+ * having to mask the values we store into it.
+ */
+#define _FP_FRAC_DISASSEMBLE_4(X, r, rsize)				\
+  do {									\
+    X##_f[0] = r;							\
+    X##_f[1] = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE);	\
+    X##_f[2] = (rsize <= 2*_FP_W_TYPE_SIZE ? 0 : r >> 2*_FP_W_TYPE_SIZE); \
+    X##_f[3] = (rsize <= 3*_FP_W_TYPE_SIZE ? 0 : r >> 3*_FP_W_TYPE_SIZE); \
+  } while (0);
+
+#define _FP_FRAC_COPY_4_1(D, S)			\
+do {						\
+  D##_f[0] = S##_f;				\
+  D##_f[1] = D##_f[2] = D##_f[3] = 0;		\
+} while (0)
+
+#define _FP_FRAC_COPY_4_2(D, S)			\
+do {						\
+  D##_f[0] = S##_f0;				\
+  D##_f[1] = S##_f1;				\
+  D##_f[2] = D##_f[3] = 0;			\
+} while (0)
+
+#define _FP_FRAC_COPY_4_4(D,S)	_FP_FRAC_COPY_4(D,S)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-8.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-8.h
new file mode 100644
index 0000000..e0612a5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-8.h
@@ -0,0 +1,111 @@
+/* Software floating-point emulation.
+   Basic eight-word fraction declaration and manipulation.
+   Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com),
+		  Jakub Jelinek (jj@ultra.linux.cz) and
+		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
+
+   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 into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser 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.)
+
+   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, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+/* We need just a few things from here for op-4, if we ever need some
+   other macros, they can be added. */
+#define _FP_FRAC_DECL_8(X)	_FP_W_TYPE X##_f[8]
+#define _FP_FRAC_HIGH_8(X)	(X##_f[7])
+#define _FP_FRAC_LOW_8(X)	(X##_f[0])
+#define _FP_FRAC_WORD_8(X,w)	(X##_f[w])
+
+#define _FP_FRAC_SLL_8(X,N)						\
+  do {									\
+    _FP_I_TYPE _up, _down, _skip, _i;					\
+    _skip = (N) / _FP_W_TYPE_SIZE;					\
+    _up = (N) % _FP_W_TYPE_SIZE;					\
+    _down = _FP_W_TYPE_SIZE - _up;					\
+    if (!_up)								\
+      for (_i = 7; _i >= _skip; --_i)					\
+	X##_f[_i] = X##_f[_i-_skip];					\
+    else								\
+      {									\
+	for (_i = 7; _i > _skip; --_i)					\
+	  X##_f[_i] = X##_f[_i-_skip] << _up				\
+		      | X##_f[_i-_skip-1] >> _down;			\
+	X##_f[_i--] = X##_f[0] << _up; 					\
+      }									\
+    for (; _i >= 0; --_i)						\
+      X##_f[_i] = 0;							\
+  } while (0)
+
+#define _FP_FRAC_SRL_8(X,N)						\
+  do {									\
+    _FP_I_TYPE _up, _down, _skip, _i;					\
+    _skip = (N) / _FP_W_TYPE_SIZE;					\
+    _down = (N) % _FP_W_TYPE_SIZE;					\
+    _up = _FP_W_TYPE_SIZE - _down;					\
+    if (!_down)								\
+      for (_i = 0; _i <= 7-_skip; ++_i)					\
+	X##_f[_i] = X##_f[_i+_skip];					\
+    else								\
+      {									\
+	for (_i = 0; _i < 7-_skip; ++_i)				\
+	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
+		      | X##_f[_i+_skip+1] << _up;			\
+	X##_f[_i++] = X##_f[7] >> _down;				\
+      }									\
+    for (; _i < 8; ++_i)						\
+      X##_f[_i] = 0;							\
+  } while (0)
+
+
+/* Right shift with sticky-lsb. 
+ * What this actually means is that we do a standard right-shift,
+ * but that if any of the bits that fall off the right hand side
+ * were one then we always set the LSbit.
+ */
+#define _FP_FRAC_SRS_8(X,N,size)					\
+  do {									\
+    _FP_I_TYPE _up, _down, _skip, _i;					\
+    _FP_W_TYPE _s;							\
+    _skip = (N) / _FP_W_TYPE_SIZE;					\
+    _down = (N) % _FP_W_TYPE_SIZE;					\
+    _up = _FP_W_TYPE_SIZE - _down;					\
+    for (_s = _i = 0; _i < _skip; ++_i)					\
+      _s |= X##_f[_i];							\
+    if (!_down)								\
+      for (_i = 0; _i <= 7-_skip; ++_i)					\
+	X##_f[_i] = X##_f[_i+_skip];					\
+    else								\
+      {									\
+	_s |= X##_f[_i] << _up;						\
+	for (_i = 0; _i < 7-_skip; ++_i)				\
+	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
+		      | X##_f[_i+_skip+1] << _up;			\
+	X##_f[_i++] = X##_f[7] >> _down;				\
+      }									\
+    for (; _i < 8; ++_i)						\
+      X##_f[_i] = 0;							\
+    /* don't fix the LSB until the very end when we're sure f[0] is stable */	\
+    X##_f[0] |= (_s != 0);						\
+  } while (0)
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-common.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-common.h
new file mode 100644
index 0000000..ef11b52
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/op-common.h
@@ -0,0 +1,1359 @@
+/* Software floating-point emulation. Common operations.
+   Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com),
+		  Jakub Jelinek (jj@ultra.linux.cz),
+		  David S. Miller (davem@redhat.com) and
+		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
+
+   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 into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser 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.)
+
+   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, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#define _FP_DECL(wc, X)						\
+  _FP_I_TYPE X##_c __attribute__((unused)), X##_s, X##_e;	\
+  _FP_FRAC_DECL_##wc(X)
+
+/*
+ * Finish truely unpacking a native fp value by classifying the kind
+ * of fp value and normalizing both the exponent and the fraction.
+ */
+
+#define _FP_UNPACK_CANONICAL(fs, wc, X)					\
+do {									\
+  switch (X##_e)							\
+  {									\
+  default:								\
+    _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_IMPLBIT_##fs;			\
+    _FP_FRAC_SLL_##wc(X, _FP_WORKBITS);					\
+    X##_e -= _FP_EXPBIAS_##fs;						\
+    X##_c = FP_CLS_NORMAL;						\
+    break;								\
+									\
+  case 0:								\
+    if (_FP_FRAC_ZEROP_##wc(X))						\
+      X##_c = FP_CLS_ZERO;						\
+    else								\
+      {									\
+	/* a denormalized number */					\
+	_FP_I_TYPE _shift;						\
+	_FP_FRAC_CLZ_##wc(_shift, X);					\
+	_shift -= _FP_FRACXBITS_##fs;					\
+	_FP_FRAC_SLL_##wc(X, (_shift+_FP_WORKBITS));			\
+	X##_e -= _FP_EXPBIAS_##fs - 1 + _shift;				\
+	X##_c = FP_CLS_NORMAL;						\
+	FP_SET_EXCEPTION(FP_EX_DENORM);					\
+      }									\
+    break;								\
+									\
+  case _FP_EXPMAX_##fs:							\
+    if (_FP_FRAC_ZEROP_##wc(X))						\
+      X##_c = FP_CLS_INF;						\
+    else								\
+      {									\
+	X##_c = FP_CLS_NAN;						\
+	/* Check for signaling NaN */					\
+	if (!(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs))		\
+	  FP_SET_EXCEPTION(FP_EX_INVALID);				\
+      }									\
+    break;								\
+  }									\
+} while (0)
+
+/* Finish unpacking an fp value in semi-raw mode: the mantissa is
+   shifted by _FP_WORKBITS but the implicit MSB is not inserted and
+   other classification is not done.  */
+#define _FP_UNPACK_SEMIRAW(fs, wc, X)	_FP_FRAC_SLL_##wc(X, _FP_WORKBITS)
+
+/* A semi-raw value has overflowed to infinity.  Adjust the mantissa
+   and exponent appropriately.  */
+#define _FP_OVERFLOW_SEMIRAW(fs, wc, X)			\
+do {							\
+  if (FP_ROUNDMODE == FP_RND_NEAREST			\
+      || (FP_ROUNDMODE == FP_RND_PINF && !X##_s)	\
+      || (FP_ROUNDMODE == FP_RND_MINF && X##_s))	\
+    {							\
+      X##_e = _FP_EXPMAX_##fs;				\
+      _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);		\
+    }							\
+  else							\
+    {							\
+      X##_e = _FP_EXPMAX_##fs - 1;			\
+      _FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc);		\
+    }							\
+    FP_SET_EXCEPTION(FP_EX_INEXACT);			\
+    FP_SET_EXCEPTION(FP_EX_OVERFLOW);			\
+} while (0)
+
+/* Check for a semi-raw value being a signaling NaN and raise the
+   invalid exception if so.  */
+#define _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X)			\
+do {								\
+  if (X##_e == _FP_EXPMAX_##fs					\
+      && !_FP_FRAC_ZEROP_##wc(X)				\
+      && !(_FP_FRAC_HIGH_##fs(X) & _FP_QNANBIT_SH_##fs))	\
+    FP_SET_EXCEPTION(FP_EX_INVALID);				\
+} while (0)
+
+/* Choose a NaN result from an operation on two semi-raw NaN
+   values.  */
+#define _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP)			\
+do {									\
+  /* _FP_CHOOSENAN expects raw values, so shift as required.  */	\
+  _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);					\
+  _FP_FRAC_SRL_##wc(Y, _FP_WORKBITS);					\
+  _FP_CHOOSENAN(fs, wc, R, X, Y, OP);					\
+  _FP_FRAC_SLL_##wc(R, _FP_WORKBITS);					\
+} while (0)
+
+/* Test whether a biased exponent is normal (not zero or maximum).  */
+#define _FP_EXP_NORMAL(fs, wc, X)	(((X##_e + 1) & _FP_EXPMAX_##fs) > 1)
+
+/* Prepare to pack an fp value in semi-raw mode: the mantissa is
+   rounded and shifted right, with the rounding possibly increasing
+   the exponent (including changing a finite value to infinity).  */
+#define _FP_PACK_SEMIRAW(fs, wc, X)				\
+do {								\
+  _FP_ROUND(wc, X);						\
+  if (_FP_FRAC_HIGH_##fs(X)					\
+      & (_FP_OVERFLOW_##fs >> 1))				\
+    {								\
+      _FP_FRAC_HIGH_##fs(X) &= ~(_FP_OVERFLOW_##fs >> 1);	\
+      X##_e++;							\
+      if (X##_e == _FP_EXPMAX_##fs)				\
+	_FP_OVERFLOW_SEMIRAW(fs, wc, X);			\
+    }								\
+  _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);				\
+  if (!_FP_EXP_NORMAL(fs, wc, X) && !_FP_FRAC_ZEROP_##wc(X))	\
+    {								\
+      if (X##_e == 0)						\
+	FP_SET_EXCEPTION(FP_EX_UNDERFLOW);			\
+      else							\
+	{							\
+	  if (!_FP_KEEPNANFRACP)				\
+	    {							\
+	      _FP_FRAC_SET_##wc(X, _FP_NANFRAC_##fs);		\
+	      X##_s = _FP_NANSIGN_##fs;				\
+	    }							\
+	  else							\
+	    _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs;	\
+	}							\
+    }								\
+} while (0)
+
+/*
+ * Before packing the bits back into the native fp result, take care
+ * of such mundane things as rounding and overflow.  Also, for some
+ * kinds of fp values, the original parts may not have been fully
+ * extracted -- but that is ok, we can regenerate them now.
+ */
+
+#define _FP_PACK_CANONICAL(fs, wc, X)				\
+do {								\
+  switch (X##_c)						\
+  {								\
+  case FP_CLS_NORMAL:						\
+    X##_e += _FP_EXPBIAS_##fs;					\
+    if (X##_e > 0)						\
+      {								\
+	_FP_ROUND(wc, X);					\
+	if (_FP_FRAC_OVERP_##wc(fs, X))				\
+	  {							\
+	    _FP_FRAC_CLEAR_OVERP_##wc(fs, X);			\
+	    X##_e++;						\
+	  }							\
+	_FP_FRAC_SRL_##wc(X, _FP_WORKBITS);			\
+	if (X##_e >= _FP_EXPMAX_##fs)				\
+	  {							\
+	    /* overflow */					\
+	    switch (FP_ROUNDMODE)				\
+	      {							\
+	      case FP_RND_NEAREST:				\
+		X##_c = FP_CLS_INF;				\
+		break;						\
+	      case FP_RND_PINF:					\
+		if (!X##_s) X##_c = FP_CLS_INF;			\
+		break;						\
+	      case FP_RND_MINF:					\
+		if (X##_s) X##_c = FP_CLS_INF;			\
+		break;						\
+	      }							\
+	    if (X##_c == FP_CLS_INF)				\
+	      {							\
+		/* Overflow to infinity */			\
+		X##_e = _FP_EXPMAX_##fs;			\
+		_FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
+	      }							\
+	    else						\
+	      {							\
+		/* Overflow to maximum normal */		\
+		X##_e = _FP_EXPMAX_##fs - 1;			\
+		_FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc);		\
+	      }							\
+	    FP_SET_EXCEPTION(FP_EX_OVERFLOW);			\
+            FP_SET_EXCEPTION(FP_EX_INEXACT);			\
+	  }							\
+      }								\
+    else							\
+      {								\
+	/* we've got a denormalized number */			\
+	X##_e = -X##_e + 1;					\
+	if (X##_e <= _FP_WFRACBITS_##fs)			\
+	  {							\
+	    _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs);	\
+	    _FP_ROUND(wc, X);					\
+	    if (_FP_FRAC_HIGH_##fs(X)				\
+		& (_FP_OVERFLOW_##fs >> 1))			\
+	      {							\
+	        X##_e = 1;					\
+	        _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
+	      }							\
+	    else						\
+	      {							\
+		X##_e = 0;					\
+		_FP_FRAC_SRL_##wc(X, _FP_WORKBITS);		\
+		FP_SET_EXCEPTION(FP_EX_UNDERFLOW);		\
+	      }							\
+	  }							\
+	else							\
+	  {							\
+	    /* underflow to zero */				\
+	    X##_e = 0;						\
+	    if (!_FP_FRAC_ZEROP_##wc(X))			\
+	      {							\
+	        _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);		\
+	        _FP_ROUND(wc, X);				\
+	        _FP_FRAC_LOW_##wc(X) >>= (_FP_WORKBITS);	\
+	      }							\
+	    FP_SET_EXCEPTION(FP_EX_UNDERFLOW);			\
+	  }							\
+      }								\
+    break;							\
+								\
+  case FP_CLS_ZERO:						\
+    X##_e = 0;							\
+    _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);			\
+    break;							\
+								\
+  case FP_CLS_INF:						\
+    X##_e = _FP_EXPMAX_##fs;					\
+    _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);			\
+    break;							\
+								\
+  case FP_CLS_NAN:						\
+    X##_e = _FP_EXPMAX_##fs;					\
+    if (!_FP_KEEPNANFRACP)					\
+      {								\
+	_FP_FRAC_SET_##wc(X, _FP_NANFRAC_##fs);			\
+	X##_s = _FP_NANSIGN_##fs;				\
+      }								\
+    else							\
+      _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs;		\
+    break;							\
+  }								\
+} while (0)
+
+/* This one accepts raw argument and not cooked,  returns
+ * 1 if X is a signaling NaN.
+ */
+#define _FP_ISSIGNAN(fs, wc, X)					\
+({								\
+  int __ret = 0;						\
+  if (X##_e == _FP_EXPMAX_##fs)					\
+    {								\
+      if (!_FP_FRAC_ZEROP_##wc(X)				\
+	  && !(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs))	\
+	__ret = 1;						\
+    }								\
+  __ret;							\
+})
+
+
+
+
+
+/* Addition on semi-raw values.  */
+#define _FP_ADD_INTERNAL(fs, wc, R, X, Y, OP)				 \
+do {									 \
+  if (X##_s == Y##_s)							 \
+    {									 \
+      /* Addition.  */							 \
+      R##_s = X##_s;							 \
+      int ediff = X##_e - Y##_e;					 \
+      if (ediff > 0)							 \
+	{								 \
+	  R##_e = X##_e;						 \
+	  if (Y##_e == 0)						 \
+	    {								 \
+	      /* Y is zero or denormalized.  */				 \
+	      if (_FP_FRAC_ZEROP_##wc(Y))				 \
+		{							 \
+		  _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X);			 \
+		  _FP_FRAC_COPY_##wc(R, X);				 \
+		  goto add_done;					 \
+		}							 \
+	      else							 \
+		{							 \
+		  FP_SET_EXCEPTION(FP_EX_DENORM);			 \
+		  ediff--;						 \
+		  if (ediff == 0)					 \
+		    {							 \
+		      _FP_FRAC_ADD_##wc(R, X, Y);			 \
+		      goto add3;					 \
+		    }							 \
+		  if (X##_e == _FP_EXPMAX_##fs)				 \
+		    {							 \
+		      _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X);		 \
+		      _FP_FRAC_COPY_##wc(R, X);				 \
+		      goto add_done;					 \
+		    }							 \
+		  goto add1;						 \
+		}							 \
+	    }								 \
+	  else if (X##_e == _FP_EXPMAX_##fs)				 \
+	    {								 \
+	      /* X is NaN or Inf, Y is normal.  */			 \
+	      _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X);			 \
+	      _FP_FRAC_COPY_##wc(R, X);					 \
+	      goto add_done;						 \
+	    }								 \
+									 \
+	  /* Insert implicit MSB of Y.  */				 \
+	  _FP_FRAC_HIGH_##fs(Y) |= _FP_IMPLBIT_SH_##fs;			 \
+									 \
+	add1:								 \
+	  /* Shift the mantissa of Y to the right EDIFF steps;		 \
+	     remember to account later for the implicit MSB of X.  */	 \
+	  if (ediff <= _FP_WFRACBITS_##fs)				 \
+	    _FP_FRAC_SRS_##wc(Y, ediff, _FP_WFRACBITS_##fs);		 \
+	  else if (!_FP_FRAC_ZEROP_##wc(Y))				 \
+	    _FP_FRAC_SET_##wc(Y, _FP_MINFRAC_##wc);			 \
+	  _FP_FRAC_ADD_##wc(R, X, Y);					 \
+	}								 \
+      else if (ediff < 0)						 \
+	{								 \
+	  ediff = -ediff;						 \
+	  R##_e = Y##_e;						 \
+	  if (X##_e == 0)						 \
+	    {								 \
+	      /* X is zero or denormalized.  */				 \
+	      if (_FP_FRAC_ZEROP_##wc(X))				 \
+		{							 \
+		  _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y);			 \
+		  _FP_FRAC_COPY_##wc(R, Y);				 \
+		  goto add_done;					 \
+		}							 \
+	      else							 \
+		{							 \
+		  FP_SET_EXCEPTION(FP_EX_DENORM);			 \
+		  ediff--;						 \
+		  if (ediff == 0)					 \
+		    {							 \
+		      _FP_FRAC_ADD_##wc(R, Y, X);			 \
+		      goto add3;					 \
+		    }							 \
+		  if (Y##_e == _FP_EXPMAX_##fs)				 \
+		    {							 \
+		      _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y);		 \
+		      _FP_FRAC_COPY_##wc(R, Y);				 \
+		      goto add_done;					 \
+		    }							 \
+		  goto add2;						 \
+		}							 \
+	    }								 \
+	  else if (Y##_e == _FP_EXPMAX_##fs)				 \
+	    {								 \
+	      /* Y is NaN or Inf, X is normal.  */			 \
+	      _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y);			 \
+	      _FP_FRAC_COPY_##wc(R, Y);					 \
+	      goto add_done;						 \
+	    }								 \
+									 \
+	  /* Insert implicit MSB of X.  */				 \
+	  _FP_FRAC_HIGH_##fs(X) |= _FP_IMPLBIT_SH_##fs;			 \
+									 \
+	add2:								 \
+	  /* Shift the mantissa of X to the right EDIFF steps;		 \
+	     remember to account later for the implicit MSB of Y.  */	 \
+	  if (ediff <= _FP_WFRACBITS_##fs)				 \
+	    _FP_FRAC_SRS_##wc(X, ediff, _FP_WFRACBITS_##fs);		 \
+	  else if (!_FP_FRAC_ZEROP_##wc(X))				 \
+	    _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);			 \
+	  _FP_FRAC_ADD_##wc(R, Y, X);					 \
+	}								 \
+      else								 \
+	{								 \
+	  /* ediff == 0.  */						 \
+	  if (!_FP_EXP_NORMAL(fs, wc, X))				 \
+	    {								 \
+	      if (X##_e == 0)						 \
+		{							 \
+		  /* X and Y are zero or denormalized.  */		 \
+		  R##_e = 0;						 \
+		  if (_FP_FRAC_ZEROP_##wc(X))				 \
+		    {							 \
+		      if (!_FP_FRAC_ZEROP_##wc(Y))			 \
+			FP_SET_EXCEPTION(FP_EX_DENORM);			 \
+		      _FP_FRAC_COPY_##wc(R, Y);				 \
+		      goto add_done;					 \
+		    }							 \
+		  else if (_FP_FRAC_ZEROP_##wc(Y))			 \
+		    {							 \
+		      FP_SET_EXCEPTION(FP_EX_DENORM);			 \
+		      _FP_FRAC_COPY_##wc(R, X);				 \
+		      goto add_done;					 \
+		    }							 \
+		  else							 \
+		    {							 \
+		      FP_SET_EXCEPTION(FP_EX_DENORM);			 \
+		      _FP_FRAC_ADD_##wc(R, X, Y);			 \
+		      if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs)	 \
+			{						 \
+			  /* Normalized result.  */			 \
+			  _FP_FRAC_HIGH_##fs(R)				 \
+			    &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs;	 \
+			  R##_e = 1;					 \
+			}						 \
+		      goto add_done;					 \
+		    }							 \
+		}							 \
+	      else							 \
+		{							 \
+		  /* X and Y are NaN or Inf.  */			 \
+		  _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X);			 \
+		  _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y);			 \
+		  R##_e = _FP_EXPMAX_##fs;				 \
+		  if (_FP_FRAC_ZEROP_##wc(X))				 \
+		    _FP_FRAC_COPY_##wc(R, Y);				 \
+		  else if (_FP_FRAC_ZEROP_##wc(Y))			 \
+		    _FP_FRAC_COPY_##wc(R, X);				 \
+		  else							 \
+		    _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP);		 \
+		  goto add_done;					 \
+		}							 \
+	    }								 \
+	  /* The exponents of X and Y, both normal, are equal.  The	 \
+	     implicit MSBs will always add to increase the		 \
+	     exponent.  */						 \
+	  _FP_FRAC_ADD_##wc(R, X, Y);					 \
+	  R##_e = X##_e + 1;						 \
+	  _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs);			 \
+	  if (R##_e == _FP_EXPMAX_##fs)					 \
+	    /* Overflow to infinity (depending on rounding mode).  */	 \
+	    _FP_OVERFLOW_SEMIRAW(fs, wc, R);				 \
+	  goto add_done;						 \
+	}								 \
+    add3:								 \
+      if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs)			 \
+	{								 \
+	  /* Overflow.  */						 \
+	  _FP_FRAC_HIGH_##fs(R) &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs;	 \
+	  R##_e++;							 \
+	  _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs);			 \
+	  if (R##_e == _FP_EXPMAX_##fs)					 \
+	    /* Overflow to infinity (depending on rounding mode).  */	 \
+	    _FP_OVERFLOW_SEMIRAW(fs, wc, R);				 \
+	}								 \
+    add_done: ;								 \
+    }									 \
+  else									 \
+    {									 \
+      /* Subtraction.  */						 \
+      int ediff = X##_e - Y##_e;					 \
+      if (ediff > 0)							 \
+	{								 \
+	  R##_e = X##_e;						 \
+	  R##_s = X##_s;						 \
+	  if (Y##_e == 0)						 \
+	    {								 \
+	      /* Y is zero or denormalized.  */				 \
+	      if (_FP_FRAC_ZEROP_##wc(Y))				 \
+		{							 \
+		  _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X);			 \
+		  _FP_FRAC_COPY_##wc(R, X);				 \
+		  goto sub_done;					 \
+		}							 \
+	      else							 \
+		{							 \
+		  FP_SET_EXCEPTION(FP_EX_DENORM);			 \
+		  ediff--;						 \
+		  if (ediff == 0)					 \
+		    {							 \
+		      _FP_FRAC_SUB_##wc(R, X, Y);			 \
+		      goto sub3;					 \
+		    }							 \
+		  if (X##_e == _FP_EXPMAX_##fs)				 \
+		    {							 \
+		      _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X);		 \
+		      _FP_FRAC_COPY_##wc(R, X);				 \
+		      goto sub_done;					 \
+		    }							 \
+		  goto sub1;						 \
+		}							 \
+	    }								 \
+	  else if (X##_e == _FP_EXPMAX_##fs)				 \
+	    {								 \
+	      /* X is NaN or Inf, Y is normal.  */			 \
+	      _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X);			 \
+	      _FP_FRAC_COPY_##wc(R, X);					 \
+	      goto sub_done;						 \
+	    }								 \
+									 \
+	  /* Insert implicit MSB of Y.  */				 \
+	  _FP_FRAC_HIGH_##fs(Y) |= _FP_IMPLBIT_SH_##fs;			 \
+									 \
+	sub1:								 \
+	  /* Shift the mantissa of Y to the right EDIFF steps;		 \
+	     remember to account later for the implicit MSB of X.  */	 \
+	  if (ediff <= _FP_WFRACBITS_##fs)				 \
+	    _FP_FRAC_SRS_##wc(Y, ediff, _FP_WFRACBITS_##fs);		 \
+	  else if (!_FP_FRAC_ZEROP_##wc(Y))				 \
+	    _FP_FRAC_SET_##wc(Y, _FP_MINFRAC_##wc);			 \
+	  _FP_FRAC_SUB_##wc(R, X, Y);					 \
+	}								 \
+      else if (ediff < 0)						 \
+	{								 \
+	  ediff = -ediff;						 \
+	  R##_e = Y##_e;						 \
+	  R##_s = Y##_s;						 \
+	  if (X##_e == 0)						 \
+	    {								 \
+	      /* X is zero or denormalized.  */				 \
+	      if (_FP_FRAC_ZEROP_##wc(X))				 \
+		{							 \
+		  _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y);			 \
+		  _FP_FRAC_COPY_##wc(R, Y);				 \
+		  goto sub_done;					 \
+		}							 \
+	      else							 \
+		{							 \
+		  FP_SET_EXCEPTION(FP_EX_DENORM);			 \
+		  ediff--;						 \
+		  if (ediff == 0)					 \
+		    {							 \
+		      _FP_FRAC_SUB_##wc(R, Y, X);			 \
+		      goto sub3;					 \
+		    }							 \
+		  if (Y##_e == _FP_EXPMAX_##fs)				 \
+		    {							 \
+		      _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y);		 \
+		      _FP_FRAC_COPY_##wc(R, Y);				 \
+		      goto sub_done;					 \
+		    }							 \
+		  goto sub2;						 \
+		}							 \
+	    }								 \
+	  else if (Y##_e == _FP_EXPMAX_##fs)				 \
+	    {								 \
+	      /* Y is NaN or Inf, X is normal.  */			 \
+	      _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y);			 \
+	      _FP_FRAC_COPY_##wc(R, Y);					 \
+	      goto sub_done;						 \
+	    }								 \
+									 \
+	  /* Insert implicit MSB of X.  */				 \
+	  _FP_FRAC_HIGH_##fs(X) |= _FP_IMPLBIT_SH_##fs;			 \
+									 \
+	sub2:								 \
+	  /* Shift the mantissa of X to the right EDIFF steps;		 \
+	     remember to account later for the implicit MSB of Y.  */	 \
+	  if (ediff <= _FP_WFRACBITS_##fs)				 \
+	    _FP_FRAC_SRS_##wc(X, ediff, _FP_WFRACBITS_##fs);		 \
+	  else if (!_FP_FRAC_ZEROP_##wc(X))				 \
+	    _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);			 \
+	  _FP_FRAC_SUB_##wc(R, Y, X);					 \
+	}								 \
+      else								 \
+	{								 \
+	  /* ediff == 0.  */						 \
+	  if (!_FP_EXP_NORMAL(fs, wc, X))				 \
+	    {								 \
+	      if (X##_e == 0)						 \
+		{							 \
+		  /* X and Y are zero or denormalized.  */		 \
+		  R##_e = 0;						 \
+		  if (_FP_FRAC_ZEROP_##wc(X))				 \
+		    {							 \
+		      _FP_FRAC_COPY_##wc(R, Y);				 \
+		      if (_FP_FRAC_ZEROP_##wc(Y))			 \
+			R##_s = (FP_ROUNDMODE == FP_RND_MINF);		 \
+		      else						 \
+			{						 \
+			  FP_SET_EXCEPTION(FP_EX_DENORM);		 \
+			  R##_s = Y##_s;				 \
+			}						 \
+		      goto sub_done;					 \
+		    }							 \
+		  else if (_FP_FRAC_ZEROP_##wc(Y))			 \
+		    {							 \
+		      FP_SET_EXCEPTION(FP_EX_DENORM);			 \
+		      _FP_FRAC_COPY_##wc(R, X);				 \
+		      R##_s = X##_s;					 \
+		      goto sub_done;					 \
+		    }							 \
+		  else							 \
+		    {							 \
+		      FP_SET_EXCEPTION(FP_EX_DENORM);			 \
+		      _FP_FRAC_SUB_##wc(R, X, Y);			 \
+		      R##_s = X##_s;					 \
+		      if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs)	 \
+			{						 \
+			  /* |X| < |Y|, negate result.  */		 \
+			  _FP_FRAC_SUB_##wc(R, Y, X);			 \
+			  R##_s = Y##_s;				 \
+			}						 \
+		      else if (_FP_FRAC_ZEROP_##wc(R))			 \
+			R##_s = (FP_ROUNDMODE == FP_RND_MINF);		 \
+		      goto sub_done;					 \
+		    }							 \
+		}							 \
+	      else							 \
+		{							 \
+		  /* X and Y are NaN or Inf, of opposite signs.  */	 \
+		  _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X);			 \
+		  _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y);			 \
+		  R##_e = _FP_EXPMAX_##fs;				 \
+		  if (_FP_FRAC_ZEROP_##wc(X))				 \
+		    {							 \
+		      if (_FP_FRAC_ZEROP_##wc(Y))			 \
+			{						 \
+			  /* Inf - Inf.  */				 \
+			  R##_s = _FP_NANSIGN_##fs;			 \
+			  _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);	 \
+			  _FP_FRAC_SLL_##wc(R, _FP_WORKBITS);		 \
+			  FP_SET_EXCEPTION(FP_EX_INVALID);		 \
+			}						 \
+		      else						 \
+			{						 \
+			  /* Inf - NaN.  */				 \
+			  R##_s = Y##_s;				 \
+			  _FP_FRAC_COPY_##wc(R, Y);			 \
+			}						 \
+		    }							 \
+		  else							 \
+		    {							 \
+		      if (_FP_FRAC_ZEROP_##wc(Y))			 \
+			{						 \
+			  /* NaN - Inf.  */				 \
+			  R##_s = X##_s;				 \
+			  _FP_FRAC_COPY_##wc(R, X);			 \
+			}						 \
+		      else						 \
+			{						 \
+			  /* NaN - NaN.  */				 \
+			  _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP);	 \
+			}						 \
+		    }							 \
+		  goto sub_done;					 \
+		}							 \
+	    }								 \
+	  /* The exponents of X and Y, both normal, are equal.  The	 \
+	     implicit MSBs cancel.  */					 \
+	  R##_e = X##_e;						 \
+	  _FP_FRAC_SUB_##wc(R, X, Y);					 \
+	  R##_s = X##_s;						 \
+	  if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs)		 \
+	    {								 \
+	      /* |X| < |Y|, negate result.  */				 \
+	      _FP_FRAC_SUB_##wc(R, Y, X);				 \
+	      R##_s = Y##_s;						 \
+	    }								 \
+	  else if (_FP_FRAC_ZEROP_##wc(R))				 \
+	    {								 \
+	      R##_e = 0;						 \
+	      R##_s = (FP_ROUNDMODE == FP_RND_MINF);			 \
+	      goto sub_done;						 \
+	    }								 \
+	  goto norm;							 \
+	}								 \
+    sub3:								 \
+      if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs)			 \
+	{								 \
+	  int diff;							 \
+	  /* Carry into most significant bit of larger one of X and Y,	 \
+	     canceling it; renormalize.  */				 \
+	  _FP_FRAC_HIGH_##fs(R) &= _FP_IMPLBIT_SH_##fs - 1;		 \
+	norm:								 \
+	  _FP_FRAC_CLZ_##wc(diff, R);					 \
+	  diff -= _FP_WFRACXBITS_##fs;					 \
+	  _FP_FRAC_SLL_##wc(R, diff);					 \
+	  if (R##_e <= diff)						 \
+	    {								 \
+	      /* R is denormalized.  */					 \
+	      diff = diff - R##_e + 1;					 \
+	      _FP_FRAC_SRS_##wc(R, diff, _FP_WFRACBITS_##fs);		 \
+	      R##_e = 0;						 \
+	    }								 \
+	  else								 \
+	    {								 \
+	      R##_e -= diff;						 \
+	      _FP_FRAC_HIGH_##fs(R) &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs; \
+	    }								 \
+	}								 \
+    sub_done: ;								 \
+    }									 \
+} while (0)
+
+#define _FP_ADD(fs, wc, R, X, Y) _FP_ADD_INTERNAL(fs, wc, R, X, Y, '+')
+#define _FP_SUB(fs, wc, R, X, Y)					    \
+  do {									    \
+    if (!(Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))) Y##_s ^= 1; \
+    _FP_ADD_INTERNAL(fs, wc, R, X, Y, '-');				    \
+  } while (0)
+
+
+/*
+ * Main negation routine.  FIXME -- when we care about setting exception
+ * bits reliably, this will not do.  We should examine all of the fp classes.
+ */
+
+#define _FP_NEG(fs, wc, R, X)		\
+  do {					\
+    _FP_FRAC_COPY_##wc(R, X);		\
+    R##_c = X##_c;			\
+    R##_e = X##_e;			\
+    R##_s = 1 ^ X##_s;			\
+  } while (0)
+
+
+/*
+ * Main multiplication routine.  The input values should be cooked.
+ */
+
+#define _FP_MUL(fs, wc, R, X, Y)			\
+do {							\
+  R##_s = X##_s ^ Y##_s;				\
+  switch (_FP_CLS_COMBINE(X##_c, Y##_c))		\
+  {							\
+  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL):	\
+    R##_c = FP_CLS_NORMAL;				\
+    R##_e = X##_e + Y##_e + 1;				\
+							\
+    _FP_MUL_MEAT_##fs(R,X,Y);				\
+							\
+    if (_FP_FRAC_OVERP_##wc(fs, R))			\
+      _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs);	\
+    else						\
+      R##_e--;						\
+    break;						\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN):		\
+    _FP_CHOOSENAN(fs, wc, R, X, Y, '*');		\
+    break;						\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL):	\
+  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF):		\
+  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO):		\
+    R##_s = X##_s;					\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF):		\
+  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL):	\
+  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL):	\
+  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):	\
+    _FP_FRAC_COPY_##wc(R, X);				\
+    R##_c = X##_c;					\
+    break;						\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN):	\
+  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN):		\
+  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN):		\
+    R##_s = Y##_s;					\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF):	\
+  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO):	\
+    _FP_FRAC_COPY_##wc(R, Y);				\
+    R##_c = Y##_c;					\
+    break;						\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO):		\
+  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF):		\
+    R##_s = _FP_NANSIGN_##fs;				\
+    R##_c = FP_CLS_NAN;					\
+    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);		\
+    FP_SET_EXCEPTION(FP_EX_INVALID);			\
+    break;						\
+							\
+  default:						\
+    abort();						\
+  }							\
+} while (0)
+
+
+/*
+ * Main division routine.  The input values should be cooked.
+ */
+
+#define _FP_DIV(fs, wc, R, X, Y)			\
+do {							\
+  R##_s = X##_s ^ Y##_s;				\
+  switch (_FP_CLS_COMBINE(X##_c, Y##_c))		\
+  {							\
+  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL):	\
+    R##_c = FP_CLS_NORMAL;				\
+    R##_e = X##_e - Y##_e;				\
+							\
+    _FP_DIV_MEAT_##fs(R,X,Y);				\
+    break;						\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN):		\
+    _FP_CHOOSENAN(fs, wc, R, X, Y, '/');		\
+    break;						\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL):	\
+  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF):		\
+  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO):		\
+    R##_s = X##_s;					\
+    _FP_FRAC_COPY_##wc(R, X);				\
+    R##_c = X##_c;					\
+    break;						\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN):	\
+  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN):		\
+  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN):		\
+    R##_s = Y##_s;					\
+    _FP_FRAC_COPY_##wc(R, Y);				\
+    R##_c = Y##_c;					\
+    break;						\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF):	\
+  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF):		\
+  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL):	\
+    R##_c = FP_CLS_ZERO;				\
+    break;						\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO):	\
+    FP_SET_EXCEPTION(FP_EX_DIVZERO);			\
+  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO):		\
+  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL):	\
+    R##_c = FP_CLS_INF;					\
+    break;						\
+							\
+  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF):		\
+  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):	\
+    R##_s = _FP_NANSIGN_##fs;				\
+    R##_c = FP_CLS_NAN;					\
+    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);		\
+    FP_SET_EXCEPTION(FP_EX_INVALID);			\
+    break;						\
+							\
+  default:						\
+    abort();						\
+  }							\
+} while (0)
+
+
+/*
+ * Main differential comparison routine.  The inputs should be raw not
+ * cooked.  The return is -1,0,1 for normal values, 2 otherwise.
+ */
+
+#define _FP_CMP(fs, wc, ret, X, Y, un)					\
+  do {									\
+    /* NANs are unordered */						\
+    if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X))		\
+	|| (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y)))	\
+      {									\
+	ret = un;							\
+      }									\
+    else								\
+      {									\
+	int __is_zero_x;						\
+	int __is_zero_y;						\
+									\
+	__is_zero_x = (!X##_e && _FP_FRAC_ZEROP_##wc(X)) ? 1 : 0;	\
+	__is_zero_y = (!Y##_e && _FP_FRAC_ZEROP_##wc(Y)) ? 1 : 0;	\
+									\
+	if (__is_zero_x && __is_zero_y)					\
+		ret = 0;						\
+	else if (__is_zero_x)						\
+		ret = Y##_s ? 1 : -1;					\
+	else if (__is_zero_y)						\
+		ret = X##_s ? -1 : 1;					\
+	else if (X##_s != Y##_s)					\
+	  ret = X##_s ? -1 : 1;						\
+	else if (X##_e > Y##_e)						\
+	  ret = X##_s ? -1 : 1;						\
+	else if (X##_e < Y##_e)						\
+	  ret = X##_s ? 1 : -1;						\
+	else if (_FP_FRAC_GT_##wc(X, Y))				\
+	  ret = X##_s ? -1 : 1;						\
+	else if (_FP_FRAC_GT_##wc(Y, X))				\
+	  ret = X##_s ? 1 : -1;						\
+	else								\
+	  ret = 0;							\
+      }									\
+  } while (0)
+
+
+/* Simplification for strict equality.  */
+
+#define _FP_CMP_EQ(fs, wc, ret, X, Y)					    \
+  do {									    \
+    /* NANs are unordered */						    \
+    if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X))		    \
+	|| (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y)))	    \
+      {									    \
+	ret = 1;							    \
+      }									    \
+    else								    \
+      {									    \
+	ret = !(X##_e == Y##_e						    \
+		&& _FP_FRAC_EQ_##wc(X, Y)				    \
+		&& (X##_s == Y##_s || (!X##_e && _FP_FRAC_ZEROP_##wc(X)))); \
+      }									    \
+  } while (0)
+
+/* Version to test unordered.  */
+
+#define _FP_CMP_UNORD(fs, wc, ret, X, Y)				\
+  do {									\
+    ret = ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X))	\
+	   || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y)));	\
+  } while (0)
+
+/*
+ * Main square root routine.  The input value should be cooked.
+ */
+
+#define _FP_SQRT(fs, wc, R, X)						\
+do {									\
+    _FP_FRAC_DECL_##wc(T); _FP_FRAC_DECL_##wc(S);			\
+    _FP_W_TYPE q;							\
+    switch (X##_c)							\
+    {									\
+    case FP_CLS_NAN:							\
+	_FP_FRAC_COPY_##wc(R, X);					\
+	R##_s = X##_s;							\
+    	R##_c = FP_CLS_NAN;						\
+    	break;								\
+    case FP_CLS_INF:							\
+    	if (X##_s)							\
+    	  {								\
+    	    R##_s = _FP_NANSIGN_##fs;					\
+	    R##_c = FP_CLS_NAN; /* NAN */				\
+	    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);			\
+	    FP_SET_EXCEPTION(FP_EX_INVALID);				\
+    	  }								\
+    	else								\
+    	  {								\
+    	    R##_s = 0;							\
+    	    R##_c = FP_CLS_INF; /* sqrt(+inf) = +inf */			\
+    	  }								\
+    	break;								\
+    case FP_CLS_ZERO:							\
+	R##_s = X##_s;							\
+	R##_c = FP_CLS_ZERO; /* sqrt(+-0) = +-0 */			\
+	break;								\
+    case FP_CLS_NORMAL:							\
+    	R##_s = 0;							\
+        if (X##_s)							\
+          {								\
+	    R##_c = FP_CLS_NAN; /* sNAN */				\
+	    R##_s = _FP_NANSIGN_##fs;					\
+	    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);			\
+	    FP_SET_EXCEPTION(FP_EX_INVALID);				\
+	    break;							\
+          }								\
+    	R##_c = FP_CLS_NORMAL;						\
+        if (X##_e & 1)							\
+          _FP_FRAC_SLL_##wc(X, 1);					\
+        R##_e = X##_e >> 1;						\
+        _FP_FRAC_SET_##wc(S, _FP_ZEROFRAC_##wc);			\
+        _FP_FRAC_SET_##wc(R, _FP_ZEROFRAC_##wc);			\
+        q = _FP_OVERFLOW_##fs >> 1;					\
+        _FP_SQRT_MEAT_##wc(R, S, T, X, q);				\
+    }									\
+  } while (0)
+
+/*
+ * Convert from FP to integer.  Input is raw.
+ */
+
+/* RSIGNED can have following values:
+ * 0:  the number is required to be 0..(2^rsize)-1, if not, NV is set plus
+ *     the result is either 0 or (2^rsize)-1 depending on the sign in such
+ *     case.
+ * 1:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not,
+ *     NV is set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1
+ *     depending on the sign in such case.
+ * -1: the number is required to be -(2^(rsize-1))..(2^rsize)-1, if not, NV is
+ *     set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1
+ *     depending on the sign in such case.
+ */
+#define _FP_TO_INT(fs, wc, r, X, rsize, rsigned)			\
+do {									\
+  if (X##_e < _FP_EXPBIAS_##fs)						\
+    {									\
+      r = 0;								\
+      if (X##_e == 0)							\
+	{								\
+	  if (!_FP_FRAC_ZEROP_##wc(X))					\
+	    {								\
+	      FP_SET_EXCEPTION(FP_EX_INEXACT);				\
+	      FP_SET_EXCEPTION(FP_EX_DENORM);				\
+	    }								\
+	}								\
+      else								\
+	FP_SET_EXCEPTION(FP_EX_INEXACT);				\
+    }									\
+  else if (X##_e >= _FP_EXPBIAS_##fs + rsize - (rsigned > 0 || X##_s)	\
+	   || (!rsigned && X##_s))					\
+    {									\
+      /* Overflow or converting to the most negative integer.  */	\
+      if (rsigned)							\
+	{								\
+	  r = 1;							\
+	  r <<= rsize - 1;						\
+	  r -= 1 - X##_s;						\
+	} else {							\
+	  r = 0;							\
+	  if (X##_s)							\
+	    r = ~r;							\
+	}								\
+									\
+      if (rsigned && X##_s && X##_e == _FP_EXPBIAS_##fs + rsize - 1)	\
+	{								\
+	  /* Possibly converting to most negative integer; check the	\
+	     mantissa.  */						\
+	  int inexact = 0;						\
+	  (void)((_FP_FRACBITS_##fs > rsize)				\
+		 ? ({ _FP_FRAC_SRST_##wc(X, inexact,			\
+					 _FP_FRACBITS_##fs - rsize,	\
+					 _FP_FRACBITS_##fs); 0; })	\
+		 : 0);							\
+	  if (!_FP_FRAC_ZEROP_##wc(X))					\
+	    FP_SET_EXCEPTION(FP_EX_INVALID);				\
+	  else if (inexact)						\
+	    FP_SET_EXCEPTION(FP_EX_INEXACT);				\
+	}								\
+      else								\
+	FP_SET_EXCEPTION(FP_EX_INVALID);				\
+    }									\
+  else									\
+    {									\
+      _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_IMPLBIT_##fs;			\
+      if (X##_e >= _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1)		\
+	{								\
+	  _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);				\
+	  r <<= X##_e - _FP_EXPBIAS_##fs - _FP_FRACBITS_##fs + 1;	\
+	}								\
+      else								\
+	{								\
+	  int inexact;							\
+	  _FP_FRAC_SRST_##wc(X, inexact,				\
+			    (_FP_FRACBITS_##fs + _FP_EXPBIAS_##fs - 1	\
+			     - X##_e),					\
+			    _FP_FRACBITS_##fs);				\
+	  if (inexact)							\
+	    FP_SET_EXCEPTION(FP_EX_INEXACT);				\
+	  _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);				\
+	}								\
+      if (rsigned && X##_s)						\
+	r = -r;								\
+    }									\
+} while (0)
+
+/* Convert integer to fp.  Output is raw.  RTYPE is unsigned even if
+   input is signed.  */
+#define _FP_FROM_INT(fs, wc, X, r, rsize, rtype)			     \
+  do {									     \
+    if (r)								     \
+      {									     \
+	rtype ur_;							     \
+									     \
+	if ((X##_s = (r < 0)))						     \
+	  r = -(rtype)r;						     \
+									     \
+	ur_ = (rtype) r;						     \
+	(void)((rsize <= _FP_W_TYPE_SIZE)				     \
+	       ? ({							     \
+		    int lz_;						     \
+		    __FP_CLZ(lz_, (_FP_W_TYPE)ur_);			     \
+		    X##_e = _FP_EXPBIAS_##fs + _FP_W_TYPE_SIZE - 1 - lz_;    \
+		  })							     \
+	       : ((rsize <= 2 * _FP_W_TYPE_SIZE)			     \
+		  ? ({							     \
+		       int lz_;						     \
+		       __FP_CLZ_2(lz_, (_FP_W_TYPE)(ur_ >> _FP_W_TYPE_SIZE), \
+				  (_FP_W_TYPE)ur_);			     \
+		       X##_e = (_FP_EXPBIAS_##fs + 2 * _FP_W_TYPE_SIZE - 1   \
+				- lz_);					     \
+		     })							     \
+		  : (abort(), 0)));					     \
+									     \
+	if (rsize - 1 + _FP_EXPBIAS_##fs >= _FP_EXPMAX_##fs		     \
+	    && X##_e >= _FP_EXPMAX_##fs)				     \
+	  {								     \
+	    /* Exponent too big; overflow to infinity.  (May also	     \
+	       happen after rounding below.)  */			     \
+	    _FP_OVERFLOW_SEMIRAW(fs, wc, X);				     \
+	    goto pack_semiraw;						     \
+	  }								     \
+									     \
+	if (rsize <= _FP_FRACBITS_##fs					     \
+	    || X##_e < _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs)		     \
+	  {								     \
+	    /* Exactly representable; shift left.  */			     \
+	    _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize);			     \
+	    _FP_FRAC_SLL_##wc(X, (_FP_EXPBIAS_##fs			     \
+				  + _FP_FRACBITS_##fs - 1 - X##_e));	     \
+	  }								     \
+	else								     \
+	  {								     \
+	    /* More bits in integer than in floating type; need to	     \
+	       round.  */						     \
+	    if (_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 < X##_e)	     \
+	      ur_ = ((ur_ >> (X##_e - _FP_EXPBIAS_##fs			     \
+			      - _FP_WFRACBITS_##fs + 1))		     \
+		     | ((ur_ << (rsize - (X##_e - _FP_EXPBIAS_##fs	     \
+					  - _FP_WFRACBITS_##fs + 1)))	     \
+			!= 0));						     \
+	    _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize);			     \
+	    if ((_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 - X##_e) > 0)     \
+	      _FP_FRAC_SLL_##wc(X, (_FP_EXPBIAS_##fs			     \
+				    + _FP_WFRACBITS_##fs - 1 - X##_e));	     \
+	    _FP_FRAC_HIGH_##fs(X) &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs;	     \
+	  pack_semiraw:							     \
+	    _FP_PACK_SEMIRAW(fs, wc, X);				     \
+	  }								     \
+      }									     \
+    else								     \
+      {									     \
+	X##_s = 0;							     \
+	X##_e = 0;							     \
+	_FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);			     \
+      }									     \
+  } while (0)
+
+
+/* Extend from a narrower floating-point format to a wider one.  Input
+   and output are raw.  */
+#define FP_EXTEND(dfs,sfs,dwc,swc,D,S)					 \
+do {									 \
+  if (_FP_FRACBITS_##dfs < _FP_FRACBITS_##sfs				 \
+      || (_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs				 \
+	  < _FP_EXPMAX_##sfs - _FP_EXPBIAS_##sfs)			 \
+      || (_FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1 \
+	  && _FP_EXPBIAS_##dfs != _FP_EXPBIAS_##sfs))			 \
+    abort();								 \
+  D##_s = S##_s;							 \
+  _FP_FRAC_COPY_##dwc##_##swc(D, S);					 \
+  if (_FP_EXP_NORMAL(sfs, swc, S))					 \
+    {									 \
+      D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs;		 \
+      _FP_FRAC_SLL_##dwc(D, (_FP_FRACBITS_##dfs - _FP_FRACBITS_##sfs));	 \
+    }									 \
+  else									 \
+    {									 \
+      if (S##_e == 0)							 \
+	{								 \
+	  if (_FP_FRAC_ZEROP_##swc(S))					 \
+	    D##_e = 0;							 \
+	  else if (_FP_EXPBIAS_##dfs					 \
+		   < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1)	 \
+	    {								 \
+	      FP_SET_EXCEPTION(FP_EX_DENORM);				 \
+	      _FP_FRAC_SLL_##dwc(D, (_FP_FRACBITS_##dfs			 \
+				     - _FP_FRACBITS_##sfs));		 \
+	      D##_e = 0;						 \
+	    }								 \
+	  else								 \
+	    {								 \
+	      int _lz;							 \
+	      FP_SET_EXCEPTION(FP_EX_DENORM);				 \
+	      _FP_FRAC_CLZ_##swc(_lz, S);				 \
+	      _FP_FRAC_SLL_##dwc(D,					 \
+				 _lz + _FP_FRACBITS_##dfs		 \
+				 - _FP_FRACTBITS_##sfs);		 \
+	      D##_e = (_FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs + 1	 \
+		       + _FP_FRACXBITS_##sfs - _lz);			 \
+	    }								 \
+	}								 \
+      else								 \
+	{								 \
+	  D##_e = _FP_EXPMAX_##dfs;					 \
+	  if (!_FP_FRAC_ZEROP_##swc(S))					 \
+	    {								 \
+	      if (!(_FP_FRAC_HIGH_RAW_##sfs(S) & _FP_QNANBIT_##sfs))	 \
+		FP_SET_EXCEPTION(FP_EX_INVALID);			 \
+	      _FP_FRAC_SLL_##dwc(D, (_FP_FRACBITS_##dfs			 \
+				     - _FP_FRACBITS_##sfs));		 \
+	    }								 \
+	}								 \
+    }									 \
+} while (0)
+
+/* Truncate from a wider floating-point format to a narrower one.
+   Input and output are semi-raw.  */
+#define FP_TRUNC(dfs,sfs,dwc,swc,D,S)					     \
+do {									     \
+  if (_FP_FRACBITS_##sfs < _FP_FRACBITS_##dfs				     \
+      || (_FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1     \
+	  && _FP_EXPBIAS_##sfs != _FP_EXPBIAS_##dfs))			     \
+    abort();								     \
+  D##_s = S##_s;							     \
+  if (_FP_EXP_NORMAL(sfs, swc, S))					     \
+    {									     \
+      D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs;		     \
+      if (D##_e >= _FP_EXPMAX_##dfs)					     \
+	_FP_OVERFLOW_SEMIRAW(dfs, dwc, D);				     \
+      else								     \
+	{								     \
+	  if (D##_e <= 0)						     \
+	    {								     \
+	      if (D##_e < 1 - _FP_FRACBITS_##dfs)			     \
+		{							     \
+		  _FP_FRAC_SET_##swc(S, _FP_ZEROFRAC_##swc);		     \
+		  _FP_FRAC_LOW_##swc(S) |= 1;				     \
+		}							     \
+	      else							     \
+		{							     \
+		  _FP_FRAC_HIGH_##sfs(S) |= _FP_IMPLBIT_SH_##sfs;	     \
+		  _FP_FRAC_SRS_##swc(S, (_FP_WFRACBITS_##sfs		     \
+					 - _FP_WFRACBITS_##dfs + 1 - D##_e), \
+				     _FP_WFRACBITS_##sfs);		     \
+		}							     \
+	      D##_e = 0;						     \
+	    }								     \
+	  else								     \
+	    _FP_FRAC_SRS_##swc(S, (_FP_WFRACBITS_##sfs			     \
+				   - _FP_WFRACBITS_##dfs),		     \
+			       _FP_WFRACBITS_##sfs);			     \
+	  _FP_FRAC_COPY_##dwc##_##swc(D, S);				     \
+	}								     \
+    }									     \
+  else									     \
+    {									     \
+      if (S##_e == 0)							     \
+	{								     \
+	  D##_e = 0;							     \
+	  if (_FP_FRAC_ZEROP_##swc(S))					     \
+	    _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc);			     \
+	  else								     \
+	    {								     \
+	      FP_SET_EXCEPTION(FP_EX_DENORM);				     \
+	      if (_FP_EXPBIAS_##sfs					     \
+		  < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1)		     \
+		{							     \
+		  _FP_FRAC_SRS_##swc(S, (_FP_WFRACBITS_##sfs		     \
+					 - _FP_WFRACBITS_##dfs),	     \
+				     _FP_WFRACBITS_##sfs);		     \
+		  _FP_FRAC_COPY_##dwc##_##swc(D, S);			     \
+		}							     \
+	      else							     \
+		{							     \
+		  _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc);		     \
+		  _FP_FRAC_LOW_##dwc(D) |= 1;				     \
+		}							     \
+	    }								     \
+	}								     \
+      else								     \
+	{								     \
+	  D##_e = _FP_EXPMAX_##dfs;					     \
+	  if (_FP_FRAC_ZEROP_##swc(S))					     \
+	    _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc);			     \
+	  else								     \
+	    {								     \
+	      _FP_CHECK_SIGNAN_SEMIRAW(sfs, swc, S);			     \
+	      _FP_FRAC_SRL_##swc(S, (_FP_WFRACBITS_##sfs		     \
+				     - _FP_WFRACBITS_##dfs));		     \
+	      _FP_FRAC_COPY_##dwc##_##swc(D, S);			     \
+	      /* Semi-raw NaN must have all workbits cleared.  */	     \
+	      _FP_FRAC_LOW_##dwc(D)					     \
+		&= ~(_FP_W_TYPE) ((1 << _FP_WORKBITS) - 1);		     \
+	      _FP_FRAC_HIGH_##dfs(D) |= _FP_QNANBIT_SH_##dfs;		     \
+	    }								     \
+	}								     \
+    }									     \
+} while (0)
+
+/*
+ * Helper primitives.
+ */
+
+/* Count leading zeros in a word.  */
+
+#ifndef __FP_CLZ
+/* GCC 3.4 and later provide the builtins for us.  */
+#define __FP_CLZ(r, x)							      \
+  do {									      \
+    if (sizeof (_FP_W_TYPE) == sizeof (unsigned int))			      \
+      r = __builtin_clz (x);						      \
+    else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long))		      \
+      r = __builtin_clzl (x);						      \
+    else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long long))	      \
+      r = __builtin_clzll (x);						      \
+    else								      \
+      abort ();								      \
+  } while (0)
+#endif /* ndef __FP_CLZ */
+
+#define _FP_DIV_HELP_imm(q, r, n, d)		\
+  do {						\
+    q = n / d, r = n % d;			\
+  } while (0)
+
+
+/* A restoring bit-by-bit division primitive.  */
+
+#define _FP_DIV_MEAT_N_loop(fs, wc, R, X, Y)				\
+  do {									\
+    int count = _FP_WFRACBITS_##fs;					\
+    _FP_FRAC_DECL_##wc (u);						\
+    _FP_FRAC_DECL_##wc (v);						\
+    _FP_FRAC_COPY_##wc (u, X);						\
+    _FP_FRAC_COPY_##wc (v, Y);						\
+    _FP_FRAC_SET_##wc (R, _FP_ZEROFRAC_##wc);				\
+    /* Normalize U and V.  */						\
+    _FP_FRAC_SLL_##wc (u, _FP_WFRACXBITS_##fs);				\
+    _FP_FRAC_SLL_##wc (v, _FP_WFRACXBITS_##fs);				\
+    /* First round.  Since the operands are normalized, either the	\
+       first or second bit will be set in the fraction.  Produce a	\
+       normalized result by checking which and adjusting the loop	\
+       count and exponent accordingly.  */				\
+    if (_FP_FRAC_GE_1 (u, v))						\
+      {									\
+	_FP_FRAC_SUB_##wc (u, u, v);					\
+	_FP_FRAC_LOW_##wc (R) |= 1;					\
+	count--;							\
+      }									\
+    else								\
+      R##_e--;								\
+    /* Subsequent rounds.  */						\
+    do {								\
+      int msb = (_FP_WS_TYPE) _FP_FRAC_HIGH_##wc (u) < 0;		\
+      _FP_FRAC_SLL_##wc (u, 1);						\
+      _FP_FRAC_SLL_##wc (R, 1);						\
+      if (msb || _FP_FRAC_GE_1 (u, v))					\
+	{								\
+	  _FP_FRAC_SUB_##wc (u, u, v);					\
+	  _FP_FRAC_LOW_##wc (R) |= 1;					\
+	}								\
+    } while (--count > 0);						\
+    /* If there's anything left in U, the result is inexact.  */	\
+    _FP_FRAC_LOW_##wc (R) |= !_FP_FRAC_ZEROP_##wc (u);			\
+  } while (0)
+
+#define _FP_DIV_MEAT_1_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 1, R, X, Y)
+#define _FP_DIV_MEAT_2_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 2, R, X, Y)
+#define _FP_DIV_MEAT_4_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 4, R, X, Y)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_add.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_add.c
new file mode 100644
index 0000000..987c725
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_add.c
@@ -0,0 +1,39 @@
+/* Software floating-point emulation.
+   Return a + b
+   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+long double _Q_add(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C);
+  long double c;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_SEMIRAW_Q(A, a);
+  FP_UNPACK_SEMIRAW_Q(B, b);
+  FP_ADD_Q(C, A, B);
+  FP_PACK_SEMIRAW_Q(c, C);
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_cmp.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_cmp.c
new file mode 100644
index 0000000..a93792b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_cmp.c
@@ -0,0 +1,41 @@
+/* Software floating-point emulation.
+   Compare a and b, return float condition code.
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+int _Q_cmp(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B);
+  int r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_UNPACK_RAW_Q(B, b);
+  FP_CMP_Q(r, B, A, 3);
+  if (r == -1) r = 2;
+  if (r == 3 && (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B)))
+    FP_SET_EXCEPTION(FP_EX_INVALID);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_cmpe.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_cmpe.c
new file mode 100644
index 0000000..135d63c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_cmpe.c
@@ -0,0 +1,42 @@
+/* Software floating-point emulation.
+   Compare a and b, return float condition code.
+   Signal exception (unless masked) if unordered.
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+int _Q_cmpe(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B);
+  int r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_UNPACK_RAW_Q(B, b);
+  FP_CMP_Q(r, B, A, 3);
+  if (r == -1) r = 2;
+  if (r == 3)
+    FP_SET_EXCEPTION(FP_EX_INVALID);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_div.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_div.c
new file mode 100644
index 0000000..86db5ed
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_div.c
@@ -0,0 +1,39 @@
+/* Software floating-point emulation.
+   Return a / b
+   Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+long double _Q_div(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C);
+  long double c;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_Q(A, a);
+  FP_UNPACK_Q(B, b);
+  FP_DIV_Q(C, A, B);
+  FP_PACK_Q(c, C);
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_dtoq.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_dtoq.c
new file mode 100644
index 0000000..6b119f4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_dtoq.c
@@ -0,0 +1,44 @@
+/* Software floating-point emulation.
+   Return (long double)(a)
+   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "double.h"
+#include "quad.h"
+
+long double _Q_dtoq(const double a)
+{
+  FP_DECL_EX;
+  FP_DECL_D(A);
+  FP_DECL_Q(C);
+  long double c;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_RAW_D(A, a);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+  FP_EXTEND(Q,D,4,2,C,A);
+#else
+  FP_EXTEND(Q,D,2,1,C,A);
+#endif
+  FP_PACK_RAW_Q(c, C);
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_feq.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_feq.c
new file mode 100644
index 0000000..12cd797
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_feq.c
@@ -0,0 +1,40 @@
+/* Software floating-point emulation.
+   Return 1 if a == b
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+int _Q_feq(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B);
+  int r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_UNPACK_RAW_Q(B, b);
+  FP_CMP_EQ_Q(r, A, B);
+  if (r && (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B)))
+    FP_SET_EXCEPTION(FP_EX_INVALID);
+  FP_HANDLE_EXCEPTIONS;
+
+  return !r;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fge.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fge.c
new file mode 100644
index 0000000..db1fdbe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fge.c
@@ -0,0 +1,40 @@
+/* Software floating-point emulation.
+   Return 1 if a >= b
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+int _Q_fge(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B);
+  int r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_UNPACK_RAW_Q(B, b);
+  FP_CMP_Q(r, B, A, 3);
+  if (r == 3)
+    FP_SET_EXCEPTION(FP_EX_INVALID);
+  FP_HANDLE_EXCEPTIONS;
+
+  return (r <= 0);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fgt.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fgt.c
new file mode 100644
index 0000000..a9f8cd0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fgt.c
@@ -0,0 +1,40 @@
+/* Software floating-point emulation.
+   Return 1 if a > b
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+int _Q_fgt(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B);
+  int r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_UNPACK_RAW_Q(B, b);
+  FP_CMP_Q(r, B, A, 3);
+  if (r == 3)
+    FP_SET_EXCEPTION(FP_EX_INVALID);
+  FP_HANDLE_EXCEPTIONS;
+
+  return (r == -1);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fle.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fle.c
new file mode 100644
index 0000000..a4b97e6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fle.c
@@ -0,0 +1,40 @@
+/* Software floating-point emulation.
+   Return 1 if a <= b
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+int _Q_fle(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B);
+  int r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_UNPACK_RAW_Q(B, b);
+  FP_CMP_Q(r, B, A, -2);
+  if (r == -2)
+    FP_SET_EXCEPTION(FP_EX_INVALID);
+  FP_HANDLE_EXCEPTIONS;
+
+  return (r >= 0);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_flt.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_flt.c
new file mode 100644
index 0000000..3979d65
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_flt.c
@@ -0,0 +1,40 @@
+/* Software floating-point emulation.
+   Return 1 if a < b
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+int _Q_flt(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B);
+  int r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_UNPACK_RAW_Q(B, b);
+  FP_CMP_Q(r, B, A, 3);
+  if (r == 3)
+    FP_SET_EXCEPTION(FP_EX_INVALID);
+  FP_HANDLE_EXCEPTIONS;
+
+  return (r == 1);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fne.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fne.c
new file mode 100644
index 0000000..a38059b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_fne.c
@@ -0,0 +1,40 @@
+/* Software floating-point emulation.
+   Return 1 if a != b
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+int _Q_fne(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B);
+  int r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_UNPACK_RAW_Q(B, b);
+  FP_CMP_EQ_Q(r, A, B);
+  if (r && (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B)))
+    FP_SET_EXCEPTION(FP_EX_INVALID);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_itoq.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_itoq.c
new file mode 100644
index 0000000..b50942f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_itoq.c
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (long double)(a)
+   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+long double _Q_itoq(const int a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(C);
+  int b = a;
+  long double c;
+
+  FP_FROM_INT_Q(C, b, 32, unsigned int);
+  FP_PACK_RAW_Q(c, C);
+  FP_CLEAR_EXCEPTIONS;
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_lltoq.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_lltoq.c
new file mode 100644
index 0000000..f977585
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_lltoq.c
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (long double)a
+   Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+long double _Q_lltoq(const long long a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(C);
+  long double c;
+  long long b = a;
+
+  FP_FROM_INT_Q(C, b, 64, unsigned long long);
+  FP_PACK_RAW_Q(c, C);
+  FP_CLEAR_EXCEPTIONS;
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_mul.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_mul.c
new file mode 100644
index 0000000..61c3a8f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_mul.c
@@ -0,0 +1,39 @@
+/* Software floating-point emulation.
+   Return a * b
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+long double _Q_mul(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C);
+  long double c;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_Q(A, a);
+  FP_UNPACK_Q(B, b);
+  FP_MUL_Q(C, A, B);
+  FP_PACK_Q(c, C);
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_neg.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_neg.c
new file mode 100644
index 0000000..14f39e8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_neg.c
@@ -0,0 +1,47 @@
+/* Software floating-point emulation.
+   Return !a
+   Copyright (C) 1997,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+long double _Q_neg(const long double a)
+{
+  FP_DECL_EX;
+  long double c = a;
+  
+#if (__BYTE_ORDER == __BIG_ENDIAN)
+  ((UWtype *)&c)[0] ^= (((UWtype)1) << (W_TYPE_SIZE - 1));
+#elif (__BYTE_ORDER == __LITTLE_ENDIAN) && (W_TYPE_SIZE == 64)
+  ((UWtype *)&c)[1] ^= (((UWtype)1) << (W_TYPE_SIZE - 1));
+#elif (__BYTE_ORDER == __LITTLE_ENDIAN) && (W_TYPE_SIZE == 32)
+  ((UWtype *)&c)[3] ^= (((UWtype)1) << (W_TYPE_SIZE - 1));
+#else
+  FP_DECL_Q(A); FP_DECL_Q(C);
+
+  FP_UNPACK_Q(A, a);
+  FP_NEG_Q(C, A);
+  FP_PACK_Q(c, C);
+#endif
+  FP_CLEAR_EXCEPTIONS;
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtod.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtod.c
new file mode 100644
index 0000000..82b01ec
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtod.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+   Return (double)a
+   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "double.h"
+#include "quad.h"
+
+double _Q_qtod(const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A);
+  FP_DECL_D(R);
+  double r;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_SEMIRAW_Q(A, a);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+  FP_TRUNC(D,Q,2,4,R,A);
+#else
+  FP_TRUNC(D,Q,1,2,R,A);
+#endif
+  FP_PACK_SEMIRAW_D(r, R);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtoi.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtoi.c
new file mode 100644
index 0000000..270ba9f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtoi.c
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (int)a
+   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 FP_ROUNDMODE FP_RND_ZERO
+#include "soft-fp.h"
+#include "quad.h"
+
+int _Q_qtoi(const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A);
+  unsigned int r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_TO_INT_Q(r, A, 32, 1);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtoll.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtoll.c
new file mode 100644
index 0000000..e0d2901
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtoll.c
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (long long)a
+   Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 FP_ROUNDMODE FP_RND_ZERO
+#include "soft-fp.h"
+#include "quad.h"
+
+long long _Q_qtoll(const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A);
+  unsigned long long r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_TO_INT_Q(r, A, 64, 1);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtos.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtos.c
new file mode 100644
index 0000000..93daa23
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtos.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+   Return (float)a
+   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "single.h"
+#include "quad.h"
+
+float _Q_qtos(const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A);
+  FP_DECL_S(R);
+  float r;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_SEMIRAW_Q(A, a);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+  FP_TRUNC(S,Q,1,4,R,A);
+#else
+  FP_TRUNC(S,Q,1,2,R,A);
+#endif
+  FP_PACK_SEMIRAW_S(r, R);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtou.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtou.c
new file mode 100644
index 0000000..812b4e0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtou.c
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (unsigned int)a
+   Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 FP_ROUNDMODE FP_RND_ZERO
+#include "soft-fp.h"
+#include "quad.h"
+
+unsigned int _Q_qtou(const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A);
+  unsigned int r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_TO_INT_Q(r, A, 32, -1);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtoull.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtoull.c
new file mode 100644
index 0000000..7a88c9f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_qtoull.c
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (unsigned long long)a
+   Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 FP_ROUNDMODE FP_RND_ZERO
+#include "soft-fp.h"
+#include "quad.h"
+
+unsigned long long _Q_qtoull(const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A);
+  unsigned long long r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_TO_INT_Q(r, A, 64, -1);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_sqrt.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_sqrt.c
new file mode 100644
index 0000000..373d02a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_sqrt.c
@@ -0,0 +1,39 @@
+/* Software floating-point emulation.
+   Return sqrtl(a)
+   Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+long double _Q_sqrt(const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(C);
+  long double c;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_Q(A, a);
+  FP_SQRT_Q(C, A);
+  FP_PACK_Q(c, C);
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
+strong_alias (_Q_sqrt, __ieee754_sqrtl);
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_stoq.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_stoq.c
new file mode 100644
index 0000000..714d880
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_stoq.c
@@ -0,0 +1,43 @@
+/* Software floating-point emulation.
+   c = (long double)(a)
+   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "single.h"
+#include "quad.h"
+
+long double _Q_stoq(const float a)
+{
+  FP_DECL_EX;
+  FP_DECL_S(A);
+  FP_DECL_Q(C);
+  long double c;
+
+  FP_UNPACK_RAW_S(A, a);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+  FP_EXTEND(Q,S,4,1,C,A);
+#else
+  FP_EXTEND(Q,S,2,1,C,A);
+#endif
+  FP_PACK_RAW_Q(c, C);
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_sub.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_sub.c
new file mode 100644
index 0000000..8616727
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_sub.c
@@ -0,0 +1,39 @@
+/* Software floating-point emulation.
+   c = a - b
+   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+long double _Q_sub(const long double a, const long double b)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C);
+  long double c;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_SEMIRAW_Q(A, a);
+  FP_UNPACK_SEMIRAW_Q(B, b);
+  FP_SUB_Q(C, A, B);
+  FP_PACK_SEMIRAW_Q(c, C);
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_ulltoq.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_ulltoq.c
new file mode 100644
index 0000000..53c0add
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_ulltoq.c
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   Return (long double)(a)
+   Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+long double _Q_ulltoq(const unsigned long long a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(C);
+  long double c;
+  unsigned long long b = a;
+
+  FP_FROM_INT_Q(C, b, 64, unsigned long long);
+  FP_PACK_RAW_Q(c, C);
+  FP_CLEAR_EXCEPTIONS;
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_util.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_util.c
new file mode 100644
index 0000000..41ecd68
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_util.c
@@ -0,0 +1,57 @@
+/* Software floating-point emulation.
+   Helper routine for _Q_* routines.
+   Simulate exceptions using double arithmetics.
+   Copyright (C) 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+
+unsigned long long ___Q_numbers [] = {
+0x0000000000000000ULL, /* Zero */
+0x0010100000000000ULL, /* Very tiny number */
+0x0010000000000000ULL, /* Minimum normalized number */
+0x7fef000000000000ULL, /* A huge double number */
+};
+
+double ___Q_simulate_exceptions(int exceptions)
+{
+  double d, *p = (double *)___Q_numbers;
+  if (exceptions & FP_EX_INVALID)
+    d = p[0]/p[0];
+  if (exceptions & FP_EX_OVERFLOW)
+    {
+      d = p[3] + p[3];
+      exceptions &= ~FP_EX_INEXACT;
+    }
+  if (exceptions & FP_EX_UNDERFLOW)
+    {
+      if (exceptions & FP_EX_INEXACT)
+        {
+	  d = p[2] * p[2];
+	  exceptions &= ~FP_EX_INEXACT;
+	}
+      else
+	d = p[1] - p[2];
+    }
+  if (exceptions & FP_EX_DIVZERO)
+    d = 1.0/p[0];
+  if (exceptions & FP_EX_INEXACT)
+    d = p[3] - p[2];
+  return d;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_utoq.c b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_utoq.c
new file mode 100644
index 0000000..f902bf8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/q_utoq.c
@@ -0,0 +1,38 @@
+/* Software floating-point emulation.
+   c = (long double)(a)
+   Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 "soft-fp.h"
+#include "quad.h"
+
+long double _Q_utoq(const unsigned int a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(C);
+  long double c;
+  unsigned int b = a;
+
+  FP_FROM_INT_Q(C, b, 32, unsigned int);
+  FP_PACK_RAW_Q(c, C);
+  FP_CLEAR_EXCEPTIONS;
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/quad.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/quad.h
new file mode 100644
index 0000000..c22e944
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/quad.h
@@ -0,0 +1,271 @@
+/* Software floating-point emulation.
+   Definitions for IEEE Quad Precision.
+   Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com),
+		  Jakub Jelinek (jj@ultra.linux.cz),
+		  David S. Miller (davem@redhat.com) and
+		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
+
+   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 into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser 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.)
+
+   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, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#if _FP_W_TYPE_SIZE < 32
+#error "Here's a nickel, kid. Go buy yourself a real computer."
+#endif
+
+#if _FP_W_TYPE_SIZE < 64
+#define _FP_FRACTBITS_Q         (4*_FP_W_TYPE_SIZE)
+#else
+#define _FP_FRACTBITS_Q		(2*_FP_W_TYPE_SIZE)
+#endif
+
+#define _FP_FRACBITS_Q		113
+#define _FP_FRACXBITS_Q		(_FP_FRACTBITS_Q - _FP_FRACBITS_Q)
+#define _FP_WFRACBITS_Q		(_FP_WORKBITS + _FP_FRACBITS_Q)
+#define _FP_WFRACXBITS_Q	(_FP_FRACTBITS_Q - _FP_WFRACBITS_Q)
+#define _FP_EXPBITS_Q		15
+#define _FP_EXPBIAS_Q		16383
+#define _FP_EXPMAX_Q		32767
+
+#define _FP_QNANBIT_Q		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-2) % _FP_W_TYPE_SIZE)
+#define _FP_QNANBIT_SH_Q		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_Q		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-1) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_SH_Q		\
+	((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
+#define _FP_OVERFLOW_Q		\
+	((_FP_W_TYPE)1 << (_FP_WFRACBITS_Q % _FP_W_TYPE_SIZE))
+
+typedef float TFtype __attribute__((mode(TF)));
+
+#if _FP_W_TYPE_SIZE < 64
+
+union _FP_UNION_Q
+{
+   TFtype flt;
+   struct 
+   {
+#if __BYTE_ORDER == __BIG_ENDIAN
+      unsigned sign : 1;
+      unsigned exp : _FP_EXPBITS_Q;
+      unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
+      unsigned long frac2 : _FP_W_TYPE_SIZE;
+      unsigned long frac1 : _FP_W_TYPE_SIZE;
+      unsigned long frac0 : _FP_W_TYPE_SIZE;
+#else
+      unsigned long frac0 : _FP_W_TYPE_SIZE;
+      unsigned long frac1 : _FP_W_TYPE_SIZE;
+      unsigned long frac2 : _FP_W_TYPE_SIZE;
+      unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
+      unsigned exp : _FP_EXPBITS_Q;
+      unsigned sign : 1;
+#endif /* not bigendian */
+   } bits __attribute__((packed));
+};
+
+
+#define FP_DECL_Q(X)		_FP_DECL(4,X)
+#define FP_UNPACK_RAW_Q(X,val)	_FP_UNPACK_RAW_4(Q,X,val)
+#define FP_UNPACK_RAW_QP(X,val)	_FP_UNPACK_RAW_4_P(Q,X,val)
+#define FP_PACK_RAW_Q(val,X)	_FP_PACK_RAW_4(Q,val,X)
+#define FP_PACK_RAW_QP(val,X)		\
+  do {					\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_4_P(Q,val,X);	\
+  } while (0)
+
+#define FP_UNPACK_Q(X,val)		\
+  do {					\
+    _FP_UNPACK_RAW_4(Q,X,val);		\
+    _FP_UNPACK_CANONICAL(Q,4,X);	\
+  } while (0)
+
+#define FP_UNPACK_QP(X,val)		\
+  do {					\
+    _FP_UNPACK_RAW_4_P(Q,X,val);	\
+    _FP_UNPACK_CANONICAL(Q,4,X);	\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_Q(X,val)	\
+  do {					\
+    _FP_UNPACK_RAW_4(Q,X,val);		\
+    _FP_UNPACK_SEMIRAW(Q,4,X);		\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_QP(X,val)	\
+  do {					\
+    _FP_UNPACK_RAW_4_P(Q,X,val);	\
+    _FP_UNPACK_SEMIRAW(Q,4,X);		\
+  } while (0)
+
+#define FP_PACK_Q(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(Q,4,X);		\
+    _FP_PACK_RAW_4(Q,val,X);		\
+  } while (0)
+
+#define FP_PACK_QP(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(Q,4,X);		\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_4_P(Q,val,X);	\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_Q(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(Q,4,X);		\
+    _FP_PACK_RAW_4(Q,val,X);		\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_QP(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(Q,4,X);		\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_4_P(Q,val,X);	\
+  } while (0)
+
+#define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN(Q,4,X)
+#define FP_NEG_Q(R,X)			_FP_NEG(Q,4,R,X)
+#define FP_ADD_Q(R,X,Y)			_FP_ADD(Q,4,R,X,Y)
+#define FP_SUB_Q(R,X,Y)			_FP_SUB(Q,4,R,X,Y)
+#define FP_MUL_Q(R,X,Y)			_FP_MUL(Q,4,R,X,Y)
+#define FP_DIV_Q(R,X,Y)			_FP_DIV(Q,4,R,X,Y)
+#define FP_SQRT_Q(R,X)			_FP_SQRT(Q,4,R,X)
+#define _FP_SQRT_MEAT_Q(R,S,T,X,Q)	_FP_SQRT_MEAT_4(R,S,T,X,Q)
+
+#define FP_CMP_Q(r,X,Y,un)	_FP_CMP(Q,4,r,X,Y,un)
+#define FP_CMP_EQ_Q(r,X,Y)	_FP_CMP_EQ(Q,4,r,X,Y)
+#define FP_CMP_UNORD_Q(r,X,Y)	_FP_CMP_UNORD(Q,4,r,X,Y)
+
+#define FP_TO_INT_Q(r,X,rsz,rsg)	_FP_TO_INT(Q,4,r,X,rsz,rsg)
+#define FP_FROM_INT_Q(X,r,rs,rt)	_FP_FROM_INT(Q,4,X,r,rs,rt)
+
+#define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_4(X)
+#define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_4(X)
+
+#else   /* not _FP_W_TYPE_SIZE < 64 */
+union _FP_UNION_Q
+{
+  TFtype flt /* __attribute__((mode(TF))) */ ;
+  struct {
+    _FP_W_TYPE a, b;
+  } longs;
+  struct {
+#if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned sign    : 1;
+    unsigned exp     : _FP_EXPBITS_Q;
+    _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
+    _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
+#else
+    _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
+    _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
+    unsigned exp     : _FP_EXPBITS_Q;
+    unsigned sign    : 1;
+#endif
+  } bits;
+};
+
+#define FP_DECL_Q(X)		_FP_DECL(2,X)
+#define FP_UNPACK_RAW_Q(X,val)	_FP_UNPACK_RAW_2(Q,X,val)
+#define FP_UNPACK_RAW_QP(X,val)	_FP_UNPACK_RAW_2_P(Q,X,val)
+#define FP_PACK_RAW_Q(val,X)	_FP_PACK_RAW_2(Q,val,X)
+#define FP_PACK_RAW_QP(val,X)		\
+  do {					\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_2_P(Q,val,X);	\
+  } while (0)
+
+#define FP_UNPACK_Q(X,val)		\
+  do {					\
+    _FP_UNPACK_RAW_2(Q,X,val);		\
+    _FP_UNPACK_CANONICAL(Q,2,X);	\
+  } while (0)
+
+#define FP_UNPACK_QP(X,val)		\
+  do {					\
+    _FP_UNPACK_RAW_2_P(Q,X,val);	\
+    _FP_UNPACK_CANONICAL(Q,2,X);	\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_Q(X,val)	\
+  do {					\
+    _FP_UNPACK_RAW_2(Q,X,val);		\
+    _FP_UNPACK_SEMIRAW(Q,2,X);		\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_QP(X,val)	\
+  do {					\
+    _FP_UNPACK_RAW_2_P(Q,X,val);	\
+    _FP_UNPACK_SEMIRAW(Q,2,X);		\
+  } while (0)
+
+#define FP_PACK_Q(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(Q,2,X);		\
+    _FP_PACK_RAW_2(Q,val,X);		\
+  } while (0)
+
+#define FP_PACK_QP(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(Q,2,X);		\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_2_P(Q,val,X);	\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_Q(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(Q,2,X);		\
+    _FP_PACK_RAW_2(Q,val,X);		\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_QP(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(Q,2,X);		\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_2_P(Q,val,X);	\
+  } while (0)
+
+#define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN(Q,2,X)
+#define FP_NEG_Q(R,X)			_FP_NEG(Q,2,R,X)
+#define FP_ADD_Q(R,X,Y)			_FP_ADD(Q,2,R,X,Y)
+#define FP_SUB_Q(R,X,Y)			_FP_SUB(Q,2,R,X,Y)
+#define FP_MUL_Q(R,X,Y)			_FP_MUL(Q,2,R,X,Y)
+#define FP_DIV_Q(R,X,Y)			_FP_DIV(Q,2,R,X,Y)
+#define FP_SQRT_Q(R,X)			_FP_SQRT(Q,2,R,X)
+#define _FP_SQRT_MEAT_Q(R,S,T,X,Q)	_FP_SQRT_MEAT_2(R,S,T,X,Q)
+
+#define FP_CMP_Q(r,X,Y,un)	_FP_CMP(Q,2,r,X,Y,un)
+#define FP_CMP_EQ_Q(r,X,Y)	_FP_CMP_EQ(Q,2,r,X,Y)
+#define FP_CMP_UNORD_Q(r,X,Y)	_FP_CMP_UNORD(Q,2,r,X,Y)
+
+#define FP_TO_INT_Q(r,X,rsz,rsg)	_FP_TO_INT(Q,2,r,X,rsz,rsg)
+#define FP_FROM_INT_Q(X,r,rs,rt)	_FP_FROM_INT(Q,2,X,r,rs,rt)
+
+#define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_2(X)
+#define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_2(X)
+
+#endif /* not _FP_W_TYPE_SIZE < 64 */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/sfp-machine.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/sfp-machine.h
new file mode 100644
index 0000000..ecf9506
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/sfp-machine.h
@@ -0,0 +1,215 @@
+/* Machine-dependent software floating-point definitions.
+   Sparc userland (_Q_*) version.
+   Copyright (C) 1997,1998,1999, 2002, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com),
+		  Jakub Jelinek (jj@ultra.linux.cz) and
+		  David S. Miller (davem@redhat.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.  */
+
+#include <fpu_control.h>
+#include <stdlib.h>
+
+#define _FP_W_TYPE_SIZE		32
+#define _FP_W_TYPE		unsigned long
+#define _FP_WS_TYPE		signed long
+#define _FP_I_TYPE		long
+
+#define _FP_MUL_MEAT_S(R,X,Y)				\
+  _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_D(R,X,Y)				\
+  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y)				\
+  _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv(S,R,X,Y)
+#define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S		((_FP_QNANBIT_S << 1) - 1)
+#define _FP_NANFRAC_D		((_FP_QNANBIT_D << 1) - 1), -1
+#define _FP_NANFRAC_Q		((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
+#define _FP_NANSIGN_S		0
+#define _FP_NANSIGN_D		0
+#define _FP_NANSIGN_Q		0
+
+#define _FP_KEEPNANFRACP 1
+
+/* If one NaN is signaling and the other is not,
+ * we choose that one, otherwise we choose X.
+ */
+/* For _Qp_* and _Q_*, this should prefer X, for
+ * CPU instruction emulation this should prefer Y.
+ * (see SPAMv9 B.2.2 section).
+ */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
+  do {								\
+    if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)		\
+	&& !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs))	\
+      {								\
+	R##_s = Y##_s;						\
+	_FP_FRAC_COPY_##wc(R,Y);				\
+      }								\
+    else							\
+      {								\
+	R##_s = X##_s;						\
+	_FP_FRAC_COPY_##wc(R,X);				\
+      }								\
+    R##_c = FP_CLS_NAN;						\
+  } while (0)
+
+/* Some assembly to speed things up. */
+#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0)			\
+  __asm__ ("addcc %r7,%8,%2\n\
+	    addxcc %r5,%6,%1\n\
+	    addx %r3,%4,%0"						\
+	   : "=r" ((USItype)(r2)),					\
+	     "=&r" ((USItype)(r1)),					\
+	     "=&r" ((USItype)(r0))					\
+	   : "%rJ" ((USItype)(x2)),					\
+	     "rI" ((USItype)(y2)),					\
+	     "%rJ" ((USItype)(x1)),					\
+	     "rI" ((USItype)(y1)),					\
+	     "%rJ" ((USItype)(x0)),					\
+	     "rI" ((USItype)(y0))					\
+	   : "cc")
+
+#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0)			\
+  __asm__ ("subcc %r7,%8,%2\n\
+	    subxcc %r5,%6,%1\n\
+	    subx %r3,%4,%0"						\
+	   : "=r" ((USItype)(r2)),					\
+	     "=&r" ((USItype)(r1)),					\
+	     "=&r" ((USItype)(r0))					\
+	   : "%rJ" ((USItype)(x2)),					\
+	     "rI" ((USItype)(y2)),					\
+	     "%rJ" ((USItype)(x1)),					\
+	     "rI" ((USItype)(y1)),					\
+	     "%rJ" ((USItype)(x0)),					\
+	     "rI" ((USItype)(y0))					\
+	   : "cc")
+
+#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)		\
+  do {									\
+    /* We need to fool gcc,  as we need to pass more than 10		\
+       input/outputs.  */						\
+    register USItype _t1 __asm__ ("g1"), _t2 __asm__ ("g2");		\
+    __asm__ __volatile__ ("\
+	    addcc %r8,%9,%1\n\
+	    addxcc %r6,%7,%0\n\
+	    addxcc %r4,%5,%%g2\n\
+	    addx %r2,%3,%%g1"						\
+	   : "=&r" ((USItype)(r1)),					\
+	     "=&r" ((USItype)(r0))					\
+	   : "%rJ" ((USItype)(x3)),					\
+	     "rI" ((USItype)(y3)),					\
+	     "%rJ" ((USItype)(x2)),					\
+	     "rI" ((USItype)(y2)),					\
+	     "%rJ" ((USItype)(x1)),					\
+	     "rI" ((USItype)(y1)),					\
+	     "%rJ" ((USItype)(x0)),					\
+	     "rI" ((USItype)(y0))					\
+	   : "cc", "g1", "g2");						\
+    __asm__ __volatile__ ("" : "=r" (_t1), "=r" (_t2));			\
+    r3 = _t1; r2 = _t2;							\
+  } while (0)
+
+#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)		\
+  do {									\
+    /* We need to fool gcc,  as we need to pass more than 10		\
+       input/outputs.  */						\
+    register USItype _t1 __asm__ ("g1"), _t2 __asm__ ("g2");		\
+    __asm__ __volatile__ ("\
+	    subcc %r8,%9,%1\n\
+	    subxcc %r6,%7,%0\n\
+	    subxcc %r4,%5,%%g2\n\
+	    subx %r2,%3,%%g1"						\
+	   : "=&r" ((USItype)(r1)),					\
+	     "=&r" ((USItype)(r0))					\
+	   : "%rJ" ((USItype)(x3)),					\
+	     "rI" ((USItype)(y3)),					\
+	     "%rJ" ((USItype)(x2)),					\
+	     "rI" ((USItype)(y2)),					\
+	     "%rJ" ((USItype)(x1)),					\
+	     "rI" ((USItype)(y1)),					\
+	     "%rJ" ((USItype)(x0)),					\
+	     "rI" ((USItype)(y0))					\
+	   : "cc", "g1", "g2");						\
+    __asm__ __volatile__ ("" : "=r" (_t1), "=r" (_t2));			\
+    r3 = _t1; r2 = _t2;							\
+  } while (0)
+
+#define __FP_FRAC_DEC_3(x2,x1,x0,y2,y1,y0) __FP_FRAC_SUB_3(x2,x1,x0,x2,x1,x0,y2,y1,y0)
+
+#define __FP_FRAC_DEC_4(x3,x2,x1,x0,y3,y2,y1,y0) __FP_FRAC_SUB_4(x3,x2,x1,x0,x3,x2,x1,x0,y3,y2,y1,y0)
+
+#define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i)					\
+  __asm__ ("addcc %3,%4,%3\n\
+	    addxcc %2,%%g0,%2\n\
+	    addxcc %1,%%g0,%1\n\
+	    addx %0,%%g0,%0"						\
+	   : "=&r" ((USItype)(x3)),					\
+	     "=&r" ((USItype)(x2)),					\
+	     "=&r" ((USItype)(x1)),					\
+	     "=&r" ((USItype)(x0))					\
+	   : "rI" ((USItype)(i)),					\
+	     "0" ((USItype)(x3)),					\
+	     "1" ((USItype)(x2)),					\
+	     "2" ((USItype)(x1)),					\
+	     "3" ((USItype)(x0))					\
+	   : "cc")
+
+/* Obtain the current rounding mode. */
+#ifndef FP_ROUNDMODE
+#define FP_ROUNDMODE	((_fcw >> 30) & 0x3)
+#endif
+
+/* Exception flags. */
+#define FP_EX_INVALID		(1 << 4)
+#define FP_EX_OVERFLOW		(1 << 3)
+#define FP_EX_UNDERFLOW		(1 << 2)
+#define FP_EX_DIVZERO		(1 << 1)
+#define FP_EX_INEXACT		(1 << 0)
+
+#define _FP_DECL_EX	fpu_control_t _fcw
+
+#ifdef __UCLIBC_HAS_FPU__
+#define FP_INIT_ROUNDMODE					\
+do {								\
+  _FPU_GETCW(_fcw);						\
+} while (0)
+
+/* Simulate exceptions using double arithmetics. */
+extern double ___Q_simulate_exceptions(int exc);
+
+#define FP_HANDLE_EXCEPTIONS					\
+do {								\
+  if (!_fex)							\
+    {								\
+      /* This is the common case, so we do it inline.		\
+       * We need to clear cexc bits if any.			\
+       */							\
+      extern unsigned long long ___Q_numbers[];			\
+      __asm__ __volatile__("\
+      	ldd [%0], %%f30\n\
+      	faddd %%f30, %%f30, %%f30\
+      	" : : "r" (___Q_numbers) : "f30");			\
+    }								\
+  else								\
+    ___Q_simulate_exceptions (_fex);			        \
+} while (0)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/single.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/single.h
new file mode 100644
index 0000000..9c3734a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/single.h
@@ -0,0 +1,151 @@
+/* Software floating-point emulation.
+   Definitions for IEEE Single Precision.
+   Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com),
+		  Jakub Jelinek (jj@ultra.linux.cz),
+		  David S. Miller (davem@redhat.com) and
+		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
+
+   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 into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser 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.)
+
+   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, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#if _FP_W_TYPE_SIZE < 32
+#error "Here's a nickel kid.  Go buy yourself a real computer."
+#endif
+
+#define _FP_FRACTBITS_S		_FP_W_TYPE_SIZE
+
+#define _FP_FRACBITS_S		24
+#define _FP_FRACXBITS_S		(_FP_FRACTBITS_S - _FP_FRACBITS_S)
+#define _FP_WFRACBITS_S		(_FP_WORKBITS + _FP_FRACBITS_S)
+#define _FP_WFRACXBITS_S	(_FP_FRACTBITS_S - _FP_WFRACBITS_S)
+#define _FP_EXPBITS_S		8
+#define _FP_EXPBIAS_S		127
+#define _FP_EXPMAX_S		255
+#define _FP_QNANBIT_S		((_FP_W_TYPE)1 << (_FP_FRACBITS_S-2))
+#define _FP_QNANBIT_SH_S	((_FP_W_TYPE)1 << (_FP_FRACBITS_S-2+_FP_WORKBITS))
+#define _FP_IMPLBIT_S		((_FP_W_TYPE)1 << (_FP_FRACBITS_S-1))
+#define _FP_IMPLBIT_SH_S	((_FP_W_TYPE)1 << (_FP_FRACBITS_S-1+_FP_WORKBITS))
+#define _FP_OVERFLOW_S		((_FP_W_TYPE)1 << (_FP_WFRACBITS_S))
+
+/* The implementation of _FP_MUL_MEAT_S and _FP_DIV_MEAT_S should be
+   chosen by the target machine.  */
+
+typedef float SFtype __attribute__((mode(SF)));
+
+union _FP_UNION_S
+{
+  SFtype flt;
+  struct {
+#if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned sign : 1;
+    unsigned exp  : _FP_EXPBITS_S;
+    unsigned frac : _FP_FRACBITS_S - (_FP_IMPLBIT_S != 0);
+#else
+    unsigned frac : _FP_FRACBITS_S - (_FP_IMPLBIT_S != 0);
+    unsigned exp  : _FP_EXPBITS_S;
+    unsigned sign : 1;
+#endif
+  } bits __attribute__((packed));
+};
+
+#define FP_DECL_S(X)		_FP_DECL(1,X)
+#define FP_UNPACK_RAW_S(X,val)	_FP_UNPACK_RAW_1(S,X,val)
+#define FP_UNPACK_RAW_SP(X,val)	_FP_UNPACK_RAW_1_P(S,X,val)
+#define FP_PACK_RAW_S(val,X)	_FP_PACK_RAW_1(S,val,X)
+#define FP_PACK_RAW_SP(val,X)		\
+  do {					\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_1_P(S,val,X);	\
+  } while (0)
+
+#define FP_UNPACK_S(X,val)		\
+  do {					\
+    _FP_UNPACK_RAW_1(S,X,val);		\
+    _FP_UNPACK_CANONICAL(S,1,X);	\
+  } while (0)
+
+#define FP_UNPACK_SP(X,val)		\
+  do {					\
+    _FP_UNPACK_RAW_1_P(S,X,val);	\
+    _FP_UNPACK_CANONICAL(S,1,X);	\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_S(X,val)	\
+  do {					\
+    _FP_UNPACK_RAW_1(S,X,val);		\
+    _FP_UNPACK_SEMIRAW(S,1,X);		\
+  } while (0)
+
+#define FP_UNPACK_SEMIRAW_SP(X,val)	\
+  do {					\
+    _FP_UNPACK_RAW_1_P(S,X,val);	\
+    _FP_UNPACK_SEMIRAW(S,1,X);		\
+  } while (0)
+
+#define FP_PACK_S(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(S,1,X);		\
+    _FP_PACK_RAW_1(S,val,X);		\
+  } while (0)
+
+#define FP_PACK_SP(val,X)		\
+  do {					\
+    _FP_PACK_CANONICAL(S,1,X);		\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_1_P(S,val,X);	\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_S(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(S,1,X);		\
+    _FP_PACK_RAW_1(S,val,X);		\
+  } while (0)
+
+#define FP_PACK_SEMIRAW_SP(val,X)	\
+  do {					\
+    _FP_PACK_SEMIRAW(S,1,X);		\
+    if (!FP_INHIBIT_RESULTS)		\
+      _FP_PACK_RAW_1_P(S,val,X);	\
+  } while (0)
+
+#define FP_ISSIGNAN_S(X)		_FP_ISSIGNAN(S,1,X)
+#define FP_NEG_S(R,X)			_FP_NEG(S,1,R,X)
+#define FP_ADD_S(R,X,Y)			_FP_ADD(S,1,R,X,Y)
+#define FP_SUB_S(R,X,Y)			_FP_SUB(S,1,R,X,Y)
+#define FP_MUL_S(R,X,Y)			_FP_MUL(S,1,R,X,Y)
+#define FP_DIV_S(R,X,Y)			_FP_DIV(S,1,R,X,Y)
+#define FP_SQRT_S(R,X)			_FP_SQRT(S,1,R,X)
+#define _FP_SQRT_MEAT_S(R,S,T,X,Q)	_FP_SQRT_MEAT_1(R,S,T,X,Q)
+
+#define FP_CMP_S(r,X,Y,un)	_FP_CMP(S,1,r,X,Y,un)
+#define FP_CMP_EQ_S(r,X,Y)	_FP_CMP_EQ(S,1,r,X,Y)
+#define FP_CMP_UNORD_S(r,X,Y)	_FP_CMP_UNORD(S,1,r,X,Y)
+
+#define FP_TO_INT_S(r,X,rsz,rsg)	_FP_TO_INT(S,1,r,X,rsz,rsg)
+#define FP_FROM_INT_S(X,r,rs,rt)	_FP_FROM_INT(S,1,X,r,rs,rt)
+
+#define _FP_FRAC_HIGH_S(X)	_FP_FRAC_HIGH_1(X)
+#define _FP_FRAC_HIGH_RAW_S(X)	_FP_FRAC_HIGH_1(X)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/soft-fp.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/soft-fp.h
new file mode 100644
index 0000000..40f0dbd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/soft-fp/soft-fp.h
@@ -0,0 +1,205 @@
+/* Software floating-point emulation.
+   Copyright (C) 1997,1998,1999,2000,2002,2003,2005,2006,2007
+	Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com),
+		  Jakub Jelinek (jj@ultra.linux.cz),
+		  David S. Miller (davem@redhat.com) and
+		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
+
+   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 into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser 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.)
+
+   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, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#ifndef SOFT_FP_H
+#define SOFT_FP_H
+
+#include "sfp-machine.h"
+
+/* Allow sfp-machine to have its own byte order definitions. */
+#ifndef __BYTE_ORDER
+#ifdef _LIBC
+#include <endian.h>
+#else
+#error "endianness not defined by sfp-machine.h"
+#endif
+#endif
+
+#define _FP_WORKBITS		3
+#define _FP_WORK_LSB		((_FP_W_TYPE)1 << 3)
+#define _FP_WORK_ROUND		((_FP_W_TYPE)1 << 2)
+#define _FP_WORK_GUARD		((_FP_W_TYPE)1 << 1)
+#define _FP_WORK_STICKY		((_FP_W_TYPE)1 << 0)
+
+#ifndef FP_RND_NEAREST
+# define FP_RND_NEAREST		0
+# define FP_RND_ZERO		1
+# define FP_RND_PINF		2
+# define FP_RND_MINF		3
+#endif
+#ifndef FP_ROUNDMODE
+# define FP_ROUNDMODE		FP_RND_NEAREST
+#endif
+
+/* By default don't care about exceptions. */
+#ifndef FP_EX_INVALID
+#define FP_EX_INVALID		0
+#endif
+#ifndef FP_EX_OVERFLOW
+#define FP_EX_OVERFLOW		0
+#endif
+#ifndef FP_EX_UNDERFLOW
+#define FP_EX_UNDERFLOW		0
+#endif
+#ifndef FP_EX_DIVZERO
+#define FP_EX_DIVZERO		0
+#endif
+#ifndef FP_EX_INEXACT
+#define FP_EX_INEXACT		0
+#endif
+#ifndef FP_EX_DENORM
+#define FP_EX_DENORM		0
+#endif
+
+#ifdef _FP_DECL_EX
+#define FP_DECL_EX					\
+  int _fex = 0;						\
+  _FP_DECL_EX
+#else
+#define FP_DECL_EX int _fex = 0
+#endif
+
+#ifndef FP_INIT_ROUNDMODE
+#define FP_INIT_ROUNDMODE do {} while (0)
+#endif
+
+#ifndef FP_HANDLE_EXCEPTIONS
+#define FP_HANDLE_EXCEPTIONS do {} while (0)
+#endif
+
+#ifndef FP_INHIBIT_RESULTS
+/* By default we write the results always.
+ * sfp-machine may override this and e.g.
+ * check if some exceptions are unmasked
+ * and inhibit it in such a case.
+ */
+#define FP_INHIBIT_RESULTS 0
+#endif
+
+#define FP_SET_EXCEPTION(ex)				\
+  _fex |= (ex)
+
+#define FP_UNSET_EXCEPTION(ex)				\
+  _fex &= ~(ex)
+
+#define FP_CLEAR_EXCEPTIONS				\
+  _fex = 0
+
+#define _FP_ROUND_NEAREST(wc, X)			\
+do {							\
+    if ((_FP_FRAC_LOW_##wc(X) & 15) != _FP_WORK_ROUND)	\
+      _FP_FRAC_ADDI_##wc(X, _FP_WORK_ROUND);		\
+} while (0)
+
+#define _FP_ROUND_ZERO(wc, X)		(void)0
+
+#define _FP_ROUND_PINF(wc, X)				\
+do {							\
+    if (!X##_s && (_FP_FRAC_LOW_##wc(X) & 7))		\
+      _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB);		\
+} while (0)
+
+#define _FP_ROUND_MINF(wc, X)				\
+do {							\
+    if (X##_s && (_FP_FRAC_LOW_##wc(X) & 7))		\
+      _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB);		\
+} while (0)
+
+#define _FP_ROUND(wc, X)			\
+do {						\
+	if (_FP_FRAC_LOW_##wc(X) & 7)		\
+	  FP_SET_EXCEPTION(FP_EX_INEXACT);	\
+	switch (FP_ROUNDMODE)			\
+	{					\
+	  case FP_RND_NEAREST:			\
+	    _FP_ROUND_NEAREST(wc,X);		\
+	    break;				\
+	  case FP_RND_ZERO:			\
+	    _FP_ROUND_ZERO(wc,X);		\
+	    break;				\
+	  case FP_RND_PINF:			\
+	    _FP_ROUND_PINF(wc,X);		\
+	    break;				\
+	  case FP_RND_MINF:			\
+	    _FP_ROUND_MINF(wc,X);		\
+	    break;				\
+	}					\
+} while (0)
+
+#define FP_CLS_NORMAL		0
+#define FP_CLS_ZERO		1
+#define FP_CLS_INF		2
+#define FP_CLS_NAN		3
+
+#define _FP_CLS_COMBINE(x,y)	(((x) << 2) | (y))
+
+#include "op-1.h"
+#include "op-2.h"
+#include "op-4.h"
+#include "op-8.h"
+#include "op-common.h"
+
+/* Sigh.  Silly things longlong.h needs.  */
+#define UWtype		_FP_W_TYPE
+#define W_TYPE_SIZE	_FP_W_TYPE_SIZE
+
+typedef int QItype __attribute__((mode(QI)));
+typedef int SItype __attribute__((mode(SI)));
+typedef int DItype __attribute__((mode(DI)));
+typedef unsigned int UQItype __attribute__((mode(QI)));
+typedef unsigned int USItype __attribute__((mode(SI)));
+typedef unsigned int UDItype __attribute__((mode(DI)));
+#if _FP_W_TYPE_SIZE == 32
+typedef unsigned int UHWtype __attribute__((mode(HI)));
+#elif _FP_W_TYPE_SIZE == 64
+typedef USItype UHWtype;
+#endif
+
+#ifndef CMPtype
+#define CMPtype		int
+#endif
+
+#define SI_BITS		(__CHAR_BIT__ * (int)sizeof(SItype))
+#define DI_BITS		(__CHAR_BIT__ * (int)sizeof(DItype))
+
+#ifndef umul_ppmm
+#include "longlong.h"
+#endif
+
+#ifdef _LIBC
+#include <stdlib.h>
+#else
+extern void abort (void);
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/rem.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/rem.S
new file mode 100644
index 0000000..ce06e63
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/rem.S
@@ -0,0 +1,360 @@
+   /* This file is generated from divrem.m4; DO NOT EDIT! */
+/*
+ * Division and remainder, from Appendix E of the Sparc Version 8
+ * Architecture Manual, with fixes from Gordon Irlam.
+ */
+
+/*
+ * Input: dividend and divisor in %o0 and %o1 respectively.
+ *
+ * m4 parameters:
+ *  .rem	name of function to generate
+ *  rem		rem=div => %o0 / %o1; rem=rem => %o0 % %o1
+ *  true		true=true => signed; true=false => unsigned
+ *
+ * Algorithm parameters:
+ *  N		how many bits per iteration we try to get (4)
+ *  WORDSIZE	total number of bits (32)
+ *
+ * Derived constants:
+ *  TOPBITS	number of bits in the top decade of a number
+ *
+ * Important variables:
+ *  Q		the partial quotient under development (initially 0)
+ *  R		the remainder so far, initially the dividend
+ *  ITER	number of main division loop iterations required;
+ *		equal to ceil(log2(quotient) / N).  Note that this
+ *		is the log base (2^N) of the quotient.
+ *  V		the current comparand, initially divisor*2^(ITER*N-1)
+ *
+ * Cost:
+ *  Current estimate for non-large dividend is
+ *	ceil(log2(quotient) / N) * (10 + 7N/2) + C
+ *  A large dividend is one greater than 2^(31-TOPBITS) and takes a
+ *  different path, as the upper bits of the quotient must be developed
+ *  one bit at a time.
+ */
+
+
+
+ENTRY(.rem)
+	! compute sign of result; if neither is negative, no problem
+	orcc	%o1, %o0, %g0	! either negative?
+	bge	2f			! no, go do the divide
+	mov	%o0, %g3		! sign of remainder matches %o0
+	tst	%o1
+	bge	1f
+	tst	%o0
+	! %o1 is definitely negative; %o0 might also be negative
+	bge	2f			! if %o0 not negative...
+	sub	%g0, %o1, %o1	! in any case, make %o1 nonneg
+1:	! %o0 is negative, %o1 is nonnegative
+	sub	%g0, %o0, %o0	! make %o0 nonnegative
+2:
+
+	! Ready to divide.  Compute size of quotient; scale comparand.
+	orcc	%o1, %g0, %o5
+	bne	1f
+	mov	%o0, %o3
+
+		! Divide by zero trap.  If it returns, return 0 (about as
+		! wrong as possible, but that is what SunOS does...).
+		ta	ST_DIV0
+		retl
+		clr	%o0
+
+1:
+	cmp	%o3, %o5			! if %o1 exceeds %o0, done
+	blu	LOC(got_result)		! (and algorithm fails otherwise)
+	clr	%o2
+	sethi	%hi(1 << (32 - 4 - 1)), %g1
+	cmp	%o3, %g1
+	blu	LOC(not_really_big)
+	clr	%o4
+
+	! Here the dividend is >= 2**(31-N) or so.  We must be careful here,
+	! as our usual N-at-a-shot divide step will cause overflow and havoc.
+	! The number of bits in the result here is N*ITER+SC, where SC <= N.
+	! Compute ITER in an unorthodox manner: know we need to shift V into
+	! the top decade: so do not even bother to compare to R.
+	1:
+		cmp	%o5, %g1
+		bgeu	3f
+		mov	1, %g2
+		sll	%o5, 4, %o5
+		b	1b
+		add	%o4, 1, %o4
+
+	! Now compute %g2.
+	2:	addcc	%o5, %o5, %o5
+		bcc	LOC(not_too_big)
+		add	%g2, 1, %g2
+
+		! We get here if the %o1 overflowed while shifting.
+		! This means that %o3 has the high-order bit set.
+		! Restore %o5 and subtract from %o3.
+		sll	%g1, 4, %g1	! high order bit
+		srl	%o5, 1, %o5		! rest of %o5
+		add	%o5, %g1, %o5
+		b	LOC(do_single_div)
+		sub	%g2, 1, %g2
+
+	LOC(not_too_big):
+	3:	cmp	%o5, %o3
+		blu	2b
+		nop
+		be	LOC(do_single_div)
+		nop
+	/* NB: these are commented out in the V8-Sparc manual as well */
+	/* (I do not understand this) */
+	! %o5 > %o3: went too far: back up 1 step
+	!	srl	%o5, 1, %o5
+	!	dec	%g2
+	! do single-bit divide steps
+	!
+	! We have to be careful here.  We know that %o3 >= %o5, so we can do the
+	! first divide step without thinking.  BUT, the others are conditional,
+	! and are only done if %o3 >= 0.  Because both %o3 and %o5 may have the high-
+	! order bit set in the first step, just falling into the regular
+	! division loop will mess up the first time around.
+	! So we unroll slightly...
+	LOC(do_single_div):
+		subcc	%g2, 1, %g2
+		bl	LOC(end_regular_divide)
+		nop
+		sub	%o3, %o5, %o3
+		mov	1, %o2
+		b	LOC(end_single_divloop)
+		nop
+	LOC(single_divloop):
+		sll	%o2, 1, %o2
+		bl	1f
+		srl	%o5, 1, %o5
+		! %o3 >= 0
+		sub	%o3, %o5, %o3
+		b	2f
+		add	%o2, 1, %o2
+	1:	! %o3 < 0
+		add	%o3, %o5, %o3
+		sub	%o2, 1, %o2
+	2:
+	LOC(end_single_divloop):
+		subcc	%g2, 1, %g2
+		bge	LOC(single_divloop)
+		tst	%o3
+		b,a	LOC(end_regular_divide)
+
+LOC(not_really_big):
+1:
+	sll	%o5, 4, %o5
+	cmp	%o5, %o3
+	bleu	1b
+	addcc	%o4, 1, %o4
+	be	LOC(got_result)
+	sub	%o4, 1, %o4
+
+	tst	%o3	! set up for initial iteration
+LOC(divloop):
+	sll	%o2, 4, %o2
+		! depth 1, accumulated bits 0
+	bl	LOC(1.16)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 2, accumulated bits 1
+	bl	LOC(2.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 3, accumulated bits 3
+	bl	LOC(3.19)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 7
+	bl	LOC(4.23)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (7*2+1), %o2
+	
+LOC(4.23):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (7*2-1), %o2
+	
+	
+LOC(3.19):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 5
+	bl	LOC(4.21)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (5*2+1), %o2
+	
+LOC(4.21):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (5*2-1), %o2
+	
+	
+	
+LOC(2.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 3, accumulated bits 1
+	bl	LOC(3.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 3
+	bl	LOC(4.19)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (3*2+1), %o2
+	
+LOC(4.19):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (3*2-1), %o2
+	
+	
+LOC(3.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 1
+	bl	LOC(4.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (1*2+1), %o2
+	
+LOC(4.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (1*2-1), %o2
+	
+	
+	
+	
+LOC(1.16):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 2, accumulated bits -1
+	bl	LOC(2.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 3, accumulated bits -1
+	bl	LOC(3.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -1
+	bl	LOC(4.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-1*2+1), %o2
+	
+LOC(4.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-1*2-1), %o2
+	
+	
+LOC(3.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -3
+	bl	LOC(4.13)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-3*2+1), %o2
+	
+LOC(4.13):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-3*2-1), %o2
+	
+	
+	
+LOC(2.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 3, accumulated bits -3
+	bl	LOC(3.13)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -5
+	bl	LOC(4.11)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-5*2+1), %o2
+	
+LOC(4.11):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-5*2-1), %o2
+	
+	
+LOC(3.13):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -7
+	bl	LOC(4.9)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-7*2+1), %o2
+	
+LOC(4.9):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-7*2-1), %o2
+	
+	
+	
+	
+	9:
+LOC(end_regular_divide):
+	subcc	%o4, 1, %o4
+	bge	LOC(divloop)
+	tst	%o3
+	bl,a	LOC(got_result)
+	! non-restoring fixup here (one instruction only!)
+	add	%o3, %o1, %o3
+
+
+LOC(got_result):
+	! check to see if answer should be < 0
+	tst	%g3
+	bl,a	1f
+	sub %g0, %o3, %o3
+1:
+	retl
+	mov %o3, %o0
+
+END(.rem)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/sdiv.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/sdiv.S
new file mode 100644
index 0000000..d6f2bc7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/sdiv.S
@@ -0,0 +1,360 @@
+   /* This file is generated from divrem.m4; DO NOT EDIT! */
+/*
+ * Division and remainder, from Appendix E of the Sparc Version 8
+ * Architecture Manual, with fixes from Gordon Irlam.
+ */
+
+/*
+ * Input: dividend and divisor in %o0 and %o1 respectively.
+ *
+ * m4 parameters:
+ *  .div	name of function to generate
+ *  div		div=div => %o0 / %o1; div=rem => %o0 % %o1
+ *  true		true=true => signed; true=false => unsigned
+ *
+ * Algorithm parameters:
+ *  N		how many bits per iteration we try to get (4)
+ *  WORDSIZE	total number of bits (32)
+ *
+ * Derived constants:
+ *  TOPBITS	number of bits in the top decade of a number
+ *
+ * Important variables:
+ *  Q		the partial quotient under development (initially 0)
+ *  R		the remainder so far, initially the dividend
+ *  ITER	number of main division loop iterations required;
+ *		equal to ceil(log2(quotient) / N).  Note that this
+ *		is the log base (2^N) of the quotient.
+ *  V		the current comparand, initially divisor*2^(ITER*N-1)
+ *
+ * Cost:
+ *  Current estimate for non-large dividend is
+ *	ceil(log2(quotient) / N) * (10 + 7N/2) + C
+ *  A large dividend is one greater than 2^(31-TOPBITS) and takes a
+ *  different path, as the upper bits of the quotient must be developed
+ *  one bit at a time.
+ */
+
+
+
+ENTRY(.div)
+	! compute sign of result; if neither is negative, no problem
+	orcc	%o1, %o0, %g0	! either negative?
+	bge	2f			! no, go do the divide
+	xor	%o1, %o0, %g3	! compute sign in any case
+	tst	%o1
+	bge	1f
+	tst	%o0
+	! %o1 is definitely negative; %o0 might also be negative
+	bge	2f			! if %o0 not negative...
+	sub	%g0, %o1, %o1	! in any case, make %o1 nonneg
+1:	! %o0 is negative, %o1 is nonnegative
+	sub	%g0, %o0, %o0	! make %o0 nonnegative
+2:
+
+	! Ready to divide.  Compute size of quotient; scale comparand.
+	orcc	%o1, %g0, %o5
+	bne	1f
+	mov	%o0, %o3
+
+		! Divide by zero trap.  If it returns, return 0 (about as
+		! wrong as possible, but that is what SunOS does...).
+		ta	ST_DIV0
+		retl
+		clr	%o0
+
+1:
+	cmp	%o3, %o5			! if %o1 exceeds %o0, done
+	blu	LOC(got_result)		! (and algorithm fails otherwise)
+	clr	%o2
+	sethi	%hi(1 << (32 - 4 - 1)), %g1
+	cmp	%o3, %g1
+	blu	LOC(not_really_big)
+	clr	%o4
+
+	! Here the dividend is >= 2**(31-N) or so.  We must be careful here,
+	! as our usual N-at-a-shot divide step will cause overflow and havoc.
+	! The number of bits in the result here is N*ITER+SC, where SC <= N.
+	! Compute ITER in an unorthodox manner: know we need to shift V into
+	! the top decade: so do not even bother to compare to R.
+	1:
+		cmp	%o5, %g1
+		bgeu	3f
+		mov	1, %g2
+		sll	%o5, 4, %o5
+		b	1b
+		add	%o4, 1, %o4
+
+	! Now compute %g2.
+	2:	addcc	%o5, %o5, %o5
+		bcc	LOC(not_too_big)
+		add	%g2, 1, %g2
+
+		! We get here if the %o1 overflowed while shifting.
+		! This means that %o3 has the high-order bit set.
+		! Restore %o5 and subtract from %o3.
+		sll	%g1, 4, %g1	! high order bit
+		srl	%o5, 1, %o5		! rest of %o5
+		add	%o5, %g1, %o5
+		b	LOC(do_single_div)
+		sub	%g2, 1, %g2
+
+	LOC(not_too_big):
+	3:	cmp	%o5, %o3
+		blu	2b
+		nop
+		be	LOC(do_single_div)
+		nop
+	/* NB: these are commented out in the V8-Sparc manual as well */
+	/* (I do not understand this) */
+	! %o5 > %o3: went too far: back up 1 step
+	!	srl	%o5, 1, %o5
+	!	dec	%g2
+	! do single-bit divide steps
+	!
+	! We have to be careful here.  We know that %o3 >= %o5, so we can do the
+	! first divide step without thinking.  BUT, the others are conditional,
+	! and are only done if %o3 >= 0.  Because both %o3 and %o5 may have the high-
+	! order bit set in the first step, just falling into the regular
+	! division loop will mess up the first time around.
+	! So we unroll slightly...
+	LOC(do_single_div):
+		subcc	%g2, 1, %g2
+		bl	LOC(end_regular_divide)
+		nop
+		sub	%o3, %o5, %o3
+		mov	1, %o2
+		b	LOC(end_single_divloop)
+		nop
+	LOC(single_divloop):
+		sll	%o2, 1, %o2
+		bl	1f
+		srl	%o5, 1, %o5
+		! %o3 >= 0
+		sub	%o3, %o5, %o3
+		b	2f
+		add	%o2, 1, %o2
+	1:	! %o3 < 0
+		add	%o3, %o5, %o3
+		sub	%o2, 1, %o2
+	2:
+	LOC(end_single_divloop):
+		subcc	%g2, 1, %g2
+		bge	LOC(single_divloop)
+		tst	%o3
+		b,a	LOC(end_regular_divide)
+
+LOC(not_really_big):
+1:
+	sll	%o5, 4, %o5
+	cmp	%o5, %o3
+	bleu	1b
+	addcc	%o4, 1, %o4
+	be	LOC(got_result)
+	sub	%o4, 1, %o4
+
+	tst	%o3	! set up for initial iteration
+LOC(divloop):
+	sll	%o2, 4, %o2
+		! depth 1, accumulated bits 0
+	bl	LOC(1.16)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 2, accumulated bits 1
+	bl	LOC(2.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 3, accumulated bits 3
+	bl	LOC(3.19)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 7
+	bl	LOC(4.23)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (7*2+1), %o2
+	
+LOC(4.23):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (7*2-1), %o2
+	
+	
+LOC(3.19):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 5
+	bl	LOC(4.21)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (5*2+1), %o2
+	
+LOC(4.21):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (5*2-1), %o2
+	
+	
+	
+LOC(2.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 3, accumulated bits 1
+	bl	LOC(3.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 3
+	bl	LOC(4.19)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (3*2+1), %o2
+	
+LOC(4.19):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (3*2-1), %o2
+	
+	
+LOC(3.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 1
+	bl	LOC(4.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (1*2+1), %o2
+	
+LOC(4.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (1*2-1), %o2
+	
+	
+	
+	
+LOC(1.16):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 2, accumulated bits -1
+	bl	LOC(2.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 3, accumulated bits -1
+	bl	LOC(3.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -1
+	bl	LOC(4.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-1*2+1), %o2
+	
+LOC(4.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-1*2-1), %o2
+	
+	
+LOC(3.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -3
+	bl	LOC(4.13)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-3*2+1), %o2
+	
+LOC(4.13):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-3*2-1), %o2
+	
+	
+	
+LOC(2.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 3, accumulated bits -3
+	bl	LOC(3.13)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -5
+	bl	LOC(4.11)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-5*2+1), %o2
+	
+LOC(4.11):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-5*2-1), %o2
+	
+	
+LOC(3.13):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -7
+	bl	LOC(4.9)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-7*2+1), %o2
+	
+LOC(4.9):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-7*2-1), %o2
+	
+	
+	
+	
+	9:
+LOC(end_regular_divide):
+	subcc	%o4, 1, %o4
+	bge	LOC(divloop)
+	tst	%o3
+	bl,a	LOC(got_result)
+	! non-restoring fixup here (one instruction only!)
+	sub	%o2, 1, %o2
+
+
+LOC(got_result):
+	! check to see if answer should be < 0
+	tst	%g3
+	bl,a	1f
+	sub %g0, %o2, %o2
+1:
+	retl
+	mov %o2, %o0
+
+END(.div)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/udiv.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/udiv.S
new file mode 100644
index 0000000..56c64ad
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/udiv.S
@@ -0,0 +1,343 @@
+   /* This file is generated from divrem.m4; DO NOT EDIT! */
+/*
+ * Division and remainder, from Appendix E of the Sparc Version 8
+ * Architecture Manual, with fixes from Gordon Irlam.
+ */
+
+/*
+ * Input: dividend and divisor in %o0 and %o1 respectively.
+ *
+ * m4 parameters:
+ *  .udiv	name of function to generate
+ *  div		div=div => %o0 / %o1; div=rem => %o0 % %o1
+ *  false		false=true => signed; false=false => unsigned
+ *
+ * Algorithm parameters:
+ *  N		how many bits per iteration we try to get (4)
+ *  WORDSIZE	total number of bits (32)
+ *
+ * Derived constants:
+ *  TOPBITS	number of bits in the top decade of a number
+ *
+ * Important variables:
+ *  Q		the partial quotient under development (initially 0)
+ *  R		the remainder so far, initially the dividend
+ *  ITER	number of main division loop iterations required;
+ *		equal to ceil(log2(quotient) / N).  Note that this
+ *		is the log base (2^N) of the quotient.
+ *  V		the current comparand, initially divisor*2^(ITER*N-1)
+ *
+ * Cost:
+ *  Current estimate for non-large dividend is
+ *	ceil(log2(quotient) / N) * (10 + 7N/2) + C
+ *  A large dividend is one greater than 2^(31-TOPBITS) and takes a
+ *  different path, as the upper bits of the quotient must be developed
+ *  one bit at a time.
+ */
+
+
+
+ENTRY(.udiv)
+
+	! Ready to divide.  Compute size of quotient; scale comparand.
+	orcc	%o1, %g0, %o5
+	bne	1f
+	mov	%o0, %o3
+
+		! Divide by zero trap.  If it returns, return 0 (about as
+		! wrong as possible, but that is what SunOS does...).
+		ta	ST_DIV0
+		retl
+		clr	%o0
+
+1:
+	cmp	%o3, %o5			! if %o1 exceeds %o0, done
+	blu	LOC(got_result)		! (and algorithm fails otherwise)
+	clr	%o2
+	sethi	%hi(1 << (32 - 4 - 1)), %g1
+	cmp	%o3, %g1
+	blu	LOC(not_really_big)
+	clr	%o4
+
+	! Here the dividend is >= 2**(31-N) or so.  We must be careful here,
+	! as our usual N-at-a-shot divide step will cause overflow and havoc.
+	! The number of bits in the result here is N*ITER+SC, where SC <= N.
+	! Compute ITER in an unorthodox manner: know we need to shift V into
+	! the top decade: so do not even bother to compare to R.
+	1:
+		cmp	%o5, %g1
+		bgeu	3f
+		mov	1, %g2
+		sll	%o5, 4, %o5
+		b	1b
+		add	%o4, 1, %o4
+
+	! Now compute %g2.
+	2:	addcc	%o5, %o5, %o5
+		bcc	LOC(not_too_big)
+		add	%g2, 1, %g2
+
+		! We get here if the %o1 overflowed while shifting.
+		! This means that %o3 has the high-order bit set.
+		! Restore %o5 and subtract from %o3.
+		sll	%g1, 4, %g1	! high order bit
+		srl	%o5, 1, %o5		! rest of %o5
+		add	%o5, %g1, %o5
+		b	LOC(do_single_div)
+		sub	%g2, 1, %g2
+
+	LOC(not_too_big):
+	3:	cmp	%o5, %o3
+		blu	2b
+		nop
+		be	LOC(do_single_div)
+		nop
+	/* NB: these are commented out in the V8-Sparc manual as well */
+	/* (I do not understand this) */
+	! %o5 > %o3: went too far: back up 1 step
+	!	srl	%o5, 1, %o5
+	!	dec	%g2
+	! do single-bit divide steps
+	!
+	! We have to be careful here.  We know that %o3 >= %o5, so we can do the
+	! first divide step without thinking.  BUT, the others are conditional,
+	! and are only done if %o3 >= 0.  Because both %o3 and %o5 may have the high-
+	! order bit set in the first step, just falling into the regular
+	! division loop will mess up the first time around.
+	! So we unroll slightly...
+	LOC(do_single_div):
+		subcc	%g2, 1, %g2
+		bl	LOC(end_regular_divide)
+		nop
+		sub	%o3, %o5, %o3
+		mov	1, %o2
+		b	LOC(end_single_divloop)
+		nop
+	LOC(single_divloop):
+		sll	%o2, 1, %o2
+		bl	1f
+		srl	%o5, 1, %o5
+		! %o3 >= 0
+		sub	%o3, %o5, %o3
+		b	2f
+		add	%o2, 1, %o2
+	1:	! %o3 < 0
+		add	%o3, %o5, %o3
+		sub	%o2, 1, %o2
+	2:
+	LOC(end_single_divloop):
+		subcc	%g2, 1, %g2
+		bge	LOC(single_divloop)
+		tst	%o3
+		b,a	LOC(end_regular_divide)
+
+LOC(not_really_big):
+1:
+	sll	%o5, 4, %o5
+	cmp	%o5, %o3
+	bleu	1b
+	addcc	%o4, 1, %o4
+	be	LOC(got_result)
+	sub	%o4, 1, %o4
+
+	tst	%o3	! set up for initial iteration
+LOC(divloop):
+	sll	%o2, 4, %o2
+		! depth 1, accumulated bits 0
+	bl	LOC(1.16)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 2, accumulated bits 1
+	bl	LOC(2.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 3, accumulated bits 3
+	bl	LOC(3.19)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 7
+	bl	LOC(4.23)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (7*2+1), %o2
+	
+LOC(4.23):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (7*2-1), %o2
+	
+	
+LOC(3.19):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 5
+	bl	LOC(4.21)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (5*2+1), %o2
+	
+LOC(4.21):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (5*2-1), %o2
+	
+	
+	
+LOC(2.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 3, accumulated bits 1
+	bl	LOC(3.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 3
+	bl	LOC(4.19)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (3*2+1), %o2
+	
+LOC(4.19):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (3*2-1), %o2
+	
+	
+LOC(3.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 1
+	bl	LOC(4.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (1*2+1), %o2
+	
+LOC(4.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (1*2-1), %o2
+	
+	
+	
+	
+LOC(1.16):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 2, accumulated bits -1
+	bl	LOC(2.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 3, accumulated bits -1
+	bl	LOC(3.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -1
+	bl	LOC(4.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-1*2+1), %o2
+	
+LOC(4.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-1*2-1), %o2
+	
+	
+LOC(3.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -3
+	bl	LOC(4.13)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-3*2+1), %o2
+	
+LOC(4.13):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-3*2-1), %o2
+	
+	
+	
+LOC(2.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 3, accumulated bits -3
+	bl	LOC(3.13)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -5
+	bl	LOC(4.11)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-5*2+1), %o2
+	
+LOC(4.11):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-5*2-1), %o2
+	
+	
+LOC(3.13):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -7
+	bl	LOC(4.9)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-7*2+1), %o2
+	
+LOC(4.9):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-7*2-1), %o2
+	
+	
+	
+	
+	9:
+LOC(end_regular_divide):
+	subcc	%o4, 1, %o4
+	bge	LOC(divloop)
+	tst	%o3
+	bl,a	LOC(got_result)
+	! non-restoring fixup here (one instruction only!)
+	sub	%o2, 1, %o2
+
+
+LOC(got_result):
+
+	retl
+	mov %o2, %o0
+
+END(.udiv)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/umul.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/umul.S
new file mode 100644
index 0000000..50b3157
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/umul.S
@@ -0,0 +1,153 @@
+/*
+ * Unsigned multiply.  Returns %o0 * %o1 in %o1%o0 (i.e., %o1 holds the
+ * upper 32 bits of the 64-bit product).
+ *
+ * This code optimizes short (less than 13-bit) multiplies.  Short
+ * multiplies require 25 instruction cycles, and long ones require
+ * 45 instruction cycles.
+ *
+ * On return, overflow has occurred (%o1 is not zero) if and only if
+ * the Z condition code is clear, allowing, e.g., the following:
+ *
+ *	call	.umul
+ *	nop
+ *	bnz	overflow	(or tnz)
+ */
+
+ENTRY(.umul)
+	or	%o0, %o1, %o4
+	mov	%o0, %y			! multiplier -> Y
+	andncc	%o4, 0xfff, %g0		! test bits 12..31 of *both* args
+	be	LOC(mul_shortway)	! if zero, can do it the short way
+	 andcc	%g0, %g0, %o4		! zero the partial product; clear N & V
+
+	/*
+	 * Long multiply.  32 steps, followed by a final shift step.
+	 */
+	mulscc	%o4, %o1, %o4	! 1
+	mulscc	%o4, %o1, %o4	! 2
+	mulscc	%o4, %o1, %o4	! 3
+	mulscc	%o4, %o1, %o4	! 4
+	mulscc	%o4, %o1, %o4	! 5
+	mulscc	%o4, %o1, %o4	! 6
+	mulscc	%o4, %o1, %o4	! 7
+	mulscc	%o4, %o1, %o4	! 8
+	mulscc	%o4, %o1, %o4	! 9
+	mulscc	%o4, %o1, %o4	! 10
+	mulscc	%o4, %o1, %o4	! 11
+	mulscc	%o4, %o1, %o4	! 12
+	mulscc	%o4, %o1, %o4	! 13
+	mulscc	%o4, %o1, %o4	! 14
+	mulscc	%o4, %o1, %o4	! 15
+	mulscc	%o4, %o1, %o4	! 16
+	mulscc	%o4, %o1, %o4	! 17
+	mulscc	%o4, %o1, %o4	! 18
+	mulscc	%o4, %o1, %o4	! 19
+	mulscc	%o4, %o1, %o4	! 20
+	mulscc	%o4, %o1, %o4	! 21
+	mulscc	%o4, %o1, %o4	! 22
+	mulscc	%o4, %o1, %o4	! 23
+	mulscc	%o4, %o1, %o4	! 24
+	mulscc	%o4, %o1, %o4	! 25
+	mulscc	%o4, %o1, %o4	! 26
+	mulscc	%o4, %o1, %o4	! 27
+	mulscc	%o4, %o1, %o4	! 28
+	mulscc	%o4, %o1, %o4	! 29
+	mulscc	%o4, %o1, %o4	! 30
+	mulscc	%o4, %o1, %o4	! 31
+	mulscc	%o4, %o1, %o4	! 32
+	mulscc	%o4, %g0, %o4	! final shift
+
+	/*
+	 * Normally, with the shift-and-add approach, if both numbers are
+	 * positive you get the correct result.  With 32-bit two's-complement
+	 * numbers, -x is represented as
+	 *
+	 *		  x		    32
+	 *	( 2  -  ------ ) mod 2  *  2
+	 *		   32
+	 *		  2
+	 *
+	 * (the `mod 2' subtracts 1 from 1.bbbb).  To avoid lots of 2^32s,
+	 * we can treat this as if the radix point were just to the left
+	 * of the sign bit (multiply by 2^32), and get
+	 *
+	 *	-x  =  (2 - x) mod 2
+	 *
+	 * Then, ignoring the `mod 2's for convenience:
+	 *
+	 *   x *  y	= xy
+	 *  -x *  y	= 2y - xy
+	 *   x * -y	= 2x - xy
+	 *  -x * -y	= 4 - 2x - 2y + xy
+	 *
+	 * For signed multiplies, we subtract (x << 32) from the partial
+	 * product to fix this problem for negative multipliers (see mul.s).
+	 * Because of the way the shift into the partial product is calculated
+	 * (N xor V), this term is automatically removed for the multiplicand,
+	 * so we don't have to adjust.
+	 *
+	 * But for unsigned multiplies, the high order bit wasn't a sign bit,
+	 * and the correction is wrong.  So for unsigned multiplies where the
+	 * high order bit is one, we end up with xy - (y << 32).  To fix it
+	 * we add y << 32.
+	 */
+#if 0
+	tst	%o1
+	bl,a	1f		! if %o1 < 0 (high order bit = 1),
+	 add	%o4, %o0, %o4	! %o4 += %o0 (add y to upper half)
+1:	rd	%y, %o0		! get lower half of product
+	retl
+	 addcc	%o4, %g0, %o1	! put upper half in place and set Z for %o1==0
+#else
+	/* Faster code from tege@sics.se.  */
+	sra	%o1, 31, %o2	! make mask from sign bit
+	and	%o0, %o2, %o2	! %o2 = 0 or %o0, depending on sign of %o1
+	rd	%y, %o0		! get lower half of product
+	retl
+	 addcc	%o4, %o2, %o1	! add compensation and put upper half in place
+#endif
+
+LOC(mul_shortway):
+	/*
+	 * Short multiply.  12 steps, followed by a final shift step.
+	 * The resulting bits are off by 12 and (32-12) = 20 bit positions,
+	 * but there is no problem with %o0 being negative (unlike above),
+	 * and overflow is impossible (the answer is at most 24 bits long).
+	 */
+	mulscc	%o4, %o1, %o4	! 1
+	mulscc	%o4, %o1, %o4	! 2
+	mulscc	%o4, %o1, %o4	! 3
+	mulscc	%o4, %o1, %o4	! 4
+	mulscc	%o4, %o1, %o4	! 5
+	mulscc	%o4, %o1, %o4	! 6
+	mulscc	%o4, %o1, %o4	! 7
+	mulscc	%o4, %o1, %o4	! 8
+	mulscc	%o4, %o1, %o4	! 9
+	mulscc	%o4, %o1, %o4	! 10
+	mulscc	%o4, %o1, %o4	! 11
+	mulscc	%o4, %o1, %o4	! 12
+	mulscc	%o4, %g0, %o4	! final shift
+
+	/*
+	 * %o4 has 20 of the bits that should be in the result; %y has
+	 * the bottom 12 (as %y's top 12).  That is:
+	 *
+	 *	  %o4		    %y
+	 * +----------------+----------------+
+	 * | -12- |   -20-  | -12- |   -20-  |
+	 * +------(---------+------)---------+
+	 *	   -----result-----
+	 *
+	 * The 12 bits of %o4 left of the `result' area are all zero;
+	 * in fact, all top 20 bits of %o4 are zero.
+	 */
+
+	rd	%y, %o5
+	sll	%o4, 12, %o0	! shift middle bits left 12
+	srl	%o5, 20, %o5	! shift low bits right 20
+	or	%o5, %o0, %o0
+	retl
+	 addcc	%g0, %g0, %o1	! %o1 = zero, and set Z
+
+END(.umul)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/urem.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/urem.S
new file mode 100644
index 0000000..ecf3467
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv7/urem.S
@@ -0,0 +1,343 @@
+   /* This file is generated from divrem.m4; DO NOT EDIT! */
+/*
+ * Division and remainder, from Appendix E of the Sparc Version 8
+ * Architecture Manual, with fixes from Gordon Irlam.
+ */
+
+/*
+ * Input: dividend and divisor in %o0 and %o1 respectively.
+ *
+ * m4 parameters:
+ *  .urem	name of function to generate
+ *  rem		rem=div => %o0 / %o1; rem=rem => %o0 % %o1
+ *  false		false=true => signed; false=false => unsigned
+ *
+ * Algorithm parameters:
+ *  N		how many bits per iteration we try to get (4)
+ *  WORDSIZE	total number of bits (32)
+ *
+ * Derived constants:
+ *  TOPBITS	number of bits in the top decade of a number
+ *
+ * Important variables:
+ *  Q		the partial quotient under development (initially 0)
+ *  R		the remainder so far, initially the dividend
+ *  ITER	number of main division loop iterations required;
+ *		equal to ceil(log2(quotient) / N).  Note that this
+ *		is the log base (2^N) of the quotient.
+ *  V		the current comparand, initially divisor*2^(ITER*N-1)
+ *
+ * Cost:
+ *  Current estimate for non-large dividend is
+ *	ceil(log2(quotient) / N) * (10 + 7N/2) + C
+ *  A large dividend is one greater than 2^(31-TOPBITS) and takes a
+ *  different path, as the upper bits of the quotient must be developed
+ *  one bit at a time.
+ */
+
+
+
+ENTRY(.urem)
+
+	! Ready to divide.  Compute size of quotient; scale comparand.
+	orcc	%o1, %g0, %o5
+	bne	1f
+	mov	%o0, %o3
+
+		! Divide by zero trap.  If it returns, return 0 (about as
+		! wrong as possible, but that is what SunOS does...).
+		ta	ST_DIV0
+		retl
+		clr	%o0
+
+1:
+	cmp	%o3, %o5			! if %o1 exceeds %o0, done
+	blu	LOC(got_result)		! (and algorithm fails otherwise)
+	clr	%o2
+	sethi	%hi(1 << (32 - 4 - 1)), %g1
+	cmp	%o3, %g1
+	blu	LOC(not_really_big)
+	clr	%o4
+
+	! Here the dividend is >= 2**(31-N) or so.  We must be careful here,
+	! as our usual N-at-a-shot divide step will cause overflow and havoc.
+	! The number of bits in the result here is N*ITER+SC, where SC <= N.
+	! Compute ITER in an unorthodox manner: know we need to shift V into
+	! the top decade: so do not even bother to compare to R.
+	1:
+		cmp	%o5, %g1
+		bgeu	3f
+		mov	1, %g2
+		sll	%o5, 4, %o5
+		b	1b
+		add	%o4, 1, %o4
+
+	! Now compute %g2.
+	2:	addcc	%o5, %o5, %o5
+		bcc	LOC(not_too_big)
+		add	%g2, 1, %g2
+
+		! We get here if the %o1 overflowed while shifting.
+		! This means that %o3 has the high-order bit set.
+		! Restore %o5 and subtract from %o3.
+		sll	%g1, 4, %g1	! high order bit
+		srl	%o5, 1, %o5		! rest of %o5
+		add	%o5, %g1, %o5
+		b	LOC(do_single_div)
+		sub	%g2, 1, %g2
+
+	LOC(not_too_big):
+	3:	cmp	%o5, %o3
+		blu	2b
+		nop
+		be	LOC(do_single_div)
+		nop
+	/* NB: these are commented out in the V8-Sparc manual as well */
+	/* (I do not understand this) */
+	! %o5 > %o3: went too far: back up 1 step
+	!	srl	%o5, 1, %o5
+	!	dec	%g2
+	! do single-bit divide steps
+	!
+	! We have to be careful here.  We know that %o3 >= %o5, so we can do the
+	! first divide step without thinking.  BUT, the others are conditional,
+	! and are only done if %o3 >= 0.  Because both %o3 and %o5 may have the high-
+	! order bit set in the first step, just falling into the regular
+	! division loop will mess up the first time around.
+	! So we unroll slightly...
+	LOC(do_single_div):
+		subcc	%g2, 1, %g2
+		bl	LOC(end_regular_divide)
+		nop
+		sub	%o3, %o5, %o3
+		mov	1, %o2
+		b	LOC(end_single_divloop)
+		nop
+	LOC(single_divloop):
+		sll	%o2, 1, %o2
+		bl	1f
+		srl	%o5, 1, %o5
+		! %o3 >= 0
+		sub	%o3, %o5, %o3
+		b	2f
+		add	%o2, 1, %o2
+	1:	! %o3 < 0
+		add	%o3, %o5, %o3
+		sub	%o2, 1, %o2
+	2:
+	LOC(end_single_divloop):
+		subcc	%g2, 1, %g2
+		bge	LOC(single_divloop)
+		tst	%o3
+		b,a	LOC(end_regular_divide)
+
+LOC(not_really_big):
+1:
+	sll	%o5, 4, %o5
+	cmp	%o5, %o3
+	bleu	1b
+	addcc	%o4, 1, %o4
+	be	LOC(got_result)
+	sub	%o4, 1, %o4
+
+	tst	%o3	! set up for initial iteration
+LOC(divloop):
+	sll	%o2, 4, %o2
+		! depth 1, accumulated bits 0
+	bl	LOC(1.16)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 2, accumulated bits 1
+	bl	LOC(2.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 3, accumulated bits 3
+	bl	LOC(3.19)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 7
+	bl	LOC(4.23)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (7*2+1), %o2
+	
+LOC(4.23):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (7*2-1), %o2
+	
+	
+LOC(3.19):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 5
+	bl	LOC(4.21)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (5*2+1), %o2
+	
+LOC(4.21):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (5*2-1), %o2
+	
+	
+	
+LOC(2.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 3, accumulated bits 1
+	bl	LOC(3.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 3
+	bl	LOC(4.19)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (3*2+1), %o2
+	
+LOC(4.19):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (3*2-1), %o2
+	
+	
+LOC(3.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits 1
+	bl	LOC(4.17)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (1*2+1), %o2
+	
+LOC(4.17):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (1*2-1), %o2
+	
+	
+	
+	
+LOC(1.16):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 2, accumulated bits -1
+	bl	LOC(2.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 3, accumulated bits -1
+	bl	LOC(3.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -1
+	bl	LOC(4.15)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-1*2+1), %o2
+	
+LOC(4.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-1*2-1), %o2
+	
+	
+LOC(3.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -3
+	bl	LOC(4.13)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-3*2+1), %o2
+	
+LOC(4.13):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-3*2-1), %o2
+	
+	
+	
+LOC(2.15):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 3, accumulated bits -3
+	bl	LOC(3.13)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -5
+	bl	LOC(4.11)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-5*2+1), %o2
+	
+LOC(4.11):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-5*2-1), %o2
+	
+	
+LOC(3.13):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+			! depth 4, accumulated bits -7
+	bl	LOC(4.9)
+	srl	%o5,1,%o5
+	! remainder is positive
+	subcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-7*2+1), %o2
+	
+LOC(4.9):
+	! remainder is negative
+	addcc	%o3,%o5,%o3
+		b	9f
+		add	%o2, (-7*2-1), %o2
+	
+	
+	
+	
+	9:
+LOC(end_regular_divide):
+	subcc	%o4, 1, %o4
+	bge	LOC(divloop)
+	tst	%o3
+	bl,a	LOC(got_result)
+	! non-restoring fixup here (one instruction only!)
+	add	%o3, %o1, %o3
+
+
+LOC(got_result):
+
+	retl
+	mov %o3, %o0
+
+END(.urem)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/rem.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/rem.S
new file mode 100644
index 0000000..c4faebe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/rem.S
@@ -0,0 +1,19 @@
+/*
+ * Sparc v8 has divide.
+ */
+
+ENTRY(.rem)
+
+	sra	%o0, 31, %o2
+	wr	%o2, 0, %y
+	nop
+	nop
+	nop
+	sdivcc	%o0, %o1, %o2
+	bvs,a	1f
+	 xnor	%o2, %g0, %o2
+1:	smul	%o2, %o1, %o2
+	retl
+	 sub	%o0, %o2, %o0
+
+END(.rem)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/sdiv.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/sdiv.S
new file mode 100644
index 0000000..4ac901a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/sdiv.S
@@ -0,0 +1,18 @@
+/*
+ * Sparc v8 has divide.
+ */
+
+ENTRY(.div)
+
+	sra	%o0, 31, %o2
+	wr	%o2, 0, %y
+	nop
+	nop
+	nop
+	sdivcc	%o0, %o1, %o0
+	bvs,a	1f
+	 xnor	%o0, %g0, %o0
+1:	retl
+	 nop
+
+END(.div)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/udiv.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/udiv.S
new file mode 100644
index 0000000..d5d93bb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/udiv.S
@@ -0,0 +1,13 @@
+/*
+ * Sparc v8 has divide.
+ */
+
+ENTRY(.udiv)
+
+	wr	%g0, 0, %y
+	nop
+	nop
+	retl
+	 udiv	%o0, %o1, %o0
+
+END(.udiv)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/umul.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/umul.S
new file mode 100644
index 0000000..47b98e9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/umul.S
@@ -0,0 +1,11 @@
+/*
+ * Sparc v8 has multiply.
+ */
+
+ENTRY(.umul)
+
+	umul	%o0, %o1, %o0
+	retl
+	 rd	%y, %o1
+
+END(.umul)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/urem.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/urem.S
new file mode 100644
index 0000000..0e96246
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv8/urem.S
@@ -0,0 +1,16 @@
+/*
+ * Sparc v8 has divide.
+ */
+
+ENTRY(.urem)
+
+	wr	%g0, 0, %y
+	nop
+	nop
+	nop
+	udiv	%o0, %o1, %o2
+	umul	%o2, %o1, %o2
+	retl
+	 sub	%o0, %o2, %o0
+
+END(.urem)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/clone.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/clone.S
new file mode 100644
index 0000000..9d101e2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/clone.S
@@ -0,0 +1,102 @@
+/* Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@tamu.edu).
+
+   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.  */
+
+#include <asm/errno.h>
+#include <asm/unistd.h>
+#include <tcb-offsets.h>
+#include <sysdep.h>
+
+#define CLONE_VM	0x00000100
+#define CLONE_THREAD	0x00010000
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
+	     pid_t *ptid, void *tls, pid_t *ctid); */
+
+	.register	%g2,#scratch
+	.register	%g3,#scratch
+
+	.text
+
+ENTRY (__clone)
+	save	%sp, -192, %sp
+	cfi_def_cfa_register(%fp)
+	cfi_window_save
+	cfi_register(%o7, %i7)
+
+	/* sanity check arguments */
+	brz,pn	%i0, 99f		/* fn non-NULL? */
+	 mov	%i0, %g2
+	brz,pn	%i1, 99f		/* child_stack non-NULL? */
+	 mov	%i2, %o0		/* clone flags */
+
+	/* The child_stack is the top of the stack, allocate one
+	   whole stack frame from that as this is what the kernel
+	   expects.  Also, subtract STACK_BIAS.  */
+	sub	%i1, 192 + 0x7ff, %o1
+	mov	%i3, %g3
+	mov	%i2, %g4
+
+	mov	%i4,%o2			/* PTID */
+	mov	%i5,%o3			/* TLS */
+	ldx	[%fp+0x7ff+176],%o4	/* CTID */
+
+	/* Do the system call */
+	set	__NR_clone, %g1
+	ta	0x6d
+	bcs,pn	%xcc, 98f
+	 nop
+	brnz,pn	%o1, __thread_start
+	 nop
+	jmpl	%i7 + 8, %g0
+	 restore %o0, %g0, %o0
+99:	mov	EINVAL, %o0
+98:	call	HIDDEN_JUMPTARGET(__errno_location)
+	 mov	%o0, %i0
+	st	%i0, [%o0]
+	jmpl	%i7 + 8, %g0
+	 restore %g0,-1,%o0
+END(__clone)
+
+	.type __thread_start,@function
+__thread_start:
+#ifdef RESET_PID
+	sethi	%hi(CLONE_THREAD), %l0
+	andcc	%g4, %l0, %g0
+	bne,pt	%icc, 1f
+	 andcc	%g4, CLONE_VM, %g0
+	bne,a,pn %icc, 2f
+	 mov	-1,%o0
+	set	__NR_getpid,%g1
+	ta	0x6d
+2:	st	%o0,[%g7 + PID]
+	st	%o0,[%g7 + TID]
+1:
+#endif
+	mov	%g0, %fp	/* terminate backtrace */
+	call	%g2
+	 mov	%g3,%o0
+	call	HIDDEN_JUMPTARGET(_exit),0
+	 nop
+
+	.size	__thread_start, .-__thread_start
+
+weak_alias (__clone, clone)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/rem.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/rem.S
new file mode 100644
index 0000000..1474e32
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/rem.S
@@ -0,0 +1,20 @@
+/*
+ * Sparc v9 has divide.
+ * As divx takes 68 cycles and sdivcc only 36,
+ * we use sdivcc eventhough it is deprecated.
+ */
+
+	.text
+	.align		32
+ENTRY(.rem)
+
+	sra		%o0, 31, %o2
+	wr		%o2, 0, %y
+	sdivcc		%o0, %o1, %o2
+	xnor		%o2, %g0, %o3
+	movvs		%icc, %o3, %o2
+	smul		%o2, %o1, %o2
+	retl
+	 sub		%o0, %o2, %o0
+
+END(.rem)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/sdiv.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
new file mode 100644
index 0000000..45535bb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
@@ -0,0 +1,18 @@
+/*
+ * Sparc v9 has divide.
+ * As divx takes 68 cycles and sdivcc only 36,
+ * we use sdivcc eventhough it is deprecated.
+ */
+
+	.text
+	.align		32
+ENTRY(.div)
+
+	sra		%o0, 31, %o2
+	wr		%o2, 0, %y
+	sdivcc		%o0, %o1, %o0
+	xnor		%o0, %g0, %o2
+	retl
+	 movvs		%icc, %o2, %o0
+
+END(.div)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/udiv.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/udiv.S
new file mode 100644
index 0000000..303f29b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/udiv.S
@@ -0,0 +1,15 @@
+/*
+ * Sparc v9 has divide.
+ * As divx takes 68 cycles and udiv only 37,
+ * we use udiv eventhough it is deprecated.
+ */
+
+	.text
+	.align		32
+ENTRY(.udiv)
+
+	wr		%g0, 0, %y
+	retl
+	 udiv		%o0, %o1, %o0
+
+END(.udiv)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/umul.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/umul.S
new file mode 100644
index 0000000..e65e4b9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/umul.S
@@ -0,0 +1,15 @@
+/*
+ * Sparc v9 has multiply.
+ */
+
+	.text
+	.align		32
+ENTRY(.umul)
+
+	srl		%o0, 0, %o0
+	srl		%o1, 0, %o1
+	mulx		%o0, %o1, %o0
+	retl
+	 srlx		%o0, 32, %o1
+
+END(.umul)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/urem.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/urem.S
new file mode 100644
index 0000000..9354269
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sparcv9/urem.S
@@ -0,0 +1,17 @@
+/*
+ * Sparc v9 has divide.
+ * As divx takes 68 cycles and udiv only 37,
+ * we use udiv eventhough it is deprecated.
+ */
+
+	.text
+	.align		32
+ENTRY(.urem)
+
+	wr		%g0, 0, %y
+	udiv		%o0, %o1, %o2
+	umul		%o2, %o1, %o2
+	retl
+	 sub		%o0, %o2, %o0
+
+END(.urem)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/procfs.h
new file mode 100644
index 0000000..2827b1e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/procfs.h
@@ -0,0 +1,211 @@
+/* Copyright (C) 1996, 1997, 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.  */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+#include <bits/wordsize.h>
+
+__BEGIN_DECLS
+
+#if __WORDSIZE == 64
+
+#define ELF_NGREG		36
+
+typedef struct
+  {
+    unsigned long	pr_regs[32];
+    unsigned long	pr_fsr;
+    unsigned long	pr_gsr;
+    unsigned long	pr_fprs;
+  } elf_fpregset_t;
+
+#else /* sparc32 */
+
+#define ELF_NGREG		38
+
+typedef struct
+  {
+    union
+      {
+	unsigned long	pr_regs[32];
+	double		pr_dregs[16];
+      }			pr_fr;
+    unsigned long	__unused;
+    unsigned long	pr_fsr;
+    unsigned char	pr_qcnt;
+    unsigned char	pr_q_entrysize;
+    unsigned char	pr_en;
+    unsigned int	pr_q[64];
+  } elf_fpregset_t;
+
+#endif /* sparc32 */
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+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.  Fields present but not used are
+   marked with "XXX".  */
+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.  */
+#if __WORDSIZE == 64
+    unsigned int pr_uid;
+    unsigned int pr_gid;
+#else
+    unsigned short int pr_uid;
+    unsigned short int pr_gid;
+#endif
+    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.  */
+  };
+
+/* 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;
+
+
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+
+#if __WORDSIZE == 64
+
+/* Provide 32-bit variants so that BFD can read 32-bit
+   core files.  */
+#define ELF_NGREG32		38
+typedef struct
+  {
+    union
+      {
+	unsigned int	pr_regs[32];
+	double		pr_dregs[16];
+      }			pr_fr;
+    unsigned int	__unused;
+    unsigned int	pr_fsr;
+    unsigned char	pr_qcnt;
+    unsigned char	pr_q_entrysize;
+    unsigned char	pr_en;
+    unsigned int	pr_q[64];
+  } elf_fpregset_t32;
+
+typedef unsigned int elf_greg_t32;
+typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG32];
+
+struct elf_prstatus32
+  {
+    struct elf_siginfo pr_info;		/* Info associated with signal.  */
+    short int pr_cursig;		/* Current signal.  */
+    unsigned int pr_sigpend;	/* Set of pending signals.  */
+    unsigned int pr_sighold;	/* Set of held signals.  */
+    __pid_t pr_pid;
+    __pid_t pr_ppid;
+    __pid_t pr_pgrp;
+    __pid_t pr_sid;
+    struct
+      {
+	int tv_sec, tv_usec;
+      } pr_utime,			/* User time.  */
+        pr_stime,			/* System time.  */
+        pr_cutime,			/* Cumulative user time.  */
+        pr_cstime;			/* Cumulative system time.  */
+    elf_gregset_t32 pr_reg;		/* GP registers.  */
+    int pr_fpvalid;			/* True if math copro being used.  */
+  };
+
+struct elf_prpsinfo32
+  {
+    char pr_state;			/* Numeric process state.  */
+    char pr_sname;			/* Char for pr_state.  */
+    char pr_zomb;			/* Zombie.  */
+    char pr_nice;			/* Nice val.  */
+    unsigned 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.  */
+  };
+
+typedef elf_gregset_t32 prgregset32_t;
+typedef elf_fpregset_t32 prfpregset32_t;
+
+typedef struct elf_prstatus32 prstatus32_t;
+typedef struct elf_prpsinfo32 prpsinfo32_t;
+
+#endif  /* sparc64 */
+
+__END_DECLS
+
+#endif	/* sys/procfs.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/ptrace.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/ptrace.h
new file mode 100644
index 0000000..d573f0e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/ptrace.h
@@ -0,0 +1,183 @@
+/* `ptrace' debugger support interface.  Linux/SPARC version.
+   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.  */
+
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H	1
+
+#include <features.h>
+
+#include <bits/wordsize.h>
+
+/* Linux/SPARC kernels up to 2.3.18 do not care much
+   about what namespace polution, so use a kludge now.  */
+#undef PTRACE_GETREGS
+#undef PTRACE_SETREGS
+#undef PTRACE_GETFPREGS
+#undef PTRACE_SETFPREGS
+#undef PTRACE_READDATA
+#undef PTRACE_WRITEDATA
+#undef PTRACE_READTEXT
+#undef PTRACE_WRITETEXT
+#undef PTRACE_SUNDETACH
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.'  */
+enum __ptrace_request
+{
+  /* Indicate that the process making this request should be traced.
+     All signals received by this process can be intercepted by its
+     parent, and its parent can use the other `ptrace' requests.  */
+  PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+  /* Return the word in the process's text space at address ADDR.  */
+  PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+  /* Return the word in the process's data space at address ADDR.  */
+  PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+  /* Return the word in the process's user area at offset ADDR.  */
+  PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+  /* Write the word DATA into the process's text space at address ADDR.  */
+  PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+  /* Write the word DATA into the process's data space at address ADDR.  */
+  PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+  /* Write the word DATA into the process's user area at offset ADDR.  */
+  PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+  /* Continue the process.  */
+  PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+  /* Kill the process.  */
+  PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+  /* Single step the process.
+     This is not supported on all machines.  */
+  PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+  /* Detach from a process attached to with PTRACE_ATTACH.  */
+  PTRACE_DETACH = 11,
+#define PT_DETACH PTRACE_DETACH
+
+  /* This define is needed for older programs which were
+     trying to work around sparc-linux ptrace nastiness.  */
+#define PTRACE_SUNDETACH PTRACE_DETACH
+
+#if __WORDSIZE == 32
+
+  /* Get all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+  /* Set all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+  /* Get all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+  /* Set all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
+#endif
+
+  /* Attach to a process that is already running. */
+  PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+  /* Write several bytes at a time. */
+  PTRACE_WRITEDATA = 17,
+#define PTRACE_WRITEDATA PTRACE_WRITEDATA
+
+  /* Read several bytes at a time. */
+  PTRACE_READTEXT = 18,
+#define PTRACE_READTEXT PTRACE_READTEXT
+#define PTRACE_READDATA PTRACE_READTEXT
+
+  /* Write several bytes at a time. */
+  PTRACE_WRITETEXT = 19,
+#define PTRACE_WRITETEXT PTRACE_WRITETEXT
+
+#if __WORDSIZE == 64
+
+  /* Get all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETREGS = 22,
+#define PT_GETREGS PTRACE_GETREGS
+
+  /* Set all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETREGS = 23,
+#define PT_SETREGS PTRACE_SETREGS
+
+#endif
+
+  /* Continue and stop at the next (return from) syscall.  */
+  PTRACE_SYSCALL = 24
+#define PTRACE_SYSCALL PTRACE_SYSCALL
+
+#if __WORDSIZE == 64
+
+  ,
+  /* Get all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETFPREGS = 25,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+  /* Set all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETFPREGS = 26
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
+#endif
+};
+
+/* Perform process tracing functions.  REQUEST is one of the values
+   above, and determines the action to be taken.
+   For all requests except PTRACE_TRACEME, PID specifies the process to be
+   traced.
+
+   PID and the other arguments described above for the various requests should
+   appear (those that are used for the particular request) as:
+     pid_t PID, void *ADDR, int DATA, void *ADDR2
+   after REQUEST.  */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/ucontext.h
new file mode 100644
index 0000000..b1102b0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/ucontext.h
@@ -0,0 +1,270 @@
+/* Copyright (C) 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_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+
+#define MC_TSTATE	0
+#define MC_PC		1
+#define MC_NPC		2
+#define MC_Y		3
+#define MC_G1		4
+#define MC_G2		5
+#define MC_G3		6
+#define MC_G4		7
+#define MC_G5		8
+#define MC_G6		9
+#define MC_G7		10
+#define MC_O0		11
+#define MC_O1		12
+#define MC_O2		13
+#define MC_O3		14
+#define MC_O4		15
+#define MC_O5		16
+#define MC_O6		17
+#define MC_O7		18
+#define MC_NGREG	19
+
+typedef unsigned long mc_greg_t;
+typedef mc_greg_t mc_gregset_t[MC_NGREG];
+
+#define MC_MAXFPQ	16
+struct mc_fq {
+	unsigned long	*mcfq_addr;
+	unsigned int	mcfq_insn;
+};
+
+struct mc_fpu {
+	union {
+		unsigned int	sregs[32];
+		unsigned long	dregs[32];
+		long double	qregs[16];
+	} mcfpu_fregs;
+	unsigned long	mcfpu_fsr;
+	unsigned long	mcfpu_fprs;
+	unsigned long	mcfpu_gsr;
+	struct mc_fq	*mcfpu_fq;
+	unsigned char	mcfpu_qcnt;
+	unsigned char	mcfpu_qentsz;
+	unsigned char	mcfpu_enab;
+};
+typedef struct mc_fpu mc_fpu_t;
+
+typedef struct {
+	mc_gregset_t	mc_gregs;
+	mc_greg_t	mc_fp;
+	mc_greg_t	mc_i7;
+	mc_fpu_t	mc_fpregs;
+} mcontext_t;
+
+typedef struct ucontext {
+	struct ucontext		*uc_link;
+	unsigned long		uc_flags;
+	unsigned long		__uc_sigmask;
+	mcontext_t		uc_mcontext;
+	stack_t			uc_stack;
+	__sigset_t		uc_sigmask;
+} ucontext_t;
+
+#endif /* __WORDISIZE == 64 */
+
+/*
+ * Location of the users' stored registers relative to R0.
+ * Usage is as an index into a gregset_t array or as u.u_ar0[XX].
+ */
+#define REG_PSR (0)
+#define REG_PC  (1)
+#define REG_nPC (2)
+#define REG_Y   (3)
+#define REG_G1  (4)
+#define REG_G2  (5)
+#define REG_G3  (6)
+#define REG_G4  (7)
+#define REG_G5  (8)
+#define REG_G6  (9)
+#define REG_G7  (10)
+#define REG_O0  (11)
+#define REG_O1  (12)
+#define REG_O2  (13)
+#define REG_O3  (14)
+#define REG_O4  (15)
+#define REG_O5  (16)
+#define REG_O6  (17)
+#define REG_O7  (18)
+
+/*
+ * A gregset_t is defined as an array type for compatibility with the reference
+ * source. This is important due to differences in the way the C language
+ * treats arrays and structures as parameters.
+ *
+ * Note that NGREG is really (sizeof (struct regs) / sizeof (greg_t)),
+ * but that the ABI defines it absolutely to be 21 (resp. 19).
+ */
+
+#if __WORDSIZE == 64
+
+#define REG_ASI	(19)
+#define REG_FPRS (20)
+
+#define NGREG   21
+typedef long greg_t;
+
+#else /* __WORDSIZE == 32 */
+
+#define NGREG   19
+typedef int greg_t;
+
+#endif /* __WORDSIZE == 32 */
+
+typedef greg_t  gregset_t[NGREG];
+
+/*
+ * The following structures define how a register window can appear on the
+ * stack. This structure is available (when required) through the `gwins'
+ * field of an mcontext (nested within ucontext). SPARC_MAXWINDOW is the
+ * maximum number of outstanding regiters window defined in the SPARC
+ * architecture (*not* implementation).
+ */
+#define SPARC_MAXREGWINDOW	31	/* max windows in SPARC arch. */
+struct  rwindow
+  {
+    greg_t rw_local[8];			/* locals */
+    greg_t rw_in[8];			/* ins */
+  };
+
+#define rw_fp   rw_in[6]		/* frame pointer */
+#define rw_rtn  rw_in[7]		/* return address */
+
+typedef struct gwindows
+  {
+    int            wbcnt;
+    int           *spbuf[SPARC_MAXREGWINDOW];
+    struct rwindow wbuf[SPARC_MAXREGWINDOW];
+  } gwindows_t;
+
+/*
+ * Floating point definitions.
+ */
+
+#define MAXFPQ	16	/* max # of fpu queue entries currently supported */
+
+/*
+ * struct fq defines the minimal format of a floating point instruction queue
+ * entry. The size of entries in the floating point queue are implementation
+ * dependent. The union FQu is guarenteed to be the first field in any ABI
+ * conformant system implementation. Any additional fields provided by an
+ * implementation should not be used applications designed to be ABI conformant. */
+
+struct fpq
+  {
+    unsigned long *fpq_addr;		/* address */
+    unsigned long fpq_instr;		/* instruction */
+  };
+
+struct fq
+  {
+    union				/* FPU inst/addr queue */
+      {
+        double whole;
+        struct fpq fpq;
+      } FQu;
+  };
+
+#define FPU_REGS_TYPE           unsigned
+#define FPU_DREGS_TYPE          unsigned long long
+#define V7_FPU_FSR_TYPE         unsigned
+#define V9_FPU_FSR_TYPE         unsigned long long
+#define V9_FPU_FPRS_TYPE        unsigned
+
+#if __WORDSIZE == 64
+
+typedef struct fpu
+  {
+    union {				/* FPU floating point regs */
+      unsigned		fpu_regs[32];	/* 32 singles */
+      double            fpu_dregs[16];	/* 32 doubles */
+      long double	fpu_qregs[16];  /* 16 quads */
+    } fpu_fr;
+    struct fq       *fpu_q;		/* ptr to array of FQ entries */
+    unsigned long   fpu_fsr;		/* FPU status register */
+    unsigned char   fpu_qcnt;		/* # of entries in saved FQ */
+    unsigned char   fpu_q_entrysize;	/* # of bytes per FQ entry */
+    unsigned char   fpu_en;		/* flag signifying fpu in use */
+  } fpregset_t;
+
+#else /* __WORDSIZE == 32 */
+
+typedef struct fpu
+  {
+    union {				/* FPU floating point regs */
+      unsigned long long fpu_regs[32];	/* 32 singles */
+      double             fpu_dregs[16];	/* 16 doubles */
+    } fpu_fr;
+    struct fq       *fpu_q;		/* ptr to array of FQ entries */
+    unsigned        fpu_fsr;		/* FPU status register */
+    unsigned char   fpu_qcnt;		/* # of entries in saved FQ */
+    unsigned char   fpu_q_entrysize;	/* # of bytes per FQ entry */
+    unsigned char   fpu_en;		/* flag signifying fpu in use */
+  } fpregset_t;
+
+/*
+ * The following structure is for associating extra register state with
+ * the ucontext structure and is kept within the uc_mcontext filler area.
+ *
+ * If (xrs_id == XRS_ID) then the xrs_ptr field is a valid pointer to
+ * extra register state. The exact format of the extra register state
+ * pointed to by xrs_ptr is platform-dependent.
+ *
+ * Note: a platform may or may not manage extra register state.
+ */
+typedef struct
+  {
+    unsigned int xrs_id;		/* indicates xrs_ptr validity */
+    void *       xrs_ptr;		/* ptr to extra reg state */
+  } xrs_t;
+
+#define XRS_ID	0x78727300		/* the string "xrs" */
+
+typedef struct
+  {
+    gregset_t   gregs;		/* general register set */
+    gwindows_t  *gwins;		/* POSSIBLE pointer to register windows */
+    fpregset_t  fpregs;		/* floating point register set */
+    xrs_t       xrs;		/* POSSIBLE extra register state association */
+    long        filler[19];
+  } mcontext_t;
+
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long   uc_flags;
+    struct ucontext *uc_link;
+    __sigset_t	    uc_sigmask;
+    stack_t         uc_stack;
+    mcontext_t      uc_mcontext;
+  } ucontext_t;
+
+#endif /* __WORDSIZE == 32 */
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/user.h
new file mode 100644
index 0000000..2aad01b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sys/user.h
@@ -0,0 +1,85 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H	1
+
+struct sunos_regs
+{
+  unsigned int psr, pc, npc, y;
+  unsigned int regs[15];
+};
+
+struct sunos_fpqueue
+{
+  unsigned int *addr;
+  unsigned int inst;
+};
+
+struct sunos_fp
+{
+  union
+    {
+      unsigned int regs[32];
+      double reg_dbls[16];
+    } fregs;
+  unsigned int fsr;
+  unsigned int flags;
+  unsigned int extra;
+  unsigned int fpq_count;
+  struct sunos_fpqueue fpq[16];
+};
+
+struct sunos_fpu
+{
+  struct sunos_fp fpstatus;
+};
+
+/* The SunOS core file header layout. */
+struct user {
+  unsigned int magic;
+  unsigned int len;
+  struct sunos_regs regs;
+  struct
+    {
+      unsigned char a_dynamic :1;
+      unsigned char a_toolversion :7;
+      unsigned char a_machtype;
+      unsigned short a_info;
+      unsigned int a_text;
+      unsigned int a_data;
+      unsigned int a_bss;
+      unsigned int a_syms;
+      unsigned int a_entry;
+      unsigned int a_trsize;
+      unsigned int a_drsize;
+    } uexec;
+  int           signal;
+  size_t        u_tsize;
+  size_t        u_dsize;
+  size_t        u_ssize;
+  char          u_comm[17];
+  struct sunos_fpu fpu;
+  unsigned int  sigcode;
+};
+
+#define NBPG			0x2000
+#define UPAGES			1
+#define SUNOS_CORE_MAGIC	0x080456
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/syscall.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/syscall.S
new file mode 100644
index 0000000..86055ec
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/syscall.S
@@ -0,0 +1,50 @@
+/* Copyright (C) 1991, 1992, 1997, 2002 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 <sys/syscall.h>
+
+.text
+.global syscall
+.type   syscall,%function
+#if __WORDSIZE == 32
+.align  4
+#else
+.align  2
+#endif
+
+syscall:
+	mov	%o0, %g1
+	mov	%o1, %o0
+	mov	%o2, %o1
+	mov	%o3, %o2
+	mov	%o4, %o3
+	mov	%o5, %o4
+
+#if __WORDSIZE == 32
+	ta	0x10
+	bcs	__syscall_error
+#else
+	ta	0x6d
+	bcs,pn %xcc,__syscall_error
+#endif
+
+	 nop
+	retl
+	 nop
+.size syscall,.-syscall
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/sparc/sysdep.h
new file mode 100644
index 0000000..cf3e3af
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/sysdep.h
@@ -0,0 +1,69 @@
+#ifndef _LINUX_SPARC_SYSDEP_H
+#define _LINUX_SPARC_SYSDEP_H 1
+
+#include <common/sysdep.h>
+
+#undef ENTRY
+#undef END
+
+#ifdef __ASSEMBLER__
+
+#define LOADSYSCALL(x) mov __NR_##x, %g1
+
+#define ENTRY(name)                 \
+    .align 4;                       \
+    .global C_SYMBOL_NAME(name);    \
+    .type   name, @function;        \
+C_LABEL(name)                       \
+    cfi_startproc;
+
+#define END(name)                   \
+    cfi_endproc;                    \
+    .size name, . - name
+
+#define LOC(name) .L##name
+
+	/* If the offset to __syscall_error fits into a signed 22-bit
+	 * immediate branch offset, the linker will relax the call into
+	 * a normal branch.
+	 */
+#undef PSEUDO
+#undef PSEUDO_END
+#undef PSEUDO_NOERRNO
+#undef PSEUDO_ERRVAL
+
+#define PSEUDO(name, syscall_name, args)	\
+	.text;					\
+	.globl		__syscall_error;	\
+ENTRY(name);					\
+	LOADSYSCALL(syscall_name);		\
+	ta		0x10;			\
+	bcc		1f;			\
+	 mov		%o7, %g1;		\
+	call		__syscall_error;	\
+	 mov		%g1, %o7;		\
+1:
+
+#define PSEUDO_NOERRNO(name, syscall_name, args)\
+	.text;					\
+ENTRY(name);					\
+	LOADSYSCALL(syscall_name);		\
+	ta		0x10;
+
+#define PSEUDO_ERRVAL(name, syscall_name, args)	\
+	.text;					\
+ENTRY(name);					\
+	LOADSYSCALL(syscall_name);		\
+	ta		0x10;
+
+#define PSEUDO_END(name)			\
+	END(name)
+
+
+#endif /* __ASSEMBLER__ */
+
+/* Pointer mangling is not yet supported for SPARC.  */
+#define PTR_MANGLE(var) (void) (var)
+#define PTR_DEMANGLE(var) (void) (var)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/udiv.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/udiv.S
new file mode 100644
index 0000000..a1355a7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/udiv.S
@@ -0,0 +1,9 @@
+#include "_math_inc.h"
+
+#if defined(__CONFIG_SPARC_V9__) || defined(__CONFIG_SPARC_V9B__)
+# include "sparcv9/udiv.S"
+#elif defined(__CONFIG_SPARC_V8__)
+# include "sparcv8/udiv.S"
+#else
+# include "sparcv7/udiv.S"
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/umul.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/umul.S
new file mode 100644
index 0000000..e860597
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/umul.S
@@ -0,0 +1,9 @@
+#include "_math_inc.h"
+
+#if defined(__CONFIG_SPARC_V9__) || defined(__CONFIG_SPARC_V9B__)
+# include "sparcv9/umul.S"
+#elif defined(__CONFIG_SPARC_V8__)
+# include "sparcv8/umul.S"
+#else
+# include "sparcv7/umul.S"
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/urem.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/urem.S
new file mode 100644
index 0000000..baf6c43
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/urem.S
@@ -0,0 +1,9 @@
+#include "_math_inc.h"
+
+#if defined(__CONFIG_SPARC_V9__) || defined(__CONFIG_SPARC_V9B__)
+# include "sparcv9/urem.S"
+#elif defined(__CONFIG_SPARC_V8__)
+# include "sparcv8/urem.S"
+#else
+# include "sparcv7/urem.S"
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/sparc/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/sparc/vfork.S
new file mode 100644
index 0000000..ed3e1a0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/sparc/vfork.S
@@ -0,0 +1,55 @@
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 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.  */
+
+/* Code taken from glibc2.2.2/sysdeps/unix/sysv/linux/sparc/vfork.S */
+
+#include <sys/syscall.h>
+
+#ifndef __NR_vfork
+/* No vfork so use fork instead */
+# define __NR_vfork __NR_fork
+#endif
+
+.text
+.global	__vfork
+.hidden	__vfork
+.type	__vfork,%function
+.align 4
+
+__vfork:
+	mov __NR_vfork, %g1
+	ta	0x10
+	bcc,a	9000f
+	nop
+	save    %sp,-96,%sp
+	call HIDDEN_JUMPTARGET(__errno_location)
+	nop
+	st	%i0,[%o0]
+	jmpl	%i7+8,%g0
+	restore	%g0,-1,%o0
+
+9000:
+	sub	%o1, 1, %o1
+	retl
+	and	%o0, %o1, %o0
+
+.size __vfork,.-__vfork
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/Makefile b/ap/build/uClibc/libc/sysdeps/linux/v850/Makefile
new file mode 100644
index 0000000..60dc97c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/Makefile
@@ -0,0 +1,64 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2001,2002  NEC Corporation
+# Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TOPDIR=../../../../
+include $(TOPDIR)Rules.mak
+
+CFLAGS += -I..
+ASFLAGS += -I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl
+
+TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
+
+CRT_SRC := crt0.S
+CRT_OBJ := crt0.o crt1.o
+CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
+
+SSRC := setjmp.S __longjmp.S vfork.S
+SOBJ := $(patsubst %.S,%.o, $(SSRC))
+
+CSRC := mmap.c syscall.c clone.c
+COBJ := $(patsubst %.c,%.o, $(CSRC))
+
+OBJS := $(SOBJ) $(COBJ)
+
+OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
+
+all: $(OBJ_LIST) $(CTOR_TARGETS)
+
+$(OBJ_LIST): $(OBJS) $(CRT_OBJ)
+	$(STRIPTOOL) -x -R .note -R .comment $^
+	$(INSTALL) -d $(TOPDIR)lib/
+	cp $(CRT_OBJ) $(TOPDIR)lib/
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
+
+$(CRT_OBJ): $(CRT_SRC)
+	$(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
+
+$(SOBJ): %.o : %.S
+	$(CC) $(ASFLAGS) -c $< -o $@
+
+$(COBJ): %.o : %.c
+	$(CC) $(CFLAGS) -c $< -o $@
+
+ifeq ($(UCLIBC_CTOR_DTOR),y)
+$(TOPDIR)lib/crti.o: crti.S
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
+
+$(TOPDIR)lib/crtn.o: crtn.S
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
+else
+$(CTOR_TARGETS):
+	$(INSTALL) -d $(TOPDIR)lib/
+	$(AR) $(ARFLAGS) $@
+endif
+
+headers:
+
+clean:
+	$(RM) *.o *~ core
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/v850/__longjmp.S
new file mode 100644
index 0000000..fa29e0f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/__longjmp.S
@@ -0,0 +1,41 @@
+/*
+ * libc/sysdeps/linux/v850/longjmp.S -- `longjmp' for v850
+ *
+ *  Copyright (C) 2001,02  NEC Corporation
+ *  Copyright (C) 2001,02  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <features.h>
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+#include <clinkage.h>
+
+	.text
+C_ENTRY(__longjmp):
+	/* Save registers */
+	mov	r6, ep
+	sld.w	0[ep], sp
+	sld.w	4[ep], lp
+	sld.w	8[ep], r2
+	sld.w	12[ep], r20
+	sld.w	16[ep], r21
+	sld.w	20[ep], r22
+	sld.w	24[ep], r23
+	sld.w	28[ep], r24
+	sld.w	32[ep], r25
+	sld.w	36[ep], r26
+	sld.w	40[ep], r27
+	sld.w	44[ep], r28
+	sld.w	48[ep], r29
+	mov	1, r10			/* return val */
+	jmp	[lp]
+C_END(__longjmp)
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/bits/byteswap.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/byteswap.h
new file mode 100644
index 0000000..b2e1ddb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/byteswap.h
@@ -0,0 +1,31 @@
+/*
+ * libc/sysdeps/linux/v850/bits/byteswap.h -- Macros to swap the order
+ * 	of bytes in integer values
+ *
+ *  Copyright (C) 2001  NEC Corporation
+ *  Copyright (C) 2001  Miles Bader <miles@gnu.org>
+ *  Copyright (C) 1997,1998,2001  Free Software Foundation, Inc.
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ */
+
+#ifndef _ASM_BITS_BYTESWAP_H
+#define _ASM_BITS_BYTESWAP_H 1
+
+#define __bswap_non_constant_16(x) \
+    (__extension__							      \
+     ({ unsigned long int __bswap_16_v;					      \
+	__asm__ ("bsh %1, %0" : "=r" (__bswap_16_v) : "r" (x));		      \
+	__bswap_16_v; }))
+
+# define __bswap_non_constant_32(x) \
+    (__extension__							      \
+     ({ unsigned long int __bswap_32_v;					      \
+	__asm__ ("bsw %1, %0" : "=r" (__bswap_32_v) : "r" (x));		      \
+	__bswap_32_v; }))
+
+#endif
+
+#include <bits/byteswap-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/endian.h
new file mode 100644
index 0000000..ae78da3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/endian.h
@@ -0,0 +1,18 @@
+/*
+ * libc/sysdeps/linux/v850/bits/endian.h -- Define processor endianess
+ *
+ *  Copyright (C) 2001  NEC Corporation
+ *  Copyright (C) 2001  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/fcntl.h
new file mode 100644
index 0000000..c8aeb91
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/fcntl.h
@@ -0,0 +1,233 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   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.  */
+
+#ifndef	_FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+
+#include <sys/types.h>
+
+/* 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.	*/
+#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_XOPEN2K
+# 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]FL.  */
+#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/v850/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/kernel_stat.h
new file mode 100644
index 0000000..1b925ca
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/kernel_stat.h
@@ -0,0 +1,54 @@
+/* Stat structure for linux/v850 */
+
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+struct kernel_stat
+{
+  __kernel_dev_t	st_dev;
+  __kernel_ino_t	st_ino;
+  __kernel_mode_t	st_mode;
+  __kernel_nlink_t 	st_nlink;
+  __kernel_uid_t 	st_uid;
+  __kernel_gid_t 	st_gid;
+  __kernel_dev_t	st_rdev;
+  __kernel_off_t	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
+{
+  __kernel_dev_t	st_dev;
+  unsigned long		__unused0;
+  unsigned long		__unused1;
+
+  __kernel_ino64_t	st_ino;
+
+  __kernel_mode_t	st_mode;
+  __kernel_nlink_t 	st_nlink;
+
+  __kernel_uid_t	st_uid;
+  __kernel_gid_t	st_gid;
+
+  __kernel_dev_t	st_rdev;
+  unsigned long		__unused2;
+  unsigned long		__unused3;
+
+  __kernel_loff_t	st_size;
+  unsigned long		st_blksize;
+
+  unsigned long		__unused4; /* future possible st_blocks high bits */
+  unsigned long		st_blocks; /* Number 512-byte blocks allocated. */
+
+  struct timespec	st_atim;
+  struct timespec	st_mtim;
+  struct timespec	st_ctim;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/kernel_types.h
new file mode 100644
index 0000000..780aa8a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/kernel_types.h
@@ -0,0 +1,55 @@
+/*
+ * sysdeps/linux/v850/bits/kernel_types.h -- Kernel versions of standard types
+ *
+ *  Copyright (C) 2001,2002  NEC Corporation
+ *  Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#ifndef __V850_POSIX_TYPES_H__
+#define __V850_POSIX_TYPES_H__
+
+typedef unsigned int	__kernel_dev_t;
+typedef unsigned long	__kernel_ino_t;
+typedef unsigned long long __kernel_ino64_t;
+typedef unsigned int	__kernel_mode_t;
+typedef unsigned int	__kernel_nlink_t;
+typedef long		__kernel_off_t;
+typedef long long	__kernel_loff_t;
+typedef int		__kernel_pid_t;
+typedef unsigned short	__kernel_ipc_pid_t;
+typedef unsigned int	__kernel_uid_t;
+typedef unsigned int	__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 __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 /* __V850_POSIX_TYPES_H__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/bits/poll.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/poll.h
new file mode 100644
index 0000000..f7a7393
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/poll.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1997, 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_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for.  These bits may be set in `events'
+   to indicate the interesting event types; they will appear in `revents'
+   to indicate the status of the file descriptor.  */
+#define POLLIN		0x001		/* There is data to read.  */
+#define POLLPRI		0x002		/* There is urgent data to read.  */
+#define POLLOUT		0x004		/* Writing now will not block.  */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2.  */
+# define POLLRDNORM	0x040		/* Normal data may be read.  */
+# define POLLRDBAND	0x080		/* Priority data may be read.  */
+# define POLLWRNORM	POLLOUT		/* Writing now will not block.  */
+# define POLLWRBAND	0x100		/* Priority data may be written.  */
+#endif
+
+/* Event types always implicitly polled for.  These bits need not be set in
+   `events', but they will appear in `revents' to indicate the status of
+   the file descriptor.  */
+#define POLLERR		0x008		/* Error condition.  */
+#define POLLHUP		0x010		/* Hung up.  */
+#define POLLNVAL	0x020		/* Invalid polling request.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/bits/select.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/select.h
new file mode 100644
index 0000000..b6bb054
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/select.h
@@ -0,0 +1,64 @@
+/*
+ * include/bits/select.h -- fd_set operations
+ *
+ *  Copyright (C) 2001  NEC Corporation
+ *  Copyright (C) 2001  Miles Bader <miles@gnu.org>
+ *  Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ */
+
+#ifndef _SYS_SELECT_H
+# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
+#endif
+
+#ifdef __GNUC__
+
+/* We don't use `memset' because this would require a prototype and
+   the array isn't too big.  */
+#define __FD_ZERO(s)							      \
+  do {									      \
+    unsigned int __i;							      \
+    fd_set *__arr = (s);						      \
+    for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i)	      \
+      __FDS_BITS (__arr)[__i] = 0;					      \
+  } while (0)
+
+#define __FD_SET(fd, s)						       	      \
+  do {									      \
+	int __fd = (fd);						      \
+	void *__addr = (void *)&__FDS_BITS (s);				      \
+	__asm__ __volatile__ ("set1 %0, [%1]"				      \
+			      : /*nothing*/				      \
+			      : "r" (__fd & 0x7), "r" (__addr + (__fd >> 3)));\
+  } while (0)
+
+#define __FD_CLR(fd, s)							      \
+  do {									      \
+	int __fd = (fd);						      \
+	void *__addr = (void *)&__FDS_BITS (s);				      \
+	__asm__ __volatile__ ("clr1 %0, [%1]"				      \
+			      : /*nothing*/				      \
+			      : "r" (__fd & 0x7), "r" (__addr + (__fd >> 3)));\
+  } while (0)
+
+#define __FD_ISSET(fd, s)						      \
+  ({									      \
+	int __fd = (fd);						      \
+	void *__addr = (void *)&__FDS_BITS (s);				      \
+	int res;							      \
+	__asm__ ("tst1 %1, [%2]; setf nz, %0"				      \
+		 : "=r" (res)						      \
+		 : "r" (__fd & 0x7), "r" (__addr + (__fd >> 3)));	      \
+	res;								      \
+  })
+
+#else /* !__GNUC__ */
+
+#define __FD_SET(d, s)     (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
+#define __FD_CLR(d, s)     (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
+#define __FD_ISSET(d, s)   ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
+
+#endif /* __GNUC__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/setjmp.h
new file mode 100644
index 0000000..c943737
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/setjmp.h
@@ -0,0 +1,42 @@
+/*
+ * libc/sysdeps/linux/v850/bits/setjmp.h -- v850 version of `jmp_buf' type
+ *
+ *  Copyright (C) 2001  NEC Corporation
+ *  Copyright (C) 2001  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#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
+typedef struct
+  {
+    /* Stack pointer.  */
+    void *__sp;
+
+    /* Link pointer.  */
+    void *__lp;
+
+    /* Callee-saved registers r2 and r20-r29.  */
+    int __regs[11];
+  } __jmp_buf[1];
+#endif
+
+#define JB_SIZE		(4 * 13)
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[0].__sp)
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/sigcontextinfo.h
new file mode 100644
index 0000000..de450ff
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/sigcontextinfo.h
@@ -0,0 +1,17 @@
+/*
+ * sysdeps/v850/sigcontextinfo.h -- v850-specific pthread signal definitions
+ *
+ *  Copyright (C) 2002  NEC Electronics Corporation
+ *  Copyright (C) 2002  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <signal.h>
+
+#define SIGCONTEXT struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/stackinfo.h
new file mode 100644
index 0000000..3ed732a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/stackinfo.h
@@ -0,0 +1,23 @@
+/*
+ * bits/stackinfo.h -- v850-specific pthread definitions
+ *
+ *  Copyright (C) 2003  NEC Electronics Corporation
+ *  Copyright (C) 2003  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On v80 the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/syscalls.h
new file mode 100644
index 0000000..b218513
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/syscalls.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#include <features.h>
+
+/* Do something very evil for now.  Until we create our own syscall
+ * macros, short circuit bits/sysnum.h  and use asm/unistd.h instead */
+#warning "fixme -- add arch specific syscall macros.h"
+#include <asm/unistd.h>
+
+#endif /* _BITS_SYSCALLS_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..2a9422e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/uClibc_arch_features.h
@@ -0,0 +1,48 @@
+/*
+ * 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__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/v850/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/v850/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/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/v850/clinkage.h b/ap/build/uClibc/libc/sysdeps/linux/v850/clinkage.h
new file mode 100644
index 0000000..e85d39f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/clinkage.h
@@ -0,0 +1,14 @@
+/*
+ * libc/sysdeps/linux/v850/clinkage.h -- Macros for C symbols in assembler
+ *
+ *  Copyright (C) 2001  NEC Corporation
+ *  Copyright (C) 2001  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <asm/clinkage.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/clone.c b/ap/build/uClibc/libc/sysdeps/linux/v850/clone.c
new file mode 100644
index 0000000..d2e2208
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/clone.c
@@ -0,0 +1,50 @@
+/*
+ * libc/sysdeps/linux/v850/clone.c -- `clone' syscall for linux/v850
+ *
+ *  Copyright (C) 2002,03  NEC Electronics Corporation
+ *  Copyright (C) 2002,03  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <errno.h>
+#include <sys/syscall.h>
+
+int
+clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg)
+{
+  register unsigned long rval __asm__ (SYSCALL_RET) = -EINVAL;
+
+  if (fn && child_stack)
+    {
+      register unsigned long syscall __asm__ (SYSCALL_NUM);
+      register unsigned long arg0 __asm__ (SYSCALL_ARG0);
+      register unsigned long arg1 __asm__ (SYSCALL_ARG1);
+
+      /* Clone this thread.  */
+      arg0 = flags;
+      arg1 = (unsigned long)child_stack;
+      syscall = __NR_clone;
+      __asm__ __volatile__ ("trap " SYSCALL_SHORT_TRAP
+		    : "=r" (rval), "=r" (syscall)
+		    : "1" (syscall), "r" (arg0), "r" (arg1)
+		    : SYSCALL_SHORT_CLOBBERS);
+
+      if (rval == 0)
+	/* In child thread, call FN and exit.  */
+	{
+	  arg0 = (*fn) (arg);
+	  syscall = __NR_exit;
+	  __asm__ __volatile__ ("trap " SYSCALL_SHORT_TRAP
+			: "=r" (rval), "=r" (syscall)
+			: "1" (syscall), "r" (arg0)
+			: SYSCALL_SHORT_CLOBBERS);
+	}
+    }
+
+  __syscall_return (int, rval);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/crt0.S b/ap/build/uClibc/libc/sysdeps/linux/v850/crt0.S
new file mode 100644
index 0000000..01e9f83
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/crt0.S
@@ -0,0 +1,57 @@
+/*
+ * libc/sysdeps/linux/v850/crt0.S -- Initial program entry point for linux/v850
+ *
+ *  Copyright (C) 2001,02,03  NEC Electronics Corporation
+ *  Copyright (C) 2001,02,03  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <clinkage.h>
+
+/* Upon entry, the stack contains the following data:
+	argc, argv[0], ..., argv[argc-1], 0, envp[0], ..., 0
+*/
+
+	.text
+C_ENTRY(start):
+	ld.w	0[sp], r6	/* Arg 0: argc */
+
+	addi	4, sp, r7	/* Arg 1: argv */
+
+	mov	r7, r8		/* Arg 2: envp */
+	mov	r6, r10		/* skip argc elements to get envp start */
+	add	1, r10		/* ...plus the NULL at the end of argv */
+	shl	2, r10		/* Convert to byte-count to skip */
+	add	r10, r8
+
+	/* Load CTBP register */
+	mov	hilo(C_SYMBOL_NAME(_ctbp)), r19
+	ldsr	r19, ctbp
+
+	/* Load GP */
+	mov	hilo(C_SYMBOL_NAME(_gp)), gp
+
+	/* tail-call uclibc's startup routine */
+	addi	-24, sp, sp		/* Stack space reserved for args */
+	jr	C_SYMBOL_NAME(__uClibc_main)
+
+
+/* Stick in a dummy reference to `main', so that if an application
+   is linking when the `main' function is in a static library (.a)
+   we can be sure that `main' actually gets linked in.  */
+L_dummy_main_reference:
+	.long	C_SYMBOL_NAME(main)
+
+/* 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/v850/crti.S b/ap/build/uClibc/libc/sysdeps/linux/v850/crti.S
new file mode 100644
index 0000000..c1e5293
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/crti.S
@@ -0,0 +1,27 @@
+	.file	"initfini.c"
+#APP
+	
+	.section .init
+#NO_APP
+	.align 1
+	.global __init
+	.type	__init, @function
+__init:
+	jarl __save_r31, r10
+#APP
+	
+	.align 1
+	
+	
+	.section .fini
+#NO_APP
+	.align 1
+	.global __fini
+	.type	__fini, @function
+__fini:
+	jarl __save_r31, r10
+#APP
+	.align 1
+	
+	
+	.ident	"GCC: (GNU) 3.3.2"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/v850/crtn.S
new file mode 100644
index 0000000..6bb0b39
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/crtn.S
@@ -0,0 +1,22 @@
+	.file	"initfini.c"
+#APP
+	
+	.section .init
+#NO_APP
+	.align 1
+	.global __init
+	.type	__init, @function
+#NO_APP
+	jr __return_r31
+#APP
+	
+	.section .fini
+#NO_APP
+	.align 1
+	.global __fini
+	.type	__fini, @function
+#NO_APP
+	jr __return_r31
+#APP
+	
+	.ident	"GCC: (GNU) 3.3.2"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/v850/mmap.c
new file mode 100644
index 0000000..7fb3f22
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/mmap.c
@@ -0,0 +1,16 @@
+/* Use new style mmap for v850 */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <errno.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+
+_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
+	   int, flags, int, fd, __off_t, offset)
+libc_hidden_def(mmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/v850/setjmp.S
new file mode 100644
index 0000000..87a5e38
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/setjmp.S
@@ -0,0 +1,48 @@
+/*
+ * libc/sysdeps/linux/v850/setjmp.S -- `setjmp' for v850
+ *
+ *  Copyright (C) 2001,2002  NEC Corporation
+ *  Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ * 
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+#include <clinkage.h>
+
+	.text
+C_ENTRY(setjmp):
+	mov	1, r7			/* Save the signal mask.  */
+	br	C_SYMBOL_NAME(__sigsetjmp)
+
+	.globl C_SYMBOL_NAME(_setjmp)
+C_SYMBOL_NAME(_setjmp):
+	mov	0, r7			/* Don't save the signal mask.  */
+
+	.globl C_SYMBOL_NAME(__sigsetjmp)
+C_SYMBOL_NAME(__sigsetjmp):
+	/* Save registers */
+	mov	r6, ep
+	sst.w	sp, 0[ep]
+	sst.w	lp, 4[ep]
+	sst.w	r2, 8[ep]
+	sst.w	r20, 12[ep]
+	sst.w	r21, 16[ep]
+	sst.w	r22, 20[ep]
+	sst.w	r23, 24[ep]
+	sst.w	r24, 28[ep]
+	sst.w	r25, 32[ep]
+	sst.w	r26, 36[ep]
+	sst.w	r27, 40[ep]
+	sst.w	r28, 44[ep]
+	sst.w	r29, 48[ep]
+	/* Make a tail call to __sigjmp_save; it takes the same args.  */
+	jr	C_SYMBOL_NAME(__sigjmp_save)
+C_END(setjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/v850/sys/procfs.h
new file mode 100644
index 0000000..67acb3c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/sys/procfs.h
@@ -0,0 +1,136 @@
+/* Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002 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>
+
+
+/* Type for a general-purpose register.  */
+typedef unsigned long elf_greg_t;
+
+/* This is exactly the same as `struct pt_regs' in the kernel.  */
+struct elf_gregset
+{
+	/* General purpose registers.  */
+	elf_greg_t gpr[32];
+
+	elf_greg_t pc;		/* program counter */
+	elf_greg_t psw;		/* program status word */
+
+	/* Registers used by `callt' instruction:  */
+	elf_greg_t ctpc;	/* saved program counter */
+	elf_greg_t ctpsw;	/* saved psw */
+	elf_greg_t ctbp;	/* base pointer for callt table */
+
+	char kernel_mode;	/* 1 if in `kernel mode', 0 if user mode */
+};
+
+#define ELF_NGREG (sizeof (struct elf_gregset) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers.  */
+typedef void elf_fpregset_t;
+
+
+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.
+ * Fields present but not used are marked with "XXX".
+ */
+struct elf_prstatus
+{
+	struct elf_siginfo pr_info;	/* Info associated with signal */
+	short	pr_cursig;		/* Current signal */
+	unsigned long pr_sigpend;	/* Set of pending signals */
+	unsigned long pr_sighold;	/* Set of held signals */
+	__kernel_pid_t	pr_pid;
+	__kernel_pid_t	pr_ppid;
+	__kernel_pid_t	pr_pgrp;
+	__kernel_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 co-processor 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 pr_flag;	/* flags */
+	__kernel_uid_t	pr_uid;
+	__kernel_gid_t	pr_gid;
+	__kernel_pid_t	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 __kernel_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;
+
+
+#endif	/* sys/procfs.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/sys/ptrace.h b/ap/build/uClibc/libc/sysdeps/linux/v850/sys/ptrace.h
new file mode 100644
index 0000000..48690ee
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/sys/ptrace.h
@@ -0,0 +1,98 @@
+/* `ptrace' debugger support interface.  Linux/v850 version.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.'  */
+enum __ptrace_request
+{
+  /* Indicate that the process making this request should be traced.
+     All signals received by this process can be intercepted by its
+     parent, and its parent can use the other `ptrace' requests.  */
+  PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+  /* Return the word in the process's text space at address ADDR.  */
+  PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+  /* Return the word in the process's data space at address ADDR.  */
+  PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+  /* Return the word in the process's user area at offset ADDR.  */
+  PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+  /* Write the word DATA into the process's text space at address ADDR.  */
+  PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+  /* Write the word DATA into the process's data space at address ADDR.  */
+  PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+  /* Write the word DATA into the process's user area at offset ADDR.  */
+  PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+  /* Continue the process.  */
+  PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+  /* Kill the process.  */
+  PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+  /* Single step the process.  */
+  PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+  /* Attach to a process that is already running. */
+  PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+  /* Detach from a process attached to with PTRACE_ATTACH.  */
+  PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+  /* Continue and stop at the next (return from) syscall.  */
+  PTRACE_SYSCALL = 24
+#define PT_SYSCALL PTRACE_SYSCALL
+};
+
+/* Perform process tracing functions.  REQUEST is one of the values
+   above, and determines the action to be taken.
+   For all requests except PTRACE_TRACEME, PID specifies the process to be
+   traced.
+
+   PID and the other arguments described above for the various requests should
+   appear (those that are used for the particular request) as:
+     pid_t PID, void *ADDR, int DATA, void *ADDR2
+   after REQUEST.  */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/v850/sys/ucontext.h
new file mode 100644
index 0000000..07f0933
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/sys/ucontext.h
@@ -0,0 +1,41 @@
+/* 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 _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+typedef struct sigcontext mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/syscall.c b/ap/build/uClibc/libc/sysdeps/linux/v850/syscall.c
new file mode 100644
index 0000000..dbcc87c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/syscall.c
@@ -0,0 +1,43 @@
+/*
+ * libc/sysdeps/linux/v850/syscall.c -- generic syscall function for linux/v850
+ *
+ *  Copyright (C) 2002  NEC Corporation
+ *  Copyright (C) 2002  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <errno.h>
+#include <sys/syscall.h>
+
+typedef unsigned long arg_t;
+
+/* Invoke `system call' NUM, passing it the remaining arguments.
+   This is completely system-dependent, and not often useful.  */
+long
+syscall (long num, arg_t a1, arg_t a2, arg_t a3, arg_t a4, arg_t a5, arg_t a6)
+{
+  /* We don't know how many arguments are valid, so A5 and A6 are fetched
+     off the stack even for (the majority of) system calls with fewer
+     arguments; hopefully this won't cause any problems.  A1-A4 are in
+     registers, so they're OK.  */
+  register arg_t a __asm__ (SYSCALL_ARG0) = a1;
+  register arg_t b __asm__ (SYSCALL_ARG1) = a2;
+  register arg_t c __asm__ (SYSCALL_ARG2) = a3;
+  register arg_t d __asm__ (SYSCALL_ARG3) = a4;
+  register arg_t e __asm__ (SYSCALL_ARG4) = a5;
+  register arg_t f __asm__ (SYSCALL_ARG5) = a6;
+  register unsigned long syscall __asm__ (SYSCALL_NUM) = num;
+  register unsigned long ret __asm__ (SYSCALL_RET);
+
+  __asm__ ("trap " SYSCALL_LONG_TRAP
+       : "=r" (ret)
+       : "r" (syscall), "r" (a), "r" (b), "r" (c), "r" (d), "r" (e), "r" (f)
+       : SYSCALL_CLOBBERS);
+
+  __syscall_return (long, ret);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/v850/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/v850/vfork.S
new file mode 100644
index 0000000..2533853
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/v850/vfork.S
@@ -0,0 +1,42 @@
+/*
+ * libc/sysdeps/linux/v850/vfork.S -- `vfork' syscall for linux/v850
+ *
+ *  Copyright (C) 2001,2002  NEC Corporation
+ *  Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <features.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+#define _SYSCALL_H
+#include <bits/sysnum.h>
+
+#include <clinkage.h>
+
+/* Clone the calling process, but without copying the whole address space.
+   The calling process is suspended until the new process exits or is
+   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
+   and the process ID of the new process to the old process.  */
+
+.global C_SYMBOL_NAME(errno)
+
+C_ENTRY (__vfork):
+	addi	SYS_vfork, r0, r12
+	trap	0
+	addi	-125, r0, r11		/* minimum err value */
+	cmp	r11, r10
+	bh	1f
+	jmp	[lp]			/* normal return */
+1:	mov	hilo(C_SYMBOL_NAME(errno)), r11
+	subr	r0, r10
+	st.w	r10, 0[r11]
+	jmp	[lp]			/* error return */
+C_END(__vfork)
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/Makefile b/ap/build/uClibc/libc/sysdeps/linux/vax/Makefile
new file mode 100644
index 0000000..b1bf1ef
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/Makefile
@@ -0,0 +1,15 @@
+# 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.
+#
+
+TOPDIR=../../../../
+
+top_srcdir=$(TOPDIR)
+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/vax/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/vax/Makefile.arch
new file mode 100644
index 0000000..027c65f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/Makefile.arch
@@ -0,0 +1,10 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2005-2006 Jan-Benedict Glaw <jbglaw@lug-owl.de>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+CSRC := brk.c mmap.c
+SSRC := __longjmp.S setjmp.S _setjmp.S clone.S
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/vax/__longjmp.S
new file mode 100644
index 0000000..61b37a3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/__longjmp.S
@@ -0,0 +1,47 @@
+#include <features.h>
+
+/*
+ * longjmp.S	atp sept 2001
+ *		Jan-Benedict Glaw <jbglaw@lug-owl.de> 2006
+ *
+ * Restore regs and info and jmp back to a previous setjmp
+ */
+
+.globl	__longjmp
+.align	4
+__longjmp:
+	.word	0x0040		/* This matches setjmp and PLT	*/
+	movl	0x4(%ap), %r0	/* Our scratch reg		*/
+/*	movl	$0, %r0						*/
+/*	movl	(%r0), %r0					*/
+	/* We are going to modify our stack frame		*/
+	/* to the same as that of the setjmp we called earlier	*/
+	movl	(%r0), (%fp)		/* cond handler		*/
+	movl	0x4(%r0), 0x4(%fp)	/* psw			*/
+	movl	0x8(%r0), 0x8(%fp)	/* ap			*/
+	movl	0xc(%r0), 0xc(%fp)	/* fp			*/
+	movl	0x10(%r0), 0x10(%fp)	/* pc			*/
+
+	/* Restore the regs					*/
+	movl	0x14(%r0), %r1
+	movl	0x18(%r0), %r2
+	movl	0x1c(%r0), %r3
+	movl	0x20(%r0), %r4
+	movl	0x24(%r0), %r5
+	movl	0x28(%r0), %r6
+	movl	0x2c(%r0), %r7
+	movl	0x30(%r0), %r8
+	movl	0x34(%r0), %r9
+	movl	0x38(%r0), %r10
+	movl	0x3c(%r0), %r11
+
+	/* Check val and set to 1 if set to zero		*/
+	movl	0x8(%ap), %r0
+	tstl	%r0
+	bneq	exit_ok
+	movl	$0x1, %r0
+exit_ok:
+	ret
+.size __longjmp,.-__longjmp
+libc_hidden_def(__longjmp)
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/vax/_setjmp.S
new file mode 100644
index 0000000..680ddd7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/_setjmp.S
@@ -0,0 +1,53 @@
+.globl _setjmp
+.align 4
+_setjmp:
+	.word	0x0040
+
+	/* push an empty word onto the stack */
+	pushl	$0
+
+	/* now copy handler, psw, ap, fp and pc on the stack up one word */
+	movl	4(%sp), (%sp)		/* copy handler */
+	movl	8(%sp), 4(%sp)		/* psw */
+	movl	12(%sp), 8(%sp)		/* ap */
+	movl	16(%sp), 12(%sp)	/* fp */
+	movl	20(%sp), 16(%sp)	/* pc */
+	movl	24(%sp), 20(%sp)	/* r6 from register mask */
+
+	movl	$2, 24(%sp)		/* set the number of arguments to 2 */
+	movl	32(%sp), 28(%sp)	/* copy the jmp_buf */
+	movl	$1, 32(%sp)		/* put the 1 on the stack */
+
+	addl3	$24, %sp, %ap
+	movl	%sp, %fp
+
+	moval	__sigsetjmp, %r0
+	addl2	$2, %r0
+	pushl	%r0
+	rsb
+
+.globl setjmp
+.align 4
+setjmp:
+	.word	0x0040
+	pushl	$0
+
+	/* now copy handler, psw, ap, fp and pc on the stack up one word */
+	movl	4(%sp), (%sp)
+	movl	8(%sp), 4(%sp)
+	movl	12(%sp), 8(%sp)
+	movl	16(%sp), 12(%sp)
+	movl	20(%sp), 16(%sp)
+	movl	24(%sp), 20(%sp)	/* r6 from register mask */
+
+	movl	$2, 24(%sp)		/* set the number of arguments to 2 */
+	movl	32(%sp), 28(%sp)	/* copy the jmp_buf */
+	movl	$0, 32(%sp)		/* put the 0 on the stack */
+
+	addl3	$24, %sp, %ap
+	movl	%sp, %fp
+
+	moval	__sigsetjmp, %r0
+	addl2	$2, %r0
+	pushl	%r0
+	rsb
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/endian.h
new file mode 100644
index 0000000..9f0c4e2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/endian.h
@@ -0,0 +1,9 @@
+/* VAX is little endian */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
+
+/*#define __FLOAT_WORD_ORDER __BIG_ENDIAN*/
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/fcntl.h
new file mode 100644
index 0000000..66c2812
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/fcntl.h
@@ -0,0 +1,214 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995, 1996, 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#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.  */
+#endif
+
+/* XXX missing */
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE	0
+#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
+
+/* 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.  */
+#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).  */
+
+/* XXX missing */
+#define F_GETLK64	5	/* Get record locking info.  */
+#define F_SETLK64	6	/* Set record locking info (non-blocking).  */
+#define F_SETLKW64	7	/* Set record locking info (blocking).  */
+
+#ifdef __USE_BSD
+# 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]FL.  */
+#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
+
+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/vax/bits/ipc.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/ipc.h
new file mode 100644
index 0000000..c4e3735
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/ipc.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1995, 1996, 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#define IPC_INFO	3		/* See ipcs.  */
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;			/* Key.  */
+    unsigned short int uid;		/* Owner's user ID.  */
+    unsigned short int gid;		/* Owner's group ID.  */
+    unsigned short int cuid;		/* Creator's user ID.  */
+    unsigned short int cgid;		/* Creator's group ID.  */
+    unsigned short int mode;		/* Read/write permission.  */
+    unsigned short int __seq;		/* Sequence number.  */
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/kernel_stat.h
new file mode 100644
index 0000000..a6da833
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/kernel_stat.h
@@ -0,0 +1,50 @@
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+/* This file provides whatever this particular arch's kernel thinks
+ * struct stat should look like...  It turns out each arch has a
+ * different opinion on the subject... */
+
+struct kernel_stat {
+	unsigned short st_dev;
+	unsigned short __pad1;
+	unsigned long st_ino;
+	unsigned short st_mode;
+	unsigned short st_nlink;
+	unsigned short st_uid;
+	unsigned short st_gid;
+	unsigned short st_rdev;
+	unsigned short __pad2;
+	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 short	st_dev;
+	unsigned char	__pad0[10];
+#define _HAVE_STAT64___ST_INO 1
+	unsigned long	__st_ino;
+	unsigned int	st_mode;
+	unsigned int	st_nlink;
+	unsigned long	st_uid;
+	unsigned long	st_gid;
+	unsigned short	st_rdev;
+	unsigned char	__pad3[10];
+	long long	st_size;
+	unsigned long	st_blksize;
+	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
+	unsigned long	__pad4;		/* future possible st_blocks high bits */
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
+	unsigned long long	st_ino;
+};
+
+#endif	/*  _BITS_STAT_STRUCT_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/kernel_types.h
new file mode 100644
index 0000000..aef74b5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/kernel_types.h
@@ -0,0 +1,45 @@
+#ifndef _VAX_POSIX_TYPES_H
+#define _VAX_POSIX_TYPES_H
+/*
+ * 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
+ */
+
+
+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 struct {
+#if defined(__KERNEL__) || defined(__USE_ALL)
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* _VAX_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/machine-gmon.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/machine-gmon.h
new file mode 100644
index 0000000..841518f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/machine-gmon.h
@@ -0,0 +1,41 @@
+/* i386-specific implementation of profiling support.
+   Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   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 <sysdep.h>
+
+/* We need a special version of the `mcount' function since for ix86 it
+   must not clobber any register.  This has several reasons:
+     - there is a bug in gcc as of version 2.7.2.2 which prohibits the
+       use of profiling together with nested functions
+     - the ELF `fixup' function uses GCC's regparm feature
+     - some (future) systems might want to pass parameters in registers.  */
+
+/* We must not pollute the global namespace.  */
+#define mcount_internal __mcount_internal
+
+extern void mcount_internal (u_long frompc, u_long selfpc);
+
+#define _MCOUNT_DECL(frompc, selfpc) \
+void __attribute__ (( regparm (2) )) mcount_internal (u_long frompc, u_long selfpc)
+
+
+/* Define MCOUNT as empty since we have the implementation in another
+   file.  */
+#define MCOUNT
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/sem.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/sem.h
new file mode 100644
index 0000000..c5c04ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/sem.h
@@ -0,0 +1,87 @@
+/* Copyright (C) 1995, 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'.  */
+#define SEM_UNDO	0x1000		/* undo the operation on exit */
+
+/* Commands for `semctl'.  */
+#define GETPID		11		/* get sempid */
+#define GETVAL		12		/* get semval */
+#define GETALL		13		/* get all semval's */
+#define GETNCNT		14		/* get semncnt */
+#define GETZCNT		15		/* get semzcnt */
+#define SETVAL		16		/* set semval */
+#define SETALL		17		/* set all semval's */
+
+
+/* Data structure describing a set of semaphores.  */
+struct semid_ds
+{
+  struct ipc_perm sem_perm;		/* operation permission struct */
+  __time_t sem_otime;			/* last semop() time */
+  unsigned long int __unused1;
+  __time_t sem_ctime;			/* last time changed by semctl() */
+  unsigned long int __unused2;
+  unsigned long int sem_nsems;		/* number of semaphores in set */
+  unsigned long int __unused3;
+  unsigned long int __unused4;
+};
+
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;				<= value for SETVAL
+     struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;		<= array for GETALL & SETALL
+     struct seminfo *__buf;		<= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED	1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct  seminfo
+{
+  int semmap;
+  int semmni;
+  int semmns;
+  int semmnu;
+  int semmsl;
+  int semopm;
+  int semume;
+  int semusz;
+  int semvmx;
+  int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/setjmp.h
new file mode 100644
index 0000000..68a1b32
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/setjmp.h
@@ -0,0 +1,37 @@
+/* Define the machine-dependent type `jmp_buf'.  Vax version. */
+
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+/* we want to save enough that we can use this to fool RET,
+ * So we basically save all of the CALLS stack frame. Plus regs. */
+#ifndef	_ASM
+typedef int __jmp_buf[16];
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf[4]))
+/*
+	jmp_buf layout. jmp_buf[0]
+	void *__cond;		 The condition handler
+	void *__psw;		 mask and PSW bits
+        void *__ap;		 argument pointer
+	void *__fp;		 frame pointer
+	void *__pc;		 program counter
+			         no need to save r0
+	void *__r1;		 regs, r0->r11.
+	void *__r2;		 regs, r0->r11.
+	void *__r3;		 regs, r0->r11.
+	void *__r4;		 regs, r0->r11.
+	void *__r5;		 regs, r0->r11.
+	void *__r6;		 regs, r0->r11.
+	void *__r7;		 regs, r0->r11.
+	void *__r8;		 regs, r0->r11.
+	void *__r9;		 regs, r0->r11.
+	void *__rA;		 regs, r0->r11.
+	void *__rB;		 regs, r0->r11.
+*/
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/shm.h
new file mode 100644
index 0000000..f1a44c9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/shm.h
@@ -0,0 +1,94 @@
+/* Copyright (C) 1995, 1996, 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
+
+#include <sys/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 ())
+extern int __getpagesize (void) __THROW __attribute__ ((__const__));
+
+
+/* Type to count number of attaches.  */
+typedef unsigned short int shmatt_t;
+
+/* Data structure describing a set of semaphores.  */
+struct shmid_ds
+  {
+    struct ipc_perm shm_perm;		/* operation permission struct */
+    int shm_segsz;			/* size of segment in bytes */
+    __time_t shm_atime;			/* time of last shmat() */
+    __time_t shm_dtime;			/* time of last shmdt() */
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+    __pid_t shm_cpid;			/* pid of creator */
+    __pid_t shm_lpid;			/* pid of last shmop */
+    shmatt_t shm_nattch;		/* number of current attaches */
+    unsigned short int __shm_npages;	/* size of segment (pages) */
+    unsigned long int *__shm_pages;	/* array of ptrs to frames -> SHMMAX */
+    struct vm_area_struct *__attaches;	/* descriptors for attaches */
+  };
+
+#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 */
+
+struct	shminfo
+  {
+    int shmmax;
+    int shmmin;
+    int shmmni;
+    int shmseg;
+    int shmall;
+  };
+
+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/vax/bits/sigcontext.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/sigcontext.h
new file mode 100644
index 0000000..97cbf4b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/sigcontext.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996, 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#ifndef sigcontext_struct
+/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
+   we need sigcontext.  */
+# define sigcontext_struct sigcontext
+
+# include <asm/sigcontext.h>
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/stackinfo.h
new file mode 100644
index 0000000..4bdad49
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/stackinfo.h
@@ -0,0 +1,7 @@
+#ifndef _VAX_BITS_STACKINFO_H
+#define _VAX_BITS_STACKINFO_H
+
+/* On VAXen, the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif /* _VAX_BITS_STACKINFO_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/statfs.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/statfs.h
new file mode 100644
index 0000000..31ae564
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/statfs.h
@@ -0,0 +1,61 @@
+/* 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
+
+#include <bits/types.h>  /* for __fsid_t and __fsblkcnt_t*/
+
+struct statfs
+  {
+    int f_type;
+    int f_bsize;
+#ifndef __USE_FILE_OFFSET64
+    __fsblkcnt_t f_blocks;
+    __fsblkcnt_t f_bfree;
+    __fsblkcnt_t f_bavail;
+    __fsfilcnt_t f_files;
+    __fsfilcnt_t f_ffree;
+#else
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+#endif
+    __fsid_t f_fsid;
+    int f_namelen;
+    int f_spare[6];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+  {
+    int f_type;
+    int f_bsize;
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsid_t f_fsid;
+    int f_namelen;
+    int f_spare[6];
+  };
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/syscalls.h
new file mode 100644
index 0000000..101aacb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/syscalls.h
@@ -0,0 +1,258 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+#define SYS_ify(syscall_name)  (__NR_##syscall_name)
+
+#undef _syscall_return
+#define _syscall_return(type)							\
+	do {									\
+		if ((unsigned long) (_sc_ret) >= (unsigned long) (-125)) {	\
+			__set_errno(-_sc_ret);					\
+			_sc_ret = -1;						\
+		}								\
+										\
+		return (type) (_sc_ret);					\
+	} while (0)
+
+#define _syscall_clobbers		\
+	"r1",  "r2",  "r3",  "r4",	\
+	"r5",  "r6",  "r7",  "r8",	\
+	"r9", "r10", "r11"
+
+#ifdef _syscall0
+#	undef _syscall0
+#endif
+#define _syscall0(type, name)						\
+type name (void)							\
+{									\
+	register long _sc_0 __asm__("r0") = SYS_ify (name);		\
+	long _sc_ret;							\
+									\
+	__asm__ __volatile__ (						\
+	"	pushl	%%ap		\n"				\
+	"	pushl	$0x0		\n"				\
+	"	movl	%%sp, %%ap	\n"				\
+	"	chmk	%%r0		\n"				\
+	"	addl2	$4, %%sp	\n"				\
+	"	movl	(%%sp)+, %%ap	\n"				\
+	: "=r" (_sc_0)							\
+	: "0" (_sc_0)							\
+	: _syscall_clobbers);						\
+									\
+	_sc_ret = _sc_0;						\
+	_syscall_return (type);						\
+}
+
+#ifdef _syscall1
+#	undef _syscall1
+#endif
+#define _syscall1(type, name, type1, arg1)				\
+type name (type1 arg1)							\
+{									\
+	register long _sc_0 __asm__("r0") = SYS_ify (name);		\
+	long _sc_ret;							\
+									\
+	__asm__ __volatile__ (						\
+	"	pushl	%%ap		\n"				\
+	"	pushl	%2		\n"				\
+	"	pushl	$0x1		\n"				\
+	"	movl	%%sp, %%ap	\n"				\
+	"	chmk	%%r0		\n"				\
+	"	addl2	$8, %%sp	\n"				\
+	"	movl	(%%sp)+, %%ap	\n"				\
+	: "=r" (_sc_0)							\
+	: "0" (_sc_0),							\
+	  "m" (arg1)							\
+	: _syscall_clobbers);						\
+									\
+	_sc_ret = _sc_0;						\
+	_syscall_return (type);						\
+}
+
+#ifdef _syscall2
+#	undef _syscall2
+#endif
+#define _syscall2(type, name, type1, arg1, type2, arg2)			\
+type name (type1 arg1,							\
+	   type2 arg2)							\
+{									\
+	register long _sc_0 __asm__("r0") = SYS_ify (name);		\
+	long _sc_ret;							\
+									\
+	__asm__ __volatile__ (						\
+	"	pushl	%%ap		\n"				\
+	"	pushl	%3		\n"				\
+	"	pushl	%2		\n"				\
+	"	pushl	$0x2		\n"				\
+	"	movl	%%sp, %%ap	\n"				\
+	"	chmk	%%r0		\n"				\
+	"	addl2	$12, %%sp	\n"				\
+	"	movl	(%%sp)+, %%ap	\n"				\
+	: "=r" (_sc_0)							\
+	: "0" (_sc_0),							\
+	  "m" (arg1),							\
+	  "m" (arg2)							\
+	: _syscall_clobbers);						\
+									\
+	_sc_ret = _sc_0;						\
+	_syscall_return (type);						\
+}
+
+#ifdef _syscall3
+#	undef _syscall3
+#endif
+#define _syscall3(type, name, type1, arg1, type2, arg2, type3, arg3)	\
+type name (type1 arg1,							\
+	   type2 arg2,							\
+	   type3 arg3)							\
+{									\
+	register long _sc_0 __asm__("r0") = SYS_ify (name);		\
+	long _sc_ret;							\
+									\
+	__asm__ __volatile__ (						\
+	"	pushl	%%ap		\n"				\
+	"	pushl	%4		\n"				\
+	"	pushl	%3		\n"				\
+	"	pushl	%2		\n"				\
+	"	pushl	$0x3		\n"				\
+	"	movl	%%sp, %%ap	\n"				\
+	"	chmk	%%r0		\n"				\
+	"	addl2	$16, %%sp	\n"				\
+	"	movl	(%%sp)+, %%ap	\n"				\
+	: "=r" (_sc_0)							\
+	: "0" (_sc_0),							\
+	  "m" (arg1),							\
+	  "m" (arg2),							\
+	  "m" (arg3)							\
+	: _syscall_clobbers);						\
+									\
+	_sc_ret = _sc_0;						\
+	_syscall_return (type);						\
+}
+
+#ifdef _syscall4
+#	undef _syscall4
+#endif
+#define _syscall4(type, name, type1, arg1, type2, arg2, type3, arg3,	\
+		type4, arg4)						\
+type name (type1 arg1,							\
+	   type2 arg2,							\
+	   type3 arg3,							\
+	   type4 arg4)							\
+{									\
+	register long _sc_0 __asm__("r0") = SYS_ify (name);		\
+	long _sc_ret;							\
+									\
+	__asm__ __volatile__ (						\
+	"	pushl	%%ap		\n"				\
+	"	pushl	%5		\n"				\
+	"	pushl	%4		\n"				\
+	"	pushl	%3		\n"				\
+	"	pushl	%2		\n"				\
+	"	pushl	$0x4		\n"				\
+	"	movl	%%sp, %%ap	\n"				\
+	"	chmk	%%r0		\n"				\
+	"	addl2	$20, %%sp	\n"				\
+	"	movl	(%%sp)+, %%ap	\n"				\
+	: "=r" (_sc_0)							\
+	: "0" (_sc_0),							\
+	  "m" (arg1),							\
+	  "m" (arg2),							\
+	  "m" (arg3),							\
+	  "m" (arg4)							\
+	: _syscall_clobbers);						\
+									\
+	_sc_ret = _sc_0;						\
+	_syscall_return (type);						\
+}
+
+#ifdef _syscall5
+#	undef _syscall5
+#endif
+#define _syscall5(type, name, type1, arg1, type2, arg2, type3, arg3,	\
+		type4, arg4, type5, arg5)				\
+type name (type1 arg1,							\
+	   type2 arg2,							\
+	   type3 arg3,							\
+	   type4 arg4,							\
+	   type5 arg5)							\
+{									\
+	register long _sc_0 __asm__("r0") = SYS_ify (name);		\
+	long _sc_ret;							\
+									\
+	__asm__ __volatile__ (						\
+	"	pushl	%%ap		\n"				\
+	"	pushl	%6		\n"				\
+	"	pushl	%5		\n"				\
+	"	pushl	%4		\n"				\
+	"	pushl	%3		\n"				\
+	"	pushl	%2		\n"				\
+	"	pushl	$0x5		\n"				\
+	"	movl	%%sp, %%ap	\n"				\
+	"	chmk	%%r0		\n"				\
+	"	addl2	$24, %%sp	\n"				\
+	"	movl	(%%sp)+, %%ap	\n"				\
+	: "=r" (_sc_0)							\
+	: "0" (_sc_0),							\
+	  "m" (arg1),							\
+	  "m" (arg2),							\
+	  "m" (arg3),							\
+	  "m" (arg4),							\
+	  "m" (arg5)							\
+	: _syscall_clobbers);						\
+									\
+	_sc_ret = _sc_0;						\
+	_syscall_return (type);						\
+}
+
+#ifdef _syscall6
+#	undef _syscall6
+#endif
+#define _syscall6(type, name, type1, arg1, type2, arg2, type3, arg3,	\
+		type4, arg4, type5, arg5, type6, arg6)			\
+type name (type1 arg1,							\
+	   type2 arg2,							\
+	   type3 arg3,							\
+	   type4 arg4,							\
+	   type5 arg5,							\
+	   type6 arg6)							\
+{									\
+	register long _sc_0 __asm__("r0") = SYS_ify (name);		\
+	long _sc_ret;							\
+									\
+	__asm__ __volatile__ (						\
+	"	pushl	%%ap		\n"				\
+	"	pushl	%7		\n"				\
+	"	pushl	%6		\n"				\
+	"	pushl	%5		\n"				\
+	"	pushl	%4		\n"				\
+	"	pushl	%3		\n"				\
+	"	pushl	%2		\n"				\
+	"	pushl	$0x6		\n"				\
+	"	movl	%%sp, %%ap	\n"				\
+	"	chmk	%%r0		\n"				\
+	"	addl2	$28, %%sp	\n"				\
+	"	movl	(%%sp)+, %%ap	\n"				\
+	: "=r" (_sc_0)							\
+	: "0" (_sc_0),							\
+	  "m" (arg1),							\
+	  "m" (arg2),							\
+	  "m" (arg3),							\
+	  "m" (arg4),							\
+	  "m" (arg5),							\
+	  "m" (arg6)							\
+	: _syscall_clobbers);						\
+									\
+	_sc_ret = _sc_0;						\
+	_syscall_return (type);						\
+}
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..f9a7b39
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/uClibc_arch_features.h
@@ -0,0 +1,47 @@
+/*
+ * 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__	"halt"
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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 */
+#undef __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/vax/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/vax/bits/wordsize.h
new file mode 100644
index 0000000..62dad0c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#define __WORDSIZE	32
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/brk.c b/ap/build/uClibc/libc/sysdeps/linux/vax/brk.c
new file mode 100644
index 0000000..c72ae36
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/brk.c
@@ -0,0 +1,53 @@
+/* brk system call for Linux/VAX.
+   Copyright (C) 2000, 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>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+/* This must be initialized data because commons can't have aliases.  */
+void *__curbrk attribute_hidden = NULL;
+
+int
+brk (void *addr)
+{
+	register unsigned long int result __asm__ ("%%r0");
+
+	__asm__ (
+	"	pushl	%%ap		\n"	/* Start frame				*/
+	"	pushl	%2		\n"	/* New top address we wish to get	*/
+	"	pushl	$1		\n"	/* One argument				*/
+	"	movl	%%sp, %%ap	\n"	/* Finish frame				*/
+	"	chmk	%1		\n"	/* Perform the system call		*/
+	"	addl2	$8, %%sp	\n"	/* Remove pushed arg			*/
+	"	movl	(%%sp)+, %%ap	\n"	/* Get back %AP				*/
+	: "=r" (result)
+	: "0" (__NR_brk),
+	  "g" (addr));
+
+	if ((void *) result < addr) {
+		__set_errno (ENOMEM);
+		return -1;
+	} else
+		__curbrk = (void *) result;
+
+	return 0;
+}
+libc_hidden_def(brk)
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/clone.S b/ap/build/uClibc/libc/sysdeps/linux/vax/clone.S
new file mode 100644
index 0000000..086adc6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/clone.S
@@ -0,0 +1,85 @@
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* clone() is even more special than fork() as it mucks with stacks
+   and invokes a function in the right context after its all over.  */
+
+#include <sys/syscall.h>
+
+#warning "This file contains a hardcoded constant for SYS_clone"
+
+.section	.rodata
+		.align 2
+.LC0:		.long 120	/* SYS_clone */
+.align 4
+.text
+.type	clone,@function
+.globl	clone;
+clone:
+	.word 0x0040
+	/* subl2	$8, %sp	*/
+	movl	4(%ap), %r1
+	movl	8(%ap), %r0
+	mcoml	$21, %r6
+
+	/* Sanity check args.  */
+	tstl	%r1
+	jeql	CLONE_ERROR_LABEL
+	tstl	%r0
+	jeql	CLONE_ERROR_LABEL
+
+	/* Need to setup the child stack the same as the parent.  */
+	subl2	$24, %r0
+	movl	16(%ap), 20(%r0)
+	movl	%r1, 16(%r0)
+	movl	%r0, %r1
+	addl2	$16, %r1
+	movl	%r1, 12(%r0)
+
+	/* Do the system call.  */
+	pushl	%ap
+	pushl	%r0
+        pushl	12(%ap)
+	pushl	$0x2
+	movl	%sp, %ap
+        chmk	.LC0	/* %r0 .LC0 -4(%fp) -8(%fp) */
+	addl2	$12, %sp
+	movl	(%sp)+, %ap
+	movl	%r0, %r6
+	jneq	CLONE_ERROR_LABEL
+
+	movl	$0, %fp
+	pushl	4(%ap)
+	movl	(%r1), %r0
+	calls	$1, (%r0)
+	pushl	%r0
+	calls	$1, HIDDEN_JUMPTARGET(_exit)
+
+CLONE_ERROR_LABEL:
+	cmpl	%r6, $-126	/* -ENOKEY?!?! Fuck, this must be wrong! FIXME */
+	jlequ	CLONE_RETURN_LABEL
+	calls	$0, __errno_location
+	mnegl	%r6, (%r0)
+	mcoml	$0, %r6
+	movl	%r6, %r0
+	ret
+
+CLONE_RETURN_LABEL:
+	ret
+
+.size clone,.-clone
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/vax/crt1.S
new file mode 100644
index 0000000..7096098
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/crt1.S
@@ -0,0 +1,73 @@
+/*
+ * crt0 for VAX
+ */
+
+/*
+ * Program stack looks like:
+ * sp->	argc            argument counter (integer)
+ *	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
+ */
+
+#include <features.h>
+
+.text
+.align 4
+
+.global __start
+__start:
+.global _start
+_start:
+	/* Kernel uses a_interp + 2, so __start isn't exactly CALLSed,	*/
+	/* but we need to have two bytes here, so we use NOPs. This	*/
+	/* won't hurt, though R0 would be invalid to push, but at	*/
+	/* lease this looks like a real function.			*/
+	.word	0x0101
+
+	movl	$0, %fp			/* FP = 0, since this is the	*/
+					/* top-most stack frame		*/
+	movl	%sp, %r0		/* R0 = %sp			*/
+	movl	(%sp)+, %r4		/* R4 = argc			*/
+	movl	%sp, %r3		/* R3 = argv = &argv[0]		*/
+
+#if (defined L_crt1 || defined L_gcrt1) && defined __UCLIBC_CTOR_DTOR__
+	pushl	%r0	/* stack_end					*/
+	pushl	$0	/* rtld_fini. This is probably needed for the	*/
+			/* case where a dynamic linker is involved. So	*/
+			/* this is an open FIXME that needs to be	*/
+			/* addressed at some time...			*/
+	pushl	$_fini
+	pushl	$_init
+	pushl	%r3	/* Argument pointer				*/
+	pushl	%r4	/* And the argument count			*/
+	pushl	$main	/* main()					*/
+
+	/* We need to call __uClibc_main which should not return.
+	 * __uClibc_main (int (*main) (int, char **, char **),
+	 *                int argc,
+	 *                char **argv,
+	 *                void (*init) (void),
+	 *                void (*fini) (void),
+	 *                void (*rtld_fini) (void),
+	 *                void *stack_end);
+	 */
+	calls	$7, __uClibc_main
+#else /* FIXME: THIS IS BROKEN!!! */
+	/* start to load the arguments from the stack */
+	/* arguments are on ap stack */
+	pushl	%r2
+	pushl	%r3
+	pushl	%r4
+
+	calls	$3, __uClibc_main
+#endif
+
+	/* The above __uClibc_start_main() shouldn't ever return. If it	*/
+	/* does, we just crash.						*/
+	halt
+.align 2
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/crti.S b/ap/build/uClibc/libc/sysdeps/linux/vax/crti.S
new file mode 100644
index 0000000..0056478
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/crti.S
@@ -0,0 +1,21 @@
+	.file	"initfini.c"
+	.version	"01.01"
+gcc2_compiled.:
+__gnu_compiled_c:
+	.section .init
+	.align 1
+.globl _init
+	.type	 _init,@function
+_init:
+	.word 0x0000
+
+	.align 1
+
+	.section .fini
+	.align 1
+.globl _fini
+	.type	 _fini,@function
+_fini:
+	.word 0x0000
+	.align 1
+	.ident	"GCC: (GNU) 2.95.2 19991024 (release) (Linux/VAX CVS)"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/vax/crtn.S
new file mode 100644
index 0000000..1153fd5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/crtn.S
@@ -0,0 +1,19 @@
+	.file	"initfini.c"
+	.version	"01.01"
+gcc2_compiled.:
+__gnu_compiled_c:
+
+	.section .init
+	.align 1
+.globl _init
+	.type	 _init,@function
+	ret
+.Lfe2:
+
+	.section .fini
+	.align 1
+.globl _fini
+	.type	 _fini,@function
+	ret
+.Lfe3:
+	.ident	"GCC: (GNU) 2.95.2 19991024 (release) (Linux/VAX CVS)"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/vax/mmap.c
new file mode 100644
index 0000000..2bc347f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/mmap.c
@@ -0,0 +1,10 @@
+
+#include <unistd.h>
+#include <sys/mman.h>
+#include <errno.h>
+#include <sys/syscall.h>
+
+_syscall6 (void *, mmap, void *, start, size_t, length, int, prot, int, flags,
+		int, fd, off_t, offset)
+libc_hidden_def(mmap)
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/vax/setjmp.S
new file mode 100644
index 0000000..bdbde4b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/setjmp.S
@@ -0,0 +1,39 @@
+
+/*
+ * setjmp.S	atp. Sept. 2001
+ *		Jan-Benedict Glaw <jbglaw@lug-owl.de> 2006
+ *
+ * Save regs and info needed for a longjmp
+ */
+
+.globl __sigsetjmp
+.align 4
+__sigsetjmp:
+	.word	0x0000		/* We look after reg saving here - this	*/
+				/* must match longjmp.			*/
+	movl	0x4(%ap), %r0	/* Our scratch reg			*/
+	/* kenn would probably use movq here. :-)			*/
+	movl	%r1, 0x14(%r0)	/* save regs				*/
+	movl	%r2, 0x18(%r0)
+	movl	%r3, 0x1c(%r0)
+	movl	%r4, 0x20(%r0)
+	movl	%r5, 0x24(%r0)
+	movl	%r6, 0x28(%r0)
+	movl	%r7, 0x2c(%r0)
+	movl	%r8, 0x30(%r0)
+	movl	%r9, 0x34(%r0)
+	movl	%r10, 0x38(%r0)
+	movl	%r11, 0x3c(%r0)
+	/* Now save our call frame					*/
+	movl	(%fp), (%r0)		/* Condition handler (for VMS emulation) */
+	movl	0x4(%fp), 0x4(%r0)	/* psw				*/
+	movl	0x8(%fp), 0x8(%r0)	/* ap				*/
+	movl	0xc(%fp), 0xc(%r0)	/* fp				*/
+	movl	0x10(%fp), 0x10(%r0)	/* pc				*/
+	/* Call the sigjmp save routine					*/
+	pushl	8(%ap)
+	pushl	%r0
+	calls	$2, __sigjmp_save
+	/* Done								*/
+	ret
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/vax/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/vax/sys/procfs.h
new file mode 100644
index 0000000..9c23350
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/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_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers.  */
+typedef struct user_regs_struct 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/vax/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/vax/sys/ucontext.h
new file mode 100644
index 0000000..f57b91e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/vax/sys/ucontext.h
@@ -0,0 +1,80 @@
+/* Copyright (C) 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.  */
+
+/* Don't rely on this, the interface is currently messed up and may need to
+   be broken to be fixed.  */
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+
+/* Type for general register.  */
+typedef unsigned long int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	37
+#define NFPREG	33
+
+/* Container for all general registers.  */
+/* gregset_t must be an array.  The below declared array corresponds to:
+typedef struct gregset {
+	greg_t	g_regs[32];
+	greg_t	g_hi;
+	greg_t	g_lo;
+	greg_t	g_pad[3];
+} gregset_t;  */
+typedef greg_t gregset_t[NGREG];
+
+/* Container for all FPU registers.  */
+typedef struct fpregset {
+	union {
+		double	fp_dregs[32];
+		struct {
+			float		_fp_fregs;
+			unsigned int	_fp_pad;
+		} fp_fregs[32];
+	} fp_r;
+	unsigned int	fp_csr;
+	unsigned int	fp_pad;
+} fpregset_t;
+
+
+/* Context to describe whole processor state.  */
+typedef struct
+  {
+    gregset_t gregs;
+    fpregset_t fpregs;
+  } mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/Makefile b/ap/build/uClibc/libc/sysdeps/linux/x86_64/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/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/x86_64/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/x86_64/Makefile.arch
new file mode 100644
index 0000000..3243d86
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/Makefile.arch
@@ -0,0 +1,22 @@
+# 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 __syscall_error.c sigaction.c mmap.c
+
+SSRC := \
+	__longjmp.S setjmp.S syscall.S bsd-setjmp.S bsd-_setjmp.S
+
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+SSRC += vfork.S clone.S
+endif
+
+ifeq ($(UCLIBC_LINUX_SPECIFIC),y)
+ARCH_OBJ_FILTEROUT = sched_getcpu.c
+ifeq ($(UCLIBC_HAS_TLS),y)
+SSRC += sched_getcpu.S
+endif
+endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/x86_64/__longjmp.S
new file mode 100644
index 0000000..db2928b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/__longjmp.S
@@ -0,0 +1,46 @@
+/* Copyright (C) 2001, 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.  */
+
+#include <features.h>
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+/* Jump to the position specified by ENV, causing the
+   setjmp call there to return VAL, or 1 if VAL is 0.
+   void __longjmp (__jmp_buf env, int val).  */
+.global __longjmp
+.type   __longjmp,%function
+__longjmp:
+	/* Restore registers.  */
+	movq (JB_RBX*8)(%rdi),%rbx
+	movq (JB_RBP*8)(%rdi),%rbp
+	movq (JB_R12*8)(%rdi),%r12
+	movq (JB_R13*8)(%rdi),%r13
+	movq (JB_R14*8)(%rdi),%r14
+	movq (JB_R15*8)(%rdi),%r15
+	/* Set return value for setjmp.  */
+	test %esi,%esi
+	mov $01,%eax
+	cmove %eax,%esi
+	mov %esi, %eax
+	movq (JB_PC*8)(%rdi),%rdx
+	movq (JB_RSP*8)(%rdi),%rsp
+	jmpq *%rdx
+.size __longjmp,.-__longjmp
+libc_hidden_def(__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/__syscall_error.c b/ap/build/uClibc/libc/sysdeps/linux/x86_64/__syscall_error.c
new file mode 100644
index 0000000..448f509
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/__syscall_error.c
@@ -0,0 +1,21 @@
+/* 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(void) attribute_hidden;
+int __syscall_error(void)
+{
+	register int err_no __asm__ ("%rcx");
+	__asm__ ("mov %rax, %rcx\n\t"
+	         "neg %rcx");
+	__set_errno(err_no);
+	return -1;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/atomic.h
new file mode 100644
index 0000000..6739afa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/atomic.h
@@ -0,0 +1,324 @@
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   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 <stdint.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 int16_t atomic16_t;
+typedef uint16_t uatomic16_t;
+typedef int_fast16_t atomic_fast16_t;
+typedef uint_fast16_t uatomic_fast16_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 int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+typedef int_fast64_t atomic_fast64_t;
+typedef uint_fast64_t uatomic_fast64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+
+#ifndef LOCK_PREFIX
+# ifdef UP
+#  define LOCK_PREFIX	/* nothing */
+# else
+#  define LOCK_PREFIX "lock;"
+# endif
+#endif
+
+
+#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
+  ({ __typeof (*mem) ret;						      \
+     __asm__ __volatile__ (LOCK_PREFIX "cmpxchgb %b2, %1"		      \
+		       : "=a" (ret), "=m" (*mem)			      \
+		       : "q" (newval), "m" (*mem), "0" (oldval));	      \
+     ret; })
+
+#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
+  ({ __typeof (*mem) ret;						      \
+     __asm__ __volatile__ (LOCK_PREFIX "cmpxchgw %w2, %1"		      \
+		       : "=a" (ret), "=m" (*mem)			      \
+		       : "r" (newval), "m" (*mem), "0" (oldval));	      \
+     ret; })
+
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+  ({ __typeof (*mem) ret;						      \
+     __asm__ __volatile__ (LOCK_PREFIX "cmpxchgl %2, %1"		      \
+		       : "=a" (ret), "=m" (*mem)			      \
+		       : "r" (newval), "m" (*mem), "0" (oldval));	      \
+     ret; })
+
+#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+  ({ __typeof (*mem) ret;						      \
+     __asm__ __volatile__ (LOCK_PREFIX "cmpxchgq %q2, %1"		      \
+		       : "=a" (ret), "=m" (*mem)			      \
+		       : "r" ((long) (newval)), "m" (*mem),		      \
+			 "0" ((long) (oldval)));			      \
+     ret; })
+
+
+/* Note that we need no lock prefix.  */
+#define atomic_exchange_acq(mem, newvalue) \
+  ({ __typeof (*mem) result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ ("xchgb %b0, %1"				      \
+			 : "=r" (result), "=m" (*mem)			      \
+			 : "0" (newvalue), "m" (*mem));			      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ ("xchgw %w0, %1"				      \
+			 : "=r" (result), "=m" (*mem)			      \
+			 : "0" (newvalue), "m" (*mem));			      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ ("xchgl %0, %1"				      \
+			 : "=r" (result), "=m" (*mem)			      \
+			 : "0" (newvalue), "m" (*mem));			      \
+     else								      \
+       __asm__ __volatile__ ("xchgq %q0, %1"				      \
+			 : "=r" (result), "=m" (*mem)			      \
+			 : "0" ((long) (newvalue)), "m" (*mem));	      \
+     result; })
+
+
+#define atomic_exchange_and_add(mem, value) \
+  ({ __typeof (*mem) result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "xaddb %b0, %1"		      \
+			 : "=r" (result), "=m" (*mem)			      \
+			 : "0" (value), "m" (*mem));			      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "xaddw %w0, %1"		      \
+			 : "=r" (result), "=m" (*mem)			      \
+			 : "0" (value), "m" (*mem));			      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "xaddl %0, %1"			      \
+			 : "=r" (result), "=m" (*mem)			      \
+			 : "0" (value), "m" (*mem));			      \
+     else								      \
+       __asm__ __volatile__ (LOCK_PREFIX "xaddq %q0, %1"		      \
+			 : "=r" (result), "=m" (*mem)			      \
+			 : "0" ((long) (value)), "m" (*mem));		      \
+     result; })
+
+
+#define atomic_add(mem, value) \
+  (void) ({ if (__builtin_constant_p (value) && (value) == 1)		      \
+	      atomic_increment (mem);					      \
+	    else if (__builtin_constant_p (value) && (value) == 1)	      \
+	      atomic_decrement (mem);					      \
+	    else if (sizeof (*mem) == 1)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "addb %b1, %0"		      \
+				: "=m" (*mem)				      \
+				: "ir" (value), "m" (*mem));		      \
+	    else if (sizeof (*mem) == 2)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "addw %w1, %0"		      \
+				: "=m" (*mem)				      \
+				: "ir" (value), "m" (*mem));		      \
+	    else if (sizeof (*mem) == 4)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "addl %1, %0"		      \
+				: "=m" (*mem)				      \
+				: "ir" (value), "m" (*mem));		      \
+	    else							      \
+	      __asm__ __volatile__ (LOCK_PREFIX "addq %q1, %0"		      \
+				: "=m" (*mem)				      \
+				: "ir" ((long) (value)), "m" (*mem));	      \
+	    })
+
+
+#define atomic_add_negative(mem, value) \
+  ({ unsigned char __result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "addb %b2, %0; sets %1"	      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" (value), "m" (*mem));			      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "addw %w2, %0; sets %1"	      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" (value), "m" (*mem));			      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "addl %2, %0; sets %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" (value), "m" (*mem));			      \
+     else								      \
+       __asm__ __volatile__ (LOCK_PREFIX "addq %q2, %0; sets %1"	      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" ((long) (value)), "m" (*mem));		      \
+     __result; })
+
+
+#define atomic_add_zero(mem, value) \
+  ({ unsigned char __result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "addb %b2, %0; setz %1"	      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" (value), "m" (*mem));			      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "addw %w2, %0; setz %1"	      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" (value), "m" (*mem));			      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "addl %2, %0; setz %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" (value), "m" (*mem));			      \
+     else								      \
+       __asm__ __volatile__ (LOCK_PREFIX "addq %q2, %0; setz %1"	      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "ir" ((long) (value)), "m" (*mem));		      \
+     __result; })
+
+
+#define atomic_increment(mem) \
+  (void) ({ if (sizeof (*mem) == 1)					      \
+	      __asm__ __volatile__ (LOCK_PREFIX "incb %b0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else if (sizeof (*mem) == 2)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "incw %w0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else if (sizeof (*mem) == 4)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "incl %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else							      \
+	      __asm__ __volatile__ (LOCK_PREFIX "incq %q0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    })
+
+
+#define atomic_increment_and_test(mem) \
+  ({ unsigned char __result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "incb %b0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "incw %w0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "incl %0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else								      \
+       __asm__ __volatile__ (LOCK_PREFIX "incq %q0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     __result; })
+
+
+#define atomic_decrement(mem) \
+  (void) ({ if (sizeof (*mem) == 1)					      \
+	      __asm__ __volatile__ (LOCK_PREFIX "decb %b0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else if (sizeof (*mem) == 2)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "decw %w0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else if (sizeof (*mem) == 4)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "decl %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    else							      \
+	      __asm__ __volatile__ (LOCK_PREFIX "decq %q0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem));				      \
+	    })
+
+
+#define atomic_decrement_and_test(mem) \
+  ({ unsigned char __result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "decb %b0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "decw %w0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "decl %0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     else								      \
+       __asm__ __volatile__ (LOCK_PREFIX "decq %q0; sete %1"		      \
+			 : "=m" (*mem), "=qm" (__result)		      \
+			 : "m" (*mem));					      \
+     __result; })
+
+
+#define atomic_bit_set(mem, bit) \
+  (void) ({ if (sizeof (*mem) == 1)					      \
+	      __asm__ __volatile__ (LOCK_PREFIX "orb %b2, %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem), "ir" (1L << (bit)));	      \
+	    else if (sizeof (*mem) == 2)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "orw %w2, %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem), "ir" (1L << (bit)));	      \
+	    else if (sizeof (*mem) == 4)				      \
+	      __asm__ __volatile__ (LOCK_PREFIX "orl %2, %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem), "ir" (1L << (bit)));	      \
+	    else if (__builtin_constant_p (bit) && (bit) < 32)		      \
+	      __asm__ __volatile__ (LOCK_PREFIX "orq %2, %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem), "i" (1L << (bit)));	      \
+	    else							      \
+	      __asm__ __volatile__ (LOCK_PREFIX "orq %q2, %0"		      \
+				: "=m" (*mem)				      \
+				: "m" (*mem), "r" (1UL << (bit)));	      \
+	    })
+
+
+#define atomic_bit_test_set(mem, bit) \
+  ({ unsigned char __result;						      \
+     if (sizeof (*mem) == 1)						      \
+       __asm__ __volatile__ (LOCK_PREFIX "btsb %3, %1; setc %0"		      \
+			 : "=q" (__result), "=m" (*mem)			      \
+			 : "m" (*mem), "ir" (bit));			      \
+     else if (sizeof (*mem) == 2)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "btsw %3, %1; setc %0"		      \
+			 : "=q" (__result), "=m" (*mem)			      \
+			 : "m" (*mem), "ir" (bit));			      \
+     else if (sizeof (*mem) == 4)					      \
+       __asm__ __volatile__ (LOCK_PREFIX "btsl %3, %1; setc %0"		      \
+			 : "=q" (__result), "=m" (*mem)			      \
+			 : "m" (*mem), "ir" (bit));			      \
+     else								      \
+       __asm__ __volatile__ (LOCK_PREFIX "btsq %3, %1; setc %0"		      \
+			 : "=q" (__result), "=m" (*mem)			      \
+			 : "m" (*mem), "ir" (bit));			      \
+     __result; })
+
+
+#define atomic_delay() __asm__ ("rep; nop")
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/byteswap.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/byteswap.h
new file mode 100644
index 0000000..a9cf23d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/byteswap.h
@@ -0,0 +1,68 @@
+/* Macros to swap the order of bytes in integer values.
+   Copyright (C) 1997, 1998, 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.  */
+
+#ifndef _ASM_BITS_BYTESWAP_H
+#define _ASM_BITS_BYTESWAP_H 1
+
+#include <bits/wordsize.h>
+
+#define __bswap_non_constant_16(x) \
+     (__extension__							      \
+      ({ register unsigned short int __v;				      \
+	 __asm__ ("rorw $8, %w0"					      \
+		  : "=r" (__v)						      \
+		  : "0" (x)						      \
+		  : "cc");						      \
+	 __v; }))
+
+#if __WORDSIZE == 64 || (defined __i486__ || defined __pentium__	      \
+		     || defined __pentiumpro__ || defined __pentium4__	      \
+		     || defined __k8__ || defined __athlon__		      \
+		     || defined __k6__)
+/* To swap the bytes in a word the i486 processors and up provide the
+   `bswap' opcode.  On i386 we have to use three instructions.  */
+# define __bswap_non_constant_32(x) \
+     (__extension__							      \
+      ({ register unsigned int __v;					      \
+	 __asm__ ("bswap %0" : "=r" (__v) : "0" (x));			      \
+	 __v; }))
+#else
+# define __bswap_non_constant_32(x) \
+     (__extension__							      \
+      ({ register unsigned int __v;					      \
+	 __asm__ ("rorw $8, %w0;"					      \
+		  "rorl $16, %0;"					      \
+		  "rorw $8, %w0"					      \
+		  : "=r" (__v)						      \
+		  : "0" (x)						      \
+		  : "cc");						      \
+	 __v; }))
+#endif
+
+#if __WORDSIZE == 64
+# define __bswap_non_constant_64(x) \
+     (__extension__							      \
+      ({ register unsigned long __v;					      \
+	 __asm__ ("bswap %q0" : "=r" (__v) : "0" (x));			      \
+	 __v; }))
+#endif
+
+#endif
+
+#include <bits/byteswap-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/endian.h
new file mode 100644
index 0000000..2f59ead
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/endian.h
@@ -0,0 +1,7 @@
+/* x86_64 is little-endian.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/environments.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/environments.h
new file mode 100644
index 0000000..a51a564
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/environments.h
@@ -0,0 +1,87 @@
+/* Copyright (C) 1999, 2001, 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 _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _POSIX_V6_ILP32_OFF32   32bit int, long, pointers, and off_t type
+   _POSIX_V6_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
+
+   _POSIX_V6_LP64_OFF32	   64bit long and pointers and 32bit off_t type
+   _POSIX_V6_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and
+   _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard
+   and are available only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* Environments with 32-bit wide pointers are optionally provided.
+   Therefore following macros aren't defined:
+   # undef _POSIX_V6_ILP32_OFF32
+   # undef _POSIX_V6_ILP32_OFFBIG
+   # undef _XBS5_ILP32_OFF32
+   # undef _XBS5_ILP32_OFFBIG
+   and users need to check at runtime.  */
+
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
+# define _POSIX_V6_LP64_OFF64	1
+# define _XBS5_LP64_OFF64	1
+
+#else /* __WORDSIZE == 32 */
+
+/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
+   and all platforms support LFS.  */
+# define _POSIX_V6_ILP32_OFF32	1
+# define _POSIX_V6_ILP32_OFFBIG	1
+# define _XBS5_ILP32_OFF32	1
+# define _XBS5_ILP32_OFFBIG	1
+
+/* We optionally provide an environment with the above size but an 64-bit
+   side `off_t'.  Therefore we don't define _XBS5_ILP32_OFFBIG.  */
+
+/* Environments with 64-bit wide pointers can be provided,
+   so these macros aren't defined:
+   # undef _POSIX_V6_LP64_OFF64
+   # undef _POSIX_V6_LPBIG_OFFBIG
+   # undef _XBS5_LP64_OFF64
+   # undef _XBS5_LPBIG_OFFBIG
+   and sysconf tests for it at runtime.  */
+
+#endif /* __WORDSIZE == 32 */
+
+#define __ILP32_OFF32_CFLAGS	"-m32"
+#define __ILP32_OFFBIG_CFLAGS	"-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+#define __ILP32_OFF32_LDFLAGS	"-m32"
+#define __ILP32_OFFBIG_LDFLAGS	"-m32"
+#define __LP64_OFF64_CFLAGS	"-m64"
+#define __LP64_OFF64_LDFLAGS	"-m64"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/epoll.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/epoll.h
new file mode 100644
index 0000000..be1f5a6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/epoll.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 2002-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_EPOLL_H
+# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+#endif
+
+/* Flags to be passed to epoll_create1.  */
+enum
+  {
+    EPOLL_CLOEXEC = 02000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 00004000
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
+
+#define __EPOLL_PACKED __attribute__ ((__packed__))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/fcntl.h
new file mode 100644
index 0000000..f1cf388
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/fcntl.h
@@ -0,0 +1,253 @@
+/* O_*, F_*, FD_* bit values for Linux/x86-64.
+   Copyright (C) 2001, 2002, 2004, 2006, 2007 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>
+#include <bits/wordsize.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_DIRECT	 040000	/* Direct disk access.	*/
+# define O_DIRECTORY	0200000	/* Must be a directory.	 */
+# define O_NOFOLLOW	0400000	/* Do not follow links.	 */
+# define O_NOATIME     01000000 /* Do not set atime.  */
+# define O_CLOEXEC     02000000 /* Set close_on_exec.  */
+#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
+# if __WORDSIZE == 64
+#  define O_LARGEFILE	0
+# else
+#  define O_LARGEFILE	0100000
+# endif
+#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.  */
+#if __WORDSIZE == 64
+# 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).	*/
+/* Not necessary, we always have 64-bit offsets.  */
+# define F_GETLK64	5	/* Get record locking info.  */
+# define F_SETLK64	6	/* Set record locking info (non-blocking).  */
+# define F_SETLKW64	7	/* Set record locking info (blocking).	*/
+#else
+# 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).	*/
+#endif
+
+#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/x86_64/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/fenv.h
new file mode 100644
index 0000000..11859f0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/fenv.h
@@ -0,0 +1,97 @@
+/* Copyright (C) 1997,1998,1999,2000,2001,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 _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+
+/* Define bits representing the exception.  We use the bit positions
+   of the appropriate bits in the FPU control word.  */
+enum
+  {
+    FE_INVALID = 0x01,
+#define FE_INVALID	FE_INVALID
+    __FE_DENORM = 0x02,
+    FE_DIVBYZERO = 0x04,
+#define FE_DIVBYZERO	FE_DIVBYZERO
+    FE_OVERFLOW = 0x08,
+#define FE_OVERFLOW	FE_OVERFLOW
+    FE_UNDERFLOW = 0x10,
+#define FE_UNDERFLOW	FE_UNDERFLOW
+    FE_INEXACT = 0x20
+#define FE_INEXACT	FE_INEXACT
+  };
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The ix87 FPU supports all of the four defined rounding modes.  We
+   use again the bit positions in the FPU control word as the values
+   for the appropriate macros.  */
+enum
+  {
+    FE_TONEAREST = 0,
+#define FE_TONEAREST	FE_TONEAREST
+    FE_DOWNWARD = 0x400,
+#define FE_DOWNWARD	FE_DOWNWARD
+    FE_UPWARD = 0x800,
+#define FE_UPWARD	FE_UPWARD
+    FE_TOWARDZERO = 0xc00
+#define FE_TOWARDZERO	FE_TOWARDZERO
+  };
+
+
+/* Type representing exception flags.  */
+typedef unsigned short int fexcept_t;
+
+
+/* Type representing floating-point environment.  This structure
+   corresponds to the layout of the block written by the `fstenv'
+   instruction and has additional fields for the contents of the MXCSR
+   register as written by the `stmxcsr' instruction.  */
+typedef struct
+  {
+    unsigned short int __control_word;
+    unsigned short int __unused1;
+    unsigned short int __status_word;
+    unsigned short int __unused2;
+    unsigned short int __tags;
+    unsigned short int __unused3;
+    unsigned int __eip;
+    unsigned short int __cs_selector;
+    unsigned int __opcode:11;
+    unsigned int __unused4:5;
+    unsigned int __data_offset;
+    unsigned short int __data_selector;
+    unsigned short int __unused5;
+#if __WORDSIZE == 64
+    unsigned int __mxcsr;
+#endif
+  }
+fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((__const fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exception is masked.  */
+# define FE_NOMASK_ENV	((__const fenv_t *) -2)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/kernel_stat.h
new file mode 100644
index 0000000..e194a7f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/kernel_stat.h
@@ -0,0 +1,30 @@
+/* Ripped from linux/include/asm-x86_64/stat.h
+ * and renamed 'struct stat' to 'struct kernel_stat' */
+
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+struct kernel_stat {
+	unsigned long  st_dev;
+	unsigned long  st_ino;
+	unsigned long  st_nlink;
+
+	unsigned int   st_mode;
+	unsigned int   st_uid;
+	unsigned int   st_gid;
+	unsigned int   __pad0;
+	unsigned long  st_rdev;
+	long           st_size;
+	long           st_blksize;
+	long           st_blocks;    /* Number 512-byte blocks allocated. */
+
+	struct timespec st_atim;
+	struct timespec st_mtim;
+	struct timespec st_ctim;
+	long           __unused[3];
+};
+
+/* x86-64 stat64 is same as stat */
+#define kernel_stat64 kernel_stat
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/kernel_types.h
new file mode 100644
index 0000000..0cae08c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/kernel_types.h
@@ -0,0 +1,55 @@
+/* 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
+ */
+
+/* a hack for compiling a 32 bit user space with 64 bit
+ * kernel on x86_64  */
+#if !defined(__ARCH_I386_POSIX_TYPES_H) && \
+    !defined(_ASM_X86_64_POSIX_TYPES_H) && \
+    !defined(_ASM_X86_POSIX_TYPES_32_H) && \
+    !defined(_ASM_X86_POSIX_TYPES_64_H)
+#define _ASM_X86_64_POSIX_TYPES_H
+#define __ARCH_I386_POSIX_TYPES_H
+#define _ASM_X86_POSIX_TYPES_32_H
+#define _ASM_X86_POSIX_TYPES_64_H
+
+typedef unsigned long	__kernel_dev_t;
+typedef unsigned long	__kernel_ino_t;
+typedef unsigned int	__kernel_mode_t;
+typedef unsigned long	__kernel_nlink_t;
+typedef long		__kernel_off_t;
+typedef int		__kernel_pid_t;
+typedef int		__kernel_ipc_pid_t;
+typedef unsigned int	__kernel_uid_t;
+typedef unsigned int	__kernel_gid_t;
+typedef unsigned long	__kernel_size_t;
+typedef long		__kernel_ssize_t;
+typedef long		__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 __kernel_dev_t	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+typedef long long	__kernel_loff_t;
+
+typedef struct {
+#ifdef __USE_ALL
+	int val[2];
+#else
+	int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/mathdef.h
new file mode 100644
index 0000000..b0567e4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/mathdef.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2001, 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
+
+# include <bits/wordsize.h>
+
+# if __WORDSIZE == 64 || (defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 0)
+/* The x86-64 architecture computes values with the precission of the
+   used type.  Similarly for -m32 -mfpmath=sse.  */
+typedef float float_t;		/* `float' expressions are evaluated as `float'.  */
+typedef double double_t;	/* `double' expressions are evaluated
+				   as `double'.  */
+# else
+/* The ix87 FPUs evaluate all values in the 80 bit floating-point format
+   which is also available for the user as `long double'.  Therefore we
+   define:  */
+typedef long double float_t;	/* `float' expressions are evaluated as
+				   `long double'.  */
+typedef long double double_t;	/* `double' expressions are evaluated as
+				   `long double'.  */
+# endif
+
+/* The values returned by `ilogb' for 0 and NaN respectively.  */
+# define FP_ILOGB0	(-2147483647 - 1)
+# define FP_ILOGBNAN	(-2147483647 - 1)
+
+#endif	/* ISO C99 */
+
+#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/mathinline.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/mathinline.h
new file mode 100644
index 0000000..39d11b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/mathinline.h
@@ -0,0 +1,53 @@
+/* Inline math functions for x86-64.
+   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Jaeger <aj@suse.de>, 2002.
+
+   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/mathinline.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __cplusplus
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE extern __inline
+#endif
+
+
+#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
+
+/* Test for negative number.  Used in the signbit() macro.  */
+__MATH_INLINE int
+__NTH (__signbitf (float __x))
+{
+  __extension__ union { float __f; int __i; } __u = { __f: __x };
+  return __u.__i < 0;
+}
+__MATH_INLINE int
+__NTH (__signbit (double __x))
+{
+  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+  return __u.__i[1] < 0;
+}
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
+{
+  __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
+  return (__u.__i[2] & 0x8000) != 0;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/mman.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/mman.h
new file mode 100644
index 0000000..a0b7a0e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/mman.h
@@ -0,0 +1,4 @@
+#ifdef __USE_MISC
+# define MAP_32BIT	0x40		/* Only give out 32-bit addresses.  */
+#endif
+#include <bits/mman-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/msq.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/msq.h
new file mode 100644
index 0000000..422218a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/msq.h
@@ -0,0 +1,83 @@
+/* Copyright (C) 1995, 1996, 1997, 2000, 2002 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_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Define options for message queue functions.  */
+#define MSG_NOERROR	010000	/* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT	020000	/* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition.  */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+/* Structure of record for one message inside the kernel.
+   The type `struct msg' is opaque.  */
+struct msqid_ds
+{
+  struct ipc_perm msg_perm;	/* structure describing operation permission */
+  __time_t msg_stime;		/* time of last msgsnd command */
+#if __WORDSIZE == 32
+  unsigned long int __unused1;
+#endif
+  __time_t msg_rtime;		/* time of last msgrcv command */
+#if __WORDSIZE == 32
+  unsigned long int __unused2;
+#endif
+  __time_t msg_ctime;		/* time of last change */
+#if __WORDSIZE == 32
+  unsigned long int __unused3;
+#endif
+  unsigned long int __msg_cbytes; /* current number of bytes on queue */
+  msgqnum_t msg_qnum;		/* number of messages currently on queue */
+  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
+  __pid_t msg_lspid;		/* pid of last msgsnd() */
+  __pid_t msg_lrpid;		/* pid of last msgrcv() */
+  unsigned long int __unused4;
+  unsigned long int __unused5;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes	__msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+  {
+    int msgpool;
+    int msgmap;
+    int msgmax;
+    int msgmnb;
+    int msgmni;
+    int msgssz;
+    int msgtql;
+    unsigned short int msgseg;
+  };
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/sem.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/sem.h
new file mode 100644
index 0000000..9b1d993
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/sem.h
@@ -0,0 +1,87 @@
+/* Copyright (C) 2002 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_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'.  */
+#define SEM_UNDO	0x1000		/* undo the operation on exit */
+
+/* Commands for `semctl'.  */
+#define GETPID		11		/* get sempid */
+#define GETVAL		12		/* get semval */
+#define GETALL		13		/* get all semval's */
+#define GETNCNT		14		/* get semncnt */
+#define GETZCNT		15		/* get semzcnt */
+#define SETVAL		16		/* set semval */
+#define SETALL		17		/* set all semval's */
+
+
+/* Data structure describing a set of semaphores.  */
+struct semid_ds
+{
+  struct ipc_perm sem_perm;		/* operation permission struct */
+  __time_t sem_otime;			/* last semop() time */
+  unsigned long int __unused1;
+  __time_t sem_ctime;			/* last time changed by semctl() */
+  unsigned long int __unused2;
+  unsigned long int sem_nsems;		/* number of semaphores in set */
+  unsigned long int __unused3;
+  unsigned long int __unused4;
+};
+
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;				<= value for SETVAL
+     struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;		<= array for GETALL & SETALL
+     struct seminfo *__buf;		<= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED	1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct  seminfo
+{
+  int semmap;
+  int semmni;
+  int semmns;
+  int semmnu;
+  int semmsl;
+  int semopm;
+  int semume;
+  int semusz;
+  int semvmx;
+  int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/setjmp.h
new file mode 100644
index 0000000..515d769
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/setjmp.h
@@ -0,0 +1,78 @@
+/* Copyright (C) 2001, 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.  */
+
+/* Define the machine-dependent type `jmp_buf'.  x86-64 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
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+
+/* We only need to save callee-saved registers plus stackpointer and
+   program counter.  */
+# if defined __USE_MISC || defined _ASM
+#  define JB_RBX	0
+#  define JB_RBP	1
+#  define JB_R12	2
+#  define JB_R13	3
+#  define JB_R14	4
+#  define JB_R15	5
+#  define JB_RSP	6
+#  define JB_PC	7
+#  define JB_SIZE (8*8)
+# endif
+
+#else
+
+# if defined __USE_MISC || defined _ASM
+#  define JB_BX	0
+#  define JB_SI	1
+#  define JB_DI	2
+#  define JB_BP	3
+#  define JB_SP	4
+#  define JB_PC	5
+#  define JB_SIZE 24
+# endif
+
+#endif
+
+#ifndef _ASM
+
+# if __WORDSIZE == 64
+typedef long int __jmp_buf[8];
+# else
+typedef int __jmp_buf[6];
+# endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+# if __WORDSIZE == 64
+#  define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[JB_RSP])
+# else
+#  define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[JB_SP])
+# endif
+#endif
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/shm.h
new file mode 100644
index 0000000..3d8c05d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/shm.h
@@ -0,0 +1,110 @@
+/* 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 ())
+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() */
+#if __WORDSIZE == 32
+    unsigned long int __unused1;
+#endif
+    __time_t shm_dtime;			/* time of last shmdt() */
+#if __WORDSIZE == 32
+    unsigned long int __unused2;
+#endif
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+#if __WORDSIZE == 32
+    unsigned long int __unused3;
+#endif
+    __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/x86_64/bits/sigcontext.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/sigcontext.h
new file mode 100644
index 0000000..c0d5fe7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/sigcontext.h
@@ -0,0 +1,159 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H  1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+struct _fpreg
+{
+  unsigned short significand[4];
+  unsigned short exponent;
+};
+
+struct _fpxreg
+{
+  unsigned short significand[4];
+  unsigned short exponent;
+  unsigned short padding[3];
+};
+
+struct _xmmreg
+{
+  __uint32_t	element[4];
+};
+
+
+
+#if __WORDSIZE == 32
+
+struct _fpstate
+{
+  /* Regular FPU environment.  */
+  __uint32_t	cw;
+  __uint32_t		sw;
+  __uint32_t		tag;
+  __uint32_t		ipoff;
+  __uint32_t		cssel;
+  __uint32_t		dataoff;
+  __uint32_t		datasel;
+  struct _fpreg	_st[8];
+  unsigned short status;
+  unsigned short magic;
+
+  /* FXSR FPU environment.  */
+  __uint32_t		_fxsr_env[6];
+  __uint32_t		mxcsr;
+  __uint32_t		reserved;
+  struct _fpxreg	_fxsr_st[8];
+  struct _xmmreg	_xmm[8];
+  __uint32_t		padding[56];
+};
+
+#ifndef sigcontext_struct
+/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
+   we need sigcontext.  Some packages have come to rely on
+   sigcontext_struct being defined on 32-bit x86, so define this for
+   their benefit.  */
+# define sigcontext_struct sigcontext
+#endif
+
+struct sigcontext
+{
+  unsigned short gs, __gsh;
+  unsigned short fs, __fsh;
+  unsigned short es, __esh;
+  unsigned short ds, __dsh;
+  unsigned long edi;
+  unsigned long esi;
+  unsigned long ebp;
+  unsigned long esp;
+  unsigned long ebx;
+  unsigned long edx;
+  unsigned long ecx;
+  unsigned long eax;
+  unsigned long trapno;
+  unsigned long err;
+  unsigned long eip;
+  unsigned short cs, __csh;
+  unsigned long eflags;
+  unsigned long esp_at_signal;
+  unsigned short ss, __ssh;
+  struct _fpstate * fpstate;
+  unsigned long oldmask;
+  unsigned long cr2;
+};
+
+#else /* __WORDSIZE == 64 */
+
+struct _fpstate
+{
+  /* FPU environment matching the 64-bit FXSAVE layout.  */
+  __uint16_t		cwd;
+  __uint16_t		swd;
+  __uint16_t		ftw;
+  __uint16_t		fop;
+  __uint64_t		rip;
+  __uint64_t		rdp;
+  __uint32_t		mxcsr;
+  __uint32_t		mxcr_mask;
+  struct _fpxreg	_st[8];
+  struct _xmmreg	_xmm[16];
+  __uint32_t		padding[24];
+};
+
+struct sigcontext
+{
+  unsigned long r8;
+  unsigned long r9;
+  unsigned long r10;
+  unsigned long r11;
+  unsigned long r12;
+  unsigned long r13;
+  unsigned long r14;
+  unsigned long r15;
+  unsigned long rdi;
+  unsigned long rsi;
+  unsigned long rbp;
+  unsigned long rbx;
+  unsigned long rdx;
+  unsigned long rax;
+  unsigned long rcx;
+  unsigned long rsp;
+  unsigned long rip;
+  unsigned long eflags;
+  unsigned short cs;
+  unsigned short gs;
+  unsigned short fs;
+  unsigned short __pad0;
+  unsigned long err;
+  unsigned long trapno;
+  unsigned long oldmask;
+  unsigned long cr2;
+  struct _fpstate * fpstate;
+  unsigned long __reserved1 [8];
+};
+
+#endif /* __WORDSIZE == 64 */
+
+#endif /* _BITS_SIGCONTEXT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/sigcontextinfo.h
new file mode 100644
index 0000000..11493c5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/sigcontextinfo.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 2001, 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.  */
+
+#define SIGCONTEXT siginfo_t *_si, struct ucontext *
+#define SIGCONTEXT_EXTRA_ARGS _si,
+#define GET_PC(ctx)	((void *) (ctx)->uc_mcontext.gregs[REG_RIP])
+#define GET_FRAME(ctx)	((void *) (ctx)->uc_mcontext.gregs[REG_RBP])
+#define GET_STACK(ctx)	((void *) (ctx)->uc_mcontext.gregs[REG_RSP])
+
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/stackinfo.h
new file mode 100644
index 0000000..60668d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/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 x86_64 the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/stat.h
new file mode 100644
index 0000000..51367b2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/stat.h
@@ -0,0 +1,208 @@
+/* Copyright (C) 1999,2000,2001,2002,2003,2009 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_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_KERNEL	0
+
+#if __WORDSIZE == 32
+# define _STAT_VER_SVR4		2
+# define _STAT_VER_LINUX	3
+
+/* i386 versions of the `xmknod' interface.  */
+# define _MKNOD_VER_LINUX	1
+# define _MKNOD_VER_SVR4	2
+# define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below.  */
+#else
+# define _STAT_VER_LINUX	1
+
+/* x86-64 versions of the `xmknod' interface.  */
+# define _MKNOD_VER_LINUX	0
+#endif
+
+#define _STAT_VER		_STAT_VER_LINUX
+
+struct stat
+  {
+    __dev_t st_dev;		/* Device.  */
+#if __WORDSIZE == 32
+    unsigned short int __pad1;
+#endif
+#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+    __ino_t st_ino;		/* File serial number.	*/
+#else
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+#endif
+#if __WORDSIZE == 32
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+#else
+    __nlink_t st_nlink;		/* Link count.  */
+    __mode_t st_mode;		/* File mode.  */
+#endif
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
+#if __WORDSIZE == 64
+    int __pad0;
+#endif
+    __dev_t st_rdev;		/* Device number, if device.  */
+#if __WORDSIZE == 32
+    unsigned short int __pad2;
+#endif
+#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+    __off_t st_size;			/* Size of file, in bytes.  */
+#else
+    __off64_t st_size;			/* Size of file, in bytes.  */
+#endif
+    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+#else
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#endif
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+#if __WORDSIZE == 64
+    long int __unused[3];
+#else
+# ifndef __USE_FILE_OFFSET64
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+# else
+    __ino64_t st_ino;			/* File serial number.	*/
+# endif
+#endif
+  };
+
+#ifdef __USE_LARGEFILE64
+/* Note stat64 has the same shape as stat for x86-64.  */
+struct stat64
+  {
+    __dev_t st_dev;		/* Device.  */
+#if __WORDSIZE == 64
+    __ino64_t st_ino;		/* File serial number.  */
+    __nlink_t st_nlink;		/* Link count.  */
+    __mode_t st_mode;		/* File mode.  */
+#else
+    unsigned int __pad1;
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+#endif
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
+#if __WORDSIZE == 64
+    int __pad0;
+    __dev_t st_rdev;		/* Device number, if device.  */
+    __off_t st_size;		/* Size of file, in bytes.  */
+#else
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned int __pad2;
+    __off64_t st_size;			/* Size of file, in bytes.  */
+#endif
+    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+#if __WORDSIZE == 64
+    long int __unused[3];
+#else
+    __ino64_t st_ino;			/* File serial number.		*/
+#endif
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/syscalls.h
new file mode 100644
index 0000000..e4ea4d8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/syscalls.h
@@ -0,0 +1,135 @@
+#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.2.5/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+*/
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+/* The Linux/x86-64 kernel expects the system call parameters in
+   registers according to the following table:
+
+    syscall number	rax
+    arg 1		rdi
+    arg 2		rsi
+    arg 3		rdx
+    arg 4		r10
+    arg 5		r8
+    arg 6		r9
+
+    The Linux kernel uses and destroys internally these registers:
+    return address from
+    syscall		rcx
+    additionally clobered: r12-r15,rbx,rbp
+    eflags from syscall	r11
+
+    Normal function call, including calls to the system call stub
+    functions in the libc, get the first six parameters passed in
+    registers and the seventh parameter and later on the stack.  The
+    register use is as follows:
+
+     system call number	in the DO_CALL macro
+     arg 1		rdi
+     arg 2		rsi
+     arg 3		rdx
+     arg 4		rcx
+     arg 5		r8
+     arg 6		r9
+
+    We have to take care that the stack is aligned to 16 bytes.  When
+    called the stack is not aligned since the return address has just
+    been pushed.
+
+
+    Syscalls of more than 6 arguments are not supported.  */
+
+#undef	DO_CALL
+#define DO_CALL(syscall_name, args)		\
+    DOARGS_##args				\
+    movq $SYS_ify (syscall_name), %rax;		\
+    syscall;
+
+#define DOARGS_0 /* nothing */
+#define DOARGS_1 /* nothing */
+#define DOARGS_2 /* nothing */
+#define DOARGS_3 /* nothing */
+#define DOARGS_4 movq %rcx, %r10;
+#define DOARGS_5 DOARGS_4
+#define DOARGS_6 DOARGS_5
+
+/* Define a macro which expands inline into the wrapper code for a system
+   call.  */
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+(__extension__ \
+  ({									      \
+    unsigned long resultvar;						      \
+    LOAD_ARGS_##nr (args)						      \
+    LOAD_REGS_##nr							      \
+    __asm__ __volatile__ (						      \
+    "syscall\n\t"							      \
+    : "=a" (resultvar)							      \
+    : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");		      \
+    (long) resultvar;							      \
+   }) \
+)
+#define LOAD_ARGS_0()
+#define LOAD_REGS_0
+#define ASM_ARGS_0
+
+#define LOAD_ARGS_1(a1)					\
+  long int __arg1 = (long) (a1);			\
+  LOAD_ARGS_0 ()
+#define LOAD_REGS_1					\
+  register long int __a1 __asm__ ("rdi") = __arg1;	\
+  LOAD_REGS_0
+#define ASM_ARGS_1	ASM_ARGS_0, "r" (__a1)
+
+#define LOAD_ARGS_2(a1, a2)				\
+  long int __arg2 = (long) (a2);			\
+  LOAD_ARGS_1 (a1)
+#define LOAD_REGS_2					\
+  register long int __a2 __asm__ ("rsi") = __arg2;	\
+  LOAD_REGS_1
+#define ASM_ARGS_2	ASM_ARGS_1, "r" (__a2)
+
+#define LOAD_ARGS_3(a1, a2, a3)				\
+  long int __arg3 = (long) (a3);			\
+  LOAD_ARGS_2 (a1, a2)
+#define LOAD_REGS_3					\
+  register long int __a3 __asm__ ("rdx") = __arg3;	\
+  LOAD_REGS_2
+#define ASM_ARGS_3	ASM_ARGS_2, "r" (__a3)
+
+#define LOAD_ARGS_4(a1, a2, a3, a4)			\
+  long int __arg4 = (long) (a4);			\
+  LOAD_ARGS_3 (a1, a2, a3)
+#define LOAD_REGS_4					\
+  register long int __a4 __asm__ ("r10") = __arg4;	\
+  LOAD_REGS_3
+#define ASM_ARGS_4	ASM_ARGS_3, "r" (__a4)
+
+#define LOAD_ARGS_5(a1, a2, a3, a4, a5)			\
+  long int __arg5 = (long) (a5);			\
+  LOAD_ARGS_4 (a1, a2, a3, a4)
+#define LOAD_REGS_5					\
+  register long int __a5 __asm__ ("r8") = __arg5;	\
+  LOAD_REGS_4
+#define ASM_ARGS_5	ASM_ARGS_4, "r" (__a5)
+
+#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6)		\
+  long int __arg6 = (long) (a6);			\
+  LOAD_ARGS_5 (a1, a2, a3, a4, a5)
+#define LOAD_REGS_6					\
+  register long int __a6 __asm__ ("r9") = __arg6;	\
+  LOAD_REGS_5
+#define ASM_ARGS_6	ASM_ARGS_5, "r" (__a6)
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..1d966ae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/uClibc_arch_features.h
@@ -0,0 +1,47 @@
+/*
+ * 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__ "hlt"
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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 */
+#define __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/x86_64/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/wordsize.h
new file mode 100644
index 0000000..e555241
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bits/wordsize.h
@@ -0,0 +1,9 @@
+/* Determine the wordsize from the preprocessor defines.  */
+
+#if defined __x86_64__
+# define __WORDSIZE	64
+/* This makes /var/run/utmp compatible with 32-bit environment: */
+# define __WORDSIZE_COMPAT32	1
+#else
+# define __WORDSIZE	32
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/brk.c b/ap/build/uClibc/libc/sysdeps/linux/x86_64/brk.c
new file mode 100644
index 0000000..4e9447e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/brk.c
@@ -0,0 +1,46 @@
+/* brk system call for Linux/x86_64.
+   Copyright (C) 1995, 1996, 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 <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;
+
+	__asm__ ("syscall\n"
+		: "=a" (newbrk)
+		: "0" (__NR_brk), "D" (addr)
+		: "r11", "rcx"
+	);
+
+	__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/x86_64/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bsd-_setjmp.S
new file mode 100644
index 0000000..8b68ff2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bsd-_setjmp.S
@@ -0,0 +1,31 @@
+/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'.  i386 version.
+   Copyright (C) 1994,1995,1996,1997,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.  */
+
+/* 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.  */
+
+#include <sysdep.h>
+
+.global _setjmp
+.type   _setjmp,%function
+_setjmp:
+	xorq %rsi, %rsi
+	jmp HIDDEN_JUMPTARGET(__sigsetjmp)
+.size _setjmp,.-_setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bsd-setjmp.S
new file mode 100644
index 0000000..889efa6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/bsd-setjmp.S
@@ -0,0 +1,30 @@
+/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'.  i386 version.
+   Copyright (C) 1995, 1996, 1997, 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.  */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+#include <sysdep.h>
+
+.global setjmp
+.type   setjmp,%function
+setjmp:
+	movq $1, %rsi
+	jmp HIDDEN_JUMPTARGET(__sigsetjmp)
+.size setjmp,.-setjmp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/clone.S b/ap/build/uClibc/libc/sysdeps/linux/x86_64/clone.S
new file mode 100644
index 0000000..8c66ce5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/clone.S
@@ -0,0 +1,116 @@
+/* Copyright (C) 2001, 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.  */
+
+/* clone() is even more special than fork() as it mucks with stacks
+   and invokes a function in the right context after its all over.  */
+
+#include <features.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+#define CLONE_VM	0x00000100
+#define CLONE_THREAD	0x00010000
+
+/* The userland implementation is:
+   int clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg),
+   the kernel entry is:
+   int clone (long flags, void *child_stack).
+
+   The parameters are passed in register and on the stack from userland:
+   rdi: fn
+   rsi: child_stack
+   rdx:	flags
+   rcx: arg
+   r8d:	TID field in parent
+   r9d: thread pointer
+%esp+8:	TID field in child
+
+   The kernel expects:
+   rax: system call number
+   rdi: flags
+   rsi: child_stack
+   rdx: TID field in parent
+   r10: TID field in child
+   r8:	thread pointer  */
+
+
+.text
+.global clone
+.type   clone,%function
+clone:
+	/* Sanity check arguments.  */
+	movq	$-EINVAL,%rax
+	testq	%rdi,%rdi		/* no NULL function pointers */
+	jz	__syscall_error
+	testq	%rsi,%rsi		/* no NULL stack pointers */
+	jz	__syscall_error
+
+	/* Insert the argument onto the new stack.  */
+	subq	$16,%rsi
+	movq	%rcx,8(%rsi)
+
+	/* Save the function pointer.  It will be popped off in the
+	   child in the ebx frobbing below.  */
+	movq	%rdi,0(%rsi)
+
+	/* Do the system call.  */
+	movq	%rdx, %rdi
+	movq	%r8, %rdx
+	movq	%r9, %r8
+	movq	8(%rsp), %r10
+	movl	$__NR_clone,%eax
+
+	syscall
+
+	testq	%rax,%rax
+	jl	__syscall_error
+	jz	.Lthread_start
+
+.Lpseudo_end:
+	ret
+
+.Lthread_start:
+	/* Clear the frame pointer.  The ABI suggests this be done, to mark
+	   the outermost frame obviously.  */
+	xorl	%ebp, %ebp
+
+#ifdef RESET_PID
+	testq	$CLONE_THREAD, %rdi
+	jne	1f
+	testq	$CLONE_VM, %rdi
+	movl	$-1, %eax
+	jne	2f
+	movl	$__NR_getpid, %eax
+	syscall
+2:	movl	%eax, %fs:PID
+	movl	%eax, %fs:TID
+1:
+#endif
+
+	/* Set up arguments for the function call.  */
+	popq	%rax		/* Function to call.  */
+	popq	%rdi		/* Argument.  */
+	call	*%rax
+	/* Call exit with return value from function call. */
+	movq	%rax, %rdi
+	movl	$__NR_exit, %eax
+	syscall
+
+.size clone,.-clone
+weak_alias(clone, __clone)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/x86_64/crt1.S
new file mode 100644
index 0000000..f6c1eb1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/crt1.S
@@ -0,0 +1,140 @@
+/* Startup code compliant to the ELF x86-64 ABI.
+   Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Jaeger <aj@suse.de>, 2001.
+
+   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.  */
+
+/* Originally based on glibc's sysdeps/x86_64/elf/start.S */
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.  The SVR4/i386 ABI (pages 3-31, 3-32) says that when the entry
+   point runs, most registers' values are unspecified, except for:
+
+   %rdx		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.
+
+   %rsp		The stack contains the arguments and environment:
+		0(%rsp)			argc
+		8(%rsp)			argv[0]
+		...
+		(8*argc)(%rsp)		NULL
+		(8*(argc+1))(%rsp)	envp[0]
+		...
+					NULL
+*/
+
+#include <features.h>
+
+.text
+.global _start
+.type   _start,%function
+#if defined(__UCLIBC_CTOR_DTOR__)
+.type   _init,%function
+.type   _fini,%function
+#else
+.weak   _init
+.weak   _fini
+#endif
+.type   __uClibc_main,%function
+/* Stick in a dummy reference to main(), so that if an application
+ * is linking when the main() function is in a static library (.a)
+ * we can be sure that main() actually gets linked in */
+.type   main,%function
+
+_start:
+	/* Clear the frame pointer.  The ABI suggests this be done, to mark
+	   the outermost frame obviously.  */
+	xorl %ebp, %ebp
+
+	/* Extract the arguments as encoded on the stack and set up
+	   the arguments for __libc_start_main (int (*main) (int, char **, char **),
+		   int argc, char *argv,
+		   void (*init) (void), void (*fini) (void),
+		   void (*rtld_fini) (void), void *stack_end).
+	   The arguments are passed via registers and on the stack:
+	main:		%rdi
+	argc:		%rsi
+	argv:		%rdx
+	init:		%rcx
+	fini:		%r8
+	rtld_fini:	%r9
+	stack_end:	stack.	*/
+
+	movq %rdx, %r9   /* Address of the shared library termination function. */
+	popq %rsi        /* Pop the argument count. */
+	movq %rsp, %rdx  /* argv starts just at the current stack top. */
+
+	/* Align the stack to a 16 byte boundary to follow the ABI. */
+	andq $~15, %rsp
+
+	pushq %rax		/* Push garbage because we push 8 more bytes.  */
+
+	/* Provide the highest stack address to the user code (for stacks
+	   which grow downwards).  */
+	pushq %rsp
+
+#if defined(L_Scrt1)
+	/* Give address for main() */
+	movq main@GOTPCREL(%rip), %rdi
+
+	/* setup init/fini address */
+	movq _init@GOTPCREL(%rip), %rcx
+	movq _fini@GOTPCREL(%rip), %r8
+
+	/* start the fun */
+	call __uClibc_main@PLT
+#else
+	/* Give address for main() */
+	movq $main, %rdi
+
+	/* setup init/fini address */
+	movq $_init, %rcx
+	movq $_fini, %r8
+
+	/* start the fun */
+	call __uClibc_main
+#endif
+
+	hlt        /* Crash if somehow `exit' does return.  */
+.size _start,.-_start
+
+/* Define a symbol for the first piece of initialized data. */
+.data
+.global __data_start
+__data_start:
+.long 0
+.weak data_start
+	data_start = __data_start
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/crti.S b/ap/build/uClibc/libc/sysdeps/linux/x86_64/crti.S
new file mode 100644
index 0000000..11491db
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/crti.S
@@ -0,0 +1,16 @@
+/* glibc's sysdeps/x86_64/elf/initfini.c used for reference [PROLOG] */
+
+
+
+.section .init
+.global  _init
+.type    _init, %function
+_init:
+	subq	$8, %rsp
+
+
+.section .fini
+.global  _fini
+.type    _fini, %function
+_fini:
+	subq	$8, %rsp
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/x86_64/crtn.S
new file mode 100644
index 0000000..9804e0f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/crtn.S
@@ -0,0 +1,16 @@
+/* glibc's sysdeps/x86_64/elf/initfini.c used for reference [EPILOG] */
+
+.file	"initfini.c"
+
+.section .init
+.global  _init
+.type    _init, %function
+	addq $8, %rsp
+	ret
+
+
+.section .fini
+.global  _fini
+.type    _fini, %function
+	addq $8, %rsp
+	ret
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/fpu_control.h
new file mode 100644
index 0000000..6e9b3b3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/fpu_control.h
@@ -0,0 +1,103 @@
+/* FPU control word bits.  x86-64 version.
+   Copyright (C) 1993,1995,1996,1997,1998,2000,2001,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Olaf Flebbe.
+
+   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	1
+
+/* Note that this file sets on x86-64 only the x87 FPU, it does not
+   touch the SSE unit.  */
+
+/* Here is the dirty part. Set up your 387 through the control word
+ * (cw) register.
+ *
+ *     15-13    12  11-10  9-8     7-6     5    4    3    2    1    0
+ * | reserved | IC | RC  | PC | reserved | PM | UM | OM | ZM | DM | IM
+ *
+ * IM: Invalid operation mask
+ * DM: Denormalized operand mask
+ * ZM: Zero-divide mask
+ * OM: Overflow mask
+ * UM: Underflow mask
+ * PM: Precision (inexact result) mask
+ *
+ * Mask bit is 1 means no interrupt.
+ *
+ * PC: Precision control
+ * 11 - round to extended precision
+ * 10 - round to double precision
+ * 00 - round to single precision
+ *
+ * RC: Rounding control
+ * 00 - rounding to nearest
+ * 01 - rounding down (toward - infinity)
+ * 10 - rounding up (toward + infinity)
+ * 11 - rounding toward zero
+ *
+ * IC: Infinity control
+ * That is for 8087 and 80287 only.
+ *
+ * The hardware default is 0x037f which we use.
+ */
+
+#include <features.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_IM  0x01
+#define _FPU_MASK_DM  0x02
+#define _FPU_MASK_ZM  0x04
+#define _FPU_MASK_OM  0x08
+#define _FPU_MASK_UM  0x10
+#define _FPU_MASK_PM  0x20
+
+/* precision control */
+#define _FPU_EXTENDED 0x300	/* libm requires double extended precision.  */
+#define _FPU_DOUBLE   0x200
+#define _FPU_SINGLE   0x0
+
+/* rounding control */
+#define _FPU_RC_NEAREST 0x0    /* RECOMMENDED */
+#define _FPU_RC_DOWN    0x400
+#define _FPU_RC_UP      0x800
+#define _FPU_RC_ZERO    0xC00
+
+#define _FPU_RESERVED 0xF0C0  /* Reserved bits in cw */
+
+
+/* The fdlibm code requires strict IEEE double precision arithmetic,
+   and no interrupts for exceptions, rounding to nearest.  */
+
+#define _FPU_DEFAULT  0x037f
+
+/* IEEE:  same as above.  */
+#define _FPU_IEEE     0x037f
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
+
+/* Macros for accessing the hardware control word.  */
+#define _FPU_GETCW(cw) __asm__ ("fnstcw %0" : "=m" (*&cw))
+#define _FPU_SETCW(cw) __asm__ ("fldcw %0" : : "m" (*&cw))
+
+#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/x86_64/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/x86_64/mmap.c
new file mode 100644
index 0000000..bb1352f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/mmap.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mmap() for uClibc/x86_64
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2005 by Mike Frysinger <vapier@gentoo.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+
+_syscall6(void *, mmap, void *, start, size_t, length, int, prot,
+          int, flags, int, fd, off_t, offset)
+libc_hidden_def(mmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/sched_getcpu.S b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sched_getcpu.S
new file mode 100644
index 0000000..592bcdb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sched_getcpu.S
@@ -0,0 +1,72 @@
+/* Copyright (C) 2007, 2011 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 <sysdep.h>
+#include <tls.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+#include <bits/kernel-features.h>
+
+/* For the calculation see asm/vsyscall.h.  */
+#define VSYSCALL_ADDR_vgetcpu	0xffffffffff600800
+
+
+ENTRY (sched_getcpu)
+	/* Align stack and create local variable for result.  */
+	sub	$0x8, %rsp
+	cfi_adjust_cfa_offset(8)
+
+	movq	%rsp, %rdi
+	xorl	%esi, %esi
+	movl	$VGETCPU_CACHE_OFFSET, %edx
+	addq	%fs:0, %rdx
+
+#ifdef SHARED
+	movq	__vdso_getcpu(%rip), %rax
+	PTR_DEMANGLE (%rax)
+	callq	*%rax
+#else
+# ifdef __NR_getcpu
+	movl	$__NR_getcpu, %eax
+	syscall
+#  ifndef __ASSUME_GETCPU_SYSCALL
+	cmpq	$-ENOSYS, %rax
+	jne	1f
+#  endif
+# endif
+# ifndef __ASSUME_GETCPU_SYSCALL
+	movq	$VSYSCALL_ADDR_vgetcpu, %rax
+	callq	*%rax
+1:
+# else
+#  ifndef __NR_getcpu
+#   error "cannot happen"
+#  endif
+# endif
+#endif
+
+	cmpq	$-4095, %rax
+	jae	SYSCALL_ERROR_LABEL
+
+	movl	(%rsp), %eax
+
+L(pseudo_end):
+	add	$0x8, %rsp
+	cfi_adjust_cfa_offset(-8)
+	ret
+PSEUDO_END(sched_getcpu)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/x86_64/setjmp.S
new file mode 100644
index 0000000..3a0f30b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/setjmp.S
@@ -0,0 +1,47 @@
+/* setjmp for x86-64.
+   Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+#include <sysdep.h>
+
+.global __sigsetjmp
+.type   __sigsetjmp,%function
+__sigsetjmp:
+	/* Save registers.  */
+	movq %rbx, (JB_RBX*8)(%rdi)
+	movq %rbp, (JB_RBP*8)(%rdi)
+	movq %r12, (JB_R12*8)(%rdi)
+	movq %r13, (JB_R13*8)(%rdi)
+	movq %r14, (JB_R14*8)(%rdi)
+	movq %r15, (JB_R15*8)(%rdi)
+	leaq 8(%rsp), %rdx	/* Save SP as it will be after we return.  */
+	movq %rdx, (JB_RSP*8)(%rdi)
+	movq (%rsp), %rax	/* Save PC we are returning to now.  */
+	movq %rax, (JB_PC*8)(%rdi)
+
+	/* Make a tail call to __sigjmp_save; it takes the same args.  */
+#ifdef	__PIC__
+	jmp __sigjmp_save@PLT
+#else
+	jmp __sigjmp_save
+#endif
+.size __sigsetjmp,.-__sigsetjmp
+libc_hidden_def(__sigsetjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sigaction.c
new file mode 100644
index 0000000..74e81a8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sigaction.c
@@ -0,0 +1,135 @@
+/* POSIX.1 `sigaction' call for Linux/x86-64.
+   Copyright (C) 2001, 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.  */
+
+
+#include <errno.h>
+#include <stddef.h>
+#include <signal.h>
+#include <string.h>
+
+#include <sys/syscall.h>
+
+#include <bits/kernel_sigaction.h>
+
+/* We do not globally define the SA_RESTORER flag so do it here.  */
+#define SA_RESTORER 0x04000000
+
+extern __typeof(sigaction) __libc_sigaction;
+
+
+#ifdef __NR_rt_sigaction
+
+/* Using the hidden attribute here does not change the code but it
+   helps to avoid warnings.  */
+extern void restore_rt(void) __asm__ ("__restore_rt") attribute_hidden;
+extern void restore(void) __asm__ ("__restore") attribute_hidden;
+
+/* 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) {
+		memcpy(&kact, act, sizeof(kact));
+		kact.sa_flags |= SA_RESTORER;
+		kact.sa_restorer = &restore_rt;
+		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 INLINE_SYSCALL(rt_sigaction, 4, sig, act, oact, sizeof(act->sa_mask));
+}
+
+#else
+
+extern void restore(void) __asm__ ("__restore") attribute_hidden;
+
+/* 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 | SA_RESTORER;
+		kact.sa_restorer = &restore;
+	}
+	__asm__ __volatile__ (
+		"syscall\n"
+		: "=a" (result)
+		: "0" (__NR_sigaction), "mr" (sig),
+		  "c" (act ? &kact : NULL),
+		  "d" (oact ? &koact : NULL));
+	if (result < 0) {
+		__set_errno(-result);
+		return -1;
+	}
+	if (oact) {
+		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
+
+
+/* NOTE: Please think twice before making any changes to the bits of
+   code below.  GDB needs some intimate knowledge about it to
+   recognize them as signal trampolines, and make backtraces through
+   signal handlers work right.  Important are both the names
+   (__restore_rt) and the exact instruction sequence.
+   If you ever feel the need to make any changes, please notify the
+   appropriate GDB maintainer.  */
+
+#define RESTORE(name, syscall) RESTORE2(name, syscall)
+#define RESTORE2(name, syscall) \
+__asm__ (						\
+	".text\n"					\
+	"__" #name ":\n"				\
+	"	movq	$" #syscall ", %rax\n"		\
+	"	syscall\n"				\
+);
+
+#ifdef __NR_rt_sigaction
+/* The return code for realtime-signals.  */
+RESTORE(restore_rt, __NR_rt_sigreturn)
+#endif
+#ifdef __NR_sigreturn
+RESTORE(restore, __NR_sigreturn)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/debugreg.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/debugreg.h
new file mode 100644
index 0000000..8abbf75
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/debugreg.h
@@ -0,0 +1,88 @@
+/* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_DEBUGREG_H
+#define _SYS_DEBUGREG_H	1
+#include <bits/wordsize.h>
+
+/* Indicate the register numbers for a number of the specific
+   debug registers.  Registers 0-3 contain the addresses we wish to trap on */
+#define DR_FIRSTADDR 0        /* u_debugreg[DR_FIRSTADDR] */
+#define DR_LASTADDR 3         /* u_debugreg[DR_LASTADDR]  */
+
+#define DR_STATUS 6           /* u_debugreg[DR_STATUS]     */
+#define DR_CONTROL 7          /* u_debugreg[DR_CONTROL] */
+
+/* Define a few things for the status register.  We can use this to determine
+   which debugging register was responsible for the trap.  The other bits
+   are either reserved or not of interest to us. */
+
+#define DR_TRAP0	(0x1)		/* db0 */
+#define DR_TRAP1	(0x2)		/* db1 */
+#define DR_TRAP2	(0x4)		/* db2 */
+#define DR_TRAP3	(0x8)		/* db3 */
+
+#define DR_STEP		(0x4000)	/* single-step */
+#define DR_SWITCH	(0x8000)	/* task switch */
+
+/* Now define a bunch of things for manipulating the control register.
+   The top two bytes of the control register consist of 4 fields of 4
+   bits - each field corresponds to one of the four debug registers,
+   and indicates what types of access we trap on, and how large the data
+   field is that we are looking at */
+
+#define DR_CONTROL_SHIFT 16   /* Skip this many bits in ctl register */
+#define DR_CONTROL_SIZE  4    /* 4 control bits per register */
+
+#define DR_RW_EXECUTE	(0x0) /* Settings for the access types to trap on */
+#define DR_RW_WRITE	(0x1)
+#define DR_RW_READ	(0x3)
+
+#define DR_LEN_1 (0x0)	      /* Settings for data length to trap on */
+#define DR_LEN_2 (0x4)
+#define DR_LEN_4 (0xC)
+#define DR_LEN_8 (0x8)
+
+/* The low byte to the control register determine which registers are
+   enabled.  There are 4 fields of two bits.  One bit is "local", meaning
+   that the processor will reset the bit after a task switch and the other
+   is global meaning that we have to explicitly reset the bit.  With linux,
+   you can use either one, since we explicitly zero the register when we enter
+   kernel mode. */
+
+#define DR_LOCAL_ENABLE_SHIFT  0   /* Extra shift to the local enable bit */
+#define DR_GLOBAL_ENABLE_SHIFT 1   /* Extra shift to the global enable bit */
+#define DR_ENABLE_SIZE	       2   /* 2 enable bits per register */
+
+#define DR_LOCAL_ENABLE_MASK  (0x55) /* Set  local bits for all 4 regs */
+#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
+
+/* The second byte to the control register has a few special
+   things.  */
+
+
+
+#if __WORDSIZE == 64
+# define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */
+#else
+# define DR_CONTROL_RESERVED (0x00FC00U) /* Reserved */
+#endif
+#define DR_LOCAL_SLOWDOWN   (0x100)  /* Local slow the pipeline */
+#define DR_GLOBAL_SLOWDOWN  (0x200)  /* Global slow the pipeline */
+
+#endif	/* sys/debugreg.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/io.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/io.h
new file mode 100644
index 0000000..ec12125
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/io.h
@@ -0,0 +1,182 @@
+/* Copyright (C) 1996, 2000, 2002 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.
+
+   Portability note: not all Linux platforms support this call.  Most
+   platforms based on the PC I/O architecture probably will, however.
+   E.g., Linux/Alpha for Alpha PCs supports this.  */
+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>3, permission to
+   access any I/O port is granted.  This call requires root
+   privileges. */
+extern int iopl (int __level) __THROW;
+
+#if defined __GNUC__ && __GNUC__ >= 2
+
+static __inline unsigned char
+inb (unsigned short int port)
+{
+  unsigned char _v;
+
+  __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned char
+inb_p (unsigned short int port)
+{
+  unsigned char _v;
+
+  __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned short int
+inw (unsigned short int port)
+{
+  unsigned short _v;
+
+  __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned short int
+inw_p (unsigned short int port)
+{
+  unsigned short int _v;
+
+  __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned int
+inl (unsigned short int port)
+{
+  unsigned int _v;
+
+  __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned int
+inl_p (unsigned short int port)
+{
+  unsigned int _v;
+  __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline void
+outb (unsigned char value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port));
+}
+
+static __inline void
+outb_p (unsigned char value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+outw (unsigned short int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port));
+
+}
+
+static __inline void
+outw_p (unsigned short int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+outl (unsigned int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (port));
+}
+
+static __inline void
+outl_p (unsigned int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+insb (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insb":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+insw (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insw":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+insl (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insl":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsb (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsw (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsl (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+#endif	/* GNU C */
+
+__END_DECLS
+#endif /* _SYS_IO_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/perm.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/perm.h
new file mode 100644
index 0000000..3796455
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/perm.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 1996, 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_PERM_H
+
+#define _SYS_PERM_H	1
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Set port input/output permissions.  */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+		   int __turn_on) __THROW;
+libc_hidden_proto(ioperm)
+
+
+/* Change I/O privilege level.  */
+extern int iopl (int __level) __THROW;
+
+__END_DECLS
+
+#endif	/* _SYS_PERM_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/procfs.h
new file mode 100644
index 0000000..5995b71
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/procfs.h
@@ -0,0 +1,143 @@
+/* Copyright (C) 2001, 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_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>
+#include <bits/wordsize.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_struct' 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_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+#if __WORDSIZE == 32
+/* Register set for the floating-point registers.  */
+typedef struct user_fpregs_struct elf_fpregset_t;
+
+/* Register set for the extended floating-point registers.  Includes
+   the Pentium III SSE registers in addition to the classic
+   floating-point stuff.  */
+typedef struct user_fpxregs_struct elf_fpxregset_t;
+#else
+/* Register set for the extended floating-point registers.  Includes
+   the Pentium III SSE registers in addition to the classic
+   floating-point stuff.  */
+typedef struct user_fpregs_struct elf_fpregset_t;
+#endif
+
+/* 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.  */
+#if __WORDSIZE == 32
+    unsigned short int pr_uid;
+    unsigned short int pr_gid;
+#else
+    unsigned int pr_uid;
+    unsigned int pr_gid;
+#endif
+    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/x86_64/sys/reg.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/reg.h
new file mode 100644
index 0000000..865e345
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/reg.h
@@ -0,0 +1,79 @@
+/* Copyright (C) 2001, 2002 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_REG_H
+#define _SYS_REG_H	1
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+/* Index into an array of 8 byte longs returned from ptrace for
+   location of the users' stored general purpose registers.  */
+
+# define R15	0
+# define R14	1
+# define R13	2
+# define R12	3
+# define RBP	4
+# define RBX	5
+# define R11	6
+# define R10	7
+# define R9	8
+# define R8	9
+# define RAX	10
+# define RCX	11
+# define RDX	12
+# define RSI	13
+# define RDI	14
+# define ORIG_RAX 15
+# define RIP	16
+# define CS	17
+# define EFLAGS	18
+# define RSP	19
+# define SS	20
+# define FS_BASE 21
+# define GS_BASE 22
+# define DS	23
+# define ES	24
+# define FS	25
+# define GS	26
+#else
+
+/* Index into an array of 4 byte integers returned from ptrace for
+ * location of the users' stored general purpose registers. */
+
+# define EBX 0
+# define ECX 1
+# define EDX 2
+# define ESI 3
+# define EDI 4
+# define EBP 5
+# define EAX 6
+# define DS 7
+# define ES 8
+# define FS 9
+# define GS 10
+# define ORIG_EAX 11
+# define EIP 12
+# define CS  13
+# define EFL 14
+# define UESP 15
+# define SS   16
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/ucontext.h
new file mode 100644
index 0000000..b59cd29
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/ucontext.h
@@ -0,0 +1,248 @@
+/* Copyright (C) 2001, 2002 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_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+#include <bits/wordsize.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+#if __WORDSIZE == 64
+
+/* Type for general register.  */
+typedef long int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	23
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+#ifdef __USE_GNU
+/* Number of each register in the `gregset_t' array.  */
+enum
+{
+  REG_R8 = 0,
+# define REG_R8		REG_R8
+  REG_R9,
+# define REG_R9		REG_R9
+  REG_R10,
+# define REG_R10	REG_R10
+  REG_R11,
+# define REG_R11	REG_R11
+  REG_R12,
+# define REG_R12	REG_R12
+  REG_R13,
+# define REG_R13	REG_R13
+  REG_R14,
+# define REG_R14	REG_R14
+  REG_R15,
+# define REG_R15	REG_R15
+  REG_RDI,
+# define REG_RDI	REG_RDI
+  REG_RSI,
+# define REG_RSI	REG_RSI
+  REG_RBP,
+# define REG_RBP	REG_RBP
+  REG_RBX,
+# define REG_RBX	REG_RBX
+  REG_RDX,
+# define REG_RDX	REG_RDX
+  REG_RAX,
+# define REG_RAX	REG_RAX
+  REG_RCX,
+# define REG_RCX	REG_RCX
+  REG_RSP,
+# define REG_RSP	REG_RSP
+  REG_RIP,
+# define REG_RIP	REG_RIP
+  REG_EFL,
+# define REG_EFL	REG_EFL
+  REG_CSGSFS,		/* Actually short cs, gs, fs, __pad0.  */
+# define REG_CSGSFS	REG_CSGSFS
+  REG_ERR,
+# define REG_ERR	REG_ERR
+  REG_TRAPNO,
+# define REG_TRAPNO	REG_TRAPNO
+  REG_OLDMASK,
+# define REG_OLDMASK	REG_OLDMASK
+  REG_CR2
+# define REG_CR2	REG_CR2
+};
+#endif
+
+struct _libc_fpxreg
+{
+  unsigned short int significand[4];
+  unsigned short int exponent;
+  unsigned short int padding[3];
+};
+
+struct _libc_xmmreg
+{
+  __uint32_t	element[4];
+};
+
+struct _libc_fpstate
+{
+  /* 64-bit FXSAVE format.  */
+  __uint16_t		cwd;
+  __uint16_t		swd;
+  __uint16_t		ftw;
+  __uint16_t		fop;
+  __uint64_t		rip;
+  __uint64_t		rdp;
+  __uint32_t		mxcsr;
+  __uint32_t		mxcr_mask;
+  struct _libc_fpxreg	_st[8];
+  struct _libc_xmmreg	_xmm[16];
+  __uint32_t		padding[24];
+};
+
+/* Structure to describe FPU registers.  */
+typedef struct _libc_fpstate *fpregset_t;
+
+/* Context to describe whole processor state.  */
+typedef struct
+  {
+    gregset_t gregs;
+    /* Note that fpregs is a pointer.  */
+    fpregset_t fpregs;
+    unsigned long __reserved1 [8];
+} mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+    struct _libc_fpstate __fpregs_mem;
+  } ucontext_t;
+
+#else /* __WORDSIZE == 32 */
+
+/* Type for general register.  */
+typedef int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	19
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+#ifdef __USE_GNU
+/* Number of each register is the `gregset_t' array.  */
+enum
+{
+  REG_GS = 0,
+# define REG_GS		REG_GS
+  REG_FS,
+# define REG_FS		REG_FS
+  REG_ES,
+# define REG_ES		REG_ES
+  REG_DS,
+# define REG_DS		REG_DS
+  REG_EDI,
+# define REG_EDI	REG_EDI
+  REG_ESI,
+# define REG_ESI	REG_ESI
+  REG_EBP,
+# define REG_EBP	REG_EBP
+  REG_ESP,
+# define REG_ESP	REG_ESP
+  REG_EBX,
+# define REG_EBX	REG_EBX
+  REG_EDX,
+# define REG_EDX	REG_EDX
+  REG_ECX,
+# define REG_ECX	REG_ECX
+  REG_EAX,
+# define REG_EAX	REG_EAX
+  REG_TRAPNO,
+# define REG_TRAPNO	REG_TRAPNO
+  REG_ERR,
+# define REG_ERR	REG_ERR
+  REG_EIP,
+# define REG_EIP	REG_EIP
+  REG_CS,
+# define REG_CS		REG_CS
+  REG_EFL,
+# define REG_EFL	REG_EFL
+  REG_UESP,
+# define REG_UESP	REG_UESP
+  REG_SS
+# define REG_SS	REG_SS
+};
+#endif
+
+/* Definitions taken from the kernel headers.  */
+struct _libc_fpreg
+{
+  unsigned short int significand[4];
+  unsigned short int exponent;
+};
+
+struct _libc_fpstate
+{
+  unsigned long int cw;
+  unsigned long int sw;
+  unsigned long int tag;
+  unsigned long int ipoff;
+  unsigned long int cssel;
+  unsigned long int dataoff;
+  unsigned long int datasel;
+  struct _libc_fpreg _st[8];
+  unsigned long int status;
+};
+
+/* Structure to describe FPU registers.  */
+typedef struct _libc_fpstate *fpregset_t;
+
+/* Context to describe whole processor state.  */
+typedef struct
+  {
+    gregset_t gregs;
+    /* Due to Linux's history we have to use a pointer here.  The SysV/i386
+       ABI requires a struct with the values.  */
+    fpregset_t fpregs;
+    unsigned long int oldmask;
+    unsigned long int cr2;
+  } mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+    struct _libc_fpstate __fpregs_mem;
+  } ucontext_t;
+
+#endif /* __WORDSIZE == 32 */
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/user.h
new file mode 100644
index 0000000..5ff68e5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sys/user.h
@@ -0,0 +1,176 @@
+/* Copyright (C) 2001, 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_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.  */
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+
+struct user_fpregs_struct
+{
+  __uint16_t		cwd;
+  __uint16_t		swd;
+  __uint16_t		ftw;
+  __uint16_t		fop;
+  __uint64_t		rip;
+  __uint64_t		rdp;
+  __uint32_t		mxcsr;
+  __uint32_t		mxcr_mask;
+  __uint32_t		st_space[32];   /* 8*16 bytes for each FP-reg = 128 bytes */
+  __uint32_t		xmm_space[64];  /* 16*16 bytes for each XMM-reg = 256 bytes */
+  __uint32_t		padding[24];
+};
+
+struct user_regs_struct
+{
+  unsigned long r15;
+  unsigned long r14;
+  unsigned long r13;
+  unsigned long r12;
+  unsigned long rbp;
+  unsigned long rbx;
+  unsigned long r11;
+  unsigned long r10;
+  unsigned long r9;
+  unsigned long r8;
+  unsigned long rax;
+  unsigned long rcx;
+  unsigned long rdx;
+  unsigned long rsi;
+  unsigned long rdi;
+  unsigned long orig_rax;
+  unsigned long rip;
+  unsigned long cs;
+  unsigned long eflags;
+  unsigned long rsp;
+  unsigned long ss;
+  unsigned long fs_base;
+  unsigned long gs_base;
+  unsigned long ds;
+  unsigned long es;
+  unsigned long fs;
+  unsigned long gs;
+};
+
+struct user
+{
+  struct user_regs_struct	regs;
+  int				u_fpvalid;
+  struct user_fpregs_struct	i387;
+  unsigned long int		u_tsize;
+  unsigned long int		u_dsize;
+  unsigned long int		u_ssize;
+  unsigned long			start_code;
+  unsigned long			start_stack;
+  long int			signal;
+  int				reserved;
+  struct user_regs_struct*	u_ar0;
+  struct user_fpregs_struct*	u_fpstate;
+  unsigned long int		magic;
+  char				u_comm [32];
+  unsigned long int		u_debugreg [8];
+};
+
+#else
+/* These are the 32-bit x86 structures.  */
+struct user_fpregs_struct
+{
+  long int cwd;
+  long int swd;
+  long int twd;
+  long int fip;
+  long int fcs;
+  long int foo;
+  long int fos;
+  long int st_space [20];
+};
+
+struct user_fpxregs_struct
+{
+  unsigned short int cwd;
+  unsigned short int swd;
+  unsigned short int twd;
+  unsigned short int fop;
+  long int fip;
+  long int fcs;
+  long int foo;
+  long int fos;
+  long int mxcsr;
+  long int reserved;
+  long int st_space[32];   /* 8*16 bytes for each FP-reg = 128 bytes */
+  long int xmm_space[32];  /* 8*16 bytes for each XMM-reg = 128 bytes */
+  long int padding[56];
+};
+
+struct user_regs_struct
+{
+  long int ebx;
+  long int ecx;
+  long int edx;
+  long int esi;
+  long int edi;
+  long int ebp;
+  long int eax;
+  long int xds;
+  long int xes;
+  long int xfs;
+  long int xgs;
+  long int orig_eax;
+  long int eip;
+  long int xcs;
+  long int eflags;
+  long int esp;
+  long int xss;
+};
+
+struct user
+{
+  struct user_regs_struct	regs;
+  int				u_fpvalid;
+  struct user_fpregs_struct	i387;
+  unsigned long int		u_tsize;
+  unsigned long int		u_dsize;
+  unsigned long int		u_ssize;
+  unsigned long			start_code;
+  unsigned long			start_stack;
+  long int			signal;
+  int				reserved;
+  struct user_regs_struct*	u_ar0;
+  struct user_fpregs_struct*	u_fpstate;
+  unsigned long int		magic;
+  char				u_comm [32];
+  int				u_debugreg [8];
+};
+#endif  /* __WORDSIZE */
+
+#include <bits/uClibc_page.h>
+#define PAGE_SHIFT		12
+#define PAGE_SIZE		(1UL << PAGE_SHIFT)
+#define PAGE_MASK		(~(PAGE_SIZE-1))
+#define NBPG			PAGE_SIZE
+#define UPAGES			1
+#define HOST_TEXT_START_ADDR	(u.start_code)
+#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
+
+#endif	/* _SYS_USER_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/syscall.S b/ap/build/uClibc/libc/sysdeps/linux/x86_64/syscall.S
new file mode 100644
index 0000000..ee223e3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/syscall.S
@@ -0,0 +1,42 @@
+/* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* Please consult the file sysdeps/unix/sysv/linux/x86-64/sysdep.h for
+   more information about the value -4095 used below.  */
+
+/* Usage: long syscall (syscall_number, arg1, arg2, arg3, arg4, arg5, arg6)
+   We need to do some arg shifting, the syscall_number will be in
+   rax.  */
+
+.text
+.globl syscall
+.type	syscall,%function
+syscall:
+	movq %rdi, %rax		/* Syscall number -> rax.  */
+	movq %rsi, %rdi		/* shift arg1 - arg5.  */
+	movq %rdx, %rsi
+	movq %rcx, %rdx
+	movq %r8, %r10
+	movq %r9, %r8
+	movq 8(%rsp),%r9	/* arg6 is on the stack.  */
+	syscall			/* Do the system call.  */
+	cmpq $-4095, %rax	/* Check %rax for error.  */
+	jae __syscall_error		/* Branch forward if it failed.  */
+	ret			/* Return to caller.  */
+
+.size syscall,.-syscall
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sysdep.h
new file mode 100644
index 0000000..4440d2b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/sysdep.h
@@ -0,0 +1,333 @@
+/* Copyright (C) 2001-2005, 2007 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_X86_64_SYSDEP_H
+#define _LINUX_X86_64_SYSDEP_H 1
+
+/* There is some commonality.  */
+#include <sys/syscall.h>
+#include <common/sysdep.h>
+
+#ifdef	__ASSEMBLER__
+
+/* Syntactic details of assembler.  */
+
+/* ELF uses byte-counts for .align, most others use log2 of count of bytes.  */
+#define ALIGNARG(log2) 1<<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 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);							      \
+  C_LABEL(name)								      \
+  cfi_startproc;							      \
+  CALL_MCOUNT
+
+#undef	END
+#define END(name)							      \
+  cfi_endproc;								      \
+  ASM_SIZE_DIRECTIVE(name)
+
+/* If compiled for profiling, call `mcount' at the start of each function.  */
+#ifdef	PROF
+/* The mcount code relies on a normal frame pointer being on the stack
+   to locate our caller, so push one just for its benefit.  */
+#define CALL_MCOUNT                                                          \
+  pushq %rbp;                                                                \
+  cfi_adjust_cfa_offset(8);                                                  \
+  movq %rsp, %rbp;                                                           \
+  cfi_def_cfa_register(%rbp);                                                \
+  call JUMPTARGET(mcount);                                                   \
+  popq %rbp;                                                                 \
+  cfi_def_cfa(rsp,8);
+#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
+
+#define	PSEUDO(name, syscall_name, args)				      \
+lose:									      \
+  jmp JUMPTARGET(syscall_error)						      \
+  .globl syscall_error;							      \
+  ENTRY (name)								      \
+  DO_CALL (syscall_name, args);						      \
+  jb lose
+
+#undef	PSEUDO_END
+#define	PSEUDO_END(name)						      \
+  END (name)
+
+#undef JUMPTARGET
+#ifdef __PIC__
+#define JUMPTARGET(name)	name##@PLT
+#else
+#define JUMPTARGET(name)	name
+#endif
+
+/* Local label name for asm code. */
+#ifndef L
+#define L(name)	.L##name
+#endif
+
+#endif	/* __ASSEMBLER__ */
+
+/* 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 SYS_ify(syscall_name)	__NR_##syscall_name
+
+/* This is a kludge to make syscalls.list find these under the names
+   pread and pwrite, since some kernel headers define those names
+   and some define the *64 names for the same system calls.  */
+#if !defined __NR_pread && defined __NR_pread64
+# define __NR_pread __NR_pread64
+#endif
+#if !defined __NR_pwrite && defined __NR_pwrite64
+# define __NR_pwrite __NR_pwrite64
+#endif
+
+/* This is to help the old kernel headers where __NR_semtimedop is not
+   available.  */
+#ifndef __NR_semtimedop
+# define __NR_semtimedop 220
+#endif
+
+
+#ifdef __ASSEMBLER__
+
+/* 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 %eax
+   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 savely
+   test with -4095.  */
+
+/* We don't want the label for the error handle to be global when we define
+   it here.  */
+# ifdef __PIC__
+#  define SYSCALL_ERROR_LABEL 0f
+# else
+#  define SYSCALL_ERROR_LABEL syscall_error
+# endif
+
+# undef	PSEUDO
+# define PSEUDO(name, syscall_name, args)				      \
+  .text;								      \
+  ENTRY (name)								      \
+    DO_CALL (syscall_name, args);					      \
+    cmpq $-4095, %rax;							      \
+    jae SYSCALL_ERROR_LABEL;						      \
+  L(pseudo_end):
+
+# 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)
+
+# undef	PSEUDO_END_NOERRNO
+# define PSEUDO_END_NOERRNO(name) \
+  END (name)
+
+# define ret_NOERRNO ret
+
+# undef	PSEUDO_ERRVAL
+# define PSEUDO_ERRVAL(name, syscall_name, args) \
+  .text;								      \
+  ENTRY (name)								      \
+    DO_CALL (syscall_name, args);					      \
+    negq %rax
+
+# undef	PSEUDO_END_ERRVAL
+# define PSEUDO_END_ERRVAL(name) \
+  END (name)
+
+# define ret_ERRVAL ret
+
+# ifndef __PIC__
+#  define SYSCALL_ERROR_HANDLER	/* Nothing here; code in sysdep.S is used.  */
+# elif defined(RTLD_PRIVATE_ERRNO)
+#  define SYSCALL_ERROR_HANDLER			\
+0:						\
+  leaq rtld_errno(%rip), %rcx;			\
+  xorl %edx, %edx;				\
+  subq %rax, %rdx;				\
+  movl %edx, (%rcx);				\
+  orq $-1, %rax;				\
+  jmp L(pseudo_end);
+# elif USE___THREAD
+#  ifndef NOT_IN_libc
+#   define SYSCALL_ERROR_ERRNO __libc_errno
+#  else
+#   define SYSCALL_ERROR_ERRNO errno
+#  endif
+#  define SYSCALL_ERROR_HANDLER			\
+0:						\
+  movq SYSCALL_ERROR_ERRNO@GOTTPOFF(%rip), %rcx;\
+  xorl %edx, %edx;				\
+  subq %rax, %rdx;				\
+  movl %edx, %fs:(%rcx);			\
+  orq $-1, %rax;				\
+  jmp L(pseudo_end);
+# elif defined _LIBC_REENTRANT
+/* Store (- %rax) into errno through the GOT.
+   Note that errno occupies only 4 bytes.  */
+#  define SYSCALL_ERROR_HANDLER			\
+0:						\
+  xorl %edx, %edx;				\
+  subq %rax, %rdx;				\
+  pushq %rdx;					\
+  cfi_adjust_cfa_offset(8);			\
+  call __errno_location@PLT;		\
+  popq %rdx;					\
+  cfi_adjust_cfa_offset(-8);			\
+  movl %edx, (%rax);				\
+  orq $-1, %rax;				\
+  jmp L(pseudo_end);
+
+/* A quick note: it is assumed that the call to `__errno_location' does
+   not modify the stack!  */
+# else /* Not _LIBC_REENTRANT.  */
+#  define SYSCALL_ERROR_HANDLER			\
+0:movq errno@GOTPCREL(%RIP), %rcx;		\
+  xorl %edx, %edx;				\
+  subq %rax, %rdx;				\
+  movl %edx, (%rcx);				\
+  orq $-1, %rax;				\
+  jmp L(pseudo_end);
+# endif	/* __PIC__ */
+
+/* The Linux/x86-64 kernel expects the system call parameters in
+   registers according to the following table:
+
+    syscall number	rax
+    arg 1		rdi
+    arg 2		rsi
+    arg 3		rdx
+    arg 4		r10
+    arg 5		r8
+    arg 6		r9
+
+    The Linux kernel uses and destroys internally these registers:
+    return address from
+    syscall		rcx
+    eflags from syscall	r11
+
+    Normal function call, including calls to the system call stub
+    functions in the libc, get the first six parameters passed in
+    registers and the seventh parameter and later on the stack.  The
+    register use is as follows:
+
+     system call number	in the DO_CALL macro
+     arg 1		rdi
+     arg 2		rsi
+     arg 3		rdx
+     arg 4		rcx
+     arg 5		r8
+     arg 6		r9
+
+    We have to take care that the stack is aligned to 16 bytes.  When
+    called the stack is not aligned since the return address has just
+    been pushed.
+
+
+    Syscalls of more than 6 arguments are not supported.  */
+
+# undef	DO_CALL
+# define DO_CALL(syscall_name, args)		\
+    DOARGS_##args				\
+    movl $SYS_ify (syscall_name), %eax;		\
+    syscall;
+
+# define DOARGS_0 /* nothing */
+# define DOARGS_1 /* nothing */
+# define DOARGS_2 /* nothing */
+# define DOARGS_3 /* nothing */
+# define DOARGS_4 movq %rcx, %r10;
+# define DOARGS_5 DOARGS_4
+# define DOARGS_6 DOARGS_5
+
+#endif	/* __ASSEMBLER__ */
+
+
+/* Pointer mangling support.  */
+#if defined NOT_IN_libc && defined IS_IN_rtld
+/* We cannot use the thread descriptor because in ld.so we use setjmp
+   earlier than the descriptor is initialized.  */
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE(reg)	xorq __pointer_chk_guard_local(%rip), reg;    \
+				rolq $17, reg
+#  define PTR_DEMANGLE(reg)	rorq $17, reg;				      \
+				xorq __pointer_chk_guard_local(%rip), reg
+# else
+#  define PTR_MANGLE(reg)	__asm__ ("xorq __pointer_chk_guard_local(%%rip), %0\n" \
+				     "rolq $17, %0"			      \
+				     : "=r" (reg) : "0" (reg))
+#  define PTR_DEMANGLE(reg)	__asm__ ("rorq $17, %0\n"			      \
+				     "xorq __pointer_chk_guard_local(%%rip), %0" \
+				     : "=r" (reg) : "0" (reg))
+# endif
+#else
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE(reg)	xorq %fs:POINTER_GUARD, reg;		      \
+				rolq $17, reg
+#  define PTR_DEMANGLE(reg)	rorq $17, reg;				      \
+				xorq %fs:POINTER_GUARD, reg
+# else
+#  define PTR_MANGLE(var)	__asm__ ("xorq %%fs:%c2, %0\n"		      \
+				     "rolq $17, %0"			      \
+				     : "=r" (var)			      \
+				     : "0" (var),			      \
+				       "i" (offsetof (tcbhead_t,	      \
+						      pointer_guard)))
+#  define PTR_DEMANGLE(var)	__asm__ ("rorq $17, %0\n"			      \
+				     "xorq %%fs:%c2, %0"		      \
+				     : "=r" (var)			      \
+				     : "0" (var),			      \
+				       "i" (offsetof (tcbhead_t,	      \
+						      pointer_guard)))
+# endif
+#endif
+
+#endif /* linux/x86_64/sysdep.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/x86_64/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/x86_64/vfork.S
new file mode 100644
index 0000000..97c9c5b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/x86_64/vfork.S
@@ -0,0 +1,66 @@
+/* Copyright (C) 2001, 2002, 2004, 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.  */
+
+#include <sys/syscall.h>
+
+/* Clone the calling process, but without copying the whole address space.
+   The calling process is suspended until the new process exits or is
+   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
+   and the process ID of the new process to the old process.  */
+
+#ifndef __NR_vfork
+/* No vfork so use fork instead */
+# define __NR_vfork __NR_fork
+#endif
+
+.text
+.global __vfork
+.hidden __vfork
+.type   __vfork,%function
+
+__vfork:
+
+	/* Pop the return PC value into RDI.  We need a register that
+	   is preserved by the syscall and that we're allowed to destroy. */
+	popq	%rdi
+
+#ifdef SAVE_PID
+	SAVE_PID
+#endif
+
+	/* Stuff the syscall number in RAX and enter into the kernel.  */
+	movl	$__NR_vfork, %eax
+	syscall
+
+	/* Push back the return PC.  */
+	pushq	%rdi
+
+#ifdef RESTORE_PID
+	RESTORE_PID
+#endif
+
+	cmpl	$-4095, %eax
+	jae __syscall_error		/* Branch forward if it failed.  */
+
+	/* Normal return.  */
+	ret
+
+.size __vfork,.-__vfork
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/Makefile b/ap/build/uClibc/libc/sysdeps/linux/xtensa/Makefile
new file mode 100644
index 0000000..633c91f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/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/xtensa/Makefile.arch b/ap/build/uClibc/libc/sysdeps/linux/xtensa/Makefile.arch
new file mode 100644
index 0000000..bf45031
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/Makefile.arch
@@ -0,0 +1,15 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2007, 2008 Tensilica Inc.
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+CSRC := brk.c fork.c pread_write.c sigaction.c __syscall_error.c
+
+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),y)
+    CSRC += posix_fadvise.c posix_fadvise64.c
+endif
+
+SSRC := bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S \
+	sigrestorer.S syscall.S mmap.S windowspill.S __longjmp.S vfork.S
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/__longjmp.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/__longjmp.S
new file mode 100644
index 0000000..5d5dd2f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/__longjmp.S
@@ -0,0 +1,126 @@
+/* longjmp for Xtensa Processors.
+
+   Copyright (C) 2001, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* This implementation relies heavily on the Xtensa register window
+   mechanism.  Setjmp flushes all the windows except its own to the
+   stack and then copies registers from the save areas on the stack
+   into the jmp_buf structure, along with the return address of the call
+   to setjmp.  Longjmp invalidates all the windows except its own, and
+   then sets things up so that it will return to the right place,
+   using a window underflow to automatically restore the registers.
+
+   Note that it would probably be sufficient to only copy the
+   registers from setjmp's caller into jmp_buf.  However, we also copy
+   the save area located at the stack pointer of setjmp's caller.
+   This save area will typically remain intact until the longjmp call.
+   The one exception is when there is an intervening alloca in
+   setjmp's caller.  This is certainly an unusual situation and is
+   likely to cause problems in any case (the storage allocated on the
+   stack cannot be safely accessed following the longjmp).  As bad as
+   it is, on most systems this situation would not necessarily lead to
+   a catastrophic failure.  If we did not preserve the extra save area
+   on Xtensa, however, it would.  When setjmp's caller returns after a
+   longjmp, there will be a window underflow; an invalid return
+   address or stack pointer in the save area will almost certainly
+   lead to a crash.  Keeping a copy of the extra save area in the
+   jmp_buf avoids this with only a small additional cost.  If setjmp
+   and longjmp are ever time-critical, this could be removed.  */
+
+
+#include "sysdep.h"
+
+
+ENTRY (__longjmp)
+
+	/* Invalidate all but the current window.  Reading and writing
+	   special registers WINDOWBASE and WINDOWSTART are
+	   privileged operations, so user processes must call the
+	   slower __window_spill() to do the job.  */
+
+	movi	a4, __window_spill
+	callx4	a4
+
+	/* Return to the return address of the setjmp, using the
+	   window size bits from the setjmp call so that the caller
+	   will be able to find the return value that we put in a2.  */
+
+	l32i	a0, a2, 64
+
+	/* Copy the first 4 saved registers from jmp_buf into the save area
+	   at the current sp so that the values will be restored to registers
+	   when longjmp returns. */
+
+	addi	a7, a1, -16
+	l32i	a4, a2, 0
+	l32i	a5, a2, 4
+	s32i	a4, a7, 0
+	s32i	a5, a7, 4
+	l32i	a4, a2, 8
+	l32i	a5, a2, 12
+	s32i	a4, a7, 8
+	s32i	a5, a7, 12
+
+	/* Copy the remaining 0-8 saved registers.  */
+	extui	a7, a0, 30, 2
+	blti	a7, 2, .Lendlj
+	l32i	a8, a2, 52
+	slli	a4, a7, 4
+	sub	a6, a8, a4
+	addi	a5, a2, 16
+	addi	a8, a8, -16		/* a8 = end of register overflow area */
+.Lljloop:
+	l32i	a7, a5, 0
+	l32i	a4, a5, 4
+	s32i	a7, a6, 0
+	s32i	a4, a6, 4
+	l32i	a7, a5, 8
+	l32i	a4, a5, 12
+	s32i	a7, a6, 8
+	s32i	a4, a6, 12
+	addi	a5, a5, 16
+	addi	a6, a6, 16
+	blt	a6, a8, .Lljloop
+.Lendlj:
+
+	/* The 4 words saved from the register save area at the target's
+	   sp are copied back to the target procedure's save area.  The
+	   only point of this is to prevent a catastrophic failure in
+	   case the contents were moved by an alloca after calling
+	   setjmp.  This is a bit paranoid but it doesn't cost much.  */
+
+	l32i	a7, a2, 4		/* load the target stack pointer */
+	addi	a7, a7, -16		/* find the destination save area */
+	l32i	a4, a2, 48
+	l32i	a5, a2, 52
+	s32i	a4, a7, 0
+	s32i	a5, a7, 4
+	l32i	a4, a2, 56
+	l32i	a5, a2, 60
+	s32i	a4, a7, 8
+	s32i	a5, a7, 12
+
+	/* Return v ? v : 1.  */
+	movi	a2, 1
+	movnez	a2, a3, a3
+
+	retw
+END (__longjmp)
+
+libc_hidden_def (__longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/__syscall_error.c b/ap/build/uClibc/libc/sysdeps/linux/xtensa/__syscall_error.c
new file mode 100644
index 0000000..2b642e8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/__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/xtensa/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/endian.h
new file mode 100644
index 0000000..38b3af3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/endian.h
@@ -0,0 +1,10 @@
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+/* Xtensa can be either big or little endian.  */
+#ifdef __XTENSA_EB__
+# define __BYTE_ORDER __BIG_ENDIAN
+#else
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/fcntl.h
new file mode 100644
index 0000000..921a626
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/fcntl.h
@@ -0,0 +1,239 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2007
+   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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, 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_DIRECT	 040000	/* Direct disk access.	*/
+# define O_DIRECTORY	0200000	/* Must be a directory.	 */
+# define O_NOFOLLOW	0400000	/* Do not follow links.	 */
+# define O_NOATIME     01000000 /* Do not set atime.  */
+# define O_CLOEXEC     02000000 /* set close_on_exec */
+#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	0100000
+#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/xtensa/bits/ipc.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/ipc.h
new file mode 100644
index 0000000..481bdcc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/ipc.h
@@ -0,0 +1,54 @@
+/* Copyright (C) 1995-1999, 2000, 2005, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#ifdef __USE_GNU
+# define IPC_INFO	3		/* See ipcs.  */
+#endif
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;			/* Key.  */
+    __uid_t uid;			/* Owner's user ID.  */
+    __gid_t gid;			/* Owner's group ID.  */
+    __uid_t cuid;			/* Creator's user ID.  */
+    __gid_t cgid;			/* Creator's group ID.  */
+    unsigned int mode;			/* Read/write permission.  */
+    unsigned int __seq;			/* Sequence number.  */
+    unsigned long int __unused1;
+    unsigned long int __unused2;
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/kernel_stat.h
new file mode 100644
index 0000000..5e4f5c4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/kernel_stat.h
@@ -0,0 +1,45 @@
+#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 {
+	unsigned long	st_dev;
+	unsigned long	st_ino;
+	unsigned int	st_mode;
+	unsigned int	st_nlink;
+	unsigned int	st_uid;
+	unsigned int	st_gid;
+	unsigned long	st_rdev;
+	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;	/* Device */
+	unsigned long long st_ino;	/* File serial number */
+	unsigned int  st_mode;		/* File mode. */
+	unsigned int  st_nlink;		/* Link count. */
+	unsigned int  st_uid;		/* User ID of the file's owner. */
+	unsigned int  st_gid;		/* Group ID of the file's group. */
+	unsigned long long st_rdev;	/* Device number, if device. */
+	long long st_size;		/* Size of file, in bytes. */
+	unsigned long st_blksize;	/* Optimal block size for I/O. */
+	unsigned long __unused2;
+	unsigned long long st_blocks;	/* Number 512-byte blocks allocated. */
+	struct timespec st_atim;	/* Time of last access. */
+	struct timespec st_mtim;	/* Time of last modification. */
+	struct timespec st_ctim;	/* Time of last status change. */
+	unsigned long __unused4;
+	unsigned long __unused5;
+};
+
+#endif	/* _BITS_STAT_STRUCT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/kernel_types.h
new file mode 100644
index 0000000..ed38f2e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/kernel_types.h
@@ -0,0 +1,50 @@
+/* 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 _XTENSA_POSIX_TYPES_H
+#define _XTENSA_POSIX_TYPES_H
+
+typedef unsigned long	__kernel_ino_t;
+typedef unsigned int	__kernel_mode_t;
+typedef unsigned long	__kernel_nlink_t;
+typedef long		__kernel_off_t;
+typedef int		__kernel_pid_t;
+typedef unsigned short	__kernel_ipc_pid_t;
+typedef unsigned int	__kernel_uid_t;
+typedef unsigned int	__kernel_gid_t;
+typedef unsigned int	__kernel_size_t;
+typedef int		__kernel_ssize_t;
+typedef long		__kernel_ptrdiff_t;
+typedef long		__kernel_time_t;
+typedef long		__kernel_suseconds_t;
+typedef long		__kernel_clock_t;
+typedef int		__kernel_timer_t;
+typedef int		__kernel_clockid_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 unsigned short	__kernel_old_dev_t;
+typedef long		__kernel_long_t;
+typedef unsigned long	__kernel_ulong_t;
+typedef long long	__kernel_loff_t;
+
+/* Beginning in 2.6 kernels, which is the first version that includes the
+   Xtensa port, __kernel_dev_t is defined in "linux/types.h" and is no longer
+   architecture-specific.  It is defined here in uClibc for consistency with
+   other uClibc ports and for lack of a better place.  */
+typedef unsigned int	__kernel_dev_t;
+
+typedef struct {
+	int	val[2];
+} __kernel_fsid_t;
+
+#endif /* _XTENSA_POSIX_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/mathdef.h
new file mode 100644
index 0000000..0177fa9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/mathdef.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 2000, 2001, 2004, 2007
+   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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, 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
+
+/* Xtensa has `float' and `double' operations.  */
+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'.  The disables the
+   declaration of all the `long double' function variants.  */
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/mman.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/mman.h
new file mode 100644
index 0000000..fead3ac
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/mman.h
@@ -0,0 +1,106 @@
+/* Definitions for POSIX memory map interface.  Linux/Xtensa version.
+   Copyright (C) 1997, 2000, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+   But the kernel header is not namespace clean.  */
+
+
+/* Protections are chosen from these bits, OR'd together.  The
+   implementation does not necessarily support PROT_EXEC or PROT_WRITE
+   without PROT_READ.  The only guarantees are that no writing will be
+   allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ	0x1		/* Page can be read.  */
+#define PROT_WRITE	0x2		/* Page can be written.  */
+#define PROT_EXEC	0x4		/* Page can be executed.  */
+#define PROT_NONE	0x0		/* Page can not be accessed.  */
+#define PROT_GROWSDOWN	0x01000000	/* Extend change to start of
+					   growsdown vma (mprotect only).  */
+#define PROT_GROWSUP	0x02000000	/* Extend change to start of
+					   growsup vma (mprotect only).  */
+
+/* Sharing types (must choose one and only one of these).  */
+#define MAP_SHARED	0x01		/* Share changes.  */
+#define MAP_PRIVATE	0x02		/* Changes are private.  */
+#ifdef __USE_MISC
+# define MAP_TYPE	0x0f		/* Mask for type of mapping.  */
+#endif
+
+/* Other flags.  */
+#define MAP_FIXED	0x10		/* Interpret addr exactly.  */
+#ifdef __USE_MISC
+# define MAP_FILE	0
+# define MAP_ANONYMOUS	0x800		/* Don't use a file.  */
+# define MAP_ANON	MAP_ANONYMOUS
+# define MAP_RENAME	MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific.  */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN	0x1000		/* Stack-like segment.  */
+# define MAP_DENYWRITE	0x2000		/* ETXTBSY */
+# define MAP_EXECUTABLE	0x4000		/* Mark it as an executable.  */
+# define MAP_LOCKED	0x8000		/* Lock the mapping.  */
+# define MAP_NORESERVE	0x0400		/* Don't check for reservations.  */
+# define MAP_POPULATE	0x10000		/* Populate (prefault) pagetables.  */
+# define MAP_NONBLOCK	0x20000		/* Do not block on IO.  */
+# define MAP_UNINITIALIZE 0x4000000     /* For anonymous mmap, memory could
+					   be uninitialized. */
+#endif
+
+/* Flags to `msync'.  */
+#define MS_ASYNC	1		/* Sync memory asynchronously.  */
+#define MS_SYNC		4		/* Synchronous memory sync.  */
+#define MS_INVALIDATE	2		/* Invalidate the caches.  */
+
+/* Flags for `mlockall'.  */
+#define MCL_CURRENT	1		/* Lock all currently mapped pages.  */
+#define MCL_FUTURE	2		/* Lock all additions to address
+					   space.  */
+
+/* Flags for `mremap'.  */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE	1
+# define MREMAP_FIXED	2
+#endif
+
+/* Advice to `madvise'.  */
+#ifdef __USE_BSD
+# define MADV_NORMAL	 0	/* No further special treatment.  */
+# define MADV_RANDOM	 1	/* Expect random page references.  */
+# define MADV_SEQUENTIAL 2	/* Expect sequential page references.  */
+# define MADV_WILLNEED	 3	/* Will need these pages.  */
+# define MADV_DONTNEED	 4	/* Don't need these pages.  */
+# define MADV_REMOVE	 9	/* Remove these pages and resources.  */
+# define MADV_DONTFORK	 10	/* Do not inherit across fork.  */
+# define MADV_DOFORK	 11	/* Do inherit across fork.  */
+#endif
+
+/* The POSIX people had to invent similar names for the same things.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_MADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_MADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+# define POSIX_MADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_MADV_DONTNEED	4 /* Don't need these pages.  */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/msq.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/msq.h
new file mode 100644
index 0000000..2eca21e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/msq.h
@@ -0,0 +1,88 @@
+/* Copyright (C) 1995-1997, 2000, 2004, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifndef _SYS_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Define options for message queue functions.  */
+#define MSG_NOERROR	010000	/* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT	020000	/* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition.  */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+
+/* Structure of record for one message inside the kernel.
+   The type `struct msg' is opaque.  */
+struct msqid_ds
+{
+  struct ipc_perm msg_perm;	/* structure describing operation permission */
+#if defined (__XTENSA_EB__)
+  unsigned long int __unused1;
+  __time_t msg_stime;		/* time of last msgsnd command */
+  unsigned long int __unused2;
+  __time_t msg_rtime;		/* time of last msgrcv command */
+  unsigned long int __unused3;
+  __time_t msg_ctime;		/* time of last change */
+#elif defined (__XTENSA_EL__)
+  __time_t msg_stime;		/* time of last msgsnd command */
+  unsigned long int __unused1;
+  __time_t msg_rtime;		/* time of last msgrcv command */
+  unsigned long int __unused2;
+  __time_t msg_ctime;		/* time of last change */
+  unsigned long int __unused3;
+#else
+# error endian order not defined
+#endif
+  unsigned long int __msg_cbytes; /* current number of bytes on queue */
+  msgqnum_t msg_qnum;		/* number of messages currently on queue */
+  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
+  __pid_t msg_lspid;		/* pid of last msgsnd() */
+  __pid_t msg_lrpid;		/* pid of last msgrcv() */
+  unsigned long int __unused4;
+  unsigned long int __unused5;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes	__msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+  {
+    int msgpool;
+    int msgmap;
+    int msgmax;
+    int msgmnb;
+    int msgmni;
+    int msgssz;
+    int msgtql;
+    unsigned short int msgseg;
+  };
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/setjmp.h
new file mode 100644
index 0000000..1bc4896
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/setjmp.h
@@ -0,0 +1,46 @@
+/* Copyright (C) 1997, 1998, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* Define the machine-dependent type `jmp_buf'.  Xtensa 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
+
+/* The jmp_buf structure for Xtensa holds the following (where "proc"
+   is the procedure that calls setjmp): 4-12 registers from the window
+   of proc, the 4 words from the save area at proc's $sp (in case a
+   subsequent alloca in proc moves $sp), and the return address within
+   proc.  Everything else is saved on the stack in the normal save areas.  */
+
+#ifndef	_ASM
+typedef int __jmp_buf[17];
+#endif
+
+#define JB_SP	1
+#define JB_PC	16
+
+/* Test if longjmp to JMPBUF would unwind the frame containing a local
+   variable at ADDRESS.  */
+
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[JB_SP])
+
+#endif	/* bits/setjmp.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/shm.h
new file mode 100644
index 0000000..de41d0d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/shm.h
@@ -0,0 +1,115 @@
+/* Copyright (C) 1995, 1996, 1997, 2000, 2002, 2007
+   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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, 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 ())
+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 */
+#if defined (__XTENSA_EL__)
+    __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;
+#elif defined (__XTENSA_EB__)
+    unsigned long int __unused1;
+    __time_t shm_atime;			/* time of last shmat() */
+    unsigned long int __unused2;
+    __time_t shm_dtime;			/* time of last shmdt() */
+    unsigned long int __unused3;
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+#else
+# error endian order not defined
+#endif
+    __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/xtensa/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/sigcontextinfo.h
new file mode 100644
index 0000000..8f3301c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/sigcontextinfo.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 2003, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* Also see register-dump.h, where we spill live registers to the
+   stack so that we can trace the stack backward.  */
+
+#define SIGCONTEXT unsigned long _info, ucontext_t *
+#define SIGCONTEXT_EXTRA_ARGS _info,
+
+/* ANDing with 0x3fffffff clears the window-size bits.
+   Assumes TASK_SIZE = 0x40000000.  */
+
+#define GET_PC(ctx)	((void *) (ctx->uc_mcontext.sc_pc & 0x3fffffff))
+#define GET_FRAME(ctx)	((void *) ctx->uc_mcontext.sc_a[1])
+#define GET_STACK(ctx)	((void *) ctx->uc_mcontext.sc_a[1])
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/stackinfo.h
new file mode 100644
index 0000000..50ddf25
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2000, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+/* On Xtensa the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+#endif	/* stackinfo.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/stat.h
new file mode 100644
index 0000000..8b67b15
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/stat.h
@@ -0,0 +1,158 @@
+/* Copyright (C) 1992, 1995-2005, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_KERNEL	0
+#define _STAT_VER_LINUX		1
+#define _STAT_VER		_STAT_VER_LINUX
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	0
+
+
+struct stat
+  {
+    __dev_t st_dev;			/* Device.  */
+#ifndef __USE_FILE_OFFSET64
+    __ino_t st_ino;			/* File serial number.	*/
+#else
+    __ino64_t st_ino;			/* File serial number.	*/
+#endif
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+#ifndef __USE_FILE_OFFSET64
+    __off_t st_size;			/* Size of file, in bytes.  */
+#else
+    __off64_t st_size;			/* Size of file, in bytes.  */
+#endif
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+#ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+#else
+    unsigned long __pad2;
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#endif
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+  };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;			/* Device.  */
+    __ino64_t st_ino;			/* File serial number.  */
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    __off64_t st_size;			/* Size of file, in bytes.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+    unsigned long __pad2;
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    unsigned long __unused4;
+    unsigned long __unused5;
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/syscalls.h
new file mode 100644
index 0000000..7e900c5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/syscalls.h
@@ -0,0 +1,87 @@
+#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 .../sysdeps/unix/sysv/linux/xtensa/sysdep.h
+*/
+
+#ifdef __ASSEMBLER__
+
+/* The register layout upon entering the function is:
+
+   return addr	stack ptr	arg0, arg1, arg2, arg3, arg4, arg5
+   -----------	---------	----------------------------------
+   a0		a1		a2,   a3,   a4,   a5,   a6,   a7
+
+   (Of course a function with say 3 arguments does not have entries for
+   arguments 4, 5, and 6.)
+
+   Linux takes system-call arguments in registers.  The ABI and Xtensa
+   software conventions require the system-call number in a2.  We move any
+   argument that was in a2 to a7, and a7 to a8 if we have all 6 arguments.
+   Note that for improved efficiency, we do NOT shift all parameters down
+   one register to maintain the original order.
+
+   syscall number		arg0, arg1, arg2, arg3, arg4, arg5
+   --------------		----------------------------------
+   a2				a6,   a3,   a4,   a5,   a8,   a9
+
+   Upon return, a2 and a3 are clobbered; all other registers are preserved.  */
+
+#undef  DO_CALL
+#define DO_CALL(syscall_name, nargs)					      \
+	DO_ARGS_##nargs							      \
+	movi	a2, SYS_ify (syscall_name);				      \
+	syscall
+
+#define DO_ARGS_0
+#define DO_ARGS_1	mov a6, a2;
+#define DO_ARGS_2	mov a6, a2;
+#define DO_ARGS_3	mov a6, a2;
+#define DO_ARGS_4	mov a6, a2;
+#define DO_ARGS_5	mov a8, a6; mov a6, a2;
+#define DO_ARGS_6	mov a9, a7; mov a8, a6; mov a6, a2;
+
+#else /* not __ASSEMBLER__ */
+
+#include <errno.h>
+
+#define STR(s) #s
+#define LD_ARG(n,ar)	register int _a##n __asm__ (STR(a##n)) = (int) (ar)
+
+#define LD_ARGS_0()
+#define LD_ARGS_1(a0)			LD_ARG(6,a0)
+#define LD_ARGS_2(a0,a1)		LD_ARGS_1(a0); LD_ARG(3,a1)
+#define LD_ARGS_3(a0,a1,a2)		LD_ARGS_2(a0,a1); LD_ARG(4,a2)
+#define LD_ARGS_4(a0,a1,a2,a3)		LD_ARGS_3(a0,a1,a2); LD_ARG(5,a3)
+#define LD_ARGS_5(a0,a1,a2,a3,a4)	LD_ARGS_4(a0,a1,a2,a3); LD_ARG(8,a4)
+#define LD_ARGS_6(a0,a1,a2,a3,a4,a5)	LD_ARGS_5(a0,a1,a2,a3,a4); LD_ARG(9,a5)
+
+#define ASM_ARGS_0			"r"(_a2)
+#define ASM_ARGS_1			ASM_ARGS_0, "r"(_a6)
+#define ASM_ARGS_2			ASM_ARGS_1, "r"(_a3)
+#define ASM_ARGS_3			ASM_ARGS_2, "r"(_a4)
+#define ASM_ARGS_4			ASM_ARGS_3, "r"(_a5)
+#define ASM_ARGS_5			ASM_ARGS_4, "r"(_a8)
+#define ASM_ARGS_6			ASM_ARGS_5, "r"(_a9)
+
+/* Define a macro which expands into the inline wrapper code for a system
+   call.  */
+
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			      \
+(__extension__ \
+  ({ LD_ARG(2, name);							      \
+     LD_ARGS_##nr(args);						      \
+     __asm__ __volatile__ ("syscall\n" 						      \
+	 	   : "=a" (_a2)						      \
+	 	   : ASM_ARGS_##nr					      \
+	 	   : "memory");						      \
+     (long) _a2;							      \
+   }) \
+)
+#endif /* not __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..fef1765
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/uClibc_arch_features.h
@@ -0,0 +1,47 @@
+/*
+ * 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__ "ill"
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#define __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __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/xtensa/bits/uClibc_page.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/uClibc_page.h
new file mode 100644
index 0000000..74a9f60
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/uClibc_page.h
@@ -0,0 +1,31 @@
+/*  Copyright (C) 2004     Erik Andersen
+ *
+ *  This 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.
+ */
+
+/* Supply an architecture specific value for PAGE_SIZE and friends.  */
+
+#ifndef _UCLIBC_PAGE_H
+#define _UCLIBC_PAGE_H
+
+#include <bits/xtensa-config.h>
+
+/* PAGE_SHIFT determines the page size -- in this case 4096 */
+#define PAGE_SHIFT	XCHAL_MMU_MIN_PTE_PAGE_SIZE
+#define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#define PAGE_MASK	(~(PAGE_SIZE-1))
+
+#endif /* _UCLIBC_PAGE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/wordsize.h
new file mode 100644
index 0000000..ba643b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/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/xtensa/bits/xtensa-config.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/xtensa-config.h
new file mode 100644
index 0000000..34cf28c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bits/xtensa-config.h
@@ -0,0 +1,53 @@
+/* Xtensa configuration settings.
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   Free Software Foundation, Inc.
+   Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
+
+   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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifndef XTENSA_CONFIG_H
+#define XTENSA_CONFIG_H
+
+/* The macros defined here match those with the same names in the Xtensa
+   compile-time HAL (Hardware Abstraction Layer).  Please refer to the
+   Xtensa System Software Reference Manual for documentation of these
+   macros.  */
+
+/* The following macros reflect the default expectations for Xtensa
+   processor configurations that can run glibc.  If you want to try
+   building glibc for an Xtensa configuration that is missing these
+   options, you will at least need to change the values of these
+   macros.  */
+
+#undef XCHAL_HAVE_NSA
+#define XCHAL_HAVE_NSA			1
+
+#undef XCHAL_HAVE_LOOPS
+#define XCHAL_HAVE_LOOPS		1
+
+/* Assume the maximum number of AR registers.  This currently only affects
+   the __window_spill function, and it is always safe to flush extra.  */
+
+#undef XCHAL_NUM_AREGS
+#define XCHAL_NUM_AREGS			64
+
+/* Set a default page size.  This is currently needed when bootstrapping
+   the runtime linker.  See comments in dl-machine.h where this is used.  */
+
+#undef XCHAL_MMU_MIN_PTE_PAGE_SIZE
+#define XCHAL_MMU_MIN_PTE_PAGE_SIZE	12
+
+#endif /* !XTENSA_CONFIG_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/brk.c b/ap/build/uClibc/libc/sysdeps/linux/xtensa/brk.c
new file mode 100644
index 0000000..8e98c31
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/brk.c
@@ -0,0 +1,42 @@
+/* brk system call for Linux/Xtensa.
+   Copyright (C) 1996, 1997, 2005, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, 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;
+
+  __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr);
+
+  if (newbrk < addr)
+    {
+      __set_errno (ENOMEM);
+      return -1;
+    }
+
+  return 0;
+}
+libc_hidden_def(brk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bsd-_setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bsd-_setjmp.S
new file mode 100644
index 0000000..4e6a2da
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bsd-_setjmp.S
@@ -0,0 +1 @@
+/* _setjmp is in setjmp.S  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/bsd-setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bsd-setjmp.S
new file mode 100644
index 0000000..1da848d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/bsd-setjmp.S
@@ -0,0 +1 @@
+/* setjmp is in setjmp.S  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/clone.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/clone.S
new file mode 100644
index 0000000..31921ea
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/clone.S
@@ -0,0 +1,103 @@
+/* Copyright (C) 2001, 2005, 2007 Free Software Foundation, Inc.
+
+   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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* clone is even more special than fork as it mucks with stacks
+   and invokes a function in the right context after it's all over.  */
+
+#include "sysdep.h"
+#include <sys/syscall.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+
+/* int clone (a2 = int (*fn)(void *arg),
+	      a3 = void *child_stack,
+	      a4 = int flags,
+	      a5 = void *arg,
+              a6 = pid_t *ptid,
+	      a7 = struct user_desc *tls,
+	      16(sp) = pid_t *ctid) */
+
+        .text
+ENTRY (__clone)
+
+	/* Sanity check arguments.  */
+	beqz	a2, .Leinval	/* no NULL function pointers */
+	beqz	a3, .Leinval	/* no NULL stack pointers */
+
+	/* a2 and a3 are candidates for destruction by system-call return
+	   parameters.  We don't need the stack pointer after the system
+	   call.  We trust that the kernel will preserve a7, a9, and a6.  */
+
+	mov	a9, a5			/* save function argument */
+	mov	a5, a7
+	mov	a7, a2			/* save function pointer */
+	mov	a8, a6			/* use a8 as a temp */
+	mov	a6, a4
+	mov	a4, a8
+	l32i	a8, a1, 16		/* child_tid */
+	movi	a2, SYS_ify (clone)
+
+	/* syscall (a2 = NR_clone,
+		    a6 = clone_flags,
+		    a3 = usp,
+		    a4 = parent_tid,
+		    a5 = child_tls,
+		    a8 = child_tid) */
+	syscall
+	bltz	a2, SYSCALL_ERROR_LABEL
+	beqz	a2, .Lthread_start
+
+	/* Fall through for parent.  */
+.Lpseudo_end:
+	retw
+
+.Leinval:
+	movi	a2, -EINVAL
+	j	SYSCALL_ERROR_LABEL
+
+.Lthread_start:
+	/* Start child thread.  */
+	movi	a0, 0			/* terminate the stack frame */
+
+#ifdef RESET_PID
+	/* Check and see if we need to reset the PID.  */
+	bbsi.l	a6, 16, 1f		/* CLONE_THREAD = 0x00010000 */
+	movi	a2, -1
+	bbsi.l	a6, 8, 2f		/* CLONE_VM = 0x00000100 */
+	movi	a2, SYS_ify (getpid)
+	syscall
+2:	rur	a3, THREADPTR
+	movi	a4, PID_OFFSET
+	add	a4, a4, a3
+	s32i	a2, a4, 0
+	movi	a4, TID_OFFSET
+	add	a4, a4, a3
+	s32i	a2, a3, 0
+1:
+#endif /* RESET_PID */
+
+	mov	a6, a9			/* load up the 'arg' parameter */
+	callx4	a7			/* call the user's function */
+
+	/* Call _exit.  Note that any return parameter from the user's
+	   function in a6 is seen as inputs to _exit.  */
+	movi	a2, JUMPTARGET(_exit)
+	callx4	a2
+
+PSEUDO_END (__clone)
+
+weak_alias (__clone, clone)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/crt1.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/crt1.S
new file mode 100644
index 0000000..63fbadc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/crt1.S
@@ -0,0 +1,119 @@
+/* Startup code compliant to the ELF Xtensa ABI.
+   Copyright (C) 2001, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#include <features.h>
+
+#ifndef __UCLIBC_CTOR_DTOR__
+        .weak _init
+        .weak _fini
+#endif
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.  When the entry point runs, most register values are unspecified,
+   except for:
+
+	a2	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.
+
+	a1	The stack (i.e., a1+16) contains the arguments and environment:
+		a1+0			argc
+		a1+4			argv[0]
+		...
+		a1+(4*argc)		NULL
+		a1+(4*(argc+1))		envp[0]
+		...
+					NULL
+
+  Setup parameters accordingly (for a call4).  See function prototype
+  from sysdeps/generic/libc-start.c
+
+	a6 = *main
+	a7 = argc
+	a8 = ubp_av
+	a9 = *init
+	a10 = *fini
+	a11 = *rtld_fini
+	[sp+0] = stack_end
+ */
+
+	.text
+	.align	4
+	.literal_position
+	.global	_start
+	.type	_start, @function
+_start:
+	/* Clear a0 to obviously mark the outermost frame.  */
+	movi	a0, 0
+
+	/* Load up the user's main function.  */
+	movi	a6, main
+
+	/* Extract the arguments as encoded on the stack and set up
+	   the arguments for `main': argc, argv.  envp will be determined
+	   later in __uClibc_main.  */
+	l32i	a7, a1, 0	/* Load the argument count.  */
+	addi	a8, a1, 4	/* Compute the argv pointer.  */
+
+	/* Push address of our own entry points to .fini and .init.  */
+	movi	a9, _init
+	movi	a10, _fini
+
+	/* Setup the shared library termination function.  */
+	mov	a11, a2
+
+	/* Provide the highest stack address to the user code (for stacks
+	   which grow downwards).  Note that we destroy the stack version
+	   of argc here.  */
+	s32i	a1, a1, 0
+
+	/* Call the user's main function, and exit with its value.
+	   But let the libc call main.    */
+	movi	a4, __uClibc_main
+	callx4	a4
+
+	/* Crash if somehow `exit' does return.  */
+	ill
+
+	/* Define a symbol for the first piece of initialized data.  */
+	.data
+	.align	4
+	.global	__data_start
+__data_start:
+	.long	0
+	.weak	data_start
+	data_start = __data_start
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/crti.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/crti.S
new file mode 100644
index 0000000..a01c02c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/crti.S
@@ -0,0 +1,16 @@
+/* glibc's sysdeps/xtensa/elf/initfini.c used for reference [PROLOG] */
+
+	.section .init
+	.align	4
+	.global	_init
+	.type	_init, @function
+_init:
+	entry	sp, 48
+
+
+	.section .fini
+	.align	4
+	.global	_fini
+	.type	_fini, @function
+_fini:
+	entry	sp, 48
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/crtn.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/crtn.S
new file mode 100644
index 0000000..ab1a489
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/crtn.S
@@ -0,0 +1,8 @@
+/* glibc's sysdeps/xtensa/elf/initfini.c used for reference [EPILOG] */
+
+	.section .init
+	retw
+
+
+	.section .fini
+	retw
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/fork.c b/ap/build/uClibc/libc/sysdeps/linux/xtensa/fork.c
new file mode 100644
index 0000000..f8fae9b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/fork.c
@@ -0,0 +1,25 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fork() for Xtensa uClibc
+ *
+ * Copyright (C) 2007 Tensilica Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <sys/syscall.h>
+#define _SIGNAL_H
+#include <bits/signum.h>
+
+/* Xtensa doesn't provide a 'fork' system call, so we use 'clone'.  */
+
+extern __typeof(fork) __libc_fork;
+
+libc_hidden_proto(fork)
+pid_t __libc_fork(void)
+{
+	return (pid_t) INLINE_SYSCALL(clone, 2, SIGCHLD, 0);
+}
+weak_alias(__libc_fork, fork)
+libc_hidden_weak(fork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/mmap.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/mmap.S
new file mode 100644
index 0000000..c991e7d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/mmap.S
@@ -0,0 +1,57 @@
+/* Copyright (C) 2005, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include <sys/syscall.h>
+
+#define PAGE_SHIFT 12
+
+/* __ptr_t __mmap (a2 = __ptr_t addr,
+		   a3 = size_t len,
+		   a4 = int prot,
+		   a5 = int flags,
+		   a6 = int fd,
+		   a7 = off_t offset) */
+
+ENTRY (__mmap)
+
+	/* We only support mmap2 in the kernel, so shift offset by
+	   page - size.  */
+	mov	a8, a6
+	mov	a6, a2
+	movi	a2, SYS_ify (mmap2)
+	srli	a9, a7, PAGE_SHIFT
+
+	/* syscall (a2 = NR_mmap2,
+		    a6 = arg0,
+		    a3 = arg1,
+		    a4 = arg2,
+		    a5 = arg3,
+		    a8 = arg4,
+		    a9 = arg5) */
+
+	syscall
+	bltz	a2, SYSCALL_ERROR_LABEL
+
+.Lpseudo_end:
+	retw
+
+PSEUDO_END (__mmap)
+
+weak_alias (__mmap, mmap)
+libc_hidden_weak (mmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/posix_fadvise.c b/ap/build/uClibc/libc/sysdeps/linux/xtensa/posix_fadvise.c
new file mode 100644
index 0000000..0fe13a1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/posix_fadvise.c
@@ -0,0 +1,29 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise() for Xtensa uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2007 Tensilica Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+int posix_fadvise (int fd, off_t offset, off_t len, int advice)
+{
+#ifdef __NR_fadvise64_64
+	INTERNAL_SYSCALL_DECL (err);
+	int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd, advice,
+								__LONG_LONG_PAIR ((long) (offset >> 31),
+												  (long) offset),
+								__LONG_LONG_PAIR ((long) (len >> 31),
+												  (long) len));
+	if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
+		return 0;
+	return INTERNAL_SYSCALL_ERRNO (ret, err);
+#else
+	return ENOSYS;
+#endif
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/posix_fadvise64.c b/ap/build/uClibc/libc/sysdeps/linux/xtensa/posix_fadvise64.c
new file mode 100644
index 0000000..1fdeeba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/posix_fadvise64.c
@@ -0,0 +1,39 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise64() for Xtensa uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2007 Tensilica Inc.
+ *
+ * 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__
+
+int posix_fadvise64 (int fd, __off64_t offset, __off64_t len, int advice)
+{
+#ifdef __NR_fadvise64_64
+	INTERNAL_SYSCALL_DECL (err);
+	int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd, advice,
+								__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;
+	return INTERNAL_SYSCALL_ERRNO (ret, err);
+#else
+	return ENOSYS;
+#endif
+}
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/pread_write.c b/ap/build/uClibc/libc/sysdeps/linux/xtensa/pread_write.c
new file mode 100644
index 0000000..71ba22b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/pread_write.c
@@ -0,0 +1,189 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/*
+ * Based in part on the files
+ *		./sysdeps/unix/sysv/linux/pwrite.c,
+ *		./sysdeps/unix/sysv/linux/pread.c,
+ *		sysdeps/posix/pread.c
+ *		sysdeps/posix/pwrite.c
+ * from GNU libc 2.2.5, but reworked considerably...
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <endian.h>
+
+extern __typeof(pread) __libc_pread;
+extern __typeof(pwrite) __libc_pwrite;
+#ifdef __UCLIBC_HAS_LFS__
+extern __typeof(pread64) __libc_pread64;
+extern __typeof(pwrite64) __libc_pwrite64;
+#endif
+
+#include <bits/kernel_types.h>
+
+#ifdef __NR_pread
+
+# define __NR___syscall_pread __NR_pread
+/* On Xtensa, 64-bit values are aligned in even/odd register pairs.  */
+static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf,
+		size_t, count, int, pad, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return __syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 31, offset));
+}
+weak_alias(__libc_pread,pread)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
+{
+	uint32_t low = offset & 0xffffffff;
+	uint32_t high = offset >> 32;
+	return __syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR(high, low));
+}
+weak_alias(__libc_pread64,pread64)
+# endif /* __UCLIBC_HAS_LFS__  */
+
+#endif /* __NR_pread */
+
+#ifdef __NR_pwrite
+
+# define __NR___syscall_pwrite __NR_pwrite
+/* On Xtensa, 64-bit values are aligned in even/odd register pairs.  */
+static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf,
+		size_t, count, int, pad, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+	return __syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 31, offset));
+}
+weak_alias(__libc_pwrite,pwrite)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
+{
+	uint32_t low = offset & 0xffffffff;
+	uint32_t high = offset >> 32;
+	return __syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR(high, low));
+}
+weak_alias(__libc_pwrite64,pwrite64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* __NR_pwrite */
+
+#if ! defined __NR_pread || ! defined __NR_pwrite
+
+static ssize_t __fake_pread_write(int fd, void *buf,
+		size_t count, off_t offset, int do_pwrite)
+{
+	int save_errno;
+	ssize_t result;
+	off_t old_offset;
+
+	/* Since we must not change the file pointer preserve the
+	 * value so that we can restore it later.  */
+	if ((old_offset=lseek(fd, 0, SEEK_CUR)) == (off_t) -1)
+		return -1;
+
+	/* Set to wanted position.  */
+	if (lseek(fd, offset, SEEK_SET) == (off_t) -1)
+		return -1;
+
+	if (do_pwrite == 1) {
+		/* Write the data.  */
+		result = write(fd, buf, count);
+	} else {
+		/* Read the data.  */
+		result = read(fd, buf, count);
+	}
+
+	/* Now we have to restore the position.  If this fails we
+	 * have to return this as an error.  */
+	save_errno = errno;
+	if (lseek(fd, old_offset, SEEK_SET) == (off_t) -1)
+	{
+		if (result == -1)
+			__set_errno(save_errno);
+		return -1;
+	}
+	__set_errno(save_errno);
+	return(result);
+}
+
+# ifdef __UCLIBC_HAS_LFS__
+
+static ssize_t __fake_pread_write64(int fd, void *buf,
+		size_t count, off64_t offset, int do_pwrite)
+{
+	int save_errno;
+	ssize_t result;
+	off64_t old_offset;
+
+	/* Since we must not change the file pointer preserve the
+	 * value so that we can restore it later.  */
+	if ((old_offset=lseek64(fd, 0, SEEK_CUR)) == (off64_t) -1)
+		return -1;
+
+	/* Set to wanted position.  */
+	if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1)
+		return -1;
+
+	if (do_pwrite == 1) {
+		/* Write the data.  */
+		result = write(fd, buf, count);
+	} else {
+		/* Read the data.  */
+		result = read(fd, buf, count);
+	}
+
+	/* Now we have to restore the position. */
+	save_errno = errno;
+	if (lseek64(fd, old_offset, SEEK_SET) == (off64_t) -1) {
+		if (result == -1)
+			__set_errno (save_errno);
+		return -1;
+	}
+	__set_errno (save_errno);
+	return result;
+}
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /*  ! defined __NR_pread || ! defined __NR_pwrite */
+
+#ifndef __NR_pread
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return __fake_pread_write(fd, buf, count, offset, 0);
+}
+weak_alias(__libc_pread,pread)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
+{
+	return __fake_pread_write64(fd, buf, count, offset, 0);
+}
+weak_alias(__libc_pread64,pread64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* ! __NR_pread */
+
+#ifndef __NR_pwrite
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+	/* we won't actually be modifying the buffer,
+	 *just cast it to get rid of warnings */
+	return __fake_pread_write(fd, (void*)buf, count, offset, 1);
+}
+weak_alias(__libc_pwrite,pwrite)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
+{
+	return __fake_pread_write64(fd, (void*)buf, count, offset, 1);
+}
+weak_alias(__libc_pwrite64,pwrite64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* ! __NR_pwrite */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/setjmp.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/setjmp.S
new file mode 100644
index 0000000..cd74caf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/setjmp.S
@@ -0,0 +1,131 @@
+/* setjmp for Xtensa Processors.
+   Copyright (C) 2001, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* This implementation relies heavily on the Xtensa register window
+   mechanism.  Setjmp flushes all the windows except its own to the
+   stack and then copies registers from the save areas on the stack
+   into the jmp_buf structure, along with the return address of the call
+   to setjmp.  Longjmp invalidates all the windows except its own, and
+   then sets things up so that it will return to the right place,
+   using a window underflow to automatically restore the registers.
+
+   Note that it would probably be sufficient to only copy the
+   registers from setjmp's caller into jmp_buf.  However, we also copy
+   the save area located at the stack pointer of setjmp's caller.
+   This save area will typically remain intact until the longjmp call.
+   The one exception is when there is an intervening alloca in
+   setjmp's caller.  This is certainly an unusual situation and is
+   likely to cause problems in any case (the storage allocated on the
+   stack cannot be safely accessed following the longjmp).  As bad as
+   it is, on most systems this situation would not necessarily lead to
+   a catastrophic failure.  If we did not preserve the extra save area
+   on Xtensa, however, it would.  When setjmp's caller returns after a
+   longjmp, there will be a window underflow; an invalid return
+   address or stack pointer in the save area will almost certainly
+   lead to a crash.  Keeping a copy of the extra save area in the
+   jmp_buf avoids this with only a small additional cost.  If setjmp
+   and longjmp are ever time-critical, this could be removed.  */
+
+#include "sysdep.h"
+
+/* int setjmp (a2 = jmp_buf env) */
+
+ENTRY (_setjmp)
+	movi	a3, 0
+	j	1f
+END (_setjmp)
+libc_hidden_def (_setjmp)
+
+ENTRY (setjmp)
+	movi	a3, 1
+	j	1f
+END (setjmp)
+
+/* int __sigsetjmp (a2 = jmp_buf env,
+		    a3 = int savemask)  */
+
+ENTRY (__sigsetjmp)
+1:
+	/* Flush registers.  */
+	movi	a4, __window_spill
+	callx4	a4
+
+	/* Preserve the second argument (savemask) in a15.  The selection
+	   of a15 is arbitrary, except it's otherwise unused.  There is no
+	   risk of triggering a window overflow since we just returned
+	   from __window_spill().  */
+	mov	a15, a3
+
+	/* Copy the register save area at (sp - 16).  */
+	addi	a5, a1, -16
+	l32i	a3, a5, 0
+	l32i	a4, a5, 4
+	s32i	a3, a2, 0
+	s32i	a4, a2, 4
+	l32i	a3, a5, 8
+	l32i	a4, a5, 12
+	s32i	a3, a2, 8
+	s32i	a4, a2, 12
+
+	/* Copy 0-8 words from the register overflow area.  */
+	extui	a3, a0, 30, 2
+	blti	a3, 2, .Lendsj
+	l32i	a7, a1, 4
+	slli	a4, a3, 4
+	sub	a5, a7, a4
+	addi	a6, a2, 16
+	addi	a7, a7, -16		/* a7 = end of register overflow area */
+.Lsjloop:
+	l32i	a3, a5, 0
+	l32i	a4, a5, 4
+	s32i	a3, a6, 0
+	s32i	a4, a6, 4
+	l32i	a3, a5, 8
+	l32i	a4, a5, 12
+	s32i	a3, a6, 8
+	s32i	a4, a6, 12
+	addi	a5, a5, 16
+	addi	a6, a6, 16
+	blt	a5, a7, .Lsjloop
+.Lendsj:
+
+	/* Copy the register save area at sp.  */
+	l32i	a3, a1, 0
+	l32i	a4, a1, 4
+	s32i	a3, a2, 48
+	s32i	a4, a2, 52
+	l32i	a3, a1, 8
+	l32i	a4, a1, 12
+	s32i	a3, a2, 56
+	s32i	a4, a2, 60
+
+	/* Save the return address, including the window size bits.  */
+	s32i	a0, a2, 64
+
+	/* a2 still addresses jmp_buf.  a15 contains savemask.  */
+	mov	a6, a2
+	mov	a7, a15
+	movi	a3, __sigjmp_save
+	callx4	a3
+	mov	a2, a6
+	retw
+END(__sigsetjmp)
+
+weak_extern(_setjmp)
+weak_extern(setjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sigaction.c
new file mode 100644
index 0000000..2a20c68
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sigaction.c
@@ -0,0 +1,44 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sigaction() for Xtensa uClibc
+ *
+ * Copyright (C) 2007, 2008 Tensilica Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <signal.h>
+#include <sys/syscall.h>
+#include <string.h>
+#include <bits/kernel_sigaction.h>
+
+#define SA_RESTORER	0x04000000
+
+extern void __default_sa_restorer(void);
+
+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 = __default_sa_restorer;
+		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));
+}
+
+#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/xtensa/sigrestorer.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sigrestorer.S
new file mode 100644
index 0000000..474a893
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sigrestorer.S
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2008 Tensilica Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */ 
+
+#include <sys/syscall.h>
+
+#if __NR_rt_sigreturn > 255
+# error value of __NR_rt_sigreturn is too big!
+#endif
+
+	.text
+	.align	4
+	.global	__default_sa_restorer
+	.type	__default_sa_restorer, @function
+__default_sa_restorer:
+	movi	a2, __NR_rt_sigreturn
+	syscall
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/sys/procfs.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sys/procfs.h
new file mode 100644
index 0000000..f6f8752
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sys/procfs.h
@@ -0,0 +1,121 @@
+/* Copyright (C) 1996, 1997, 1999, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, 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;
+
+#define ELF_NGREG 128
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers.  */
+#define ELF_NFPREG 18
+typedef unsigned long elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+/* 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/xtensa/sys/ptrace.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sys/ptrace.h
new file mode 100644
index 0000000..7aad929
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sys/ptrace.h
@@ -0,0 +1,156 @@
+/* `ptrace' debugger support interface.  Linux version.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007
+   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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H	1
+
+#include <features.h>
+
+/* Kludge away careless namespace pollution from the kernel. */
+
+#undef PTRACE_GETREGS
+#undef PTRACE_SETREGS
+#undef PTRACE_GETFPREGS
+#undef PTRACE_SETFPREGS
+#undef PTRACE_GETFPREGSIZE
+
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.'  */
+enum __ptrace_request
+{
+  /* Indicate that the process making this request should be traced.
+     All signals received by this process can be intercepted by its
+     parent, and its parent can use the other `ptrace' requests.  */
+  PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+  /* Return the word in the process's text space at address ADDR.  */
+  PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+  /* Return the word in the process's data space at address ADDR.  */
+  PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+  /* Return the word in the process's user area at offset ADDR.  */
+  PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+  /* Write the word DATA into the process's text space at address ADDR.  */
+  PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+  /* Write the word DATA into the process's data space at address ADDR.  */
+  PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+  /* Write the word DATA into the process's user area at offset ADDR.  */
+  PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+  /* Continue the process.  */
+  PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+  /* Kill the process.  */
+  PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+  /* Single step the process.
+     This is not supported on all machines.  */
+  PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+  /* Get all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+  /* Set all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+  /* Get all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+  /* Set all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
+  /* Attach to a process that is already running. */
+  PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+  /* Detach from a process attached to with PTRACE_ATTACH.  */
+  PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+  /* Get size required for the buffer holding the floating point registers.
+     This is not supported on all machines.  */
+   PTRACE_GETFPREGSIZE = 18,
+#define PT_GETFPREGSIZE PTRACE_GETFPREGSIZE
+
+  /* Continue and stop at the next (return from) syscall.  */
+  PTRACE_SYSCALL = 24
+#define PT_SYSCALL PTRACE_SYSCALL
+};
+
+/* Options set using PTRACE_SETOPTIONS.  */
+enum __ptrace_setoptions {
+  PTRACE_O_TRACESYSGOOD	= 0x00000001,
+  PTRACE_O_TRACEFORK	= 0x00000002,
+  PTRACE_O_TRACEVFORK   = 0x00000004,
+  PTRACE_O_TRACECLONE	= 0x00000008,
+  PTRACE_O_TRACEEXEC	= 0x00000010,
+  PTRACE_O_TRACEVFORKDONE = 0x00000020,
+  PTRACE_O_TRACEEXIT	= 0x00000040,
+  PTRACE_O_MASK		= 0x0000007f
+};
+
+/* Wait extended result codes for the above trace options.  */
+enum __ptrace_eventcodes {
+  PTRACE_EVENT_FORK	= 1,
+  PTRACE_EVENT_VFORK	= 2,
+  PTRACE_EVENT_CLONE	= 3,
+  PTRACE_EVENT_EXEC	= 4,
+  PTRACE_EVENT_VFORK_DONE = 5,
+  PTRACE_EVENT_EXIT	= 6
+};
+
+/* Perform process tracing functions.  REQUEST is one of the values
+   above, and determines the action to be taken.
+   For all requests except PTRACE_TRACEME, PID specifies the process to be
+   traced.
+
+   PID and the other arguments described above for the various requests should
+   appear (those that are used for the particular request) as:
+     pid_t PID, void *ADDR, int DATA, void *ADDR2
+   after REQUEST.  */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/sys/ucontext.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sys/ucontext.h
new file mode 100644
index 0000000..4c37201
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sys/ucontext.h
@@ -0,0 +1,49 @@
+/* Copyright (C) 2001, 2006, 2007  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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
+/* Revise this structure when we add support for coprocessors.  */
+
+/* Structure to describe FPU registers.  */
+typedef struct fpregset
+{
+  int dummy;
+} fpregset_t;
+
+typedef struct sigcontext mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/syscall.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/syscall.S
new file mode 100644
index 0000000..955e889
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/syscall.S
@@ -0,0 +1,42 @@
+/* Copyright (C) 2005, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+
+/* The register layout upon entering the function is:
+
+   arguments	syscall number	arg0, arg1, arg2, arg3, arg4, arg5
+   ---------	--------------	----------------------------------
+   function	a2		a3,   a4,   a5,   a6,   a7,   (sp)
+   syscall	a2		a6,   a3,   a4,   a5,   a8,   a9
+ */
+
+ENTRY (syscall)
+	l32i	a9, a1, 16	/* load extra argument from stack */
+	mov	a8, a7
+	mov	a7, a3		/* preserve a3 in a7 */
+	mov	a3, a4
+	mov	a4, a5
+	mov	a5, a6
+	mov	a6, a7
+	syscall
+	movi    a4, -4095
+	bgeu    a2, a4, SYSCALL_ERROR_LABEL
+.Lpseudo_end:
+	retw
+PSEUDO_END (syscall)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sysdep.h
new file mode 100644
index 0000000..4c32c2c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/sysdep.h
@@ -0,0 +1,160 @@
+/* Assembler macros for Xtensa processors.
+   Copyright (C) 2001, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifdef __ASSEMBLER__
+
+#define ALIGNARG(log2) 1 << log2
+#define ASM_TYPE_DIRECTIVE(name, typearg) .type name, typearg
+#define ASM_SIZE_DIRECTIVE(name) .size name, . - name
+
+#ifdef __STDC__
+#define C_LABEL(name)	name :
+#else
+#define C_LABEL(name)	name/**/:
+#endif
+
+#define	ENTRY(name)							\
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);				\
+  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name), @function);			\
+  .align ALIGNARG(2);							\
+  LITERAL_POSITION;							\
+  C_LABEL(name)								\
+  entry sp, FRAMESIZE;							\
+  CALL_MCOUNT
+
+#undef END
+#define END(name) ASM_SIZE_DIRECTIVE(name)
+
+/* Define a macro for this directive so it can be removed in a few places.  */
+#define LITERAL_POSITION .literal_position
+
+#undef JUMPTARGET
+#ifdef __PIC__
+/* The "@PLT" suffix is currently a no-op for non-shared linking, but
+   it doesn't hurt to use it conditionally for PIC code in case that
+   changes someday.  */
+#define JUMPTARGET(name) name##@PLT
+#else
+#define JUMPTARGET(name) name
+#endif
+
+#define FRAMESIZE 16
+#define CALL_MCOUNT		/* Do nothing.  */
+
+
+/* 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 a2
+   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.  */
+
+/* We don't want the label for the error handler to be global when we define
+   it here.  */
+#define SYSCALL_ERROR_LABEL 0f
+
+#undef  PSEUDO
+#define	PSEUDO(name, syscall_name, args)				      \
+  .text;								      \
+  ENTRY (name)								      \
+	DO_CALL	(syscall_name, args);					      \
+	movi	a4, -4095;						      \
+	bgeu	a2, a4, SYSCALL_ERROR_LABEL;				      \
+  .Lpseudo_end:
+
+#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)
+
+#undef	PSEUDO_END_NOERRNO
+#define	PSEUDO_END_NOERRNO(name)					      \
+  END (name)
+
+#undef	ret_NOERRNO
+#define ret_NOERRNO retw
+
+/* 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);					      \
+	neg	a2, a2
+
+#undef	PSEUDO_END_ERRVAL
+#define	PSEUDO_END_ERRVAL(name)						      \
+  END (name)
+
+#define ret_ERRVAL retw
+
+#if defined RTLD_PRIVATE_ERRNO
+# define SYSCALL_ERROR_HANDLER						      \
+0:	movi	a4, rtld_errno;						      \
+	neg	a2, a2;							      \
+	s32i	a2, a4, 0;						      \
+	movi	a2, -1;							      \
+	j	.Lpseudo_end;
+
+#elif defined _LIBC_REENTRANT
+
+# if defined USE___THREAD
+#  ifndef NOT_IN_libc
+#   define SYSCALL_ERROR_ERRNO __libc_errno
+#  else
+#   define SYSCALL_ERROR_ERRNO errno
+#  endif
+#  define SYSCALL_ERROR_HANDLER						      \
+0:	rur	a4, THREADPTR;						      \
+	movi	a3, SYSCALL_ERROR_ERRNO@TPOFF;				      \
+	neg	a2, a2;							      \
+	add	a4, a4, a3;						      \
+	s32i	a2, a4, 0;						      \
+	movi	a2, -1;							      \
+	j	.Lpseudo_end;
+# else /* !USE___THREAD */
+#  define SYSCALL_ERROR_HANDLER						      \
+0:	neg	a2, a2;							      \
+	mov	a6, a2;							      \
+	movi	a4, __errno_location@PLT;				      \
+	callx4	a4;						              \
+	s32i	a2, a6, 0;						      \
+	movi	a2, -1;							      \
+	j	.Lpseudo_end;
+# endif /* !USE___THREAD */
+#else /* !_LIBC_REENTRANT */
+#define SYSCALL_ERROR_HANDLER						      \
+0:	movi	a4, errno;						      \
+	neg	a2, a2;							      \
+	s32i	a2, a4, 0;						      \
+	movi	a2, -1;							      \
+	j	.Lpseudo_end;
+#endif /* _LIBC_REENTRANT */
+
+#endif	/* __ASSEMBLER__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/vfork.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/vfork.S
new file mode 100644
index 0000000..6e490fe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/vfork.S
@@ -0,0 +1,170 @@
+/* Copyright (C) 2005, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include <sys/syscall.h>
+#define _SIGNAL_H
+#include <bits/signum.h>
+
+
+/* Clone the calling process, but without copying the whole address space.
+   The calling process is suspended until the new process exits or is
+   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
+   and the process ID of the new process to the old process.
+
+   Note that it is important that we don't create a new stack frame for the
+   caller.  */
+
+
+/* The following are defined in linux/sched.h, which unfortunately
+   is not safe for inclusion in an assembly file.  */
+#define CLONE_VM        0x00000100     /* set if VM shared between processes */
+#define CLONE_VFORK     0x00004000     /* set if the parent wants the child to
+					  wake it up on mm_release */
+
+#ifndef SAVE_PID
+#define SAVE_PID
+#endif
+
+#ifndef RESTORE_PID
+#define RESTORE_PID
+#endif
+
+
+/* pid_t vfork(void);
+   Implemented as __clone_syscall(CLONE_VFORK | CLONE_VM | SIGCHLD, 0) */
+
+ENTRY (__vfork)
+
+	movi	a6, .Ljumptable
+	extui	a2, a0, 30, 2		/* call-size: call4/8/12 = 1/2/3 */
+	addx4	a4, a2, a6		/* find return address in jumptable */
+	l32i	a4, a4, 0
+	add	a4, a4, a6
+
+	slli	a2, a2, 30
+	xor	a3, a0, a2		/* remove call-size from return addr */
+	extui	a5, a4, 30, 2		/* get high bits of jump target */
+	slli	a5, a5, 30
+	or	a3, a3, a5		/* stuff them into the return address */
+	xor	a4, a4, a5		/* clear high bits of jump target */
+	or	a0, a4, a2		/* create temporary return address */
+	retw				/* "return" to .L4, .L8, or .L12 */
+
+	.align	4
+.Ljumptable:
+	.word	0
+	.word	.L4 - .Ljumptable
+	.word	.L8 - .Ljumptable
+	.word	.L12 - .Ljumptable
+
+	/* a7: return address */
+.L4:	mov	a12, a2
+	mov	a13, a3
+
+	SAVE_PID
+
+	/* Use syscall 'clone'.  Set new stack pointer to the same address.  */
+	movi	a2, SYS_ify (clone)
+	movi	a3, 0
+	movi	a6, CLONE_VM | CLONE_VFORK | SIGCHLD
+        syscall
+
+	RESTORE_PID
+
+	movi	a5, -4096
+
+	mov	a6, a2
+	mov	a2, a12
+	mov	a3, a13
+
+	bgeu	a6, a5, 1f
+	jx	a7
+1:	call4	.Lerr			/* returns to original caller */
+
+
+	/* a11: return address */
+.L8:	mov	a12, a2
+	mov	a13, a3
+	mov	a14, a6
+
+	SAVE_PID
+
+	movi	a2, SYS_ify (clone)
+	movi	a3, 0
+	movi	a6, CLONE_VM | CLONE_VFORK | SIGCHLD
+	syscall
+
+	RESTORE_PID
+
+	movi	a9, -4096
+
+	mov	a10, a2
+	mov	a2, a12
+	mov	a3, a13
+	mov	a6, a14
+
+	bgeu	a10, a9, 1f
+	jx	a11
+1:	call8	.Lerr			/* returns to original caller */
+
+
+	/* a15: return address */
+.L12:	mov	a12, a2
+	mov	a13, a3
+	mov	a14, a6
+
+	SAVE_PID
+
+	movi	a2, SYS_ify (clone)
+	movi	a3, 0
+	movi	a6, CLONE_VM | CLONE_VFORK | SIGCHLD
+	syscall
+
+	RESTORE_PID
+
+	mov	a3, a13
+	movi	a13, -4096
+
+	mov	a6, a14
+	mov	a14, a2
+
+	mov	a2, a12
+
+	bgeu	a14, a13, 1f
+	jx	a15
+1:	call12	.Lerr			/* returns to original caller */
+
+
+	.align 4
+.Lerr:	entry	a1, 16
+
+	/* Restore the return address.  */
+	extui	a4, a0, 30, 2		/* get the call-size bits */
+	slli	a4, a4, 30
+	slli	a3, a3, 2		/* clear high bits of target address */
+	srli	a3, a3, 2
+	or	a0, a3, a4		/* combine them */
+
+	PSEUDO_END (__vfork)
+.Lpseudo_end:
+	retw
+
+libc_hidden_def (__vfork)
+
+weak_alias (__vfork, vfork)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/xtensa/windowspill.S b/ap/build/uClibc/libc/sysdeps/linux/xtensa/windowspill.S
new file mode 100644
index 0000000..1487f07
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/xtensa/windowspill.S
@@ -0,0 +1,96 @@
+/* Function to force register windows to the stack.
+   Copyright (C) 2005, 2007 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., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#include <bits/xtensa-config.h>
+
+	.text
+	.align  4
+	.literal_position
+	.global __window_spill
+	.type   __window_spill, @function
+__window_spill:
+	entry	a1, 48
+        bbci.l  a0, 31, .L4		/* branch if called with call4 */
+        bbsi.l  a0, 30, .L12		/* branch if called with call12 */
+
+	/* Called with call8: touch register NUM_REGS-12 (4/20/52) */
+.L8:
+#if XCHAL_NUM_AREGS > 16
+	call12	1f
+	retw
+
+	.align	4
+1:	_entry	a1, 48			/* touch NUM_REGS-24 (x/8/40) */
+
+#if XCHAL_NUM_AREGS == 32
+	mov	a8, a0
+	retw
+#else
+	mov	a12, a0
+	_entry	a1, 48			/* touch NUM_REGS-36 (x/x/28) */
+	mov	a12, a0
+	_entry	a1, 48			/* touch NUM_REGS-48 (x/x/16) */
+	mov	a12, a0
+	_entry	a1, 16			/* touch NUM_REGS-60 (x/x/4) */
+#endif
+#endif
+	mov	a4, a0
+	retw
+
+	/* Called with call4: touch register NUM_REGS-8 (8/24/56) */
+.L4:
+#if XCHAL_NUM_AREGS == 16
+	mov	a8, a0
+#else
+	call12	1f
+	retw
+
+	.align	4
+1:	_entry	a1, 48			/* touch NUM_REGS-20 (x/12/44) */
+	mov	a12, a0
+#if XCHAL_NUM_AREGS > 32
+	_entry	a1, 48			/* touch NUM_REGS-32 (x/x/32) */
+	mov	a12, a0
+	_entry	a1, 48			/* touch NUM_REGS-44 (x/x/20) */
+	mov	a12, a0
+	_entry	a1, 48			/* touch NUM_REGS-56 (x/x/8) */
+	mov	a8, a0
+#endif
+#endif
+	retw
+
+	/* Called with call12: touch register NUM_REGS-16 (x/16/48) */
+.L12:
+#if XCHAL_NUM_AREGS > 16
+	call12	1f
+	retw
+
+	.align	4
+1:	_entry	a1, 48			/* touch NUM_REGS-28 (x/4/36) */
+#if XCHAL_NUM_AREGS == 32
+	mov	a4, a0
+#else
+	mov	a12, a0
+	_entry	a1, 48			/* touch NUM_REGS-40 (x/x/24) */
+	mov	a12, a0
+	_entry	a1, 48			/* touch NUM_REGS-52 (x/x/12) */
+	mov	a12, a0
+#endif
+#endif
+	retw