Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Use bus_space_mmap().
details: https://anonhg.NetBSD.org/src/rev/911be389d478
branches: trunk
changeset: 514511:911be389d478
user: thorpej <thorpej%NetBSD.org@localhost>
date: Tue Sep 04 06:59:10 2001 +0000
description:
Use bus_space_mmap().
diffstat:
sys/dev/pci/neo.c | 11 +++--------
sys/dev/pci/tga.c | 23 +++--------------------
sys/dev/pci/tgavar.h | 3 +--
3 files changed, 7 insertions(+), 30 deletions(-)
diffs (98 lines):
diff -r 8dad5718a586 -r 911be389d478 sys/dev/pci/neo.c
--- a/sys/dev/pci/neo.c Tue Sep 04 06:57:26 2001 +0000
+++ b/sys/dev/pci/neo.c Tue Sep 04 06:59:10 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: neo.c,v 1.8 2001/03/14 11:38:55 drochner Exp $ */
+/* $NetBSD: neo.c,v 1.9 2001/09/04 07:12:12 thorpej Exp $ */
/*
* Copyright (c) 1999 Cameron Grant <gandalf%vilnya.demon.co.uk@localhost>
@@ -1018,8 +1018,6 @@
vaddr_t v = (vaddr_t) mem;
bus_addr_t pciaddr;
- /* XXX Need new mapping code. */
-
if (v == sc->pbuf_vaddr)
pciaddr = sc->pbuf_pciaddr;
else if (v == sc->rbuf_vaddr)
@@ -1027,11 +1025,8 @@
else
return (-1);
-#ifdef __i386__
- return (i386_btop(pciaddr + off));
-#else
- return (-1);
-#endif
+ return (bus_space_mmap(sc->bufiot, pciaddr, off, prot,
+ BUS_SPACE_MAP_LINEAR));
}
int
diff -r 8dad5718a586 -r 911be389d478 sys/dev/pci/tga.c
--- a/sys/dev/pci/tga.c Tue Sep 04 06:57:26 2001 +0000
+++ b/sys/dev/pci/tga.c Tue Sep 04 06:59:10 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tga.c,v 1.35 2001/08/05 18:07:54 jdolecek Exp $ */
+/* $NetBSD: tga.c,v 1.36 2001/09/04 06:59:10 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -241,12 +241,6 @@
BUS_SPACE_MAP_PREFETCHABLE | BUS_SPACE_MAP_LINEAR, &dc->dc_memh))
panic("tga_mapaddrs: could not map TGA address space");
dc->dc_vaddr = (vaddr_t) bus_space_vaddr(memt, dc->dc_memh);
-#ifdef __alpha__
- dc->dc_paddr = ALPHA_K0SEG_TO_PHYS(dc->dc_vaddr); /* XXX */
-#endif
-#ifdef arc
- bus_space_paddr(memt, dc->dc_memh, &dc->dc_paddr);
-#endif
bus_space_subregion(dc->dc_memt, dc->dc_memh,
TGA_MEM_CREGS, TGA_CREGS_SIZE,
@@ -669,24 +663,13 @@
off_t offset;
int prot;
{
-
- /* XXX NEW MAPPING CODE... */
-
-#if defined(__alpha__)
struct tga_softc *sc = v;
if (offset >= sc->sc_dc->dc_tgaconf->tgac_cspace_size || offset < 0)
return -1;
- return alpha_btop(sc->sc_dc->dc_paddr + offset);
-#elif defined(__mips__)
- struct tga_softc *sc = v;
- if (offset >= sc->sc_dc->dc_tgaconf->tgac_cspace_size || offset < 0)
- return -1;
- return mips_btop(sc->sc_dc->dc_paddr + offset);
-#else
- return (-1);
-#endif
+ return (bus_space_mmap(sc->sc_dc->dc_memt, sc->sc_dc->dc_pcipaddr,
+ offset, prot, BUS_SPACE_MAP_LINEAR));
}
static int
diff -r 8dad5718a586 -r 911be389d478 sys/dev/pci/tgavar.h
--- a/sys/dev/pci/tgavar.h Tue Sep 04 06:57:26 2001 +0000
+++ b/sys/dev/pci/tgavar.h Tue Sep 04 06:59:10 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tgavar.h,v 1.10 2001/07/16 00:55:17 elric Exp $ */
+/* $NetBSD: tgavar.h,v 1.11 2001/09/04 06:59:11 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -76,7 +76,6 @@
*dc_ramdac_cookie; /* the RAMDAC type; see above */
vaddr_t dc_vaddr; /* memory space virtual base address */
- paddr_t dc_paddr; /* memory space physical base address */
int dc_wid; /* width of frame buffer */
int dc_ht; /* height of frame buffer */
Home |
Main Index |
Thread Index |
Old Index