From f4822b7eaa2dd97781e18b475e091a615dcb5b6a Mon Sep 17 00:00:00 2001 From: chuck Date: Fri, 12 Jan 1996 21:21:54 +0000 Subject: [PATCH] change mapdev() so that it includes the offset from the start of the page in the virtual address it returns. --- sys/arch/sparc/sparc/machdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index f2b858ad5ad..b07e6110b47 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -881,7 +881,8 @@ mapdev(rr, virt, offset, size, bustype) if (iobase > IODEV_END) /* unlikely */ panic("mapiodev"); } - ret = (void *)v; + ret = (void *)(v | (((u_long)rr->rr_paddr + offset) & PGOFSET)); + /* note: preserve page offset */ pa = trunc_page(rr->rr_paddr + offset); #ifdef notyet pmtype = (cputyp == CPU_SUN4M) -- 2.20.1