From 52ed20614260fd1651dfcfc41fc71ffa60a5efbc Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 4 Feb 1997 12:23:16 +0000 Subject: [PATCH] pass VM_PROT_READ/VM_PROT_WRITE as si_trapno for SIGSEGV --- sys/arch/sparc/sparc/trap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) { -- 2.20.1