svn commit: r306408 - head/sys/mips/mips

Ruslan Bukin br at FreeBSD.org
Wed Sep 28 14:13:42 UTC 2016


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";


More information about the svn-src-all mailing list