summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2017-07-22 15:20:12 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2017-07-22 15:20:12 +0000
commit3b0f2673b426b6c459e815859530a6f329847d2b (patch)
tree30f0ddc38b1236a4a4db6171246fce17e65b2926 /sys
parent6098f5fc6f5aaf4b9387a041011a9d1e7e9a2e7e (diff)
Fix the various SIGSEGV and SIGBUS scenarios to match what we do on
amd64/arm64/armv7/i386/sparc64. ok visa@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hppa/hppa/trap.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c
index 1182d837fe4..b58f2c9158d 100644
--- a/sys/arch/hppa/hppa/trap.c
+++ b/sys/arch/hppa/hppa/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.141 2016/10/19 08:31:32 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.142 2017/07/22 15:20:11 kettenis Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -513,23 +513,27 @@ datacc:
* the current limit and we need to reflect that as an access
* error.
*/
- if (space != HPPA_SID_KERNEL &&
- va < (vaddr_t)vm->vm_minsaddr) {
- if (ret == 0)
- uvm_grow(p, va);
- else if (ret == EACCES)
- ret = EFAULT;
- }
+ if (ret == 0 && space != HPPA_SID_KERNEL &&
+ va < (vaddr_t)vm->vm_minsaddr)
+ uvm_grow(p, va);
KERNEL_UNLOCK();
if (ret != 0) {
if (type & T_USER) {
+ int signal, sicode;
+
+ signal = SIGSEGV;
+ sicode = SEGV_MAPERR;
+ if (ret == EACCES)
+ sicode = SEGV_ACCERR;
+ if (ret == EIO) {
+ signal = SIGBUS;
+ sicode = BUS_OBJERR;
+ }
sv.sival_int = va;
KERNEL_LOCK();
- trapsignal(p, SIGSEGV, vftype,
- ret == EACCES? SEGV_ACCERR : SEGV_MAPERR,
- sv);
+ trapsignal(p, signal, vftype, sicode, sv);
KERNEL_UNLOCK();
} else {
if (p && p->p_addr->u_pcb.pcb_onfault) {