diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2010-12-26 15:41:01 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2010-12-26 15:41:01 +0000 |
commit | 55d0ea063b25d8b25fea5135f59de22437ecd4ea (patch) | |
tree | 42c739678ad68f903e06cc29eb0db1df3bf6298e /sys/arch/loongson/dev | |
parent | 47f20d782a94ebc11fb4c7b43294559377be4989 (diff) |
Kill pmap_phys_address(), and force every driver's mmap() routine to return
a physical address [more precisely, something suitable to pass to pmap_enter()'sphysical address argument].
This allows MI drivers to implement mmap() routines without having to know
about the pmap_phys_address() implementation and #ifdef obfuscation.
Diffstat (limited to 'sys/arch/loongson/dev')
-rw-r--r-- | sys/arch/loongson/dev/sisfb.c | 6 | ||||
-rw-r--r-- | sys/arch/loongson/dev/smfb.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/sys/arch/loongson/dev/sisfb.c b/sys/arch/loongson/dev/sisfb.c index aa93396a2e5..d693c9f0937 100644 --- a/sys/arch/loongson/dev/sisfb.c +++ b/sys/arch/loongson/dev/sisfb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sisfb.c,v 1.1 2010/02/28 22:32:50 miod Exp $ */ +/* $OpenBSD: sisfb.c,v 1.2 2010/12/26 15:40:59 miod Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -349,7 +349,6 @@ sisfb_mmap(void *v, off_t offset, int prot) { struct sisfb_softc *sc = (struct sisfb_softc *)v; struct rasops_info *ri = &sc->sc_fb->ri; - paddr_t pa; if ((offset & PAGE_MASK) != 0) return -1; @@ -365,8 +364,7 @@ sisfb_mmap(void *v, off_t offset, int prot) if (((paddr_t)ri->ri_bits & PAGE_MASK) != 0) return -1; - pa = XKPHYS_TO_PHYS((paddr_t)ri->ri_bits) + offset; - return atop(pa); + return XKPHYS_TO_PHYS((paddr_t)ri->ri_bits) + offset; } /* diff --git a/sys/arch/loongson/dev/smfb.c b/sys/arch/loongson/dev/smfb.c index 745f4d4846a..9530f335158 100644 --- a/sys/arch/loongson/dev/smfb.c +++ b/sys/arch/loongson/dev/smfb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smfb.c,v 1.10 2010/08/31 10:24:46 pirofti Exp $ */ +/* $OpenBSD: smfb.c,v 1.11 2010/12/26 15:40:59 miod Exp $ */ /* * Copyright (c) 2009, 2010 Miodrag Vallat. @@ -303,7 +303,6 @@ smfb_mmap(void *v, off_t offset, int prot) { struct smfb_softc *sc = (struct smfb_softc *)v; struct rasops_info *ri = &sc->sc_fb->ri; - paddr_t pa; if ((offset & PAGE_MASK) != 0) return -1; @@ -311,8 +310,7 @@ smfb_mmap(void *v, off_t offset, int prot) if (offset < 0 || offset >= ri->ri_stride * ri->ri_height) return -1; - pa = XKPHYS_TO_PHYS((paddr_t)ri->ri_bits) + offset; - return atop(pa); + return XKPHYS_TO_PHYS((paddr_t)ri->ri_bits) + offset; } void |