diff --git a/sys/arch/mips/conf/files.mips b/sys/arch/mips/conf/files.mips index 8795c1aba135..9234b8fdaf65 100644 --- a/sys/arch/mips/conf/files.mips +++ b/sys/arch/mips/conf/files.mips @@ -1,4 +1,4 @@ -# $NetBSD: files.mips,v 1.53 2005/12/11 12:18:09 christos Exp $ +# $NetBSD: files.mips,v 1.54 2006/03/25 00:08:11 tsutsui Exp $ # defflag opt_cputype.h NOFPU @@ -55,7 +55,7 @@ file arch/mips/mips/cache_mipsNN.c mips32 | mips64 file arch/mips/mips/in_cksum.c inet file netns/ns_cksum.c ns -file arch/mips/mips/mips_fputrap.c !softfloat & !nofpu +file arch/mips/mips/mips_fputrap.c softfloat | !nofpu file arch/mips/mips/mips_emul.c file arch/mips/mips/fp.S softfloat | !nofpu diff --git a/sys/arch/mips/mips/fp.S b/sys/arch/mips/mips/fp.S index e6f0b56d3b11..0cc99ea0d4b5 100644 --- a/sys/arch/mips/mips/fp.S +++ b/sys/arch/mips/mips/fp.S @@ -1,4 +1,4 @@ -/* $NetBSD: fp.S,v 1.30 2006/03/23 16:16:46 tsutsui Exp $ */ +/* $NetBSD: fp.S,v 1.31 2006/03/25 00:08:11 tsutsui Exp $ */ /* * Copyright (c) 1992, 1993 @@ -4967,7 +4967,7 @@ STATIC_XLEAF(bcemul_sigill) move a2, a0 # code = instruction lw a0, _C_LABEL(curlwp) # get current process li a1, SIGILL - j _C_LABEL(trapsignal) + j _C_LABEL(fpemul_trapsignal) END(fpemul_sigill) STATIC_LEAF(fpemul_sigfpe) @@ -4981,7 +4981,7 @@ STATIC_LEAF(fpemul_sigfpe) move a2, a0 # code = instruction lw a0, _C_LABEL(curlwp) # get current process li a1, SIGFPE - j _C_LABEL(trapsignal) + j _C_LABEL(fpemul_trapsignal) END(fpemul_sigfpe) #ifdef SOFTFLOAT @@ -4996,6 +4996,6 @@ STATIC_LEAF(bcemul_sigfpe) move a2, a0 # code = instruction lw a0, _C_LABEL(curlwp) # get current process li a1, SIGFPE - j _C_LABEL(trapsignal) + j _C_LABEL(fpemul_trapsignal) END(bcemul_sigfpe) #endif diff --git a/sys/arch/mips/mips/mips_fputrap.c b/sys/arch/mips/mips/mips_fputrap.c index ed98958cbb96..146de453e562 100644 --- a/sys/arch/mips/mips/mips_fputrap.c +++ b/sys/arch/mips/mips/mips_fputrap.c @@ -1,4 +1,4 @@ -/* $NetBSD: mips_fputrap.c,v 1.2 2005/12/11 12:18:09 christos Exp $ */ +/* $NetBSD: mips_fputrap.c,v 1.3 2006/03/25 00:08:11 tsutsui Exp $ */ /* * Copyright (c) 2004 @@ -33,6 +33,7 @@ #include #include +#ifndef SOFTFLOAT void mips_fpuexcept(struct lwp *, unsigned int); void mips_fpuillinst(struct lwp *, unsigned int, unsigned long); static int fpustat2sicode(unsigned int); @@ -84,3 +85,20 @@ fpustat2sicode(unsigned int fpustat) return (fpecodes[i].code); return (FPE_FLTINV); } +#endif /* !SOFTFLOAT */ + +void fpemul_trapsignal(struct lwp *, unsigned int, unsigned int); + +void +fpemul_trapsignal(struct lwp *l, unsigned int sig, unsigned int code) +{ + ksiginfo_t ksi; + + printf("emul_trapsignal(%x,%x)\n", sig, code); + + KSI_INIT_TRAP(&ksi); + ksi.ksi_signo = sig; + ksi.ksi_code = 1; /* XXX */ + ksi.ksi_trap = code; + (*l->l_proc->p_emul->e_trapsignal)(l, &ksi); +}