Add address translation support for 4MB pages, which we use to map the
kernel text.
This commit is contained in:
parent
324e44d74f
commit
1717a7fe75
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kvm_i386.c,v 1.23 2008/01/05 06:22:55 jld Exp $ */
|
||||
/* $NetBSD: kvm_i386.c,v 1.24 2008/01/05 06:54:12 jld Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1989, 1992, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kvm_i386.c,v 1.23 2008/01/05 06:22:55 jld Exp $");
|
||||
__RCSID("$NetBSD: kvm_i386.c,v 1.24 2008/01/05 06:54:12 jld Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -131,6 +131,14 @@ _kvm_kvatop(kd, va, pa)
|
||||
_kvm_err(kd, 0, "invalid translation (invalid PDE)");
|
||||
goto lose;
|
||||
}
|
||||
if ((pde & PG_PS) != 0) {
|
||||
/*
|
||||
* This is a 4MB page.
|
||||
*/
|
||||
page_off = va & ~PG_LGFRAME;
|
||||
*pa = (pde & PG_LGFRAME) + page_off;
|
||||
return (int)(NBPD_L2 - page_off);
|
||||
}
|
||||
pte_pa = (pde & PG_FRAME) + (pl1_pi(va) * sizeof(pt_entry_t));
|
||||
if (pread(kd->pmfd, (void *) &pte, sizeof(pte),
|
||||
_kvm_pa2off(kd, pte_pa)) != sizeof(pte)) {
|
||||
|
Loading…
Reference in New Issue
Block a user