Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / emulators / gxemul / patches / patch-af
blobe04a29e86996f0e39c5d83f9147d86236654190b
1 $NetBSD$
3 --- src/cpus/memory_sh.cc.orig  2010-02-14 01:33:54.000000000 -0800
4 +++ src/cpus/memory_sh.cc       2011-07-15 01:12:18.000000000 -0700
5 @@ -273,15 +273,17 @@
6         }
7  
8         if (user) {
9 +               int expevt;
10 +               int wf = flags & FLAG_WRITEFLAG;
12                 if (flags & FLAG_NOEXCEPTIONS) {
13                         *return_paddr = 0;
14                         return 2;
15                 }
17 -               fatal("Userspace tried to access non-user space memory."
18 -                   " TODO: cause exception! (vaddr=0x%08"PRIx32"\n",
19 -                   (uint32_t) vaddr);
20 -               exit(1);
21 +               expevt = wf? EXPEVT_TLB_PROT_ST : EXPEVT_TLB_PROT_LD;
22 +               sh_exception(cpu, expevt, 0, (uint32_t)vaddr);
23 +               return 0;
24         }
26         /*  P1,P2: Direct-mapped physical memory.  */