From: deraadt Date: Tue, 4 Feb 1997 12:23:16 +0000 (+0000) Subject: pass VM_PROT_READ/VM_PROT_WRITE as si_trapno for SIGSEGV X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=52ed20614260fd1651dfcfc41fc71ffa60a5efbc;p=openbsd pass VM_PROT_READ/VM_PROT_WRITE as si_trapno for SIGSEGV --- diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c index 972e8482747..65569121f50 100644 --- a/sys/arch/sparc/sparc/trap.c +++ b/sys/arch/sparc/sparc/trap.c @@ -743,7 +743,8 @@ kfault: tf->tf_npc = onfault + 4; return; } - trapsignal(p, SIGSEGV, (u_int)v, SEGV_MAPERR, (caddr_t)v); + trapsignal(p, SIGSEGV, (ser & SER_WRITE) ? VM_PROT_WRITE : + VM_PROT_READ, SEGV_MAPERR, (caddr_t)v); } out: if ((psr & PSR_PS) == 0) { @@ -1015,7 +1016,7 @@ kfault: tf->tf_npc = onfault + 4; return; } - trapsignal(p, SIGSEGV, (u_int)sfva, SEGV_MAPERR, (caddr_t)sfva); + trapsignal(p, SIGSEGV, ftype, SEGV_MAPERR, (caddr_t)sfva); } out: if ((psr & PSR_PS) == 0) {