summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-07-18 13:36:15 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-07-18 13:36:15 +0000
commit486bf11bac425626bf9a1d8fcf2099c6d217f0c5 (patch)
tree1779df3042b03ade6661fb35a9ea7a232a6c4381 /sys/arch/loongson
parentd5107650f41ea119c4864ed4fe4981bf536a7be2 (diff)
Repair Gdium support.
Diffstat (limited to 'sys/arch/loongson')
-rw-r--r--sys/arch/loongson/dev/bonito.c12
-rw-r--r--sys/arch/loongson/loongson/wscons_machdep.c10
2 files changed, 15 insertions, 7 deletions
diff --git a/sys/arch/loongson/dev/bonito.c b/sys/arch/loongson/dev/bonito.c
index df9d2b7e211..884d2019002 100644
--- a/sys/arch/loongson/dev/bonito.c
+++ b/sys/arch/loongson/dev/bonito.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bonito.c,v 1.14 2010/05/08 21:59:56 miod Exp $ */
+/* $OpenBSD: bonito.c,v 1.15 2010/07/18 13:36:13 miod Exp $ */
/* $NetBSD: bonito_mainbus.c,v 1.11 2008/04/28 20:23:10 martin Exp $ */
/* $NetBSD: bonito_pci.c,v 1.5 2008/04/28 20:23:28 martin Exp $ */
@@ -995,11 +995,15 @@ bonito_io_map(bus_space_tag_t t, bus_addr_t offs, bus_size_t size, int flags,
bus_space_handle_t *bshp)
{
const struct legacy_io_range *r;
+ bus_addr_t rend;
if (offs < BONITO_PCIIO_LEGACY) {
- size--;
- for (r = sys_platform->legacy_io_ranges; r->start != 0; r++)
- if (offs >= r->start && offs + size <= r->end)
+ if ((r = sys_platform->legacy_io_ranges) == NULL)
+ return ENXIO;
+
+ rend = offs + size - 1;
+ for (; r->start != 0; r++)
+ if (offs >= r->start && rend <= r->end)
break;
if (r->end == 0)
diff --git a/sys/arch/loongson/loongson/wscons_machdep.c b/sys/arch/loongson/loongson/wscons_machdep.c
index 219c93f34a3..6374b3157e2 100644
--- a/sys/arch/loongson/loongson/wscons_machdep.c
+++ b/sys/arch/loongson/loongson/wscons_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wscons_machdep.c,v 1.7 2010/05/08 21:59:56 miod Exp $ */
+/* $OpenBSD: wscons_machdep.c,v 1.8 2010/07/18 13:36:14 miod Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
@@ -118,7 +118,9 @@ wscnprobe(struct consdev *cp)
continue;
class = pci_conf_read_early(tag, PCI_CLASS_REG);
- if (!DEVICE_IS_VGA_PCI(class))
+ if (!DEVICE_IS_VGA_PCI(class) &&
+ !(PCI_CLASS(class) == PCI_CLASS_DISPLAY &&
+ PCI_SUBCLASS(class) == PCI_SUBCLASS_DISPLAY_MISC))
continue;
cp->cn_dev = makedev(maj, 0);
@@ -156,7 +158,9 @@ static int initted;
continue;
class = pci_conf_read_early(tag, PCI_CLASS_REG);
- if (!DEVICE_IS_VGA_PCI(class))
+ if (!DEVICE_IS_VGA_PCI(class) &&
+ !(PCI_CLASS(class) == PCI_CLASS_DISPLAY &&
+ PCI_SUBCLASS(class) == PCI_SUBCLASS_DISPLAY_MISC))
continue;
/*