This brings arm64 in line with amd64/i386. Makes the siginfo-fault regress test pass.
ok? Index: arch/arm64/arm64/trap.c =================================================================== RCS file: /cvs/src/sys/arch/arm64/arm64/trap.c,v retrieving revision 1.7 diff -u -p -r1.7 trap.c --- arch/arm64/arm64/trap.c 29 Apr 2017 17:10:43 -0000 1.7 +++ arch/arm64/arm64/trap.c 20 Jul 2017 19:24:45 -0000 @@ -136,7 +136,7 @@ data_abort(struct trapframe *frame, uint vaddr_t va; union sigval sv; uint64_t far; - int error = 0, sig; + int error = 0, sig, code; pcb = curcpu()->ci_curpcb; p = curcpu()->ci_curproc; @@ -191,13 +191,22 @@ data_abort(struct trapframe *frame, uint if (error != 0) { if (lower) { - if (error == ENOMEM) + if (error == ENOMEM) { sig = SIGKILL; - else + code = 0; + } else if (error == EIO) { + sig = SIGBUS; + code = BUS_OBJERR; + } else if (error == EACCES) { sig = SIGSEGV; + code = SEGV_ACCERR; + } else { + sig = SIGSEGV; + code = SEGV_MAPERR; + } sv.sival_ptr = (u_int64_t *)far; - trapsignal(p, sig, 0, SEGV_ACCERR, sv); + trapsignal(p, sig, 0, code, sv); } else { if (curcpu()->ci_idepth == 0 && pcb->pcb_onfault != 0) {