Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Sep 2016 14:13:41 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r306408 - head/sys/mips/mips
Message-ID:  <201609281413.u8SEDfBq083814@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: br
Date: Wed Sep 28 14:13:41 2016
New Revision: 306408
URL: https://svnweb.freebsd.org/changeset/base/306408

Log:
  Use SIGSEGV signal for memory protection failures from userspace on MIPS.
  (same as ARMv8, RISC-V and other architectures do).
  This makes mmap tests happy.
  
  Sponsored by:	DARPA, AFRL
  Sponsored by:	HEIF5

Modified:
  head/sys/mips/mips/trap.c

Modified: head/sys/mips/mips/trap.c
==============================================================================
--- head/sys/mips/mips/trap.c	Wed Sep 28 13:29:11 2016	(r306407)
+++ head/sys/mips/mips/trap.c	Wed Sep 28 14:13:41 2016	(r306408)
@@ -741,8 +741,11 @@ dofault:
 				}
 				goto err;
 			}
-			ucode = ftype;
-			i = ((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV);
+			i = SIGSEGV;
+			if (rv == KERN_PROTECTION_FAILURE)
+				ucode = SEGV_ACCERR;
+			else
+				ucode = SEGV_MAPERR;
 			addr = trapframe->pc;
 
 			msg = "BAD_PAGE_FAULT";



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609281413.u8SEDfBq083814>