summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2017-07-22 16:44:16 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2017-07-22 16:44:16 +0000
commit595ea01890bed554f6f33da88e4078dc8963437e (patch)
treeb4889744cbb61149d1e382c68ff27a7d92fd213b /sys/arch/mips64
parentc30e87c01ed0aeb81a308ca4d26fdf8b19c97d30 (diff)
Bring SIGBUS and SIGSEGV handling better in line with the other
architectures. OK kettenis@, deraadt@
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/mips64/trap.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c
index 762141db48c..2ab8fbf3e29 100644
--- a/sys/arch/mips64/mips64/trap.c
+++ b/sys/arch/mips64/mips64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.125 2017/07/03 16:37:07 visa Exp $ */
+/* $OpenBSD: trap.c,v 1.126 2017/07/22 16:44:15 visa Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -420,12 +420,9 @@ fault_common_no_miss:
* the current limit and we need to reflect that as an access
* error.
*/
- if ((caddr_t)va >= vm->vm_maxsaddr) {
- if (rv == 0)
- uvm_grow(p, va);
- else if (rv == EACCES)
- rv = EFAULT;
- }
+ if (rv == 0 && (caddr_t)va >= vm->vm_maxsaddr)
+ uvm_grow(p, va);
+
KERNEL_UNLOCK();
if (rv == 0)
return;
@@ -441,6 +438,12 @@ fault_common_no_miss:
ucode = ftype;
i = SIGSEGV;
typ = SEGV_MAPERR;
+ if (rv == EACCES)
+ typ = SEGV_ACCERR;
+ if (rv == EIO) {
+ i = SIGBUS;
+ typ = BUS_OBJERR;
+ }
break;
}