repo_id
stringlengths 5
115
| size
int64 590
5.01M
| file_path
stringlengths 4
212
| content
stringlengths 590
5.01M
|
|---|---|---|---|
0xffea/MINIX3
| 2,804
|
lib/libc/arch/m68k/sys/cerror.S
|
/* $NetBSD: cerror.S,v 1.15 2009/10/03 22:28:33 phx Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)cerror.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: cerror.S,v 1.15 2009/10/03 22:28:33 phx Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
#ifdef _REENTRANT
.globl _C_LABEL(__errno)
#else
.globl _C_LABEL(errno)
#endif
_ENTRY(CERROR)
#ifdef _REENTRANT
movl %d0,%sp@-
#if defined(PIC) && !defined(__ELF__)
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),%a0
lea %pc@(0,%a0:l),%a0
movl %a0@(_C_LABEL(__errno):l),%a0
jsr %a0@
#else
jbsr PIC_PLT(_C_LABEL(__errno))
#endif
#ifndef __SVR4_ABI__
movl %d0,%a0
#endif
movl %sp@+,%a0@
#else
#ifdef PIC
#ifdef __ELF__
lea %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),%a0
movl %a0@(_C_LABEL(errno)@GOT:w),%a0
#else
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),%a0
lea %pc@(0,a0:l),%a0
movl %a0@(_C_LABEL(errno):w),%a0
#endif
movl %d0,%a0@
#else
movl %d0,_C_LABEL(errno)
#endif
#endif /* _REENTRANT */
movl #-1,%d0
movl #-1,%d1
#ifdef __SVR4_ABI__
movl %d0,%a0
#endif
rts
|
0xffea/MINIX3
| 2,155
|
lib/libc/arch/m68k/sys/fork.S
|
/* $NetBSD: fork.S,v 1.7 2003/08/07 16:42:14 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)fork.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: fork.S,v 1.7 2003/08/07 16:42:14 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
_SYSCALL(__fork,fork)
subql #1,%d1 /* from 1 to 0 in child, 0 to -1 in parent */
andl %d1,%d0
rts /* pid = fork() */
|
0xffea/MINIX3
| 2,169
|
lib/libc/arch/m68k/sys/pipe.S
|
/* $NetBSD: pipe.S,v 1.6 2003/08/07 16:42:14 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)pipe.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: pipe.S,v 1.6 2003/08/07 16:42:14 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
#ifdef WEAK_ALIAS
WEAK_ALIAS(pipe, _pipe)
#endif
_SYSCALL(_pipe,pipe)
movl %sp@(4),%a0
movl %d0,%a0@+
movl %d1,%a0@
clrl %d0
rts
|
0xffea/MINIX3
| 2,126
|
lib/libc/arch/m68k/sys/__sigtramp2.S
|
/* $NetBSD: __sigtramp2.S,v 1.2 2008/05/02 18:34:17 martin Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
/*
* The m68k signal trampoline is invoked only to return from
* the signal; the kernel calls the signal handler directly.
*
* On entry, stack looks like:
*
* ucontext structure [12+sizeof(siginfo_t)]
* siginfo structure [12]
* pointer to ucontext structure [8]
* pointer to siginfo structure [4]
* sp-> signal number [0]
*/
ENTRY_NOPROFILE(__sigtramp_siginfo_2)
movl %sp@(8),%a0 /* get pointer to ucontext */
movl %a0,%sp@(4) /* put it in the argument slot */
/* fake return address already there */
movl #SYS_setcontext,%d0
trap #0
movl %d0,%sp@(4) /* error code */
SYSTRAP(exit) /* exit */
|
0xffea/MINIX3
| 1,535
|
lib/libc/arch/m68k/sys/mremap.S
|
/* $NetBSD: mremap.S,v 1.2 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
SYSCALL(mremap)
#ifdef __SVR4_ABI__
movl %d0,%a0
#endif
rts
|
0xffea/MINIX3
| 2,636
|
lib/libc/arch/m68k/sys/sbrk.S
|
/* $NetBSD: sbrk.S,v 1.14 2003/08/07 16:42:14 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)sbrk.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: sbrk.S,v 1.14 2003/08/07 16:42:14 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
.globl _end
.globl CURBRK
#ifdef WEAK_ALIAS
WEAK_ALIAS(sbrk, _sbrk)
#endif
.data
CURBRK: .long _end
.text
ENTRY(_sbrk)
#ifdef PIC
#ifdef __ELF__
lea %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),%a1
movl %a1@(CURBRK@GOT:w),%a1
#else
movl #_C_LABEL(_GLOBAL_OFFSET_TABLE_),%a1
lea %pc@(0,%a1:l),%a1
movl %a1@(CURBRK:w),%a1
#endif
movl %a1@,%d0
#else
movl CURBRK,%d0
#endif
addl %d0,%sp@(4)
movl #SYS_break,%d0
trap #0
jcs err
#ifdef PIC
movl %a1@,%d0
movl %sp@(4),%a1@
#else
movl CURBRK,%d0
movl %sp@(4),CURBRK
#endif
#ifdef __SVR4_ABI__
movl %d0,%a0
#endif
rts
err:
jra PIC_PLT(CERROR)
|
0xffea/MINIX3
| 1,993
|
lib/libc/arch/m68k/sys/getcontext.S
|
/* $NetBSD: getcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: getcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $")
#endif /* SYSLIBC_SCCS && !lint */
#ifdef WEAK_ALIAS
WEAK_ALIAS(getcontext, _getcontext)
#endif
_SYSCALL(_getcontext,getcontext)
movl %sp@(4),%a0
addql #4,%a0@(96) | adjust saved stack pointer
movl %sp@,%a0@(100) | adjust saved program counter
clrl %a0@(36) | arrange for return value of 0
rts
|
0xffea/MINIX3
| 1,541
|
lib/libc/arch/m68k/sys/__mmap.S
|
/* $NetBSD: __mmap.S,v 1.2 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
_SYSCALL(__mmap,mmap)
#ifdef __SVR4_ABI__
movl %d0,%a0
#endif
rts
|
0xffea/MINIX3
| 1,967
|
lib/libc/arch/m68k/quad/ashrdi3.S
|
/* $NetBSD: ashrdi3.S,v 1.4 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by J.T. Conklin.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
| d0 msw
| d1 lsw
| d2 shift
| d3 offset (32 - shift)
ENTRY(__ashrdi3)
link %a6,#0
moveml %d2-%d4,%sp@-
movel %a6@(8),%d0
movel %a6@(12),%d1
movel %a6@(16),%d2
moveq #32,%d3
subl %d2,%d3
jgt L2
negl %d3
movel %d0,%d1
asrl %d3,%d1
smi %d0
extbl %d0
jra L3
L2: lsrl %d2,%d1
movel %d0,%d4
asll %d3,%d4
orl %d4,%d1
asrl %d2,%d0
L3: moveml %a6@(-12),%d2-%d4
unlk %a6
rts
|
0xffea/MINIX3
| 1,957
|
lib/libc/arch/m68k/quad/lshrdi3.S
|
/* $NetBSD: lshrdi3.S,v 1.5 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by J.T. Conklin.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
| d0 msw
| d1 lsw
| d2 shift
| d3 offset (32 - shift)
ENTRY(__lshrdi3)
link %a6,#0
moveml %d2-%d4,%sp@-
movel %a6@(8),%d0
movel %a6@(12),%d1
movel %a6@(16),%d2
moveq #32,%d3
subl %d2,%d3
jgt L2
negl %d3
movel %d0,%d1
lsrl %d3,%d1
clrl %d0
jra L3
L2: lsrl %d2,%d1
movel %d0,%d4
asll %d3,%d4
orl %d4,%d1
lsrl %d2,%d0
L3: moveml %a6@(-12),%d2-%d4
unlk %a6
rts
|
0xffea/MINIX3
| 1,957
|
lib/libc/arch/m68k/quad/ashldi3.S
|
/* $NetBSD: ashldi3.S,v 1.4 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by J.T. Conklin.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
| d0 msw
| d1 lsw
| d2 shift
| d3 offset (32 - shift)
ENTRY(__ashldi3)
link %a6,#0
moveml %d2-%d4,%sp@-
movel %a6@(8),%d0
movel %a6@(12),%d1
movel %a6@(16),%d2
moveq #32,%d3
subl %d2,%d3
jgt L2
negl %d3
movel %d1,%d0
asll %d3,%d0
clrl %d1
jra L3
L2: asll %d2,%d0
movel %d1,%d4
lsrl %d3,%d4
orl %d4,%d0
asll %d2,%d1
L3: moveml %a6@(-12),%d2-%d4
unlk %a6
rts
|
0xffea/MINIX3
| 2,213
|
lib/libc/arch/m68k/gen/divdf3.S
|
/* $NetBSD: divdf3.S,v 1.6 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)divdf3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: divdf3.S,v 1.6 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* double / double */
ENTRY(__divdf3)
fmoved %sp@(4),%fp0
fdivd %sp@(12),%fp0
#ifndef __SVR4_ABI__
fmoved %fp0,%sp@-
movel %sp@+,%d0
movel %sp@+,%d1
#endif
rts
|
0xffea/MINIX3
| 2,141
|
lib/libc/arch/m68k/gen/ashrsi3.S
|
/* $NetBSD: ashrsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)ashrsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: ashrsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* int >> int */
ENTRY(__ashrsi3)
movel %sp@(8),%d1
movel %sp@(4),%d0
asrl %d1,%d0
rts
|
0xffea/MINIX3
| 2,141
|
lib/libc/arch/m68k/gen/ashlsi3.S
|
/* $NetBSD: ashlsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)ashlsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: ashlsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* int << int */
ENTRY(__ashlsi3)
movel %sp@(8),%d1
movel %sp@(4),%d0
asll %d1,%d0
rts
|
0xffea/MINIX3
| 2,176
|
lib/libc/arch/m68k/gen/mulsf3.S
|
/* $NetBSD: mulsf3.S,v 1.6 2003/08/07 16:42:11 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)mulsf3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: mulsf3.S,v 1.6 2003/08/07 16:42:11 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* single * single */
ENTRY(__mulsf3)
fmoves %sp@(4),%fp0
fmuls %sp@(8),%fp0
#ifndef __SVR4_ABI__
fmoves %fp0,%d0
#endif
rts
|
0xffea/MINIX3
| 2,320
|
lib/libc/arch/m68k/gen/modf.S
|
/* $NetBSD: modf.S,v 1.6 2003/08/07 16:42:11 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)modf.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: modf.S,v 1.6 2003/08/07 16:42:11 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/*
* double modf(val, iptr)
* returns: xxx and n (in *iptr) where val == n.xxx
*/
ENTRY(modf)
fmoved %sp@(4),%fp0
movel %sp@(12),%a0
fintrzx %fp0,%fp1
fmoved %fp1,%a0@
fsubx %fp1,%fp0
#ifndef __SVR4_ABI__
fmoved %fp0,%sp@-
movel %sp@+,%d0
movel %sp@+,%d1
#endif
rts
|
0xffea/MINIX3
| 2,211
|
lib/libc/arch/m68k/gen/extendsfdf2.S
|
/* $NetBSD: extendsfdf2.S,v 1.6 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)extendsfdf2.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: extendsfdf2.S,v 1.6 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* (double) float */
ENTRY(__extendsfdf2)
fmoves %sp@(4),%fp0
#ifndef __SVR4_ABI__
fmoved %fp0,%sp@-
movel %sp@+,%d0
movel %sp@+,%d1
#endif
rts
|
0xffea/MINIX3
| 2,202
|
lib/libc/arch/m68k/gen/floatsidf.S
|
/* $NetBSD: floatsidf.S,v 1.6 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)floatsidf.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: floatsidf.S,v 1.6 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* (double) int */
ENTRY(__floatsidf)
fmovel %sp@(4),%fp0
#ifndef __SVR4_ABI__
fmoved %fp0,%sp@-
movel %sp@+,%d0
movel %sp@+,%d1
#endif
rts
|
0xffea/MINIX3
| 2,213
|
lib/libc/arch/m68k/gen/muldf3.S
|
/* $NetBSD: muldf3.S,v 1.7 2003/08/07 16:42:11 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)muldf3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: muldf3.S,v 1.7 2003/08/07 16:42:11 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* double * double */
ENTRY(__muldf3)
fmoved %sp@(4),%fp0
fmuld %sp@(12),%fp0
#ifndef __SVR4_ABI__
fmoved %fp0,%sp@-
movel %sp@+,%d0
movel %sp@+,%d1
#endif
rts
|
0xffea/MINIX3
| 3,379
|
lib/libc/arch/m68k/gen/setjmp.S
|
/* $NetBSD: setjmp.S,v 1.12 2006/03/09 16:20:27 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)setjmp.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: setjmp.S,v 1.12 2006/03/09 16:20:27 christos Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/*
* C library -- setjmp, longjmp
*
* longjmp(a,v)
* will generate a "return(v)" from
* the last call to
* setjmp(a)
* by restoring registers from the stack,
* and a struct sigcontext, see <signal.h>
*/
ENTRY(__setjmp14)
/* Get signal stack info. Note overlay of ss_sp and ss_size! */
lea %sp@(-12),%sp /* sizeof(stack_t) */
clrl %sp@ /* ss = NULL */
movl %sp,%sp@(4) /* oss = stack_t on stack */
jbsr PIC_PLT(_C_LABEL(__sigaltstack14))
movl %sp@(8),%d0 /* ss_flags */
andl #1,%d0 /* extract SS_ONSTACK */
lea %sp@(12),%sp /* pop stack_t */
/* Get pointer to jmp_buf; a sigcontext is at the beginning. */
movl %sp@(4),%a0
movl %d0,%a0@ /* store onstack */
clrl %a0@(4) /* unused word (old style signal mask) */
/* Get the signal mask. */
pea %a0@(28) /* oset = &sc.sc_mask */
movl #0,%sp@- /* set = NULL */
movl #0,%sp@- /* action = 0 <ignored> */
jbsr PIC_PLT(_C_LABEL(__sigprocmask14))
addl #12,%sp
movl %sp@(4),%a0 /* get jmp_buf pointer again */
lea %sp@(4),%a1 /* adjust SP since we won't rts */
movl %a1,%a0@(8) /* save SP */
movl %a6,%a0@(12) /* save FP */
clrl %a0@(16) /* no AP */
movl %sp@,%a0@(20) /* save return PC */
clrl %a0@(24) /* clear PS */
/* Save remaining non-scratch regs after signal mask. */
moveml #0x3CFC,%a0@(44)
clrl %d0 /* return 0 */
rts
|
0xffea/MINIX3
| 2,176
|
lib/libc/arch/m68k/gen/addsf3.S
|
/* $NetBSD: addsf3.S,v 1.6 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)addsf3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: addsf3.S,v 1.6 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* single + single */
ENTRY(__addsf3)
fmoves %sp@(4),%fp0
fadds %sp@(8),%fp0
#ifndef __SVR4_ABI__
fmoves %fp0,%d0
#endif
rts
|
0xffea/MINIX3
| 2,128
|
lib/libc/arch/m68k/gen/swapcontext.S
|
/* $NetBSD: swapcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: swapcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $")
#endif /* LIBC_SCCS && !lint */
ENTRY(swapcontext)
movl %sp@(4),%sp@- | push oucp on stack
jbsr PIC_PLT(_C_LABEL(_getcontext)) | getcontext(oucp)
tstl %d0 | OK?
jne L1
movl %sp@,%a0
addql #8,%a0@(96) | adjust saved stack pointer (again)
movl %sp@(4),%a0@(100) | adjust saved program counter (again)
movl %sp@(12),%sp@ | push ucp on stack
jbsr PIC_PLT(_C_LABEL(setcontext)) | setcontext(ucp)
L1: addql #4,%sp | pop ucp
rts
|
0xffea/MINIX3
| 2,151
|
lib/libc/arch/m68k/gen/lshrsi3.S
|
/* $NetBSD: lshrsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)lshrsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: lshrsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* unsigned >> unsigned */
ENTRY(__lshrsi3)
movel %sp@(8),%d1
movel %sp@(4),%d0
lsrl %d1,%d0
rts
|
0xffea/MINIX3
| 2,171
|
lib/libc/arch/m68k/gen/truncdfsf2.S
|
/* $NetBSD: truncdfsf2.S,v 1.6 2003/08/07 16:42:11 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)truncdfsf2.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: truncdfsf2.S,v 1.6 2003/08/07 16:42:11 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* (float) double */
ENTRY(__truncdfsf2)
fmoved %sp@(4),%fp0
#ifndef __SVR4_ABI__
fmoves %fp0,%d0
#endif
rts
|
0xffea/MINIX3
| 2,262
|
lib/libc/arch/m68k/gen/fixunsdfsi.S
|
/* $NetBSD: fixunsdfsi.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)fixunsdfsi.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: fixunsdfsi.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* (unsigned) double */
ENTRY(__fixunsdfsi)
fintrzd %sp@(4),%fp0
fcmpd #0r2147483648.0,%fp0
fbge Lwaybig
fmovel %fp0,%d0
rts
Lwaybig:
fsubd #0r2147483648.0,%fp0
fmovel %fp0,%d0
bset #31,%d0
rts
|
0xffea/MINIX3
| 2,176
|
lib/libc/arch/m68k/gen/divsf3.S
|
/* $NetBSD: divsf3.S,v 1.6 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)divsf3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: divsf3.S,v 1.6 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* single / single */
ENTRY(__divsf3)
fmoves %sp@(4),%fp0
fdivs %sp@(8),%fp0
#ifndef __SVR4_ABI__
fmoves %fp0,%d0
#endif
rts
|
0xffea/MINIX3
| 2,151
|
lib/libc/arch/m68k/gen/lshlsi3.S
|
/* $NetBSD: lshlsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)lshlsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: lshlsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* unsigned << unsigned */
ENTRY(__lshlsi3)
movel %sp@(8),%d1
movel %sp@(4),%d0
lsll %d1,%d0
rts
|
0xffea/MINIX3
| 2,200
|
lib/libc/arch/m68k/gen/negsf2.S
|
/* $NetBSD: negsf2.S,v 1.7 2003/08/07 16:42:11 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID"from: @(#)negsf2.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: negsf2.S,v 1.7 2003/08/07 16:42:11 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* -single */
ENTRY(__negsf2)
#if defined(__SVR4_ABI__) && defined(__HAVE_68881__)
fnegs %sp@(4),%fp0
#else
movel %sp@(4),%d0
bchg #31,%d0
#endif
rts
|
0xffea/MINIX3
| 2,246
|
lib/libc/arch/m68k/gen/cmpdf2.S
|
/* $NetBSD: cmpdf2.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)cmpdf2.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: cmpdf2.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* double > double: 1 */
/* double < double: -1 */
/* double == double: 0 */
ENTRY(__cmpdf2)
fmoved %sp@(4),%fp0
fcmpd %sp@(12),%fp0
fbgt Lagtb
fslt %d0
extbl %d0
rts
Lagtb:
moveq #1,%d0
rts
|
0xffea/MINIX3
| 2,245
|
lib/libc/arch/m68k/gen/cmpsf2.S
|
/* $NetBSD: cmpsf2.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)cmpsf2.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: cmpsf2.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* single > single: 1 */
/* single < single: -1 */
/* single == single: 0 */
ENTRY(__cmpsf2)
fmoves %sp@(4),%fp0
fcmps %sp@(8),%fp0
fbgt Lagtb
fslt %d0
extbl %d0
rts
Lagtb:
moveq #1,%d0
rts
|
0xffea/MINIX3
| 2,213
|
lib/libc/arch/m68k/gen/subdf3.S
|
/* $NetBSD: subdf3.S,v 1.6 2003/08/07 16:42:11 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)subdf3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: subdf3.S,v 1.6 2003/08/07 16:42:11 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* double - double */
ENTRY(__subdf3)
fmoved %sp@(4),%fp0
fsubd %sp@(12),%fp0
#ifndef __SVR4_ABI__
fmoved %fp0,%sp@-
movel %sp@+,%d0
movel %sp@+,%d1
#endif
rts
|
0xffea/MINIX3
| 3,164
|
lib/libc/arch/m68k/gen/_setjmp.S
|
/* $NetBSD: _setjmp.S,v 1.7 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)_setjmp.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: _setjmp.S,v 1.7 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/*
* C library -- _setjmp, _longjmp
*
* _longjmp(a,v)
* will generate a "return(v)" from
* the last call to
* _setjmp(a)
* by restoring registers from the stack,
* The previous signal state is NOT restored.
*/
ENTRY(_setjmp)
movl %sp@(4),%a0 /* save area pointer */
clrl %a0@+ /* no old onstack */
clrl %a0@+ /* no old sigmask */
movl %sp,%a0@+ /* save old SP */
movl %a6,%a0@+ /* save old FP */
clrl %a0@+ /* no old AP */
movl %sp@,%a0@+ /* save old PC */
clrl %a0@+ /* clear PS */
moveml #0x3CFC,%a0@ /* save other non-scratch regs */
clrl %d0 /* return zero */
rts
ENTRY(_longjmp)
movl %sp@(4),%a0 /* save area pointer */
addql #8,%a0 /* skip onstack/sigmask */
tstl %a0@ /* ensure non-zero SP */
jeq botch /* oops! */
movl %sp@(8),%d0 /* grab return value */
jne ok /* non-zero ok */
moveq #1,%d0 /* else make non-zero */
ok:
movl %a0@+,%sp /* restore SP */
movl %a0@+,%a6 /* restore FP */
addql #4,%a0 /* skip AP */
movl %a0@+,%sp@ /* restore PC */
moveml %a0@(4),#0x3CFC /* restore non-scratch regs */
rts
botch:
jbsr PIC_PLT(_C_LABEL(longjmperror))
stop #0
|
0xffea/MINIX3
| 2,136
|
lib/libc/arch/m68k/gen/umulsi3.S
|
/* $NetBSD: umulsi3.S,v 1.5 2003/08/07 16:42:12 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)umulsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: umulsi3.S,v 1.5 2003/08/07 16:42:12 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* unsigned * unsigned */
ENTRY(__umulsi3)
movel %sp@(4),%d0
mulul %sp@(8),%d0
rts
|
0xffea/MINIX3
| 2,220
|
lib/libc/arch/m68k/gen/negdf2.S
|
/* $NetBSD: negdf2.S,v 1.7 2003/08/07 16:42:11 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)negdf2.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: negdf2.S,v 1.7 2003/08/07 16:42:11 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* -double */
ENTRY(__negdf2)
#if defined(__SVR4_ABI__) && defined(__HAVE_68881__)
fnegd %sp@(4),%fp0
#else
movel %sp@(4),%d0
movel %sp@(8),%d1
bchg #31,%d0
#endif
rts
|
0xffea/MINIX3
| 2,508
|
lib/libc/arch/m68k/gen/alloca.S
|
/* $NetBSD: alloca.S,v 1.6 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)alloca.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: alloca.S,v 1.6 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* like alloc, but automatic free in return */
ENTRY(alloca)
movl %sp@,%a1 /* save return addr */
movl %sp,%d0 /* get current SP value */
subl %sp@(4),%d0 /* allocate requested space */
andb #~3,%d0 /* longword align for efficiency */
addql #8,%d0 /* reuse space of call frame */
movl %d0,%sp /* set new SP value */
lea %sp@(-4),%sp /* account for argument pop in caller */
#ifdef __SVR4_ABI__
moveal %d0,%a0
#endif
jmp %a1@ /* funny return */
|
0xffea/MINIX3
| 2,385
|
lib/libc/arch/m68k/gen/resumecontext.S
|
/* $NetBSD: resumecontext.S,v 1.5 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: resumecontext.S,v 1.5 2008/04/28 20:22:56 martin Exp $")
#endif /* LIBC_SCCS && !lint */
/*
* This assembly-language implementation differs from the (obvious)
* C-language implementation only in not clobbering the previous
* function's return address (us), which is the point of the exercise.
*/
ENTRY(_resumecontext)
subl #(4 + 1024),%sp /* retaddr preservation + ucontext_t */
lea %sp@,%a0
movl %a0,%sp@-
jbsr PIC_PLT(_C_LABEL(_getcontext))
movl %sp@(4 + 4),%sp@ /* uc_link */
tstl %sp@ /* check for NULL */
jne 1f
jbsr PIC_PLT(_C_LABEL(exit)) /* cleanly exit(0) */
jmp 2f
1: jbsr PIC_PLT(_C_LABEL(setcontext))
/* NOTREACHED */
/* But just in case... */
2: movl #-1,%sp@
jbsr PIC_PLT(_C_LABEL(_exit))
/* NOTREACHED */
|
0xffea/MINIX3
| 2,813
|
lib/libc/arch/m68k/gen/sigsetjmp.S
|
/* $NetBSD: sigsetjmp.S,v 1.8 2006/03/09 16:20:27 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)_setjmp.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: sigsetjmp.S,v 1.8 2006/03/09 16:20:27 christos Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/*
* C library -- sigsetjmp, siglongjmp
*
* siglongjmp(a,v)
* will generate a "return(v)" from
* the last call to
* sigsetjmp(a,m)
* by restoring registers from the stack,
* The previous signal state is restored if 'm' was non-zero.
*/
/* grab _JBLEN */
#include <m68k/setjmp.h>
ENTRY(__sigsetjmp14)
movl %sp@(8),%d1 /* grab the mask */
movl %sp@(4),%a0 /* grab the area pointer */
movl %d1,%a0@(_JBLEN * 4) /* save at end of area */
tstl %d1
bne dosig
jra PIC_PLT(_C_LABEL(_setjmp))
dosig:
jra PIC_PLT(_C_LABEL(__setjmp14))
ENTRY(__siglongjmp14)
movl %sp@(4),%a0 /* save area pointer */
tstl %a0@(_JBLEN * 4) /* check mask... */
bne didsig
jra PIC_PLT(_C_LABEL(_longjmp))
didsig:
jra PIC_PLT(_C_LABEL(__longjmp14))
|
0xffea/MINIX3
| 2,130
|
lib/libc/arch/m68k/gen/fixdfsi.S
|
/* $NetBSD: fixdfsi.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)fixdfsi.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: fixdfsi.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* (int) double */
ENTRY(__fixdfsi)
fintrzd %sp@(4),%fp0
fmovel %fp0,%d0
rts
|
0xffea/MINIX3
| 2,213
|
lib/libc/arch/m68k/gen/adddf3.S
|
/* $NetBSD: adddf3.S,v 1.6 2003/08/07 16:42:10 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)adddf3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: adddf3.S,v 1.6 2003/08/07 16:42:10 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* double + double */
ENTRY(__adddf3)
fmoved %sp@(4),%fp0
faddd %sp@(12),%fp0
#ifndef __SVR4_ABI__
fmoved %fp0,%sp@-
movel %sp@+,%d0
movel %sp@+,%d1
#endif
rts
|
0xffea/MINIX3
| 1,802
|
lib/libc/arch/m68k/gen/fabs.S
|
/* $NetBSD: fabs.S,v 1.8 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
RCSID("$NetBSD: fabs.S,v 1.8 2008/04/28 20:22:56 martin Exp $")
ENTRY(fabs)
#if defined(__SVR4_ABI__) && defined(__HAVE_68881__)
bclr #31,%sp@(4)
fmoved %sp@(4),%fp0
#else
movl %sp@(4),%d0
movl %sp@(8),%d1
bclr #31,%d0
#endif
rts
|
0xffea/MINIX3
| 2,176
|
lib/libc/arch/m68k/gen/subsf3.S
|
/* $NetBSD: subsf3.S,v 1.6 2003/08/07 16:42:11 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)subsf3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: subsf3.S,v 1.6 2003/08/07 16:42:11 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* single - single */
ENTRY(__subsf3)
fmoves %sp@(4),%fp0
fsubs %sp@(8),%fp0
#ifndef __SVR4_ABI__
fmoves %fp0,%d0
#endif
rts
|
0xffea/MINIX3
| 2,964
|
lib/libc/arch/m68k/string/memccpy.S
|
/* $NetBSD: memccpy.S,v 1.1 2001/02/05 00:17:22 scottr Exp $ */
/*
* Copyright (C) 1999 Scott Reynolds. 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: memccpy.S,v 1.1 2001/02/05 00:17:22 scottr Exp $")
#endif /* LIBC_SCCS and not lint */
ENTRY(memccpy)
movl %sp@(16),%d0 | count
jeq Lmcbail | nothing to do
movl %sp@(4),%a0 | a0 = toaddr
subql #1,%d0 | prepare count for DBcc loop
movl %sp@(8),%a1 | a1 = fromaddr
movl %sp@(12),%d1 | d1 = terminator
jeq Lmcloop | handle ASCII NUL specially
movl %d2,%sp@- | save scratch register
Lmcnzloop:
movb %a1@+,%d2 | move a byte
movb %d2,%a0@+
cmpb %d2,%d1 | found the terminator?
dbeq %d0,Lmcnzloop | if not, keep transferring,
jeq Lmcnzdone | otherwise done
clrw %d0 | check to see if more to do
subql #1,%d0
jcc Lmcnzloop | yes, keep going...
movl %sp@+,%d2 | restore scratch register
movql #0,%d0 | no terminator found, return NULL
#ifdef __SVR4_ABI__
movl %d0,%a0 | XXX maybe use lea to avoid stall?
#endif
rts
Lmcloop:
movb %a1@+,%a0@+ | move a byte; was it NUL?
dbeq %d0,Lmcloop | if not, keep transferring,
jeq Lmcdone | otherwise done
clrw %d0 | check to see if more to do
subql #1,%d0
jcc Lmcloop | yes, keep going...
| Note: %d0 is now -1!
movql #0,%d0 | no terminator found, return NULL
Lmcbail:
#ifdef __SVR4_ABI__
movl %d0,%a0 | XXX maybe use lea to avoid stall?
#endif
rts
Lmcnzdone:
movl %sp@+,%d2 | restore scratch register
Lmcdone:
movl %a0,%d0
rts
|
0xffea/MINIX3
| 2,211
|
lib/libc/arch/m68k/stdlib/abs.S
|
/* $NetBSD: abs.S,v 1.6 2003/08/07 16:42:12 agc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)abs.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: abs.S,v 1.6 2003/08/07 16:42:12 agc Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* labs - long int absolute value */
ENTRY_NOPROFILE(labs)
/* fall through to: */
/* abs - int absolute value */
ENTRY(abs)
movl %sp@(4),%d0
jge L1
negl %d0
L1:
rts
|
0xffea/MINIX3
| 2,300
|
lib/libc/arch/m68k/stdlib/llabs.S
|
/* $NetBSD: llabs.S,v 1.4 2008/08/04 21:29:28 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)abs.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: llabs.S,v 1.4 2008/08/04 21:29:28 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
#ifdef WEAK_ALIAS
WEAK_ALIAS(llabs, _llabs)
WEAK_ALIAS(imaxabs, _llabs)
#endif
/* llabs - long long int absolute value */
#ifdef WEAK_ALIAS
ENTRY(_llabs)
#else
ENTRY(llabs)
#endif
movl %sp@(8),%d1
movl %sp@(4),%d0
jge L1
negl %d1
negxl %d0
L1:
rts
|
0xffea/MINIX3
| 2,257
|
lib/libc/arch/i386/sys-minix/_ipc.S
|
#include <minix/ipcconst.h>
#include <machine/asm.h>
SRC_DST = 8 /* source/ destination process */
MESSAGE = 12 /* message pointer */
STATUS = 16 /* status pointer */
/**========================================================================* */
/* IPC assembly routines * */
/**========================================================================* */
/* all message passing routines save ebx, but destroy eax and ecx. */
ENTRY(_send_orig)
push %ebp
movl %esp, %ebp
push %ebx
movl SRC_DST(%ebp), %eax /* eax = dest-src */
movl MESSAGE(%ebp), %ebx /* ebx = message pointer */
movl $SEND, %ecx /* _send(dest, ptr) */
int $IPCVEC_ORIG /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_receive_orig)
push %ebp
movl %esp, %ebp
push %ebx
movl SRC_DST(%ebp), %eax /* eax = dest-src */
movl MESSAGE(%ebp), %ebx /* ebx = message pointer */
movl $RECEIVE, %ecx /* _receive(src, ptr) */
int $IPCVEC_ORIG /* trap to the kernel */
movl STATUS(%ebp), %ecx /* ecx = status pointer */
movl %ebx, (%ecx)
pop %ebx
pop %ebp
ret
ENTRY(_sendrec_orig)
push %ebp
movl %esp, %ebp
push %ebx
movl SRC_DST(%ebp), %eax /* eax = dest-src */
movl MESSAGE(%ebp), %ebx /* ebx = message pointer */
movl $SENDREC, %ecx /* _sendrec(srcdest, ptr) */
int $IPCVEC_ORIG /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_minix_kernel_info_struct)
push %ebp
movl %esp, %ebp
push %ebx
movl $0, %eax
movl $0, %ebx
movl $MINIX_KERNINFO, %ecx
int $IPCVEC_ORIG /* trap to the kernel */
movl 8(%ebp), %ecx /* ecx = return struct ptr */
movl %ebx, (%ecx)
pop %ebx
pop %ebp
ret
ENTRY(_notify_orig)
push %ebp
movl %esp, %ebp
push %ebx
movl SRC_DST(%ebp), %eax /* eax = destination */
movl $NOTIFY, %ecx /* _notify(srcdst) */
int $IPCVEC_ORIG /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_sendnb_orig)
push %ebp
movl %esp, %ebp
push %ebx
movl SRC_DST(%ebp), %eax /* eax = dest-src */
movl MESSAGE(%ebp), %ebx /* ebx = message pointer */
movl $SENDNB, %ecx /* _sendnb(dest, ptr) */
int $IPCVEC_ORIG /* trap to the kernel */
pop %ebx
pop %ebp
ret
ENTRY(_do_kernel_call_orig)
/* pass the message pointer to kernel in the %eax register */
movl 4(%esp), %eax
int $KERVEC_ORIG
ret
|
0xffea/MINIX3
| 5,387
|
lib/libc/arch/i386/sys-minix/ucontext.S
|
#include <machine/asm.h>
#include <ucontextoffsets.h>
#ifdef __ACK__
.text
begtext:
#ifdef __ACK__
.rom
#else
.data
#endif
begrom:
.data
begdata:
.bss
begbss:
#endif
IMPORT(getuctx)
IMPORT(setuctx)
IMPORT(resumecontext)
/* MCF_MAGIC value from <mcontext.h> */
#define MCF_MAGIC 0xc0ffee
/* Values from <sys/ucontext.h> */
#define UCF_IGNFPU 0x002
#define UCF_IGNSIGM 0x004
/* EINVAL from errno.h */
#define EFAULT 14
#define EINVAL 22
/* int getcontext(ucontext_t *ucp)
* Initialise the structure pointed to by ucp to the current user context
* of the calling thread. */
ENTRY(getcontext)
/* In case a process does not use the FPU and is neither interested in
* saving its signal mask, then we can skip the context switch to
* PM and kernel altogether and only save general-purpose registers. */
mov (%esp), %ecx /* Save return address:
* When setcontext or swapcontext is called,
* we jump to this address and continue
* running. */
mov 4(%esp), %edx /* edx = ucp */
/* Check null pointer */
cmp $0, %edx /* edx == NULL? */
jne 3f /* Not null, continue */
movl $EFAULT, (_C_LABEL(errno))
xor %eax, %eax
dec %eax /* return -1 */
ret
3: /* Check flags */
push %ecx /* save ecx */
push %ebx /* save ebx */
lea UC_FLAGS(%edx), %ebx /* ebx = &(ucp->uc_flags) */
mov (%ebx), %ecx /* ecx = ucp->uc_flags */
mov $UCF_IGNFPU, %eax
or $UCF_IGNSIGM, %eax
cmp %eax, %ecx /* is UCF_IGNFPU or UCF_IGNSIGM set? */
pop %ebx /* restore ebx */
pop %ecx /* restore ecx */
jz 1f /* Both are set, skip getuctx */
0:
push %ecx /* Save ecx */
push %edx
call _C_LABEL(getuctx) /* getuctx(ucp) */
pop %edx /* clean up stack and restore edx */
pop %ecx /* Restore ecx */
1:
/* Save the context */
mov 4(%esp), %edx /* edx = ucp */
pop %eax /* retaddr */
mov %eax, PC(%edx) /* Save real RTA in mcp struct */
mov %esp, SP(%edx) /* Save stack pointer (now pointing to ucp) */
/* Save GP registers */
mov %ebp, BP(%edx) /* Save EBP */
mov %esi, SI(%edx) /* Save ESI */
mov %edi, DI(%edx) /* Save EDI */
mov %ebx, BX(%edx) /* Save EBX */
mov %ecx, CX(%edx) /* Save ECX */
movl $MCF_MAGIC, MAGIC(%edx) /* Set magic value */
push %eax /* Restore retaddr */
xor %eax, %eax /* Return 0 */
2:
add $4, %esp /* Remove stale (setcontext) RTA */
jmp *%ecx /* Restore return address */
/* int setcontext(const ucontext_t *ucp)
* Restore the user context pointed to by ucp. A successful call to
* setcontext does not return; program execution resumes at the point
* specified by the ucp argument. If ucp was created with getcontext(),
* program execution continues as if the corresponding call of getcontext()
* had just returned. If ucp was created with makecontext(), program
* execution continues with the function passed to makecontext(). */
ENTRY(setcontext)
/* In case a process does not use the FPU and is neither interested in
* restoring its signal mask, then we can skip the context switch to
* PM and kernel altogether and restore state here. */
mov 4(%esp), %edx /* edx = ucp */
/* Check null pointer */
cmp $0, %edx /* edx == NULL? */
jnz 3f /* Not null, continue */
movl $EFAULT, (_C_LABEL(errno))
xor %eax, %eax
dec %eax /* return -1 */
ret
3: /* Check flags */
push %ebx /* save ebx */
lea MAGIC(%edx), %ebx /* ebx = &(ucp->mc_context.mc_magic) */
mov (%ebx), %ecx /* ecx = ucp->mc_context.mc_magic */
pop %ebx /* restore ebx */
cmp $MCF_MAGIC, %ecx /* is the magic value set (is context valid)?*/
jz 4f /* is set, proceed */
movl $EINVAL, (_C_LABEL(errno)) /* not set, return error code */
xor %eax, %eax
dec %eax /* return -1 */
ret
4: push %ebx /* save ebx */
lea UC_FLAGS(%edx), %ebx /* ebx = &(ucp->uc_flags) */
mov (%ebx), %ecx /* ecx = ucp->uc_flags */
pop %ebx /* restore ebx */
mov $UCF_IGNFPU, %eax
or $UCF_IGNSIGM, %eax
cmp %eax, %ecx /* Are UCF_IGNFPU and UCF_IGNSIGM flags set? */
jz 1f /* Both are set, so don't bother restoring FPU
* state and signal mask */
0: push %ecx /* Save ecx */
push %edx
call _C_LABEL(setuctx) /* setuctx(ucp) */
pop %edx /* Clean up stack and restore edx */
pop %ecx /* Restore ecx */
1: /* Restore the registers */
mov 4(%esp), %edx /* edx = ucp */
mov CX(%edx), %ecx /* Restore ECX */
mov BX(%edx), %ebx /* Restore EBX */
mov DI(%edx), %edi /* Restore EDI */
mov SI(%edx), %esi /* Restore ESI */
mov BP(%edx), %ebp /* Restore EBP */
mov SP(%edx), %esp /* Restore stack pointer */
2:
jmp *PC(%edx) /* Push RTA onto stack so we can return to it */
/* void ctx_start((void *func)(int arg1, ..., argn), arg1, ..., argn,
* ucontext_t *ucp)
* A wrapper to start function `func'. ESI register will contain a pointer
* to ucp on the stack. By setting ESP to ESI, we effectively 'remove' all
* arguments to `func' from the stack. Finally, a call to resumecontext
* will start the next context in the linked list (or exit the program if
* there is no context). */
ENTRY(ctx_start)
/* 0(esp) -> func
* 4(esp) -> arg1
* ...
* 4*n(esp) -> argn
* 4*(n+1)(esp) -> ucp */
pop %eax /* eax = func */
call *%eax /* func(arg1, ..., argn) */
mov %esi, %esp /* Clean up stack */
/* ucp is now at the top of the stack again */
call _C_LABEL(resumecontext) /* resumecontext(ucp) */
ret /* never reached */
|
0xffea/MINIX3
| 2,309
|
lib/libc/arch/i386/sys/ptrace.S
|
/* $NetBSD: ptrace.S,v 1.16 2003/08/07 16:42:09 agc 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. 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: @(#)ptrace.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: ptrace.S,v 1.16 2003/08/07 16:42:09 agc Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
.globl _C_LABEL(__errno)
ENTRY(ptrace)
#ifdef PIC
PIC_PROLOGUE
call PIC_PLT(_C_LABEL(__errno))
PIC_EPILOGUE
#else
call _C_LABEL(__errno)
#endif /* PIC */
xorl %edx,%edx
movl %edx,(%eax)
SYSTRAP(ptrace)
jc err
ret
err:
#ifdef PIC
PIC_PROLOGUE
mov PIC_GOT(CERROR), %ecx
PIC_EPILOGUE
jmp *%ecx
#else
jmp CERROR
#endif
|
0xffea/MINIX3
| 3,028
|
lib/libc/arch/i386/sys/__clone.S
|
/* $NetBSD: __clone.S,v 1.3 2001/07/18 12:24:53 fvdl Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
* All rights reserved.
*
* Written by Frank van der Linden for Wasabi Systems, Inc.
*
* 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 for the NetBSD Project by
* Wasabi Systems, Inc.
* 4. The name of Wasabi Systems, Inc. may not be used to endorse
* or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#include <sys/errno.h>
#include "SYS.h"
#ifdef WEAK_ALIAS
WEAK_ALIAS(clone, __clone)
#endif
.text
/*
* int clone(int (*fn)(void *), void *stack, int flags, void *arg);
*/
ENTRY(__clone)
pushl %ebp
/*
* Sanity checks: func and stack may not be NULL.
*/
movl 8(%esp), %ebp
cmpl $0,%ebp /* function */
je 3f
movl 12(%esp),%eax /* stack */
cmpl $0,%eax
je 3f
/*
* Set up the stack for the clone.
*/
movl 20(%esp),%ecx
movl %ecx,-4(%eax) /* argument */
leal -4(%eax),%eax /* sp points to arg */
pushl %eax /* stack */
pushl 20(%esp) /* flags */
pushl $0 /* dummy return address */
SYSTRAP(__clone)
jc 4f
cmpl $0,%eax
jne 2f /* we're the parent */
call *%ebp /* this is the clone, call the function */
#ifdef PIC
PIC_PROLOGUE
pushl %eax /* clone does _exit(func(arg)); */
call PIC_PLT(_C_LABEL(_exit))
addl $4,%esp
PIC_EPILOGUE
#else
pushl %eax
call _C_LABEL(_exit)
addl $4,%esp
#endif
2:
addl $12,%esp
popl %ebp
ret
3:
movl $EINVAL,%eax
jmp 5f
4:
addl $12,%esp
5:
popl %ebp
#ifdef PIC
PIC_PROLOGUE
movl PIC_GOT(CERROR),%edx
PIC_EPILOGUE
jmp *%edx
#else
jmp CERROR
#endif
|
0xffea/MINIX3
| 2,172
|
lib/libc/arch/i386/sys/exect.S
|
/* $NetBSD: exect.S,v 1.13 2003/08/07 16:42:08 agc 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. 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: @(#)exect.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: exect.S,v 1.13 2003/08/07 16:42:08 agc Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
#include <machine/psl.h>
ENTRY(exect)
pushfl
orb $(PSL_T>>8),1(%esp)
popfl
SYSTRAP(execve)
#ifdef PIC
PIC_PROLOGUE
mov PIC_GOT(CERROR), %ecx
PIC_EPILOGUE
jmp *%ecx
#else
jmp CERROR
#endif
|
0xffea/MINIX3
| 2,304
|
lib/libc/arch/i386/sys/__syscall.S
|
/* $NetBSD: __syscall.S,v 1.3 2003/08/07 16:42:08 agc 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. 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: @(#)syscall.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: __syscall.S,v 1.3 2003/08/07 16:42:08 agc Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
ENTRY(__syscall)
pop %ecx /* rta */
pop %eax /* syscall number */
pop %edx /* junk */
push %ecx
int $0x80
push %ecx /* Keep stack frame consistant */
push %ecx /* Keep stack frame consistant */
jc err
ret
err:
#ifdef PIC
PIC_PROLOGUE
mov PIC_GOT(CERROR), %ecx
PIC_EPILOGUE
jmp *%ecx
#else
jmp CERROR
#endif
|
0xffea/MINIX3
| 2,758
|
lib/libc/arch/i386/sys/brk.S
|
/* $NetBSD: brk.S,v 1.21 2007/03/09 14:30:56 ad 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. 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: @(#)brk.s 5.2 (Berkeley) 12/17/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: brk.S,v 1.21 2007/03/09 14:30:56 ad Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
.globl _end
.globl _C_LABEL(__minbrk)
.globl CURBRK
#ifdef WEAK_ALIAS
WEAK_ALIAS(brk, _brk)
#endif
.data
_C_LABEL(__minbrk):
.long _end
.text
ENTRY(_brk)
#ifdef PIC
movl 4(%esp),%ecx
PIC_PROLOGUE
movl PIC_GOT(_C_LABEL(__minbrk)),%edx
PIC_EPILOGUE
cmpl %ecx,(%edx)
jb 1f
movl (%edx),%ecx
movl %ecx,4(%esp)
1:
OSYSTRAP(break) /* don't clobber %ecx */
jc err
PIC_PROLOGUE
movl PIC_GOT(CURBRK),%edx # set up GOT addressing
PIC_EPILOGUE
movl %ecx,(%edx)
xorl %eax,%eax
ret
err:
PIC_PROLOGUE
mov PIC_GOT(CERROR),%edx
PIC_EPILOGUE
jmp *%edx
#else
movl 4(%esp),%ecx
cmpl %ecx,_C_LABEL(__minbrk)
jb 1f
movl _C_LABEL(__minbrk),%ecx
movl %ecx,4(%esp)
1:
OSYSTRAP(break) /* don't clobber %ecx */
jc err
movl %ecx,CURBRK
xorl %eax,%eax
ret
err:
jmp CERROR
#endif
|
0xffea/MINIX3
| 2,401
|
lib/libc/arch/i386/sys/__vfork14.S
|
/* $NetBSD: __vfork14.S,v 1.8 2007/03/09 14:30:48 ad 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. 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: @(#)Ovfork.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: __vfork14.S,v 1.8 2007/03/09 14:30:48 ad Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
/*
* pid = vfork();
*
* %edx == 0 in parent process, %edx == 1 in child process.
* %eax == pid of child in parent, %eax == pid of parent in child.
*
*/
ENTRY(__vfork14)
popl %ecx /* my rta into %ecx */
OSYSTRAP(__vfork14) /* don't clobber %ecx */
jc err
decl %edx
andl %edx,%eax
jmp *%ecx
err:
pushl %ecx
#ifdef PIC
PIC_PROLOGUE
mov PIC_GOT(CERROR), %ecx
PIC_EPILOGUE
jmp *%ecx
#else
jmp CERROR
#endif
|
0xffea/MINIX3
| 2,234
|
lib/libc/arch/i386/sys/syscall.S
|
/* $NetBSD: syscall.S,v 1.11 2003/08/07 16:42:09 agc 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. 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: @(#)syscall.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: syscall.S,v 1.11 2003/08/07 16:42:09 agc Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
ENTRY(syscall)
pop %ecx /* rta */
pop %eax /* syscall number */
push %ecx
int $0x80
push %ecx /* Keep stack frame consistant */
jc err
ret
err:
#ifdef PIC
PIC_PROLOGUE
mov PIC_GOT(CERROR), %ecx
PIC_EPILOGUE
jmp *%ecx
#else
jmp CERROR
#endif
|
0xffea/MINIX3
| 2,199
|
lib/libc/arch/i386/sys/cerror.S
|
/* $NetBSD: cerror.S,v 1.14 2003/08/07 16:42:08 agc 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. 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: @(#)cerror.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: cerror.S,v 1.14 2003/08/07 16:42:08 agc Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
.globl _C_LABEL(__errno)
_ENTRY(CERROR)
pushl %eax
#ifdef PIC
PIC_PROLOGUE
call PIC_PLT(_C_LABEL(__errno))
PIC_EPILOGUE
#else
call _C_LABEL(__errno)
#endif /* PIC */
popl (%eax)
movl $-1,%eax
movl $-1,%edx
ret
|
0xffea/MINIX3
| 2,091
|
lib/libc/arch/i386/sys/fork.S
|
/* $NetBSD: fork.S,v 1.9 2003/08/07 16:42:09 agc 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. 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: @(#)fork.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: fork.S,v 1.9 2003/08/07 16:42:09 agc Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
_SYSCALL(__fork,fork)
decl %edx /* from 1 to 0 in child, 0 to -1 in parent */
andl %edx,%eax
ret /* pid = fork(); */
|
0xffea/MINIX3
| 2,118
|
lib/libc/arch/i386/sys/pipe.S
|
/* $NetBSD: pipe.S,v 1.6 2003/08/07 16:42:09 agc 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. 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: @(#)pipe.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: pipe.S,v 1.6 2003/08/07 16:42:09 agc Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
#ifdef WEAK_ALIAS
WEAK_ALIAS(pipe, _pipe)
#endif
_SYSCALL(_pipe,pipe)
movl 4(%esp),%ecx
movl %eax,(%ecx)
movl %edx,4(%ecx)
xorl %eax,%eax
ret
|
0xffea/MINIX3
| 2,238
|
lib/libc/arch/i386/sys/__sigtramp2.S
|
/* $NetBSD: __sigtramp2.S,v 1.4 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Christos Zoulas.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
/*
* The i386 signal trampoline is invoked only to return from
* the signal; the kernel calls the signal handler directly.
*
* On entry, stack looks like:
*
* ucontext structure [12+sizeof(siginfo_t)]
* siginfo structure [12]
* pointer to ucontext structure [8]
* pointer to siginfo structure [4]
* sp-> signal number [0]
*/
NENTRY(__sigtramp_siginfo_2)
leal 12+128(%esp),%eax /* get address of ucontext */
movl %eax,4(%esp) /* put it in the argument slot */
/* fake return address already there */
SYSTRAP(setcontext) /* do setcontext */
movl $-1,4(%esp) /* if we return here, something is wrong */
SYSTRAP(exit) /* exit */
|
0xffea/MINIX3
| 2,691
|
lib/libc/arch/i386/sys/sbrk.S
|
/* $NetBSD: sbrk.S,v 1.19 2008/07/02 20:07:43 rmind 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. 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: @(#)sbrk.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: sbrk.S,v 1.19 2008/07/02 20:07:43 rmind Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
.globl _end
.globl CURBRK
#ifdef WEAK_ALIAS
WEAK_ALIAS(sbrk, _sbrk)
#endif
.data
CURBRK: .long _end
.text
ENTRY(_sbrk)
#ifdef PIC
movl 4(%esp),%ecx
PIC_PROLOGUE
movl PIC_GOT(CURBRK),%edx
PIC_EPILOGUE
movl (%edx),%eax
test %ecx,%ecx
jz out
addl %eax,%ecx
movl %ecx,4(%esp)
OSYSTRAP(break) /* don't clobber %ecx */
jc err
PIC_PROLOGUE
movl PIC_GOT(CURBRK),%edx
PIC_EPILOGUE
movl (%edx),%eax
movl %ecx,(%edx)
out:
ret
err:
PIC_PROLOGUE
mov PIC_GOT(CERROR),%edx
PIC_EPILOGUE
jmp *%edx
#else
movl 4(%esp),%ecx
movl CURBRK,%eax
test %ecx,%ecx
jz out
addl %eax,4(%esp)
OSYSTRAP(break) /* don't clobber %ecx */
jc err
movl CURBRK,%eax
addl %ecx,CURBRK
out:
ret
err:
jmp CERROR
#endif
|
0xffea/MINIX3
| 2,069
|
lib/libc/arch/i386/sys/getcontext.S
|
/* $NetBSD: getcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: getcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $")
#endif /* SYSLIBC_SCCS && !lint */
#ifdef WEAK_ALIAS
WEAK_ALIAS(getcontext, _getcontext)
#endif
_SYSCALL(_getcontext,getcontext)
movl 4(%esp),%ecx
movl 0(%esp),%edx
movl %edx,(36 + 14 * 4)(%ecx) /* Adjust saved %eip ... */
leal 4(%esp),%edx
movl %edx,(36 + 17 * 4)(%ecx) /* ... and %esp. */
movl $0,(36 + 11 * 4)(%ecx) /* Arrange for return of 0. */
xorl %eax,%eax
ret
|
0xffea/MINIX3
| 1,979
|
lib/libc/arch/i386/gen/udivsi3.S
|
/* $NetBSD: udivsi3.S,v 1.6 2003/08/07 16:42:07 agc 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. 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: @(#)udivsi3.s 5.1 (Berkeley) 5/15/90
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: udivsi3.S,v 1.6 2003/08/07 16:42:07 agc Exp $")
#endif
ENTRY(__udivsi3)
movl 4(%esp),%eax
xorl %edx,%edx
divl 8(%esp)
ret
|
0xffea/MINIX3
| 1,966
|
lib/libc/arch/i386/gen/divsi3.S
|
/* $NetBSD: divsi3.S,v 1.6 2003/08/07 16:42:07 agc 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. 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: @(#)divsi3.s 5.1 (Berkeley) 5/15/90
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: divsi3.S,v 1.6 2003/08/07 16:42:07 agc Exp $")
#endif
ENTRY(__divsi3)
movl 4(%esp),%eax
cltd
idivl 8(%esp)
ret
|
0xffea/MINIX3
| 3,109
|
lib/libc/arch/i386/gen/setjmp.S
|
/* $NetBSD: setjmp.S,v 1.14 2005/09/13 01:44:08 christos 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. 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 <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: setjmp.S,v 1.14 2005/09/13 01:44:08 christos Exp $")
#endif
/*
* C library -- _setjmp, _longjmp
*
* longjmp(a,v)
* will generate a "return(v)" from the last call to
* setjmp(a)
* by restoring registers from the stack.
* The previous signal state is restored.
*/
ENTRY(__setjmp14)
movl 4(%esp),%ecx
movl 0(%esp),%edx
movl %edx, 0(%ecx)
movl %ebx, 4(%ecx)
movl %esp, 8(%ecx)
movl %ebp,12(%ecx)
movl %esi,16(%ecx)
movl %edi,20(%ecx)
/* Get the signal mask. */
leal 24(%ecx),%edx
PIC_PROLOGUE
pushl %edx
pushl $0
pushl $0
#ifdef PIC
call PIC_PLT(_C_LABEL(__sigprocmask14))
#else
call _C_LABEL(__sigprocmask14)
#endif
addl $12,%esp
PIC_EPILOGUE
xorl %eax,%eax
ret
ENTRY(__longjmp14)
/* Restore the signal mask. */
movl 4(%esp),%ecx
leal 24(%ecx),%edx
PIC_PROLOGUE
pushl $0
pushl %edx
#ifdef __minix
pushl $2 /* SIG_SETMASK */
#else
pushl $3 /* SIG_SETMASK */
#endif
#ifdef PIC
call PIC_PLT(_C_LABEL(__sigprocmask14))
#else
call _C_LABEL(__sigprocmask14)
#endif
addl $12,%esp
PIC_EPILOGUE
movl 4(%esp),%edx
movl 8(%esp),%eax
movl 0(%edx),%ecx
movl 4(%edx),%ebx
movl 8(%edx),%esp
movl 12(%edx),%ebp
movl 16(%edx),%esi
movl 20(%edx),%edi
testl %eax,%eax
jnz 1f
incl %eax
1: movl %ecx,0(%esp)
ret
|
0xffea/MINIX3
| 2,539
|
lib/libc/arch/i386/gen/swapcontext.S
|
/* $NetBSD: swapcontext.S,v 1.6 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: swapcontext.S,v 1.6 2008/04/28 20:22:56 martin Exp $")
#endif /* LIBC_SCCS && !lint */
ENTRY(swapcontext)
movl 4(%esp),%ecx
PIC_PROLOGUE
pushl %ecx /* push oucp */
#ifdef PIC
call PIC_PLT(_C_LABEL(_getcontext))
#else
call _C_LABEL(_getcontext)
#endif
addl $4,%esp /* pop oucp */
PIC_EPILOGUE
testl %eax,%eax
jnz 2f
movl 4(%esp),%ecx
movl 0(%esp),%edx
movl %edx,(36 + 14 * 4)(%ecx) /* Adjust saved %eip ... */
#ifdef PIC
movl %ebx,(36 + 8 * 4)(%ecx) /* ... clobbered PIC reg ... */
#endif
leal 4(%esp),%edx
movl %edx,(36 + 17 * 4)(%ecx) /* ... and %esp. */
/* Note: oucp->%eax has been cleared by getcontext(). */
movl 8(%esp),%ecx
PIC_PROLOGUE
pushl %ecx /* push ucp */
#ifdef PIC
call PIC_PLT(_C_LABEL(setcontext))
#else
call _C_LABEL(setcontext)
#endif
addl $4,%esp /* pop ucp */
PIC_EPILOGUE
/* No need to error-check: setcontext() must have failed. */
2: ret
|
0xffea/MINIX3
| 2,540
|
lib/libc/arch/i386/gen/fixunsdfsi.S
|
/* $NetBSD: fixunsdfsi.S,v 1.11 2003/08/07 16:42:07 agc 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. 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: @(#)fixunsdfsi.s 5.1 12/17/90
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: fixunsdfsi.S,v 1.11 2003/08/07 16:42:07 agc Exp $")
#endif
ENTRY(__fixunsdfsi)
fldl 4(%esp) /* argument double to accum stack */
frndint /* create integer */
#ifdef PIC
PIC_PROLOGUE
leal PIC_GOTOFF(fbiggestsigned),%eax
PIC_EPILOGUE
fcoml (%eax)
#else
fcoml fbiggestsigned /* bigger than biggest signed? */
#endif
fstsw %ax
sahf
jnb 2f
fistpl 4(%esp)
movl 4(%esp),%eax
ret
2:
#ifdef PIC
PIC_PROLOGUE
leal PIC_GOTOFF(fbiggestsigned),%eax
PIC_EPILOGUE
fsubl (%eax)
#else
fsubl fbiggestsigned /* reduce for proper conversion */
#endif
fistpl 4(%esp) /* convert */
movl 4(%esp),%eax
orl $0x80000000,%eax /* restore bias */
ret
fbiggestsigned: .double 0r2147483648.0
|
0xffea/MINIX3
| 2,340
|
lib/libc/arch/i386/gen/alloca.S
|
/* $NetBSD: alloca.S,v 1.8 2003/08/07 16:42:06 agc 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. 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: @(#)alloca.s 5.2 (Berkeley) 5/14/90
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: alloca.S,v 1.8 2003/08/07 16:42:06 agc Exp $")
#endif
/* like alloc, but automatic free in return */
ENTRY(alloca)
popl %edx /* pop return addr */
popl %eax /* pop amount to allocate */
movl %esp,%ecx
addl $3,%eax /* round up to next word */
andl $-4,%eax
subl %eax,%esp
movl %esp,%eax /* base of newly allocated space */
pushl 8(%ecx) /* copy possible saved registers */
pushl 4(%ecx)
pushl 0(%ecx)
pushl %eax /* dummy to pop at callsite */
jmp *%edx /* "return" */
|
0xffea/MINIX3
| 2,825
|
lib/libc/arch/i386/gen/resumecontext.S
|
/* $NetBSD: resumecontext.S,v 1.6 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: resumecontext.S,v 1.6 2008/04/28 20:22:56 martin Exp $")
#endif /* LIBC_SCCS && !lint */
/*
* This assembly-language implementation differs from the (obvious)
* C-language implementation only in not clobbering the previous
* function's return address (us), which is the point of the exercise.
*/
NENTRY(_resumecontext) /* profiling prologue would clobber TOS */
leal -(4 + 776)(%esp),%ecx /* retaddr + sizeof (ucontext_t) */
andl $~(0xf),%ecx /* align on _UC_UCONTEXT_ALIGN */
movl %ecx,%esp
PIC_PROLOGUE
pushl %ecx
#ifdef PIC
call PIC_PLT(_C_LABEL(_getcontext))
#else
call _C_LABEL(_getcontext)
#endif
addl $4,%esp
PIC_EPILOGUE
movl 4(%esp),%ecx /* uc_link */
PIC_PROLOGUE
pushl %ecx /* argument for exit() or setcontext() */
testl %ecx,%ecx /* link end? */
jnz 9f /* watch out for local label use in PIC_* */
/* normal exit */
#ifdef PIC
call PIC_PLT(_C_LABEL(exit))
#else
call _C_LABEL(exit)
#endif
/* NOTREACHED */
9:
#ifdef PIC
call PIC_PLT(_C_LABEL(setcontext))
#else
call _C_LABEL(setcontext)
#endif
/* NOTREACHED */
/* something is wrong, pull the brake */
pushl $-1
pushl %eax /* unused return address */
SYSTRAP(exit)
|
0xffea/MINIX3
| 3,162
|
lib/libc/arch/i386/gen/sigsetjmp.S
|
/* $NetBSD: sigsetjmp.S,v 1.16 2005/09/13 01:44:08 christos 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. 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 <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: sigsetjmp.S,v 1.16 2005/09/13 01:44:08 christos Exp $")
#endif
ENTRY(__sigsetjmp14)
movl 4(%esp),%ecx
movl 0(%esp),%edx
movl %edx, 0(%ecx)
movl %ebx, 4(%ecx)
movl %esp, 8(%ecx)
movl %ebp,12(%ecx)
movl %esi,16(%ecx)
movl %edi,20(%ecx)
/* Check if we should save the signal mask, and remember it. */
movl 8(%esp),%eax
movl %eax,40(%ecx)
testl %eax,%eax
jz 2f /* no, skip */
/* Get the signal mask. */
leal 24(%ecx),%edx
PIC_PROLOGUE
pushl %edx
pushl $0
pushl $0
#ifdef PIC
call PIC_PLT(_C_LABEL(__sigprocmask14))
#else
call _C_LABEL(__sigprocmask14)
#endif
addl $12,%esp
PIC_EPILOGUE
2: xorl %eax,%eax
ret
ENTRY(__siglongjmp14)
/* Check to see if we need to restore the signal mask. */
movl 4(%esp),%ecx
cmpl $0,40(%ecx)
jz 2f /* no, skip */
/* Restore the signal mask. */
leal 24(%ecx),%edx
PIC_PROLOGUE
pushl $0
pushl %edx
#ifdef __minix
pushl $2 /* SIG_SETMASK */
#else
pushl $3 /* SIG_SETMASK */
#endif
#ifdef PIC
call PIC_PLT(_C_LABEL(__sigprocmask14))
#else
call _C_LABEL(__sigprocmask14)
#endif
addl $12,%esp
PIC_EPILOGUE
2: movl 4(%esp),%edx
movl 8(%esp),%eax
movl 0(%edx),%ecx
movl 4(%edx),%ebx
movl 8(%edx),%esp
movl 12(%edx),%ebp
movl 16(%edx),%esi
movl 20(%edx),%edi
testl %eax,%eax
jnz 3f
incl %eax
3: movl %ecx,0(%esp)
ret
|
0xffea/MINIX3
| 1,979
|
lib/libc/arch/i386/gen/fixdfsi.S
|
/* $NetBSD: fixdfsi.S,v 1.6 2003/08/07 16:42:07 agc Exp $ */
/*-
* Copyright (c) 1991 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. 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: @(#)fixdfsi.s 5.4 (Berkeley) 4/12/91
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: fixdfsi.S,v 1.6 2003/08/07 16:42:07 agc Exp $")
#endif
ENTRY(__fixdfsi)
fldl 4(%esp)
fistpl 4(%esp)
movl 4(%esp),%eax
ret
|
0xffea/MINIX3
| 1,937
|
lib/libc/arch/i386/gen/fabs.S
|
/* $NetBSD: fabs.S,v 1.5 2003/08/07 16:42:07 agc 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. 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: @(#)fabs.s 5.2 (Berkeley) 12/17/90
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: fabs.S,v 1.5 2003/08/07 16:42:07 agc Exp $")
#endif
ENTRY(fabs)
fldl 4(%esp)
fabs
ret
|
0xffea/MINIX3
| 1,074
|
lib/libc/arch/i386/string/swab.S
|
/*
* Written by J.T. Conklin <[email protected]>.
* Public domain.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: swab.S,v 1.13 2007/11/12 18:42:00 ad Exp $")
#endif
/*
* On the i486, this code is negligibly faster than the code generated
* by gcc at about half the size. If my i386 databook is correct, it
* should be considerably faster than the gcc code on a i386.
*/
ENTRY(swab)
pushl %esi
pushl %edi
movl 12(%esp),%esi
movl 16(%esp),%edi
movl 20(%esp),%ecx
shrl $1,%ecx
testl $7,%ecx # copy first group of 1 to 7 words
jz L2 # while swapping alternate bytes.
_ALIGN_TEXT,0x90
L1: lodsw
rorw $8,%ax
stosw
decl %ecx
testl $7,%ecx
jnz L1
L2: shrl $3,%ecx # copy remainder 8 words at a time
jz L4 # while swapping alternate bytes.
_ALIGN_TEXT,0x90
L3: lodsw
rorw $8,%ax
stosw
lodsw
rorw $8,%ax
stosw
lodsw
rorw $8,%ax
stosw
lodsw
rorw $8,%ax
stosw
lodsw
rorw $8,%ax
stosw
lodsw
rorw $8,%ax
stosw
lodsw
rorw $8,%ax
stosw
lodsw
rorw $8,%ax
stosw
decl %ecx
jnz L3
L4: popl %edi
popl %esi
ret
|
0xffea/MINIX3
| 1,554
|
lib/libc/arch/i386/string/strncmp.S
|
/*
* Written by J.T. Conklin <[email protected]>.
* Public domain.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: strncmp.S,v 1.14 2005/08/03 22:59:50 rpaulo Exp $")
#endif
/*
* NOTE: I've unrolled the loop eight times: large enough to make a
* significant difference, and small enough not to totally trash the
* cache.
*/
ENTRY(strncmp)
pushl %ebx
movl 8(%esp),%eax
movl 12(%esp),%ecx
movl 16(%esp),%edx
testl %edx,%edx
jmp L2 /* Jump into the loop! */
_ALIGN_TEXT,0x90
L1: incl %eax
incl %ecx
decl %edx
L2: jz L4 /* strings are equal */
movb (%eax),%bl
testb %bl,%bl
jz L3
cmpb %bl,(%ecx)
jne L3
incl %eax
incl %ecx
decl %edx
jz L4
movb (%eax),%bl
testb %bl,%bl
jz L3
cmpb %bl,(%ecx)
jne L3
incl %eax
incl %ecx
decl %edx
jz L4
movb (%eax),%bl
testb %bl,%bl
jz L3
cmpb %bl,(%ecx)
jne L3
incl %eax
incl %ecx
decl %edx
jz L4
movb (%eax),%bl
testb %bl,%bl
jz L3
cmpb %bl,(%ecx)
jne L3
incl %eax
incl %ecx
decl %edx
jz L4
movb (%eax),%bl
testb %bl,%bl
jz L3
cmpb %bl,(%ecx)
jne L3
incl %eax
incl %ecx
decl %edx
jz L4
movb (%eax),%bl
testb %bl,%bl
jz L3
cmpb %bl,(%ecx)
jne L3
incl %eax
incl %ecx
decl %edx
jz L4
movb (%eax),%bl
testb %bl,%bl
jz L3
cmpb %bl,(%ecx)
jne L3
incl %eax
incl %ecx
decl %edx
jz L4
movb (%eax),%bl
testb %bl,%bl
jz L3
cmpb %bl,(%ecx)
je L1
_ALIGN_TEXT,0x90
L3: movzbl (%eax),%eax /* unsigned comparison */
movzbl (%ecx),%ecx
subl %ecx,%eax
popl %ebx
ret
_ALIGN_TEXT,0x90
L4: xorl %eax,%eax
popl %ebx
ret
|
0xffea/MINIX3
| 1,973
|
lib/libc/arch/i386/stdlib/labs.S
|
/* $NetBSD: labs.S,v 1.7 2003/08/07 16:42:07 agc 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. 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: @(#)abs.s 5.2 (Berkeley) 12/17/90
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: labs.S,v 1.7 2003/08/07 16:42:07 agc Exp $")
#endif
ENTRY(labs)
movl 4(%esp),%eax
testl %eax,%eax
jns 1f
negl %eax
1: ret
|
0xffea/MINIX3
| 1,970
|
lib/libc/arch/i386/stdlib/abs.S
|
/* $NetBSD: abs.S,v 1.7 2003/08/07 16:42:07 agc 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. 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: @(#)abs.s 5.2 (Berkeley) 12/17/90
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: abs.S,v 1.7 2003/08/07 16:42:07 agc Exp $")
#endif
ENTRY(abs)
movl 4(%esp),%eax
testl %eax,%eax
jns 1f
negl %eax
1: ret
|
0xffea/MINIX3
| 2,176
|
lib/libc/arch/i386/stdlib/llabs.S
|
/* $NetBSD: llabs.S,v 1.5 2008/08/04 21:29:28 matt 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. 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: @(#)abs.s 5.2 (Berkeley) 12/17/90
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: llabs.S,v 1.5 2008/08/04 21:29:28 matt Exp $")
#endif
#ifdef WEAK_ALIAS
WEAK_ALIAS(llabs, _llabs)
WEAK_ALIAS(imaxabs, _llabs)
#endif
#ifdef WEAK_ALIAS
ENTRY(_llabs)
#else
STRONG_ALIAS(imaxabs, llabs)
ENTRY(llabs)
#endif
movl 8(%esp),%edx
movl 4(%esp),%eax
testl %edx,%edx
jns 1f
negl %eax
adcl $0,%edx
negl %edx
1: ret
|
0xffea/MINIX3
| 2,942
|
lib/libc/arch/sh3/sys/ptrace.S
|
/* $NetBSD: ptrace.S,v 1.8 2006/01/06 20:38:01 uwe 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. 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: @(#)ptrace.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: ptrace.S,v 1.8 2006/01/06 20:38:01 uwe Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
/*
* int
* ptrace(int request, pid_t pid, caddr_t addr, int data);
*/
ENTRY(ptrace)
#ifdef _REENTRANT
mov.l .L___errno, r1
PIC_PROLOGUE(.L_GOT)
sts.l pr, @-sp
mov.l r7, @-sp
mov.l r6, @-sp
mov.l r5, @-sp
1: CALL r1
mov.l r4, @-sp
mov.l @sp+, r4
mov.l @sp+, r5
mov.l @sp+, r6
mov.l @sp+, r7
lds.l @sp+, pr
PIC_EPILOGUE
#else /* ! _REENTRANT */
#ifdef PIC
mova .L_GOT, r0
mov.l .L_GOT, r1
add r0, r1
mov.l .L_errno, r0
mov.l @(r0, r1), r0
#else
mov.l .L_errno, r0
#endif
#endif /* ! _REENTRANT */
mov #0, r1
mov.l r1, @r0 /* errno = 0; */
mov #SYS_ptrace, r0
trapa #0x80
bf err
rts
nop
err:
JUMP_CERROR
.align 2
.L_GOT:
PIC_GOT_DATUM
#ifdef _REENTRANT
.global _C_LABEL(__errno)
.L___errno:
CALL_DATUM(_C_LABEL(__errno), 1b)
#else /* ! _REENTRANT */
.global _C_LABEL(errno)
.L_errno:
#ifdef PIC
.long PIC_GOT(_C_LABEL(errno))
#else
.long _C_LABEL(errno)
#endif
#endif /* ! _REENTRANT */
SET_ENTRY_SIZE(ptrace)
|
0xffea/MINIX3
| 2,529
|
lib/libc/arch/sh3/sys/__clone.S
|
/* $NetBSD: __clone.S,v 1.6 2006/01/06 03:58:31 uwe Exp $ */
/*-
* Copyright (c) 2001 Tsubai Masanari. 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/errno.h>
#include "SYS.h"
#ifdef WEAK_ALIAS
WEAK_ALIAS(clone,__clone)
#endif
/*
* int __clone(int (*fn)(void *), void *stack, int flags, void *arg);
*/
ENTRY(__clone)
/*
* Sanity checks: func and stack may not be NULL.
*/
tst r4, r4
bt inval
tst r5, r5
bt inval
mov r4, r2 /* save entry point for later */
mov r6, r4 /* r4 = flags, r5 = stack (already) */
mov.l .L_SYS___clone, r0
trapa #0x80
bf err
tst r0, r0
bf 3f /* we're the parent, just return */
jsr @r2 /* clone does _exit((*fn)(arg)); */
mov r7, r4
mov.l .L__exit, r1
#ifdef PIC
mov r0, r4
mov.l .L_got, r12 /* PIC_PROLOGUE_NOSAVE(.L_got) */
mova .L_got, r0 /* expanded to fill the delay slot */
1: JUMP r1
add r0, r12
#else
JUMP r1
mov r0, r4
#endif
/* NOTREACHED */
inval:
mov #EINVAL, r0
err:
JUMP_CERROR
/* NOTREACHED */
3: rts
nop
.align 2
.L_SYS___clone: .long SYS___clone
.L_got: PIC_GOT_DATUM
.L__exit: CALL_DATUM(_C_LABEL(_exit), 1b)
SET_ENTRY_SIZE(__clone)
|
0xffea/MINIX3
| 1,994
|
lib/libc/arch/sh3/sys/exect.S
|
/* $NetBSD: exect.S,v 1.5 2006/01/06 01:53:30 uwe 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. 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: @(#)exect.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: exect.S,v 1.5 2006/01/06 01:53:30 uwe Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
PSEUDO(exect,execve)
|
0xffea/MINIX3
| 2,003
|
lib/libc/arch/sh3/sys/__syscall.S
|
/* $NetBSD: __syscall.S,v 1.6 2006/01/06 01:57:38 uwe 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. 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: @(#)syscall.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: __syscall.S,v 1.6 2006/01/06 01:57:38 uwe Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
RSYSCALL(__syscall)
|
0xffea/MINIX3
| 2,738
|
lib/libc/arch/sh3/sys/brk.S
|
/* $NetBSD: brk.S,v 1.10 2006/01/06 03:58:31 uwe 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. 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: @(#)brk.s 5.2 (Berkeley) 12/17/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: brk.S,v 1.10 2006/01/06 03:58:31 uwe Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
#ifdef WEAK_ALIAS
WEAK_ALIAS(brk,_brk)
#endif
.data
.globl _C_LABEL(__minbrk)
.align 2
_C_LABEL(__minbrk):
.long _end
.text
ENTRY(_brk)
#ifdef PIC
mova L_GOT, r0
mov.l L_GOT, r2
add r0, r2
mov.l Lminbrk, r0
mov.l @(r0, r2), r0
mov.l @r0, r0
#else
mov.l Lminbrk, r0
mov.l @r0, r0
#endif
cmp/hs r4, r0
bf 1f
mov r0, r4
1:
mov.l LSYS_break, r0
trapa #0x80
bf err
#ifdef PIC
mov.l Lcurbrk, r0
mov.l @(r0, r2), r1
xor r0, r0
#else
xor r0, r0
mov.l Lcurbrk, r1
#endif
rts
mov.l r4, @r1
err:
JUMP_CERROR
.align 2
LSYS_break: .long SYS_break
#ifdef PIC
L_GOT: .long _GLOBAL_OFFSET_TABLE_
Lminbrk: .long _C_LABEL(__minbrk)@GOT
Lcurbrk: .long curbrk@GOT
#else
Lminbrk: .long _C_LABEL(__minbrk)
Lcurbrk: .long curbrk
#endif
SET_ENTRY_SIZE(_brk)
|
0xffea/MINIX3
| 2,414
|
lib/libc/arch/sh3/sys/__vfork14.S
|
/* $NetBSD: __vfork14.S,v 1.6 2006/01/06 07:07:34 uwe 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. 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: @(#)Ovfork.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: __vfork14.S,v 1.6 2006/01/06 07:07:34 uwe Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
/*
* pid = vfork();
*
* r1 == 0 in parent process, r1 == 1 in child process.
* r0 == pid of child in parent, r0 == pid of parent in child.
*
*/
ENTRY(__vfork14)
mov.l .L_SYS___vfork14, r0
trapa #0x80
bf err
add #0xff, r1 /* from 1 to 0 in child, 0 to -1 in parent */
rts
and r1, r0 /* 0 in child, child pid in parent */
err:
JUMP_CERROR
.align 2
.L_SYS___vfork14:
.long SYS___vfork14
SET_ENTRY_SIZE(__vfork14)
|
0xffea/MINIX3
| 1,997
|
lib/libc/arch/sh3/sys/syscall.S
|
/* $NetBSD: syscall.S,v 1.6 2006/01/06 01:27:23 uwe 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. 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: @(#)syscall.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: syscall.S,v 1.6 2006/01/06 01:27:23 uwe Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
RSYSCALL(syscall)
|
0xffea/MINIX3
| 2,775
|
lib/libc/arch/sh3/sys/cerror.S
|
/* $NetBSD: cerror.S,v 1.10 2006/01/06 05:14:39 uwe 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. 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: @(#)cerror.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: cerror.S,v 1.10 2006/01/06 05:14:39 uwe Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
#ifdef _REENTRANT
.globl _C_LABEL(__errno)
.align 2
cerror:
mov.l .L___errno, r1
PIC_PROLOGUE(.L_got)
sts.l pr, @-sp
1: CALL r1
mov.l r4, @-sp ! save error code
mov.l @sp+, r4
lds.l @sp+, pr
PIC_EPILOGUE
mov.l r4, @r0
mov #-1, r1
rts
mov #-1, r0
.align 2
.L_got: PIC_GOT_DATUM
.L___errno: CALL_DATUM(_C_LABEL(__errno), 1b)
SET_ASENTRY_SIZE(cerror)
#else /* !_REENTRANT */
.globl _C_LABEL(errno)
.align 2
cerror:
#ifdef PIC
mova L_GOT, r0
mov.l L_GOT, r1
add r0, r1
mov.l L_errno, r0
mov.l @(r0, r1), r1
mov.l r4, @r1
#else
mov.l L_errno, r1
mov.l r4, @r1
#endif
mov #-1, r0
rts
mov #-1, r1
.align 2
#ifdef PIC
L_GOT: .long _GLOBAL_OFFSET_TABLE_
L_errno: .long _C_LABEL(errno)@GOT
#else
L_errno: .long _C_LABEL(errno)
#endif
#endif /* !_REENTRANT */
|
0xffea/MINIX3
| 2,338
|
lib/libc/arch/sh3/sys/fork.S
|
/* $NetBSD: fork.S,v 1.10 2006/01/06 05:11:29 uwe 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. 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: @(#)fork.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: fork.S,v 1.10 2006/01/06 05:11:29 uwe Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
/*
* pid = fork();
*
* r1 == 0 in parent process, r1 == 1 in child process.
* r0 == pid of child in parent, r0 == pid of parent in child.
*
*/
ENTRY(__fork)
mov #SYS_fork, r0
trapa #0x80
bf err
add #0xff, r1 /* from 1 to 0 in child, 0 to -1 in parent */
rts
and r1, r0 /* 0 in child, child pid in parent */
err:
JUMP_CERROR
SET_ENTRY_SIZE(__fork)
|
0xffea/MINIX3
| 2,093
|
lib/libc/arch/sh3/sys/pipe.S
|
/* $NetBSD: pipe.S,v 1.7 2006/01/06 05:23:46 uwe 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. 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: @(#)pipe.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: pipe.S,v 1.7 2006/01/06 05:23:46 uwe Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
#ifdef WEAK_ALIAS
WEAK_ALIAS(pipe,_pipe)
#endif
_SYSCALL(_pipe,pipe)
mov.l r0, @r4
mov.l r1, @(4, r4)
rts
mov #0, r0
|
0xffea/MINIX3
| 2,306
|
lib/libc/arch/sh3/sys/__sigtramp2.S
|
/* $NetBSD: __sigtramp2.S,v 1.3 2008/04/28 20:22:57 martin Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
/*
* The SH signal trampoline is invoked only to return from
* the signal; the kernel calls the signal handler directly.
*
* On entry, stack looks like:
*
* siginfo structure
* sp-> ucontext structure
*
* NB: This order is different from what other ports use (siginfo at
* the top of the stack), because we want to avoid wasting two
* instructions to skip to the ucontext. Not that this order really
* matters, but I think this inconsistency deserves an explanation.
*/
NENTRY(__sigtramp_siginfo_2)
mov r15, r4 /* get pointer to ucontext */
SYSTRAP(setcontext) /* and call setcontext() */
mov r0, r4 /* exit with errno */
SYSTRAP(exit) /* if sigreturn fails */
SET_ENTRY_SIZE(__sigtramp_siginfo_2)
|
0xffea/MINIX3
| 2,623
|
lib/libc/arch/sh3/sys/sbrk.S
|
/* $NetBSD: sbrk.S,v 1.9 2006/01/06 03:58:31 uwe 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. 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: @(#)sbrk.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: sbrk.S,v 1.9 2006/01/06 03:58:31 uwe Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
.globl _end
.globl curbrk
#ifdef WEAK_ALIAS
WEAK_ALIAS(sbrk,_sbrk)
#endif
.data
curbrk: .long _end
.text
ENTRY(_sbrk)
mov r4, r2
#ifdef PIC
mova L_GOT, r0
mov.l L_GOT, r3
add r0, r3
mov.l Lcurbrk, r0
mov.l @(r0, r3), r0
#else
mov.l Lcurbrk, r0
#endif
mov.l @r0, r0
add r0, r4
mov.l LSYS_break, r0
trapa #0x80
bf err
#ifdef PIC
mov.l Lcurbrk, r0
mov.l @(r0, r3), r1
#else
mov.l Lcurbrk, r1
#endif
mov.l @r1, r0
add r0, r2
rts
mov.l r2, @r1
err:
JUMP_CERROR
.align 2
LSYS_break: .long SYS_break
#ifdef PIC
L_GOT: .long _GLOBAL_OFFSET_TABLE_
Lcurbrk: .long curbrk@GOT
#else
Lcurbrk: .long curbrk
#endif
SET_ENTRY_SIZE(_sbrk)
|
0xffea/MINIX3
| 1,990
|
lib/libc/arch/sh3/sys/getcontext.S
|
/* $NetBSD: getcontext.S,v 1.3 2008/04/28 20:22:57 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: getcontext.S,v 1.3 2008/04/28 20:22:57 martin Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
#ifdef WEAK_ALIAS
WEAK_ALIAS(getcontext,_getcontext)
#endif
_SYSCALL(_getcontext,getcontext)
sts pr, r2
mov.l r2, @(36 + 1 * 4, r4) /* saved pc <- pr */
add #36 + 20 * 4, r4
rts
mov.l r0, @r4 /* arrange for return value 0 */
|
0xffea/MINIX3
| 3,655
|
lib/libc/arch/sh3/gen/setjmp.S
|
/* $NetBSD: setjmp.S,v 1.10 2006/01/05 19:21:37 uwe 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. 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 <machine/asm.h>
#include <machine/setjmp.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: setjmp.S,v 1.10 2006/01/05 19:21:37 uwe Exp $")
#endif
/*
* C library -- setjmp, longjmp
*
* longjmp(a,v)
* will generate a "return(v)" from the last call to
* setjmp(a)
* by restoring registers from the stack.
* The previous signal state is restored.
*/
ENTRY(__setjmp14)
PIC_PROLOGUE(.L_got_1)
sts.l pr, @-sp
mov.l r4, @-sp
mov.l .L___sigprocmask14_1, r0
mov r4, r6
mov #1, r4 /* how = SIG_BLOCK */
mov #0, r5 /* new = NULL */
1: CALL r0
add #(_JB_SIGMASK * 4), r6 /* old = &sigmask */
mov.l @sp+, r4
lds.l @sp+, pr
PIC_EPILOGUE
/* identical to _setjmp except that _JB_HAS_MASK is non-zero */
add #((_JB_HAS_MASK + 1) * 4), r4
mov #1, r0
mov.l r0, @-r4 /* has signal mask */
mov.l r15, @-r4
mov.l r14, @-r4
mov.l r13, @-r4
mov.l r12, @-r4
mov.l r11, @-r4
mov.l r10, @-r4
mov.l r9, @-r4
mov.l r8, @-r4
sts.l pr, @-r4
rts
xor r0, r0
.align 2
.L_got_1: PIC_GOT_DATUM
.L___sigprocmask14_1: CALL_DATUM(_C_LABEL(__sigprocmask14), 1b)
SET_ENTRY_SIZE(__setjmp14)
ENTRY(__longjmp14)
/* we won't return here, so we don't need to save pr and r12 */
PIC_PROLOGUE_NOSAVE(.L_got_2)
mov.l r5, @-sp
mov.l r4, @-sp
mov.l .L___sigprocmask14_2, r0
mov r4, r5
mov #3, r4 /* how = SIG_SETMASK */
add #(_JB_SIGMASK * 4), r5 /* new = &sigmask */
1: CALL r0
mov #0, r6 /* old = NULL */
mov.l @sp+, r4
mov.l @sp+, r5
/* identical to _longjmp */
lds.l @r4+, pr
mov.l @r4+, r8
mov.l @r4+, r9
mov.l @r4+, r10
mov.l @r4+, r11
mov.l @r4+, r12
mov.l @r4+, r13
mov.l @r4+, r14
mov.l @r4+, r15
mov r5, r0
tst r0, r0 /* make sure return value is non-zero */
bf .L0
add #1, r0
.L0:
rts
nop
.align 2
.L_got_2: PIC_GOT_DATUM
.L___sigprocmask14_2: CALL_DATUM(_C_LABEL(__sigprocmask14), 1b)
SET_ENTRY_SIZE(__longjmp14)
|
0xffea/MINIX3
| 2,591
|
lib/libc/arch/sh3/gen/swapcontext.S
|
/* $NetBSD: swapcontext.S,v 1.9 2008/04/28 20:22:57 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: swapcontext.S,v 1.9 2008/04/28 20:22:57 martin Exp $")
#endif /* SYSLIBC_SCCS and not lint */
/*
* int
* swapcontext(ucontext_t * restrict oucp, ucontext_t * restrict ucp);
*/
ENTRY(swapcontext)
PIC_PROLOGUE(.L_got)
mov.l r5, @-sp
sts.l pr, @-sp
mov.l .L__getcontext, r0
1: CALL r0 /* _getcontext(oucp) */
mov.l r4, @-sp
mov.l @sp+, r1
tst r0, r0
bf 3f /* return error from getcontext */
/* Note: getcontext does _UC_MACHINE_INTRV(oucp) = 0 for us */
mov.l @sp, r0
mov.l r0, @(36 + 1 * 4, r1) /* _UC_MACHINE_SET_PC(oucp, pr) */
mov.l .L_setcontext, r2
2: CALL r2 /* setcontext(ucp) */
mov.l @(4, sp), r4
/* if we get here, return error from setcontext */
3:
lds.l @sp+, pr
#ifdef PIC
add #4, sp
rts
PIC_EPILOGUE
#else
rts
add #4, sp
#endif
.align 2
.L_got: PIC_GOT_DATUM
.L__getcontext: CALL_DATUM(_C_LABEL(_getcontext), 1b)
.L_setcontext: CALL_DATUM(_C_LABEL(setcontext), 2b)
SET_ENTRY_SIZE(swapcontext)
|
0xffea/MINIX3
| 2,707
|
lib/libc/arch/sh3/gen/_setjmp.S
|
/* $NetBSD: _setjmp.S,v 1.7 2006/01/05 02:04:41 uwe 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. 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 <machine/asm.h>
#include <machine/setjmp.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: _setjmp.S,v 1.7 2006/01/05 02:04:41 uwe Exp $")
#endif
/*
* C library -- _setjmp, _longjmp
*
* _longjmp(a,v)
* will generate a "return(v)" from the last call to
* _setjmp(a)
* by restoring registers from the stack.
* The previous signal state is NOT restored.
*/
ENTRY(_setjmp)
add #((_JB_HAS_MASK + 1) * 4), r4
mov #0, r0
mov.l r0, @-r4 /* no saved signal mask */
mov.l r15, @-r4
mov.l r14, @-r4
mov.l r13, @-r4
mov.l r12, @-r4
mov.l r11, @-r4
mov.l r10, @-r4
mov.l r9, @-r4
mov.l r8, @-r4
sts.l pr, @-r4
rts
xor r0, r0
SET_ENTRY_SIZE(_setjmp)
ENTRY(_longjmp)
lds.l @r4+, pr
mov.l @r4+, r8
mov.l @r4+, r9
mov.l @r4+, r10
mov.l @r4+, r11
mov.l @r4+, r12
mov.l @r4+, r13
mov.l @r4+, r14
mov.l @r4+, r15
mov r5, r0
tst r0, r0
bf .L0
add #1, r0
.L0:
rts
nop
SET_ENTRY_SIZE(_longjmp)
|
0xffea/MINIX3
| 3,715
|
lib/libc/arch/sh3/gen/sigsetjmp.S
|
/* $NetBSD: sigsetjmp.S,v 1.9 2006/01/05 19:21:37 uwe 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. 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 <machine/asm.h>
#include <machine/setjmp.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: sigsetjmp.S,v 1.9 2006/01/05 19:21:37 uwe Exp $")
#endif
ENTRY(__sigsetjmp14)
tst r5, r5
bt 2f /* if (savemask == 0) */
/* identical to longjmp except that _JB_HAS_MASK is in the argument */
PIC_PROLOGUE(.L_got_1)
sts.l pr, @-sp
mov.l r4, @-sp
mov.l r5, @-sp
mov.l .L___sigprocmask14_1, r0
mov r4, r6
mov #1, r4 /* how = SIG_BLOCK */
mov #0, r5 /* new = NULL */
1: CALL r0
add #(_JB_SIGMASK * 4), r6 /* old = &sigmask */
mov.l @sp+, r5
mov.l @sp+, r4
lds.l @sp+, pr
PIC_EPILOGUE
2: /* identical to _setjmp except that _JB_HAS_MASK is in the argument */
add #((_JB_HAS_MASK + 1) * 4), r4
mov.l r5, @-r4 /* has signal mask? */
mov.l r15, @-r4
mov.l r14, @-r4
mov.l r13, @-r4
mov.l r12, @-r4
mov.l r11, @-r4
mov.l r10, @-r4
mov.l r9, @-r4
mov.l r8, @-r4
sts.l pr, @-r4
rts
xor r0, r0
.align 2
.L_got_1: PIC_GOT_DATUM
.L___sigprocmask14_1: CALL_DATUM(_C_LABEL(__sigprocmask14), 1b)
SET_ENTRY_SIZE(__sigsetjmp14)
ENTRY(__siglongjmp14)
mov.l @(_JB_HAS_MASK * 4, r4), r0
tst r0, r0
bt 2f /* if no mask */
/* identical to longjmp */
/* we won't return here, so we don't need to save pr and r12 */
PIC_PROLOGUE_NOSAVE(.L_got_2)
mov.l r5, @-sp
mov.l r4, @-sp
mov.l .L___sigprocmask14_2, r0
mov r4, r5
mov #3, r4 /* how = SIG_SETMASK */
add #(_JB_SIGMASK * 4), r5 /* new = &sigmask */
1: CALL r0
mov #0, r6 /* old = NULL */
mov.l @sp+, r4
mov.l @sp+, r5
2: /* identical to _longjmp */
lds.l @r4+, pr
mov.l @r4+, r8
mov.l @r4+, r9
mov.l @r4+, r10
mov.l @r4+, r11
mov.l @r4+, r12
mov.l @r4+, r13
mov.l @r4+, r14
mov.l @r4+, r15
mov r5, r0
tst r0, r0 /* make sure return value is non-zero */
bf .L0
add #1, r0
.L0:
rts
nop
.align 2
.L_got_2: PIC_GOT_DATUM
.L___sigprocmask14_2: CALL_DATUM(_C_LABEL(__sigprocmask14), 1b)
SET_ENTRY_SIZE(__siglongjmp14)
|
0xffea/MINIX3
| 2,203
|
lib/libc/arch/hppa/sys/ptrace.S
|
/* $NetBSD: ptrace.S,v 1.6 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Fredette.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/errno.h>
#include "SYS.h"
.import __cerror, code
/*
* int ptrace(int request, pid_t pid, void * addr, int data);
*/
ENTRY(ptrace, HPPA_FRAME_SIZE)
stw %rp, HPPA_FRAME_CRP(%sp)
stw %arg0, HPPA_FRAME_ARG(0)(%sp)
stw %arg1, HPPA_FRAME_ARG(1)(%sp)
stw %arg2, HPPA_FRAME_ARG(2)(%sp)
stw %arg3, HPPA_FRAME_ARG(3)(%sp)
ldo HPPA_FRAME_SIZE(%sp),%sp
bl __cerror, %rp
copy %r0, %t1
ldo -HPPA_FRAME_SIZE(%sp), %sp
ldw HPPA_FRAME_ARG(0)(%sp), %arg0
ldw HPPA_FRAME_ARG(1)(%sp), %arg1
ldw HPPA_FRAME_ARG(2)(%sp), %arg2
ldw HPPA_FRAME_ARG(3)(%sp), %arg3
ldw HPPA_FRAME_CRP(%sp), %rp
SYSCALL(ptrace)
bv,n %r0(%rp)
EXIT(ptrace)
|
0xffea/MINIX3
| 2,639
|
lib/libc/arch/hppa/sys/__clone.S
|
/* $NetBSD: __clone.S,v 1.6 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Fredette.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/errno.h>
#include "SYS.h"
#ifdef WEAK_ALIAS
WEAK_ALIAS(clone, __clone)
#endif
.import __cerror, code
/*
* int clone(int (*fn)(void *), void *stack, int flags, void *arg);
*/
ENTRY(__clone, 0)
/*
* Sanity checks: func and stack may not be NULL.
*/
ldi EINVAL, %t1
comb,= %r0, %arg0, __cerror
nop
comb,= %r0, %arg1, __cerror
nop
/*
* Put the func and arg arguments into a frame in the child's stack.
*/
ldo (HPPA_FRAME_SIZE * 2)(%arg1), %arg1
stw %arg0, HPPA_FRAME_ARG(0)(%arg1)
stw %arg3, HPPA_FRAME_ARG(1)(%arg1)
/*
* The system call expects (flags, stack).
*/
copy %arg2, %arg0
SYSCALL(__clone)
comb,<>,n %r0, %ret1, 9f
bv,n %r0(%rp)
9: /*
* Child: Reload the function and argument from the new stack.
*/
ldw HPPA_FRAME_ARG(0)(%sp), %r22
ldw HPPA_FRAME_ARG(1)(%sp), %arg0
/* Call the clone's entry point. */
stw %r19, HPPA_FRAME_ARG(2)(%sp)
bl $$dyncall, %r31
copy %r31, %rp
ldw HPPA_FRAME_ARG(2)(%sp), %r19
/* Pass the return value to _exit(). */
copy %ret0, %arg0
PIC_CALL(_exit)
/* NOTREACHED */
EXIT(__clone)
|
0xffea/MINIX3
| 1,686
|
lib/libc/arch/hppa/sys/exect.S
|
/* $NetBSD: exect.S,v 1.2 2009/11/03 05:07:25 snj Exp $ */
/* $OpenBSD: exect.S,v 1.5 2001/03/29 01:43:52 mickey Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: exect.S,v 1.2 2009/11/03 05:07:25 snj Exp $")
#endif /* LIBC_SCCS and not lint */
/* we do no tracing yet */
PSEUDO(exect,execve)
.end
|
0xffea/MINIX3
| 2,281
|
lib/libc/arch/hppa/sys/brk.S
|
/* $NetBSD: brk.S,v 1.5 2012/03/14 14:18:10 skrll Exp $ */
/* $OpenBSD: brk.S,v 1.7 2001/06/04 23:14:04 mickey Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: brk.S,v 1.5 2012/03/14 14:18:10 skrll Exp $")
#endif /* LIBC_SCCS and not lint */
.import curbrk, data
.global _end
#ifdef WEAK_ALIAS
WEAK_ALIAS(brk, _brk)
#endif
.data
.export __minbrk, data
__minbrk:
.long _end
ENTRY(_brk,0)
#ifdef PIC
addil LT%__minbrk, %r19
ldw RT%__minbrk(%r1), %r1
ldw 0(%r1), %t2
#else /* !PIC */
ldil L%__minbrk, %t1
ldw R%__minbrk(%t1), %t2
#endif /* !PIC */
sub,<< %t2, %arg0, %r0
copy %t2, %arg0
stw %arg0, HPPA_FRAME_ARG(0)(%sp)
SYSCALL(break)
ldw HPPA_FRAME_ARG(0)(%sp), %arg0
#ifdef PIC
addil LT%curbrk, %r19
ldw RT%curbrk(%r1), %r1
bv %r0(%rp)
stw %arg0, 0(%r1)
#else /* !PIC */
ldil L%curbrk, %t1
bv %r0(%rp)
stw %arg0, R%curbrk(%t1)
#endif /* !PIC */
EXIT(brk)
.end
|
0xffea/MINIX3
| 2,635
|
lib/libc/arch/hppa/sys/__vfork14.S
|
/* $NetBSD: __vfork14.S,v 1.5 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Fredette.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/errno.h>
#include "SYS.h"
ENTRY(__vfork14, 0)
/*
* NB: __vfork14 is a tricky syscall. We can't save
* any values on the stack, because the stack will be
* trashed by the child, leaving garbage for when the
* parent returns.
*
* So we must save values in registers, specifically,
* registers that the kernel is willing to preserve
* across the syscall. Normally, this would be callee-
* saved registers, with the kernel being the callee,
* but the problem is that we, too, are a callee, and
* would have to save that very same register somewhere,
* because *our* caller is counting on us to do so.
*
* What we need is a normally caller-saved register,
* that the kernel is willing to save for us. The
* syscall entry code in locore.S has been modified
* to do just this for the t4 register.
*/
.import __cerror, code
copy %rp, %t4
ldil L%SYSCALLGATE, %r1
ble 4(%sr7, %r1)
ldi SYS___vfork14, %t1
comb,<> %r0, %t1, __cerror
copy %t4, %rp
addi -1, %ret1, %ret1
bv %r0(%rp)
and %ret0, %ret1, %ret0
EXIT(__vfork14)
|
0xffea/MINIX3
| 1,662
|
lib/libc/arch/hppa/sys/syscall.S
|
/* $NetBSD: syscall.S,v 1.2 2009/11/03 05:07:25 snj Exp $ */
/* $OpenBSD: syscall.S,v 1.4 2001/03/29 01:43:53 mickey Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: syscall.S,v 1.2 2009/11/03 05:07:25 snj Exp $")
#endif /* LIBC_SCCS and not lint */
RSYSCALL(syscall)
.end
|
0xffea/MINIX3
| 2,100
|
lib/libc/arch/hppa/sys/cerror.S
|
/* $NetBSD: cerror.S,v 1.4 2008/04/28 20:22:56 martin Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Nick Hudson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
#ifdef _REENTRANT
ENTRY(__cerror,HPPA_FRAME_SIZE)
#else
LEAF_ENTRY(__cerror)
#endif
#ifdef _REENTRANT
stw %rp, HPPA_FRAME_CRP(%sp)
stw %t1, HPPA_FRAME_ARG(0)(%sp)
ldo HPPA_FRAME_SIZE(%sp),%sp
bl __errno, %rp
nop
ldo -HPPA_FRAME_SIZE(%sp), %sp
ldw HPPA_FRAME_ARG(0)(%sp), %t1
ldw HPPA_FRAME_CRP(%sp), %rp
stw %t1, 0(%ret0)
#else
#ifdef PIC
addil LT%errno, %r19
ldw RT%errno(%r1), %r1
stw %t1, 0(%r1)
#else
ldil L%errno, %r1
stw %t1, R%errno(%r1)
#endif
#endif
ldi -1, %ret0
bv %r0(%rp)
ldi -1, %ret1
EXIT(__cerror)
|
0xffea/MINIX3
| 1,740
|
lib/libc/arch/hppa/sys/fork.S
|
/* $NetBSD: fork.S,v 1.4 2009/11/03 05:07:25 snj Exp $ */
/* $OpenBSD: fork.S,v 1.7 2001/06/04 23:14:04 mickey Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: fork.S,v 1.4 2009/11/03 05:07:25 snj Exp $")
#endif /* LIBC_SCCS and not lint */
ENTRY(__fork,0)
SYSCALL(fork)
addi -1, %ret1, %ret1
bv %r0(%rp)
and %ret0, %ret1, %ret0
EXIT(__fork)
.end
|
0xffea/MINIX3
| 2,271
|
lib/libc/arch/hppa/sys/pipe.S
|
/* $NetBSD: pipe.S,v 1.3 2003/10/06 05:30:21 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)pipe.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: pipe.S,v 1.3 2003/10/06 05:30:21 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
#ifdef WEAK_ALIAS
WEAK_ALIAS(pipe, _pipe)
#endif
ENTRY(_pipe,0)
stw %arg0, HPPA_FRAME_ARG(0)(%sp)
SYSCALL(pipe)
ldw HPPA_FRAME_ARG(0)(%sp), %arg0
stw %ret0, 0(%arg0)
stw %ret1, 4(%arg0)
bv %r0(%rp)
copy %r0, %ret0
EXIT(_pipe)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.