From owner-p4-projects Sun Dec 22 20:44:38 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 220C137B405; Sun, 22 Dec 2002 20:44:35 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE26737B401 for ; Sun, 22 Dec 2002 20:44:34 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B5FA43EE6 for ; Sun, 22 Dec 2002 20:44:34 -0800 (PST) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gBN4iYfh012816 for ; Sun, 22 Dec 2002 20:44:34 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBN4iXO6012813 for perforce@freebsd.org; Sun, 22 Dec 2002 20:44:33 -0800 (PST) Date: Sun, 22 Dec 2002 20:44:33 -0800 (PST) Message-Id: <200212230444.gBN4iXO6012813@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar Subject: PERFORCE change 22652 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=22652 Change 22652 by marcel@marcel_nfs on 2002/12/22 20:43:42 We have a memory mapped serial console: sio0 iomem 0xff5e0000-0xff5e0007 irq 34 on acpi0 sio0: type 16550, console Start cleaning things up by removing unused code and "explicit lyrics". Also, make the bus driver glue conditional on the presence of the bus. This makes me happy because the HP box doesn't have an ISA bus and will make bde happy because he doesn't have ACPI enabled ;-) Interrupts are still broken by the previous interface change. Affected files ... .. //depot/projects/ia64/sys/dev/sio/sio_isa.c#11 edit Differences ... ==== //depot/projects/ia64/sys/dev/sio/sio_isa.c#11 (text+ko) ==== @@ -24,6 +24,8 @@ * $FreeBSD: src/sys/dev/sio/sio_isa.c,v 1.9 2002/05/06 09:02:55 dwmalone Exp $ */ +#include "opt_acpi.h" + #include #include #include @@ -154,19 +156,12 @@ *rid = 0; *sp = SYS_RES_IOPORT; - device_printf(dev, "trying I/O port\n"); res = bus_alloc_resource(dev, *sp, rid, 0, ~0, 8, RF_ACTIVE); if (res == NULL) { - device_printf(dev, "trying memory mapped\n"); *rid = 0; *sp = SYS_RES_MEMORY; res = bus_alloc_resource(dev, *sp, rid, 0, ~0, 8, RF_ACTIVE); - if (res == NULL) { - device_printf(dev, "Bollocks!\n"); - return (NULL); - } } - return (res); } @@ -181,10 +176,10 @@ if (ISA_PNP_PROBE(device_get_parent(dev), dev, sio_ids) == ENXIO) return (ENXIO); - com = device_get_softc(dev); res = sio_isa_alloc(dev, &space, &rid); if (res == NULL) - return (0); + return (ENXIO); + com = device_get_softc(dev); com->bsh = rman_get_bushandle(res); com->bst = rman_get_bustag(res); error = sioprobe(dev); @@ -193,14 +188,11 @@ } static int -sio_isa_attach(dev) - device_t dev; +sio_isa_attach(device_t dev) { - struct com_s *com; struct resource *res; int error, rid, space; - com = device_get_softc(dev); res = sio_isa_alloc(dev, &space, &rid); if (res == NULL) return (ENXIO); @@ -210,5 +202,9 @@ return (error); } +#ifdef DEV_ISA DRIVER_MODULE(sio, isa, sio_isa_driver, sio_devclass, 0, 0); +#endif +#ifdef DEV_ACPI DRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0); +#endif To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message