Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sh3/sh3 In tlb_exception(), don't panic immediately...



details:   https://anonhg.NetBSD.org/src/rev/b341d2c84d7c
branches:  trunk
changeset: 544039:b341d2c84d7c
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Mar 09 16:14:29 2003 +0000

description:
In tlb_exception(), don't panic immediately on access at va == 0
from kernel mode if fault hander is set.

diffstat:

 sys/arch/sh3/sh3/exception.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 031529d6036e -r b341d2c84d7c sys/arch/sh3/sh3/exception.c
--- a/sys/arch/sh3/sh3/exception.c      Sun Mar 09 13:59:56 2003 +0000
+++ b/sys/arch/sh3/sh3/exception.c      Sun Mar 09 16:14:29 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exception.c,v 1.5 2003/01/18 06:33:43 thorpej Exp $    */
+/*     $NetBSD: exception.c,v 1.6 2003/03/09 16:14:29 tsutsui Exp $    */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@@ -406,9 +406,13 @@
                        map = kernel_map;
                        pmap = pmap_kernel();
                } else {
-                       TLB_ASSERT(va != 0 && l != NULL &&
+                       TLB_ASSERT(l != NULL &&
                            l->l_md.md_pcb->pcb_onfault != NULL,
                            "invalid user-space access from kernel mode");
+                       if (va == 0) {
+                               tf->tf_spc = (int)l->l_md.md_pcb->pcb_onfault;
+                               return;
+                       }
                        map = &l->l_proc->p_vmspace->vm_map;
                        pmap = map->pmap;
                }



Home | Main Index | Thread Index | Old Index