diff options
author | jake <jake@FreeBSD.org> | 2001-10-26 05:40:07 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-10-26 05:40:07 +0000 |
commit | e655c7bdcaf79400600c7acbb120adeeaf3dfc6d (patch) | |
tree | baaeb9c1557a4d0fb79e2133e355fe0a1d610226 | |
parent | f883ef447af57985b21cde8cd13232ca845190a4 (diff) | |
download | FreeBSD-src-e655c7bdcaf79400600c7acbb120adeeaf3dfc6d.zip FreeBSD-src-e655c7bdcaf79400600c7acbb120adeeaf3dfc6d.tar.gz |
Minimal libc for sparc64.
Reviewed by: obrien
-rw-r--r-- | lib/libc/sparc64/Makefile.inc | 9 | ||||
-rw-r--r-- | lib/libc/sparc64/SYS.h | 82 | ||||
-rw-r--r-- | lib/libc/sparc64/gen/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/libc/sparc64/gen/_setjmp.S | 101 | ||||
-rw-r--r-- | lib/libc/sparc64/gen/flt_rounds.c | 26 | ||||
-rw-r--r-- | lib/libc/sparc64/gen/isinf.c | 56 | ||||
-rw-r--r-- | lib/libc/sparc64/net/Makefile.inc | 1 | ||||
-rw-r--r-- | lib/libc/sparc64/stdlib/Makefile.inc | 1 | ||||
-rw-r--r-- | lib/libc/sparc64/string/Makefile.inc | 1 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/Makefile.inc | 14 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/brk.S | 72 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/cerror.S | 63 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/exect.S | 58 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/fork.S | 58 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/pipe.S | 64 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/ptrace.S | 62 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/sbrk.S | 75 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/setlogin.S | 61 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/vfork.S | 67 |
19 files changed, 874 insertions, 0 deletions
diff --git a/lib/libc/sparc64/Makefile.inc b/lib/libc/sparc64/Makefile.inc new file mode 100644 index 0000000..58a6bc4 --- /dev/null +++ b/lib/libc/sparc64/Makefile.inc @@ -0,0 +1,9 @@ +# $FreeBSD$ +# +# Machine dependent definitions for the ultra sparc architecture. +# + +# +# sparc64 is 64-bit, so it doesn't need quad functions. +# +NO_QUAD=1 diff --git a/lib/libc/sparc64/SYS.h b/lib/libc/sparc64/SYS.h new file mode 100644 index 0000000..cc9c844 --- /dev/null +++ b/lib/libc/sparc64/SYS.h @@ -0,0 +1,82 @@ +/*- + * 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 + * from: FreeBSD: src/lib/libc/i386/SYS.h,v 1.20 2001/01/29 + * $FreeBSD$ + */ + +#include <sys/syscall.h> + +#include <machine/asm.h> +#include <machine/trap.h> + +#define ERROR() \ + mov %o7, %g1 ; \ + call HIDENAME(cerror) ; \ + mov %g1, %o7 + +#define _SYSENTRY(x) \ +ENTRY(__CONCAT(__sys_,x)) ; \ + .weak CNAME(x) ; \ + .set CNAME(x),CNAME(__CONCAT(__sys_,x)) ; \ + .weak CNAME(__CONCAT(_,x)) ; \ + .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)) + +#define _SYSCALL(x) \ + mov __CONCAT(SYS_,x), %g1 ; \ + ta %xcc, ST_SYSCALL ; \ + bcc,a,pt %xcc, 1f ; \ + nop ; \ + ERROR() ; \ +1: + +#define SYSCALL(x) \ +_SYSENTRY(x) ; \ + _SYSCALL(x) + +#define RSYSCALL(x) \ + SYSCALL(x) ; \ + retl ; \ + nop + +#define PSEUDO(x) \ +ENTRY(__CONCAT(__sys_,x)) ; \ + .weak CNAME(__CONCAT(_,x)) ; \ + .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)) ; \ + mov __CONCAT(SYS_,x), %g1 ; \ + ta %xcc, ST_SYSCALL ; \ + retl ; \ + nop diff --git a/lib/libc/sparc64/gen/Makefile.inc b/lib/libc/sparc64/gen/Makefile.inc new file mode 100644 index 0000000..82c194c --- /dev/null +++ b/lib/libc/sparc64/gen/Makefile.inc @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SRCS+= _setjmp.S flt_rounds.c isinf.c diff --git a/lib/libc/sparc64/gen/_setjmp.S b/lib/libc/sparc64/gen/_setjmp.S new file mode 100644 index 0000000..0e315eb --- /dev/null +++ b/lib/libc/sparc64/gen/_setjmp.S @@ -0,0 +1,101 @@ +/* + * 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: _setjmp.s,v 1.1 91/07/06 16:45:53 torek Exp + */ + +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 + .asciz "@(#)_setjmp.s 8.1 (Berkeley) 6/4/93" +#else + RCSID("$NetBSD: _setjmp.S,v 1.4 1998/10/08 02:27:59 eeh Exp $") +#endif +#endif /* LIBC_SCCS and not lint */ + +#if defined(SYSLIBC_RCS) && !defined(lint) + .text + .asciz "$FreeBSD$" +#endif /* SYSLIBC_RCS and not lint */ + +#include <machine/asm.h> + +/* + * C library -- _setjmp, _longjmp + * + * _longjmp(a,v) + * will generate a "return(v?v:1)" from + * the last call to + * _setjmp(a) + * by unwinding the call stack. + * The previous signal state is NOT restored. + */ + +#define JB_SP 0x0 +#define JB_PC 0x8 +#define JB_FP 0x10 + +ENTRY(_setjmp) + stx %sp, [%o0 + JB_SP] /* store caller's stack pointer */ + stx %o7, [%o0 + JB_PC] /* ... return pc */ + stx %fp, [%o0 + JB_FP] /* ... and frame pointer */ + retl + clr %o0 ! return 0 + +ENTRY(_longjmp) + mov 1, %g6 + movrnz %o1, %o1, %g6 ! compute v ? v : 1 in a global register + mov %o0, %g1 ! save a in another global register + ldx [%g1 + JB_FP], %g7 /* get caller's frame */ +1: cmp %fp, %g7 ! compare against desired frame + bl,a 1b ! if below, + restore ! pop frame and loop + be,a 2f ! if there, + ldx [%g1 + JB_SP], %o2 ! fetch return %sp + +.Lbotch: + call CNAME(longjmperror) ! otherwise, went too far; bomb out + nop + illtrap + +2: cmp %o2, %sp ! %sp must not decrease + bge,a 3f + mov %o2, %sp ! it is OK, put it in place + b,a .Lbotch + nop +3: ldx [%g1 + JB_PC], %o3 ! fetch pc + jmp %o3 + 8 ! success, return %g6 + mov %g6, %o0 + diff --git a/lib/libc/sparc64/gen/flt_rounds.c b/lib/libc/sparc64/gen/flt_rounds.c new file mode 100644 index 0000000..b0b7dde --- /dev/null +++ b/lib/libc/sparc64/gen/flt_rounds.c @@ -0,0 +1,26 @@ +/* + * Written by J.T. Conklin, Apr 10, 1995 + * Public domain. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/types.h> +#include <machine/float.h> + +static const int map[] = { + 1, /* round to nearest */ + 0, /* round to zero */ + 3, /* round to negative infinity */ + 2 /* round to positive infinity */ +}; + +int +__flt_rounds() +{ + int x; + + __asm("st %%fsr,%0" : "=m" (*&x)); + return map[(x >> 30) & 0x03]; +} diff --git a/lib/libc/sparc64/gen/isinf.c b/lib/libc/sparc64/gen/isinf.c new file mode 100644 index 0000000..9a70e44 --- /dev/null +++ b/lib/libc/sparc64/gen/isinf.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 1994, 1995 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + * + * from: NetBSD: isinf.c,v 1.1 1995/02/10 17:50:23 cgd Exp + * from: FreeBSD: src/lib/libc/alpha/gen/isinf.c,v 1.2 2000/05/10 + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/types.h> +#include <machine/ieee.h> +#include <math.h> + +int +isnan(d) + double d; +{ + register struct ieee_double *p = (struct ieee_double *)&d; + + return (p->dbl_exp == DBL_EXP_INFNAN && + (p->dbl_frach || p->dbl_fracl)); +} + +int +isinf(d) + double d; +{ + register struct ieee_double *p = (struct ieee_double *)&d; + + return (p->dbl_exp == DBL_EXP_INFNAN && + !p->dbl_frach && !p->dbl_fracl); +} diff --git a/lib/libc/sparc64/net/Makefile.inc b/lib/libc/sparc64/net/Makefile.inc new file mode 100644 index 0000000..e8c0da7 --- /dev/null +++ b/lib/libc/sparc64/net/Makefile.inc @@ -0,0 +1 @@ +# $FreeBSD$ diff --git a/lib/libc/sparc64/stdlib/Makefile.inc b/lib/libc/sparc64/stdlib/Makefile.inc new file mode 100644 index 0000000..e8c0da7 --- /dev/null +++ b/lib/libc/sparc64/stdlib/Makefile.inc @@ -0,0 +1 @@ +# $FreeBSD$ diff --git a/lib/libc/sparc64/string/Makefile.inc b/lib/libc/sparc64/string/Makefile.inc new file mode 100644 index 0000000..e8c0da7 --- /dev/null +++ b/lib/libc/sparc64/string/Makefile.inc @@ -0,0 +1 @@ +# $FreeBSD$ diff --git a/lib/libc/sparc64/sys/Makefile.inc b/lib/libc/sparc64/sys/Makefile.inc new file mode 100644 index 0000000..345cd46 --- /dev/null +++ b/lib/libc/sparc64/sys/Makefile.inc @@ -0,0 +1,14 @@ +# $FreeBSD$ + +MDASM+= brk.S cerror.S exect.S fork.S pipe.S ptrace.S sbrk.S setlogin.S \ + vfork.S + +# Don't generate default code for these syscalls: +NOASM= __semctl.o break.o exit.o ftruncate.o getdomainname.o getlogin.o \ + lseek.o mlockall.o mmap.o msgctl.o msgget.o msgrcv.o msgsnd.o \ + munlockall.o openbsd_poll.o pread.o pwrite.o semconfig.o semget.o \ + semop.o setdomainname.o shmat.o shmctl.o shmdt.o shmget.o sstk.o \ + truncate.o uname.o yield.o + +PSEUDO= _getlogin.o _exit.o + diff --git a/lib/libc/sparc64/sys/brk.S b/lib/libc/sparc64/sys/brk.S new file mode 100644 index 0000000..738f093 --- /dev/null +++ b/lib/libc/sparc64/sys/brk.S @@ -0,0 +1,72 @@ +/* + * 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(SYSLIBC_SCCS) && !defined(lint) +#if 0 + .asciz "@(#)brk.s 8.1 (Berkeley) 6/4/93" +#else + RCSID("$NetBSD: brk.S,v 1.9 2000/07/25 20:15:40 mycroft Exp $") +#endif +#endif /* SYSLIBC_SCCS and not lint */ + +#if defined(SYSLIBC_RCS) && !defined(lint) + .text + .asciz "$FreeBSD$" +#endif /* SYSLIBC_RCS and not lint */ + +#include "SYS.h" + + .globl HIDENAME(curbrk) + .globl HIDENAME(minbrk) + +_SYSENTRY(brk) + PIC_PROLOGUE(%o3, %o2) + SET(HIDENAME(minbrk), %o2, %o3) + ldx [%o3], %o4 + cmp %o4, %o0 + movg %xcc, %o4, %o0 + mov %o0, %o4 + mov SYS_break, %g1 + ta %xcc, ST_SYSCALL + bcc,a,pt %xcc, 1f + nop + ERROR() +1: SET(HIDENAME(curbrk), %o2, %o3) + retl + stx %o4, [%o3] diff --git a/lib/libc/sparc64/sys/cerror.S b/lib/libc/sparc64/sys/cerror.S new file mode 100644 index 0000000..e51f0b3 --- /dev/null +++ b/lib/libc/sparc64/sys/cerror.S @@ -0,0 +1,63 @@ +/*- + * 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: FreeBSD: src/lib/libc/i386/sys/cerror.S,v 1.11 2001/08/13 + */ + +#if defined(SYSLIBC_RCS) && !defined(lint) + .text + .asciz "$FreeBSD$" +#endif /* SYSLIBC_RCS and not lint */ + +#include "SYS.h" + + .text + .align 16 + .globl HIDENAME(cerror) + + /* + * The __error() function is thread aware. For non-threaded + * programs and the initial threaded in threaded programs, + * it returns a pointer to the global errno variable. + */ + .globl CNAME(__error) +HIDENAME(cerror): + save %sp, -CCFSZ, %sp + call CNAME(__error) + nop + stw %i0, [%o0] + mov -1, %i0 + ret + restore %g0, -1, %o1 diff --git a/lib/libc/sparc64/sys/exect.S b/lib/libc/sparc64/sys/exect.S new file mode 100644 index 0000000..3078b01 --- /dev/null +++ b/lib/libc/sparc64/sys/exect.S @@ -0,0 +1,58 @@ +/* + * 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) +#if 0 + .asciz "@(#)exect.s 8.1 (Berkeley) 6/4/93" +#else + RCSID("$NetBSD: exect.S,v 1.1 1998/09/11 04:56:34 eeh Exp $") +#endif +#endif /* LIBC_SCCS and not lint */ + +#if defined(SYSLIBC_RCS) && !defined(lint) + .text + .asciz "$FreeBSD$" +#endif /* SYSLIBC_RCS and not lint */ + +#include "SYS.h" + +ENTRY(exect) + mov SYS_execve, %g1 + ta %xcc, ST_SYSCALL + ERROR() diff --git a/lib/libc/sparc64/sys/fork.S b/lib/libc/sparc64/sys/fork.S new file mode 100644 index 0000000..00d59d2 --- /dev/null +++ b/lib/libc/sparc64/sys/fork.S @@ -0,0 +1,58 @@ +/* + * 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(SYSLIBC_SCCS) && !defined(lint) +#if 0 + .asciz "@(#)fork.s 8.1 (Berkeley) 6/4/93" +#else + RCSID("$NetBSD: fork.S,v 1.3 2000/07/25 15:14:46 mycroft Exp $") +#endif +#endif /* SYSLIBC_SCCS and not lint */ + +#if defined(SYSLIBC_RCS) && !defined(lint) + .text + .asciz "$FreeBSD$" +#endif /* SYSLIBC_RCS and not lint */ + +#include "SYS.h" + +SYSCALL(fork) + dec %o1 /* from 1 to 0 in child, 0 to -1 in parent */ + retl + and %o0, %o1, %o0 /* return 0 in child, pid in parent */ diff --git a/lib/libc/sparc64/sys/pipe.S b/lib/libc/sparc64/sys/pipe.S new file mode 100644 index 0000000..2b52538 --- /dev/null +++ b/lib/libc/sparc64/sys/pipe.S @@ -0,0 +1,64 @@ +/* + * 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(SYSLIBC_SCCS) && !defined(lint) +#if 0 + .asciz "@(#)pipe.s 8.1 (Berkeley) 6/4/93" +#else + RCSID("$NetBSD: pipe.S,v 1.3 2000/09/28 08:38:55 kleink Exp $") +#endif +#endif /* SYSLIBC_SCCS and not lint */ + +#if defined(SYSLIBC_RCS) && !defined(lint) + .text + .asciz "$FreeBSD$" +#endif + +#include "SYS.h" + +_SYSENTRY(pipe) + mov %o0, %o2 + mov SYS_pipe, %g1 + ta %xcc, ST_SYSCALL + bcc,a,pt %xcc, 1f + stw %o0, [%o2] + ERROR() +1: stw %o1, [%o2 + 4] + retl + clr %o0 diff --git a/lib/libc/sparc64/sys/ptrace.S b/lib/libc/sparc64/sys/ptrace.S new file mode 100644 index 0000000..7f7a9b3 --- /dev/null +++ b/lib/libc/sparc64/sys/ptrace.S @@ -0,0 +1,62 @@ +/* + * 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 + * from: NetBSD: ptrace.S,v 1.4 2000/07/24 00:11:10 mycroft Exp + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) +#if 0 + .asciz "@(#)ptrace.s 8.1 (Berkeley) 6/4/93" +#else + RCSID("$NetBSD: ptrace.S,v 1.4 2000/07/24 00:11:10 mycroft Exp $") +#endif +#endif /* SYSLIBC_SCCS and not lint */ + +#if defined(SYSLIBC_RCS) && !defined(lint) + .text + .asciz "$FreeBSD$" +#endif /* SYSLIBC_RCS and not lint */ + +#include "SYS.h" + +_SYSENTRY(ptrace) + save %sp, -CCFSZ, %sp + call CNAME(__error) + nop + stw %g0, [%o0] + restore + _SYSCALL(ptrace) diff --git a/lib/libc/sparc64/sys/sbrk.S b/lib/libc/sparc64/sys/sbrk.S new file mode 100644 index 0000000..211d54d --- /dev/null +++ b/lib/libc/sparc64/sys/sbrk.S @@ -0,0 +1,75 @@ +/* + * 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(SYSLIBC_SCCS) && !defined(lint) +#if 0 + .asciz "@(#)sbrk.s 8.1 (Berkeley) 6/4/93" +#else + RCSID("$NetBSD: sbrk.S,v 1.7 2000/07/25 15:14:46 mycroft Exp $") +#endif +#endif /* SYSLIBC_SCCS and not lint */ + +#if defined(SYSLIBC_RCS) && !defined(lint) + .text + .asciz "$FreeBSD$" +#endif /* SYSLIBC_RCS and not lint */ + +#include "SYS.h" + + .data + .globl HIDENAME(curbrk) + .globl HIDENAME(minbrk) +HIDENAME(curbrk): + .xword CNAME(_end) +HIDENAME(minbrk): + .xword CNAME(_end) + +_SYSENTRY(sbrk) + PIC_PROLOGUE(%o3, %o2) + SET(HIDENAME(curbrk), %o2, %o3) + ldx [%o3], %o4 + add %o4, %o0, %o5 + mov %o5, %o0 + mov SYS_break, %g1 + ta %xcc, ST_SYSCALL + bcc,a,pt %xcc, 1f + mov %o4, %o0 + ERROR() +1: retl + stx %o5, [%o3] diff --git a/lib/libc/sparc64/sys/setlogin.S b/lib/libc/sparc64/sys/setlogin.S new file mode 100644 index 0000000..f05da2e --- /dev/null +++ b/lib/libc/sparc64/sys/setlogin.S @@ -0,0 +1,61 @@ +/* + * 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(SYSLIBC_SCCS) && !defined(lint) +#if 0 + .asciz "@(#)setlogin.s 8.1 (Berkeley) 6/4/93" +#else + RCSID("$NetBSD: setlogin.S,v 1.3 2000/07/21 03:14:15 eeh Exp $") +#endif +#endif /* SYSLIBC_SCCS and not lint */ + +#if defined(SYSLIBC_RCS) && !defined(lint) + .text + .asciz "$FreeBSD$" +#endif /* SYSLIBC_RCS and not lint */ + +#include "SYS.h" + + .globl CNAME(_logname_valid) /* in _getlogin() */ + +SYSCALL(setlogin) + PIC_PROLOGUE(%o3, %o2) + SET(CNAME(_logname_valid), %o2, %o3) + retl + stw %g0, [%o3] diff --git a/lib/libc/sparc64/sys/vfork.S b/lib/libc/sparc64/sys/vfork.S new file mode 100644 index 0000000..01ccd33 --- /dev/null +++ b/lib/libc/sparc64/sys/vfork.S @@ -0,0 +1,67 @@ +/* $NetBSD: __vfork14.S,v 1.2 2000/07/25 15:14:45 mycroft 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(SYSLIBC_SCCS) && !defined(lint) +#if 0 + .asciz "@(#)Ovfork.s 8.1 (Berkeley) 6/4/93" +#else + RCSID("$NetBSD: __vfork14.S,v 1.2 2000/07/25 15:14:45 mycroft Exp $") +#endif +#endif /* SYSLIBC_SCCS and not lint */ + +#if defined(SYSLIBC_RCS) && !defined(lint) + .text + .asciz "$FreeBSD$" +#endif /* SYSLIBC_RCS and not lint */ + +/* + * pid = vfork(); + * + * %o1 == 0 in parent process, 1 in child process. + * %o0 == pid of child in parent, pid of parent in child. + */ + +#include "SYS.h" + +SYSCALL(vfork) + dec %o1 /* from 1 to 0 in child, 0 to -1 in parent */ + retl + and %o0, %o1, %o0 /* return 0 in child, pid in parent */ |