Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/powerpc Onfault needs to be done even from ...
details: https://anonhg.NetBSD.org/src/rev/e9776d65d41f
branches: trunk
changeset: 511878:e9776d65d41f
user: matt <matt%NetBSD.org@localhost>
date: Thu Jun 28 21:27:47 2001 +0000
description:
Onfault needs to be done even from interrupts so restore that. Default
to EFAULT for the error.
diffstat:
sys/arch/powerpc/powerpc/trap.c | 32 +++++++++++++++-----------------
1 files changed, 15 insertions(+), 17 deletions(-)
diffs (66 lines):
diff -r b7895c232287 -r e9776d65d41f sys/arch/powerpc/powerpc/trap.c
--- a/sys/arch/powerpc/powerpc/trap.c Thu Jun 28 21:12:01 2001 +0000
+++ b/sys/arch/powerpc/powerpc/trap.c Thu Jun 28 21:27:47 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.49 2001/06/28 18:33:39 matt Exp $ */
+/* $NetBSD: trap.c,v 1.50 2001/06/28 21:27:47 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -98,7 +98,8 @@
trapsignal(p, SIGTRAP, EXC_TRC);
KERNEL_PROC_UNLOCK(p);
break;
- case EXC_DSI:
+ case EXC_DSI: {
+ faultbuf *fb;
/*
* Only query UVM if no interrupts are active (this applies
* "on-fault" as well.
@@ -106,7 +107,6 @@
if (intr_depth < 0) {
struct vm_map *map;
vaddr_t va;
- faultbuf *fb;
KERNEL_LOCK(LK_CANRECURSE|LK_EXCLUSIVE);
map = kernel_map;
@@ -139,26 +139,24 @@
return;
if (rv == EACCES)
rv = EFAULT;
- if ((fb = p->p_addr->u_pcb.pcb_onfault) != NULL) {
- frame->srr0 = (*fb)[0];
- frame->fixreg[1] = (*fb)[1];
- frame->fixreg[2] = (*fb)[2];
- frame->fixreg[3] = rv;
- frame->cr = (*fb)[3];
- bcopy(&(*fb)[4], &frame->fixreg[13],
+ } else {
+ rv = EFAULT;
+ }
+ if ((fb = p->p_addr->u_pcb.pcb_onfault) != NULL) {
+ frame->srr0 = (*fb)[0];
+ frame->fixreg[1] = (*fb)[1];
+ frame->fixreg[2] = (*fb)[2];
+ frame->fixreg[3] = rv;
+ frame->cr = (*fb)[3];
+ bcopy(&(*fb)[4], &frame->fixreg[13],
19 * sizeof(register_t));
- return;
- }
- } else {
- /*
- * Make sure err is bogus in interrupt case
- */
- rv = -1;
+ return;
}
printf("trap: kernel %s DSI @ %#x by %#x (DSISR %#x, err=%d)\n",
(frame->dsisr & DSISR_STORE) ? "write" : "read",
frame->dar, frame->srr0, frame->dsisr, rv);
goto brain_damage2;
+ }
case EXC_DSI|EXC_USER:
KERNEL_PROC_LOCK(p);
if (frame->dsisr & DSISR_STORE)
Home |
Main Index |
Thread Index |
Old Index