Try to make this work. Havard will test it.

This commit is contained in:
christos 2003-11-04 23:01:13 +00:00
parent 5d63abe1f1
commit 808f08e986
1 changed files with 11 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kdb.c,v 1.32 2003/04/01 01:57:36 thorpej Exp $ */
/* $NetBSD: kdb.c,v 1.33 2003/11/04 23:01:13 christos Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kdb.c,v 1.32 2003/04/01 01:57:36 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: kdb.c,v 1.33 2003/11/04 23:01:13 christos Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -253,24 +253,17 @@ kdbgo(usc, mxi)
if ((bp->b_flags & B_PHYS) == 0) {
mapaddr = ((u_int32_t)kvtopte(addr)) & ~KERNBASE;
} else {
struct pcb *pcb;
u_int32_t eaddr;
/*
* We check if the PTE's needed crosses a page boundary.
* If they do; only transfer the amount of data that is
* mapped by the first PTE page and led the system handle
* the rest of the data.
*/
if (addr & 0x40000000)
mapaddr = (u_int32_t)&bp->b_proc->p_vmspace->vm_map.
pmap->pm_p1br[addr & ~0x4000000];
else
mapaddr = (u_int32_t)&bp->b_proc->p_vmspace->vm_map.
pmap->pm_p0br[addr];
/* XXX: This code does not belong here! */
#define UVTOPTE(addr, pmap) (((addr) < 0x40000000) ? \
&pmap->pm_p0br[PF_NUM(addr)] : &pmap->pm_p1br[PF_NUM(addr)])
eaddr = (u_int32_t)uvtopte(addr + (bp->b_bcount - 1), pcb);
if (trunc_page(mapaddr) != trunc_page(eaddr)) {
pmap_t *pmap = &bp->b_proc->p_vmspace->vm_map.pmap;
u_int32_t eaddr = addr + (bp->b_count - 1);
u_int32_t emapaddr = (u_int32_t)UVTOPTE(eaddr, pmap);
mapaddr = (u_int32_t)UVTOPTE(addr, pmap);
if (trunc_page(mapaddr) != trunc_page(emapaddr)) {
mp->mscp_seq.seq_bytecount =
(((round_page(mapaddr) - mapaddr)/4) * 512);
}