Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci add PCI_MAGIC_IO_RANGE so non-x86 machines can m...



details:   https://anonhg.NetBSD.org/src/rev/0324a094e6c9
branches:  trunk
changeset: 758882:0324a094e6c9
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Nov 19 13:38:17 2010 +0000

description:
add PCI_MAGIC_IO_RANGE so non-x86 machines can map the IO range belonging to
the console vga
thanks to nick for reminding me to commit this and for confirming that it works as intended

diffstat:

 sys/dev/pci/vga_pci.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 6fe20ece3df5 -r 0324a094e6c9 sys/dev/pci/vga_pci.c
--- a/sys/dev/pci/vga_pci.c     Fri Nov 19 12:37:48 2010 +0000
+++ b/sys/dev/pci/vga_pci.c     Fri Nov 19 13:38:17 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vga_pci.c,v 1.50 2010/11/09 21:12:19 shattered Exp $   */
+/*     $NetBSD: vga_pci.c,v 1.51 2010/11/19 13:38:17 macallan Exp $    */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vga_pci.c,v 1.50 2010/11/09 21:12:19 shattered Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vga_pci.c,v 1.51 2010/11/19 13:38:17 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -351,6 +351,16 @@
                return (bus_space_mmap(vc->hdl.vh_memt, IOM_BEGIN,
                    (offset - IOM_BEGIN), prot, 0));
 
+#ifdef PCI_MAGIC_IO_RANGE
+       /* allow to map our IO space on non-x86 machines */
+       if ((offset >= PCI_MAGIC_IO_RANGE) &&
+           (offset < PCI_MAGIC_IO_RANGE + 0x10000)) {
+               return bus_space_mmap(vc->hdl.vh_iot,
+                   offset - PCI_MAGIC_IO_RANGE,
+                   0, prot, BUS_SPACE_MAP_LINEAR);     
+       }
+#endif
+       
        /* Range not found. */
        return (-1);
 }



Home | Main Index | Thread Index | Old Index