Clean up deleted files.
This commit is contained in:
parent
e501423fab
commit
448e711c78
@ -1,91 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)bcmp.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: bcmp.s,v 1.1 1993/10/07 00:18:21 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* bcmp(s1, s2, n) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* This is probably not the best we can do, but it is still 2-10 times
|
||||
* faster than the C version in the portable gen directory.
|
||||
*
|
||||
* Things that might help:
|
||||
* - longword align when possible (only on the 68020)
|
||||
* - use nested DBcc instructions or use one and limit size to 64K
|
||||
*/
|
||||
ENTRY(bcmp)
|
||||
movl sp@(4),a0 /* string 1 */
|
||||
movl sp@(8),a1 /* string 2 */
|
||||
movl sp@(12),d0 /* length */
|
||||
jeq bcdone /* if zero, nothing to do */
|
||||
movl a0,d1
|
||||
btst #0,d1 /* string 1 address odd? */
|
||||
jeq bceven /* no, skip alignment */
|
||||
cmpmb a0@+,a1@+ /* yes, compare a byte */
|
||||
jne bcnoteq /* not equal, return non-zero */
|
||||
subql #1,d0 /* adjust count */
|
||||
jeq bcdone /* count 0, reutrn zero */
|
||||
bceven:
|
||||
movl a1,d1
|
||||
btst #0,d1 /* string 2 address odd? */
|
||||
jne bcbloop /* yes, no hope for alignment, compare bytes */
|
||||
movl d0,d1 /* no, both even */
|
||||
lsrl #2,d1 /* convert count to longword count */
|
||||
jeq bcbloop /* count 0, skip longword loop */
|
||||
bclloop:
|
||||
cmpml a0@+,a1@+ /* compare a longword */
|
||||
jne bcnoteq /* not equal, return non-zero */
|
||||
subql #1,d1 /* adjust count */
|
||||
jne bclloop /* still more, keep comparing */
|
||||
andl #3,d0 /* what remains */
|
||||
jeq bcdone /* nothing, all done */
|
||||
bcbloop:
|
||||
cmpmb a0@+,a1@+ /* compare a byte */
|
||||
jne bcnoteq /* not equal, return non-zero */
|
||||
subql #1,d0 /* adjust count */
|
||||
jne bcbloop /* still more, keep going */
|
||||
rts
|
||||
bcnoteq:
|
||||
moveq #1,d0
|
||||
bcdone:
|
||||
rts
|
@ -1,114 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)bcopy.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: bcopy.s,v 1.1 1993/10/07 00:18:23 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* This is probably not the best we can do, but it is still 2-10 times
|
||||
* faster than the C version in the portable gen directory.
|
||||
*
|
||||
* Things that might help:
|
||||
* - unroll the longword copy loop (might not be good for a 68020)
|
||||
* - longword align when possible (only on the 68020)
|
||||
* - use nested DBcc instructions or use one and limit size to 64K
|
||||
*/
|
||||
ENTRY(bcopy)
|
||||
movl sp@(12),d1 /* check count */
|
||||
jle bcdone /* <= 0, don't do anything */
|
||||
movl sp@(4),a0 /* src address */
|
||||
movl sp@(8),a1 /* dest address */
|
||||
cmpl a1,a0 /* src after dest? */
|
||||
jlt bcback /* yes, must copy backwards */
|
||||
movl a0,d0
|
||||
btst #0,d0 /* src address odd? */
|
||||
jeq bcfeven /* no, skip alignment */
|
||||
movb a0@+,a1@+ /* yes, copy a byte */
|
||||
subql #1,d1 /* adjust count */
|
||||
jeq bcdone /* count 0, all done */
|
||||
bcfeven:
|
||||
movl a1,d0
|
||||
btst #0,d0 /* dest address odd? */
|
||||
jne bcfbloop /* yes, no hope for alignment, copy bytes */
|
||||
movl d1,d0 /* no, both even */
|
||||
lsrl #2,d0 /* convert count to longword count */
|
||||
jeq bcfbloop /* count 0, skip longword loop */
|
||||
bcflloop:
|
||||
movl a0@+,a1@+ /* copy a longword */
|
||||
subql #1,d0 /* adjust count */
|
||||
jne bcflloop /* still more, keep copying */
|
||||
andl #3,d1 /* what remains */
|
||||
jeq bcdone /* nothing, all done */
|
||||
bcfbloop:
|
||||
movb a0@+,a1@+ /* copy a byte */
|
||||
subql #1,d1 /* adjust count */
|
||||
jne bcfbloop /* still more, keep going */
|
||||
bcdone:
|
||||
rts
|
||||
bcback:
|
||||
addl d1,a0 /* src pointer to end */
|
||||
addl d1,a1 /* dest pointer to end */
|
||||
movl a0,d0
|
||||
btst #0,d0 /* src address odd? */
|
||||
jeq bcbeven /* no, skip alignment */
|
||||
movb a0@-,a1@- /* yes, copy a byte */
|
||||
subql #1,d1 /* adjust count */
|
||||
jeq bcdone /* count 0, all done */
|
||||
bcbeven:
|
||||
movl a1,d0
|
||||
btst #0,d0 /* dest address odd? */
|
||||
jne bcbbloop /* yes, no hope for alignment, copy bytes */
|
||||
movl d1,d0 /* no, both even */
|
||||
lsrl #2,d0 /* convert count to longword count */
|
||||
jeq bcbbloop /* count 0, skip longword loop */
|
||||
bcblloop:
|
||||
movl a0@-,a1@- /* copy a longword */
|
||||
subql #1,d0 /* adjust count */
|
||||
jne bcblloop /* still more, keep copying */
|
||||
andl #3,d1 /* what remains */
|
||||
jeq bcdone /* nothing, all done */
|
||||
bcbbloop:
|
||||
movb a0@-,a1@- /* copy a byte */
|
||||
subql #1,d1 /* adjust count */
|
||||
jne bcbbloop /* still more, keep going */
|
||||
rts
|
||||
|
@ -1,80 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)bzero.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: bzero.s,v 1.1 1993/10/07 00:18:25 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* This is probably not the best we can do, but it is still much
|
||||
* faster than the C version in the portable gen directory.
|
||||
*
|
||||
* Things that might help:
|
||||
* - unroll the longword loop (might not be good for a 68020)
|
||||
* - longword, as opposed to word, align when possible (only on the 68020)
|
||||
* - use nested DBcc instructions or use one and limit size to 64K
|
||||
*/
|
||||
ENTRY(bzero)
|
||||
movl sp@(4),a0 /* destination */
|
||||
movl sp@(8),d0 /* count */
|
||||
jeq bzdone /* nothing to do */
|
||||
movl a0,d1
|
||||
btst #0,d1 /* address odd? */
|
||||
jeq bzeven /* no, skip alignment */
|
||||
clrb a0@+ /* yes, clear a byte */
|
||||
subql #1,d0 /* adjust count */
|
||||
jeq bzdone /* if zero, all done */
|
||||
bzeven:
|
||||
movl d0,d1
|
||||
lsrl #2,d1 /* convert to longword count */
|
||||
jeq bzbloop /* no longwords, skip loop */
|
||||
bzlloop:
|
||||
clrl a0@+ /* clear a longword */
|
||||
subql #1,d1 /* adjust count */
|
||||
jne bzlloop /* still more, keep going */
|
||||
andl #3,d0 /* what remains */
|
||||
jeq bzdone /* nothing, all done */
|
||||
bzbloop:
|
||||
clrb a0@+ /* clear a byte */
|
||||
subql #1,d0 /* adjust count */
|
||||
jne bzbloop /* still more, keep going */
|
||||
bzdone:
|
||||
rts
|
@ -1,58 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)ffs.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: ffs.s,v 1.1 1993/10/07 00:18:26 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* bit = ffs(value) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(ffs)
|
||||
moveq #-1,d0
|
||||
movl sp@(4),d1
|
||||
beq done
|
||||
again:
|
||||
addql #1,d0
|
||||
btst d0,d1
|
||||
beq again
|
||||
done:
|
||||
addql #1,d0
|
||||
rts
|
@ -1,58 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)index.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: index.s,v 1.1 1993/10/07 00:18:27 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(index)
|
||||
movl sp@(4),a0 /* string */
|
||||
movb sp@(11),d0 /* char to look for */
|
||||
ixloop:
|
||||
cmpb a0@,d0 /* found our char? */
|
||||
jeq ixfound /* yes, break out */
|
||||
tstb a0@+ /* null? */
|
||||
jne ixloop /* no, keep going */
|
||||
moveq #0,d0 /* not found, return null */
|
||||
rts
|
||||
ixfound:
|
||||
movl a0,d0 /* found, return pointer */
|
||||
rts
|
@ -1,58 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)rindex.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: rindex.s,v 1.1 1993/10/07 00:18:28 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(rindex)
|
||||
movl sp@(4),a0 /* string */
|
||||
movb sp@(11),d0 /* char to look for */
|
||||
subl a1,a1 /* clear rindex pointer */
|
||||
rixloop:
|
||||
cmpb a0@,d0 /* found our char? */
|
||||
jne rixnope /* no, check for null */
|
||||
movl a0,a1 /* yes, remember location */
|
||||
rixnope:
|
||||
tstb a0@+ /* null? */
|
||||
jne rixloop /* no, keep going */
|
||||
movl a1,d0 /* return value */
|
||||
rts
|
@ -1,66 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)strcmp.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: strcmp.s,v 1.1 1993/10/07 00:18:29 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* NOTE: this guy returns result compatible with the VAX assembly version.
|
||||
* The C version on the portable gen directory returns different results
|
||||
* (different signs!) when comparing chars with the high bit on. Who is
|
||||
* right??
|
||||
*/
|
||||
ENTRY(strcmp)
|
||||
movl sp@(4),a0 /* a0 = string1 */
|
||||
movl sp@(8),a1 /* a1 = string2 */
|
||||
scloop:
|
||||
movb a0@+,d0 /* get *string1 */
|
||||
cmpb a1@+,d0 /* compare a byte */
|
||||
jne scexit /* not equal, break out */
|
||||
tstb d0 /* at end of string1? */
|
||||
jne scloop /* no, keep going */
|
||||
moveq #0,d0 /* strings are equal */
|
||||
rts
|
||||
scexit:
|
||||
subb a1@-,d0 /* *string1 - *string2 */
|
||||
extbl d0
|
||||
rts
|
@ -1,81 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)Ovfork.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: Ovfork.s,v 1.1 1993/10/07 00:18:35 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
* @(#)vfork.s 4.1 (Berkeley) 12/21/80
|
||||
* C library -- vfork
|
||||
*/
|
||||
|
||||
/*
|
||||
* pid = vfork();
|
||||
*
|
||||
* d1 == 0 in parent process, d1 == 1 in child process.
|
||||
* d0 == pid of child in parent, d0 == pid of parent in child.
|
||||
*
|
||||
* trickery here, due to keith sklower, uses ret to clear the stack,
|
||||
* and then returns with a jump indirect, since only one person can return
|
||||
* with a ret off this stack... we do the ret before we vfork!
|
||||
*/
|
||||
|
||||
vfork = 66
|
||||
.globl _vfork
|
||||
|
||||
_vfork:
|
||||
movl sp@+,a0
|
||||
movl #vfork,d0
|
||||
trap #0
|
||||
jcc vforkok
|
||||
jmp verror
|
||||
vforkok:
|
||||
tstl d1 /* child process ? */
|
||||
jne child /* yes */
|
||||
jcc parent /* if c-bit not set, fork ok */
|
||||
.globl _errno
|
||||
verror:
|
||||
movl d0,_errno
|
||||
moveq #-1,d0
|
||||
jmp a0@
|
||||
child:
|
||||
clrl d0
|
||||
parent:
|
||||
jmp a0@
|
@ -1,63 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)brk.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: brk.s,v 1.1 1993/10/07 00:18:37 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
#define SYS_brk 17
|
||||
|
||||
.globl curbrk
|
||||
.globl minbrk
|
||||
ENTRY(brk)
|
||||
movl minbrk,d0
|
||||
cmpl sp@(4),d0
|
||||
jle ok
|
||||
movl d0,sp@(4)
|
||||
ok:
|
||||
movl #SYS_brk,d0
|
||||
trap #0
|
||||
jcs err
|
||||
movl sp@(4),curbrk
|
||||
clrl d0
|
||||
rts
|
||||
err:
|
||||
jmp cerror
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)cerror.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: cerror.s,v 1.1 1993/10/07 00:18:38 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
.even
|
||||
.globl _errno
|
||||
cerror:
|
||||
movl d0,_errno
|
||||
movl #-1,d0
|
||||
rts
|
@ -1,50 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)exect.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: exect.s,v 1.1 1993/10/07 00:18:39 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
#include <machine/psl.h>
|
||||
|
||||
ENTRY(exect)
|
||||
movl #SYS_execve,d0
|
||||
trap #0
|
||||
jmp cerror /* exect(file, argv, env) */
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)fork.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: fork.s,v 1.1 1993/10/07 00:18:40 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
SYSCALL(fork)
|
||||
tstl d1
|
||||
jeq parent /* parent, since d1 == 0 in parent, 1 in child */
|
||||
clrl d0
|
||||
parent:
|
||||
rts /* pid = fork() */
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)pipe.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: pipe.s,v 1.1 1993/10/07 00:18:41 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
SYSCALL(pipe)
|
||||
movl sp@(4),a0
|
||||
movl d0,a0@+
|
||||
movl d1,a0@
|
||||
clrl d0
|
||||
rts
|
@ -1,53 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)ptrace.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: ptrace.s,v 1.1 1993/10/07 00:18:42 cgd Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
ENTRY(ptrace)
|
||||
clrl _errno
|
||||
movl #SYS_ptrace,d0
|
||||
trap #0
|
||||
jcs err
|
||||
rts
|
||||
err:
|
||||
jmp cerror
|
@ -1,82 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)_setjmp.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: _setjmp.s,v 1.3 1993/10/21 01:39:55 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: _setjmp.s,v 1.3 1993/10/21 01:39:55 jtc 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.
|
||||
*/
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(_setjmp)
|
||||
movl 4(%esp),%eax
|
||||
movl 0(%esp),%edx
|
||||
movl %edx, 0(%eax) /* rta */
|
||||
movl %ebx, 4(%eax)
|
||||
movl %esp, 8(%eax)
|
||||
movl %ebp,12(%eax)
|
||||
movl %esi,16(%eax)
|
||||
movl %edi,20(%eax)
|
||||
xorl %eax,%eax
|
||||
ret
|
||||
|
||||
ENTRY(_longjmp)
|
||||
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
|
@ -1,61 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)alloca.s 5.2 (Berkeley) 5/14/90
|
||||
* $Id: alloca.s,v 1.2 1993/10/21 01:39:56 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: alloca.s,v 1.2 1993/10/21 01:39:56 jtc Exp $"
|
||||
#endif
|
||||
|
||||
/* like alloc, but automatic automatic free in return */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
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 $0xfffffffc,%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" */
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)divsi3.s 5.1 (Berkeley) 5/15/90
|
||||
* $Id: divsi3.s,v 1.3 1993/10/21 02:03:37 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: divsi3.s,v 1.3 1993/10/21 02:03:37 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(__divsi3)
|
||||
movl 4(%esp),%eax
|
||||
cltd
|
||||
idivl 8(%esp)
|
||||
ret
|
@ -1,50 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fabs.s 5.2 (Berkeley) 12/17/90
|
||||
* $Id: fabs.s,v 1.2 1993/10/21 01:39:58 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: fabs.s,v 1.2 1993/10/21 01:39:58 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(fabs)
|
||||
fldl 4(%esp)
|
||||
fabs
|
||||
ret
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fixdfsi.s 5.4 (Berkeley) 4/12/91
|
||||
* $Id: fixdfsi.s,v 1.3 1993/10/21 02:03:38 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: fixdfsi.s,v 1.3 1993/10/21 02:03:38 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(__fixdfsi)
|
||||
fldl 4(%esp)
|
||||
fistpl 4(%esp)
|
||||
movl 4(%esp),%eax
|
||||
ret
|
@ -1,82 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fixunsdfsi.s 5.1 12/17/90
|
||||
* $Id: fixunsdfsi.s,v 1.4 1993/10/21 02:03:39 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: fixunsdfsi.s,v 1.4 1993/10/21 02:03:39 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
#include "SYS.h"
|
||||
|
||||
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 PIC_GOTOFF(fbiggestsigned) /* bigger than biggest signed? */
|
||||
#endif
|
||||
fstsw %ax
|
||||
sahf
|
||||
jnb 1f
|
||||
|
||||
fistpl 4(%esp)
|
||||
movl 4(%esp),%eax
|
||||
ret
|
||||
|
||||
1:
|
||||
#ifdef PIC
|
||||
PIC_PROLOGUE
|
||||
leal PIC_GOTOFF(fbiggestsigned),%eax
|
||||
PIC_EPILOGUE
|
||||
fsubl (%eax)
|
||||
#else
|
||||
fsubl PIC_GOTOFF(fbiggestsigned) /* reduce for proper conversion */
|
||||
#endif
|
||||
fistpl 4(%esp) /* convert */
|
||||
movl 4(%esp),%eax
|
||||
orl $0x80000000,%eax /* restore bias */
|
||||
PIC_EPILOGUE
|
||||
ret
|
||||
|
||||
fbiggestsigned: .double 0r2147483648.0
|
@ -1,54 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)htonl.s 5.3 (Berkeley) 12/17/90
|
||||
* $Id: htonl.s,v 1.2 1993/10/21 01:40:10 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: htonl.s,v 1.2 1993/10/21 01:40:10 jtc Exp $"
|
||||
#endif
|
||||
|
||||
/* netorder = htonl(hostorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(htonl)
|
||||
movl 4(%esp),%eax
|
||||
xchgb %al,%ah
|
||||
roll $16,%eax
|
||||
xchgb %al,%ah
|
||||
ret
|
@ -1,52 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)htons.s 5.2 (Berkeley) 12/17/90
|
||||
* $Id: htons.s,v 1.2 1993/10/21 01:40:12 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: htons.s,v 1.2 1993/10/21 01:40:12 jtc Exp $"
|
||||
#endif
|
||||
|
||||
/* netorder = htons(hostorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(htons)
|
||||
movzwl 4(%esp),%eax
|
||||
xchgb %al,%ah
|
||||
ret
|
@ -1,54 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)ntohl.s 5.2 (Berkeley) 12/17/90
|
||||
* $Id: ntohl.s,v 1.2 1993/10/21 01:40:12 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: ntohl.s,v 1.2 1993/10/21 01:40:12 jtc Exp $"
|
||||
#endif
|
||||
|
||||
/* hostorder = ntohl(netorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(ntohl)
|
||||
movl 4(%esp),%eax
|
||||
xchgb %al,%ah
|
||||
roll $16,%eax
|
||||
xchgb %al,%ah
|
||||
ret
|
@ -1,52 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)ntohs.s 5.2 (Berkeley) 12/17/90
|
||||
* $Id: ntohs.s,v 1.2 1993/10/21 01:40:14 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: ntohs.s,v 1.2 1993/10/21 01:40:14 jtc Exp $"
|
||||
#endif
|
||||
|
||||
/* hostorder = ntohs(netorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(ntohs)
|
||||
movzwl 4(%esp),%eax
|
||||
xchgb %al,%ah
|
||||
ret
|
@ -1,52 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)abs.s 5.2 (Berkeley) 12/17/90
|
||||
* $Id: abs.s,v 1.3 1993/10/21 01:40:17 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: abs.s,v 1.3 1993/10/21 01:40:17 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(abs)
|
||||
movl 4(%esp),%eax
|
||||
cmpl $0,%eax
|
||||
jge 1f
|
||||
negl %eax
|
||||
1: ret
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1993 Winning Strategies, 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.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Winning Strategies, Inc.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software withough 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.
|
||||
*
|
||||
* $Id: div.s,v 1.2 1993/10/21 01:40:19 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: div.s,v 1.2 1993/10/21 01:40:19 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(div)
|
||||
movl 4(%esp),%eax
|
||||
movl 8(%esp),%ecx
|
||||
cdq
|
||||
idiv %ecx
|
||||
movl %eax,4(%esp)
|
||||
movl %edx,8(%esp)
|
||||
ret
|
@ -1,52 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)abs.s 5.2 (Berkeley) 12/17/90
|
||||
* $Id: labs.s,v 1.3 1993/10/21 01:48:26 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: labs.s,v 1.3 1993/10/21 01:48:26 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(labs)
|
||||
movl 4(%esp),%eax
|
||||
cmpl $0,%eax
|
||||
jge 1f
|
||||
negl %eax
|
||||
1: ret
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1993 Winning Strategies, 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.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Winning Strategies, Inc.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software withough 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.
|
||||
*
|
||||
* $Id: ldiv.s,v 1.2 1993/10/21 01:40:21 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: ldiv.s,v 1.2 1993/10/21 01:40:21 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(ldiv)
|
||||
movl 4(%esp),%eax
|
||||
movl 8(%esp),%ecx
|
||||
cdq
|
||||
idiv %ecx
|
||||
movl %eax,4(%esp)
|
||||
movl %edx,8(%esp)
|
||||
ret
|
@ -1,71 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1993 Winning Strategies, 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.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Winning Strategies, Inc.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software withough 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.
|
||||
*
|
||||
* $Id: bcmp.s,v 1.2 1993/10/21 01:40:26 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: bcmp.s,v 1.2 1993/10/21 01:40:26 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* bcmp (void *b1, void *b2, size_t len)
|
||||
*
|
||||
* Written by:
|
||||
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
|
||||
*/
|
||||
|
||||
ENTRY(bcmp)
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
movl 12(%esp),%edi
|
||||
movl 16(%esp),%esi
|
||||
movl 20(%esp),%edx
|
||||
xorl %eax,%eax /* clear return value */
|
||||
cld /* set compare direction forward */
|
||||
|
||||
movl %edx,%ecx /* compare by words */
|
||||
shrl $2,%ecx
|
||||
repe
|
||||
cmpsl
|
||||
jne L1
|
||||
|
||||
movl %edx,%ecx /* compare remainder by bytes */
|
||||
andl $3,%ecx
|
||||
repe
|
||||
cmpsb
|
||||
je L2
|
||||
|
||||
L1: incl %eax
|
||||
L2: popl %esi
|
||||
popl %edi
|
||||
ret
|
@ -1,87 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from locore.s.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: bcopy.s,v 1.2 1993/10/21 01:40:28 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: bcopy.s,v 1.2 1993/10/21 01:40:28 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* (ov)bcopy (src,dst,cnt)
|
||||
* ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
|
||||
*/
|
||||
|
||||
ENTRY(bcopy)
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl 12(%esp),%esi
|
||||
movl 16(%esp),%edi
|
||||
movl 20(%esp),%ecx
|
||||
cmpl %esi,%edi /* potentially overlapping? */
|
||||
jnb 1f
|
||||
cld /* nope, copy forwards. */
|
||||
shrl $2,%ecx /* copy by words */
|
||||
rep
|
||||
movsl
|
||||
movl 20(%esp),%ecx
|
||||
andl $3,%ecx /* any bytes left? */
|
||||
rep
|
||||
movsb
|
||||
popl %edi
|
||||
popl %esi
|
||||
ret
|
||||
1:
|
||||
addl %ecx,%edi /* copy backwards. */
|
||||
addl %ecx,%esi
|
||||
std
|
||||
andl $3,%ecx /* any fractional bytes? */
|
||||
decl %edi
|
||||
decl %esi
|
||||
rep
|
||||
movsb
|
||||
movl 20(%esp),%ecx /* copy remainder by words */
|
||||
shrl $2,%ecx
|
||||
subl $3,%esi
|
||||
subl $3,%edi
|
||||
rep
|
||||
movsl
|
||||
popl %edi
|
||||
popl %esi
|
||||
cld
|
||||
ret
|
@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1993 Winning Strategies, 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.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Winning Strategies, Inc.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software withough 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.
|
||||
*
|
||||
* $Id: bzero.s,v 1.3 1993/10/21 01:48:29 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: bzero.s,v 1.3 1993/10/21 01:48:29 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* bzero (void *b, size_t len)
|
||||
* write len zero bytes to the string b.
|
||||
*
|
||||
* Written by:
|
||||
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
|
||||
*/
|
||||
|
||||
ENTRY(bzero)
|
||||
pushl %edi
|
||||
pushl %ebx
|
||||
movl 12(%esp),%edi
|
||||
movl 16(%esp),%ecx
|
||||
|
||||
cld /* set fill direction forward */
|
||||
xorl %eax,%eax /* set fill data to 0 */
|
||||
|
||||
/*
|
||||
* if the string is too short, it's really not worth the overhead
|
||||
* of aligning to word boundries, etc. So we jump to a plain
|
||||
* unaligned set.
|
||||
*/
|
||||
cmpl $0x0f,%ecx
|
||||
jle L1
|
||||
|
||||
movl %edi,%edx /* compute misalignment */
|
||||
negl %edx
|
||||
andl $3,%edx
|
||||
movl %ecx,%ebx
|
||||
subl %edx,%ebx
|
||||
|
||||
movl %edx,%ecx /* zero until word aligned */
|
||||
rep
|
||||
stosb
|
||||
|
||||
movl %ebx,%ecx /* zero by words */
|
||||
shrl $2,%ecx
|
||||
rep
|
||||
stosl
|
||||
|
||||
movl %ebx,%ecx
|
||||
andl $3,%ecx /* zero remainder by bytes */
|
||||
L1: rep
|
||||
stosb
|
||||
|
||||
popl %ebx
|
||||
popl %edi
|
||||
ret
|
@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1993 Winning Strategies, 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.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Winning Strategies, Inc.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software withough 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.
|
||||
*
|
||||
* $Id: ffs.s,v 1.3 1993/10/21 01:48:32 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: ffs.s,v 1.3 1993/10/21 01:48:32 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* ffs(value)
|
||||
* finds the first bit set in value and returns the index of
|
||||
* that bit. Bits are numbered starting from 1, starting at the
|
||||
* rightmost bit. A return value of 0 means that the argument
|
||||
* was zero.
|
||||
*
|
||||
* Written by:
|
||||
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
|
||||
*/
|
||||
|
||||
ENTRY(ffs)
|
||||
bsfl 4(%esp),%eax
|
||||
jz L1 /* ZF is set if all bits are 0 */
|
||||
incl %eax /* bits numbered from 1, not 0 */
|
||||
ret
|
||||
|
||||
.align 2
|
||||
L1: xorl %eax,%eax /* clear result */
|
||||
ret
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1993 Winning Strategies, 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.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Winning Strategies, Inc.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software withough 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.
|
||||
*
|
||||
* $Id: index.s,v 1.2 1993/10/21 01:40:31 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: index.s,v 1.2 1993/10/21 01:40:31 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* index(s, c)
|
||||
* return a pointer to the first occurance of the character c in
|
||||
* string s, or NULL if c does not occur in the string.
|
||||
*
|
||||
* %edx - pointer iterating through string
|
||||
* %eax - pointer to first occurance of 'c'
|
||||
* %cl - character we're comparing against
|
||||
* %bl - character at %edx
|
||||
*
|
||||
* Written by:
|
||||
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
|
||||
*/
|
||||
|
||||
ENTRY(index)
|
||||
pushl %ebx
|
||||
movl 8(%esp),%eax
|
||||
movb 12(%esp),%cl
|
||||
.align 2,0x90
|
||||
L1:
|
||||
movb (%eax),%bl
|
||||
cmpb %bl,%cl /* found char??? */
|
||||
je L2
|
||||
incl %eax
|
||||
testb %bl,%bl /* null terminator??? */
|
||||
jne L1
|
||||
xorl %eax,%eax
|
||||
L2:
|
||||
popl %ebx
|
||||
ret
|
@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1993 Winning Strategies, 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.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Winning Strategies, Inc.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software withough 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.
|
||||
*
|
||||
* $Id: memchr.s,v 1.2 1993/10/21 01:40:32 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: memchr.s,v 1.2 1993/10/21 01:40:32 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* memchr (b, c, len)
|
||||
* locates the first occurance of c in string b.
|
||||
*
|
||||
* Written by:
|
||||
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
|
||||
*/
|
||||
|
||||
ENTRY(memchr)
|
||||
pushl %edi
|
||||
movl 8(%esp),%edi /* string address */
|
||||
movl 12(%esp),%eax /* set character to search for */
|
||||
movl 16(%esp),%ecx /* set length of search */
|
||||
testl %eax,%eax /* clear Z flag, for len == 0 */
|
||||
cld /* set search forward */
|
||||
repne /* search! */
|
||||
scasb
|
||||
jnz L1 /* scan failed, return null */
|
||||
leal -1(%edi),%eax /* adjust result of scan */
|
||||
popl %edi
|
||||
ret
|
||||
.align 2,0x90
|
||||
L1: xorl %eax,%eax
|
||||
popl %edi
|
||||
ret
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1993 Winning Strategies, 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.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Winning Strategies, Inc.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software withough 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.
|
||||
*
|
||||
* $Id: memcmp.s,v 1.2 1993/10/21 01:40:33 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: memcmp.s,v 1.2 1993/10/21 01:40:33 jtc Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* memcmp (void *b1, void *b2, size_t len)
|
||||
*
|
||||
* Written by:
|
||||
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
|
||||
*/
|
||||
|
||||
ENTRY(memcmp)
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
movl 12(%esp),%edi
|
||||
movl 16(%esp),%esi
|
||||
movl 20(%esp),%edx
|
||||
cld /* set compare direction forward */
|
||||
|
||||
movl %edx,%ecx /* compare by words */
|
||||
shrl $2,%ecx
|
||||
repe
|
||||
cmpsl
|
||||
jne L5 /* do we match so far? */
|
||||
|
||||
movl %edx,%ecx /* compare remainder by bytes */
|
||||
andl $3,%ecx
|
||||
repe
|
||||
cmpsb
|
||||
jne L6 /* do we match? */
|
||||
|
||||
xorl %eax,%eax /* we match, return zero */
|
||||
popl %esi
|
||||
popl %edi
|
||||
ret
|
||||
|
||||
L5: movl $4,%ecx /* We know that one of the next */
|
||||
subl %ecx,%edi /* four pairs of bytes do not */
|
||||
subl %ecx,%esi /* match. */
|
||||
repe
|
||||
cmpsb
|
||||
L6: movsbl -1(%edi),%eax /* Perform unsigned comparison */
|
||||
movsbl -1(%esi),%edx
|
||||
subl %edx,%eax
|
||||
popl %esi
|
||||
popl %edi
|
||||
ret
|
@ -1,79 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)Ovfork.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: Ovfork.s,v 1.3 1993/10/21 02:19:25 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: Ovfork.s,v 1.3 1993/10/21 02:19:25 jtc 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.
|
||||
*
|
||||
*/
|
||||
.set vfork,66
|
||||
ENTRY(vfork)
|
||||
popl %ecx /* my rta into ecx */
|
||||
movl $vfork, %eax
|
||||
LCALL(7,0)
|
||||
jb verror
|
||||
vforkok:
|
||||
cmpl $0,%edx /* child process? */
|
||||
jne child /* yes */
|
||||
jmp parent
|
||||
.globl _errno
|
||||
verror:
|
||||
#ifdef PIC
|
||||
PIC_PROLOGUE
|
||||
movl PIC_GOT(_errno), %edx
|
||||
movl %eax,(%edx)
|
||||
PIC_EPILOGUE
|
||||
#else
|
||||
movl %eax,_errno
|
||||
#endif
|
||||
movl $-1,%eax
|
||||
jmp %ecx
|
||||
child:
|
||||
movl $0,%eax
|
||||
parent:
|
||||
jmp %ecx
|
@ -1,93 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)brk.s 5.2 (Berkeley) 12/17/90
|
||||
* $Id: brk.s,v 1.2 1993/10/21 02:19:26 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: brk.s,v 1.2 1993/10/21 02:19:26 jtc Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
#define SYS_brk 17
|
||||
|
||||
.globl curbrk
|
||||
.globl minbrk
|
||||
ENTRY(_brk)
|
||||
jmp ok
|
||||
|
||||
ENTRY(brk)
|
||||
#ifdef PIC
|
||||
movl 4(%esp),%eax
|
||||
PIC_PROLOGUE
|
||||
movl %edx,PIC_GOT(curbrk) # set up GOT addressing
|
||||
movl %ecx,PIC_GOT(minbrk) #
|
||||
cmpl %eax,(%ecx)
|
||||
PIC_EPILOGUE
|
||||
jl ok
|
||||
movl (%ecx),%eax
|
||||
movl %eax,4(%esp)
|
||||
ok:
|
||||
lea SYS_brk,%eax
|
||||
LCALL(7,0)
|
||||
jb err
|
||||
movl 4(%esp),%eax
|
||||
movl %eax,(%edx)
|
||||
movl $0,%eax
|
||||
ret
|
||||
err:
|
||||
jmp PIC_PLT(cerror)
|
||||
|
||||
#else
|
||||
|
||||
movl 4(%esp),%eax
|
||||
cmpl %eax,minbrk
|
||||
jl ok
|
||||
movl minbrk,%eax
|
||||
movl %eax,4(%esp)
|
||||
ok:
|
||||
lea SYS_brk,%eax
|
||||
LCALL(7,0)
|
||||
jb err
|
||||
movl 4(%esp),%eax
|
||||
movl %eax,curbrk
|
||||
movl $0,%eax
|
||||
ret
|
||||
err:
|
||||
jmp cerror
|
||||
#endif
|
@ -1,58 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)cerror.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: cerror.s,v 1.2 1993/10/21 02:19:27 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: cerror.s,v 1.2 1993/10/21 02:19:27 jtc Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
.globl _errno
|
||||
cerror:
|
||||
#ifdef PIC
|
||||
PIC_PROLOGUE
|
||||
movl PIC_GOT(_errno),%ecx
|
||||
movl %eax,(%ecx)
|
||||
PIC_EPILOGUE
|
||||
#else
|
||||
movl %eax,_errno
|
||||
#endif
|
||||
movl $-1,%eax
|
||||
ret
|
@ -1,56 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)exect.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: exect.s,v 1.2 1993/10/21 02:19:28 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: exect.s,v 1.2 1993/10/21 02:19:28 jtc Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
#include <machine/psl.h>
|
||||
|
||||
ENTRY(exect)
|
||||
lea SYS_execve,%eax
|
||||
pushf
|
||||
popl %edx
|
||||
orl $PSL_T,%edx
|
||||
pushl %edx
|
||||
popf
|
||||
LCALL(7,0)
|
||||
jmp cerror /* exect(file, argv, env); */
|
@ -1,52 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fork.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: fork.s,v 1.2 1993/10/21 02:19:30 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: fork.s,v 1.2 1993/10/21 02:19:30 jtc Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
SYSCALL(fork)
|
||||
cmpl $0,%edx /* parent, since %edx == 0 in parent, 1 in child */
|
||||
je 1f
|
||||
movl $0,%eax
|
||||
1:
|
||||
ret /* pid = fork(); */
|
@ -1,49 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)mount.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: mount.s,v 1.2 1993/10/21 02:19:31 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: mount.s,v 1.2 1993/10/21 02:19:31 jtc Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
SYSCALL(mount)
|
||||
movl $0,%eax
|
||||
ret
|
@ -1,52 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)pipe.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: pipe.s,v 1.2 1993/10/21 02:19:32 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: pipe.s,v 1.2 1993/10/21 02:19:32 jtc Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
SYSCALL(pipe)
|
||||
movl 4(%esp),%ecx
|
||||
movl %eax,(%ecx)
|
||||
movl %edx,4(%ecx)
|
||||
movl $0,%eax
|
||||
ret
|
@ -1,62 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)ptrace.s 5.1 (Berkeley) 4/23/90
|
||||
* $Id: ptrace.s,v 1.2 1993/10/21 02:19:33 jtc Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: ptrace.s,v 1.2 1993/10/21 02:19:33 jtc Exp $"
|
||||
#endif /* SYSLIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
ENTRY(ptrace)
|
||||
xorl %eax,%eax
|
||||
#ifdef PIC
|
||||
PIC_PROLOGUE
|
||||
movl PIC_GOT(_errno),%edx
|
||||
movl %eax,(%edx)
|
||||
PIC_EPILOGUE
|
||||
#else
|
||||
movl %eax,_errno
|
||||
#endif
|
||||
lea SYS_ptrace,%eax
|
||||
LCALL(7,0)
|
||||
jb err
|
||||
ret
|
||||
err:
|
||||
jmp cerror
|
@ -1,88 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)_setjmp.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: _setjmp.s,v 1.1 1993/11/25 23:36:47 paulus Exp $"
|
||||
#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.
|
||||
*/
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
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 _longjmperror
|
||||
stop #0
|
@ -1,53 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)adddf3.s 5.1 (Berkeley) 6/7/90"*/
|
||||
.asciz "$Id: adddf3.s,v 1.1 1993/11/25 23:36:48 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/* double + double */
|
||||
ENTRY(__adddf3)
|
||||
fmoved sp@(4),fp0
|
||||
faddd sp@(12),fp0
|
||||
fmoved fp0,sp@-
|
||||
movel sp@+,d0
|
||||
movel sp@+,d1
|
||||
rts
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)addsf3.s 5.1 (Berkeley) 6/7/90"*/
|
||||
.asciz "$Id: addsf3.s,v 1.1 1993/11/25 23:36:49 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/* single + single */
|
||||
ENTRY(__addsf3)
|
||||
fmoves sp@(4),fp0
|
||||
fadds sp@(8),fp0
|
||||
fmoves fp0,d0
|
||||
rts
|
@ -1,56 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)alloca.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: alloca.s,v 1.1 1993/11/25 23:36:50 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* like alloc, but automatic free in return */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(alloca)
|
||||
movl sp@,a0 /* 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 */
|
||||
jmp a0@ /* funny return */
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)ashlsi3.s 5.1 (Berkeley) 6/7/90"*/
|
||||
.asciz "$Id: ashlsi3.s,v 1.1 1993/11/25 23:36:51 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/* int << int */
|
||||
ENTRY(__ashlsi3)
|
||||
movel sp@(8),d1
|
||||
movel sp@(4),d0
|
||||
asll d1,d0
|
||||
rts
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)ashrsi3.s 5.1 (Berkeley) 6/7/90"*/
|
||||
.asciz "$Id: ashrsi3.s,v 1.1 1993/11/25 23:36:52 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/* int >> int */
|
||||
ENTRY(__ashrsi3)
|
||||
movel sp@(8),d1
|
||||
movel sp@(4),d0
|
||||
asrl d1,d0
|
||||
rts
|
@ -1,50 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)htonl.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: htonl.s,v 1.1 1993/11/25 23:37:39 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* netorder = htonl(hostorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(htonl)
|
||||
movl sp@(4),d0
|
||||
rts
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)htons.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: htons.s,v 1.1 1993/11/25 23:37:42 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* hostorder = htons(netorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(htons)
|
||||
clrl d0
|
||||
movw sp@(6),d0
|
||||
rts
|
@ -1,50 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)ntohl.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: ntohl.s,v 1.1 1993/11/25 23:37:43 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* hostorder = ntohl(netorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(ntohl)
|
||||
movl sp@(4),d0
|
||||
rts
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)ntohs.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: ntohs.s,v 1.1 1993/11/25 23:37:44 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* hostorder = ntohs(netorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(ntohs)
|
||||
clrl d0
|
||||
movw sp@(6),d0
|
||||
rts
|
@ -1,53 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)abs.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: abs.s,v 1.1 1993/11/25 23:38:12 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* abs - int absolute value */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(abs)
|
||||
movl sp@(4),d0
|
||||
jge L1
|
||||
negl d0
|
||||
L1:
|
||||
rts
|
@ -1,91 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)bcmp.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: bcmp.s,v 1.1 1993/11/25 23:38:23 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* bcmp(s1, s2, n) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* This is probably not the best we can do, but it is still 2-10 times
|
||||
* faster than the C version in the portable gen directory.
|
||||
*
|
||||
* Things that might help:
|
||||
* - longword align when possible (only on the 68020)
|
||||
* - use nested DBcc instructions or use one and limit size to 64K
|
||||
*/
|
||||
ENTRY(bcmp)
|
||||
movl sp@(4),a0 /* string 1 */
|
||||
movl sp@(8),a1 /* string 2 */
|
||||
movl sp@(12),d0 /* length */
|
||||
jeq bcdone /* if zero, nothing to do */
|
||||
movl a0,d1
|
||||
btst #0,d1 /* string 1 address odd? */
|
||||
jeq bceven /* no, skip alignment */
|
||||
cmpmb a0@+,a1@+ /* yes, compare a byte */
|
||||
jne bcnoteq /* not equal, return non-zero */
|
||||
subql #1,d0 /* adjust count */
|
||||
jeq bcdone /* count 0, reutrn zero */
|
||||
bceven:
|
||||
movl a1,d1
|
||||
btst #0,d1 /* string 2 address odd? */
|
||||
jne bcbloop /* yes, no hope for alignment, compare bytes */
|
||||
movl d0,d1 /* no, both even */
|
||||
lsrl #2,d1 /* convert count to longword count */
|
||||
jeq bcbloop /* count 0, skip longword loop */
|
||||
bclloop:
|
||||
cmpml a0@+,a1@+ /* compare a longword */
|
||||
jne bcnoteq /* not equal, return non-zero */
|
||||
subql #1,d1 /* adjust count */
|
||||
jne bclloop /* still more, keep comparing */
|
||||
andl #3,d0 /* what remains */
|
||||
jeq bcdone /* nothing, all done */
|
||||
bcbloop:
|
||||
cmpmb a0@+,a1@+ /* compare a byte */
|
||||
jne bcnoteq /* not equal, return non-zero */
|
||||
subql #1,d0 /* adjust count */
|
||||
jne bcbloop /* still more, keep going */
|
||||
rts
|
||||
bcnoteq:
|
||||
moveq #1,d0
|
||||
bcdone:
|
||||
rts
|
@ -1,114 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)bcopy.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: bcopy.s,v 1.1 1993/11/25 23:38:26 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* This is probably not the best we can do, but it is still 2-10 times
|
||||
* faster than the C version in the portable gen directory.
|
||||
*
|
||||
* Things that might help:
|
||||
* - unroll the longword copy loop (might not be good for a 68020)
|
||||
* - longword align when possible (only on the 68020)
|
||||
* - use nested DBcc instructions or use one and limit size to 64K
|
||||
*/
|
||||
ENTRY(bcopy)
|
||||
movl sp@(12),d1 /* check count */
|
||||
jle bcdone /* <= 0, don't do anything */
|
||||
movl sp@(4),a0 /* src address */
|
||||
movl sp@(8),a1 /* dest address */
|
||||
cmpl a1,a0 /* src after dest? */
|
||||
jlt bcback /* yes, must copy backwards */
|
||||
movl a0,d0
|
||||
btst #0,d0 /* src address odd? */
|
||||
jeq bcfeven /* no, skip alignment */
|
||||
movb a0@+,a1@+ /* yes, copy a byte */
|
||||
subql #1,d1 /* adjust count */
|
||||
jeq bcdone /* count 0, all done */
|
||||
bcfeven:
|
||||
movl a1,d0
|
||||
btst #0,d0 /* dest address odd? */
|
||||
jne bcfbloop /* yes, no hope for alignment, copy bytes */
|
||||
movl d1,d0 /* no, both even */
|
||||
lsrl #2,d0 /* convert count to longword count */
|
||||
jeq bcfbloop /* count 0, skip longword loop */
|
||||
bcflloop:
|
||||
movl a0@+,a1@+ /* copy a longword */
|
||||
subql #1,d0 /* adjust count */
|
||||
jne bcflloop /* still more, keep copying */
|
||||
andl #3,d1 /* what remains */
|
||||
jeq bcdone /* nothing, all done */
|
||||
bcfbloop:
|
||||
movb a0@+,a1@+ /* copy a byte */
|
||||
subql #1,d1 /* adjust count */
|
||||
jne bcfbloop /* still more, keep going */
|
||||
bcdone:
|
||||
rts
|
||||
bcback:
|
||||
addl d1,a0 /* src pointer to end */
|
||||
addl d1,a1 /* dest pointer to end */
|
||||
movl a0,d0
|
||||
btst #0,d0 /* src address odd? */
|
||||
jeq bcbeven /* no, skip alignment */
|
||||
movb a0@-,a1@- /* yes, copy a byte */
|
||||
subql #1,d1 /* adjust count */
|
||||
jeq bcdone /* count 0, all done */
|
||||
bcbeven:
|
||||
movl a1,d0
|
||||
btst #0,d0 /* dest address odd? */
|
||||
jne bcbbloop /* yes, no hope for alignment, copy bytes */
|
||||
movl d1,d0 /* no, both even */
|
||||
lsrl #2,d0 /* convert count to longword count */
|
||||
jeq bcbbloop /* count 0, skip longword loop */
|
||||
bcblloop:
|
||||
movl a0@-,a1@- /* copy a longword */
|
||||
subql #1,d0 /* adjust count */
|
||||
jne bcblloop /* still more, keep copying */
|
||||
andl #3,d1 /* what remains */
|
||||
jeq bcdone /* nothing, all done */
|
||||
bcbbloop:
|
||||
movb a0@-,a1@- /* copy a byte */
|
||||
subql #1,d1 /* adjust count */
|
||||
jne bcbbloop /* still more, keep going */
|
||||
rts
|
||||
|
@ -1,80 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)bzero.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: bzero.s,v 1.1 1993/11/25 23:38:27 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* This is probably not the best we can do, but it is still much
|
||||
* faster than the C version in the portable gen directory.
|
||||
*
|
||||
* Things that might help:
|
||||
* - unroll the longword loop (might not be good for a 68020)
|
||||
* - longword, as opposed to word, align when possible (only on the 68020)
|
||||
* - use nested DBcc instructions or use one and limit size to 64K
|
||||
*/
|
||||
ENTRY(bzero)
|
||||
movl sp@(4),a0 /* destination */
|
||||
movl sp@(8),d0 /* count */
|
||||
jeq bzdone /* nothing to do */
|
||||
movl a0,d1
|
||||
btst #0,d1 /* address odd? */
|
||||
jeq bzeven /* no, skip alignment */
|
||||
clrb a0@+ /* yes, clear a byte */
|
||||
subql #1,d0 /* adjust count */
|
||||
jeq bzdone /* if zero, all done */
|
||||
bzeven:
|
||||
movl d0,d1
|
||||
lsrl #2,d1 /* convert to longword count */
|
||||
jeq bzbloop /* no longwords, skip loop */
|
||||
bzlloop:
|
||||
clrl a0@+ /* clear a longword */
|
||||
subql #1,d1 /* adjust count */
|
||||
jne bzlloop /* still more, keep going */
|
||||
andl #3,d0 /* what remains */
|
||||
jeq bzdone /* nothing, all done */
|
||||
bzbloop:
|
||||
clrb a0@+ /* clear a byte */
|
||||
subql #1,d0 /* adjust count */
|
||||
jne bzbloop /* still more, keep going */
|
||||
bzdone:
|
||||
rts
|
@ -1,58 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)ffs.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: ffs.s,v 1.2 1993/11/30 00:45:15 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* bit = ffs(value) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(ffs)
|
||||
moveq #-1,d0
|
||||
movl sp@(4),d1
|
||||
jeq done
|
||||
again:
|
||||
addql #1,d0
|
||||
btst d0,d1
|
||||
jeq again
|
||||
done:
|
||||
addql #1,d0
|
||||
rts
|
@ -1,58 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)index.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: index.s,v 1.1 1993/11/25 23:38:29 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(index)
|
||||
movl sp@(4),a0 /* string */
|
||||
movb sp@(11),d0 /* char to look for */
|
||||
ixloop:
|
||||
cmpb a0@,d0 /* found our char? */
|
||||
jeq ixfound /* yes, break out */
|
||||
tstb a0@+ /* null? */
|
||||
jne ixloop /* no, keep going */
|
||||
moveq #0,d0 /* not found, return null */
|
||||
rts
|
||||
ixfound:
|
||||
movl a0,d0 /* found, return pointer */
|
||||
rts
|
@ -1,58 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)rindex.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: rindex.s,v 1.1 1993/11/25 23:38:30 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(rindex)
|
||||
movl sp@(4),a0 /* string */
|
||||
movb sp@(11),d0 /* char to look for */
|
||||
subl a1,a1 /* clear rindex pointer */
|
||||
rixloop:
|
||||
cmpb a0@,d0 /* found our char? */
|
||||
jne rixnope /* no, check for null */
|
||||
movl a0,a1 /* yes, remember location */
|
||||
rixnope:
|
||||
tstb a0@+ /* null? */
|
||||
jne rixloop /* no, keep going */
|
||||
movl a1,d0 /* return value */
|
||||
rts
|
@ -1,66 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)strcmp.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: strcmp.s,v 1.1 1993/11/25 23:38:31 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* NOTE: this guy returns result compatible with the VAX assembly version.
|
||||
* The C version on the portable gen directory returns different results
|
||||
* (different signs!) when comparing chars with the high bit on. Who is
|
||||
* right??
|
||||
*/
|
||||
ENTRY(strcmp)
|
||||
movl sp@(4),a0 /* a0 = string1 */
|
||||
movl sp@(8),a1 /* a1 = string2 */
|
||||
scloop:
|
||||
movb a0@+,d0 /* get *string1 */
|
||||
cmpb a1@+,d0 /* compare a byte */
|
||||
jne scexit /* not equal, break out */
|
||||
tstb d0 /* at end of string1? */
|
||||
jne scloop /* no, keep going */
|
||||
moveq #0,d0 /* strings are equal */
|
||||
rts
|
||||
scexit:
|
||||
subb a1@-,d0 /* *string1 - *string2 */
|
||||
extbl d0
|
||||
rts
|
@ -1,88 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)Ovfork.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: Ovfork.s,v 1.1 1993/11/25 23:39:23 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
* @(#)vfork.s 4.1 (Berkeley) 12/21/80
|
||||
* C library -- vfork
|
||||
*/
|
||||
|
||||
/*
|
||||
* pid = vfork();
|
||||
*
|
||||
* d1 == 0 in parent process, d1 == 1 in child process.
|
||||
* d0 == pid of child in parent, d0 == pid of parent in child.
|
||||
*
|
||||
* trickery here, due to keith sklower, uses ret to clear the stack,
|
||||
* and then returns with a jump indirect, since only one person can return
|
||||
* with a ret off this stack... we do the ret before we vfork!
|
||||
*/
|
||||
|
||||
vfork = 66
|
||||
.globl _vfork
|
||||
|
||||
_vfork:
|
||||
movl sp@+,a0
|
||||
movl #vfork,d0
|
||||
trap #0
|
||||
jcc vforkok
|
||||
jra verror
|
||||
vforkok:
|
||||
tstl d1 /* child process ? */
|
||||
jne child /* yes */
|
||||
jcc parent /* if c-bit not set, fork ok */
|
||||
verror:
|
||||
.globl _errno
|
||||
#ifdef PIC
|
||||
movel #__GLOBAL_OFFSET_TABLE_,a1
|
||||
lea pc@(0,a1:l),a1
|
||||
movl a1@(_errno:w),a1
|
||||
movl d0,a1@
|
||||
#else
|
||||
movl d0,_errno
|
||||
#endif
|
||||
moveq #-1,d0
|
||||
jmp a0@
|
||||
child:
|
||||
clrl d0
|
||||
parent:
|
||||
jmp a0@
|
@ -1,78 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)brk.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: brk.s,v 1.1 1993/11/25 23:39:24 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
#define SYS_brk 17
|
||||
|
||||
.globl curbrk
|
||||
.globl minbrk
|
||||
ENTRY(brk)
|
||||
#ifdef PIC
|
||||
movl #__GLOBAL_OFFSET_TABLE_,a1
|
||||
lea pc@(0,a1:l),a1
|
||||
movl a1@(minbrk:w),a0
|
||||
movl a0@,d0
|
||||
#else
|
||||
movl minbrk,d0
|
||||
#endif
|
||||
cmpl sp@(4),d0
|
||||
jle ok
|
||||
movl d0,sp@(4)
|
||||
ok:
|
||||
movl #SYS_brk,d0
|
||||
trap #0
|
||||
jcs err
|
||||
#ifdef PIC
|
||||
movl a1@(curbrk:w),a0
|
||||
movl sp@(4),a0@
|
||||
#else
|
||||
movl sp@(4),curbrk
|
||||
#endif
|
||||
clrl d0
|
||||
rts
|
||||
err:
|
||||
#ifdef PIC
|
||||
movl d0,sp@-
|
||||
#endif
|
||||
jra cerror
|
@ -1,59 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)cerror.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: cerror.s,v 1.1 1993/11/25 23:39:25 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
.even
|
||||
.globl _errno
|
||||
cerror:
|
||||
#ifdef PIC
|
||||
movl #__GLOBAL_OFFSET_TABLE_,a0
|
||||
lea pc@(0,a0:l),a0
|
||||
movl a0@(_errno:w),a0
|
||||
| Note: error # passed in on stack, because we might come in via the binder
|
||||
movl sp@+,a0@
|
||||
#else
|
||||
movl d0,_errno
|
||||
#endif
|
||||
movl #-1,d0
|
||||
rts
|
@ -1,53 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)exect.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: exect.s,v 1.1 1993/11/25 23:39:26 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
#include <machine/psl.h>
|
||||
|
||||
ENTRY(exect)
|
||||
movl #SYS_execve,d0
|
||||
trap #0
|
||||
#ifdef PIC
|
||||
movl d0,sp@-
|
||||
#endif
|
||||
jra cerror /* exect(file, argv, env) */
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)fork.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: fork.s,v 1.1 1993/11/25 23:39:27 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
SYSCALL(fork)
|
||||
tstl d1
|
||||
jeq parent /* parent, since d1 == 0 in parent, 1 in child */
|
||||
clrl d0
|
||||
parent:
|
||||
rts /* pid = fork() */
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)pipe.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: pipe.s,v 1.1 1993/11/25 23:39:28 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
SYSCALL(pipe)
|
||||
movl sp@(4),a0
|
||||
movl d0,a0@+
|
||||
movl d1,a0@
|
||||
clrl d0
|
||||
rts
|
@ -1,65 +0,0 @@
|
||||
/*-
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.text
|
||||
/*.asciz "from: @(#)ptrace.s 5.1 (Berkeley) 5/12/90"*/
|
||||
.asciz "$Id: ptrace.s,v 1.1 1993/11/25 23:39:30 paulus Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
.globl _errno
|
||||
|
||||
ENTRY(ptrace)
|
||||
#ifdef PIC
|
||||
movl #__GLOBAL_OFFSET_TABLE_,a0
|
||||
lea pc@(0,a0:l),a0
|
||||
movl a0@(_errno:w),a0
|
||||
clrl a0@
|
||||
#else
|
||||
clrl _errno
|
||||
#endif
|
||||
movl #SYS_ptrace,d0
|
||||
trap #0
|
||||
jcs err
|
||||
rts
|
||||
err:
|
||||
#ifdef PIC
|
||||
movl d0,sp@-
|
||||
#endif
|
||||
jra cerror
|
@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: _setjmp.s,v 1.1 1993/10/07 00:20:14 cgd Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
#include <machine/jmpbuf.h>
|
||||
|
||||
ENTRY(_setjmp)
|
||||
movd 4(sp), r2 /* jmp_buf */
|
||||
movd 0(sp), JMP_BUF_PC(r2) /* pc of caller */
|
||||
|
||||
sprd sp, JMP_BUF_SP(r2)
|
||||
sprd fp, JMP_BUF_FP(r2)
|
||||
sprd sb, JMP_BUF_SB(r2)
|
||||
movd r3, JMP_BUF_R3(r2) /* save registers r3-r7 */
|
||||
movd r4, JMP_BUF_R4(r2)
|
||||
movd r5, JMP_BUF_R5(r2)
|
||||
movd r6, JMP_BUF_R6(r2)
|
||||
movd r7, JMP_BUF_R7(r2)
|
||||
|
||||
movqd 0, r0
|
||||
ret 0
|
||||
|
||||
ENTRY(_longjmp)
|
||||
movd 4(sp), r2 /* jmp_buf */
|
||||
movd 8(sp), r0 /* value */
|
||||
|
||||
lprd sp, JMP_BUF_SP(r2)
|
||||
lprd fp, JMP_BUF_FP(r2)
|
||||
lprd sb, JMP_BUF_SB(r2)
|
||||
movd JMP_BUF_R3(r2), r3 /* load registers r3-r7 */
|
||||
movd JMP_BUF_R4(r2), r4
|
||||
movd JMP_BUF_R5(r2), r5
|
||||
movd JMP_BUF_R6(r2), r6
|
||||
movd JMP_BUF_R7(r2), r7
|
||||
|
||||
movd JMP_BUF_PC(r2), 0(sp) /* patch return pc */
|
||||
|
||||
cmpqd 0, r0
|
||||
bne nonzero
|
||||
movqd 1, r0
|
||||
nonzero:
|
||||
ret 0
|
||||
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: alloca.s,v 1.1 1993/10/07 00:20:15 cgd Exp $
|
||||
*/
|
||||
/*
|
||||
* Note: Saved registers are accessed through the frame pointer so
|
||||
* no special magic is required here.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(alloca)
|
||||
movd tos,r2 /* get return address */
|
||||
movd tos,r1 /* get length */
|
||||
sprd sp,r0
|
||||
subd r1,r0
|
||||
lprd sp,r0
|
||||
movd r1,tos
|
||||
jump 0(r2)
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: fabs.s,v 1.1 1993/10/07 00:20:16 cgd Exp $
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(fabs)
|
||||
absl S_ARG0,f0
|
||||
ret 0
|
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Tero Kivinen (kivinen) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: frexp.s,v 1.1 1993/10/07 00:20:17 cgd Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
double frexp(value, eptr)
|
||||
double value;
|
||||
int *eptr;
|
||||
|
||||
The frexp subroutine returns the mantissa of a double value
|
||||
as a double quantity, x, of magnitude less than one and
|
||||
greater than or equal to 0.5 (0.5 <= |x| < 1) and stores an
|
||||
integer n such that value = x*2**n indirectly through eptr.
|
||||
|
||||
One exception: if the given value is 0, then x and *eptr are made
|
||||
zero.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(frexp)
|
||||
enter [],8
|
||||
movd 12(fp),r1 /* value, high 32 bit */
|
||||
cmpd 0,r1 /* check if 0 */
|
||||
beq frexp_zero /* we do not support denormalized values */
|
||||
movd r1,r2
|
||||
bicd 0x7ff00000,r2 /* clear exponent */
|
||||
ord 0x3fe00000,r2 /* set it to 1024 == exponent -11 == .5-1 */
|
||||
lshd -20,r1 /* extract exponent */
|
||||
andd 0x7ff,r1 /* 11 lower bits */
|
||||
subd 1022,r1 /* unbias exponent */
|
||||
movd r1,0(16(fp))
|
||||
movd 8(fp),-8(fp) /* value, low 32 bit */
|
||||
movd r2,-4(fp) /* value without exponent, high 32 bit */
|
||||
movl -8(fp),f0 /* load return value */
|
||||
exit []
|
||||
ret 0
|
||||
frexp_zero:
|
||||
movqd 0,0(16(fp)) /* return exp = 0, mantissa = 9 */
|
||||
movdl 0,f0
|
||||
exit []
|
||||
ret 0
|
||||
|
@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Tero Kivinen (kivinen) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: ldexp.s,v 1.1 1993/10/07 00:20:21 cgd Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* double ldexp (value, exp)
|
||||
* double value;
|
||||
* int exp;
|
||||
*
|
||||
* Ldexp returns value*2**exp, if that result is in range.
|
||||
* If underflow occurs, it returns zero. If overflow occurs,
|
||||
* it returns a value of appropriate sign and largest
|
||||
* possible magnitude. In case of either overflow or underflow,
|
||||
* errno is set to ERANGE. Note that errno is not modified if
|
||||
* no error occurs.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
#define ERANGE 34
|
||||
|
||||
.globl EX(errno)
|
||||
|
||||
ENTRY(ldexp)
|
||||
enter [],8
|
||||
movd 12(fp),r1 /* get value, high 32 bit */
|
||||
lshd -20,r1 /* extract exponent */
|
||||
andd 0x7ff,r1 /* 11 lower bits */
|
||||
subd 1023,r1 /* unbias exponent */
|
||||
movd 16(fp),r0 /* get exp */
|
||||
addd r1,r0 /* add exponents */
|
||||
cmpd r0,1023 /* most positive exponent */
|
||||
bgt ldexp_overflow /* too large */
|
||||
cmpd r0,-1022 /* most negative exponent */
|
||||
blt ldexp_underflow /* too small */
|
||||
addd 1023,r0 /* bias exponent */
|
||||
lshd 20,r0 /* convert exponent back to its place */
|
||||
movd 12(fp),r1 /* get value high 32 bit */
|
||||
bicd 0x7ff00000,r1 /* clear exponent */
|
||||
ord r0,r1 /* insert exponent */
|
||||
movd r1,-4(fp) /* put high 32 bit to local variable */
|
||||
movd 8(fp),-8(fp) /* value low 32 bit to local variable */
|
||||
movl -8(fp),f0 /* return value * 2**exp */
|
||||
exit []
|
||||
ret 0 /* neither */
|
||||
ldexp_underflow:
|
||||
movdl 0d0e0,f0 /* if underflow return 0, set errno */
|
||||
movd ERANGE,@EX(errno)
|
||||
exit []
|
||||
ret 0
|
||||
ldexp_overflow:
|
||||
movl @huge,f0 /* if overflow return HUGE */
|
||||
movdl 0d0e0,f2
|
||||
cmpl f2,8(fp) /* check original sign */
|
||||
bgt ldexp_positive
|
||||
negl f0,f0 /* if negative, return -HUGE */
|
||||
ldexp_positive:
|
||||
movd ERANGE,@EX(errno) /* set errno */
|
||||
exit []
|
||||
ret 0
|
||||
|
||||
huge: .long 0xffffffff /* the largest number that can */
|
||||
.long 0x7fefffff /* be represented in a long floating */
|
||||
/* number. This is given in hex in order */
|
||||
/* to avoid floating conversions */
|
@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Tero Kivinen (kivinen) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: modf.s,v 1.1 1993/10/07 00:20:22 cgd Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* double modf (value, iptr)
|
||||
* double value, *iptr;
|
||||
*
|
||||
* Modf returns the fractional part of "value",
|
||||
* and stores the integer part indirectly through "iptr".
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(modf)
|
||||
FRAME
|
||||
movl 8(fp),f0 /* value */
|
||||
movd 12(fp),r0 /* higher 32 bit of value */
|
||||
lshd -20,r0 /* extract exponent */
|
||||
andd 0x7ff,r0 /* 11 lower bits */
|
||||
cmpd r0,1023+30 /* compare if it's int part can fit in int */
|
||||
bgt modf_overflow /* nope else it's ok to truncld it to int*/
|
||||
truncld f0,r0 /* get integer part */
|
||||
movdl r0,f2 /* convert back to float */
|
||||
movl f2,0(16(fp)) /* move integer part to *iptr */
|
||||
subl f2,f0 /* return fract. part = value - *iptr */
|
||||
EMARF
|
||||
ret 0
|
||||
modf_overflow:
|
||||
subd 1023+20,r0 /* bias 1023, and upper part of
|
||||
floating point mantissa part */
|
||||
movqd -1,r2 /* generate mask to get fract. part */
|
||||
cmpd r0,32 /* if value > 2^52 (20+32) then all int part */
|
||||
bhi modf_all_ip
|
||||
negd r0,r0 /* shift right */
|
||||
lshd r0,r2 /* here */
|
||||
comd r2,r2 /* get fractional part complement mask */
|
||||
movd 8(fp),r1 /* get lower 32 bit of value */
|
||||
andd r2,r1 /* mask fractional part off leave ip part */
|
||||
movd r1,0(16(fp)) /* store ip part to *iptr */
|
||||
movd 12(fp),4(16(fp)) /* store other half to *iptr */
|
||||
subl 0(16(fp)),f0 /* return fract. part = value - *iptr */
|
||||
EMARF
|
||||
ret 0
|
||||
modf_all_ip:
|
||||
movl 8(fp),0(16(fp)) /* copy value to *iptr */
|
||||
movdl 0,f0 /* return 0 for fract. part */
|
||||
EMARF
|
||||
ret 0
|
@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: setjmp.s,v 1.1 1993/10/07 00:20:24 cgd Exp $
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
#include <machine/jmpbuf.h>
|
||||
|
||||
ENTRY(setjmp)
|
||||
movqd 0, tos
|
||||
bsr EX(sigblock)
|
||||
adjspb -4
|
||||
movd 4(sp), r2 /* jmp_buf */
|
||||
movd 0(sp), JMP_BUF_PC(r2) /* pc of caller */
|
||||
movd r0, JMP_BUF_SIGMASK(r2) /* save mask */
|
||||
|
||||
sprd sp, JMP_BUF_SP(r2)
|
||||
sprd fp, JMP_BUF_FP(r2)
|
||||
sprd sb, JMP_BUF_SB(r2)
|
||||
movd r3, JMP_BUF_R3(r2) /* save registers r3-r7 */
|
||||
movd r4, JMP_BUF_R4(r2)
|
||||
movd r5, JMP_BUF_R5(r2)
|
||||
movd r6, JMP_BUF_R6(r2)
|
||||
movd r7, JMP_BUF_R7(r2)
|
||||
|
||||
movqd 0, r0
|
||||
ret 0
|
||||
|
||||
ENTRY(longjmp)
|
||||
movd 4(sp),r2 /* jmp_buf */
|
||||
movd JMP_BUF_SIGMASK(r2), tos /* restore mask */
|
||||
bsr EX(sigsetmask)
|
||||
adjspb -4
|
||||
movd 4(sp), r2 /* jmp_buf */
|
||||
movd 8(sp), r0 /* value */
|
||||
|
||||
lprd sp, JMP_BUF_SP(r2)
|
||||
lprd fp, JMP_BUF_FP(r2)
|
||||
lprd sb, JMP_BUF_SB(r2)
|
||||
movd JMP_BUF_R3(r2), r3 /* load registers r3-r7 */
|
||||
movd JMP_BUF_R4(r2), r4
|
||||
movd JMP_BUF_R5(r2), r5
|
||||
movd JMP_BUF_R6(r2), r6
|
||||
movd JMP_BUF_R7(r2), r7
|
||||
movd JMP_BUF_PC(r2), 0(sp) /* patch return pc */
|
||||
|
||||
cmpqd 0, r0
|
||||
bne nonzero
|
||||
movqd 1, r0
|
||||
nonzero:
|
||||
ret 0
|
||||
|
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Mach Operating System
|
||||
* Copyright (c) 1992 Carnegie Mellon University
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON AND HELSINKI UNIVERSITY OF TECHNOLOGY ALLOW FREE USE
|
||||
* OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON AND
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIM ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie Mellon
|
||||
* the rights to redistribute these changes.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 11-May-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: ntoh.s,v 1.1 1993/10/07 00:20:29 cgd Exp $
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
.text
|
||||
Entry(ntohl)
|
||||
ENTRY(htonl)
|
||||
movd S_ARG0,r0
|
||||
rotw 8,r0
|
||||
rotd 16,r0
|
||||
rotw 8,r0
|
||||
ret 0
|
||||
|
||||
|
||||
Entry(ntohs)
|
||||
ENTRY(htons)
|
||||
movzwd S_ARG0,r0
|
||||
rotw 8,r0
|
||||
ret 0
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: abs.s,v 1.1 1993/10/07 00:20:37 cgd Exp $
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(abs)
|
||||
absd S_ARG0,r0
|
||||
ret 0
|
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: Ovfork.s,v 1.1 1993/10/07 00:20:49 cgd Exp $
|
||||
*/
|
||||
|
||||
#include <syscall.h>
|
||||
#include "SYS.h"
|
||||
|
||||
/*
|
||||
* r0 = pid of child in parent / pid of parent in child
|
||||
* r1 = 0 in parent, 1 in child
|
||||
*/
|
||||
SYSCALL(vfork)
|
||||
cmpqd 0,r1
|
||||
beq parent
|
||||
movqd 0,r0
|
||||
parent:
|
||||
ret 0
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 11-May-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: brk.s,v 1.1 1993/10/07 00:20:51 cgd Exp $
|
||||
*/
|
||||
|
||||
#include <sys/syscall.h>
|
||||
#include "SYS.h"
|
||||
|
||||
.globl _curbrk
|
||||
.globl _minbrk
|
||||
|
||||
ENTRY(_brk)
|
||||
br ok
|
||||
|
||||
ENTRY(brk)
|
||||
cmpd S_ARG0, _minbrk(pc)
|
||||
bge ok
|
||||
movd _minbrk(pc), S_ARG0
|
||||
ok:
|
||||
movd SYS_break,r0
|
||||
SVC
|
||||
bcs cerror
|
||||
movd S_ARG0, _curbrk(pc)
|
||||
movqd 0, r0
|
||||
ret 0
|
@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: cerror.s,v 1.1 1993/10/07 00:20:52 cgd Exp $
|
||||
*/
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
.globl cerror
|
||||
.globl _errno
|
||||
|
||||
cerror:
|
||||
movd r0,_errno(pc)
|
||||
movd -1,r0
|
||||
ret 0
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: exect.s,v 1.1 1993/10/07 00:20:53 cgd Exp $
|
||||
*/
|
||||
|
||||
#include "SYS.h"
|
||||
#include <machine/psl.h>
|
||||
|
||||
ENTRY(exect)
|
||||
sprb us,r0
|
||||
orb PSR_T,r0
|
||||
lprb us,r0
|
||||
movd SYS_execve,r0
|
||||
SVC
|
||||
bcs cerror
|
||||
ret 0
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: fork.s,v 1.1 1993/10/07 00:20:56 cgd Exp $
|
||||
*/
|
||||
|
||||
#include <sys/syscall.h>
|
||||
#include "SYS.h"
|
||||
|
||||
/* r0 = pid. r1 = 0 in parent, 1 in child */
|
||||
|
||||
SYSCALL(fork)
|
||||
cmpqd 0, r1
|
||||
beq parent
|
||||
movqd 0, r0
|
||||
parent:
|
||||
ret 0 /* pid = fork() */
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: mount.s,v 1.1 1993/10/07 00:20:57 cgd Exp $
|
||||
*/
|
||||
|
||||
#include <syscall.h>
|
||||
#include "SYS.h"
|
||||
|
||||
SYSCALL(mount)
|
||||
movqd 0,r0
|
||||
ret 0
|
@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: pipe.s,v 1.1 1993/10/07 00:20:57 cgd Exp $
|
||||
*/
|
||||
|
||||
#include <sys/syscall.h>
|
||||
#include <SYS.h>
|
||||
|
||||
SYSCALL(pipe)
|
||||
movd S_ARG0, r2
|
||||
movd r0, 0(r2)
|
||||
movd r1, 4(r2)
|
||||
movqd 0, r0
|
||||
ret 0
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Helsinki University of Technology
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
|
||||
* ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
|
||||
* LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||
* USE OF THIS SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
|
||||
* Created.
|
||||
*
|
||||
* $Id: ptrace.s,v 1.1 1993/10/07 00:20:58 cgd Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is included for the NetBSD version!
|
||||
*/
|
||||
|
||||
#include <syscall.h>
|
||||
#include "SYS.h"
|
||||
|
||||
.globl EX(errno)
|
||||
.globl cerror
|
||||
|
||||
ENTRY(ptrace)
|
||||
movqd 0, EX(errno)
|
||||
movd SYS_ptrace, r0
|
||||
SVC
|
||||
bcs cerror
|
||||
ret 0
|
@ -1,90 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: _setjmp.s,v 1.1 91/07/06 16:45:53 torek Exp
|
||||
* $Id: _setjmp.s,v 1.1 1993/10/07 00:21:26 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)_setjmp.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
* C library -- _setjmp, _longjmp
|
||||
*
|
||||
* _longjmp(a,v)
|
||||
* will generate a "return(v?v:1)" from
|
||||
* the last call to
|
||||
* _setjmp(a)
|
||||
* by unwinding the call stack.
|
||||
* The previous signal state is NOT restored.
|
||||
*/
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(_setjmp)
|
||||
std %sp, [%o0+0] /* caller's stack pointer and return pc */
|
||||
st %fp, [%o0+8] /* store caller's frame pointer */
|
||||
retl
|
||||
clr %o0 ! return 0
|
||||
|
||||
ENTRY(_longjmp)
|
||||
addcc %o1, %g0, %g6 ! compute v ? v : 1 in a global register
|
||||
be,a 0f
|
||||
mov 1, %g6
|
||||
0:
|
||||
mov %o0, %g1 ! save a in another global register
|
||||
ld [%g1+8], %g7 /* get caller's frame */
|
||||
1:
|
||||
cmp %fp, %g7 ! compare against desired frame
|
||||
bl,a 1b ! if below,
|
||||
restore ! pop frame and loop
|
||||
be,a 2f ! if there,
|
||||
ldd [%g1+0], %o2 ! fetch return %sp and pc, and get out
|
||||
|
||||
Lbotch:
|
||||
call _longjmperror ! otherwise, went too far; bomb out
|
||||
nop
|
||||
unimp 0
|
||||
|
||||
2:
|
||||
cmp %o2, %sp ! %sp must not decrease
|
||||
bge,a 3f
|
||||
mov %o2, %sp ! it is OK, put it in place
|
||||
b,a Lbotch
|
||||
3:
|
||||
jmp %o3 + 8 ! success, return %g6
|
||||
mov %g6, %o0
|
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: fabs.s,v 1.4 91/10/07 23:59:05 torek Exp
|
||||
* $Id: fabs.s,v 1.1 1993/10/07 00:21:30 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)fabs.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* fabs - floating absolute value */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(fabs)
|
||||
std %o0, [%sp + 32] ! return value => %f0:f1
|
||||
ldd [%sp + 32], %f0 ! (via kernel %o0/%o1 slot)
|
||||
retl
|
||||
fabss %f0, %f0 ! return absolute value
|
@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: fixunsdfsi.s,v 1.3 91/10/08 00:03:15 torek Exp
|
||||
* $Id: fixunsdfsi.s,v 1.1 1993/10/07 00:21:32 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)fixunsdfsi.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
* Convert double to unsigned integer (for gcc).
|
||||
*
|
||||
* I have made the output for NaN agree with the Sun compiler, not
|
||||
* that it really matters, by using `fbul,a'.
|
||||
*/
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
.align 8
|
||||
Lbig:
|
||||
.word 0x41e00000 ! .double 0r2147483648.0e+00
|
||||
.word 0 ! (who me, not trust the assembler?)
|
||||
|
||||
ENTRY(__fixunsdfsi)
|
||||
sub %sp, 8, %sp
|
||||
std %o0, [%sp + 64] ! get argument into fpu reg
|
||||
ldd [%sp + 64], %f0
|
||||
sethi %hi(Lbig), %g1
|
||||
ldd [%g1 + %lo(Lbig)], %f2
|
||||
fcmped %f0, %f2 ! d < 2^31, or NaN, or -Inf?
|
||||
nop ! (fpop2 delay)
|
||||
fbul,a 1f ! if so, use fdtoi to convert to int
|
||||
fdtoi %f0, %f0 ! (this includes negatives!)
|
||||
|
||||
! d does not fit in an int, so subtract 2^31, convert,
|
||||
! and add 2^31 again (sigh). Just hope the intermediate
|
||||
! fits (if not, the result is undefined anyway).
|
||||
|
||||
fsubd %f0, %f2, %f0 ! d -= 2^31
|
||||
fdtoi %f0, %f0 ! convert to int
|
||||
st %f0, [%sp + 64] ! move into return reg
|
||||
ld [%sp + 64], %o0
|
||||
sethi %hi(0x80000000), %o1
|
||||
add %o0, %o1, %o0 ! add 2^31
|
||||
retl
|
||||
add %sp, 8, %sp
|
||||
|
||||
1:
|
||||
st %f0, [%sp + 64] ! return result
|
||||
ld [%sp + 64], %o0
|
||||
retl
|
||||
add %sp, 8, %sp
|
@ -1,185 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: modf.s,v 1.3 92/06/20 00:00:54 torek Exp
|
||||
* $Id: modf.s,v 1.1 1993/10/07 00:21:37 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)modf.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
#include <machine/fsr.h>
|
||||
|
||||
/*
|
||||
* double modf(double val, double *iptr)
|
||||
*
|
||||
* Returns the fractional part of `val', storing the integer part of
|
||||
* `val' in *iptr. Both *iptr and the return value have the same sign
|
||||
* as `val'.
|
||||
*
|
||||
* Method:
|
||||
*
|
||||
* We use the fpu's normalization hardware to compute the integer portion
|
||||
* of the double precision argument. Sun IEEE double precision numbers
|
||||
* have 52 bits of mantissa, 11 bits of exponent, and one bit of sign,
|
||||
* with the sign occupying bit 31 of word 0, and the exponent bits 30:20
|
||||
* of word 0. Thus, values >= 2^52 are by definition integers.
|
||||
*
|
||||
* If we take a value that is in the range [+0..2^52) and add 2^52, all
|
||||
* of the fractional bits fall out and all of the integer bits are summed
|
||||
* with 2^52. If we then subtract 2^52, we get those integer bits back.
|
||||
* This must be done with rounding set to `towards 0' or `towards -inf'.
|
||||
* `Toward -inf' fails when the value is 0 (we get -0 back)....
|
||||
*
|
||||
* Note that this method will work anywhere, but is machine dependent in
|
||||
* various aspects.
|
||||
*
|
||||
* Stack usage:
|
||||
* 4@[%fp - 4] saved %fsr
|
||||
* 4@[%fp - 8] new %fsr with rounding set to `towards 0'
|
||||
* 8@[%fp - 16] space for moving between %i and %f registers
|
||||
* Register usage:
|
||||
* %i0%i1 double val;
|
||||
* %l0 scratch
|
||||
* %l1 sign bit (0x80000000)
|
||||
* %i2 double *iptr;
|
||||
* %f2:f3 `magic number' 2^52, in fpu registers
|
||||
* %f4:f5 double v, in fpu registers
|
||||
*/
|
||||
|
||||
.align 8
|
||||
Lmagic:
|
||||
.word 0x43300000 ! sign = 0, exponent = 52 + 1023, mantissa = 0
|
||||
.word 0 ! (i.e., .double 0r4503599627370496e+00)
|
||||
|
||||
L0:
|
||||
.word 0 ! 0.0
|
||||
.word 0
|
||||
|
||||
ENTRY(modf)
|
||||
save %sp, -64-16, %sp
|
||||
|
||||
/*
|
||||
* First, compute v = abs(val) by clearing sign bit,
|
||||
* and then set up the fpu registers. This would be
|
||||
* much easier if we could do alu operations on fpu registers!
|
||||
*/
|
||||
sethi 0x80000000, %l1 ! sign bit
|
||||
andn %i0, %l1, %l0
|
||||
st %l0, [%fp - 16]
|
||||
sethi %hi(Lmagic), %l0
|
||||
ldd [%l0 + %lo(Lmagic)], %f2
|
||||
st %i1, [%fp - 12]
|
||||
ldd [%fp - 16], %f4 ! %f4:f5 = v
|
||||
|
||||
/*
|
||||
* Is %f4:f5 >= %f2:f3 ? If so, it is all integer bits.
|
||||
* It is probably less, though.
|
||||
*/
|
||||
fcmped %f4, %f2
|
||||
nop ! fpop2 delay
|
||||
fbuge Lbig ! if >= (or unordered), go out
|
||||
nop
|
||||
|
||||
/*
|
||||
* v < 2^52, so add 2^52, then subtract 2^52, but do it all
|
||||
* with rounding set towards zero. We leave any enabled
|
||||
* traps enabled, but change the rounding mode. This might
|
||||
* not be so good. Oh well....
|
||||
*/
|
||||
st %fsr, [%fp - 4] ! %l5 = current FSR mode
|
||||
set FSR_RD, %l3 ! %l3 = rounding direction mask
|
||||
ld [%fp - 4], %l5
|
||||
set FSR_RD_RZ << FSR_RD_SHIFT, %l4
|
||||
andn %l5, %l3, %l6
|
||||
or %l6, %l4, %l6 ! round towards zero, please
|
||||
and %l5, %l3, %l5 ! save original rounding mode
|
||||
st %l6, [%fp - 8]
|
||||
ld [%fp - 8], %fsr
|
||||
|
||||
faddd %f4, %f2, %f4 ! %f4:f5 += 2^52
|
||||
fsubd %f4, %f2, %f4 ! %f4:f5 -= 2^52
|
||||
|
||||
/*
|
||||
* Restore %fsr, but leave exceptions accrued.
|
||||
*/
|
||||
st %fsr, [%fp - 4]
|
||||
ld [%fp - 4], %l6
|
||||
andn %l6, %l3, %l6 ! %l6 = %fsr & ~FSR_RD;
|
||||
or %l5, %l6, %l5 ! %l5 |= %l6;
|
||||
st %l5, [%fp - 4]
|
||||
ld [%fp - 4], %fsr ! restore %fsr, leaving accrued stuff
|
||||
|
||||
/*
|
||||
* Now insert the original sign in %f4:f5.
|
||||
* This is a lot of work, so it is conditional here.
|
||||
*/
|
||||
btst %l1, %i0
|
||||
be 1f
|
||||
nop
|
||||
st %f4, [%fp - 16]
|
||||
ld [%fp - 16], %g1
|
||||
or %l1, %g1, %g1
|
||||
st %g1, [%fp - 16]
|
||||
ld [%fp - 16], %f4
|
||||
1:
|
||||
|
||||
/*
|
||||
* The value in %f4:f5 is now the integer portion of the original
|
||||
* argument. We need to store this in *ival (%i2), subtract it
|
||||
* from the original value argument (%i0:i1), and return the result.
|
||||
*/
|
||||
std %f4, [%i2] ! *ival = %f4:f5;
|
||||
std %i0, [%fp - 16]
|
||||
ldd [%fp - 16], %f0 ! %f0:f1 = val;
|
||||
fsubd %f0, %f4, %f0 ! %f0:f1 -= %f4:f5;
|
||||
ret
|
||||
restore
|
||||
|
||||
Lbig:
|
||||
/*
|
||||
* We get here if the original comparison of %f4:f5 (v) to
|
||||
* %f2:f3 (2^52) came out `greater or unordered'. In this
|
||||
* case the integer part is the original value, and the
|
||||
* fractional part is 0.
|
||||
*/
|
||||
sethi %hi(L0), %l0
|
||||
std %f0, [%i2] ! *ival = val;
|
||||
ldd [%l0 + %lo(L0)], %f0 ! return 0.0;
|
||||
ret
|
||||
restore
|
@ -1,155 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: mul.s,v 1.5 92/06/25 13:24:03 torek Exp
|
||||
* $Id: mul.s,v 1.1 1993/10/07 00:21:38 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)mul.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
* Signed multiply, from Appendix E of the Sparc Version 8
|
||||
* Architecture Manual.
|
||||
*
|
||||
* Returns %o0 * %o1 in %o1%o0 (i.e., %o1 holds the upper 32 bits of
|
||||
* the 64-bit product).
|
||||
*
|
||||
* This code optimizes short (less than 13-bit) multiplies.
|
||||
*/
|
||||
|
||||
#include "DEFS.h"
|
||||
FUNC(.mul)
|
||||
mov %o0, %y ! multiplier -> Y
|
||||
andncc %o0, 0xfff, %g0 ! test bits 12..31
|
||||
be Lmul_shortway ! if zero, can do it the short way
|
||||
andcc %g0, %g0, %o4 ! zero the partial product and clear N and V
|
||||
|
||||
/*
|
||||
* Long multiply. 32 steps, followed by a final shift step.
|
||||
*/
|
||||
mulscc %o4, %o1, %o4 ! 1
|
||||
mulscc %o4, %o1, %o4 ! 2
|
||||
mulscc %o4, %o1, %o4 ! 3
|
||||
mulscc %o4, %o1, %o4 ! 4
|
||||
mulscc %o4, %o1, %o4 ! 5
|
||||
mulscc %o4, %o1, %o4 ! 6
|
||||
mulscc %o4, %o1, %o4 ! 7
|
||||
mulscc %o4, %o1, %o4 ! 8
|
||||
mulscc %o4, %o1, %o4 ! 9
|
||||
mulscc %o4, %o1, %o4 ! 10
|
||||
mulscc %o4, %o1, %o4 ! 11
|
||||
mulscc %o4, %o1, %o4 ! 12
|
||||
mulscc %o4, %o1, %o4 ! 13
|
||||
mulscc %o4, %o1, %o4 ! 14
|
||||
mulscc %o4, %o1, %o4 ! 15
|
||||
mulscc %o4, %o1, %o4 ! 16
|
||||
mulscc %o4, %o1, %o4 ! 17
|
||||
mulscc %o4, %o1, %o4 ! 18
|
||||
mulscc %o4, %o1, %o4 ! 19
|
||||
mulscc %o4, %o1, %o4 ! 20
|
||||
mulscc %o4, %o1, %o4 ! 21
|
||||
mulscc %o4, %o1, %o4 ! 22
|
||||
mulscc %o4, %o1, %o4 ! 23
|
||||
mulscc %o4, %o1, %o4 ! 24
|
||||
mulscc %o4, %o1, %o4 ! 25
|
||||
mulscc %o4, %o1, %o4 ! 26
|
||||
mulscc %o4, %o1, %o4 ! 27
|
||||
mulscc %o4, %o1, %o4 ! 28
|
||||
mulscc %o4, %o1, %o4 ! 29
|
||||
mulscc %o4, %o1, %o4 ! 30
|
||||
mulscc %o4, %o1, %o4 ! 31
|
||||
mulscc %o4, %o1, %o4 ! 32
|
||||
mulscc %o4, %g0, %o4 ! final shift
|
||||
|
||||
! If %o0 was negative, the result is
|
||||
! (%o0 * %o1) + (%o1 << 32))
|
||||
! We fix that here.
|
||||
|
||||
tst %o0
|
||||
bge 1f
|
||||
rd %y, %o0
|
||||
|
||||
! %o0 was indeed negative; fix upper 32 bits of result by subtracting
|
||||
! %o1 (i.e., return %o4 - %o1 in %o1).
|
||||
retl
|
||||
sub %o4, %o1, %o1
|
||||
|
||||
1:
|
||||
retl
|
||||
mov %o4, %o1
|
||||
|
||||
Lmul_shortway:
|
||||
/*
|
||||
* Short multiply. 12 steps, followed by a final shift step.
|
||||
* The resulting bits are off by 12 and (32-12) = 20 bit positions,
|
||||
* but there is no problem with %o0 being negative (unlike above).
|
||||
*/
|
||||
mulscc %o4, %o1, %o4 ! 1
|
||||
mulscc %o4, %o1, %o4 ! 2
|
||||
mulscc %o4, %o1, %o4 ! 3
|
||||
mulscc %o4, %o1, %o4 ! 4
|
||||
mulscc %o4, %o1, %o4 ! 5
|
||||
mulscc %o4, %o1, %o4 ! 6
|
||||
mulscc %o4, %o1, %o4 ! 7
|
||||
mulscc %o4, %o1, %o4 ! 8
|
||||
mulscc %o4, %o1, %o4 ! 9
|
||||
mulscc %o4, %o1, %o4 ! 10
|
||||
mulscc %o4, %o1, %o4 ! 11
|
||||
mulscc %o4, %o1, %o4 ! 12
|
||||
mulscc %o4, %g0, %o4 ! final shift
|
||||
|
||||
/*
|
||||
* %o4 has 20 of the bits that should be in the low part of the
|
||||
* result; %y has the bottom 12 (as %y's top 12). That is:
|
||||
*
|
||||
* %o4 %y
|
||||
* +----------------+----------------+
|
||||
* | -12- | -20- | -12- | -20- |
|
||||
* +------(---------+------)---------+
|
||||
* --hi-- ----low-part----
|
||||
*
|
||||
* The upper 12 bits of %o4 should be sign-extended to form the
|
||||
* high part of the product (i.e., highpart = %o4 >> 20).
|
||||
*/
|
||||
|
||||
rd %y, %o5
|
||||
sll %o4, 12, %o0 ! shift middle bits left 12
|
||||
srl %o5, 20, %o5 ! shift low bits right 20, zero fill at left
|
||||
or %o5, %o0, %o0 ! construct low part of result
|
||||
retl
|
||||
sra %o4, 20, %o1 ! ... and extract high part of result
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: saveregs.s,v 1.1 91/07/06 17:22:33 torek Exp
|
||||
* $Id: saveregs.s,v 1.1 1993/10/07 00:21:39 cgd Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* Save register arguments in caller's `arg dump' area, so that
|
||||
* stdarg functions work.
|
||||
*
|
||||
* This really should be done with a pointer to the arg dump area;
|
||||
* our caller should allocate that area, not our caller's caller.
|
||||
* But then, they did not let me invent the calling sequence....
|
||||
*
|
||||
* We assume the caller has executed a `save' instruction.
|
||||
*/
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(__builtin_saveregs)
|
||||
st %i0, [%fp + 0x44] ! fr->fr_argd[0]
|
||||
st %i1, [%fp + 0x48] ! fr->fr_argd[1]
|
||||
st %i2, [%fp + 0x4c] ! fr->fr_argd[2]
|
||||
st %i3, [%fp + 0x50] ! fr->fr_argd[3]
|
||||
st %i4, [%fp + 0x54] ! fr->fr_argd[4]
|
||||
retl
|
||||
st %i5, [%fp + 0x58] ! fr->fr_argd[5]
|
@ -1,114 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: setjmp.s,v 1.2 92/06/25 03:18:43 torek Exp
|
||||
* $Id: setjmp.s,v 1.1 1993/10/07 00:21:40 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)setjmp.s 8.1 (Berkeley) 6/4/93"
|
||||
#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>
|
||||
*/
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
ENTRY(setjmp)
|
||||
/*
|
||||
* We use the caller's `arg dump' area (%sp+0x44; there are 6 ints
|
||||
* reserved there for us) to avoid having to allocate stack space
|
||||
* here.
|
||||
*/
|
||||
mov %o0, %o2 /* build sigcontext in [%o2] */
|
||||
mov 1, %o0 /* SIG_BLOCK */
|
||||
mov SYS_sigprocmask, %g1
|
||||
clr %o1 /* sigprocmask(SIG_BLOCK, (sigset_t *)NULL) */
|
||||
t ST_SYSCALL
|
||||
st %o0, [%o2 + 4] /* sc.sc_mask = current mask; */
|
||||
mov SYS_sigaltstack, %g1
|
||||
clr %o0 /* sigstack(NULL, &foo) */
|
||||
add %sp, 0x48, %o1 /* (foo being in arg dump area) */
|
||||
t ST_SYSCALL
|
||||
ld [%sp + 0x50], %o0 /* foo.ss_flags */
|
||||
and %o0, 1, %o1 /* onstack = foo.ss_flags & 1; */
|
||||
st %o0, [%o2 + 0] /* sc.sc_onstack = current onstack; */
|
||||
st %sp, [%o2 + 8] /* sc.sc_sp = sp (both ours and caller's) */
|
||||
add %o7, 8, %o0
|
||||
st %o0, [%o2 + 12] /* sc.sc_pc = return_pc */
|
||||
add %o7, 12, %o0
|
||||
st %o0, [%o2 + 16] /* sc.sc_npc = return_pc + 4 */
|
||||
st %g0, [%o2 + 20] /* sc.sc_psr = (clean psr) */
|
||||
st %fp, [%o2 + 24] /* sc.sc_g1 = %fp (misuse, but what the heck) */
|
||||
/* sc.sc_o0 = random(), set in longjmp */
|
||||
retl /* return 0 */
|
||||
clr %o0
|
||||
|
||||
/*
|
||||
* All we need to do here is force sigreturn to load a new stack pointer,
|
||||
* new <pc,npc>, and appropriate %o0 return value from the sigcontext built
|
||||
* in setjmp. The %i and %l registers will be reloaded from the place to
|
||||
* which %sp points, due to sigreturn() semantics (sigreturn does not modify
|
||||
* the window pointer in the psr, hence it must force all windows to reload).
|
||||
*/
|
||||
ENTRY(longjmp)
|
||||
save %sp, -96, %sp
|
||||
ld [%i0 + 8], %o2 /* make sure sc->sc_sp, sc->sc_fp nonzero */
|
||||
ld [%i0 + 24], %o3
|
||||
orcc %o2, %o3, %g0
|
||||
bz Lbotch
|
||||
tst %i1 /* if (v == 0) v = 1; */
|
||||
bz,a 1f
|
||||
mov 1, %i1
|
||||
1:
|
||||
st %i1, [%i0 + 28] /* sc.sc_o0 = v; */
|
||||
mov SYS_sigreturn, %g1
|
||||
mov %i0, %o0
|
||||
t ST_SYSCALL /* sigreturn(scp); */
|
||||
|
||||
Lbotch:
|
||||
/* oops, caller botched it */
|
||||
call _longjmperror
|
||||
nop
|
||||
unimp 0
|
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: htonl.s,v 1.1 92/06/25 12:47:05 torek Exp
|
||||
* $Id: htonl.s,v 1.1 1993/10/07 00:21:46 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)htonl.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* netorder = htonl(hostorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(htonl)
|
||||
retl
|
||||
nop
|
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: htons.s,v 1.1 92/06/25 12:47:05 torek Exp
|
||||
* $Id: htons.s,v 1.1 1993/10/07 00:21:47 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)htons.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* netorder = htons(hostorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(htons)
|
||||
sethi %hi(0xffff0000), %o1
|
||||
retl
|
||||
andn %o0, %o1, %o0
|
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: ntohl.s,v 1.1 92/06/25 12:47:06 torek Exp
|
||||
* $Id: ntohl.s,v 1.1 1993/10/07 00:21:48 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)ntohl.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* hostorder = ntohl(netorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(ntohl)
|
||||
retl
|
||||
nop
|
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: ntohs.s,v 1.1 92/06/25 12:47:07 torek Exp
|
||||
* $Id: ntohs.s,v 1.1 1993/10/07 00:21:49 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)ntohs.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* hostorder = ntohs(netorder) */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(ntohs)
|
||||
sethi %hi(0xffff0000), %o1
|
||||
retl
|
||||
andn %o0, %o1, %o0
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: abs.s,v 1.1 91/07/06 18:01:57 torek Exp
|
||||
* $Id: abs.s,v 1.1 1993/10/07 00:21:56 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)abs.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/* abs - int absolute value */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(abs)
|
||||
tst %o0
|
||||
bl,a 1f
|
||||
neg %o0
|
||||
1: retl
|
||||
nop
|
@ -1,146 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: bzero.s,v 1.1 92/06/25 12:52:46 torek Exp
|
||||
* $Id: bzero.s,v 1.1 1993/10/07 00:22:00 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)bzero.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* bzero(addr, len)
|
||||
*
|
||||
* We should unroll the loop, but at the moment this would
|
||||
* gain nothing since the `std' instructions are what limits us.
|
||||
*/
|
||||
ENTRY(bzero)
|
||||
! %o0 = addr, %o1 = len
|
||||
|
||||
! Optimize a common case: addr and len are both multiples of 8.
|
||||
or %o0, %o1, %o2
|
||||
btst 7, %o2 ! ((addr | len) & 7) != 0?
|
||||
bnz 1f ! if so, cannot optimize
|
||||
clr %g1 ! in any case, we want g1=0
|
||||
|
||||
/* `Good' operands, can just store doubles. */
|
||||
0:
|
||||
deccc 8, %o1 ! while ((len -= 8) >= 0)
|
||||
bge,a 0b
|
||||
std %g0, [%o0 + %o1] ! *(quad *)(addr + len) = 0;
|
||||
retl
|
||||
nop
|
||||
|
||||
/*
|
||||
* Either the address is unaligned, or the count is not a
|
||||
* multiple of 8, or both. We will have to align the address
|
||||
* in order to use anything `better' than stb.
|
||||
*/
|
||||
1:
|
||||
cmp %o1, 15 ! len >= 15?
|
||||
bge,a Lstd ! yes, use std
|
||||
btst 1, %o0 ! (but first check alignment)
|
||||
|
||||
! not enough to bother: do byte-at-a-time loop.
|
||||
2:
|
||||
deccc %o1 ! while (--len >= 0)
|
||||
bge,a 2b
|
||||
stb %g0, [%o0 + %o1] ! addr[len] = 0;
|
||||
retl
|
||||
nop
|
||||
|
||||
Lstd:
|
||||
/*
|
||||
* There are at least 15 bytes to zero.
|
||||
* We may have to zero some initial stuff to align
|
||||
* the address.
|
||||
*/
|
||||
bz,a 1f ! if (addr & 1) {
|
||||
btst 2, %o0
|
||||
stb %g0, [%o0] ! *addr = 0;
|
||||
inc %o0 ! addr++;
|
||||
dec %o1 ! len--;
|
||||
btst 2, %o0 ! }
|
||||
1:
|
||||
bz,a 1f ! if (addr & 2) {
|
||||
btst 4, %o0
|
||||
sth %g0, [%o0] ! *(short *)addr = 0;
|
||||
inc 2, %o0 ! addr += 2;
|
||||
dec 2, %o1 ! len -= 2;
|
||||
btst 4, %o0 ! }
|
||||
1:
|
||||
bz 1f ! if (addr & 4) {
|
||||
dec 8, %o1
|
||||
st %g0, [%o0] ! *(int *)addr = 0;
|
||||
inc 4, %o0 ! addr += 4;
|
||||
dec 4, %o1 ! len -= 4;
|
||||
! }
|
||||
/*
|
||||
* Address is double word aligned; len is 8 less than
|
||||
* the number of bytes remaining (i.e., len is 0 if
|
||||
* the remaining count is 8, 1 if it is 9, etc.).
|
||||
*/
|
||||
1:
|
||||
std %g0, [%o0] ! do {
|
||||
2: ! *(quad *)addr = 0;
|
||||
inc 8, %o0 ! addr += 8;
|
||||
deccc 8, %o1 ! } while ((len -= 8) >= 0);
|
||||
bge,a 2b
|
||||
std %g0, [%o0]
|
||||
|
||||
/*
|
||||
* Len is in [-8..-1] where -8 => done, -7 => 1 byte to zero,
|
||||
* -6 => two bytes, etc. Mop up this remainder, if any.
|
||||
*/
|
||||
btst 4, %o1
|
||||
bz 1f ! if (len & 4) {
|
||||
btst 2, %o1
|
||||
st %g0, [%o0] ! *(int *)addr = 0;
|
||||
inc 4, %o0 ! addr += 4;
|
||||
1:
|
||||
bz 1f ! if (len & 2) {
|
||||
btst 1, %o1
|
||||
sth %g0, [%o0] ! *(short *)addr = 0;
|
||||
inc 2, %o0 ! addr += 2;
|
||||
1:
|
||||
bnz,a 1f ! if (len & 1)
|
||||
stb %g0, [%o0] ! *addr = 0;
|
||||
1:
|
||||
retl
|
||||
nop
|
@ -1,109 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: ffs.s,v 1.3 92/07/07 00:23:57 torek Exp
|
||||
* $Id: ffs.s,v 1.1 1993/10/07 00:22:05 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)ffs.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
/*
|
||||
* ffs returns the number of the rightmost bit set in its argument,
|
||||
* i.e., the lowest value such that (x & (ffs(x) - 1)) is nonzero.
|
||||
* If no bits are set, ffs returns 0.
|
||||
*
|
||||
* We use a table lookup on each byte.
|
||||
*
|
||||
* In each section below, %o1 is the current byte (0, 1, 2, or 3).
|
||||
* The last byte is handled specially: for the first three,
|
||||
* if that byte is nonzero, we return the table value
|
||||
* (plus 0, 8, or 16 for the byte number), but for the last
|
||||
* one, we just return the table value plus 24. This means
|
||||
* that ffstab[0] must be -24 so that ffs(0) will return 0.
|
||||
*/
|
||||
ENTRY(ffs)
|
||||
set ffstab, %o2
|
||||
andcc %o0, 0xff, %o1 ! get low byte
|
||||
be,a 1f ! try again if 0
|
||||
srl %o0, 8, %o0 ! delay slot, get ready for next byte
|
||||
|
||||
retl ! return ffstab[%o1]
|
||||
ldsb [%o2 + %o1], %o0
|
||||
|
||||
1:
|
||||
andcc %o0, 0xff, %o1 ! byte 1 like byte 0...
|
||||
be,a 2f
|
||||
srl %o0, 8, %o0 ! (use delay to prepare for byte 2)
|
||||
|
||||
ldsb [%o2 + %o1], %o0
|
||||
retl ! return ffstab[%o1] + 8
|
||||
add %o0, 8, %o0
|
||||
|
||||
2:
|
||||
andcc %o0, 0xff, %o1
|
||||
be,a 3f
|
||||
srl %o0, 8, %o0 ! (prepare for byte 3)
|
||||
|
||||
ldsb [%o2 + %o1], %o0
|
||||
retl ! return ffstab[%o1] + 16
|
||||
add %o0, 16, %o0
|
||||
|
||||
3: ! just return ffstab[%o0] + 24
|
||||
ldsb [%o2 + %o0], %o0
|
||||
retl
|
||||
add %o0, 24, %o0
|
||||
|
||||
ffstab:
|
||||
.byte -24,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 00-0f */
|
||||
.byte 5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 10-1f */
|
||||
.byte 6,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 20-2f */
|
||||
.byte 5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 30-3f */
|
||||
.byte 7,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 40-4f */
|
||||
.byte 5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 50-5f */
|
||||
.byte 6,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 60-6f */
|
||||
.byte 5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 70-7f */
|
||||
.byte 8,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 80-8f */
|
||||
.byte 5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* 10-9f */
|
||||
.byte 6,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* a0-af */
|
||||
.byte 5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* b0-bf */
|
||||
.byte 7,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* c0-cf */
|
||||
.byte 5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* d0-df */
|
||||
.byte 6,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* e0-ef */
|
||||
.byte 5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1 /* f0-ff */
|
@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Header: strlen.s,v 1.1 92/06/25 12:52:47 torek Exp
|
||||
* $Id: strlen.s,v 1.1 1993/10/07 00:22:07 cgd Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)strlen.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
ENTRY(strlen)
|
||||
add %o0, 1, %o1 ! save starting point + 1
|
||||
1:
|
||||
ldsb [%o0], %o2 ! fetch byte
|
||||
tst %o2 ! null?
|
||||
bne 1b ! no, keep going
|
||||
inc %o0 ! always increment pointer
|
||||
retl
|
||||
sub %o0, %o1, %o0 ! return length (ptr - (origptr+1))
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user