summaryrefslogtreecommitdiff
path: root/sys/dev/bi
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2003-11-04 23:01:13 +0000
committerchristos <christos@NetBSD.org>2003-11-04 23:01:13 +0000
commit808f08e986bbeebc58ffa044e9fb6696b0be9a8f (patch)
tree3e7dfab7502ebd5030ed777bae330ec99ab31c54 /sys/dev/bi
parent5d63abe1f1d45a6a31747cc9a4072efa7a9e1223 (diff)
Try to make this work. Havard will test it.
Diffstat (limited to 'sys/dev/bi')
-rw-r--r--sys/dev/bi/kdb.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/sys/dev/bi/kdb.c b/sys/dev/bi/kdb.c
index 537c9b44548..84116298efe 100644
--- a/sys/dev/bi/kdb.c
+++ b/sys/dev/bi/kdb.c
@@ -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];
-
- eaddr = (u_int32_t)uvtopte(addr + (bp->b_bcount - 1), pcb);
- if (trunc_page(mapaddr) != trunc_page(eaddr)) {
+
+/* 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)])
+
+ 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);
}