Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch * Set ksi_code to SI_NOINFO where we used to return...



details:   https://anonhg.NetBSD.org/src/rev/cef26539b46b
branches:  trunk
changeset: 554913:cef26539b46b
user:      pk <pk%NetBSD.org@localhost>
date:      Tue Nov 04 14:24:25 2003 +0000

description:
* Set ksi_code to SI_NOINFO where we used to return zero.
* Fill in ksi_errno if we have an error code to report.

diffstat:

 sys/arch/sparc/sparc/trap.c     |  15 ++++++++-------
 sys/arch/sparc64/sparc64/trap.c |  10 ++++++----
 2 files changed, 14 insertions(+), 11 deletions(-)

diffs (124 lines):

diff -r 4f69bb4c7b31 -r cef26539b46b sys/arch/sparc/sparc/trap.c
--- a/sys/arch/sparc/sparc/trap.c       Tue Nov 04 14:14:28 2003 +0000
+++ b/sys/arch/sparc/sparc/trap.c       Tue Nov 04 14:24:25 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.149 2003/11/01 01:38:46 cl Exp $ */
+/*     $NetBSD: trap.c,v 1.150 2003/11/04 14:24:25 pk Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.149 2003/11/01 01:38:46 cl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.150 2003/11/04 14:24:25 pk Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ktrace.h"
@@ -536,7 +536,7 @@
                        sig = SIGFPE;
                        KSI_INIT_TRAP(&ksi);
                        ksi.ksi_trap = type;
-                       ksi.ksi_code = 0; /* XXX - ucode? */
+                       ksi.ksi_code = SI_NOINFO;
                        ksi.ksi_addr = (void *)pc;
 #endif
                        break;
@@ -719,7 +719,7 @@
                sig = SIGEMT;
                KSI_INIT_TRAP(&ksi);
                ksi.ksi_trap = type;
-               ksi.ksi_code = 0;
+               ksi.ksi_code = SI_NOINFO;
                ksi.ksi_addr = (void *)pc;
                break;
 
@@ -774,7 +774,6 @@
                ksi.ksi_trap = type;
                ksi.ksi_code = ILL_ILLADR;
                ksi.ksi_addr = (void *)pc;
-               /* XXX - ucode? */
                break;
 
        case T_FIXALIGN:
@@ -1057,12 +1056,13 @@
                               p->p_cred && p->p_ucred ?
                               p->p_ucred->cr_uid : -1);
                        ksi.ksi_signo = SIGKILL;
-                       ksi.ksi_code = 0;
+                       ksi.ksi_code = SI_NOINFO;
                } else {
                        ksi.ksi_signo = SIGSEGV;
                        ksi.ksi_code = (rv == EACCES
                                ? SEGV_ACCERR : SEGV_MAPERR);
                }
+               ksi.ksi_errno = rv;
                ksi.ksi_trap = type;
                ksi.ksi_addr = (void *)v;
                trapsignal(l, &ksi);
@@ -1350,12 +1350,13 @@
                               p->p_cred && p->p_ucred ?
                               p->p_ucred->cr_uid : -1);
                        ksi.ksi_signo = SIGKILL;
-                       ksi.ksi_code = 0;
+                       ksi.ksi_code = SI_NOINFO;
                } else {
                        ksi.ksi_signo = SIGSEGV;
                        ksi.ksi_code = (rv == EACCES)
                                ? SEGV_ACCERR : SEGV_MAPERR;
                }
+               ksi.ksi_errno = rv;
                ksi.ksi_trap = type;
                ksi.ksi_addr = (void *)sfva;
                trapsignal(l, &ksi);
diff -r 4f69bb4c7b31 -r cef26539b46b sys/arch/sparc64/sparc64/trap.c
--- a/sys/arch/sparc64/sparc64/trap.c   Tue Nov 04 14:14:28 2003 +0000
+++ b/sys/arch/sparc64/sparc64/trap.c   Tue Nov 04 14:24:25 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.99 2003/11/04 14:14:28 pk Exp $ */
+/*     $NetBSD: trap.c,v 1.100 2003/11/04 14:24:25 pk Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.99 2003/11/04 14:14:28 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.100 2003/11/04 14:24:25 pk Exp $");
 
 #define NEW_FPSTATE
 
@@ -879,7 +879,7 @@
                KSI_INIT_TRAP(&ksi);
                sig = SIGEMT;
                ksi.ksi_trap = type;
-               ksi.ksi_code = 0;
+               ksi.ksi_code = SI_NOINFO;
                ksi.ksi_addr = (void *)pc;
                break;
 
@@ -1304,12 +1304,13 @@
                               p->p_cred && p->p_ucred ?
                               p->p_ucred->cr_uid : -1);
                        ksi.ksi_signo = SIGKILL;
-                       ksi.ksi_code = 0;
+                       ksi.ksi_code = SI_NOINFO;
                } else {
                        ksi.ksi_signo = SIGSEGV;
                        ksi.ksi_code = (rv == EACCES
                                ? SEGV_ACCERR : SEGV_MAPERR);
                }
+               ksi.ksi_errno = rv;
                ksi.ksi_trap = type;
                ksi.ksi_addr = (void *)sfva;
                trapsignal(l, &ksi);
@@ -1808,6 +1809,7 @@
                KSI_INIT_TRAP(&ksi);
                ksi.ksi_signo = SIGSEGV;
                ksi.ksi_code = (rv == EACCES ? SEGV_ACCERR : SEGV_MAPERR);
+               ksi.ksi_errno = rv;
                ksi.ksi_trap = type;
                ksi.ksi_addr = (void *)pc;
                trapsignal(l, &ksi);



Home | Main Index | Thread Index | Old Index