diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2005-04-01 10:54:28 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2005-04-01 10:54:28 +0000 |
commit | 40fe5959ec0c87345f1274365d3617ef8f162daa (patch) | |
tree | 081bfb5f6de56691c08281156fcd6ab40e1913ae /lib | |
parent | 7cbcdc8cfe24e4103b982b5e0866abca26236d66 (diff) |
hppa64 bits cloned form hppa
Diffstat (limited to 'lib')
33 files changed, 1694 insertions, 0 deletions
diff --git a/lib/libc/arch/hppa64/DEFS.h b/lib/libc/arch/hppa64/DEFS.h new file mode 100644 index 00000000000..4fc95e39994 --- /dev/null +++ b/lib/libc/arch/hppa64/DEFS.h @@ -0,0 +1,3 @@ +/* $OpenBSD: DEFS.h,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +#include <machine/asm.h> diff --git a/lib/libc/arch/hppa64/Makefile.inc b/lib/libc/arch/hppa64/Makefile.inc new file mode 100644 index 00000000000..e55e3d0014c --- /dev/null +++ b/lib/libc/arch/hppa64/Makefile.inc @@ -0,0 +1,4 @@ +# $OpenBSD: Makefile.inc,v 1.1 2005/04/01 10:54:27 mickey Exp $ + +KMINCLUDES= arch/hppa64/DEFS.h arch/hppa64/SYS.h prefix.h +KMSRCS= diff --git a/lib/libc/arch/hppa64/SYS.h b/lib/libc/arch/hppa64/SYS.h new file mode 100644 index 00000000000..0e80aa1705b --- /dev/null +++ b/lib/libc/arch/hppa64/SYS.h @@ -0,0 +1,70 @@ +/* $OpenBSD: SYS.h,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1998-2002 Michael Shalayeff + * 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 MIND + * 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/syscall.h> +#include <machine/asm.h> +#undef _LOCORE +#define _LOCORE +#include <machine/frame.h> +#include <machine/vmparam.h> +#undef _LOCORE + +#define SYSENTRY(x,n) !\ +ENTRY(__CONCAT(_thread_sys_,x),n) !\ + .weak x ! .set x, __CONCAT(_thread_sys_,x) +#define SYSEXIT(x) !\ +EXIT(__CONCAT(_thread_sys_,x)) + +#define SYSCALL(x) !\ + std rp, HPPA_FRAME_ERP(sr0,sp) !\ + ldil L%SYSCALLGATE, r1 !\ + ble 4(sr7, r1) !\ + ldi __CONCAT(SYS_,x), r1 !\ + .import __cerror, code !\ + comb,<> r0, t1, __cerror !\ + ldd HPPA_FRAME_ERP(sr0,sp), rp + +#define PSEUDO(x,y) !\ +SYSENTRY(x,0) !\ + SYSCALL(y) !\ + bv r0(rp) !\ + nop !\ +SYSEXIT(x) + +#define PSEUDO_NOERROR(x,y) !\ +SYSENTRY(x,0) !\ + std rp, HPPA_FRAME_ERP(sr0,sp) !\ + ldil L%SYSCALLGATE, r1 !\ + ble 4(sr7, r1) !\ + ldi __CONCAT(SYS_,y), r1 !\ + ldd HPPA_FRAME_ERP(sr0,sp), rp !\ + bv r0(rp) !\ + nop !\ +SYSEXIT(x) + +#define RSYSCALL(x) PSEUDO(x,x) + diff --git a/lib/libc/arch/hppa64/gen/Makefile.inc b/lib/libc/arch/hppa64/gen/Makefile.inc new file mode 100644 index 00000000000..f8fb7dd9761 --- /dev/null +++ b/lib/libc/arch/hppa64/gen/Makefile.inc @@ -0,0 +1,9 @@ +# $OpenBSD: Makefile.inc,v 1.1 2005/04/01 10:54:27 mickey Exp $ + +SRCS+= setjmp.S +SRCS+= fabs.c frexp.c ldexp.c +SRCS+= isnan.c isinf.c infinity.c setjmp.S +SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ + fpsetround.c fpsetsticky.c +SRCS+= modf.c +SRCS+= alloca.c diff --git a/lib/libc/arch/hppa64/gen/fabs.c b/lib/libc/arch/hppa64/gen/fabs.c new file mode 100644 index 00000000000..12233d1e44e --- /dev/null +++ b/lib/libc/arch/hppa64/gen/fabs.c @@ -0,0 +1,13 @@ +/* $OpenBSD: fabs.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Written by Miodrag Vallat. Public domain + */ + +double +fabs(double val) +{ + + __asm__ __volatile__("fabs,dbl %0,%0" : "+f" (val)); + return (val); +} diff --git a/lib/libc/arch/hppa64/gen/flt_rounds.c b/lib/libc/arch/hppa64/gen/flt_rounds.c new file mode 100644 index 00000000000..5461bfac809 --- /dev/null +++ b/lib/libc/arch/hppa64/gen/flt_rounds.c @@ -0,0 +1,24 @@ +/* $OpenBSD: flt_rounds.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Written by Miodrag Vallat. Public domain. + */ + +#include <sys/types.h> +#include <machine/float.h> + +static const int map[] = { + 1, /* round to nearest */ + 0, /* round to zero */ + 2, /* round to positive infinity */ + 3 /* round to negative infinity */ +}; + +int +__flt_rounds() +{ + u_int64_t fpsr; + + __asm__ __volatile__("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr)); + return map[(fpsr >> 41) & 0x03]; +} diff --git a/lib/libc/arch/hppa64/gen/fpgetmask.c b/lib/libc/arch/hppa64/gen/fpgetmask.c new file mode 100644 index 00000000000..db64a22e41b --- /dev/null +++ b/lib/libc/arch/hppa64/gen/fpgetmask.c @@ -0,0 +1,17 @@ +/* $OpenBSD: fpgetmask.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Written by Miodrag Vallat. Public domain + */ + +#include <sys/types.h> +#include <ieeefp.h> + +fp_except +fpgetmask() +{ + u_int64_t fpsr; + + __asm__ __volatile__("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr)); + return ((fpsr >> 32) & 0x1f); +} diff --git a/lib/libc/arch/hppa64/gen/fpgetround.c b/lib/libc/arch/hppa64/gen/fpgetround.c new file mode 100644 index 00000000000..c27df493366 --- /dev/null +++ b/lib/libc/arch/hppa64/gen/fpgetround.c @@ -0,0 +1,17 @@ +/* $OpenBSD: fpgetround.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Written by Miodrag Vallat. Public domain + */ + +#include <sys/types.h> +#include <ieeefp.h> + +fp_rnd +fpgetround() +{ + u_int64_t fpsr; + + __asm__ __volatile__("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr)); + return ((fpsr >> 41) & 0x3); +} diff --git a/lib/libc/arch/hppa64/gen/fpgetsticky.c b/lib/libc/arch/hppa64/gen/fpgetsticky.c new file mode 100644 index 00000000000..de112641fa9 --- /dev/null +++ b/lib/libc/arch/hppa64/gen/fpgetsticky.c @@ -0,0 +1,17 @@ +/* $OpenBSD: fpgetsticky.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Written by Miodrag Vallat. Public domain + */ + +#include <sys/types.h> +#include <ieeefp.h> + +fp_except +fpgetsticky() +{ + u_int64_t fpsr; + + __asm__ __volatile__("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr)); + return ((fpsr >> 59) & 0x1f); +} diff --git a/lib/libc/arch/hppa64/gen/fpsetmask.c b/lib/libc/arch/hppa64/gen/fpsetmask.c new file mode 100644 index 00000000000..757690ea3b9 --- /dev/null +++ b/lib/libc/arch/hppa64/gen/fpsetmask.c @@ -0,0 +1,22 @@ +/* $OpenBSD: fpsetmask.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Written by Miodrag Vallat. Public domain + */ + +#include <sys/types.h> +#include <ieeefp.h> + +fp_except +fpsetmask(mask) + fp_except mask; +{ + u_int64_t fpsr; + fp_except old; + + __asm__ __volatile__("fstd %%fr0,0(%1)" : "=m"(fpsr) : "r"(&fpsr)); + old = (fpsr >> 32) & 0x1f; + fpsr = (fpsr & 0xffffffe000000000LL) | ((u_int64_t)(mask & 0x1f) << 32); + __asm__ __volatile__("fldd 0(%0),%%fr0" : : "r"(&fpsr)); + return (old); +} diff --git a/lib/libc/arch/hppa64/gen/fpsetround.c b/lib/libc/arch/hppa64/gen/fpsetround.c new file mode 100644 index 00000000000..c64cd406bc8 --- /dev/null +++ b/lib/libc/arch/hppa64/gen/fpsetround.c @@ -0,0 +1,23 @@ +/* $OpenBSD: fpsetround.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Written by Miodrag Vallat. Public domain + */ + +#include <sys/types.h> +#include <ieeefp.h> + +fp_rnd +fpsetround(rnd_dir) + fp_rnd rnd_dir; +{ + u_int64_t fpsr; + fp_rnd old; + + __asm__ __volatile__("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr)); + old = (fpsr >> 41) & 0x03; + fpsr = (fpsr & 0xfffff9ff00000000LL) | + ((u_int64_t)(rnd_dir & 0x03) << 41); + __asm__ __volatile__("fldd 0(%0),%%fr0" : : "r" (&fpsr)); + return (old); +} diff --git a/lib/libc/arch/hppa64/gen/fpsetsticky.c b/lib/libc/arch/hppa64/gen/fpsetsticky.c new file mode 100644 index 00000000000..c5733e0b8a1 --- /dev/null +++ b/lib/libc/arch/hppa64/gen/fpsetsticky.c @@ -0,0 +1,22 @@ +/* $OpenBSD: fpsetsticky.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Written by Miodrag Vallat. Public domain + */ + +#include <sys/types.h> +#include <ieeefp.h> + +fp_except +fpsetsticky(mask) + fp_except mask; +{ + u_int64_t fpsr; + fp_except old; + + __asm__ __volatile__("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr)); + old = (fpsr >> 27) & 0x1f; + fpsr = (fpsr & 0x07ffffff00000000LL) | ((u_int64_t)(mask & 0x1f) << 59); + __asm__ __volatile__("fldd 0(%0),%%fr0" : : "r" (&fpsr)); + return (old); +} diff --git a/lib/libc/arch/hppa64/gen/frexp.c b/lib/libc/arch/hppa64/gen/frexp.c new file mode 100644 index 00000000000..0ab4079fb93 --- /dev/null +++ b/lib/libc/arch/hppa64/gen/frexp.c @@ -0,0 +1,74 @@ +/* $OpenBSD: frexp.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char rcsid[] = "$OpenBSD: frexp.c,v 1.1 2005/04/01 10:54:27 mickey Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include <sys/types.h> +#include <machine/ieee.h> + +/* + * Split the given value into a fraction in the range [0.5, 1.0) and + * an exponent, such that frac * (2^exp) == value. If value is 0, + * return 0. + */ +double +frexp(value, eptr) + double value; + int *eptr; +{ + union { + double v; + struct ieee_double s; + } u; + + if (value) { + /* + * Fractions in [0.5..1.0) have an exponent of 2^-1. + * Leave Inf and NaN alone, however. + * WHAT ABOUT DENORMS? + */ + u.v = value; + if (u.s.dbl_exp != DBL_EXP_INFNAN) { + *eptr = u.s.dbl_exp - (DBL_EXP_BIAS - 1); + u.s.dbl_exp = DBL_EXP_BIAS - 1; + } + return (u.v); + } else { + *eptr = 0; + return ((double)0); + } +} diff --git a/lib/libc/arch/hppa64/gen/infinity.c b/lib/libc/arch/hppa64/gen/infinity.c new file mode 100644 index 00000000000..6f98b44b42b --- /dev/null +++ b/lib/libc/arch/hppa64/gen/infinity.c @@ -0,0 +1,13 @@ +/* $OpenBSD: infinity.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* infinity.c */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char rcsid[] = "$OpenBSD: infinity.c,v 1.1 2005/04/01 10:54:27 mickey Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include <math.h> + +/* bytes for +Infinity on a hppa */ +char __infinity[] __attribute__((__aligned__(sizeof(double)))) = + { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }; diff --git a/lib/libc/arch/hppa64/gen/isinf.c b/lib/libc/arch/hppa64/gen/isinf.c new file mode 100644 index 00000000000..60d0079b0ec --- /dev/null +++ b/lib/libc/arch/hppa64/gen/isinf.c @@ -0,0 +1,51 @@ +/* $OpenBSD: isinf.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char rcsid[] = "$OpenBSD: isinf.c,v 1.1 2005/04/01 10:54:27 mickey Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include <sys/types.h> +#include <machine/ieee.h> + +int +isinf(d) + double d; +{ + struct ieee_double *p = (struct ieee_double *)&d; + + return (p->dbl_exp == DBL_EXP_INFNAN && + p->dbl_frach == 0 && p->dbl_fracl == 0); +} diff --git a/lib/libc/arch/hppa64/gen/isnan.c b/lib/libc/arch/hppa64/gen/isnan.c new file mode 100644 index 00000000000..1b563027b00 --- /dev/null +++ b/lib/libc/arch/hppa64/gen/isnan.c @@ -0,0 +1,51 @@ +/* $OpenBSD: isnan.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char rcsid[] = "$OpenBSD: isnan.c,v 1.1 2005/04/01 10:54:27 mickey Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include <sys/types.h> +#include <machine/ieee.h> + +int +isnan(d) + double d; +{ + struct ieee_double *p = (struct ieee_double *)&d; + + return (p->dbl_exp == DBL_EXP_INFNAN && + (p->dbl_frach != 0 || p->dbl_fracl != 0)); +} diff --git a/lib/libc/arch/hppa64/gen/ldexp.c b/lib/libc/arch/hppa64/gen/ldexp.c new file mode 100644 index 00000000000..039b805165e --- /dev/null +++ b/lib/libc/arch/hppa64/gen/ldexp.c @@ -0,0 +1,144 @@ +/* $OpenBSD: ldexp.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * from: Header: ldexp.c,v 1.1 91/07/07 04:28:19 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static const char sccsid[] = "@(#)ldexp.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ + +#include <sys/types.h> +#include <machine/ieee.h> +#include <errno.h> + +/* + * double ldexp(double val, int exp) + * returns: val * (2**exp) + */ +double +ldexp(val, exp) + double val; + int exp; +{ + register int oldexp, newexp, mulexp; + union doub { + double v; + struct ieee_double s; + } u, mul; + + /* + * If input is zero, or no change, just return input. + * Likewise, if input is Inf or NaN, just return it. + */ + u.v = val; + oldexp = u.s.dbl_exp; + if (val == 0 || exp == 0 || oldexp == DBL_EXP_INFNAN) + return (val); + + /* + * Compute new exponent and check for over/under flow. + * Underflow, unfortunately, could mean switching to denormal. + * If result out of range, set ERANGE and return 0 if too small + * or Inf if too big, with the same sign as the input value. + */ + newexp = oldexp + exp; + if (newexp >= DBL_EXP_INFNAN) { + /* u.s.dbl_sign = val < 0; -- already set */ + u.s.dbl_exp = DBL_EXP_INFNAN; + u.s.dbl_frach = u.s.dbl_fracl = 0; + errno = ERANGE; + return (u.v); /* Inf */ + } + if (newexp <= 0) { + /* + * The output number is either a denormal or underflows + * (see comments in machine/ieee.h). + */ + if (newexp <= -DBL_FRACBITS) { + /* u.s.dbl_sign = val < 0; -- already set */ + u.s.dbl_exp = 0; + u.s.dbl_frach = u.s.dbl_fracl = 0; + errno = ERANGE; + return (u.v); /* zero */ + } + /* + * We are going to produce a denorm. Our `exp' argument + * might be as small as -2097, and we cannot compute + * 2^-2097, so we may have to do this as many as three + * steps (not just two, as for positive `exp's below). + */ + mul.v = 0; + while (exp <= -DBL_EXP_BIAS) { + mul.s.dbl_exp = 1; + val *= mul.v; + exp += DBL_EXP_BIAS - 1; + } + mul.s.dbl_exp = exp + DBL_EXP_BIAS; + val *= mul.v; + return (val); + } + + /* + * Newexp is positive. + * + * If oldexp is zero, we are starting with a denorm, and simply + * adjusting the exponent will produce bogus answers. We need + * to fix that first. + */ + if (oldexp == 0) { + /* + * Multiply by 2^mulexp to make the number normalizable. + * We cannot multiply by more than 2^1023, but `exp' + * argument might be as large as 2046. A single + * adjustment, however, will normalize the number even + * for huge `exp's, and then we can use exponent + * arithmetic just as for normal `double's. + */ + mulexp = exp <= DBL_EXP_BIAS ? exp : DBL_EXP_BIAS; + mul.v = 0; + mul.s.dbl_exp = mulexp + DBL_EXP_BIAS; + val *= mul.v; + if (mulexp == exp) + return (val); + u.v = val; + newexp -= mulexp; + } + + /* + * Both oldexp and newexp are positive; just replace the + * old exponent with the new one. + */ + u.s.dbl_exp = newexp; + return (u.v); +} diff --git a/lib/libc/arch/hppa64/gen/modf.c b/lib/libc/arch/hppa64/gen/modf.c new file mode 100644 index 00000000000..582c67aa993 --- /dev/null +++ b/lib/libc/arch/hppa64/gen/modf.c @@ -0,0 +1,309 @@ +/* $OpenBSD: modf.c,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ +/* @(#)s_modf.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$OpenBSD: modf.c,v 1.1 2005/04/01 10:54:27 mickey Exp $"; +#endif + +/* + * modf(double x, double *iptr) + * return fraction part of x, and return x's integral part in *iptr. + * Method: + * Bit twiddling. + * + * Exception: + * No exception. + */ + +#include "math.h" + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * from: @(#)fdlibm.h 5.1 93/09/24 + */ + +#ifndef _MATH_PRIVATE_H_ +#define _MATH_PRIVATE_H_ + +#include <sys/types.h> +#include <machine/endian.h> + +/* The original fdlibm code used statements like: + n0 = ((*(int*)&one)>>29)^1; * index of high word * + ix0 = *(n0+(int*)&x); * high word of x * + ix1 = *((1-n0)+(int*)&x); * low word of x * + to dig two 32 bit words out of the 64 bit IEEE floating point + value. That is non-ANSI, and, moreover, the gcc instruction + scheduler gets it wrong. We instead use the following macros. + Unlike the original code, we determine the endianness at compile + time, not at run time; I don't see much benefit to selecting + endianness at run time. */ + +/* A union which permits us to convert between a double and two 32 bit + ints. */ + +/* + * The arm32 port is little endian except for the FP word order which is + * big endian. + */ + +#if (BYTE_ORDER == BIG_ENDIAN) || defined(arm32) + +typedef union +{ + double value; + struct + { + u_int32_t msw; + u_int32_t lsw; + } parts; +} ieee_double_shape_type; + +#endif + +#if (BYTE_ORDER == LITTLE_ENDIAN) && !defined(arm32) + +typedef union +{ + double value; + struct + { + u_int32_t lsw; + u_int32_t msw; + } parts; +} ieee_double_shape_type; + +#endif + +/* Get two 32 bit ints from a double. */ + +#define EXTRACT_WORDS(ix0,ix1,d) \ +do { \ + ieee_double_shape_type ew_u; \ + ew_u.value = (d); \ + (ix0) = ew_u.parts.msw; \ + (ix1) = ew_u.parts.lsw; \ +} while (0) + +/* Get the more significant 32 bit int from a double. */ + +#define GET_HIGH_WORD(i,d) \ +do { \ + ieee_double_shape_type gh_u; \ + gh_u.value = (d); \ + (i) = gh_u.parts.msw; \ +} while (0) + +/* Get the less significant 32 bit int from a double. */ + +#define GET_LOW_WORD(i,d) \ +do { \ + ieee_double_shape_type gl_u; \ + gl_u.value = (d); \ + (i) = gl_u.parts.lsw; \ +} while (0) + +/* Set a double from two 32 bit ints. */ + +#define INSERT_WORDS(d,ix0,ix1) \ +do { \ + ieee_double_shape_type iw_u; \ + iw_u.parts.msw = (ix0); \ + iw_u.parts.lsw = (ix1); \ + (d) = iw_u.value; \ +} while (0) + +/* Set the more significant 32 bits of a double from an int. */ + +#define SET_HIGH_WORD(d,v) \ +do { \ + ieee_double_shape_type sh_u; \ + sh_u.value = (d); \ + sh_u.parts.msw = (v); \ + (d) = sh_u.value; \ +} while (0) + +/* Set the less significant 32 bits of a double from an int. */ + +#define SET_LOW_WORD(d,v) \ +do { \ + ieee_double_shape_type sl_u; \ + sl_u.value = (d); \ + sl_u.parts.lsw = (v); \ + (d) = sl_u.value; \ +} while (0) + +/* A union which permits us to convert between a float and a 32 bit + int. */ + +typedef union +{ + float value; + u_int32_t word; +} ieee_float_shape_type; + +/* Get a 32 bit int from a float. */ + +#define GET_FLOAT_WORD(i,d) \ +do { \ + ieee_float_shape_type gf_u; \ + gf_u.value = (d); \ + (i) = gf_u.word; \ +} while (0) + +/* Set a float from a 32 bit int. */ + +#define SET_FLOAT_WORD(d,i) \ +do { \ + ieee_float_shape_type sf_u; \ + sf_u.word = (i); \ + (d) = sf_u.value; \ +} while (0) + +/* ieee style elementary functions */ +extern double __ieee754_sqrt(double); +extern double __ieee754_acos(double); +extern double __ieee754_acosh(double); +extern double __ieee754_log(double); +extern double __ieee754_atanh(double); +extern double __ieee754_asin(double); +extern double __ieee754_atan2(double,double); +extern double __ieee754_exp(double); +extern double __ieee754_cosh(double); +extern double __ieee754_fmod(double,double); +extern double __ieee754_pow(double,double); +extern double __ieee754_lgamma_r(double,int *); +extern double __ieee754_gamma_r(double,int *); +extern double __ieee754_lgamma(double); +extern double __ieee754_gamma(double); +extern double __ieee754_log10(double); +extern double __ieee754_sinh(double); +extern double __ieee754_hypot(double,double); +extern double __ieee754_j0(double); +extern double __ieee754_j1(double); +extern double __ieee754_y0(double); +extern double __ieee754_y1(double); +extern double __ieee754_jn(int,double); +extern double __ieee754_yn(int,double); +extern double __ieee754_remainder(double,double); +extern int __ieee754_rem_pio2(double,double*); +extern double __ieee754_scalb(double,double); + +/* fdlibm kernel function */ +extern double __kernel_standard(double,double,int); +extern double __kernel_sin(double,double,int); +extern double __kernel_cos(double,double); +extern double __kernel_tan(double,double,int); +extern int __kernel_rem_pio2(double*,double*,int,int,int,const int*); + + +/* ieee style elementary float functions */ +extern float __ieee754_sqrtf(float); +extern float __ieee754_acosf(float); +extern float __ieee754_acoshf(float); +extern float __ieee754_logf(float); +extern float __ieee754_atanhf(float); +extern float __ieee754_asinf(float); +extern float __ieee754_atan2f(float,float); +extern float __ieee754_expf(float); +extern float __ieee754_coshf(float); +extern float __ieee754_fmodf(float,float); +extern float __ieee754_powf(float,float); +extern float __ieee754_lgammaf_r(float,int *); +extern float __ieee754_gammaf_r(float,int *); +extern float __ieee754_lgammaf(float); +extern float __ieee754_gammaf(float); +extern float __ieee754_log10f(float); +extern float __ieee754_sinhf(float); +extern float __ieee754_hypotf(float,float); +extern float __ieee754_j0f(float); +extern float __ieee754_j1f(float); +extern float __ieee754_y0f(float); +extern float __ieee754_y1f(float); +extern float __ieee754_jnf(int,float); +extern float __ieee754_ynf(int,float); +extern float __ieee754_remainderf(float,float); +extern int __ieee754_rem_pio2f(float,float*); +extern float __ieee754_scalbf(float,float); + +/* float versions of fdlibm kernel functions */ +extern float __kernel_sinf(float,float,int); +extern float __kernel_cosf(float,float); +extern float __kernel_tanf(float,float,int); +extern int __kernel_rem_pio2f(float*,float*,int,int,int,const int*); + +#endif /* _MATH_PRIVATE_H_ */ +#ifdef __STDC__ +static const double one = 1.0; +#else +static double one = 1.0; +#endif + +#ifdef __STDC__ + double modf(double x, double *iptr) +#else + double modf(x, iptr) + double x,*iptr; +#endif +{ + int32_t i0,i1,j0; + u_int32_t i; + EXTRACT_WORDS(i0,i1,x); + j0 = ((i0>>20)&0x7ff)-0x3ff; /* exponent of x */ + if(j0<20) { /* integer part in high x */ + if(j0<0) { /* |x|<1 */ + INSERT_WORDS(*iptr,i0&0x80000000,0); /* *iptr = +-0 */ + return x; + } else { + i = (0x000fffff)>>j0; + if(((i0&i)|i1)==0) { /* x is integral */ + u_int32_t high; + *iptr = x; + GET_HIGH_WORD(high,x); + INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */ + return x; + } else { + INSERT_WORDS(*iptr,i0&(~i),0); + return x - *iptr; + } + } + } else if (j0>51) { /* no fraction part */ + u_int32_t high; + *iptr = x*one; + GET_HIGH_WORD(high,x); + INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */ + return x; + } else { /* fraction part in low x */ + i = ((u_int32_t)(0xffffffff))>>(j0-20); + if((i1&i)==0) { /* x is integral */ + u_int32_t high; + *iptr = x; + GET_HIGH_WORD(high,x); + INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */ + return x; + } else { + INSERT_WORDS(*iptr,i0,i1&(~i)); + return x - *iptr; + } + } +} diff --git a/lib/libc/arch/hppa64/gen/setjmp.S b/lib/libc/arch/hppa64/gen/setjmp.S new file mode 100644 index 00000000000..cc512846e0b --- /dev/null +++ b/lib/libc/arch/hppa64/gen/setjmp.S @@ -0,0 +1,202 @@ +/* $OpenBSD: setjmp.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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> +#define _LOCORE +#include <machine/frame.h> +#undef _LOCORE + +#if defined(LIBC_SCCS) && !defined(lint) + .text + .asciz "$OpenBSD: setjmp.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif /* LIBC_SCCS and not lint */ + +/* + * C library -- setjmp, longjmp + * + * longjmp(a,v) + * will generate a "return(v)" from + * the last call to + * setjmp(a) + * by restoring registers from the stack, + * and a struct sigcontext, see <signal.h> + */ + +ENTRY(sigsetjmp, 64) + sub,<> %r0, %arg1, %r0 + b,n _setjmp + nop + + stw %arg1, 44(%arg0) ; last of reserved words + +ALTENTRY(setjmp) + stw %rp, HPPA_FRAME_CRP(%sp) + stw %arg0, HPPA_FRAME_ARG(0)(%sp) + + copy %r3, %r1 + copy %sp, %r3 + stw,ma %r1, HPPA_FRAME_SIZE(%sp) + + bl sigblock, %rp + copy %r0, %arg0 + + ldo HPPA_FRAME_SIZE(%r3), %sp + ldw,mb -HPPA_FRAME_SIZE(%sp),%r3 + ldw HPPA_FRAME_CRP(%sp), %rp + ldw HPPA_FRAME_ARG(0)(%sp), %arg0 + + stw %r0, 0(%arg0) ; no onstack + b _setjmp$dosaves + stw %ret0, 4(%arg0) ; mask + +ALTENTRY(_setjmp) + /* A sigcontext is at the beginning of our jmp_buf. */ + stw %r0, 0(%arg0) ; no onstack + stw %r0, 4(%arg0) ; mask +_setjmp$dosaves + stw %r0, 8(%arg0) ; set sc.sc_ps + stw %sp, 12(%arg0) ; sc.sc_sp = %sp + stw %r0, 16(%arg0) ; sc.sc_fp + ldo 4(%rp), %r1 + stw %rp, 20(%arg0) ; sc.sc_pcoqh = %rp + stw %r1, 24(%arg0) ; sc.sc_pcoqt = %rp + 4 + + /* We store all callee-saved registers after the sigcontext. */ + ldo 48(%arg0), %r1 ; offset to after sc + stwm %r3, 4(%r1) + stwm %r4, 4(%r1) + stwm %r5, 4(%r1) + stwm %r6, 4(%r1) + stwm %r7, 4(%r1) + stwm %r8, 4(%r1) + stwm %r9, 4(%r1) + stwm %r10, 4(%r1) + stwm %r11, 4(%r1) + stwm %r12, 4(%r1) + stwm %r13, 4(%r1) + stwm %r14, 4(%r1) + stwm %r15, 4(%r1) + stwm %r16, 4(%r1) + stwm %r17, 4(%r1) + stwm %r18, 4(%r1) + + /* Return 0. */ + bv %r0(%rp) + copy %r0, %ret0 +EXIT(_setjmp) + +ENTRY(siglongjmp,64) + /* XXX have to dup this from below */ + sub,>> %sp, %arg0, %r0 /* botch if jbuf was on stack */ + bl,n longjmperror, %rp + nop + ldw 16(%arg0), %r1 /* botch if it's a real signal frame */ + add,= %r0, %r1, %r0 + bl,n longjmperror, %rp + nop + + ldw 44(%arg0), %arg2 + sub,<> %r0, %arg2, %r0 + b _longjmp + nop + +ALTENTRY(longjmp) + /* XXX have to dup this from below */ + sub,>> %sp, %arg0, %r0 /* botch if jbuf was on stack */ + bl,n longjmperror, %rp + nop + ldw 16(%arg0), %r1 /* botch if it's a real signal frame */ + add,= %r0, %r1, %r0 + bl,n longjmperror, %rp + nop + + stw %rp, HPPA_FRAME_CRP(%sp) + stw %arg0, HPPA_FRAME_ARG(0)(%sp) + stw %arg1, HPPA_FRAME_ARG(1)(%sp) + + copy %r3, %r1 + copy %sp, %r3 + stw,ma %r1, HPPA_FRAME_SIZE(%sp) + + bl sigsetmask, %rp + ldw 4(%arg0), %arg0 + + ldo HPPA_FRAME_SIZE(%r3), %sp + ldw,mb -HPPA_FRAME_SIZE(%sp),%r3 + ldw HPPA_FRAME_CRP(%sp), %rp + ldw HPPA_FRAME_ARG(0)(%sp), %arg0 + b _longjmp$restores + ldw HPPA_FRAME_ARG(1)(%sp), %arg1 + +ALTENTRY(_longjmp) + sub,>> %sp, %arg0, %r0 /* botch if jbuf was on stack */ + bl,n longjmperror, %rp + nop + ldw 16(%arg0), %r1 /* botch if it's a real signal frame */ + add,= %r0, %r1, %r0 + bl,n longjmperror, %rp + nop + +_longjmp$restores + /* restore callee-saved registers */ + ldo 48(%arg0), %r1 + ldwm 4(%r1), %r3 + ldwm 4(%r1), %r4 + ldwm 4(%r1), %r5 + ldwm 4(%r1), %r6 + ldwm 4(%r1), %r7 + ldwm 4(%r1), %r8 + ldwm 4(%r1), %r9 + ldwm 4(%r1), %r10 + ldwm 4(%r1), %r11 + ldwm 4(%r1), %r12 + ldwm 4(%r1), %r13 + ldwm 4(%r1), %r14 + ldwm 4(%r1), %r15 + ldwm 4(%r1), %r16 + ldwm 4(%r1), %r17 + ldwm 4(%r1), %r18 + + /* restore the rest */ + ldw 12(%arg0), %sp + ldw 20(%arg0), %rp /* check the priv level */ + sub,<> %arg1, %r0, %r0 + ldo 1(%arg1), %arg1 + bv %r0(%rp) + copy %arg1, %ret0 +EXIT(_longjmp) + + .end diff --git a/lib/libc/arch/hppa64/net/Makefile.inc b/lib/libc/arch/hppa64/net/Makefile.inc new file mode 100644 index 00000000000..1a5924d85ab --- /dev/null +++ b/lib/libc/arch/hppa64/net/Makefile.inc @@ -0,0 +1,3 @@ +# $OpenBSD: Makefile.inc,v 1.1 2005/04/01 10:54:27 mickey Exp $ + +SRCS+= ntohl.c ntohs.c htons.c htonl.c diff --git a/lib/libc/arch/hppa64/string/Makefile.inc b/lib/libc/arch/hppa64/string/Makefile.inc new file mode 100644 index 00000000000..51954ba1a74 --- /dev/null +++ b/lib/libc/arch/hppa64/string/Makefile.inc @@ -0,0 +1,7 @@ +# $OpenBSD: Makefile.inc,v 1.1 2005/04/01 10:54:27 mickey Exp $ + +SRCS+= bcmp.c bzero.c bcopy.c memchr.c memcmp.c memset.c index.c rindex.c \ + strcat.c strcmp.c strcpy.c strlcpy.c strcspn.c strlen.c \ + strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \ + strspn.c strstr.c swab.c ffs.c + diff --git a/lib/libc/arch/hppa64/sys/Ovfork.S b/lib/libc/arch/hppa64/sys/Ovfork.S new file mode 100644 index 00000000000..cec62dc10d5 --- /dev/null +++ b/lib/libc/arch/hppa64/sys/Ovfork.S @@ -0,0 +1,51 @@ +/* $OpenBSD: Ovfork.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1999,2002 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + +#ifdef SYSLIBC_SCCS + .text + .asciz "$OpenBSD: Ovfork.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif + +SYSENTRY(vfork,0) + .import errno, data + copy rp, t4 + ldil L%SYSCALLGATE, r1 + ble 4(sr7, r1) + ldi __CONCAT(SYS_,vfork), t1 + .import __cerror, code + comb,<> r0, t1, __cerror + copy t4, rp + addi -1, ret1, ret1 + bv r0(rp) + and ret1, ret0, ret0 +SYSEXIT(vfork) + + .end diff --git a/lib/libc/arch/hppa64/sys/brk.S b/lib/libc/arch/hppa64/sys/brk.S new file mode 100644 index 00000000000..390fe92b650 --- /dev/null +++ b/lib/libc/arch/hppa64/sys/brk.S @@ -0,0 +1,74 @@ +/* $OpenBSD: brk.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1999 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + +#ifdef SYSLIBC_SCCS + .text + .asciz "$OpenBSD: brk.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif + + .import __curbrk, data + .import end, data + + .data + .export minbrk, data +minbrk + .long end + +SYSENTRY(brk,0) +#ifdef PIC + addil LT%minbrk, r19 + ldd RT%minbrk(r1), t1 + ldd 0(t1), t2 +#else + ldil L%minbrk, t1 + ldd R%minbrk(t1), t2 +#endif + sub,<< t2, arg0, r0 + copy t2, arg0 + std arg0, HPPA_FRAME_ARG(0)(sp) + + SYSCALL(break) + + ldd HPPA_FRAME_ARG(0)(sp), arg0 +#ifdef PIC + addil LT%__curbrk, r19 + ldd RT%__curbrk(r1), t1 + bv r0(rp) + std arg0, 0(t1) +#else + ldil L%__curbrk, t1 + bv r0(rp) + std arg0, R%__curbrk(t1) +#endif +SYSEXIT(brk) + + .end + diff --git a/lib/libc/arch/hppa64/sys/cerror.S b/lib/libc/arch/hppa64/sys/cerror.S new file mode 100644 index 00000000000..3f01e252dd7 --- /dev/null +++ b/lib/libc/arch/hppa64/sys/cerror.S @@ -0,0 +1,46 @@ +/* $OpenBSD: cerror.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 2004 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + + .import errno, data +ENTRY(__cerror,0) +#ifdef PIC + addil LT%errno, r19 + ldd RT%errno(r1), r1 + std t1, 0(r1) +#else + ldil L%errno, r1 + std t1, R%errno(r1) +#endif + ldi -1, ret0 + bv r0(rp) + ldi -1, ret1 +EXIT(__cerror) + + .end diff --git a/lib/libc/arch/hppa64/sys/exect.S b/lib/libc/arch/hppa64/sys/exect.S new file mode 100644 index 00000000000..da080260601 --- /dev/null +++ b/lib/libc/arch/hppa64/sys/exect.S @@ -0,0 +1,40 @@ +/* $OpenBSD: exect.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1999 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + +#ifdef SYSLIBC_SCCS + .text + .asciz "$OpenBSD: exect.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif + +/* we do no tracing yet */ +PSEUDO(exect,execve) + + .end diff --git a/lib/libc/arch/hppa64/sys/fork.S b/lib/libc/arch/hppa64/sys/fork.S new file mode 100644 index 00000000000..95fff6510d1 --- /dev/null +++ b/lib/libc/arch/hppa64/sys/fork.S @@ -0,0 +1,44 @@ +/* $OpenBSD: fork.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1999 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + +#ifdef SYSLIBC_SCCS + .text + .asciz "$OpenBSD: fork.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif + +SYSENTRY(fork,0) + SYSCALL(fork) + addi -1, ret1, ret1 + bv r0(rp) + and ret0, ret1, ret0 +SYSEXIT(fork) + + .end diff --git a/lib/libc/arch/hppa64/sys/rfork.S b/lib/libc/arch/hppa64/sys/rfork.S new file mode 100644 index 00000000000..92e7a06f396 --- /dev/null +++ b/lib/libc/arch/hppa64/sys/rfork.S @@ -0,0 +1,44 @@ +/* $OpenBSD: rfork.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1999 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + +#ifdef SYSLIBC_SCCS + .text + .asciz "$OpenBSD: rfork.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif + +SYSENTRY(rfork,0) + SYSCALL(rfork) + addi -1, ret1, ret1 + bv r0(rp) + and ret0, ret1, ret0 +SYSEXIT(rfork) + + .end diff --git a/lib/libc/arch/hppa64/sys/sbrk.S b/lib/libc/arch/hppa64/sys/sbrk.S new file mode 100644 index 00000000000..74c0523dbae --- /dev/null +++ b/lib/libc/arch/hppa64/sys/sbrk.S @@ -0,0 +1,73 @@ +/* $OpenBSD: sbrk.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1999 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + +#ifdef SYSLIBC_SCCS + .text + .asciz "$OpenBSD: sbrk.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif + + .import end, data + + .data + .export __curbrk, data +__curbrk + .long end + +SYSENTRY(sbrk,0) +#ifdef PIC + addil LT%__curbrk, r19 + ldd RT%__curbrk(r1), t1 + ldd 0(t1), t2 +#else + ldil L%__curbrk, t1 + ldd R%__curbrk(t1), t2 +#endif + add arg0, t2, arg0 + std arg0, HPPA_FRAME_ARG(0)(sp) + + SYSCALL(break) + +#ifdef PIC + addil LT%__curbrk, r19 + ldd RT%__curbrk(r1), t1 +#else + ldil L%__curbrk, t1 + ldo R%__curbrk(t1), t1 +#endif + ldd HPPA_FRAME_ARG(0)(sp), arg0 + ldd 0(t1), ret0 + bv r0(rp) + std arg0, 0(t1) + +SYSEXIT(sbrk) + + .end + diff --git a/lib/libc/arch/hppa64/sys/sigpending.S b/lib/libc/arch/hppa64/sys/sigpending.S new file mode 100644 index 00000000000..7ac9a9233fe --- /dev/null +++ b/lib/libc/arch/hppa64/sys/sigpending.S @@ -0,0 +1,45 @@ +/* $OpenBSD: sigpending.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1999 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + +#ifdef SYSLIBC_SCCS + .text + .asciz "$OpenBSD: sigpending.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif + +SYSENTRY(sigpending,0) + SYSCALL(sigpending) + ldd HPPA_FRAME_ARG(0)(sp), t1 + std ret0, 0(t1) + bv r0(rp) + copy r0, ret0 +SYSEXIT(sigpending) + + .end diff --git a/lib/libc/arch/hppa64/sys/sigprocmask.S b/lib/libc/arch/hppa64/sys/sigprocmask.S new file mode 100644 index 00000000000..8c5b5588430 --- /dev/null +++ b/lib/libc/arch/hppa64/sys/sigprocmask.S @@ -0,0 +1,60 @@ +/* $OpenBSD: sigprocmask.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1999 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + +#ifdef SYSLIBC_SCCS + .text + .asciz "$OpenBSD: sigprocmask.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif + +SYSENTRY(sigprocmask,0) + /* just in case compiler forgot about this */ + std arg2, HPPA_FRAME_ARG(2)(sp) + + comb,<>,n r0, arg1, sigprocmask$nblock + + b sigprocmask$call + ldi 1, arg0 + +sigprocmask$nblock + ldd 0(arg1), arg1 + std arg1, HPPA_FRAME_ARG(1)(sp) + +sigprocmask$call + SYSCALL(sigprocmask) + + ldd HPPA_FRAME_ARG(2)(sp), arg2 + add,= r0, arg2, r0 + std ret0, 0(arg2) + bv r0(rp) + copy r0, ret0 +SYSEXIT(sigprocmask) + + .end diff --git a/lib/libc/arch/hppa64/sys/sigreturn.S b/lib/libc/arch/hppa64/sys/sigreturn.S new file mode 100644 index 00000000000..b47eabaf455 --- /dev/null +++ b/lib/libc/arch/hppa64/sys/sigreturn.S @@ -0,0 +1,39 @@ +/* $OpenBSD: sigreturn.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1999 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + +#ifdef SYSLIBC_SCCS + .text + .asciz "$OpenBSD: sigreturn.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif + +RSYSCALL(sigreturn) + + .end diff --git a/lib/libc/arch/hppa64/sys/sigsuspend.S b/lib/libc/arch/hppa64/sys/sigsuspend.S new file mode 100644 index 00000000000..01043267588 --- /dev/null +++ b/lib/libc/arch/hppa64/sys/sigsuspend.S @@ -0,0 +1,44 @@ +/* $OpenBSD: sigsuspend.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1999 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + +#ifdef SYSLIBC_SCCS + .text + .asciz "$OpenBSD: sigsuspend.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif + +SYSENTRY(sigsuspend,0) + ldd 0(arg0), arg0 + std arg0, HPPA_FRAME_ARG(0)(sp) + + SYSCALL(sigsuspend) +SYSEXIT(sigsuspend) + + .end diff --git a/lib/libc/arch/hppa64/sys/syscall.S b/lib/libc/arch/hppa64/sys/syscall.S new file mode 100644 index 00000000000..b5795ce6d17 --- /dev/null +++ b/lib/libc/arch/hppa64/sys/syscall.S @@ -0,0 +1,39 @@ +/* $OpenBSD: syscall.S,v 1.1 2005/04/01 10:54:27 mickey Exp $ */ + +/* + * Copyright (c) 1999 Michael Shalayeff + * 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 OR HIS RELATIVES 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 MIND, 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.h" + +#ifdef SYSLIBC_SCCS + .text + .asciz "$OpenBSD: syscall.S,v 1.1 2005/04/01 10:54:27 mickey Exp $" + .align 4 +#endif + +RSYSCALL(syscall) + + .end |