-/* $OpenBSD: machdep.c,v 1.208 2024/02/10 07:10:13 jsg Exp $ */
+/* $OpenBSD: machdep.c,v 1.209 2024/03/07 15:01:53 claudio Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
paddr_t pa;
long incr;
- incr = min(buflen, NBPG);
+ incr = min(buflen,
+ PAGE_SIZE - ((u_long)vaddr & PGOFSET));
if (pmap_extract(pmap_kernel(), vaddr, &pa) == FALSE) {
#ifdef DIAGNOSTIC
paddr_t pa;
long incr;
- incr = min(buflen, NBPG);
+ incr = min(buflen,
+ PAGE_SIZE - ((u_long)vaddr & PGOFSET));
+
(void) pmap_extract(pmap_kernel(), vaddr, &pa);
buflen -= incr;
vaddr += incr;