Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/ia64/ia64 Add some vector process from FreeBSD.
details: https://anonhg.NetBSD.org/src/rev/76dbad955605
branches: trunk
changeset: 783902:76dbad955605
user: kiyohara <kiyohara%NetBSD.org@localhost>
date: Sat Jan 12 08:42:53 2013 +0000
description:
Add some vector process from FreeBSD.
Remove and add null-line.
diffstat:
sys/arch/ia64/ia64/trap.c | 63 ++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 60 insertions(+), 3 deletions(-)
diffs (98 lines):
diff -r 8bf4ee612c9e -r 76dbad955605 sys/arch/ia64/ia64/trap.c
--- a/sys/arch/ia64/ia64/trap.c Sat Jan 12 08:40:51 2013 +0000
+++ b/sys/arch/ia64/ia64/trap.c Sat Jan 12 08:42:53 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.11 2013/01/06 11:25:13 kiyohara Exp $ */
+/* $NetBSD: trap.c,v 1.12 2013/01/12 08:42:53 kiyohara Exp $ */
/*-
* Copyright (c) 2005 Marcel Moolenaar
@@ -61,7 +61,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.11 2013/01/06 11:25:13 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.12 2013/01/12 08:42:53 kiyohara Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -414,6 +414,7 @@
*/
trap_panic(vector, tf);
break;
+
case IA64_VEC_ITLB:
case IA64_VEC_DTLB:
case IA64_VEC_EXT_INTR:
@@ -526,7 +527,6 @@
} else if (ucode == 0x100000) {
break_syscall(tf);
return; /* do_ast() already called. */
-
} else if (ucode == 0x180000) {
mcontext_t mc;
@@ -547,6 +547,63 @@
}
break;
+ case IA64_VEC_PAGE_NOT_PRESENT:
+ case IA64_VEC_INST_ACCESS_RIGHTS:
+ case IA64_VEC_DATA_ACCESS_RIGHTS: {
+ struct pcb * const pcb = lwp_getpcb(l);
+ vaddr_t va;
+ struct vm_map *map;
+ vm_prot_t ftype;
+ uint64_t onfault;
+ int error = 0;
+
+ va = trunc_page(tf->tf_special.ifa);
+
+ if (va >= VM_MAXUSER_ADDRESS) {
+ /*
+ * Don't allow user-mode faults for kernel virtual
+ * addresses, including the gateway page.
+ */
+ if (user)
+ goto no_fault_in;
+ map = kernel_map;
+ } else {
+ map = (p != NULL) ? &p->p_vmspace->vm_map : NULL;
+ if (map == NULL)
+ goto no_fault_in;
+ }
+
+ if (tf->tf_special.isr & IA64_ISR_X)
+ ftype = VM_PROT_EXECUTE;
+ else if (tf->tf_special.isr & IA64_ISR_W)
+ ftype = VM_PROT_WRITE;
+ else
+ ftype = VM_PROT_READ;
+
+ onfault = pcb->pcb_onfault;
+ pcb->pcb_onfault = 0;
+ error = uvm_fault(map, va, ftype);
+ pcb->pcb_onfault = onfault;
+
+ if (error == 0)
+ goto out;
+
+no_fault_in:
+ if (!user) {
+ /* Check for copyin/copyout fault. */
+ if (pcb->pcb_onfault != 0) {
+ tf->tf_special.iip = pcb->pcb_onfault;
+ tf->tf_special.psr &= ~IA64_PSR_RI;
+ tf->tf_scratch.gr8 = error;
+ goto out;
+ }
+ trap_panic(vector, tf);
+ }
+ ucode = va;
+ sig = (error == EACCES) ? SIGBUS : SIGSEGV;
+ break;
+ }
+
/* XXX: Fill in the rest */
case IA64_VEC_SPECULATION:
Home |
Main Index |
Thread Index |
Old Index