Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sh5/sh5 Add support for non-executable mappings.



details:   https://anonhg.NetBSD.org/src/rev/511eb5ef228e
branches:  trunk
changeset: 551569:511eb5ef228e
user:      scw <scw%NetBSD.org@localhost>
date:      Mon Sep 08 08:01:52 2003 +0000

description:
Add support for non-executable mappings.

diffstat:

 sys/arch/sh5/sh5/trap.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (46 lines):

diff -r 47dc78298bef -r 511eb5ef228e sys/arch/sh5/sh5/trap.c
--- a/sys/arch/sh5/sh5/trap.c   Mon Sep 08 07:21:59 2003 +0000
+++ b/sys/arch/sh5/sh5/trap.c   Mon Sep 08 08:01:52 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.25 2003/08/12 13:50:23 scw Exp $    */
+/*     $NetBSD: trap.c,v 1.26 2003/09/08 08:01:52 scw Exp $    */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.25 2003/08/12 13:50:23 scw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.26 2003/09/08 08:01:52 scw Exp $");
 
 #include "opt_ddb.h"
 
@@ -273,7 +273,8 @@
        case T_RTLBMISS:
        case T_WTLBMISS:
        case T_ITLBMISS:
-               ftype = (traptype == T_WTLBMISS) ? VM_PROT_WRITE : VM_PROT_READ;
+               ftype = (traptype == T_WTLBMISS) ? VM_PROT_WRITE :
+                   ((traptype == T_ITLBMISS) ? VM_PROT_EXECUTE : VM_PROT_READ);
                if (vaddr >= VM_MIN_KERNEL_ADDRESS)
                        goto kernelfault;
 
@@ -282,12 +283,16 @@
                goto pagefault;
 
        case T_RTLBMISS|T_USER:
+               ftype = VM_PROT_READ;
+               goto pagefault;
+
        case T_ITLBMISS|T_USER:
-               ftype = VM_PROT_READ;
+               ftype = VM_PROT_EXECUTE;
                goto pagefault;
 
        case T_WTLBMISS|T_USER:
                ftype = VM_PROT_WRITE;
+               /*FALLTHROUGH*/
 
        pagefault:
            {



Home | Main Index | Thread Index | Old Index