From f81b26636bfddd9f14af209aaf3ceb2dc4ccc86e Mon Sep 17 00:00:00 2001 From: miod Date: Sun, 18 Jul 2010 13:36:13 +0000 Subject: [PATCH] Repair Gdium support. --- sys/arch/loongson/dev/bonito.c | 12 ++++++++---- sys/arch/loongson/loongson/wscons_machdep.c | 10 +++++++--- 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; /* -- 2.20.1