Mon Dec 14 01:07:43 2009 UTC ()
Merge from matt-nb5-mips64.


(matt)
diff -r1.8 -r1.9 src/lib/libc/arch/mips/Makefile.inc
diff -r1.18 -r1.19 src/lib/libc/arch/mips/SYS.h
diff -r0 -r1.2 src/lib/libc/arch/mips/genassym.cf
diff -r1.29 -r1.30 src/lib/libc/arch/mips/gen/Makefile.inc
diff -r1.5 -r1.6 src/lib/libc/arch/mips/gen/_resumecontext.S
diff -r1.20 -r1.21 src/lib/libc/arch/mips/gen/_setjmp.S
diff -r1.7 -r1.8 src/lib/libc/arch/mips/gen/fabs.S
diff -r1.8 -r1.9 src/lib/libc/arch/mips/gen/ldexp.S
diff -r1.8 -r1.9 src/lib/libc/arch/mips/gen/sigsetjmp.S
diff -r1.4 -r1.5 src/lib/libc/arch/mips/gen/makecontext.c
diff -r1.10 -r1.11 src/lib/libc/arch/mips/gen/modf.S
diff -r1.17 -r1.18 src/lib/libc/arch/mips/gen/setjmp.S
diff -r1.3 -r1.4 src/lib/libc/arch/mips/gen/swapcontext.S
diff -r0 -r1.2 src/lib/libc/arch/mips/softfloat/milieu.h
diff -r0 -r1.2 src/lib/libc/arch/mips/softfloat/mips-gcc.h
diff -r0 -r1.2 src/lib/libc/arch/mips/softfloat/softfloat.h
diff -r1.4 -r1.5 src/lib/libc/arch/mips/string/Makefile.inc
diff -r1.8 -r1.9 src/lib/libc/arch/mips/string/bcmp.S
diff -r1.8 -r1.9 src/lib/libc/arch/mips/string/bzero.S
diff -r1.7 -r1.8 src/lib/libc/arch/mips/sys/__clone.S
diff -r1.2 -r1.3 src/lib/libc/arch/mips/sys/__sigtramp2.S
diff -r1.5 -r1.6 src/lib/libc/arch/mips/sys/__vfork14.S
diff -r1.5 -r1.6 src/lib/libc/arch/mips/sys/syscall.S
diff -r1.16 -r1.17 src/lib/libc/arch/mips/sys/brk.S
diff -r1.16 -r1.17 src/lib/libc/arch/mips/sys/sbrk.S
diff -r1.13 -r1.14 src/lib/libc/arch/mips/sys/cerror.S
diff -r1.9 -r1.10 src/lib/libc/arch/mips/sys/exect.S
diff -r1.9 -r1.10 src/lib/libc/arch/mips/sys/ptrace.S
diff -r1.11 -r1.12 src/lib/libc/arch/mips/sys/fork.S
diff -r1.11 -r1.12 src/lib/libc/arch/mips/sys/pipe.S
diff -r1.3 -r1.4 src/lib/libc/arch/mips/sys/getcontext.S
diff -r1.2 -r1.3 src/lib/libc/compat/arch/mips/sys/compat___semctl.S
diff -r1.2 -r1.3 src/lib/libc/compat/arch/mips/sys/compat___sigtramp1.S
diff -r1.2 -r1.3 src/lib/libc/compat/arch/mips/sys/compat_msgctl.S
diff -r1.2 -r1.3 src/lib/libc/compat/arch/mips/sys/compat_shmctl.S
diff -r1.2 -r1.3 src/lib/libc/compat/arch/mips/sys/compat_sigaction.S
diff -r1.7 -r1.8 src/lib/libc/softfloat/softfloat-for-gcc.h

cvs diff -r1.8 -r1.9 src/lib/libc/arch/mips/Makefile.inc (expand / switch to unified diff)

--- src/lib/libc/arch/mips/Makefile.inc 2006/06/17 18:04:23 1.8
+++ src/lib/libc/arch/mips/Makefile.inc 2009/12/14 01:07:41 1.9
@@ -1,3 +1,11 @@ @@ -1,3 +1,11 @@
1# $NetBSD: Makefile.inc,v 1.8 2006/06/17 18:04:23 uwe Exp $ 1# $NetBSD: Makefile.inc,v 1.9 2009/12/14 01:07:41 matt Exp $
2 2
3SRCS+= __sigaction14_sigtramp.c __sigtramp2.S 3SRCS+= __sigaction14_sigtramp.c __sigtramp2.S
 4
 5CPPFLAGS+= -I.
 6CPPFLAGS.assym.h+=-D__LIBC12_SOURCE__
 7
 8.if ${MKSOFTFLOAT} != "no"
 9.include <softfloat/Makefile.inc>
 10CPPFLAGS+= -DSOFTFLOAT_NEED_FIXUNS
 11.endif

cvs diff -r1.18 -r1.19 src/lib/libc/arch/mips/SYS.h (expand / switch to unified diff)

--- src/lib/libc/arch/mips/SYS.h 2003/10/29 12:28:33 1.18
+++ src/lib/libc/arch/mips/SYS.h 2009/12/14 01:07:41 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: SYS.h,v 1.18 2003/10/29 12:28:33 pooka Exp $ */ 1/* $NetBSD: SYS.h,v 1.19 2009/12/14 01:07:41 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996 Jonathan Stone 4 * Copyright (c) 1996 Jonathan Stone
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -68,32 +68,40 @@ @@ -68,32 +68,40 @@
68#include <sys/syscall.h> 68#include <sys/syscall.h>
69#include <mips/asm.h> 69#include <mips/asm.h>
70 70
71 71
72/* 72/*
73 * If compiling for shared libs, Emit sysV ABI PIC segment pseudo-ops. 73 * If compiling for shared libs, Emit sysV ABI PIC segment pseudo-ops.
74 * 74 *
75 * i) Emit .abicalls before .LEAF entrypoint, and .cpload/.cprestore after. 75 * i) Emit .abicalls before .LEAF entrypoint, and .cpload/.cprestore after.
76 * ii) Do interprocedure jumps indirectly via t9, with the side-effect of 76 * ii) Do interprocedure jumps indirectly via t9, with the side-effect of
77 * preserving the callee's entry address in t9. 77 * preserving the callee's entry address in t9.
78 */ 78 */
79#ifdef __ABICALLS__ 79#ifdef __ABICALLS__
80 .abicalls 80 .abicalls
81# define PIC_PROLOGUE(x,sr) .set noreorder; .cpload sr; .set reorder 81# if defined(__mips_o32) || defined(__mips_o64)
82# define PIC_CALL(l,sr) la sr, _C_LABEL(l); jr sr 82# define PIC_PROLOGUE(x) SETUP_GP
 83# define PIC_TAILCALL(l) PTR_LA t9, _C_LABEL(l); jr t9
 84# define PIC_RETURN() j ra
 85# else
 86# define PIC_PROLOGUE(x) SETUP_GP64(t3, x)
 87# define PIC_TAILCALL(l) PTR_LA t9, _C_LABEL(l); RESTORE_GP64; jr t9
 88# define PIC_RETURN() RESTORE_GP64; j ra
 89# endif
83#else 90#else
84# define PIC_PROLOGUE(x,sr) 91# define PIC_PROLOGUE(x)
85# define PIC_CALL(l,sr) j _C_LABEL(l) 92# define PIC_TAILCALL(l) j _C_LABEL(l)
86#endif 93# define PIC_RETURN()
 94#endif /* __ABICALLS__ */
87 95
88 96
89#ifdef __STDC__ 97#ifdef __STDC__
90# define SYSTRAP(x) li v0,SYS_ ## x; syscall; 98# define SYSTRAP(x) li v0,SYS_ ## x; syscall;
91#else 99#else
92# define SYSTRAP(x) li v0,SYS_/**/x; syscall; 100# define SYSTRAP(x) li v0,SYS_/**/x; syscall;
93#endif 101#endif
94 102
95 103
96/* 104/*
97 * Do a syscall that cannot fail (sync, get{p,u,g,eu,eg)id) 105 * Do a syscall that cannot fail (sync, get{p,u,g,eu,eg)id)
98 */ 106 */
99#define RSYSCALL_NOERROR(x) \ 107#define RSYSCALL_NOERROR(x) \
@@ -114,20 +122,20 @@ @@ -114,20 +122,20 @@
114 122
115/* 123/*
116 * Do a renamed or pseudo syscall (e.g., _exit()), where the entrypoint 124 * Do a renamed or pseudo syscall (e.g., _exit()), where the entrypoint
117 * and syscall name are not the same. 125 * and syscall name are not the same.
118 */ 126 */
119#define PSEUDO_NOERROR(x,y) \ 127#define PSEUDO_NOERROR(x,y) \
120LEAF(x); \ 128LEAF(x); \
121 SYSTRAP(y); \ 129 SYSTRAP(y); \
122 j ra; \ 130 j ra; \
123 END(x) 131 END(x)
124 132
125#define PSEUDO(x,y) \ 133#define PSEUDO(x,y) \
126LEAF(x); \ 134LEAF(x); \
127 PIC_PROLOGUE(x,t9); \ 135 PIC_PROLOGUE(x); \
128 SYSTRAP(y); \ 136 SYSTRAP(y); \
129 bne a3,zero,err; \ 137 bne a3,zero,err; \
130 j ra; \ 138 PIC_RETURN(); \
131err: \ 139err: \
132 PIC_CALL(__cerror,t9); \ 140 PIC_TAILCALL(__cerror); \
133 END(x) 141END(x)

File Added: src/lib/libc/arch/mips/genassym.cf
#	$NetBSD: genassym.cf,v 1.2 2009/12/14 01:07:41 matt Exp $

#
# Copyright (c) 2001 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Matt Thomas <matt@3am-sfotware.com>.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

include <sys/types.h>
include <machine/reg.h>
include <machine/regnum.h>
include <ucontext.h>
include <signal.h>
include <sys/siginfo.h>

define _OFFSETOF_UC_GREGS	offsetof(ucontext_t, uc_mcontext.__gregs[0])
define _OFFSETOF_UC_GREGS_V0	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_V0])
define _OFFSETOF_UC_GREGS_SP	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_SP])
define _OFFSETOF_UC_GREGS_EPC	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_EPC])
define _OFFSETOF_UC_LINK	offsetof(ucontext_t, uc_link)
define UCONTEXT_SIZE		sizeof(ucontext_t)

define _OFFSETOF_SC_REGS	offsetof(struct sigcontext, sc_regs[0])
define _OFFSETOF_SC_REGS_V0	offsetof(struct sigcontext, sc_regs[_R_V0])
define _OFFSETOF_SC_REGS_S0	offsetof(struct sigcontext, sc_regs[_R_S0])
define _OFFSETOF_SC_REGS_S1	offsetof(struct sigcontext, sc_regs[_R_S1])
define _OFFSETOF_SC_REGS_S2	offsetof(struct sigcontext, sc_regs[_R_S2])
define _OFFSETOF_SC_REGS_S3	offsetof(struct sigcontext, sc_regs[_R_S3])
define _OFFSETOF_SC_REGS_S4	offsetof(struct sigcontext, sc_regs[_R_S4])
define _OFFSETOF_SC_REGS_S5	offsetof(struct sigcontext, sc_regs[_R_S5])
define _OFFSETOF_SC_REGS_S6	offsetof(struct sigcontext, sc_regs[_R_S6])
define _OFFSETOF_SC_REGS_S7	offsetof(struct sigcontext, sc_regs[_R_S7])
define _OFFSETOF_SC_REGS_S8	offsetof(struct sigcontext, sc_regs[_R_S8])
define _OFFSETOF_SC_REGS_SP	offsetof(struct sigcontext, sc_regs[_R_SP])
define _OFFSETOF_SC_REGS_GP	offsetof(struct sigcontext, sc_regs[_R_GP])
define _OFFSETOF_SC_FPREGS	offsetof(struct sigcontext, sc_fpregs[0])
define _OFFSETOF_SC_FPREGS_F20	offsetof(struct sigcontext, sc_fpregs[20])
define _OFFSETOF_SC_FPREGS_F21	offsetof(struct sigcontext, sc_fpregs[21])
define _OFFSETOF_SC_FPREGS_F22	offsetof(struct sigcontext, sc_fpregs[22])
define _OFFSETOF_SC_FPREGS_F23	offsetof(struct sigcontext, sc_fpregs[23])
define _OFFSETOF_SC_FPREGS_F24	offsetof(struct sigcontext, sc_fpregs[24])
define _OFFSETOF_SC_FPREGS_F25	offsetof(struct sigcontext, sc_fpregs[25])
define _OFFSETOF_SC_FPREGS_F26	offsetof(struct sigcontext, sc_fpregs[26])
define _OFFSETOF_SC_FPREGS_F27	offsetof(struct sigcontext, sc_fpregs[27])
define _OFFSETOF_SC_FPREGS_F28	offsetof(struct sigcontext, sc_fpregs[28])
define _OFFSETOF_SC_FPREGS_F29	offsetof(struct sigcontext, sc_fpregs[29])
define _OFFSETOF_SC_FPREGS_F30	offsetof(struct sigcontext, sc_fpregs[30])
define _OFFSETOF_SC_FPREGS_F31	offsetof(struct sigcontext, sc_fpregs[31])
define _OFFSETOF_SC_FPREGS_FCSR	offsetof(struct sigcontext, sc_fpregs[32])
define _OFFSETOF_SC_PC		offsetof(struct sigcontext, sc_pc)
define _OFFSETOF_SC_MASK	offsetof(struct sigcontext, sc_mask)
define _OFFSETOF_SC_MASK13	offsetof(struct sigcontext, __sc_mask13)
define _OFFSETOF_SC_ONSTACK	offsetof(struct sigcontext, sc_onstack)
define _OFFSETOF_SC_FPUSED	offsetof(struct sigcontext, sc_fpused)

define SIGINFO_SIZE		sizeof(siginfo_t)

define STACK_T_SIZE		((sizeof(stack_t) + 2 * sizeof(register_t) - 1) & -(2 * sizeof(register_t)))
define _OFFSETOF_STACK_T_SP	offsetof(stack_t, ss_sp)
define _OFFSETOF_STACK_T_SIZE	offsetof(stack_t, ss_size)
define _OFFSETOF_STACK_T_FLAGS	offsetof(stack_t, ss_flags)

define SS_ONSTACK		SS_ONSTACK

cvs diff -r1.29 -r1.30 src/lib/libc/arch/mips/gen/Makefile.inc (expand / switch to unified diff)

--- src/lib/libc/arch/mips/gen/Makefile.inc 2009/12/06 07:12:17 1.29
+++ src/lib/libc/arch/mips/gen/Makefile.inc 2009/12/14 01:07:42 1.30
@@ -1,31 +1,31 @@ @@ -1,31 +1,31 @@
1# $NetBSD: Makefile.inc,v 1.29 2009/12/06 07:12:17 uebayasi Exp $ 1# $NetBSD: Makefile.inc,v 1.30 2009/12/14 01:07:42 matt Exp $
2 2
3SRCS+= fabs.S ldexp.S modf.S 3SRCS+= fabs.S ldexp.S modf.S
4 4
5# Common ieee754 constants and functions 5# Common ieee754 constants and functions
6SRCS+= infinityf_ieee754.c infinity_ieee754.c infinityl_dbl_ieee754.c 6SRCS+= infinityf_ieee754.c infinity_ieee754.c infinityl_dbl_ieee754.c
7SRCS+= fpclassifyf_ieee754.c fpclassifyd_ieee754.c 7SRCS+= fpclassifyf_ieee754.c fpclassifyd_ieee754.c
8SRCS+= isinff_ieee754.c isinfd_ieee754.c 8SRCS+= isinff_ieee754.c isinfd_ieee754.c
9SRCS+= isnanf_ieee754.c isnand_ieee754.c 9SRCS+= isnanf_ieee754.c isnand_ieee754.c
10SRCS+= isfinitef_ieee754.c isfinited_ieee754.c 10SRCS+= isfinitef_ieee754.c isfinited_ieee754.c
11SRCS+= signbitf_ieee754.c signbitd_ieee754.c 11SRCS+= signbitf_ieee754.c signbitd_ieee754.c
12 12
13SRCS+= nanf.c 13SRCS+= nanf.c
14 14
15SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ 15SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
16 fpsetround.c fpsetsticky.c 16 fpsetround.c fpsetsticky.c
17 17
18SRCS+= setjmp.S longjmp.c 18SRCS+= setjmp.S longjmp.c
19SRCS+= _setjmp.S 19SRCS+= _setjmp.S
20SRCS+= sigsetjmp.S 20SRCS+= sigsetjmp.S
21SRCS+= byte_swap_2.S byte_swap_4.S bswap64.c 21SRCS+= byte_swap_2.S byte_swap_4.S byte_swap_8.S
22 22
23SRCS+= makecontext.c resumecontext.c _resumecontext.S swapcontext.S _lwp.c 23SRCS+= makecontext.c resumecontext.c _resumecontext.S swapcontext.S _lwp.c
24 24
25# mips abi builtin extensions (used by GCC for lexical-closure trampoline) 25# mips abi builtin extensions (used by GCC for lexical-closure trampoline)
26SRCS+= cacheflush.c 26SRCS+= cacheflush.c
27 27
28LSRCS.mips.gen= Lint__setjmp.c Lint_bswap16.c Lint_bswap32.c Lint_swapcontext.c 28LSRCS.mips.gen= Lint__setjmp.c Lint_bswap16.c Lint_bswap32.c Lint_swapcontext.c
29LSRCS+= ${LSRCS.mips.gen} 29LSRCS+= ${LSRCS.mips.gen}
30DPSRCS+= ${LSRCS.mips.gen} 30DPSRCS+= ${LSRCS.mips.gen}
31CLEANFILES+= ${LSRCS.mips.gen} 31CLEANFILES+= ${LSRCS.mips.gen}

cvs diff -r1.5 -r1.6 src/lib/libc/arch/mips/gen/_resumecontext.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/gen/_resumecontext.S 2008/04/28 20:22:56 1.5
+++ src/lib/libc/arch/mips/gen/_resumecontext.S 2009/12/14 01:07:42 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: _resumecontext.S,v 1.5 2008/04/28 20:22:56 martin Exp $ */ 1/* $NetBSD: _resumecontext.S,v 1.6 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Wayne Knowles. 8 * by Wayne Knowles.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -19,29 +19,44 @@ @@ -19,29 +19,44 @@
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
 32#include <machine/asm.h>
 33
32#include "SYS.h" 34#include "SYS.h"
33#include <machine/mcontext.h> 35#include "assym.h"
34 36
35#if defined(SYSLIBC_SCCS) && !defined(lint) 37#if defined(SYSLIBC_SCCS) && !defined(lint)
36 ASMSTR("$NetBSD: _resumecontext.S,v 1.5 2008/04/28 20:22:56 martin Exp $") 38 RCSID("$NetBSD: _resumecontext.S,v 1.6 2009/12/14 01:07:42 matt Exp $")
37#endif /* SYSLIBC_SCCS && !lint */ 39#endif /* SYSLIBC_SCCS && !lint */
38 40
39 .set reorder 41 .set reorder
 42 .hidden _C_LABEL(__resumecontext)
40  43
41LEAF_NOPROFILE(__resumecontext) 44LEAF_NOPROFILE(__resumecontext)
42 PIC_PROLOGUE(_resumecontext, ra) 45 /*
43  46 * We get here not by a call through $t9 but thru $ra after the
44 la t9, _C_LABEL(_resumecontext) 47 * function passed to makecontext returns.
45 jr t9 48 */
46 nop 49 PTR_SUBU sp, sp, UCONTEXT_SIZE # get space for ucontext
 50 move a0, sp # arg0 for getcontext
 51 PTR_S zero, _OFFSETOF_UC_LINK(a0) # make sure uc_link is 0
 52 SYSTRAP(getcontext) # get context
 53 PTR_L a0, _OFFSETOF_UC_LINK(a0) # linked context?
 54 beq a0, zero, 1f # nope, exit process
 55 nop
 56 SYSTRAP(setcontext) # yes, become it.
 57 /* NOTREACHED (in theory) */
 58 li a0, -1 # failure,
 591:
 60 SYSTRAP(exit) # all hope is lost.
 61 /* NOTREACHED */
47END(__resumecontext) 62END(__resumecontext)

cvs diff -r1.20 -r1.21 src/lib/libc/arch/mips/gen/_setjmp.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/gen/_setjmp.S 2005/10/07 17:16:40 1.20
+++ src/lib/libc/arch/mips/gen/_setjmp.S 2009/12/14 01:07:42 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: _setjmp.S,v 1.20 2005/10/07 17:16:40 tsutsui Exp $ */ 1/* $NetBSD: _setjmp.S,v 1.21 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -28,124 +28,161 @@ @@ -28,124 +28,161 @@
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include <machine/cdefs.h> 35#include <machine/cdefs.h>
36#include <mips/regnum.h> 36#include <mips/regnum.h>
37#include <mips/asm.h> 37#include <mips/asm.h>
38#include <machine/setjmp.h> 38#include <machine/setjmp.h>
39#include <machine/signal.h> /* XXX */ 39#include <machine/signal.h> /* XXX */
40 40
41#if defined(LIBC_SCCS) && !defined(lint) 41#include "assym.h"
42 ASMSTR("from: @(#)_setjmp.s 8.1 (Berkeley) 6/4/93") 
43 ASMSTR("$NetBSD: _setjmp.S,v 1.20 2005/10/07 17:16:40 tsutsui Exp $") 
44#endif /* LIBC_SCCS and not lint */ 
45 42
46#ifdef __ABICALLS__ 43#include "SYS.h"
47 .abicalls 44
 45#if defined(LIBC_SCCS) && !defined(lint)
 46#if 0
 47 RCSID("from: @(#)_setjmp.s 8.1 (Berkeley) 6/4/93")
 48#else
 49 RCSID("$NetBSD: _setjmp.S,v 1.21 2009/12/14 01:07:42 matt Exp $")
48#endif 50#endif
 51#endif /* LIBC_SCCS and not lint */
49 52
50/* 53/*
51 * C library -- _setjmp, _longjmp 54 * C library -- _setjmp, _longjmp
52 * 55 *
53 * _longjmp(a,v) 56 * _longjmp(a,v)
54 * will generate a "return(v)" from 57 * will generate a "return(v)" from
55 * the last call to 58 * the last call to
56 * _setjmp(a) 59 * _setjmp(a)
57 * by restoring registers from the stack, 60 * by restoring registers from the stack,
58 * The previous signal state is NOT restored. 61 * The previous signal state is NOT restored.
59 */ 62 */
60 63
61 .set noreorder 64 .set noreorder
62 65
63LEAF(_setjmp) 66LEAF(_setjmp)
64#ifdef __ABICALLS__  
65 #.set noreorder 
66 .cpload t9 
67 #.set reorder 
68#endif 
69 
70 REG_PROLOGUE 67 REG_PROLOGUE
71 REG_LI v0, 0xACEDBADE # sigcontext magic number 68 REG_LI v0, 0xACEDBADE # sigcontext magic number
72 REG_S ra, (2 * 4)(a0) # sc_pc = return address 69 REG_S ra, _OFFSETOF_SC_PC(a0) # sc_pc = return address
73 REG_S v0, (_OFFSETOF_SC_REGS)(a0) # saved in sc_regs[0] 70 REG_S v0, _OFFSETOF_SC_REGS(a0) # saved in sc_regs[0]
74 REG_S s0, (_R_S0 * SZREG + _OFFSETOF_SC_REGS)(a0) 71 REG_S a1, _OFFSETOF_SC_REGS_V0(a0) # save return value
75 REG_S s1, (_R_S1 * SZREG + _OFFSETOF_SC_REGS)(a0) 72 REG_S s0, _OFFSETOF_SC_REGS_S0(a0)
76 REG_S s2, (_R_S2 * SZREG + _OFFSETOF_SC_REGS)(a0) 73 REG_S s1, _OFFSETOF_SC_REGS_S1(a0)
77 REG_S s3, (_R_S3 * SZREG + _OFFSETOF_SC_REGS)(a0) 74 REG_S s2, _OFFSETOF_SC_REGS_S2(a0)
78 REG_S s4, (_R_S4 * SZREG + _OFFSETOF_SC_REGS)(a0) 75 REG_S s3, _OFFSETOF_SC_REGS_S3(a0)
79 REG_S s5, (_R_S5 * SZREG + _OFFSETOF_SC_REGS)(a0) 76 REG_S s4, _OFFSETOF_SC_REGS_S4(a0)
80 REG_S s6, (_R_S6 * SZREG + _OFFSETOF_SC_REGS)(a0) 77 REG_S s5, _OFFSETOF_SC_REGS_S5(a0)
81 REG_S s7, (_R_S7 * SZREG + _OFFSETOF_SC_REGS)(a0) 78 REG_S s6, _OFFSETOF_SC_REGS_S6(a0)
82 REG_S sp, (_R_SP * SZREG + _OFFSETOF_SC_REGS)(a0) 79 REG_S s7, _OFFSETOF_SC_REGS_S7(a0)
83 REG_S s8, (_R_S8 * SZREG + _OFFSETOF_SC_REGS)(a0) 80 REG_S sp, _OFFSETOF_SC_REGS_SP(a0)
 81 REG_S s8, _OFFSETOF_SC_REGS_S8(a0)
 82#if defined(__mips_n32) || defined(__mips_n64)
 83 REG_S gp, _OFFSETOF_SC_REGS_GP(a0) # newabi gp is callee-saved
 84#endif
84 cfc1 v0, $31 # too bad cant check if FP used 85 cfc1 v0, $31 # too bad cant check if FP used
85 swc1 $f20, (20 * 4 + _OFFSETOF_SC_FPREGS)(a0) 86 /*
86 swc1 $f21, (21 * 4 + _OFFSETOF_SC_FPREGS)(a0) 87 * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
87 swc1 $f22, (22 * 4 + _OFFSETOF_SC_FPREGS)(a0) 88 * In N64, FP registers F23 .. F31 are callee-saved.
88 swc1 $f23, (23 * 4 + _OFFSETOF_SC_FPREGS)(a0) 89 * In O32, FP registers F20 .. F23 are callee-saved.
89 swc1 $f24, (24 * 4 + _OFFSETOF_SC_FPREGS)(a0) 90 */
90 swc1 $f25, (25 * 4 + _OFFSETOF_SC_FPREGS)(a0) 91#ifndef SOFTFLOAT_FOR_GCC
91 swc1 $f26, (26 * 4 + _OFFSETOF_SC_FPREGS)(a0) 92#if defined(__mips_n64) || defined(__mips_n32)
92 swc1 $f27, (27 * 4 + _OFFSETOF_SC_FPREGS)(a0) 93 FP_S $f30, _OFFSETOF_SC_FPREGS_F30(a0)
93 swc1 $f28, (28 * 4 + _OFFSETOF_SC_FPREGS)(a0) 94 FP_S $f28, _OFFSETOF_SC_FPREGS_F28(a0)
94 swc1 $f29, (29 * 4 + _OFFSETOF_SC_FPREGS)(a0) 95 FP_S $f26, _OFFSETOF_SC_FPREGS_F26(a0)
95 swc1 $f30, (30 * 4 + _OFFSETOF_SC_FPREGS)(a0) 96 FP_S $f24, _OFFSETOF_SC_FPREGS_F24(a0)
96 swc1 $f31, (31 * 4 + _OFFSETOF_SC_FPREGS)(a0) 97#endif
97 sw v0, (32 * 4 + _OFFSETOF_SC_FPREGS)(a0) 98#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
 99 FP_S $f22, _OFFSETOF_SC_FPREGS_F22(a0)
 100 FP_S $f20, _OFFSETOF_SC_FPREGS_F20(a0)
 101#endif
 102#if defined(__mips_o32) || defined(__mips_o64)
 103 FP_S $f21, _OFFSETOF_SC_FPREGS_F21(a0)
 104 FP_S $f23, _OFFSETOF_SC_FPREGS_F23(a0)
 105#endif
 106#if defined(__mips_n64)
 107 FP_S $f25, _OFFSETOF_SC_FPREGS_F25(a0)
 108 FP_S $f27, _OFFSETOF_SC_FPREGS_F27(a0)
 109 FP_S $f29, _OFFSETOF_SC_FPREGS_F29(a0)
 110 FP_S $f31, _OFFSETOF_SC_FPREGS_F31(a0)
 111#endif
 112#endif /* SOFTFLOAT_FOR_GCC */
 113 INT_S v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
98 REG_EPILOGUE 114 REG_EPILOGUE
 115
99 j ra 116 j ra
100 move v0, zero 117 move v0, zero
101END(_setjmp) 118END(_setjmp)
102 119
103LEAF(_longjmp) 120LEAF(_longjmp)
104#ifdef __ABICALLS__  121 PIC_PROLOGUE(_longjmp)
105 .set noreorder 122 PTR_SUBU sp, sp, CALLFRAME_SIZ
106 .cpload t9 123 SAVE_GP(CALLFRAME_GP)
107 .set reorder 124
108 subu sp, sp, 32 
109 .cprestore 16 
110 .set noreorder 
111#endif  
112 REG_PROLOGUE 125 REG_PROLOGUE
113 REG_L v0, (_OFFSETOF_SC_REGS)(a0) # get magic number 126 REG_L v0, _OFFSETOF_SC_REGS(a0) # get magic number
114 REG_L ra, (2 * 4)(a0) 127 REG_L ra, _OFFSETOF_SC_PC(a0)
115 REG_LI t0, 0xACEDBADE 128 REG_LI t0, 0xACEDBADE
116 bne v0, t0, botch # jump if error 129 bne v0, t0, botch # jump if error
117 addu sp, sp, 32 # does not matter, sanity 130 PTR_ADDU sp, sp, CALLFRAME_SIZ # does not matter, sanity
118 REG_L s0, (_R_S0 * SZREG + _OFFSETOF_SC_REGS)(a0) 131 REG_L s0, _OFFSETOF_SC_REGS_S0(a0)
119 REG_L s1, (_R_S1 * SZREG + _OFFSETOF_SC_REGS)(a0) 132 REG_L s1, _OFFSETOF_SC_REGS_S1(a0)
120 REG_L s2, (_R_S2 * SZREG + _OFFSETOF_SC_REGS)(a0) 133 REG_L s2, _OFFSETOF_SC_REGS_S2(a0)
121 REG_L s3, (_R_S3 * SZREG + _OFFSETOF_SC_REGS)(a0) 134 REG_L s3, _OFFSETOF_SC_REGS_S3(a0)
122 REG_L s4, (_R_S4 * SZREG + _OFFSETOF_SC_REGS)(a0) 135 REG_L s4, _OFFSETOF_SC_REGS_S4(a0)
123 REG_L s5, (_R_S5 * SZREG + _OFFSETOF_SC_REGS)(a0) 136 REG_L s5, _OFFSETOF_SC_REGS_S5(a0)
124 REG_L s6, (_R_S6 * SZREG + _OFFSETOF_SC_REGS)(a0) 137 REG_L s6, _OFFSETOF_SC_REGS_S6(a0)
125 REG_L s7, (_R_S7 * SZREG + _OFFSETOF_SC_REGS)(a0) 138 REG_L s7, _OFFSETOF_SC_REGS_S7(a0)
126 lw v0, (32 * 4 + _OFFSETOF_SC_FPREGS)(a0) # get fpu status 139#if defined(__mips_n32) || defined(__mips_n64)
127 REG_L sp, (_R_SP * SZREG + _OFFSETOF_SC_REGS)(a0) 140 REG_L gp, _OFFSETOF_SC_REGS_GP(a0)
128 REG_L s8, (_R_S8 * SZREG + _OFFSETOF_SC_REGS)(a0) 141#endif
129 ctc1 v0, $31 142 # get fpu status
130 lwc1 $f20, (20 * 4 + _OFFSETOF_SC_FPREGS)(a0) 143 INT_L v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
131 lwc1 $f21, (21 * 4 + _OFFSETOF_SC_FPREGS)(a0) 144 REG_L sp, _OFFSETOF_SC_REGS_SP(a0)
132 lwc1 $f22, (22 * 4 + _OFFSETOF_SC_FPREGS)(a0) 145 REG_L s8, _OFFSETOF_SC_REGS_S8(a0)
133 lwc1 $f23, (23 * 4 + _OFFSETOF_SC_FPREGS)(a0) 146 ctc1 v0, $31
134 lwc1 $f24, (24 * 4 + _OFFSETOF_SC_FPREGS)(a0) 147 /*
135 lwc1 $f25, (25 * 4 + _OFFSETOF_SC_FPREGS)(a0) 148 * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
136 lwc1 $f26, (26 * 4 + _OFFSETOF_SC_FPREGS)(a0) 149 * In N64, FP registers F23 .. F31 are callee-saved.
137 lwc1 $f27, (27 * 4 + _OFFSETOF_SC_FPREGS)(a0) 150 * In O32, FP registers F20 .. F23 are callee-saved.
138 lwc1 $f28, (28 * 4 + _OFFSETOF_SC_FPREGS)(a0) 151 */
139 lwc1 $f29, (29 * 4 + _OFFSETOF_SC_FPREGS)(a0) 152#ifndef SOFTFLOAT_FOR_GCC
140 lwc1 $f30, (30 * 4 + _OFFSETOF_SC_FPREGS)(a0) 153#if defined(__mips_n64) || defined(__mips_n32)
141 lwc1 $f31, (31 * 4 + _OFFSETOF_SC_FPREGS)(a0) 154 FP_L $f30, _OFFSETOF_SC_FPREGS_F30(a0)
 155 FP_L $f28, _OFFSETOF_SC_FPREGS_F28(a0)
 156 FP_L $f26, _OFFSETOF_SC_FPREGS_F26(a0)
 157 FP_L $f24, _OFFSETOF_SC_FPREGS_F24(a0)
 158#endif
 159#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
 160 FP_L $f22, _OFFSETOF_SC_FPREGS_F22(a0)
 161 FP_L $f20, _OFFSETOF_SC_FPREGS_F20(a0)
 162#endif
 163#if defined(__mips_o32) || defined(__mips_o64)
 164 FP_L $f21, _OFFSETOF_SC_FPREGS_F21(a0)
 165 FP_L $f23, _OFFSETOF_SC_FPREGS_F23(a0)
 166#endif
 167#if defined(__mips_n64)
 168 FP_L $f25, _OFFSETOF_SC_FPREGS_F25(a0)
 169 FP_L $f27, _OFFSETOF_SC_FPREGS_F27(a0)
 170 FP_L $f29, _OFFSETOF_SC_FPREGS_F29(a0)
 171 FP_L $f31, _OFFSETOF_SC_FPREGS_F31(a0)
 172#endif
 173#endif /* SOFTFLOAT_FOR_GCC */
142 174
143 j ra 
144 move v0, a1 
145 REG_EPILOGUE 175 REG_EPILOGUE
 176 REG_L v0, _OFFSETOF_SC_REGS_V0(a0)
 177 j ra
 178 nop
 179
146botch: 180botch:
 181 /*
 182 * We know we aren't returning so we don't care about restoring
 183 * our caller's GP.
 184 */
147 jal _C_LABEL(longjmperror) 185 jal _C_LABEL(longjmperror)
148 nop 186
149 jal _C_LABEL(abort) 187 PIC_TAILCALL(abort)
150 nop 
151END(_longjmp) 188END(_longjmp)

cvs diff -r1.7 -r1.8 src/lib/libc/arch/mips/gen/fabs.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/gen/fabs.S 2003/08/07 16:42:15 1.7
+++ src/lib/libc/arch/mips/gen/fabs.S 2009/12/14 01:07:42 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fabs.S,v 1.7 2003/08/07 16:42:15 agc Exp $ */ 1/* $NetBSD: fabs.S,v 1.8 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1993 4 * Copyright (c) 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,33 +25,33 @@ @@ -25,33 +25,33 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include <mips/asm.h> 35#include <mips/asm.h>
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)fabs.s 8.1 (Berkeley) 2/16/94") 38#if 0
39 ASMSTR("$NetBSD: fabs.S,v 1.7 2003/08/07 16:42:15 agc Exp $") 39 RCSID("from: @(#)fabs.s 8.1 (Berkeley) 2/16/94")
 40#else
 41 RCSID("$NetBSD: fabs.S,v 1.8 2009/12/14 01:07:42 matt Exp $")
 42#endif
40#endif /* LIBC_SCCS and not lint */ 43#endif /* LIBC_SCCS and not lint */
41 44
42 45
43#ifdef __ABICALLS__ 
44 .abicalls 
45#endif 
46 .set noreorder 46 .set noreorder
47 47
48/* 48/*
49 * fabs(x) 49 * fabs(x)
50 * double x; 50 * double x;
51 * 51 *
52 * Return absolute value of x. 52 * Return absolute value of x.
53 */ 53 */
54LEAF(fabs) 54LEAF(fabs)
55 j ra 55 j ra
56 abs.d $f0, $f12 # compute absolute value of x 56 abs.d $f0, $f12 # compute absolute value of x
57END(fabs) 57END(fabs)

cvs diff -r1.8 -r1.9 src/lib/libc/arch/mips/gen/ldexp.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/gen/ldexp.S 2003/08/07 16:42:15 1.8
+++ src/lib/libc/arch/mips/gen/ldexp.S 2009/12/14 01:07:42 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ldexp.S,v 1.8 2003/08/07 16:42:15 agc Exp $ */ 1/* $NetBSD: ldexp.S,v 1.9 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,33 +25,32 @@ @@ -25,33 +25,32 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include <mips/asm.h> 35#include <mips/asm.h>
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)ldexp.s 8.1 (Berkeley) 6/4/93") 38#if 0
39 ASMSTR("$NetBSD: ldexp.S,v 1.8 2003/08/07 16:42:15 agc Exp $") 39 RCSID("from: @(#)ldexp.s 8.1 (Berkeley) 6/4/93")
40#endif /* LIBC_SCCS and not lint */ 40#else
41 41 RCSID("$NetBSD: ldexp.S,v 1.9 2009/12/14 01:07:42 matt Exp $")
42#ifdef __ABICALLS__ 
43 .abicalls 
44#endif 42#endif
 43#endif /* LIBC_SCCS and not lint */
45 44
46#define DEXP_INF 0x7ff 45#define DEXP_INF 0x7ff
47#define DEXP_BIAS 1023 46#define DEXP_BIAS 1023
48#define DEXP_MIN -1022 47#define DEXP_MIN -1022
49#define DEXP_MAX 1023 48#define DEXP_MAX 1023
50#define DFRAC_BITS 52 49#define DFRAC_BITS 52
51#define DIMPL_ONE 0x00100000 50#define DIMPL_ONE 0x00100000
52#define DLEAD_ZEROS 31 - 20 51#define DLEAD_ZEROS 31 - 20
53#define STICKYBIT 1 52#define STICKYBIT 1
54#define GUARDBIT 0x80000000 53#define GUARDBIT 0x80000000
55#define DSIGNAL_NAN 0x00040000 54#define DSIGNAL_NAN 0x00040000
56#define DQUIET_NAN0 0x0007ffff 55#define DQUIET_NAN0 0x0007ffff
57#define DQUIET_NAN1 0xffffffff 56#define DQUIET_NAN1 0xffffffff

cvs diff -r1.8 -r1.9 src/lib/libc/arch/mips/gen/sigsetjmp.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/gen/sigsetjmp.S 2005/09/17 11:49:39 1.8
+++ src/lib/libc/arch/mips/gen/sigsetjmp.S 2009/12/14 01:07:42 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $ */ 1/* $NetBSD: sigsetjmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993, 1995, 4 * Copyright (c) 1991, 1993, 1995,
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Havard Eidnes. 8 * Havard Eidnes.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -27,62 +27,53 @@ @@ -27,62 +27,53 @@
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include <sys/syscall.h> 35#include <sys/syscall.h>
36#include <mips/regnum.h> 36#include <mips/regnum.h>
37#include <mips/asm.h> 37#include <mips/asm.h>
38#include <machine/setjmp.h> 38#include <machine/setjmp.h>
39 39
40#if defined(LIBC_SCCS) && !defined(lint) 40#include "assym.h"
41 ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") 41#include "SYS.h"
42 ASMSTR("$NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $") 
43#endif /* LIBC_SCCS and not lint */ 
44 42
45#ifdef __ABICALLS__ 43#if defined(LIBC_SCCS) && !defined(lint)
46 .abicalls 44#if 0
 45 RCSID("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93")
 46#else
 47 RCSID("$NetBSD: sigsetjmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $")
47#endif 48#endif
 49#endif /* LIBC_SCCS and not lint */
48 50
49/* 51/*
50 * C library -- sigsetjmp, siglongjmp 52 * C library -- sigsetjmp, siglongjmp
51 * 53 *
52 * siglongjmp(a,v) 54 * siglongjmp(a,v)
53 * will generate a "return(v)" from 55 * will generate a "return(v)" from
54 * the last call to 56 * the last call to
55 * sigsetjmp(a, savemask) 57 * sigsetjmp(a, savemask)
56 * by restoring registers from the stack, 58 * by restoring registers from the stack,
57 * and dependent on savemask restores the 59 * and dependent on savemask restores the
58 * signal mask. 60 * signal mask.
59 */ 61 */
60 62
61LEAF(__sigsetjmp14) 63LEAF(__sigsetjmp14)
62#ifdef __ABICALLS__ 64 PIC_PROLOGUE(__sigsetjmp14)
63 .set noreorder 65 REG_S a1, _JBLEN*SZREG(a0) # save "savemask"
64 .cpload t9 
65 .set reorder 
66#endif 
67 sw a1, (_JBLEN*4)(a0) # save "savemask" 
68 bne a1, 0x0, 1f # do saving of signal mask? 66 bne a1, 0x0, 1f # do saving of signal mask?
69 la t9, _setjmp 67 PIC_TAILCALL(_setjmp)
70 jr t9 
71 68
721: la t9, __setjmp14 691: PIC_TAILCALL(__setjmp14)
73 jr t9 
74END(__sigsetjmp14) 70END(__sigsetjmp14)
75 71
76LEAF(__siglongjmp14) 72LEAF(__siglongjmp14)
77#ifdef __ABICALLS__ 73 PIC_PROLOGUE(__siglongjmp14)
78 .set noreorder 74 REG_L t0, _JBLEN*SZREG(a0) # get "savemask"
79 .cpload t9 
80 .set reorder 
81#endif 
82 lw t0, (_JBLEN * 4)(a0) # get "savemask" 
83 bne t0, 0x0, 1f # restore signal mask? 75 bne t0, 0x0, 1f # restore signal mask?
84 la t9, _longjmp 76 PIC_TAILCALL(_longjmp)
85 jr t9 77
861: la t9, __longjmp14 781: PIC_TAILCALL(__longjmp14)
87 jr t9 
88END(__siglongjmp14) 79END(__siglongjmp14)

cvs diff -r1.4 -r1.5 src/lib/libc/arch/mips/gen/makecontext.c (expand / switch to unified diff)

--- src/lib/libc/arch/mips/gen/makecontext.c 2008/04/28 20:22:56 1.4
+++ src/lib/libc/arch/mips/gen/makecontext.c 2009/12/14 01:07:42 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: makecontext.c,v 1.4 2008/04/28 20:22:56 martin Exp $ */ 1/* $NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Klaus Klein. 8 * by Klaus Klein.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -21,58 +21,75 @@ @@ -21,58 +21,75 @@
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34__RCSID("$NetBSD: makecontext.c,v 1.4 2008/04/28 20:22:56 martin Exp $"); 34__RCSID("$NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $");
35#endif 35#endif
36 36
37#include <inttypes.h> 37#include <inttypes.h>
38#include <stddef.h> 38#include <stddef.h>
39#include <ucontext.h> 39#include <ucontext.h>
40#include "extern.h" 40#include "extern.h"
41 41
42#include <stdarg.h> 42#include <stdarg.h>
43 43
44void 44void
45makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) 45makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
46{ 46{
47 __greg_t *gr = ucp->uc_mcontext.__gregs; 47 __greg_t *gr = ucp->uc_mcontext.__gregs;
48 uintptr_t *sp; 48 __greg_t *sp;
49 int i; 49 int i;
50 va_list ap; 50 va_list ap;
51 51
52 void __resumecontext(void); 52 void __resumecontext(void);
53 53
54 /* LINTED uintptr_t is safe */ 54 /* LINTED uintptr_t is safe */
55 sp = (uintptr_t *) 55 sp = (__greg_t *)
56 ((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size); 56 ((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
57 /* LINTED uintptr_t is safe */ 57 /* LINTED uintptr_t is safe */
 58#if defined(__mips_o32) || defined(__mips_o64)
58 sp -= (argc >= 4 ? argc : 4); /* Make room for >=4 arguments. */ 59 sp -= (argc >= 4 ? argc : 4); /* Make room for >=4 arguments. */
59 sp = (uintptr_t *) 60 sp = (__greg_t *)
60 ((uintptr_t)sp & ~0x7); /* Align on double-word boundary. */ 61 ((uintptr_t)sp & ~0x7); /* Align on double-word boundary. */
 62#elif defined(__mips_n32) || defined(__mips_n64)
 63 sp -= (argc > 8 ? argc - 8 : 0); /* Make room for > 8 arguments. */
 64 sp = (__greg_t *)
 65 ((uintptr_t)sp & ~0xf); /* Align on quad-word boundary. */
 66#endif
61 67
62 gr[_REG_SP] = (__greg_t)sp; 68 gr[_REG_SP] = (intptr_t)sp;
63 gr[_REG_RA] = (__greg_t)__resumecontext; 69 gr[_REG_RA] = (intptr_t)__resumecontext;
64 gr[_REG_T9] = (__greg_t)func; /* required for .abicalls */ 70 gr[_REG_T9] = (intptr_t)func; /* required for .abicalls */
65 gr[_REG_EPC] = (__greg_t)func; 71 gr[_REG_EPC] = (intptr_t)func;
66 72
67 /* Construct argument list. */ 73 /* Construct argument list. */
68 va_start(ap, argc); 74 va_start(ap, argc);
 75#if defined(__mips_o32) || defined(__mips_o64)
69 /* Up to the first four arguments are passed in $a0-3. */ 76 /* Up to the first four arguments are passed in $a0-3. */
70 for (i = 0; i < argc && i < 4; i++) 77 for (i = 0; i < argc && i < 4; i++)
71 /* LINTED uintptr_t is safe */ 78 /* LINTED __greg_t is safe */
72 gr[_REG_A0 + i] = va_arg(ap, uintptr_t); 79 gr[_REG_A0 + i] = va_arg(ap, __greg_t);
 80 /* Pass remaining arguments on the stack above the $a0-3 gap. */
 81 sp += i;
 82#endif
 83#if defined(__mips_n32) || defined(__mips_n64)
 84 /* Up to the first 8 arguments are passed in $a0-7. */
 85 for (i = 0; i < argc && i < 8; i++)
 86 /* LINTED __greg_t is safe */
 87 gr[_REG_A0 + i] = va_arg(ap, __greg_t);
 88 /* Pass remaining arguments on the stack above the $a0-3 gap. */
 89#endif
73 /* Pass remaining arguments on the stack above the $a0-3 gap. */ 90 /* Pass remaining arguments on the stack above the $a0-3 gap. */
74 for (sp += 4; i < argc; i++) 91 for (; i < argc; i++)
75 /* LINTED uintptr_t is safe */ 92 /* LINTED uintptr_t is safe */
76 *sp++ = va_arg(ap, uintptr_t); 93 *sp++ = va_arg(ap, __greg_t);
77 va_end(ap); 94 va_end(ap);
78} 95}

cvs diff -r1.10 -r1.11 src/lib/libc/arch/mips/gen/modf.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/gen/modf.S 2003/08/07 16:42:15 1.10
+++ src/lib/libc/arch/mips/gen/modf.S 2009/12/14 01:07:42 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: modf.S,v 1.10 2003/08/07 16:42:15 agc Exp $ */ 1/* $NetBSD: modf.S,v 1.11 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993, 1995 4 * Copyright (c) 1991, 1993, 1995
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,45 +25,39 @@ @@ -25,45 +25,39 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include <mips/asm.h> 35#include <mips/asm.h>
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)modf.s 8.1 (Berkeley) 6/4/93") 38#if 0
39 ASMSTR("$NetBSD: modf.S,v 1.10 2003/08/07 16:42:15 agc Exp $") 39 RCSID("from: @(#)modf.s 8.1 (Berkeley) 6/4/93")
40#endif /* LIBC_SCCS and not lint */ 40#else
41 41 RCSID("$NetBSD: modf.S,v 1.11 2009/12/14 01:07:42 matt Exp $")
42#ifdef __ABICALLS__ 
43 .abicalls 
44#endif 42#endif
 43#endif /* LIBC_SCCS and not lint */
45 44
46/* 45/*
47 * double modf(val, iptr) 46 * double modf(val, iptr)
48 * double val, *iptr; 47 * double val, *iptr;
49 * returns: xxx and n (in *iptr) where val == n.xxx 48 * returns: xxx and n (in *iptr) where val == n.xxx
50 */ 49 */
51LEAF(modf) 50LEAF(modf)
52#ifdef __ABICALLS__ 
53 .set noreorder 
54 .cpload t9 
55 .set reorder 
56#endif 
57 cfc1 t0, $31 # get the control register 51 cfc1 t0, $31 # get the control register
58 li.d $f2, 4503599627370496e0 # f2 <- 2^52 52 li.d $f2, 4503599627370496e0 # f2 <- 2^52
59 53
60 or t1, t0, 0x3 # set rounding mode to round to zero 54 or t1, t0, 0x3 # set rounding mode to round to zero
61 xor t1, t1, 0x2 # (i.e., 01) 55 xor t1, t1, 0x2 # (i.e., 01)
62 ctc1 t1, $31 56 ctc1 t1, $31
63 57
64 mov.d $f0, $f12 # f0 <- f12 58 mov.d $f0, $f12 # f0 <- f12
65 abs.d $f4, $f12 # f4 <- |f12| 59 abs.d $f4, $f12 # f4 <- |f12|
66 c.olt.d $f4, $f2 # f4 ? < f2  60 c.olt.d $f4, $f2 # f4 ? < f2
67 bc1f 1f # leave f0 alone if Nan, infinity  61 bc1f 1f # leave f0 alone if Nan, infinity
68 # or >=2^52 62 # or >=2^52
69 c.eq.d $f12,$f4 # was f12 positive ? 63 c.eq.d $f12,$f4 # was f12 positive ?

cvs diff -r1.17 -r1.18 src/lib/libc/arch/mips/gen/setjmp.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/gen/setjmp.S 2005/09/17 11:49:39 1.17
+++ src/lib/libc/arch/mips/gen/setjmp.S 2009/12/14 01:07:42 1.18
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $ */ 1/* $NetBSD: setjmp.S,v 1.18 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -22,114 +22,125 @@ @@ -22,114 +22,125 @@
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include <machine/cdefs.h> 
36#include <sys/syscall.h> 35#include <sys/syscall.h>
37#include <mips/regnum.h> 
38#include <mips/asm.h> 36#include <mips/asm.h>
39#include <machine/signal.h> 
40#include <machine/setjmp.h> 
41 37
42#if defined(LIBC_SCCS) && !defined(lint) 38#include "assym.h"
43 ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") 
44 ASMSTR("$NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $") 
45#endif /* LIBC_SCCS and not lint */ 
46 39
47#ifdef __ABICALLS__ 40#if defined(LIBC_SCCS) && !defined(lint)
48 .abicalls 41#if 0
 42 RCSID("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93")
 43#else
 44 RCSID("$NetBSD: setjmp.S,v 1.18 2009/12/14 01:07:42 matt Exp $")
49#endif 45#endif
 46#endif /* LIBC_SCCS and not lint */
50 47
51/* 48/*
52 * C library -- setjmp, longjmp 49 * C library -- setjmp, longjmp
53 * 50 *
54 * longjmp(a,v) 51 * longjmp(a,v)
55 * will generate a "return(v)" from 52 * will generate a "return(v)" from
56 * the last call to 53 * the last call to
57 * setjmp(a) 54 * setjmp(a)
58 * by restoring registers from the stack, 55 * by restoring registers from the stack,
59 * and a struct sigcontext, see <signal.h> 56 * and a struct sigcontext, see <signal.h>
60 */ 57 */
61 58
62#define SETJMP_FRAME_SIZE (CALLFRAME_SIZ + 12) 59#define SETJMP_FRAME_SIZE (CALLFRAME_SIZ + STACK_T_SIZE)
63 60
64NON_LEAF(__setjmp14, SETJMP_FRAME_SIZE, ra) 61NON_LEAF(__setjmp14, SETJMP_FRAME_SIZE, ra)
65 .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) 62 .mask 0x80010000, (CALLFRAME_RA - CALLFRAME_SIZ)
66#ifdef __ABICALLS__ 63 SETUP_GP
67 .set noreorder 64 PTR_SUBU sp, sp, SETJMP_FRAME_SIZE # allocate stack frame
68 .cpload t9 65 SAVE_GP(CALLFRAME_GP)
69 .set reorder 66 SETUP_GP64(CALLFRAME_GP, __setjmp14)
70#endif 67
71 subu sp, sp, SETJMP_FRAME_SIZE # allocate stack frame 68 REG_S ra, CALLFRAME_RA(sp) # save RA
72#ifdef __ABICALLS__ 69 REG_S s0, CALLFRAME_S0(sp) # save S0
73 .cprestore 16 70 move s0, a0 # save sigcontext
74#endif 
75 sw ra, CALLFRAME_RA(sp) # save RA 
76 sw a0, SETJMP_FRAME_SIZE(sp) # squirrel away sc 
77 71
78 /* Get the signal mask. */ 72 /* Get the signal mask. */
79 addu a2, a0, _OFFSETOF_SC_MASK # &sc.sc_mask 73 PTR_ADDU a2, a0, _OFFSETOF_SC_MASK # &sc.sc_mask
80 move a1, zero 74 move a1, zero
81 jal _C_LABEL(__sigprocmask14) # get current signal mask 75 jal _C_LABEL(__sigprocmask14) # get current signal mask
82 move a0, zero # (in delay slot) 
83 76
84 /* Get the signal stack. */ 77 /* Get the signal stack. */
85 move a0, zero 78 move a0, zero
86 addu a1, sp, CALLFRAME_SIZ # pointer to struct sigaltstack 79 PTR_ADDU a1, sp, CALLFRAME_SIZ # pointer to stack_t
87 jal _C_LABEL(__sigaltstack14) 80 jal _C_LABEL(__sigaltstack14)
 81
 82 move a0, s0 # restore jmpbuf
 83 INT_L v1, CALLFRAME_SIZ+_OFFSETOF_STACK_T_FLAGS(sp)
 84 # get old ss_onstack
 85 and v1, v1, SS_ONSTACK # extract onstack flag
 86 INT_S v1, _OFFSETOF_SC_ONSTACK(a0) # save it in sc_onstack
 87
 88 REG_L s0, CALLFRAME_S0(sp) # restore S0
 89 REG_L ra, CALLFRAME_RA(sp) # restore RA
 90 blt v0, zero, botch # check for sigaltstack() error
88 nop 91 nop
89 lw v1, CALLFRAME_SIZ+8(sp) # get old ss_onstack 92 /*
90 lw a0, SETJMP_FRAME_SIZE(sp) # restore sc pointer 93 * We know we won't need this routine's GP anymore.
91 and v1, v1, 1 # extract onstack flag 94 */
92 sw v1, 0(a0) # save it in sc_onstack 95 RESTORE_GP64
 96 PTR_ADDU sp, sp, SETJMP_FRAME_SIZE # pop stack frame
93 97
94 lw ra, CALLFRAME_RA(sp) # restore RA 
95 addu sp, sp, SETJMP_FRAME_SIZE # pop stack frame 
96 
97 blt v0, zero, botch # check for sigaltstack() error 
98 98
99 REG_PROLOGUE 99 REG_PROLOGUE
100 REG_S ra, (2 * 4)(a0) # sc_pc = return address 100 REG_S ra, _OFFSETOF_SC_PC(a0) # sc_pc = return address
101 REG_LI v0, 0xACEDBADE # sigcontext magic number 101 REG_LI v0, 0xACEDBADE # sigcontext magic number
102 REG_S v0, (_OFFSETOF_SC_REGS + _R_ZERO * SZREG)(a0) # saved in sc_regs[0] 102 REG_S v0, _OFFSETOF_SC_REGS(a0) # saved in sc_regs[0]
103 REG_S s0, (_OFFSETOF_SC_REGS + _R_S0 * SZREG)(a0) 103 REG_S s0, _OFFSETOF_SC_REGS_S0(a0)
104 REG_S s1, (_OFFSETOF_SC_REGS + _R_S1 * SZREG)(a0) 104 REG_S s1, _OFFSETOF_SC_REGS_S1(a0)
105 REG_S s2, (_OFFSETOF_SC_REGS + _R_S2 * SZREG)(a0) 105 REG_S s2, _OFFSETOF_SC_REGS_S2(a0)
106 REG_S s3, (_OFFSETOF_SC_REGS + _R_S3 * SZREG)(a0) 106 REG_S s3, _OFFSETOF_SC_REGS_S3(a0)
107 REG_S s4, (_OFFSETOF_SC_REGS + _R_S4 * SZREG)(a0) 107 REG_S s4, _OFFSETOF_SC_REGS_S4(a0)
108 REG_S s5, (_OFFSETOF_SC_REGS + _R_S5 * SZREG)(a0) 108 REG_S s5, _OFFSETOF_SC_REGS_S5(a0)
109 REG_S s6, (_OFFSETOF_SC_REGS + _R_S6 * SZREG)(a0) 109 REG_S s6, _OFFSETOF_SC_REGS_S6(a0)
110 REG_S s7, (_OFFSETOF_SC_REGS + _R_S7 * SZREG)(a0) 110 REG_S s7, _OFFSETOF_SC_REGS_S7(a0)
111 REG_S gp, (_OFFSETOF_SC_REGS + _R_GP * SZREG)(a0) 111 REG_S gp, _OFFSETOF_SC_REGS_GP(a0)
112 REG_S sp, (_OFFSETOF_SC_REGS + _R_SP * SZREG)(a0) 112 REG_S sp, _OFFSETOF_SC_REGS_SP(a0)
113 REG_S s8, (_OFFSETOF_SC_REGS + _R_S8 * SZREG)(a0) 113 REG_S s8, _OFFSETOF_SC_REGS_S8(a0)
114 li v0, 1 # be nice if we could tell 114 li v0, 1 # be nice if we could tell
115 sw v0, (_OFFSETOF_SC_REGS + 34 * SZREG)(a0) # sc_fpused = 1 115 INT_S v0, _OFFSETOF_SC_FPUSED(a0) # sc_fpused = 1
116 cfc1 v0, $31 116 cfc1 v0, $31
117 swc1 $f20, (20 * 4 + _OFFSETOF_SC_FPREGS)(a0) 117 INT_S v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
118 swc1 $f21, (21 * 4 + _OFFSETOF_SC_FPREGS)(a0) 118#ifndef SOFTFLOAT_FOR_GCC
119 swc1 $f22, (22 * 4 + _OFFSETOF_SC_FPREGS)(a0) 119#if defined(__mips_o32) || defined(__mips_o64) || defined(__mips_n32)
120 swc1 $f23, (23 * 4 + _OFFSETOF_SC_FPREGS)(a0) 120 FP_S $f20, _OFFSETOF_SC_FPREGS_F20(a0)
121 swc1 $f24, (24 * 4 + _OFFSETOF_SC_FPREGS)(a0) 121 FP_S $f22, _OFFSETOF_SC_FPREGS_F22(a0)
122 swc1 $f25, (25 * 4 + _OFFSETOF_SC_FPREGS)(a0) 122#endif
123 swc1 $f26, (26 * 4 + _OFFSETOF_SC_FPREGS)(a0) 123#if defined(__mips_o32) || defined(__mips_o64)
124 swc1 $f27, (27 * 4 + _OFFSETOF_SC_FPREGS)(a0) 124 FP_S $f21, _OFFSETOF_SC_FPREGS_F21(a0)
125 swc1 $f28, (28 * 4 + _OFFSETOF_SC_FPREGS)(a0) 125 FP_S $f23, _OFFSETOF_SC_FPREGS_F23(a0)
126 swc1 $f29, (29 * 4 + _OFFSETOF_SC_FPREGS)(a0) 126#endif
127 swc1 $f30, (30 * 4 + _OFFSETOF_SC_FPREGS)(a0) 127#if defined(__mips_n32) || defined(__mips_n64)
128 swc1 $f31, (31 * 4 + _OFFSETOF_SC_FPREGS)(a0) 128 FP_S $f24, _OFFSETOF_SC_FPREGS_F24(a0)
129 sw v0, (32 * 4 + _OFFSETOF_SC_FPREGS)(a0) 129 FP_S $f26, _OFFSETOF_SC_FPREGS_F26(a0)
130 move v0, zero 130 FP_S $f28, _OFFSETOF_SC_FPREGS_F28(a0)
131 j ra 131 FP_S $f30, _OFFSETOF_SC_FPREGS_F30(a0)
 132#endif
 133#if defined(__mips_n64)
 134 FP_S $f25, _OFFSETOF_SC_FPREGS_F25(a0)
 135 FP_S $f27, _OFFSETOF_SC_FPREGS_F27(a0)
 136 FP_S $f29, _OFFSETOF_SC_FPREGS_F29(a0)
 137 FP_S $f31, _OFFSETOF_SC_FPREGS_F31(a0)
 138#endif
 139#endif /* SOFTFLOAT_FOR_GCC */
132 REG_EPILOGUE 140 REG_EPILOGUE
 141 j ra
 142 move v0, zero
 143
133botch: 144botch:
134 jal _C_LABEL(abort) 145 jal _C_LABEL(abort)
135END(__setjmp14) 146END(__setjmp14)

cvs diff -r1.3 -r1.4 src/lib/libc/arch/mips/gen/swapcontext.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/gen/swapcontext.S 2008/04/28 20:22:56 1.3
+++ src/lib/libc/arch/mips/gen/swapcontext.S 2009/12/14 01:07:42 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: swapcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $ */ 1/* $NetBSD: swapcontext.S,v 1.4 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Klaus Klein. 8 * by Klaus Klein.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,50 +20,48 @@ @@ -20,50 +20,48 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include "SYS.h" 32#include "SYS.h"
33#include <machine/mcontext.h> 33#include "assym.h"
34 34
35#if defined(SYSLIBC_SCCS) && !defined(lint) 35#if defined(SYSLIBC_SCCS) && !defined(lint)
36 ASMSTR("$NetBSD: swapcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $") 36 RCSID("$NetBSD: swapcontext.S,v 1.4 2009/12/14 01:07:42 matt Exp $")
37#endif /* SYSLIBC_SCCS && !lint */ 37#endif /* SYSLIBC_SCCS && !lint */
38 38
39#ifdef __ABICALLS__ 
40 .abicalls 
41#endif 
42 .set reorder 39 .set reorder
43  40
44NESTED(swapcontext, CALLFRAME_SIZ, ra) 41NESTED(swapcontext, CALLFRAME_SIZ, ra)
45 .mask 0x80000030, (CALLFRAME_RA - CALLFRAME_SIZ) 42 .mask 0x80000030, (CALLFRAME_RA - CALLFRAME_SIZ)
46 subu sp, sp, CALLFRAME_SIZ 43 PTR_SUBU sp, sp, CALLFRAME_SIZ
47 sw ra, CALLFRAME_RA(sp) # save ra 44 PTR_S ra, CALLFRAME_RA(sp) # save ra
48 sw a0, 0(sp) # stash away oucp 45 PTR_S a0, 0(sp) # stash away oucp
49 sw a1, 4(sp) # stash away ucp 46 PTR_S a1, SZREG(sp) # stash away ucp
50 SYSTRAP(getcontext) 47 SYSTRAP(getcontext)
51 lw ra, CALLFRAME_RA(sp) 48 PTR_L ra, CALLFRAME_RA(sp)
52 bne a3, zero, 1f 49 bne a3, zero, 1f
53 50
54 lw v1, 0(sp) # load oucp again for adjustment 51 PTR_L v1, 0(sp) # load oucp again for adjustment
55 lw a0, 4(sp) # load ucp 52 PTR_L a0, SZREG(sp) # load ucp
56 addiu v0, sp, CALLFRAME_SIZ 53 PTR_ADDIU v0, sp, CALLFRAME_SIZ
57 REG_PROLOGUE 54 REG_PROLOGUE
58 REG_S zero, (_OFFSETOF_UC_GREGS + _REG_V0 * SZREG)(v1) 55 REG_S zero, _OFFSETOF_UC_GREGS_V0(v1)
59 REG_S ra, (_OFFSETOF_UC_GREGS + _REG_EPC * SZREG)(v1) 56 REG_S ra, _OFFSETOF_UC_GREGS_EPC(v1)
60 REG_S v0, (_OFFSETOF_UC_GREGS + _REG_SP * SZREG)(v1) 57 REG_S v0, _OFFSETOF_UC_GREGS_SP(v1)
61 REG_EPILOGUE 58 REG_EPILOGUE
62 59
63 SYSTRAP(setcontext) 60 SYSTRAP(setcontext)
64 /* NOTREACHED */ 61 /* NOTREACHED */
651: 621:
66 addiu sp, sp, CALLFRAME_SIZ 63 PTR_ADDU sp, sp, CALLFRAME_SIZ
67 la t9, _C_LABEL(__cerror) 64 SETUP_GPX(t0);
68 jr t9 65 SETUP_GP64(t3,swapcontext);
 66 PIC_TAILCALL(__cerror)
69END(swapcontext) 67END(swapcontext)

File Added: src/lib/libc/arch/mips/softfloat/milieu.h
/* $NetBSD: milieu.h,v 1.2 2009/12/14 01:07:42 matt Exp $ */

/*
===============================================================================

This C header file is part of the SoftFloat IEC/IEEE Floating-point
Arithmetic Package, Release 2a.

Written by John R. Hauser.  This work was made possible in part by the
International Computer Science Institute, located at Suite 600, 1947 Center
Street, Berkeley, California 94704.  Funding was partially provided by the
National Science Foundation under grant MIP-9311980.  The original version
of this code was written as part of a project to build a fixed-point vector
processor in collaboration with the University of California at Berkeley,
overseen by Profs. Nelson Morgan and John Wawrzynek.  More information
is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
arithmetic/SoftFloat.html'.

THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.

Derivative works are acceptable, even for commercial purposes, so long as
(1) they include prominent notice that the work is derivative, and (2) they
include prominent notice akin to these four paragraphs for those parts of
this code that are retained.

===============================================================================
*/

/*
-------------------------------------------------------------------------------
Include common integer types and flags.
-------------------------------------------------------------------------------
*/
#include "mips-gcc.h"

/*
-------------------------------------------------------------------------------
Symbolic Boolean literals.
-------------------------------------------------------------------------------
*/
enum {
    FALSE = 0,
    TRUE  = 1
};

File Added: src/lib/libc/arch/mips/softfloat/mips-gcc.h
/* $NetBSD: mips-gcc.h,v 1.2 2009/12/14 01:07:42 matt Exp $ */

/*
-------------------------------------------------------------------------------
One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
-------------------------------------------------------------------------------
*/
#ifdef __MIPSEB__
#define BIGENDIAN
#else
#define LITTLEENDIAN
#endif

/*
-------------------------------------------------------------------------------
The macro `BITS64' can be defined to indicate that 64-bit integer types are
supported by the compiler.
-------------------------------------------------------------------------------
*/
#define BITS64

/*
-------------------------------------------------------------------------------
Each of the following `typedef's defines the most convenient type that holds
integers of at least as many bits as specified.  For example, `uint8' should
be the most convenient type that can hold unsigned integers of as many as
8 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
to the same as `int'.
-------------------------------------------------------------------------------
*/
typedef int flag;
typedef int uint8;
typedef int int8;
typedef int uint16;
typedef int int16;
typedef unsigned int uint32;
typedef signed int int32;
#ifdef BITS64
typedef unsigned long long int uint64;
typedef signed long long int int64;
#endif

/*
-------------------------------------------------------------------------------
Each of the following `typedef's defines a type that holds integers
of _exactly_ the number of bits specified.  For instance, for most
implementation of C, `bits16' and `sbits16' should be `typedef'ed to
`unsigned short int' and `signed short int' (or `short int'), respectively.
-------------------------------------------------------------------------------
*/
typedef unsigned char bits8;
typedef signed char sbits8;
typedef unsigned short int bits16;
typedef signed short int sbits16;
typedef unsigned int bits32;
typedef signed int sbits32;
#ifdef BITS64
typedef unsigned long long int bits64;
typedef signed long long int sbits64;
#endif

#ifdef BITS64
/*
-------------------------------------------------------------------------------
The `LIT64' macro takes as its argument a textual integer literal and
if necessary ``marks'' the literal as having a 64-bit integer type.
For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
appended with the letters `LL' standing for `long long', which is `gcc's
name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
defined as the identity macro:  `#define LIT64( a ) a'.
-------------------------------------------------------------------------------
*/
#define LIT64( a ) a##LL
#endif

/*
-------------------------------------------------------------------------------
The macro `INLINE' can be used before functions that should be inlined.  If
a compiler does not support explicit inlining, this macro should be defined
to be `static'.
-------------------------------------------------------------------------------
*/
#define INLINE static inline

/*
-------------------------------------------------------------------------------
The ARM FPA is odd in that it stores doubles high-order word first, no matter
what the endianness of the CPU.  VFP is sane.
-------------------------------------------------------------------------------
*/
#if defined(SOFTFLOAT_FOR_GCC)
#define FLOAT64_DEMANGLE(a)	(a)
#define FLOAT64_MANGLE(a)	(a)
#endif

File Added: src/lib/libc/arch/mips/softfloat/softfloat.h
/*	$NetBSD: softfloat.h,v 1.2 2009/12/14 01:07:42 matt Exp $	*/

/* This is a derivative work. */

/*
===============================================================================

This C header file is part of the SoftFloat IEC/IEEE Floating-point
Arithmetic Package, Release 2a.

Written by John R. Hauser.  This work was made possible in part by the
International Computer Science Institute, located at Suite 600, 1947 Center
Street, Berkeley, California 94704.  Funding was partially provided by the
National Science Foundation under grant MIP-9311980.  The original version
of this code was written as part of a project to build a fixed-point vector
processor in collaboration with the University of California at Berkeley,
overseen by Profs. Nelson Morgan and John Wawrzynek.  More information
is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
arithmetic/SoftFloat.html'.

THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.

Derivative works are acceptable, even for commercial purposes, so long as
(1) they include prominent notice that the work is derivative, and (2) they
include prominent notice akin to these four paragraphs for those parts of
this code that are retained.

===============================================================================
*/

/*
-------------------------------------------------------------------------------
The macro `FLOATX80' must be defined to enable the extended double-precision
floating-point format `floatx80'.  If this macro is not defined, the
`floatx80' type will not be defined, and none of the functions that either
input or output the `floatx80' type will be defined.  The same applies to
the `FLOAT128' macro and the quadruple-precision format `float128'.
-------------------------------------------------------------------------------
*/
/* #define FLOATX80 */
/* #define FLOAT128 */

#include <machine/ieeefp.h>

/*
-------------------------------------------------------------------------------
Software IEC/IEEE floating-point types.
-------------------------------------------------------------------------------
*/
typedef unsigned int float32;
typedef unsigned long long float64;
#ifdef FLOATX80
typedef struct {
    unsigned short high;
    unsigned long long low;
} floatx80;
#endif
#ifdef FLOAT128
typedef struct {
    unsigned long long high, low;
} float128;
#endif

/*
-------------------------------------------------------------------------------
Software IEC/IEEE floating-point underflow tininess-detection mode.
-------------------------------------------------------------------------------
*/
#ifndef SOFTFLOAT_FOR_GCC
extern int float_detect_tininess;
#endif
enum {
    float_tininess_after_rounding  = 0,
    float_tininess_before_rounding = 1
};

/*
-------------------------------------------------------------------------------
Software IEC/IEEE floating-point rounding mode.
-------------------------------------------------------------------------------
*/
extern fp_rnd float_rounding_mode;
enum {
    float_round_nearest_even = FP_RN,
    float_round_to_zero      = FP_RZ,
    float_round_down         = FP_RM,
    float_round_up           = FP_RP
};

/*
-------------------------------------------------------------------------------
Software IEC/IEEE floating-point exception flags.
-------------------------------------------------------------------------------
*/
extern fp_except float_exception_flags;
extern fp_except float_exception_mask;
enum {
    float_flag_inexact   = FP_X_IMP,
    float_flag_underflow = FP_X_UFL,
    float_flag_overflow  = FP_X_OFL,
    float_flag_divbyzero = FP_X_DZ,
    float_flag_invalid   = FP_X_INV
};

/*
-------------------------------------------------------------------------------
Routine to raise any or all of the software IEC/IEEE floating-point
exception flags.
-------------------------------------------------------------------------------
*/
void float_raise( fp_except );

/*
-------------------------------------------------------------------------------
Software IEC/IEEE integer-to-floating-point conversion routines.
-------------------------------------------------------------------------------
*/
float32 int32_to_float32( int );
float64 int32_to_float64( int );
#ifdef FLOATX80
floatx80 int32_to_floatx80( int );
#endif
#ifdef FLOAT128
float128 int32_to_float128( int );
#endif
#ifndef SOFTFLOAT_FOR_GCC /* __floatdi?f is in libgcc2.c */
float32 int64_to_float32( long long );
float64 int64_to_float64( long long );
#ifdef FLOATX80
floatx80 int64_to_floatx80( long long );
#endif
#ifdef FLOAT128
float128 int64_to_float128( long long );
#endif
#endif

/*
-------------------------------------------------------------------------------
Software IEC/IEEE single-precision conversion routines.
-------------------------------------------------------------------------------
*/
int float32_to_int32( float32 );
int float32_to_int32_round_to_zero( float32 );
#if defined(SOFTFLOAT_FOR_GCC) && defined(SOFTFLOAT_NEED_FIXUNS)
unsigned int float32_to_uint32_round_to_zero( float32 );
#endif
#ifndef SOFTFLOAT_FOR_GCC /* __fix?fdi provided by libgcc2.c */
long long float32_to_int64( float32 );
long long float32_to_int64_round_to_zero( float32 );
#endif
float64 float32_to_float64( float32 );
#ifdef FLOATX80
floatx80 float32_to_floatx80( float32 );
#endif
#ifdef FLOAT128
float128 float32_to_float128( float32 );
#endif

/*
-------------------------------------------------------------------------------
Software IEC/IEEE single-precision operations.
-------------------------------------------------------------------------------
*/
float32 float32_round_to_int( float32 );
float32 float32_add( float32, float32 );
float32 float32_sub( float32, float32 );
float32 float32_mul( float32, float32 );
float32 float32_div( float32, float32 );
float32 float32_rem( float32, float32 );
float32 float32_sqrt( float32 );
int float32_eq( float32, float32 );
int float32_le( float32, float32 );
int float32_lt( float32, float32 );
int float32_eq_signaling( float32, float32 );
int float32_le_quiet( float32, float32 );
int float32_lt_quiet( float32, float32 );
#ifndef SOFTFLOAT_FOR_GCC
int float32_is_signaling_nan( float32 );
#endif

/*
-------------------------------------------------------------------------------
Software IEC/IEEE double-precision conversion routines.
-------------------------------------------------------------------------------
*/
int float64_to_int32( float64 );
int float64_to_int32_round_to_zero( float64 );
#if defined(SOFTFLOAT_FOR_GCC) && defined(SOFTFLOAT_NEED_FIXUNS)
unsigned int float64_to_uint32_round_to_zero( float64 );
#endif
#ifndef SOFTFLOAT_FOR_GCC /* __fix?fdi provided by libgcc2.c */
long long float64_to_int64( float64 );
long long float64_to_int64_round_to_zero( float64 );
#endif
float32 float64_to_float32( float64 );
#ifdef FLOATX80
floatx80 float64_to_floatx80( float64 );
#endif
#ifdef FLOAT128
float128 float64_to_float128( float64 );
#endif

/*
-------------------------------------------------------------------------------
Software IEC/IEEE double-precision operations.
-------------------------------------------------------------------------------
*/
float64 float64_round_to_int( float64 );
float64 float64_add( float64, float64 );
float64 float64_sub( float64, float64 );
float64 float64_mul( float64, float64 );
float64 float64_div( float64, float64 );
float64 float64_rem( float64, float64 );
float64 float64_sqrt( float64 );
int float64_eq( float64, float64 );
int float64_le( float64, float64 );
int float64_lt( float64, float64 );
int float64_eq_signaling( float64, float64 );
int float64_le_quiet( float64, float64 );
int float64_lt_quiet( float64, float64 );
#ifndef SOFTFLOAT_FOR_GCC
int float64_is_signaling_nan( float64 );
#endif

#ifdef FLOATX80

/*
-------------------------------------------------------------------------------
Software IEC/IEEE extended double-precision conversion routines.
-------------------------------------------------------------------------------
*/
int floatx80_to_int32( floatx80 );
int floatx80_to_int32_round_to_zero( floatx80 );
long long floatx80_to_int64( floatx80 );
long long floatx80_to_int64_round_to_zero( floatx80 );
float32 floatx80_to_float32( floatx80 );
float64 floatx80_to_float64( floatx80 );
#ifdef FLOAT128
float128 floatx80_to_float128( floatx80 );
#endif

/*
-------------------------------------------------------------------------------
Software IEC/IEEE extended double-precision rounding precision.  Valid
values are 32, 64, and 80.
-------------------------------------------------------------------------------
*/
extern int floatx80_rounding_precision;

/*
-------------------------------------------------------------------------------
Software IEC/IEEE extended double-precision operations.
-------------------------------------------------------------------------------
*/
floatx80 floatx80_round_to_int( floatx80 );
floatx80 floatx80_add( floatx80, floatx80 );
floatx80 floatx80_sub( floatx80, floatx80 );
floatx80 floatx80_mul( floatx80, floatx80 );
floatx80 floatx80_div( floatx80, floatx80 );
floatx80 floatx80_rem( floatx80, floatx80 );
floatx80 floatx80_sqrt( floatx80 );
int floatx80_eq( floatx80, floatx80 );
int floatx80_le( floatx80, floatx80 );
int floatx80_lt( floatx80, floatx80 );
int floatx80_eq_signaling( floatx80, floatx80 );
int floatx80_le_quiet( floatx80, floatx80 );
int floatx80_lt_quiet( floatx80, floatx80 );
int floatx80_is_signaling_nan( floatx80 );

#endif

#ifdef FLOAT128

/*
-------------------------------------------------------------------------------
Software IEC/IEEE quadruple-precision conversion routines.
-------------------------------------------------------------------------------
*/
int float128_to_int32( float128 );
int float128_to_int32_round_to_zero( float128 );
#if defined(SOFTFLOAT_FOR_GCC) && defined(SOFTFLOAT_NEED_FIXUNS)
unsigned int float128_to_uint32_round_to_zero( float64 );
#endif
long long float128_to_int64( float128 );
long long float128_to_int64_round_to_zero( float128 );
#if defined(SOFTFLOAT_FOR_GCC) && defined(SOFTFLOAT_NEED_FIXUNS)
unsigned long long float128_to_uint64_round_to_zero( float128 );
#endif
float32 float128_to_float32( float128 );
float64 float128_to_float64( float128 );
#ifdef FLOATX80
floatx80 float128_to_floatx80( float128 );
#endif

/*
-------------------------------------------------------------------------------
Software IEC/IEEE quadruple-precision operations.
-------------------------------------------------------------------------------
*/
float128 float128_round_to_int( float128 );
float128 float128_add( float128, float128 );
float128 float128_sub( float128, float128 );
float128 float128_mul( float128, float128 );
float128 float128_div( float128, float128 );
float128 float128_rem( float128, float128 );
float128 float128_sqrt( float128 );
int float128_eq( float128, float128 );
int float128_le( float128, float128 );
int float128_lt( float128, float128 );
int float128_eq_signaling( float128, float128 );
int float128_le_quiet( float128, float128 );
int float128_lt_quiet( float128, float128 );
int float128_is_signaling_nan( float128 );

#endif


cvs diff -r1.4 -r1.5 src/lib/libc/arch/mips/string/Makefile.inc (expand / switch to unified diff)

--- src/lib/libc/arch/mips/string/Makefile.inc 2009/07/30 20:57:16 1.4
+++ src/lib/libc/arch/mips/string/Makefile.inc 2009/12/14 01:07:42 1.5
@@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
1# $NetBSD: Makefile.inc,v 1.4 2009/07/30 20:57:16 dsl Exp $ 1# $NetBSD: Makefile.inc,v 1.5 2009/12/14 01:07:42 matt Exp $
2 2
3SRCS+= bcmp.S bcopy.S bzero.S ffs.S \ 3SRCS+= bcmp.S bcopy.S bzero.S \
 4 ffs.S \
4 memcpy.S memmove.S \ 5 memcpy.S memmove.S \
5 strchr.S strrchr.S \ 6 strchr.S strrchr.S \
6 strcmp.S strlen.S \ 7 strcmp.S strlen.S

cvs diff -r1.8 -r1.9 src/lib/libc/arch/mips/string/bcmp.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/string/bcmp.S 2003/08/07 16:42:16 1.8
+++ src/lib/libc/arch/mips/string/bcmp.S 2009/12/14 01:07:42 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcmp.S,v 1.8 2003/08/07 16:42:16 agc Exp $ */ 1/* $NetBSD: bcmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -27,99 +27,98 @@ @@ -27,99 +27,98 @@
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include <mips/asm.h> 35#include <mips/asm.h>
36#define _LOCORE /* XXX not really, just assembly-code source */ 36#define _LOCORE /* XXX not really, just assembly-code source */
37#include <machine/endian.h> /* LWLO/LWHI, SWLO/SWHI */ 37#include <machine/endian.h> /* LWLO/LWHI, SWLO/SWHI */
38 38
39#if defined(LIBC_SCCS) && !defined(lint) 39#if defined(LIBC_SCCS) && !defined(lint)
40 ASMSTR("from: @(#)bcmp.s 8.1 (Berkeley) 6/4/93") 40#if 0
41 ASMSTR("$NetBSD: bcmp.S,v 1.8 2003/08/07 16:42:16 agc Exp $") 41 RCSID("from: @(#)bcmp.s 8.1 (Berkeley) 6/4/93")
42#endif /* LIBC_SCCS and not lint */ 42#else
43 43 RCSID("$NetBSD: bcmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $")
44#ifdef __ABICALLS__ 
45 .abicalls 
46#endif 44#endif
 45#endif /* LIBC_SCCS and not lint */
47 46
48/* bcmp(s1, s2, n) */ 47/* bcmp(s1, s2, n) */
49 48
50 49
51LEAF(bcmp) 50LEAF(bcmp)
52 .set noreorder 51 .set noreorder
53 blt a2, 16, small # is it worth any trouble? 52 blt a2, 16, small # is it worth any trouble?
54 xor v0, a0, a1 # compare low two bits of addresses 53 xor v0, a0, a1 # compare low two bits of addresses
55 and v0, v0, 3 54 and v0, v0, 3
56 subu a3, zero, a1 # compute # bytes to word align address 55 PTR_SUBU a3, zero, a1 # compute # bytes to word align address
57 bne v0, zero, unaligned # not possible to align addresses 56 bne v0, zero, unaligned # not possible to align addresses
58 and a3, a3, 3 57 and a3, a3, 3
59 58
60 beq a3, zero, 1f 59 beq a3, zero, 1f
61 subu a2, a2, a3 # subtract from remaining count 60 PTR_SUBU a2, a2, a3 # subtract from remaining count
62 move v0, v1 # init v0,v1 so unmodified bytes match 61 move v0, v1 # init v0,v1 so unmodified bytes match
63 LWHI v0, 0(a0) # read 1, 2, or 3 bytes 62 LWHI v0, 0(a0) # read 1, 2, or 3 bytes
64 LWHI v1, 0(a1) 63 LWHI v1, 0(a1)
65 addu a1, a1, a3 64 PTR_ADDU a1, a1, a3
66 bne v0, v1, nomatch 65 bne v0, v1, nomatch
67 addu a0, a0, a3 66 PTR_ADDU a0, a0, a3
681: 671:
69 and a3, a2, ~3 # compute number of whole words left 68 and a3, a2, ~3 # compute number of whole words left
70 subu a2, a2, a3 # which has to be >= (16-3) & ~3 69 PTR_SUBU a2, a2, a3 # which has to be >= (16-3) & ~3
71 addu a3, a3, a0 # compute ending address 70 PTR_ADDU a3, a3, a0 # compute ending address
722: 712:
73 lw v0, 0(a0) # compare words 72 lw v0, 0(a0) # compare words
74 lw v1, 0(a1) 73 lw v1, 0(a1)
75 addu a0, a0, 4 74 PTR_ADDU a0, a0, 4
76 bne v0, v1, nomatch 75 bne v0, v1, nomatch
77 addu a1, a1, 4 76 PTR_ADDU a1, a1, 4
78 bne a0, a3, 2b 77 bne a0, a3, 2b
79 nop 78 nop
80 b small # finish remainder 79 b small # finish remainder
81 nop 80 nop
82unaligned: 81unaligned:
83 beq a3, zero, 2f 82 beq a3, zero, 2f
84 subu a2, a2, a3 # subtract from remaining count 83 PTR_SUBU a2, a2, a3 # subtract from remaining count
85 addu a3, a3, a0 # compute ending address 84 PTR_ADDU a3, a3, a0 # compute ending address
861: 851:
87 lbu v0, 0(a0) # compare bytes until a1 word aligned 86 lbu v0, 0(a0) # compare bytes until a1 word aligned
88 lbu v1, 0(a1) 87 lbu v1, 0(a1)
89 addu a0, a0, 1 88 PTR_ADDU a0, a0, 1
90 bne v0, v1, nomatch 89 bne v0, v1, nomatch
91 addu a1, a1, 1 90 PTR_ADDU a1, a1, 1
92 bne a0, a3, 1b 91 bne a0, a3, 1b
93 nop 92 nop
942: 932:
95 and a3, a2, ~3 # compute number of whole words left 94 and a3, a2, ~3 # compute number of whole words left
96 subu a2, a2, a3 # which has to be >= (16-3) & ~3 95 PTR_SUBU a2, a2, a3 # which has to be >= (16-3) & ~3
97 addu a3, a3, a0 # compute ending address 96 PTR_ADDU a3, a3, a0 # compute ending address
983: 973:
99 LWHI v0, 0(a0) # compare words a0 unaligned, a1 aligned 98 LWHI v0, 0(a0) # compare words a0 unaligned, a1 aligned
100 LWLO v0, 3(a0) 99 LWLO v0, 3(a0)
101 lw v1, 0(a1) 100 lw v1, 0(a1)
102 addu a0, a0, 4 101 PTR_ADDU a0, a0, 4
103 bne v0, v1, nomatch 102 bne v0, v1, nomatch
104 addu a1, a1, 4 103 PTR_ADDU a1, a1, 4
105 bne a0, a3, 3b 104 bne a0, a3, 3b
106 nop 105 nop
107small: 106small:
108 ble a2, zero, match 107 ble a2, zero, match
109 addu a3, a2, a0 # compute ending address 108 PTR_ADDU a3, a2, a0 # compute ending address
1101: 1091:
111 lbu v0, 0(a0) 110 lbu v0, 0(a0)
112 lbu v1, 0(a1) 111 lbu v1, 0(a1)
113 addu a0, a0, 1 112 PTR_ADDU a0, a0, 1
114 bne v0, v1, nomatch 113 bne v0, v1, nomatch
115 addu a1, a1, 1 114 PTR_ADDU a1, a1, 1
116 bne a0, a3, 1b 115 bne a0, a3, 1b
117 nop 116 nop
118match: 117match:
119 j ra 118 j ra
120 move v0, zero 119 move v0, zero
121nomatch: 120nomatch:
122 j ra 121 j ra
123 li v0, 1 122 li v0, 1
124 .set reorder 123 .set reorder
125END(bcmp) 124END(bcmp)

cvs diff -r1.8 -r1.9 src/lib/libc/arch/mips/string/bzero.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/string/bzero.S 2003/08/07 16:42:16 1.8
+++ src/lib/libc/arch/mips/string/bzero.S 2009/12/14 01:07:42 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bzero.S,v 1.8 2003/08/07 16:42:16 agc Exp $ */ 1/* $NetBSD: bzero.S,v 1.9 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,56 +25,73 @@ @@ -25,56 +25,73 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include <mips/asm.h> 35#include <mips/asm.h>
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)bzero.s 8.1 (Berkeley) 6/4/93") 38#if 0
39 ASMSTR("$NetBSD: bzero.S,v 1.8 2003/08/07 16:42:16 agc Exp $") 39 RCSID("from: @(#)bzero.s 8.1 (Berkeley) 6/4/93")
 40#else
 41 RCSID("$NetBSD: bzero.S,v 1.9 2009/12/14 01:07:42 matt Exp $")
 42#endif
40#endif /* LIBC_SCCS and not lint */ 43#endif /* LIBC_SCCS and not lint */
41 44
42 45
43#define _LOCORE /* XXX not really, just assembly-code source */ 46#define _LOCORE /* XXX not really, just assembly-code source */
44#include <machine/endian.h> 47#include <machine/endian.h>
45 48
46#ifdef __ABICALLS__ 
47 .abicalls 
48#endif 
49 
50/* bzero(s1, n) */ 49/* bzero(s1, n) */
51 50
52LEAF(bzero) 51LEAF(bzero)
53 .set noreorder 52 .set noreorder
54 blt a1, 12, smallclr # small amount to clear? 53 blt a1, 3*SZREG, smallclr # small amount to clear?
55 subu a3, zero, a0 # compute # bytes to word align address 54 PTR_SUBU a3, zero, a0 # compute # bytes to word align address
56 and a3, a3, 3 55 and a3, a3, SZREG-1
57 beq a3, zero, 1f # skip if word aligned 56 beq a3, zero, 1f # skip if word aligned
58 subu a1, a1, a3 # subtract from remaining count 57#if SZREG == 4
59 SWHI zero, 0(a0) # clear 1, 2, or 3 bytes to align 58 PTR_SUBU a1, a1, a3 # subtract from remaining count
60 addu a0, a0, a3 59 SWHI zero, 0(a0) # clear 1, 2, or 3 bytes to align
 60 PTR_ADDU a0, a0, a3
 61#endif
 62#if SZREG == 8
 63 PTR_SUBU a1, a1, a3 # subtract from remaining count
 64 PTR_ADDU a0, a0, a3 # align dst to next word
 65 sll a3, a3, 3 # bits to bytes
 66 li a2, -1 # make a mask
 67#if _BYTE_ORDER == _BIG_ENDIAN
 68 REG_SRLV a2, a2, a3 # we want to keep the MSB bytes
 69#endif
 70#if _BYTE_ORDER == _LITTLE_ENDIAN
 71 REG_SLLV a2, a2, a3 # we want to keep the LSB bytes
 72#endif
 73 nor a2, zero, a2 # complement the mask
 74 REL_L v0, -SZREG(a0) # load the word to partially clear
 75 and v0, v0, a2 # clear the bytes
 76 REG_S v0, -SZREG(a0) # store it back
 77#endif
611: 781:
62 and v0, a1, 3 # compute number of words left 79 and v0, a1, SZREG-1 # compute number of words left
63 subu a3, a1, v0 80 PTR_SUBU a3, a1, v0
64 move a1, v0 81 move a1, v0
65 addu a3, a3, a0 # compute ending address 82 PTR_ADDU a3, a3, a0 # compute ending address
662: 832:
67 addu a0, a0, 4 # clear words 84 PTR_ADDU a0, a0, SZREG # clear words
68 bne a0, a3, 2b # unrolling loop doesnt help 85 bne a0, a3, 2b # unrolling loop doesnt help
69 sw zero, -4(a0) # since we are limited by memory speed 86 REG_S zero, -SZREG(a0) # since we are limited by memory speed
70smallclr: 87smallclr:
71 ble a1, zero, 2f 88 ble a1, zero, 2f
72 addu a3, a1, a0 # compute ending address 89 PTR_ADDU a3, a1, a0 # compute ending address
731: 901:
74 addu a0, a0, 1 # clear bytes 91 PTR_ADDU a0, a0, 1 # clear bytes
75 bne a0, a3, 1b 92 bne a0, a3, 1b
76 sb zero, -1(a0) 93 sb zero, -1(a0)
772: 942:
78 j ra 95 j ra
79 nop 96 nop
80END(bzero) 97END(bzero)

cvs diff -r1.7 -r1.8 src/lib/libc/arch/mips/sys/__clone.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/__clone.S 2008/04/28 20:22:56 1.7
+++ src/lib/libc/arch/mips/sys/__clone.S 2009/12/14 01:07:42 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: __clone.S,v 1.7 2008/04/28 20:22:56 martin Exp $ */ 1/* $NetBSD: __clone.S,v 1.8 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -23,79 +23,81 @@ @@ -23,79 +23,81 @@
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/errno.h> 32#include <sys/errno.h>
33 33
34#include "SYS.h" 34#include "SYS.h"
35 35
 36#if defined(SYSLIBC_SCCS) && !defined(lint)
 37 RCSID("$NetBSD: __clone.S,v 1.8 2009/12/14 01:07:42 matt Exp $");
 38#endif /* SYSLIBC_SCCS and not lint */
 39
36#ifdef WEAK_ALIAS 40#ifdef WEAK_ALIAS
37WEAK_ALIAS(clone, __clone) 41WEAK_ALIAS(clone, __clone)
38#endif 42#endif
39 43
40/* 44/*
41 * int __clone(int (*fn)(void *), void *stack, int flags, void *arg); 45 * int __clone(int (*fn)(void *), void *stack, int flags, void *arg);
42 */ 46 */
43LEAF(__clone) 47LEAF(__clone)
44 PIC_PROLOGUE(__clone, t9) 48 PIC_PROLOGUE(__clone)
45 49
46 /* 50 /*
47 * Sanity checks: func and stack may not be NULL. 51 * Sanity checks: func and stack may not be NULL.
48 */ 52 */
49 li v0, EINVAL 53 li v0, EINVAL
50 beq a0, zero, 8f 54 beq a0, zero, 8f
51 beq a1, zero, 8f 55 beq a1, zero, 8f
52 56
53 /* 57 /*
54 * We need to be able to get at the func and arg arguments 58 * We need to be able to get at the func and arg arguments
55 * in the child. Luckily, we have a convenient place to 59 * in the child. Luckily, we have a convenient place to
56 * do this: the child's stack. 60 * do this: the child's stack.
57 */ 61 */
58 subu a1, a1, (2 * SZREG) 62 PTR_SUBU a1, a1, CALLFRAME_SIZ
59 REG_S a0, 0(a1) 63 REG_S a0, 0(a1)
60 REG_S a3, SZREG(a1) 64 REG_S a3, SZREG(a1)
61 65
62 /* 66 /*
63 * The system call expects (flags, stack). 67 * The system call expects (flags, stack).
64 */ 68 */
65 move a0, a2 69 move a0, a2
66 SYSTRAP(__clone) 70 SYSTRAP(__clone)
67 bne a3, zero, 8f 71 bne a3, zero, 8f
68 72
69 bne v1, zero, 9f # v1 (rv[1]) == 0, parent, child pid in v0 73 bne v1, zero, 9f # v1 (rv[1]) == 0, parent, child pid in v0
70 74
71 j ra # parent return 75 PIC_RETURN() # parent return
72 76
738: PIC_CALL(__cerror, t9) 778: PIC_TAILCALL(__cerror)
74 /* NOTREACHED */ 78 /* NOTREACHED */
75 79
769: /* 809: /*
77 * Child: Fetch the function and argument from the new stack, 81 * Child: Fetch the function and argument from the new stack and create
78 * and create a frame so that the child can be safely called. 82 a frame so that the child can be safely called.
79 * 83 *
80 * There are already register slots on the stack from above. 84 * There are already register slots on the stack from above.
81 * We take 4 register slots more. The lower 4 accommodate o32 85 * They already include the o32 argument save area. The
82 * argument save area. The next higher is used to save GP (if 86 * highest is unused. a1 should equal sp now.
83 * ABICALLS). The highest is unused. 
84 */ 87 */
85 REG_L t9, 0(sp) 
86 REG_L a0, SZREG(sp) 
87 subu sp, sp, (4 * SZREG) 
88 88
89#ifdef __ABICALLS__ 89 REG_L t9, 0(sp)
90 .cprestore (4 * SZREG) 90 REG_L a0, SZREG(sp)
91#endif 91
 92 REG_S zero, CALLFRAME_RA(sp) /* make sure stack frame ends */
92 93
93 /* Call the clone's entry point. */ 94 /* Call the clone's entry point. */
94 jal t9 95 SAVE_GP(CALLFRAME_GP)
 96 jal t9
95 97
96 /* Pass the return value to _exit(). */ 98 /* Pass the return value to _exit. */
97 move a0, v0 99 move a0, v0
98 PIC_CALL(_exit, t9) 100 PIC_TAILCALL(_exit)
99 101
100 /* NOTREACHED */ 102 /* NOTREACHED */
101END(__clone) 103END(__clone)

cvs diff -r1.2 -r1.3 src/lib/libc/arch/mips/sys/__sigtramp2.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/__sigtramp2.S 2008/04/28 20:22:56 1.2
+++ src/lib/libc/arch/mips/sys/__sigtramp2.S 2009/12/14 01:07:42 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: __sigtramp2.S,v 1.2 2008/04/28 20:22:56 martin Exp $ */ 1/* $NetBSD: __sigtramp2.S,v 1.3 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,29 +20,35 @@ @@ -20,29 +20,35 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include "SYS.h" 32#include "SYS.h"
 33#include "assym.h"
 34
 35#if defined(SYSLIBC_SCCS) && !defined(lint)
 36 RCSID("$NetBSD: __sigtramp2.S,v 1.3 2009/12/14 01:07:42 matt Exp $")
 37#endif /* SYSLIBC_SCCS and not lint */
 38
33 39
34/* 40/*
35 * The MIPS signal trampoline is invoked only to return from 41 * The MIPS signal trampoline is invoked only to return from
36 * the signal; the kernel calls the signal handler directly. 42 * the signal; the kernel calls the signal handler directly.
37 * 43 *
38 * On entry, stack looks like: 44 * On entry, stack looks like:
39 * 45 *
40 * sp -> siginfo_t structure 46 * sp -> siginfo_t structure
41 * sp + 128 -> ucontext_t structure 47 * sp + SIGINFO_SIZE -> ucontext_t structure
42 */ 48 */
43LEAF_NOPROFILE(__sigtramp_siginfo_2) 49LEAF_NOPROFILE(__sigtramp_siginfo_2)
44 addu a0, sp, 128 /* address of ucontext */ 50 PTR_ADDU a0, sp, SIGINFO_SIZE /* address of ucontext */
45 SYSTRAP(setcontext) /* and do setcontext */ 51 SYSTRAP(setcontext) /* and do setcontext */
46 move a0, v0 /* exit with errno */ 52 move a0, v0 /* exit with errno */
47 SYSTRAP(exit) /* if sigreturn fails */ 53 SYSTRAP(exit) /* if sigreturn fails */
48END(__sigtramp_siginfo_2) 54END(__sigtramp_siginfo_2)

cvs diff -r1.5 -r1.6 src/lib/libc/arch/mips/sys/__vfork14.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/__vfork14.S 2003/08/07 16:42:17 1.5
+++ src/lib/libc/arch/mips/sys/__vfork14.S 2009/12/14 01:07:42 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: __vfork14.S,v 1.5 2003/08/07 16:42:17 agc Exp $ */ 1/* $NetBSD: __vfork14.S,v 1.6 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,41 +25,39 @@ @@ -25,41 +25,39 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include "SYS.h" 35#include "SYS.h"
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)Ovfork.s 8.1 (Berkeley) 6/4/93") 38#if 0
39 ASMSTR("$NetBSD: __vfork14.S,v 1.5 2003/08/07 16:42:17 agc Exp $") 39 RCSID("from: @(#)Ovfork.s 8.1 (Berkeley) 6/4/93")
 40#else
 41 RCSID("$NetBSD: __vfork14.S,v 1.6 2009/12/14 01:07:42 matt Exp $")
 42#endif
40#endif /* LIBC_SCCS and not lint */ 43#endif /* LIBC_SCCS and not lint */
41 44
42/* 45/*
43 * pid = vfork(); 46 * pid = vfork();
44 * 47 *
45 * v1 == 0 in parent process, v1 == 1 in child process. 48 * v1 == 0 in parent process, v1 == 1 in child process.
46 * v0 == pid of child in parent, v0 == pid of parent in child. 49 * v0 == pid of child in parent, v0 == pid of parent in child.
47 */ 50 */
48 51
49LEAF(__vfork14) 52LEAF(__vfork14)
50#ifdef __ABICALLS__ 53 PIC_PROLOGUE(__vfork14)
51 .set noreorder 
52 .cpload t9 
53 .set reorder 
54#endif 
55 li v0, SYS___vfork14 # system call number for vfork 54 li v0, SYS___vfork14 # system call number for vfork
56 syscall 55 syscall
57 beq a3, zero, 1f # jump if no errors 56 beq a3, zero, 1f # jump if no errors
58 la t9, __cerror 57 PIC_TAILCALL(__cerror)
59 jr t9 
601: 581:
61 beq v1, zero, 2f # parent process ? 59 beq v1, zero, 2f # parent process ?
62 move v0, zero # return zero in child 60 move v0, zero # return zero in child
632: 612:
64 j ra 62 PIC_RETURN()
65END(__vfork14) 63END(__vfork14)

cvs diff -r1.5 -r1.6 src/lib/libc/arch/mips/sys/syscall.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/syscall.S 2003/08/07 16:42:18 1.5
+++ src/lib/libc/arch/mips/sys/syscall.S 2009/12/14 01:07:42 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: syscall.S,v 1.5 2003/08/07 16:42:18 agc Exp $ */ 1/* $NetBSD: syscall.S,v 1.6 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,18 +25,21 @@ @@ -25,18 +25,21 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include "SYS.h" 35#include "SYS.h"
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)syscall.s 8.1 (Berkeley) 6/4/93") 38#if 0
39 ASMSTR("$NetBSD: syscall.S,v 1.5 2003/08/07 16:42:18 agc Exp $") 39 RCSID("from: @(#)syscall.s 8.1 (Berkeley) 6/4/93")
 40#else
 41 RCSID("$NetBSD: syscall.S,v 1.6 2009/12/14 01:07:42 matt Exp $")
 42#endif
40#endif /* LIBC_SCCS and not lint */ 43#endif /* LIBC_SCCS and not lint */
41 44
42RSYSCALL(syscall) 45RSYSCALL(syscall)

cvs diff -r1.16 -r1.17 src/lib/libc/arch/mips/sys/brk.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/brk.S 2003/08/07 16:42:17 1.16
+++ src/lib/libc/arch/mips/sys/brk.S 2009/12/14 01:07:42 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: brk.S,v 1.16 2003/08/07 16:42:17 agc Exp $ */ 1/* $NetBSD: brk.S,v 1.17 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,50 +25,49 @@ @@ -25,50 +25,49 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include "SYS.h" 35#include "SYS.h"
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)brk.s 8.1 (Berkeley) 6/4/93") 38#if 0
39 ASMSTR("$NetBSD: brk.S,v 1.16 2003/08/07 16:42:17 agc Exp $") 39 RCSID("from: @(#)brk.s 8.1 (Berkeley) 6/4/93")
 40#else
 41 RCSID("$NetBSD: brk.S,v 1.17 2009/12/14 01:07:42 matt Exp $")
 42#endif
40#endif /* LIBC_SCCS and not lint */ 43#endif /* LIBC_SCCS and not lint */
41 44
42 .globl _C_LABEL(__minbrk) 45 .globl _C_LABEL(__minbrk)
43 .globl _C_LABEL(__curbrk) 46 .globl _C_LABEL(__curbrk)
44 .globl _C_LABEL(_end) 47 .globl _C_LABEL(_end)
45 48
46#ifdef WEAK_ALIAS 49#ifdef WEAK_ALIAS
47WEAK_ALIAS(brk, _brk) 50WEAK_ALIAS(brk, _brk)
48#endif 51#endif
49 52
50 .data 53 .data
51_C_LABEL(__minbrk): 54_C_LABEL(__minbrk):
52 .word _C_LABEL(_end) 55 PTR_WORD _C_LABEL(_end)
53 .text 56 .text
54 57
55LEAF(_brk) 58LEAF(_brk)
56#ifdef __ABICALLS__ 59 PIC_PROLOGUE(_brk)
57 .set noreorder 60 PTR_LA t0, _C_LABEL(__minbrk)
58 .cpload t9 61 PTR_L v0, 0(t0)
59 .set reorder 62 bgeu a0, v0, 1f
60#endif 63 move a0, v0 # dont allow break < minbrk
61 lw v0, _C_LABEL(__minbrk) 
62 bgeu a0, v0, 1f 
63 move a0, v0 # dont allow break < minbrk 
641: 641:
65 li v0, SYS_break 65 li v0, SYS_break
66 syscall 66 syscall
67 bne a3, zero, 2f 67 bne a3, zero, 2f
68 sw a0, _C_LABEL(__curbrk) 68 PTR_S a0, 0(t0)
69 move v0, zero 69 move v0, zero
70 j ra 70 PIC_RETURN()
712: 712:
72 la t9, _C_LABEL(__cerror) 72 PIC_TAILCALL(__cerror)
73 jr t9 
74END(_brk) 73END(_brk)

cvs diff -r1.16 -r1.17 src/lib/libc/arch/mips/sys/sbrk.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/sbrk.S 2005/04/22 06:58:01 1.16
+++ src/lib/libc/arch/mips/sys/sbrk.S 2009/12/14 01:07:42 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sbrk.S,v 1.16 2005/04/22 06:58:01 simonb Exp $ */ 1/* $NetBSD: sbrk.S,v 1.17 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,47 +25,45 @@ @@ -25,47 +25,45 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include "SYS.h" 35#include "SYS.h"
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)sbrk.s 8.1 (Berkeley) 6/4/93") 38#if 0
39 ASMSTR("$NetBSD: sbrk.S,v 1.16 2005/04/22 06:58:01 simonb Exp $") 39 RCSID("from: @(#)sbrk.s 8.1 (Berkeley) 6/4/93")
 40#else
 41 RCSID("$NetBSD: sbrk.S,v 1.17 2009/12/14 01:07:42 matt Exp $")
 42#endif
40#endif /* LIBC_SCCS and not lint */ 43#endif /* LIBC_SCCS and not lint */
41 44
42 .globl _C_LABEL(__curbrk) 45 .globl _C_LABEL(__curbrk)
43 .globl _C_LABEL(_end) 46 .globl _C_LABEL(_end)
44 47
45#ifdef WEAK_ALIAS 48#ifdef WEAK_ALIAS
46WEAK_ALIAS(sbrk, _sbrk) 49WEAK_ALIAS(sbrk, _sbrk)
47#endif 50#endif
48 51
49 .data 52 .data
50_C_LABEL(__curbrk): 53_C_LABEL(__curbrk):
51 .word _C_LABEL(_end) 54 PTR_WORD _C_LABEL(_end)
52 .text 55 .text
53 56
54LEAF(_sbrk) 57LEAF(_sbrk)
55#ifdef __ABICALLS__ 58 PIC_PROLOGUE(_sbrk)
56 .set noreorder 59 PTR_LA t0, _C_LABEL(__curbrk)
57 .cpload t9 60 PTR_L v1, 0(t0)
58 .set reorder 61 PTR_ADDU a0, a0, v1 # compute current break
59#endif 62 SYSTRAP(break)
60 lw v1, _C_LABEL(__curbrk) 63 bne a3, zero, 1f
61 li v0, SYS_break 64 move v0, v1 # return old val of curbrk from above
62 addu a0, a0, v1 # compute current break 65 PTR_S a0, 0(t0) # save current val of curbrk from above
63 syscall 66 PIC_RETURN()
64 bne a3, zero, 1f 
65 move v0, v1 # return old val of curbrk from above 
66 sw a0, _C_LABEL(__curbrk) # save current val of curbrk from above 
67 j ra 
681: 671:
69 la t9, _C_LABEL(__cerror) 68 PIC_TAILCALL(__cerror)
70 jr t9 
71END(_sbrk) 69END(_sbrk)

cvs diff -r1.13 -r1.14 src/lib/libc/arch/mips/sys/cerror.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/cerror.S 2003/08/07 16:42:17 1.13
+++ src/lib/libc/arch/mips/sys/cerror.S 2009/12/14 01:07:42 1.14
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cerror.S,v 1.13 2003/08/07 16:42:17 agc Exp $ */ 1/* $NetBSD: cerror.S,v 1.14 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,50 +25,52 @@ @@ -25,50 +25,52 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include "SYS.h" 35#include "SYS.h"
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)cerror.s 8.1 (Berkeley) 6/16/93") 38#if 0
39 ASMSTR("$NetBSD: cerror.S,v 1.13 2003/08/07 16:42:17 agc Exp $") 39 RCSID("from: @(#)cerror.s 8.1 (Berkeley) 6/16/93")
 40#else
 41 RCSID("$NetBSD: cerror.S,v 1.14 2009/12/14 01:07:42 matt Exp $")
 42#endif
40#endif /* LIBC_SCCS and not lint */ 43#endif /* LIBC_SCCS and not lint */
41 44
42#ifdef _REENTRANT 45#ifdef _REENTRANT
43 .globl _C_LABEL(__errno) 46 .globl _C_LABEL(__errno)
44NESTED_NOPROFILE(__cerror, CALLFRAME_SIZ, ra) 47NESTED_NOPROFILE(__cerror, CALLFRAME_SIZ, ra)
45 PIC_PROLOGUE(__cerror, t9) 
46 subu sp, sp, CALLFRAME_SIZ 
47 .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) 48 .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
48 sw ra, CALLFRAME_RA(sp) 49 PIC_PROLOGUE(__cerror)
49 sw v0, 12(sp) # save errno value 50 PTR_SUBU sp, sp, CALLFRAME_SIZ
50 51 PTR_S ra, CALLFRAME_RA(sp)
51 la t9, _C_LABEL(__errno) # locate address of errno 52 INT_S v0, CALLFRAME_S0(sp) # save errno value
52 jalr t9 53
53 54 SAVE_GP(CALLFRAME_GP)
54 lw t0, 12(sp) 55
55 lw ra, CALLFRAME_RA(sp) 56 PTR_LA t9, _C_LABEL(__errno) # locate address of errno
56 sw t0, 0(v0) # update errno value 57 jalr t9
57 addiu sp, sp, CALLFRAME_SIZ 58
58 li v0, -1 59 INT_L t0, CALLFRAME_S0(sp)
59 li v1, -1 60 PTR_L ra, CALLFRAME_RA(sp)
60 j ra 61 INT_S t0, 0(v0) # update errno value
 62 PTR_ADDU sp, sp, CALLFRAME_SIZ
 63 li v0, -1
 64 li v1, -1
 65 PIC_RETURN()
61END(__cerror) 66END(__cerror)
62#else  67#else
63 .globl _C_LABEL(errno) 68 .globl _C_LABEL(errno)
64LEAF_NOPROFILE(__cerror) 69LEAF_NOPROFILE(__cerror)
65 .set noreorder 70 PIC_PROLOGUE(__cerror)
66#ifdef __ABICALLS__ 71 INT_S v0, _C_LABEL(errno)
67 .cpload t9 72 li v0, -1
68#endif 73 li v1, -1
69 sw v0, _C_LABEL(errno) 74 PIC_RETURN()
70 li v0, -1 
71 j ra 
72 li v1, -1 
73END(__cerror) 75END(__cerror)
74#endif /* _REENTRANT */ 76#endif /* _REENTRANT */

cvs diff -r1.9 -r1.10 src/lib/libc/arch/mips/sys/Attic/exect.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/Attic/exect.S 2003/08/07 16:42:17 1.9
+++ src/lib/libc/arch/mips/sys/Attic/exect.S 2009/12/14 01:07:42 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: exect.S,v 1.9 2003/08/07 16:42:17 agc Exp $ */ 1/* $NetBSD: exect.S,v 1.10 2009/12/14 01:07:42 matt Exp $ */
2/*- 2/*-
3 * Copyright (c) 1991, 1993 3 * Copyright (c) 1991, 1993
4 * The Regents of the University of California. All rights reserved. 4 * The Regents of the University of California. All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to Berkeley by 6 * This code is derived from software contributed to Berkeley by
7 * Ralph Campbell. 7 * Ralph Campbell.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -24,31 +24,29 @@ @@ -24,31 +24,29 @@
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE. 31 * SUCH DAMAGE.
32 */ 32 */
33 33
34#include "SYS.h" 34#include "SYS.h"
35 35
36#if defined(LIBC_SCCS) && !defined(lint) 36#if defined(LIBC_SCCS) && !defined(lint)
37 ASMSTR("from: @(#)exect.s 8.1 (Berkeley) 6/4/93") 37#if 0
38 ASMSTR("$NetBSD: exect.S,v 1.9 2003/08/07 16:42:17 agc Exp $") 38 RCSID("from: @(#)exect.s 8.1 (Berkeley) 6/4/93")
 39#else
 40 RCSID("$NetBSD: exect.S,v 1.10 2009/12/14 01:07:42 matt Exp $")
 41#endif
39#endif /* LIBC_SCCS and not lint */ 42#endif /* LIBC_SCCS and not lint */
40 43
41LEAF(exect) 44LEAF(exect)
42#ifdef __ABICALLS__ 45 PIC_PROLOGUE(exect)
43 .set noreorder 
44 .cpload t9 
45 .set reorder 
46#endif 
47 li v0, SYS_execve 46 li v0, SYS_execve
48 syscall 47 syscall
49 bne a3, zero, 1f 48 bne a3, zero, 1f
50 j ra 49 PIC_RETURN()
511: 501:
52 la t9, _C_LABEL(__cerror) 51 PIC_TAILCALL(__cerror)
53 jr t9 
54END(exect) 52END(exect)

cvs diff -r1.9 -r1.10 src/lib/libc/arch/mips/sys/ptrace.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/ptrace.S 2003/08/07 16:42:17 1.9
+++ src/lib/libc/arch/mips/sys/ptrace.S 2009/12/14 01:07:42 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ptrace.S,v 1.9 2003/08/07 16:42:17 agc Exp $ */ 1/* $NetBSD: ptrace.S,v 1.10 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,32 +25,30 @@ @@ -25,32 +25,30 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include "SYS.h" 35#include "SYS.h"
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)ptrace.s 8.1 (Berkeley) 6/4/93") 38#if 0
39 ASMSTR("$NetBSD: ptrace.S,v 1.9 2003/08/07 16:42:17 agc Exp $") 39 RCSID("from: @(#)ptrace.s 8.1 (Berkeley) 6/4/93")
 40#else
 41 RCSID("$NetBSD: ptrace.S,v 1.10 2009/12/14 01:07:42 matt Exp $")
 42#endif
40#endif /* LIBC_SCCS and not lint */ 43#endif /* LIBC_SCCS and not lint */
41 44
42LEAF(ptrace) 45LEAF(ptrace)
43#ifdef __ABICALLS__ 46 PIC_PROLOGUE(ptrace)
44 .set noreorder 47 INT_S zero, _C_LABEL(errno) /* BOGUS */
45 .cpload t9 48
46 .set reorder 49 SYSTRAP(ptrace)
47#endif 
48 sw zero, _C_LABEL(errno) 
49 li v0, SYS_ptrace 
50 syscall 
51 bne a3, zero, 1f 50 bne a3, zero, 1f
52 j ra 51 PIC_RETURN()
531: 521:
54 la t9, _C_LABEL(__cerror) 53 PIC_TAILCALL(__cerror)
55 jr t9 
56END(ptrace) 54END(ptrace)

cvs diff -r1.11 -r1.12 src/lib/libc/arch/mips/sys/fork.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/fork.S 2003/08/07 16:42:17 1.11
+++ src/lib/libc/arch/mips/sys/fork.S 2009/12/14 01:07:42 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fork.S,v 1.11 2003/08/07 16:42:17 agc Exp $ */ 1/* $NetBSD: fork.S,v 1.12 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,34 +25,32 @@ @@ -25,34 +25,32 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include "SYS.h" 35#include "SYS.h"
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)fork.s 8.1 (Berkeley) 6/4/93") 38#if 0
39 ASMSTR("$NetBSD: fork.S,v 1.11 2003/08/07 16:42:17 agc Exp $") 39 RCSID("from: @(#)fork.s 8.1 (Berkeley) 6/4/93")
 40#else
 41 RCSID("$NetBSD: fork.S,v 1.12 2009/12/14 01:07:42 matt Exp $")
 42#endif
40#endif /* LIBC_SCCS and not lint */ 43#endif /* LIBC_SCCS and not lint */
41 44
42LEAF(__fork) 45LEAF(__fork)
43#ifdef __ABICALLS__ 46 PIC_PROLOGUE(__fork)
44 .set noreorder 47
45 .cpload t9 48 SYSTRAP(fork) # pid = fork()
46 .set reorder 
47#endif 
48 li v0, SYS_fork # pid = fork() 
49 syscall 
50 bne a3, zero, 2f 49 bne a3, zero, 2f
51 beq v1, zero, 1f # v1 == 0 in parent, 1 in child 50 beq v1, zero, 1f # v1 == 0 in parent, 1 in child
52 move v0, zero 51 move v0, zero
531: 521:
54 j ra 53 PIC_RETURN()
552: 542:
56 la t9, _C_LABEL(__cerror) 55 PIC_TAILCALL(__cerror)
57 jr t9 
58END(__fork) 56END(__fork)

cvs diff -r1.11 -r1.12 src/lib/libc/arch/mips/sys/pipe.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/pipe.S 2005/04/22 06:58:01 1.11
+++ src/lib/libc/arch/mips/sys/pipe.S 2009/12/14 01:07:42 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pipe.S,v 1.11 2005/04/22 06:58:01 simonb Exp $ */ 1/* $NetBSD: pipe.S,v 1.12 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,38 +25,37 @@ @@ -25,38 +25,37 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include "SYS.h" 35#include "SYS.h"
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38 ASMSTR("from: @(#)pipe.s 8.1 (Berkeley) 6/4/93") 38#if 0
39 ASMSTR("$NetBSD: pipe.S,v 1.11 2005/04/22 06:58:01 simonb Exp $") 39 RCSID("from: @(#)pipe.s 8.1 (Berkeley) 6/4/93")
 40#else
 41 RCSID("$NetBSD: pipe.S,v 1.12 2009/12/14 01:07:42 matt Exp $")
 42#endif
40#endif /* LIBC_SCCS and not lint */ 43#endif /* LIBC_SCCS and not lint */
41 44
42#ifdef WEAK_ALIAS 45#ifdef WEAK_ALIAS
43WEAK_ALIAS(pipe, _pipe) 46WEAK_ALIAS(pipe, _pipe)
44#endif 47#endif
45 48
46LEAF(_pipe) 49LEAF(_pipe)
47#ifdef __ABICALLS__ 50 PIC_PROLOGUE(_pipe);
48 .set noreorder 51
49 .cpload t9 52 SYSTRAP(pipe) # pipe(fildes) int fildes[2];
50 .set reorder 53
51#endif 
52 li v0, SYS_pipe # pipe(fildes) int fildes[2]; 
53 syscall 
54 bne a3, zero, 1f 54 bne a3, zero, 1f
55 sw v0, 0(a0) # store the two file descriptors 55 INT_S v0, 0(a0) # store the two file descriptors
56 sw v1, 4(a0) 56 INT_S v1, 4(a0)
57 move v0, zero 57 move v0, zero
58 j ra 58 PIC_RETURN()
591: 591:
60 la t9, _C_LABEL(__cerror) 60 PIC_TAILCALL(__cerror)
61 jr t9 
62END(_pipe) 61END(_pipe)

cvs diff -r1.3 -r1.4 src/lib/libc/arch/mips/sys/getcontext.S (expand / switch to unified diff)

--- src/lib/libc/arch/mips/sys/getcontext.S 2008/04/28 20:22:56 1.3
+++ src/lib/libc/arch/mips/sys/getcontext.S 2009/12/14 01:07:42 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: getcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $ */ 1/* $NetBSD: getcontext.S,v 1.4 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Klaus Klein. 8 * by Klaus Klein.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,35 +20,37 @@ @@ -20,35 +20,37 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include "SYS.h" 32#include "SYS.h"
 33#include "assym.h"
33#include <machine/mcontext.h> 34#include <machine/mcontext.h>
34 35
35#if defined(SYSLIBC_SCCS) && !defined(lint) 36#if defined(SYSLIBC_SCCS) && !defined(lint)
36 ASMSTR("$NetBSD: getcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $") 37 RCSID("$NetBSD: getcontext.S,v 1.4 2009/12/14 01:07:42 matt Exp $")
37#endif /* SYSLIBC_SCCS && !lint */ 38#endif /* SYSLIBC_SCCS && !lint */
38 39
39#ifdef WEAK_ALIAS 40#ifdef WEAK_ALIAS
40WEAK_ALIAS(getcontext, _getcontext) 41WEAK_ALIAS(getcontext, _getcontext)
41#endif 42#endif
42 .set reorder 43 .set reorder
43 44
44LEAF(_getcontext) 45LEAF(_getcontext)
 46 PIC_PROLOGUE(_getcontext)
45 SYSTRAP(getcontext) 47 SYSTRAP(getcontext)
46 bne a3, zero, 1f 48 bne a3, zero, 1f
47 REG_PROLOGUE 49 REG_PROLOGUE
48 REG_S zero, (_OFFSETOF_UC_GREGS + _REG_V0 * SZREG)(a0) 50 REG_S zero, (_OFFSETOF_UC_GREGS + _REG_V0 * SZREG)(a0)
49 REG_S ra, (_OFFSETOF_UC_GREGS + _REG_EPC * SZREG)(a0) 51 REG_S ra, (_OFFSETOF_UC_GREGS + _REG_EPC * SZREG)(a0)
50 REG_EPILOGUE 52 REG_EPILOGUE
51 j ra 53 PIC_RETURN()
521: 541:
53 PIC_CALL(__cerror, t9) 55 PIC_TAILCALL(__cerror)
54END(_getcontext) 56END(_getcontext)

cvs diff -r1.2 -r1.3 src/lib/libc/compat/arch/mips/sys/compat___semctl.S (expand / switch to unified diff)

--- src/lib/libc/compat/arch/mips/sys/compat___semctl.S 2008/04/28 20:22:58 1.2
+++ src/lib/libc/compat/arch/mips/sys/compat___semctl.S 2009/12/14 01:07:42 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: compat___semctl.S,v 1.2 2008/04/28 20:22:58 martin Exp $ */ 1/* $NetBSD: compat___semctl.S,v 1.3 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -22,14 +22,18 @@ @@ -22,14 +22,18 @@
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include "SYS.h" 33#include "SYS.h"
34 34
 35#if defined(LIBC_SCCS) && !defined(lint)
 36 RCSID("$NetBSD: compat___semctl.S,v 1.3 2009/12/14 01:07:42 matt Exp $")
 37#endif /* LIBC_SCCS and not lint */
 38
35PSEUDO(__semctl,compat_14___semctl) 39PSEUDO(__semctl,compat_14___semctl)

cvs diff -r1.2 -r1.3 src/lib/libc/compat/arch/mips/sys/compat___sigtramp1.S (expand / switch to unified diff)

--- src/lib/libc/compat/arch/mips/sys/compat___sigtramp1.S 2008/04/28 20:22:58 1.2
+++ src/lib/libc/compat/arch/mips/sys/compat___sigtramp1.S 2009/12/14 01:07:42 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: compat___sigtramp1.S,v 1.2 2008/04/28 20:22:58 martin Exp $ */ 1/* $NetBSD: compat___sigtramp1.S,v 1.3 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -21,26 +21,30 @@ @@ -21,26 +21,30 @@
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include "SYS.h" 32#include "SYS.h"
33 33
 34#if defined(LIBC_SCCS) && !defined(lint)
 35 RCSID("$NetBSD: compat___sigtramp1.S,v 1.3 2009/12/14 01:07:42 matt Exp $")
 36#endif /* LIBC_SCCS and not lint */
 37
34/* 38/*
35 * The MIPS signal trampoline is invoked only to return from 39 * The MIPS signal trampoline is invoked only to return from
36 * the signal; the kernel calls the signal handler directly. 40 * the signal; the kernel calls the signal handler directly.
37 * 41 *
38 * On entry, stack looks like: 42 * On entry, stack looks like:
39 * 43 *
40 * sp-> sigcontext structure 44 * sp-> sigcontext structure
41 */ 45 */
42LEAF_NOPROFILE(__sigtramp_sigcontext_1) 46LEAF_NOPROFILE(__sigtramp_sigcontext_1)
43 move a0, sp /* address of sigcontext */ 47 move a0, sp /* address of sigcontext */
44 SYSTRAP(compat_16___sigreturn14) /* and do sigreturn */ 48 SYSTRAP(compat_16___sigreturn14) /* and do sigreturn */
45 move a0, v0 /* exit with errno */ 49 move a0, v0 /* exit with errno */
46 SYSTRAP(exit) /* if sigreturn fails */ 50 SYSTRAP(exit) /* if sigreturn fails */

cvs diff -r1.2 -r1.3 src/lib/libc/compat/arch/mips/sys/compat_msgctl.S (expand / switch to unified diff)

--- src/lib/libc/compat/arch/mips/sys/compat_msgctl.S 2008/04/28 20:22:58 1.2
+++ src/lib/libc/compat/arch/mips/sys/compat_msgctl.S 2009/12/14 01:07:42 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: compat_msgctl.S,v 1.2 2008/04/28 20:22:58 martin Exp $ */ 1/* $NetBSD: compat_msgctl.S,v 1.3 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -22,17 +22,21 @@ @@ -22,17 +22,21 @@
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include "SYS.h" 33#include "SYS.h"
34 34
 35#if defined(LIBC_SCCS) && !defined(lint)
 36 RCSID("$NetBSD: compat_msgctl.S,v 1.3 2009/12/14 01:07:42 matt Exp $")
 37#endif /* LIBC_SCCS and not lint */
 38
35WARN_REFERENCES(msgctl, \ 39WARN_REFERENCES(msgctl, \
36 "warning: reference to compatibility msgctl(); include <sys/msg.h> for correct reference") 40 "warning: reference to compatibility msgctl(); include <sys/msg.h> for correct reference")
37 41
38PSEUDO(msgctl,compat_14_msgctl) 42PSEUDO(msgctl,compat_14_msgctl)

cvs diff -r1.2 -r1.3 src/lib/libc/compat/arch/mips/sys/compat_shmctl.S (expand / switch to unified diff)

--- src/lib/libc/compat/arch/mips/sys/compat_shmctl.S 2008/04/28 20:22:58 1.2
+++ src/lib/libc/compat/arch/mips/sys/compat_shmctl.S 2009/12/14 01:07:42 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: compat_shmctl.S,v 1.2 2008/04/28 20:22:58 martin Exp $ */ 1/* $NetBSD: compat_shmctl.S,v 1.3 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -22,17 +22,21 @@ @@ -22,17 +22,21 @@
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include "SYS.h" 33#include "SYS.h"
34 34
 35#if defined(LIBC_SCCS) && !defined(lint)
 36 RCSID("$NetBSD: compat_shmctl.S,v 1.3 2009/12/14 01:07:42 matt Exp $")
 37#endif /* LIBC_SCCS and not lint */
 38
35WARN_REFERENCES(shmctl, \ 39WARN_REFERENCES(shmctl, \
36 "warning: reference to compatibility shmctl(); include <sys/shm.h> for correct reference") 40 "warning: reference to compatibility shmctl(); include <sys/shm.h> for correct reference")
37 41
38PSEUDO(shmctl,compat_14_shmctl) 42PSEUDO(shmctl,compat_14_shmctl)

cvs diff -r1.2 -r1.3 src/lib/libc/compat/arch/mips/sys/compat_sigaction.S (expand / switch to unified diff)

--- src/lib/libc/compat/arch/mips/sys/compat_sigaction.S 2008/04/28 20:22:58 1.2
+++ src/lib/libc/compat/arch/mips/sys/compat_sigaction.S 2009/12/14 01:07:42 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: compat_sigaction.S,v 1.2 2008/04/28 20:22:58 martin Exp $ */ 1/* $NetBSD: compat_sigaction.S,v 1.3 2009/12/14 01:07:42 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -22,17 +22,21 @@ @@ -22,17 +22,21 @@
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include "SYS.h" 33#include "SYS.h"
34 34
 35#if defined(LIBC_SCCS) && !defined(lint)
 36 RCSID("$NetBSD: compat_sigaction.S,v 1.3 2009/12/14 01:07:42 matt Exp $")
 37#endif /* LIBC_SCCS and not lint */
 38
35WARN_REFERENCES(sigaction, \ 39WARN_REFERENCES(sigaction, \
36 "warning: reference to compatibility sigaction(); include <signal.h> for correct reference") 40 "warning: reference to compatibility sigaction(); include <signal.h> for correct reference")
37 41
38PSEUDO(sigaction,compat_13_sigaction13) 42PSEUDO(sigaction,compat_13_sigaction13)

cvs diff -r1.7 -r1.8 src/lib/libc/softfloat/softfloat-for-gcc.h (expand / switch to unified diff)

--- src/lib/libc/softfloat/softfloat-for-gcc.h 2004/09/26 21:13:27 1.7
+++ src/lib/libc/softfloat/softfloat-for-gcc.h 2009/12/14 01:07:42 1.8
@@ -1,58 +1,169 @@ @@ -1,58 +1,169 @@
1/* $NetBSD: softfloat-for-gcc.h,v 1.7 2004/09/26 21:13:27 jmmv Exp $ */ 1/* $NetBSD: softfloat-for-gcc.h,v 1.8 2009/12/14 01:07:42 matt Exp $ */
2 2
3/* 3/*
4 * Move private identifiers with external linkage into implementation 4 * Move private identifiers with external linkage into implementation
5 * namespace. -- Klaus Klein <kleink@NetBSD.org>, May 5, 1999 5 * namespace. -- Klaus Klein <kleink@NetBSD.org>, May 5, 1999
6 */ 6 */
7#define float_exception_flags _softfloat_float_exception_flags 7#define float_exception_flags _softfloat_float_exception_flags
8#define float_exception_mask _softfloat_float_exception_mask 8#define float_exception_mask _softfloat_float_exception_mask
9#define float_rounding_mode _softfloat_float_rounding_mode 9#define float_rounding_mode _softfloat_float_rounding_mode
10#define float_raise _softfloat_float_raise 10#define float_raise _softfloat_float_raise
 11
11/* The following batch are called by GCC through wrappers */ 12/* The following batch are called by GCC through wrappers */
12#define float32_eq _softfloat_float32_eq 13#define float32_eq _softfloat_float32_eq
13#define float32_le _softfloat_float32_le 14#define float32_le _softfloat_float32_le
14#define float32_lt _softfloat_float32_lt 15#define float32_lt _softfloat_float32_lt
15#define float64_eq _softfloat_float64_eq 16#define float64_eq _softfloat_float64_eq
16#define float64_le _softfloat_float64_le 17#define float64_le _softfloat_float64_le
17#define float64_lt _softfloat_float64_lt 18#define float64_lt _softfloat_float64_lt
 19#define float128_eq _softfloat_float128_eq
 20#define float128_le _softfloat_float128_le
 21#define float128_lt _softfloat_float128_lt
18 22
19/* 23/*
20 * Macros to define functions with the GCC expected names 24 * Macros to define functions with the GCC expected names
21 */ 25 */
22 26
23#define float32_add __addsf3 27#define float32_add __addsf3
24#define float64_add __adddf3 28#define float64_add __adddf3
25#define floatx80_add __addxf3 29#define floatx80_add __addxf3
 30#define float128_add __addtf3
 31
26#define float32_sub __subsf3 32#define float32_sub __subsf3
27#define float64_sub __subdf3 33#define float64_sub __subdf3
28#define floatx80_sub __subxf3 34#define floatx80_sub __subxf3
 35#define float128_sub __subtf3
 36
29#define float32_mul __mulsf3 37#define float32_mul __mulsf3
30#define float64_mul __muldf3 38#define float64_mul __muldf3
31#define floatx80_mul __mulxf3 39#define floatx80_mul __mulxf3
 40#define float128_mul __multf3
 41
32#define float32_div __divsf3 42#define float32_div __divsf3
33#define float64_div __divdf3 43#define float64_div __divdf3
34#define floatx80_div __divxf3 44#define floatx80_div __divxf3
 45#define float128_div __divtf3
 46
 47#if 0
 48#define float32_neg __negsf2
 49#define float64_neg __negdf2
 50#define floatx80_neg __negxf2
 51#define float128_neg __negtf2
 52#endif
 53
35#define int32_to_float32 __floatsisf 54#define int32_to_float32 __floatsisf
36#define int32_to_float64 __floatsidf 55#define int32_to_float64 __floatsidf
37#define int32_to_floatx80 __floatsixf 56#define int32_to_floatx80 __floatsixf
 57#define int32_to_float128 __floatsitf
 58
38#define int64_to_float32 __floatdisf 59#define int64_to_float32 __floatdisf
39#define int64_to_float64 __floatdidf 60#define int64_to_float64 __floatdidf
40#define int64_to_floatx80 __floatdixf 61#define int64_to_floatx80 __floatdixf
 62#define int64_to_float128 __floatditf
 63
 64#define int128_to_float32 __floattisf
 65#define int128_to_float64 __floattidf
 66#define int128_to_floatx80 __floattixf
 67#define int128_to_float128 __floattitf
 68
 69#define uint32_to_float32 __floatunsisf
 70#define uint32_to_float64 __floatunsidf
 71#define uint32_to_floatx80 __floatunsixf
 72#define uint32_to_float128 __floatunsitf
 73
 74#define uint64_to_float32 __floatundisf
 75#define uint64_to_float64 __floatundidf
 76#define uint64_to_floatx80 __floatundixf
 77#define uint64_to_float128 __floatunditf
 78
 79#define uint128_to_float32 __floatuntisf
 80#define uint128_to_float64 __floatuntidf
 81#define uint128_to_floatx80 __floatuntixf
 82#define uint128_to_float128 __floatuntitf
 83
41#define float32_to_int32_round_to_zero __fixsfsi 84#define float32_to_int32_round_to_zero __fixsfsi
42#define float64_to_int32_round_to_zero __fixdfsi 85#define float64_to_int32_round_to_zero __fixdfsi
43#define floatx80_to_int32_round_to_zero __fixxfsi 86#define floatx80_to_int32_round_to_zero __fixxfsi
 87#define float128_to_int32_round_to_zero __fixtfsi
 88
44#define float32_to_int64_round_to_zero __fixsfdi 89#define float32_to_int64_round_to_zero __fixsfdi
45#define float64_to_int64_round_to_zero __fixdfdi 90#define float64_to_int64_round_to_zero __fixdfdi
46#define floatx80_to_int64_round_to_zero __fixxfdi 91#define floatx80_to_int64_round_to_zero __fixxfdi
 92#define float128_to_int64_round_to_zero __fixtfdi
 93
 94#define float32_to_int128_round_to_zero __fixsfti
 95#define float64_to_int128_round_to_zero __fixdfti
 96#define floatx80_to_int128_round_to_zero __fixxfti
 97#define float128_to_int128_round_to_zero __fixtfti
 98
47#define float32_to_uint32_round_to_zero __fixunssfsi 99#define float32_to_uint32_round_to_zero __fixunssfsi
48#define float64_to_uint32_round_to_zero __fixunsdfsi 100#define float64_to_uint32_round_to_zero __fixunsdfsi
 101#define floatx80_to_uint32_round_to_zero __fixunsxfsi
 102#define float128_to_uint32_round_to_zero __fixunstfsi
 103
 104#define float32_to_uint64_round_to_zero __fixunssfdi
 105#define float64_to_uint64_round_to_zero __fixunsdfdi
 106#define floatx80_to_uint64_round_to_zero __fixunsxfdi
 107#define float128_to_uint64_round_to_zero __fixunstfdi
 108
 109#define float32_to_uint128_round_to_zero __fixunssfti
 110#define float64_to_uint128_round_to_zero __fixunsdfti
 111#define floatx80_to_uint128_round_to_zero __fixunsxfti
 112#define float128_to_uint128_round_to_zero __fixunstfti
 113
49#define float32_to_float64 __extendsfdf2 114#define float32_to_float64 __extendsfdf2
50#define float64_to_floatx80 __extenddfxf2 
51#define float32_to_floatx80 __extendsfxf2 115#define float32_to_floatx80 __extendsfxf2
52#define float64_to_float32 __truncdfsf2 116#define float32_to_float128 __extendsftf2
 117#define float64_to_floatx80 __extenddfxf2
 118#define float64_to_float128 __extenddftf2
 119
 120#define float128_to_float64 __trunctfdf2
53#define floatx80_to_float64 __truncxfdf2 121#define floatx80_to_float64 __truncxfdf2
 122#define float128_to_float32 __trunctfsf2
54#define floatx80_to_float32 __truncxfsf2 123#define floatx80_to_float32 __truncxfsf2
 124#define float64_to_float32 __truncdfsf2
55 125
56#define floatx80_lt __ltxf2 126#if 0
 127#define float32_cmp __cmpsf2
 128#define float32_unord __unordsf2
 129#define float32_eq __eqsf2
 130#define float32_ne __nesf2
 131#define float32_ge __gesf2
 132#define float32_lt __ltsf2
 133#define float32_le __lesf2
 134#define float32_gt __gtsf2
 135#endif
 136
 137#if 0
 138#define float64_cmp __cmpdf2
 139#define float64_unord __unorddf2
 140#define float64_eq __eqdf2
 141#define float64_ne __nedf2
 142#define float64_ge __gedf2
 143#define float64_lt __ltdf2
 144#define float64_le __ledf2
 145#define float64_gt __gtdf2
 146#endif
 147
 148/* XXX not in libgcc */
 149#if 1
 150#define floatx80_cmp __cmpxf2
 151#define floatx80_unord __unordxf2
57#define floatx80_eq __eqxf2 152#define floatx80_eq __eqxf2
 153#define floatx80_ne __nexf2
 154#define floatx80_ge __gexf2
 155#define floatx80_lt __ltxf2
58#define floatx80_le __lexf2 156#define floatx80_le __lexf2
 157#define floatx80_gt __gtxf2
 158#endif
 159
 160#if 0
 161#define float128_cmp __cmptf2
 162#define float128_unord __unordtf2
 163#define float128_eq __eqtf2
 164#define float128_ne __netf2
 165#define float128_ge __getf2
 166#define float128_lt __lttf2
 167#define float128_le __letf2
 168#define float128_gt __gttf2
 169#endif