From owner-p4-projects Sun Nov 24 21:54:47 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9B34337B406; Sun, 24 Nov 2002 21:54:42 -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 1911337B401 for ; Sun, 24 Nov 2002 21:54:42 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAA0043E6E for ; Sun, 24 Nov 2002 21:54:41 -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 gAP5pEmV044246 for ; Sun, 24 Nov 2002 21:51:14 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gAP5pEh8044243 for perforce@freebsd.org; Sun, 24 Nov 2002 21:51:14 -0800 (PST) Date: Sun, 24 Nov 2002 21:51:14 -0800 (PST) Message-Id: <200211250551.gAP5pEh8044243@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar Subject: PERFORCE change 21475 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=21475 Change 21475 by marcel@marcel_nfs on 2002/11/24 21:50:34 Hack: if the rid passed to sioprobe and sioattach is negative, use memory mapped I/O instead of I/O ports. This makes the HP Diva controller attach... Affected files ... .. //depot/projects/ia64/sys/dev/sio/sio.c#17 edit Differences ... ==== //depot/projects/ia64/sys/dev/sio/sio.c#17 (text+ko) ==== @@ -263,6 +263,7 @@ struct resource *irqres; struct resource *ioportres; + int ioportspace; void *cookie; dev_t devs[6]; @@ -450,7 +451,7 @@ bus_release_resource(dev, SYS_RES_IRQ, 0, com->irqres); } if (com->ioportres) - bus_release_resource(dev, SYS_RES_IOPORT, 0, com->ioportres); + bus_release_resource(dev, com->ioportspace, 0, com->ioportres); if (com->tp && (com->tp->t_state & TS_ISOPEN)) { device_printf(dev, "still open, forcing close\n"); (*linesw[com->tp->t_line].l_close)(com->tp, 0); @@ -467,6 +468,12 @@ return (0); } +__inline intrmask_t +isa_irq_pending(void) +{ + return -1; +} + int sioprobe(dev, xrid, rclk, noprobe) device_t dev; @@ -490,12 +497,13 @@ int result; u_long xirq; u_int flags = device_get_flags(dev); - int rid; + int rid, space; struct resource *port; - rid = xrid; - port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, IO_COMSIZE, RF_ACTIVE); + rid = (xrid < 0) ? -xrid : xrid; + space = (xrid < 0) ? SYS_RES_MEMORY : SYS_RES_IOPORT; + port = bus_alloc_resource(dev, space, &rid, 0, ~0, IO_COMSIZE, + RF_ACTIVE); if (!port) return (ENXIO); @@ -539,7 +547,7 @@ for (i = 0; i < count; i++) { xdev = devs[i]; if (device_is_enabled(xdev) && - bus_get_resource(xdev, SYS_RES_IOPORT, 0, &xioport, + bus_get_resource(xdev, space, 0, &xioport, NULL) == 0) outb(xioport + com_mcr, 0); } @@ -551,7 +559,7 @@ if (COM_LLCONSOLE(flags)) { printf("sio%d: reserved for low-level i/o\n", device_get_unit(dev)); - bus_release_resource(dev, SYS_RES_IOPORT, rid, port); + bus_release_resource(dev, space, rid, port); device_set_softc(dev, NULL); free(com, M_DEVBUF); return (ENXIO); @@ -579,7 +587,7 @@ idev = dev; } if (!COM_NOTAST4(flags)) { - if (bus_get_resource(idev, SYS_RES_IOPORT, 0, &io, + if (bus_get_resource(idev, space, 0, &io, NULL) == 0) { xiobase = io; if (bus_get_resource(idev, SYS_RES_IRQ, 0, @@ -712,7 +720,7 @@ sio_setreg(com, com_ier, 0); sio_setreg(com, com_cfcr, CFCR_8BITS); mtx_unlock_spin(&sio_lock); - bus_release_resource(dev, SYS_RES_IOPORT, rid, port); + bus_release_resource(dev, space, rid, port); if (iobase == siocniobase) result = 0; if (result != 0) { @@ -789,7 +797,7 @@ } break; } - bus_release_resource(dev, SYS_RES_IOPORT, rid, port); + bus_release_resource(dev, space, rid, port); if (iobase == siocniobase) result = 0; if (result != 0) { @@ -878,13 +886,14 @@ int minorbase; int unit; u_int flags; - int rid; + int rid, space; struct resource *port; int ret; - rid = xrid; - port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, IO_COMSIZE, RF_ACTIVE); + rid = (xrid < 0) ? -xrid : xrid; + space = (xrid < 0) ? SYS_RES_MEMORY : SYS_RES_IOPORT; + port = bus_alloc_resource(dev, space, &rid, 0, ~0, IO_COMSIZE, + RF_ACTIVE); if (!port) return (ENXIO); @@ -910,6 +919,7 @@ bzero(com, sizeof *com); com->unit = unit; com->ioportres = port; + com->ioportspace = space; com->bst = rman_get_bustag(port); com->bsh = rman_get_bushandle(port); com->cfcr_image = CFCR_8BITS; @@ -960,7 +970,7 @@ * console, so that other devices can't snarf them. */ if (iobase != siocniobase) - bus_release_resource(dev, SYS_RES_IOPORT, rid, port); + bus_release_resource(dev, space, rid, port); return (ENOMEM); } mtx_unlock_spin(&sio_lock); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message