From 27f65398f872a8be39f3cff5bed8e2185eb72a7a Mon Sep 17 00:00:00 2001 From: Thorsten Lockert Date: Tue, 7 Jan 1997 05:37:38 +0000 Subject: Fix for final ptdi panic on i386 --- sys/arch/i386/i386/pmap.c | 19 ++++++++++++++++++- sys/arch/i386/i386/pmap.old.c | 19 ++++++++++++++++++- sys/arch/i386/include/pmap.h | 3 ++- sys/arch/i386/include/pmap.old.h | 3 ++- 4 files changed, 40 insertions(+), 4 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c index cf4c5717c1f..3e7d0d0db44 100644 --- a/sys/arch/i386/i386/pmap.c +++ b/sys/arch/i386/i386/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.15 1996/10/25 11:14:13 deraadt Exp $ */ +/* $OpenBSD: pmap.c,v 1.16 1997/01/07 05:37:32 tholo Exp $ */ /* $NetBSD: pmap.c,v 1.36 1996/05/03 19:42:22 christos Exp $ */ /* @@ -1726,6 +1726,23 @@ pmap_changebit(pa, setbits, maskbits) splx(s); } +void +pmap_prefault(map, v, l) + vm_map_t map; + vm_offset_t v; + vm_size_t l; +{ + vm_offset_t pv, pv2; + + for (pv = v; pv < v + l ; pv += ~PD_MASK + 1) { + if (!pmap_pde_v(pmap_pde(map->pmap, pv))) { + pv2 = trunc_page(vtopte(pv)); + vm_fault(map, pv2, VM_PROT_READ, FALSE); + } + pv &= PD_MASK; + } +} + #ifdef DEBUG void pmap_pvdump(pa) diff --git a/sys/arch/i386/i386/pmap.old.c b/sys/arch/i386/i386/pmap.old.c index 57ae1e13313..0aa7a5d478f 100644 --- a/sys/arch/i386/i386/pmap.old.c +++ b/sys/arch/i386/i386/pmap.old.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.old.c,v 1.15 1996/10/25 11:14:13 deraadt Exp $ */ +/* $OpenBSD: pmap.old.c,v 1.16 1997/01/07 05:37:32 tholo Exp $ */ /* $NetBSD: pmap.c,v 1.36 1996/05/03 19:42:22 christos Exp $ */ /* @@ -1726,6 +1726,23 @@ pmap_changebit(pa, setbits, maskbits) splx(s); } +void +pmap_prefault(map, v, l) + vm_map_t map; + vm_offset_t v; + vm_size_t l; +{ + vm_offset_t pv, pv2; + + for (pv = v; pv < v + l ; pv += ~PD_MASK + 1) { + if (!pmap_pde_v(pmap_pde(map->pmap, pv))) { + pv2 = trunc_page(vtopte(pv)); + vm_fault(map, pv2, VM_PROT_READ, FALSE); + } + pv &= PD_MASK; + } +} + #ifdef DEBUG void pmap_pvdump(pa) diff --git a/sys/arch/i386/include/pmap.h b/sys/arch/i386/include/pmap.h index 4d43e526f80..67415f52349 100644 --- a/sys/arch/i386/include/pmap.h +++ b/sys/arch/i386/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.7 1996/10/25 11:14:16 deraadt Exp $ */ +/* $OpenBSD: pmap.h,v 1.8 1997/01/07 05:37:34 tholo Exp $ */ /* $NetBSD: pmap.h,v 1.23 1996/05/03 19:26:30 christos Exp $ */ /* @@ -86,6 +86,7 @@ extern int PTDpaddr; /* physical address of kernel PTD */ void pmap_bootstrap __P((vm_offset_t start)); boolean_t pmap_testbit __P((vm_offset_t, int)); void pmap_changebit __P((vm_offset_t, int, int)); +void pmap_prefault __P((vm_map_t, vm_offset_t, vm_size_t)); #endif /* diff --git a/sys/arch/i386/include/pmap.old.h b/sys/arch/i386/include/pmap.old.h index 3fbeaf58fdd..bbe198f994f 100644 --- a/sys/arch/i386/include/pmap.old.h +++ b/sys/arch/i386/include/pmap.old.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.old.h,v 1.7 1996/10/25 11:14:16 deraadt Exp $ */ +/* $OpenBSD: pmap.old.h,v 1.8 1997/01/07 05:37:34 tholo Exp $ */ /* $NetBSD: pmap.h,v 1.23 1996/05/03 19:26:30 christos Exp $ */ /* @@ -86,6 +86,7 @@ extern int PTDpaddr; /* physical address of kernel PTD */ void pmap_bootstrap __P((vm_offset_t start)); boolean_t pmap_testbit __P((vm_offset_t, int)); void pmap_changebit __P((vm_offset_t, int, int)); +void pmap_prefault __P((vm_map_t, vm_offset_t, vm_size_t)); #endif /* -- cgit v1.2.3