summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2011-07-04 05:38:43 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2011-07-04 05:38:43 +0000
commitff95e3fe3033fe667c6dfe9f0ea99aa4f40a4478 (patch)
treec224462c0c792234e40c7bf5620f9c92f781e176
parent8944ced576425c97f76c10ec6f7b616aa62550b6 (diff)
Add ia64 libc support.
-rw-r--r--lib/libc/arch/ia64/Makefile.inc3
-rw-r--r--lib/libc/arch/ia64/SYS.h74
-rw-r--r--lib/libc/arch/ia64/gdtoa/Makefile.inc3
-rw-r--r--lib/libc/arch/ia64/gdtoa/arith.h6
-rw-r--r--lib/libc/arch/ia64/gdtoa/gd_qnan.h5
-rw-r--r--lib/libc/arch/ia64/gen/Makefile.inc7
-rw-r--r--lib/libc/arch/ia64/gen/flt_rounds.c25
-rw-r--r--lib/libc/arch/ia64/gen/fpgetmask.c41
-rw-r--r--lib/libc/arch/ia64/gen/fpgetround.c39
-rw-r--r--lib/libc/arch/ia64/gen/fpsetmask.c44
-rw-r--r--lib/libc/arch/ia64/gen/fpsetround.c43
-rw-r--r--lib/libc/arch/ia64/net/Makefile.inc2
-rw-r--r--lib/libc/arch/ia64/stdlib/Makefile.inc1
-rw-r--r--lib/libc/arch/ia64/string/Makefile.inc2
-rw-r--r--lib/libc/arch/ia64/sys/__clone.S3
-rw-r--r--lib/libc/arch/ia64/sys/__sigaction14_sigtramp.c74
-rw-r--r--lib/libc/arch/ia64/sys/__sigtramp2.S12
-rw-r--r--lib/libc/arch/ia64/sys/__syscall.S7
-rw-r--r--lib/libc/arch/ia64/sys/__vfork14.S8
-rw-r--r--lib/libc/arch/ia64/sys/brk.S57
-rw-r--r--lib/libc/arch/ia64/sys/cerror.S48
-rw-r--r--lib/libc/arch/ia64/sys/exect.S3
-rw-r--r--lib/libc/arch/ia64/sys/fork.S9
-rw-r--r--lib/libc/arch/ia64/sys/getcontext.S3
-rw-r--r--lib/libc/arch/ia64/sys/pipe.S50
-rw-r--r--lib/libc/arch/ia64/sys/ptrace.S3
-rw-r--r--lib/libc/arch/ia64/sys/sbrk.S63
-rw-r--r--lib/libc/arch/ia64/sys/shmat.S3
-rw-r--r--lib/libc/arch/ia64/sys/syscall.S7
29 files changed, 645 insertions, 0 deletions
diff --git a/lib/libc/arch/ia64/Makefile.inc b/lib/libc/arch/ia64/Makefile.inc
new file mode 100644
index 00000000000..6c135b17bd6
--- /dev/null
+++ b/lib/libc/arch/ia64/Makefile.inc
@@ -0,0 +1,3 @@
+# $NetBSD: Makefile.inc,v 1.3 2006/09/23 17:39:34 cherry Exp $
+
+SRCS+= __sigaction14_sigtramp.c __sigtramp2.S
diff --git a/lib/libc/arch/ia64/SYS.h b/lib/libc/arch/ia64/SYS.h
new file mode 100644
index 00000000000..8ee7fb44364
--- /dev/null
+++ b/lib/libc/arch/ia64/SYS.h
@@ -0,0 +1,74 @@
+/* $NetBSD: SYS.h,v 1.1 2006/09/10 21:22:33 cherry Exp $ */
+
+/*
+ * Copyright (c) 1994, 1995 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include <sys/cdefs.h>
+
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+#define RET { br.ret.sptk.few rp;; }
+
+#define CALLSYS_ERROR(name) \
+ CALLSYS_NOERROR(name) \
+{ cmp.ne p6,p0=r0,r10; \
+(p6) br.cond.sptk.few __cerror ;; }
+
+#define SYSCALL(name) \
+ENTRY(name,0); /* XXX # of args? */ \
+ CALLSYS_ERROR(name)
+
+#define SYSCALL_NOERROR(name) \
+ENTRY(name,0); /* XXX # of args? */ \
+ CALLSYS_NOERROR(name)
+
+#define PSEUDO(label,name) \
+ENTRY(label,0); /* XXX # of args? */ \
+ CALLSYS_ERROR(name); \
+ RET; \
+END(label);
+
+#define PSEUDO_NOERROR(label,name) \
+ENTRY(label,0); /* XXX # of args? */ \
+ CALLSYS_NOERROR(name); \
+ RET; \
+END(label);
+
+#define RSYSCALL(name) \
+ SYSCALL(name); \
+ RET; \
+END(name)
+
+#define RSYSCALL_NOERROR(name) \
+ SYSCALL_NOERROR(name); \
+ RET; \
+END(name)
+
+#define WSYSCALL(weak,strong) \
+ WEAK_ALIAS(weak,strong); \
+ PSEUDO(strong,weak)
diff --git a/lib/libc/arch/ia64/gdtoa/Makefile.inc b/lib/libc/arch/ia64/gdtoa/Makefile.inc
new file mode 100644
index 00000000000..43505eaa3d0
--- /dev/null
+++ b/lib/libc/arch/ia64/gdtoa/Makefile.inc
@@ -0,0 +1,3 @@
+# $NetBSD: Makefile.inc,v 1.2 2006/09/22 12:09:24 cherry Exp $
+
+SRCS+= strtof.c
diff --git a/lib/libc/arch/ia64/gdtoa/arith.h b/lib/libc/arch/ia64/gdtoa/arith.h
new file mode 100644
index 00000000000..4fb91e5d4a7
--- /dev/null
+++ b/lib/libc/arch/ia64/gdtoa/arith.h
@@ -0,0 +1,6 @@
+/* $NetBSD: arith.h,v 1.1 2006/09/10 21:22:33 cherry Exp $ */
+
+#define IEEE_LITTLE_ENDIAN
+#ifndef _IEEE_FP
+#define Sudden_Underflow
+#endif
diff --git a/lib/libc/arch/ia64/gdtoa/gd_qnan.h b/lib/libc/arch/ia64/gdtoa/gd_qnan.h
new file mode 100644
index 00000000000..92b0734668a
--- /dev/null
+++ b/lib/libc/arch/ia64/gdtoa/gd_qnan.h
@@ -0,0 +1,5 @@
+/* $NetBSD: gd_qnan.h,v 1.1 2006/09/10 21:22:33 cherry Exp $ */
+
+#define f_QNAN 0x7fc00000
+#define d_QNAN0 0x0
+#define d_QNAN1 0x7ff80000
diff --git a/lib/libc/arch/ia64/gen/Makefile.inc b/lib/libc/arch/ia64/gen/Makefile.inc
new file mode 100644
index 00000000000..88c1a5e994c
--- /dev/null
+++ b/lib/libc/arch/ia64/gen/Makefile.inc
@@ -0,0 +1,7 @@
+# $NetBSD: Makefile.inc,v 1.4 2006/09/23 17:39:34 cherry Exp $
+
+#SRCS+= bswap16.c bswap32.c bswap64.c
+
+SRCS+= flt_rounds.c fpgetround.c fpsetround.c fpgetmask.c fpsetmask.c
+#SRCS+= isinff_ieee754.c isinfd_ieee754.c
+#SRCS+= isnanf_ieee754.c isnand_ieee754.c
diff --git a/lib/libc/arch/ia64/gen/flt_rounds.c b/lib/libc/arch/ia64/gen/flt_rounds.c
new file mode 100644
index 00000000000..a48a4237603
--- /dev/null
+++ b/lib/libc/arch/ia64/gen/flt_rounds.c
@@ -0,0 +1,25 @@
+/*
+ * Written by J.T. Conklin, Apr 10, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+/* __FBSDID("$FreeBSD: src/lib/libc/ia64/gen/flt_rounds.c,v 1.1 2004/07/19 08:17:24 das Exp $"); */
+
+#include <float.h>
+
+static const int map[] = {
+ 1, /* round to nearest */
+ 3, /* round to zero */
+ 2, /* round to negative infinity */
+ 0 /* round to positive infinity */
+};
+
+int
+__flt_rounds(void)
+{
+ int x;
+
+ __asm("mov %0=ar.fpsr" : "=r" (x));
+ return (map[(x >> 10) & 0x03]);
+}
diff --git a/lib/libc/arch/ia64/gen/fpgetmask.c b/lib/libc/arch/ia64/gen/fpgetmask.c
new file mode 100644
index 00000000000..6bf750cbdf8
--- /dev/null
+++ b/lib/libc/arch/ia64/gen/fpgetmask.c
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2001 Doug Rabson
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+/* __FBSDID("$FreeBSD: src/lib/libc/ia64/gen/fpgetmask.c,v 1.4 2003/10/22 09:00:07 marcel Exp $"); */
+
+#include <sys/types.h>
+#include <ieeefp.h>
+
+/* XXX: Move to sysarchs() */
+fp_except
+fpgetmask(void)
+{
+ uint64_t fpsr;
+
+ __asm __volatile("mov %0=ar.fpsr" : "=r" (fpsr));
+ return (~fpsr & 0x3d);
+}
diff --git a/lib/libc/arch/ia64/gen/fpgetround.c b/lib/libc/arch/ia64/gen/fpgetround.c
new file mode 100644
index 00000000000..407edce7442
--- /dev/null
+++ b/lib/libc/arch/ia64/gen/fpgetround.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2003 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libc/ia64/gen/fpgetround.c,v 1.1 2003/01/11 07:24:54 marcel Exp $
+ */
+
+#include <sys/types.h>
+#include <ieeefp.h>
+
+fp_rnd
+fpgetround(void)
+{
+ uint64_t fpsr;
+
+ __asm __volatile("mov %0=ar.fpsr" : "=r"(fpsr));
+ return ((fp_rnd)((fpsr >> 10) & 3));
+}
diff --git a/lib/libc/arch/ia64/gen/fpsetmask.c b/lib/libc/arch/ia64/gen/fpsetmask.c
new file mode 100644
index 00000000000..ea87938c1b5
--- /dev/null
+++ b/lib/libc/arch/ia64/gen/fpsetmask.c
@@ -0,0 +1,44 @@
+/*-
+ * Copyright (c) 2001 Doug Rabson
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+/* __FBSDID("$FreeBSD: src/lib/libc/ia64/gen/fpsetmask.c,v 1.4 2003/10/22 09:00:07 marcel Exp $"); */
+
+#include <sys/types.h>
+#include <ieeefp.h>
+
+fp_except
+fpsetmask(fp_except mask)
+{
+ int64_t fpsr;
+ int64_t oldmask;
+
+ __asm __volatile("mov %0=ar.fpsr" : "=r" (fpsr));
+ oldmask = ~fpsr & 0x3d;
+ fpsr = (fpsr & ~0x3d) | (~mask & 0x3d);
+ __asm __volatile("mov ar.fpsr=%0" :: "r" (fpsr));
+ return (oldmask);
+}
diff --git a/lib/libc/arch/ia64/gen/fpsetround.c b/lib/libc/arch/ia64/gen/fpsetround.c
new file mode 100644
index 00000000000..695540692d2
--- /dev/null
+++ b/lib/libc/arch/ia64/gen/fpsetround.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2003 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libc/ia64/gen/fpsetround.c,v 1.1 2003/01/11 07:24:54 marcel Exp $
+ */
+
+#include <sys/types.h>
+#include <ieeefp.h>
+
+fp_rnd
+fpsetround(fp_rnd rnd)
+{
+ uint64_t fpsr;
+ fp_rnd prev;
+
+ __asm __volatile("mov %0=ar.fpsr" : "=r"(fpsr));
+ prev = (fp_rnd)((fpsr >> 10) & 3);
+ fpsr = (fpsr & ~0xC00ULL) | ((unsigned int)rnd << 10);
+ __asm __volatile("mov ar.fpsr=%0" :: "r"(fpsr));
+ return (prev);
+}
diff --git a/lib/libc/arch/ia64/net/Makefile.inc b/lib/libc/arch/ia64/net/Makefile.inc
new file mode 100644
index 00000000000..fa364cfe585
--- /dev/null
+++ b/lib/libc/arch/ia64/net/Makefile.inc
@@ -0,0 +1,2 @@
+# $NetBSD: Makefile.inc,v 1.1 2006/09/10 21:22:33 cherry Exp $
+# XXX: Stub
diff --git a/lib/libc/arch/ia64/stdlib/Makefile.inc b/lib/libc/arch/ia64/stdlib/Makefile.inc
new file mode 100644
index 00000000000..d1dda0262f1
--- /dev/null
+++ b/lib/libc/arch/ia64/stdlib/Makefile.inc
@@ -0,0 +1 @@
+# $NetBSD: Makefile.inc,v 1.4 2009/07/31 20:39:59 dsl Exp $
diff --git a/lib/libc/arch/ia64/string/Makefile.inc b/lib/libc/arch/ia64/string/Makefile.inc
new file mode 100644
index 00000000000..eebf40a43a6
--- /dev/null
+++ b/lib/libc/arch/ia64/string/Makefile.inc
@@ -0,0 +1,2 @@
+# $NetBSD: Makefile.inc,v 1.4 2009/07/30 20:57:16 dsl Exp $
+
diff --git a/lib/libc/arch/ia64/sys/__clone.S b/lib/libc/arch/ia64/sys/__clone.S
new file mode 100644
index 00000000000..a62702e144b
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/__clone.S
@@ -0,0 +1,3 @@
+/* $NetBSD: __clone.S,v 1.1 2006/09/10 21:22:34 cherry Exp $ */
+
+/* XXX: Stub */ \ No newline at end of file
diff --git a/lib/libc/arch/ia64/sys/__sigaction14_sigtramp.c b/lib/libc/arch/ia64/sys/__sigaction14_sigtramp.c
new file mode 100644
index 00000000000..77451d093d2
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/__sigaction14_sigtramp.c
@@ -0,0 +1,74 @@
+/* $NetBSD: __sigaction14_sigtramp.c,v 1.2 2008/04/28 20:22:56 martin Exp $ */
+
+/*-
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/types.h>
+#include <stddef.h>
+#include <signal.h>
+#include <errno.h>
+
+#include "extern.h"
+
+__weak_alias(__sigaction14, __libc_sigaction14)
+
+int
+__libc_sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
+{
+ extern const int __sigtramp_siginfo_2[];
+
+ /*
+ * If no sigaction, use the "default" trampoline since it won't
+ * be used.
+ */
+ if (act == NULL)
+ return __sigaction_sigtramp(sig, act, oact, NULL, 0);
+
+#ifdef __LIBC12_SOURCE__
+ /*
+ * We select the non-SA_SIGINFO trampoline if SA_SIGINFO is not
+ * set in the sigaction.
+ */
+ if ((act->sa_flags & SA_SIGINFO) == 0) {
+ extern const int __sigtramp_sigcontext_1[];
+ int sav = errno;
+ int rv = __sigaction_sigtramp(sig, act, oact,
+ __sigtramp_sigcontext_1, 1);
+ if (rv >= 0 || errno != EINVAL)
+ return rv;
+ errno = sav;
+ }
+#endif
+
+ /*
+ * If SA_SIGINFO was specified or the compatibility trampolines
+ * can't be used, use the siginfo trampoline.
+ */
+ return __sigaction_sigtramp(sig, act, oact, __sigtramp_siginfo_2, 2);
+}
diff --git a/lib/libc/arch/ia64/sys/__sigtramp2.S b/lib/libc/arch/ia64/sys/__sigtramp2.S
new file mode 100644
index 00000000000..a305ed4ffdd
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/__sigtramp2.S
@@ -0,0 +1,12 @@
+/* $NetBSD: __sigtramp2.S,v 1.1 2006/09/23 17:39:34 cherry Exp $ */
+
+#include "SYS.h"
+
+/* XXX: Fix this when we look at signal handling */
+
+ENTRY(__sigtramp_siginfo_2, 2)
+ /* XXX: get pointer to ucontext */
+ /* setcontext() ie. CALLSYS_NOERROR(setcontext) */
+ /* get error code */
+ CALLSYS_NOERROR(exit) /* exit */
+END(__sigtramp_siginfo_2) \ No newline at end of file
diff --git a/lib/libc/arch/ia64/sys/__syscall.S b/lib/libc/arch/ia64/sys/__syscall.S
new file mode 100644
index 00000000000..e3312dbea7e
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/__syscall.S
@@ -0,0 +1,7 @@
+/* $NetBSD: __syscall.S,v 1.2 2006/09/22 12:09:25 cherry Exp $ */
+
+#include "SYS.h"
+
+
+RSYSCALL(__syscall)
+
diff --git a/lib/libc/arch/ia64/sys/__vfork14.S b/lib/libc/arch/ia64/sys/__vfork14.S
new file mode 100644
index 00000000000..324396f02f5
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/__vfork14.S
@@ -0,0 +1,8 @@
+/* $NetBSD: __vfork14.S,v 1.2 2006/09/22 17:59:47 cherry Exp $ */
+
+#include "SYS.h"
+
+SYSCALL(__vfork14)
+ /* XXX: watchout for return values for child/parent */
+ RET
+END(__vfork14)
diff --git a/lib/libc/arch/ia64/sys/brk.S b/lib/libc/arch/ia64/sys/brk.S
new file mode 100644
index 00000000000..8be7e907fc5
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/brk.S
@@ -0,0 +1,57 @@
+/* $NetBSD: brk.S,v 1.2 2006/09/23 17:39:34 cherry Exp $ */
+
+/*
+ * Copyright (c) 1994, 1995 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include <machine/asm.h>
+/* __FBSDID("$FreeBSD: src/lib/libc/ia64/sys/brk.S,v 1.4 2003/05/16 21:26:39 marcel Exp $"); */
+
+#include "SYS.h"
+
+ .globl _end
+IMPORT(__curbrk, 8)
+
+ .data
+EXPORT(__minbrk)
+ .quad _end
+
+ .text
+ENTRY(_brk, 1)
+ add r14=@ltoff(__minbrk),gp ;;
+ ld8 r14=[r14] ;;
+ ld8 r14=[r14] ;;
+ cmp.ltu p6,p0=r32,r14 ;;
+(p6) mov r32=r14 ;;
+ st8 [sp]=r32
+ CALLSYS_ERROR(break)
+ ld8 r15=[sp]
+ add r14=@ltoff(__curbrk),gp ;;
+ ld8 r14=[r14] ;;
+ st8 [r14]=r15
+ mov ret0=0
+ br.ret.sptk.few rp
+END(_brk)
diff --git a/lib/libc/arch/ia64/sys/cerror.S b/lib/libc/arch/ia64/sys/cerror.S
new file mode 100644
index 00000000000..7698241043c
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/cerror.S
@@ -0,0 +1,48 @@
+/* $NetBSD: cerror.S,v 1.2 2006/09/22 17:59:47 cherry Exp $ */
+
+/*-
+ * Copyright (c) 2000 Doug Rabson
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+/* __FBSDID("$FreeBSD: src/lib/libc/ia64/sys/cerror.S,v 1.2 2003/03/03 01:09:46 obrien Exp $"); */
+
+
+ENTRY(__cerror, 0)
+ alloc loc0=ar.pfs,0,3,1,0
+ ;;
+ mov loc1=rp
+ mov loc2=ret0
+ mov out0=ret0
+ ;;
+ br.call.sptk.few rp=__errno
+ st4 [ret0]=loc2
+ ;;
+ mov ret0=-1
+ mov ar.pfs=loc0
+ mov rp=loc1
+ ;;
+ br.ret.sptk.few rp
+END(__cerror)
diff --git a/lib/libc/arch/ia64/sys/exect.S b/lib/libc/arch/ia64/sys/exect.S
new file mode 100644
index 00000000000..5a78ec0eb86
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/exect.S
@@ -0,0 +1,3 @@
+/* $NetBSD: exect.S,v 1.1 2006/09/10 21:22:34 cherry Exp $ */
+
+/* XXX: Stub */ \ No newline at end of file
diff --git a/lib/libc/arch/ia64/sys/fork.S b/lib/libc/arch/ia64/sys/fork.S
new file mode 100644
index 00000000000..c0df388ee44
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/fork.S
@@ -0,0 +1,9 @@
+/* $NetBSD: fork.S,v 1.2 2006/09/23 17:39:34 cherry Exp $ */
+
+#include "SYS.h"
+
+ENTRY(__fork, 0)
+ CALLSYS_ERROR(fork)
+ /* XXX: get return value for child */
+ RET
+END(__fork) \ No newline at end of file
diff --git a/lib/libc/arch/ia64/sys/getcontext.S b/lib/libc/arch/ia64/sys/getcontext.S
new file mode 100644
index 00000000000..ea491ab9027
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/getcontext.S
@@ -0,0 +1,3 @@
+/* $NetBSD: getcontext.S,v 1.1 2006/09/10 21:22:34 cherry Exp $ */
+
+/* XXX: Stub */ \ No newline at end of file
diff --git a/lib/libc/arch/ia64/sys/pipe.S b/lib/libc/arch/ia64/sys/pipe.S
new file mode 100644
index 00000000000..e545e5a509c
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/pipe.S
@@ -0,0 +1,50 @@
+/* $NetBSD: pipe.S,v 1.2 2006/09/23 17:39:34 cherry Exp $ */
+
+/*
+ * Copyright (c) 1994, 1995 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include <machine/asm.h>
+/* __FBSDID("$FreeBSD: src/lib/libc/ia64/sys/pipe.S,v 1.4 2003/05/16 21:26:39 marcel Exp $"); */
+
+#include "SYS.h"
+
+#ifdef WEAK_ALIAS
+WEAK_ALIAS(pipe, _pipe)
+#endif
+/* XXX: Relook param passing */
+
+ENTRY(_pipe, 1)
+ st8 [sp]=r32
+ CALLSYS_ERROR(pipe)
+ ld8 r14=[sp]
+ ;;
+ st4 [r14]=ret0,4
+ ;;
+ st4 [r14]=ret1
+ mov ret0=0
+ br.ret.sptk.few rp
+END(_pipe)
diff --git a/lib/libc/arch/ia64/sys/ptrace.S b/lib/libc/arch/ia64/sys/ptrace.S
new file mode 100644
index 00000000000..bea78b23aef
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/ptrace.S
@@ -0,0 +1,3 @@
+/* $NetBSD: ptrace.S,v 1.1 2006/09/10 21:22:34 cherry Exp $ */
+
+/* XXX: Stub */ \ No newline at end of file
diff --git a/lib/libc/arch/ia64/sys/sbrk.S b/lib/libc/arch/ia64/sys/sbrk.S
new file mode 100644
index 00000000000..2340e2fa4f7
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/sbrk.S
@@ -0,0 +1,63 @@
+/* $NetBSD: sbrk.S,v 1.2 2006/09/23 17:39:34 cherry Exp $ */
+
+/*
+ * Copyright (c) 1994, 1995 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include <machine/asm.h>
+/* __FBSDID("$FreeBSD: src/lib/libc/ia64/sys/sbrk.S,v 1.5 2003/05/16 21:26:39 marcel Exp $"); */
+
+#include "SYS.h"
+
+ .globl _end
+
+ .data
+EXPORT(__curbrk)
+ .quad _end
+
+ .text
+ENTRY(_sbrk, 1)
+ add r14 = @ltoff(__curbrk), gp
+ ;;
+ ld8 r14 = [r14]
+ cmp.eq p6, p0 = r32, r0
+ ;;
+ ld8 ret0 = [r14]
+(p6) br.ret.sptk.few rp
+ ;;
+ add r32 = ret0, r32
+ ;;
+ st8 [sp] = r32
+ CALLSYS_ERROR(break)
+ ld8 r15 = [sp]
+ add r14 = @ltoff(__curbrk), gp
+ ;;
+ ld8 r14 = [r14]
+ ;;
+ ld8 ret0 = [r14]
+ st8 [r14] = r15
+ br.ret.sptk.few rp
+END(_sbrk)
diff --git a/lib/libc/arch/ia64/sys/shmat.S b/lib/libc/arch/ia64/sys/shmat.S
new file mode 100644
index 00000000000..cacc700934a
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/shmat.S
@@ -0,0 +1,3 @@
+/* $NetBSD: shmat.S,v 1.1 2006/09/10 21:22:34 cherry Exp $ */
+
+/* XXX: Stub */ \ No newline at end of file
diff --git a/lib/libc/arch/ia64/sys/syscall.S b/lib/libc/arch/ia64/sys/syscall.S
new file mode 100644
index 00000000000..21359c59571
--- /dev/null
+++ b/lib/libc/arch/ia64/sys/syscall.S
@@ -0,0 +1,7 @@
+/* $NetBSD: syscall.S,v 1.2 2006/09/22 12:09:25 cherry Exp $ */
+
+#include "SYS.h"
+
+
+RSYSCALL(syscall)
+