summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-02-26 04:42:15 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-02-26 04:42:15 +0000
commit192c7d21f30350696e505d70e6fbe8f6d282e28a (patch)
tree796c20224e9c9508d7b5c14c1da76114367a8477
parent6bbe8bb03eac297fcaa07763b0d6f8472c578643 (diff)
cnt.foo -> uvmexp.bar
vm_fault -> uvm_fault
-rw-r--r--sys/arch/i386/i386/trap.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c
index 0f8d59784e8..d25a0c31d86 100644
--- a/sys/arch/i386/i386/trap.c
+++ b/sys/arch/i386/i386/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.29 1999/02/12 19:40:12 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.30 1999/02/26 04:42:14 art Exp $ */
/* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */
#undef DEBUG
@@ -62,6 +62,10 @@
#include <vm/pmap.h>
#include <vm/vm_map.h>
+#if defined(UVM)
+#include <uvm/uvm_extern.h>
+#endif
+
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/psl.h>
@@ -193,7 +197,11 @@ trap(frame)
vm_prot_t vftype, ftype;
union sigval sv;
+#if defined(UVM)
+ uvmexp.traps++;
+#else
cnt.v_trap++;
+#endif
/* SIGSEGV and SIGBUS need this */
if (frame.tf_err & PGEX_W) {
@@ -340,7 +348,11 @@ trap(frame)
goto out;
case T_ASTFLT|T_USER: /* Allow process switch */
+#if defined(UVM)
+ uvmexp.softs++;
+#else
cnt.v_soft++;
+#endif
if (p->p_flag & P_OWEUPC) {
p->p_flag &= ~P_OWEUPC;
ADDUPROF(p);
@@ -447,15 +459,27 @@ trap(frame)
/* check if page table is mapped, if not, fault it first */
if ((PTD[pdei(va)] & PG_V) == 0) {
v = trunc_page(vtopte(va));
+#if defined(UVM)
+ rv = uvm_fault(map, v, 0, ftype);
+#else
rv = vm_fault(map, v, ftype, FALSE);
+#endif
if (rv != KERN_SUCCESS)
goto nogo;
/* check if page table fault, increment wiring */
+#if defined(UVM)
+ uvm_map_pageable(map, v, round_page(v+1), FALSE);
+#else
vm_map_pageable(map, v, round_page(v+1), FALSE);
+#endif
} else
v = 0;
+#if defined(UVM)
+ rv = uvm_fault(map, va, 0, ftype);
+#else
rv = vm_fault(map, va, ftype, FALSE);
+#endif
if (rv == KERN_SUCCESS) {
if (nss > vm->vm_ssize)
vm->vm_ssize = nss;
@@ -468,8 +492,13 @@ trap(frame)
if (type == T_PAGEFLT) {
if (pcb->pcb_onfault != 0)
goto copyfault;
+#if defined(UVM)
+ printf("uvm_fault(%p, 0x%lx, 0, %d) -> %x\n",
+ map, va, ftype, rv);
+#else
printf("vm_fault(%p, %lx, %x, 0) -> %x\n",
map, va, ftype, rv);
+#endif
goto we_re_toast;
}
sv.sival_int = rcr2();
@@ -538,9 +567,15 @@ trapwrite(addr)
return 1;
}
+#if defined(UVM)
+ if (uvm_fault(&vm->vm_map, va, 0, VM_PROT_READ | VM_PROT_WRITE)
+ != KERN_SUCCESS)
+ return 1;
+#else
if (vm_fault(&vm->vm_map, va, VM_PROT_READ | VM_PROT_WRITE, FALSE)
!= KERN_SUCCESS)
return 1;
+#endif
if (nss > vm->vm_ssize)
vm->vm_ssize = nss;
@@ -566,7 +601,11 @@ syscall(frame)
register_t code, args[8], rval[2];
u_quad_t sticks;
+#if defined(UVM)
+ uvmexp.syscalls++;
+#else
cnt.v_syscall++;
+#endif
if (!USERMODE(frame.tf_cs, frame.tf_eflags))
panic("syscall");
p = curproc;