change mapdev() so that it includes the offset from the start of the
authorchuck <chuck@openbsd.org>
Fri, 12 Jan 1996 21:21:54 +0000 (21:21 +0000)
committerchuck <chuck@openbsd.org>
Fri, 12 Jan 1996 21:21:54 +0000 (21:21 +0000)
page in the virtual address it returns.

sys/arch/sparc/sparc/machdep.c

index f2b858a..b07e611 100644 (file)
@@ -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)