Update FPE trapsignal functions for new siginfo,
based on a patch provided by Matthias Drochner. Ok'ed by christos, and fixes PR port-mips/26410.
This commit is contained in:
parent
42ddba8762
commit
65c2431d51
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <sys/siginfo.h>
|
||||
#include <mips/cpuregs.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue