diff --git a/lib/libc/arch/m68k/gen/ldexp.c b/lib/libc/arch/m68k/gen/ldexp.c new file mode 100644 index 000000000000..4af44630d59a --- /dev/null +++ b/lib/libc/arch/m68k/gen/ldexp.c @@ -0,0 +1,148 @@ +/* + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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 + * $Id: ldexp.c,v 1.1 1997/03/29 20:55:57 thorpej 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 +#include +#include + +/* + * 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/powerpc/Makefile.inc b/lib/libc/arch/powerpc/Makefile.inc new file mode 100644 index 000000000000..9f9a44699621 --- /dev/null +++ b/lib/libc/arch/powerpc/Makefile.inc @@ -0,0 +1,4 @@ +# $NetBSD: Makefile.inc,v 1.1 1997/03/29 20:55:50 thorpej Exp $ + +KMINCLUDES= arch/powerpc/SYS.h +KMSRCS= diff --git a/lib/libc/arch/powerpc/SYS.h b/lib/libc/arch/powerpc/SYS.h new file mode 100644 index 000000000000..22f5d40747ff --- /dev/null +++ b/lib/libc/arch/powerpc/SYS.h @@ -0,0 +1,87 @@ +/* $NetBSD: SYS.h,v 1.1 1997/03/29 20:55:51 thorpej Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: @(#)SYS.h 5.5 (Berkeley) 5/7/91 + */ + +#include +#include + +#ifdef __STDC__ + +#define SYSCALL_NOERROR(x) .text ;\ + .align 2 ;\ + ENTRY(x) ;\ + li 0,(SYS_ ## x) ;\ + sc + +#define PSEUDO(x,y) .text ;\ + .align 2 ;\ + ENTRY(x) ;\ + li 0,(SYS_ ## y) ;\ + sc ;\ + blr + +#else /* !__STDC__ */ + +#define SYSCALL_NOERROR(x) .text ;\ + .align 2 ;\ + ENTRY(x) ;\ + li 0,(SYS_/**/x) ;\ + sc + +#define PSEUDO(x,y) .text ;\ + .align 2 ;\ + ENTRY(x) ;\ + li 0,(SYS_/**/y) ;\ + sc ;\ + blr + +#endif + +#define RSYSCALL_NOERROR(x) SYSCALL_NOERROR(x) ;\ + blr + +#define SYSCALL(x) .text ;\ + .align 2 ;\ + 2: b PIC_PLT(cerror) ;\ + SYSCALL_NOERROR(x) ;\ + bso 2b + +#define RSYSCALL(x) SYSCALL_NOERROR(x) ;\ + bnslr ;\ + b PIC_PLT(cerror) diff --git a/lib/libc/arch/powerpc/gen/Makefile.inc b/lib/libc/arch/powerpc/gen/Makefile.inc new file mode 100644 index 000000000000..d5ff96cbb272 --- /dev/null +++ b/lib/libc/arch/powerpc/gen/Makefile.inc @@ -0,0 +1,4 @@ +# $NetBSD: Makefile.inc,v 1.1 1997/03/29 20:55:52 thorpej Exp $ + +SRCS+= _setjmp.S setjmp.S sigsetjmp.S +SRCS+= isinf.c isnan.c ldexp.c fabs.S flt_rounds.c infinity.c diff --git a/lib/libc/arch/powerpc/gen/_setjmp.S b/lib/libc/arch/powerpc/gen/_setjmp.S new file mode 100644 index 000000000000..c263d26e6c09 --- /dev/null +++ b/lib/libc/arch/powerpc/gen/_setjmp.S @@ -0,0 +1,38 @@ +/* $NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */ + +#include + +#if defined(LIBC_SCCS) + .text + .asciz "$NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $" +#endif + +/* + * C library -- _setjmp, _longjmp + * + * _longjmp(a,v) + * will generate a "return(v?v:1)" from the last call to + * _setjmp(a) + * by restoring registers from the stack. + * The previous signal state is NOT restored. + */ + +ENTRY(_setjmp) + mflr 11 + mfcr 12 + mr 10,1 + mr 9,2 + stmw 9,8(3) + li 3,0 + blr + +ENTRY(_longjmp) + lmw 9,8(3) + mtlr 11 + mtcr 12 + mr 2,9 + mr 1,10 + or. 3,4,4 + bnelr + li 3,1 + blr diff --git a/lib/libc/arch/powerpc/gen/fabs.S b/lib/libc/arch/powerpc/gen/fabs.S new file mode 100644 index 000000000000..c15fb404c5f7 --- /dev/null +++ b/lib/libc/arch/powerpc/gen/fabs.S @@ -0,0 +1,37 @@ +/* $NetBSD: fabs.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */ + +/* + * Copyright (C) 1996 Wolfgang Solfrank. + * Copyright (C) 1996 TooLs GmbH. + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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 + +ENTRY(fabs) + fabs 1,1 + blr diff --git a/lib/libc/arch/powerpc/gen/flt_rounds.c b/lib/libc/arch/powerpc/gen/flt_rounds.c new file mode 100644 index 000000000000..7ace4a8d1ab4 --- /dev/null +++ b/lib/libc/arch/powerpc/gen/flt_rounds.c @@ -0,0 +1,18 @@ +/* $NetBSD: flt_rounds.c,v 1.1 1997/03/29 20:55:55 thorpej Exp $ */ + +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() +{ + double tmp; + int x; + + asm("mffs %0; stfiwx %0,0,%1" : "=f"(tmp): "b"(&x)); + return map[x & 0x03]; +} diff --git a/lib/libc/arch/powerpc/gen/infinity.c b/lib/libc/arch/powerpc/gen/infinity.c new file mode 100644 index 000000000000..6fbefe5489b0 --- /dev/null +++ b/lib/libc/arch/powerpc/gen/infinity.c @@ -0,0 +1,10 @@ +#ifndef lint +static char rcsid[] = "$NetBSD: infinity.c,v 1.1 1997/03/29 20:55:55 thorpej Exp $"; +#endif /* not lint */ + +/* infinity.c */ + +#include + +/* bytes for +Infinity on a PowerPC */ +char __infinity[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }; diff --git a/lib/libc/arch/powerpc/gen/isinf.c b/lib/libc/arch/powerpc/gen/isinf.c new file mode 100644 index 000000000000..e925baa95725 --- /dev/null +++ b/lib/libc/arch/powerpc/gen/isinf.c @@ -0,0 +1,57 @@ +/* $NetBSD: isinf.c,v 1.1 1997/03/29 20:55:56 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +int +isinf(d) + double d; +{ + register 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/powerpc/gen/isnan.c b/lib/libc/arch/powerpc/gen/isnan.c new file mode 100644 index 000000000000..c5ecd320f4a1 --- /dev/null +++ b/lib/libc/arch/powerpc/gen/isnan.c @@ -0,0 +1,57 @@ +/* $NetBSD: isnan.c,v 1.1 1997/03/29 20:55:57 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: isnan.c,v 1.1 91/07/08 19:03:34 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)isnan.c 8.1 (Berkeley) 6/4/93"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +int +isnan(d) + double d; +{ + register 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/powerpc/gen/ldexp.c b/lib/libc/arch/powerpc/gen/ldexp.c new file mode 100644 index 000000000000..4af44630d59a --- /dev/null +++ b/lib/libc/arch/powerpc/gen/ldexp.c @@ -0,0 +1,148 @@ +/* + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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 + * $Id: ldexp.c,v 1.1 1997/03/29 20:55:57 thorpej 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 +#include +#include + +/* + * 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/powerpc/gen/setjmp.S b/lib/libc/arch/powerpc/gen/setjmp.S new file mode 100644 index 000000000000..9ca890d2a2ad --- /dev/null +++ b/lib/libc/arch/powerpc/gen/setjmp.S @@ -0,0 +1,89 @@ +/* $NetBSD: setjmp.S,v 1.1 1997/03/29 20:55:58 thorpej Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: @(#)setjmp.s 5.1 (Berkeley) 4/23/90 + */ + +#include + +#include + +#if defined(LIBC_SCCS) + .text + .asciz "$NetBSD: setjmp.S,v 1.1 1997/03/29 20:55:58 thorpej Exp $" +#endif + +/* + * C library -- _setjmp, _longjmp + * + * longjmp(a,v) + * will generate a "return(v?v:1)" from the last call to + * setjmp(a) + * by restoring registers from the stack. + * The previous signal state is restored. + */ + +ENTRY(setjmp) + mr 6,3 + li 3,1 # SIG_BLOCK + li 4,0 + li 0,SYS_sigprocmask + sc # assume no error XXX + mflr 11 + mfcr 12 + mr 10,1 + mr 9,2 + mr 8,3 + stmw 8,4(6) + li 3,0 + blr + +ENTRY(longjmp) + lmw 8,4(3) + mr 6,4 + mtlr 11 + mtcr 12 + mr 2,9 + mr 1,10 + mr 4,8 + li 3,3 # SIG_SETMASK + li 0,SYS_sigprocmask + sc # assume no error XXX + or. 3,6,6 + bnelr + li 3,1 + blr diff --git a/lib/libc/arch/powerpc/gen/sigsetjmp.S b/lib/libc/arch/powerpc/gen/sigsetjmp.S new file mode 100644 index 000000000000..522afa63c30b --- /dev/null +++ b/lib/libc/arch/powerpc/gen/sigsetjmp.S @@ -0,0 +1,84 @@ +/* $NetBSD: sigsetjmp.S,v 1.1 1997/03/29 20:55:59 thorpej Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: @(#)setjmp.s 5.1 (Berkeley) 4/23/90" + */ +#include + +#include + +#if defined(LIBC_SCCS) + .text + .asciz "$NetBSD: sigsetjmp.S,v 1.1 1997/03/29 20:55:59 thorpej Exp $" +#endif + +ENTRY(sigsetjmp) + mr 6,3 + or. 7,4,4 + beq 1f + li 3,1 # SIG_BLOCK + li 4,0 + li 0,SYS_sigprocmask + sc # assume no error XXX +1: + mflr 11 + mfcr 12 + mr 10,1 + mr 9,2 + mr 8,3 + stmw 7,0(6) + li 3,0 + blr + +ENTRY(siglongjmp) + lmw 7,0(3) + mr 6,4 + mtlr 11 + mtcr 12 + mr 2,9 + mr 1,10 + or. 7,7,7 + beq 1f + mr 4,8 + li 3,3 # SIG_SETMASK + li 0,SYS_sigprocmask + sc # assume no error XXX +1: + or. 3,6,6 + bnelr + li 3,1 + blr diff --git a/lib/libc/arch/powerpc/net/Makefile.inc b/lib/libc/arch/powerpc/net/Makefile.inc new file mode 100644 index 000000000000..0e5f5a6be77f --- /dev/null +++ b/lib/libc/arch/powerpc/net/Makefile.inc @@ -0,0 +1 @@ +# $NetBSD: Makefile.inc,v 1.1 1997/03/29 20:55:59 thorpej Exp $ diff --git a/lib/libc/arch/powerpc/string/Makefile.inc b/lib/libc/arch/powerpc/string/Makefile.inc new file mode 100644 index 000000000000..acc57293f2ef --- /dev/null +++ b/lib/libc/arch/powerpc/string/Makefile.inc @@ -0,0 +1,6 @@ +# $NetBSD: Makefile.inc,v 1.1 1997/03/29 20:56:01 thorpej Exp $ + +SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memchr.c memcmp.c memset.c \ + rindex.c strcat.c strcmp.c strcpy.c strcspn.c strlen.c \ + strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \ + strspn.c strstr.c swab.c diff --git a/lib/libc/arch/powerpc/sys/Ovfork.S b/lib/libc/arch/powerpc/sys/Ovfork.S new file mode 100644 index 000000000000..85c41861e1e1 --- /dev/null +++ b/lib/libc/arch/powerpc/sys/Ovfork.S @@ -0,0 +1,58 @@ +/* $NetBSD: Ovfork.S,v 1.1 1997/03/29 20:56:01 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: Ovfork.s,v 1.1 91/07/06 13:05:56 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)Ovfork.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +/* + * pid = vfork(); + * + * r4 == 0 in parent process, 1 in child process. + * r3 == pid of child in parent, pid of parent in child. + */ + +#include "SYS.h" + +SYSCALL(vfork) + addi 4,4,-1 # from 1 to 0 in child, 0 to -1 in parent + and 3,3,4 # return 0 in child, pid in parent + blr diff --git a/lib/libc/arch/powerpc/sys/brk.S b/lib/libc/arch/powerpc/sys/brk.S new file mode 100644 index 000000000000..d5e918b168ee --- /dev/null +++ b/lib/libc/arch/powerpc/sys/brk.S @@ -0,0 +1,72 @@ +/* $NetBSD: brk.S,v 1.1 1997/03/29 20:56:02 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: brk.s,v 1.3 92/06/25 12:56:05 mccanne Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)brk.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include "SYS.h" + + .globl curbrk + + .text + +#ifdef PIC + XXX +#else +ENTRY(brk) + lis 5,_end@ha # r5 = &_end + addi 5,5,_end@l + cmplw 5,3 # if (&_end <= r3) + bgt 0f + mr 5,3 # r5 = r3 +0: + mr 3,5 # new break value + li 0,SYS_break + sc # assume, that r5 is kept + bso 1f + lis 6,curbrk@ha + stw 5,curbrk@l(6) # record new break + blr # return 0 + +1: + b cerror +#endif diff --git a/lib/libc/arch/powerpc/sys/cerror.S b/lib/libc/arch/powerpc/sys/cerror.S new file mode 100644 index 000000000000..d91ed95ef642 --- /dev/null +++ b/lib/libc/arch/powerpc/sys/cerror.S @@ -0,0 +1,62 @@ +/* $NetBSD: cerror.S,v 1.1 1997/03/29 20:56:03 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: cerror.s,v 1.3 92/07/02 04:17:59 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)cerror.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include +#include "SYS.h" + +/* XXX _REENTRANT */ + + .globl _C_LABEL(errno) +#ifdef PIC +ASENTRY(cerror) + XXX +#else +ASENTRY(cerror) + lis 4,_C_LABEL(errno)@ha + stw 3,_C_LABEL(errno)@l(4) + li 3,-1 + li 4,-1 + blr +#endif diff --git a/lib/libc/arch/powerpc/sys/exect.S b/lib/libc/arch/powerpc/sys/exect.S new file mode 100644 index 000000000000..c2472ae205bd --- /dev/null +++ b/lib/libc/arch/powerpc/sys/exect.S @@ -0,0 +1,48 @@ +/* $NetBSD: exect.S,v 1.1 1997/03/29 20:56:03 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: exect.s,v 1.1 91/07/06 13:05:57 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)exect.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include "SYS.h" + +RSYSCALL(execve) diff --git a/lib/libc/arch/powerpc/sys/fork.S b/lib/libc/arch/powerpc/sys/fork.S new file mode 100644 index 000000000000..0937b49d262b --- /dev/null +++ b/lib/libc/arch/powerpc/sys/fork.S @@ -0,0 +1,58 @@ +/* $NetBSD: fork.S,v 1.1 1997/03/29 20:56:04 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: fork.s,v 1.1 91/07/06 13:05:58 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)fork.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +/* + * pid = fork(); + * + * r4 == 0 in parent process, 1 in child process. + * r3 == pid of child in parent, pid of parent in child. + */ + +#include "SYS.h" + +SYSCALL(fork) + addi 4,4,-1 # from 1 to 0 in child, 0 to -1 in parent + and 3,3,4 # return 0 in child, pid in parent + blr diff --git a/lib/libc/arch/powerpc/sys/pipe.S b/lib/libc/arch/powerpc/sys/pipe.S new file mode 100644 index 000000000000..719a75b3c98d --- /dev/null +++ b/lib/libc/arch/powerpc/sys/pipe.S @@ -0,0 +1,58 @@ +/* $NetBSD: pipe.S,v 1.1 1997/03/29 20:56:05 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: pipe.s,v 1.1 91/07/06 13:05:58 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)pipe.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(pipe) + mr 5, 3 # save pointer + li 0,SYS_pipe + sc # assume, that r5 is kept + bso 1f + stw 3,0(5) # success, store fds + stw 4,4(5) + li 3,0 + blr # and return 0 +1: + b cerror diff --git a/lib/libc/arch/powerpc/sys/ptrace.S b/lib/libc/arch/powerpc/sys/ptrace.S new file mode 100644 index 000000000000..fb677f89d654 --- /dev/null +++ b/lib/libc/arch/powerpc/sys/ptrace.S @@ -0,0 +1,48 @@ +/* $NetBSD: ptrace.S,v 1.1 1997/03/29 20:56:05 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: ptrace.s,v 1.2 91/12/20 01:59:00 leres Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)ptrace.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include "SYS.h" + +RSYSCALL(ptrace) diff --git a/lib/libc/arch/powerpc/sys/sbrk.S b/lib/libc/arch/powerpc/sys/sbrk.S new file mode 100644 index 000000000000..53b96085a8e6 --- /dev/null +++ b/lib/libc/arch/powerpc/sys/sbrk.S @@ -0,0 +1,71 @@ +/* $NetBSD: sbrk.S,v 1.1 1997/03/29 20:56:06 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: sbrk.s,v 1.3 92/07/02 00:56:49 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)sbrk.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include "SYS.h" + + .globl _end + .globl curbrk + + .data +curbrk: .long _end + .text + +ENTRY(sbrk) +#ifdef PIC + XXX +#else + lis 5,curbrk@ha + lwz 6,curbrk@l(5) # r6 = old break + add 3,3,6 + mr 7,3 # r7 = new break + li 0,SYS_break + sc # break(new_break) + bso 1f + mr 3,6 # set return value + stw 7,curbrk@l(5) # record new break + blr +1: + b cerror +#endif diff --git a/lib/libc/arch/powerpc/sys/setlogin.S b/lib/libc/arch/powerpc/sys/setlogin.S new file mode 100644 index 000000000000..165941d6d702 --- /dev/null +++ b/lib/libc/arch/powerpc/sys/setlogin.S @@ -0,0 +1,58 @@ +/* $NetBSD: setlogin.S,v 1.1 1997/03/29 20:56:06 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: setlogin.s,v 1.1 91/07/06 13:06:00 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)setlogin.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include "SYS.h" + + .globl _C_LABEL(__logname_valid) /* in getlogin() */ + +SYSCALL(setlogin) +#ifdef PIC + XXX +#else + lis 4,_C_LABEL(__logname_valid)@ha + li 5,0 + stw 5,_C_LABEL(__logname_valid)@l(4) + blr +#endif diff --git a/lib/libc/arch/powerpc/sys/sigpending.S b/lib/libc/arch/powerpc/sys/sigpending.S new file mode 100644 index 000000000000..bc693ab9b1bf --- /dev/null +++ b/lib/libc/arch/powerpc/sys/sigpending.S @@ -0,0 +1,57 @@ +/* $NetBSD: sigpending.S,v 1.1 1997/03/29 20:56:07 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: sigpending.s,v 1.1 91/07/06 13:06:00 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)sigpending.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(sigpending) + mr 5,3 # save pointer + li 0,SYS_sigpending + sc # sigpending() + bso 1f + stw 3,0(5) # store return value + li 3,0 # and return 0 + blr +1: + b cerror diff --git a/lib/libc/arch/powerpc/sys/sigprocmask.S b/lib/libc/arch/powerpc/sys/sigprocmask.S new file mode 100644 index 000000000000..1752e627572f --- /dev/null +++ b/lib/libc/arch/powerpc/sys/sigprocmask.S @@ -0,0 +1,69 @@ +/* $NetBSD: sigprocmask.S,v 1.1 1997/03/29 20:56:08 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: sigprocmask.s,v 1.1 91/07/06 13:06:01 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)sigprocmask.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include "SYS.h" + +/* + * sigprocmask(int how, sigset_t *set, sigset_t *oset) + */ +ENTRY(sigprocmask) + or. 4,4,4 # set == NULL? + li 6,1 # how = SIG_BLOCK + beq 1f + lwz 4,0(4) # if not, replace it in r4 with *set + mr 6,3 +1: + mr 3,6 # ... using sigprocmask(SIG_BLOCK) + li 0,SYS_sigprocmask + sc + bso 3f + or. 5,5,5 # check to see of oset requested + beq 2f # if oset != NULL, + stw 3,0(5) # *oset = oldmask +2: + li 3,0 + blr # in any case, return 0 +3: + b cerror diff --git a/lib/libc/arch/powerpc/sys/sigreturn.S b/lib/libc/arch/powerpc/sys/sigreturn.S new file mode 100644 index 000000000000..03ba0c886f16 --- /dev/null +++ b/lib/libc/arch/powerpc/sys/sigreturn.S @@ -0,0 +1,48 @@ +/* $NetBSD: sigreturn.S,v 1.1 1997/03/29 20:56:08 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: sigreturn.s,v 1.1 91/07/06 13:06:01 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)sigreturn.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include "SYS.h" + +RSYSCALL(sigreturn) diff --git a/lib/libc/arch/powerpc/sys/sigsuspend.S b/lib/libc/arch/powerpc/sys/sigsuspend.S new file mode 100644 index 000000000000..59c29c9fcddd --- /dev/null +++ b/lib/libc/arch/powerpc/sys/sigsuspend.S @@ -0,0 +1,52 @@ +/* $NetBSD: sigsuspend.S,v 1.1 1997/03/29 20:56:09 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: sigsuspend.s,v 1.1 91/07/06 13:06:01 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)sigsuspend.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(sigsuspend) + lwz 3,0(3) # indirect to mask arg + li 0,SYS_sigsuspend + sc + b cerror # always terminates with EINTR diff --git a/lib/libc/arch/powerpc/sys/syscall.S b/lib/libc/arch/powerpc/sys/syscall.S new file mode 100644 index 000000000000..761a70f24f5c --- /dev/null +++ b/lib/libc/arch/powerpc/sys/syscall.S @@ -0,0 +1,48 @@ +/* $NetBSD: syscall.S,v 1.1 1997/03/29 20:56:09 thorpej 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. 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: syscall.s,v 1.1 91/07/06 13:06:02 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)syscall.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +#include "SYS.h" + +RSYSCALL(syscall)