Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm32 When pcb_onfault is set, pass the error c...



details:   https://anonhg.NetBSD.org/src/rev/5436764cba87
branches:  trunk
changeset: 535234:5436764cba87
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Mon Aug 12 20:17:37 2002 +0000

description:
When pcb_onfault is set, pass the error code we get from uvm_fault()
(or EFAULT if we never called uvm_fault) to the onfault handler in R0,
in case it wants to use it.

diffstat:

 sys/arch/arm/arm32/fault.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r efb4c9e89495 -r 5436764cba87 sys/arch/arm/arm32/fault.c
--- a/sys/arch/arm/arm32/fault.c        Mon Aug 12 20:11:38 2002 +0000
+++ b/sys/arch/arm/arm32/fault.c        Mon Aug 12 20:17:37 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fault.c,v 1.19 2002/05/25 07:58:35 ichiro Exp $        */
+/*     $NetBSD: fault.c,v 1.20 2002/08/12 20:17:37 bjh21 Exp $ */
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -262,6 +262,7 @@
                 fault_code != FAULT_PERM_S && fault_code != FAULT_PERM_P)
                || pcb->pcb_onfault == fusubailout)) {
 
+               frame->tf_r0 = EFAULT;
 copyfault:
 #ifdef DEBUG
                printf("Using pcb_onfault=%p addr=%08x st=%08x p=%p\n",
@@ -515,8 +516,10 @@
                        goto out;
 
                if (user == 0) {
-                       if (pcb->pcb_onfault)
+                       if (pcb->pcb_onfault) {
+                               frame->tf_r0 = rv;
                                goto copyfault;
+                       }
                        printf("[u]vm_fault(%p, %lx, %x, 0) -> %x\n",
                            map, va, ftype, rv);
                        goto we_re_toast;



Home | Main Index | Thread Index | Old Index