From e98bcb27e2fa94039025d2a2069fc90fc1f246e5 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 2 Dec 2012 00:09:09 +0100 Subject: [PATCH] kernel/i386: With stl(4) and cy(4) made PCI only, remove COMPAT_OLDISA. --- UPDATING | 6 + sys/bus/isa/i386/isa.c | 6 - sys/bus/isa/i386/isa_compat.c | 301 ---------------------------- sys/bus/isa/i386/isa_compat.h | 57 ------ sys/bus/isa/i386/isa_device.h | 5 - sys/bus/isa/isa_compat.h | 49 ----- sys/bus/isa/x86_64/isa_device.h | 4 - sys/config/GENERIC | 1 - sys/config/LINT | 1 - sys/config/X86_64_GENERIC | 1 - sys/platform/pc32/conf/files | 1 - sys/platform/pc32/conf/options | 1 - sys/platform/pc32/i386/userconfig.c | 1 - 13 files changed, 6 insertions(+), 428 deletions(-) delete mode 100644 sys/bus/isa/i386/isa_compat.c delete mode 100644 sys/bus/isa/i386/isa_compat.h delete mode 100644 sys/bus/isa/isa_compat.h diff --git a/UPDATING b/UPDATING index 01be748c2c..160054224a 100644 --- a/UPDATING +++ b/UPDATING @@ -40,6 +40,12 @@ has been completely removed (along with the stlload(8) and stlstty(8) utilities) and stl(4) was changed to support only PCI cards. Similarly, ISA support was removed from cy(4) too. All these drivers are i386 only. +COMPAT_OLDISA OPTION GONE +------------------------- + +The i386 specific COMPAT_OLDISA kernel option has been removed, since +nothing needs it anymore. + +-----------------------------------------------------------------------+ + UPGRADING DRAGONFLY FROM 3.0 to later versions + +-----------------------------------------------------------------------+ diff --git a/sys/bus/isa/i386/isa.c b/sys/bus/isa/i386/isa.c index ab5a4c5b22..4e38377d20 100644 --- a/sys/bus/isa/i386/isa.c +++ b/sys/bus/isa/i386/isa.c @@ -24,7 +24,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/isa.c,v 1.132.2.5 2002/03/03 05:42:50 nyan Exp $ - * $DragonFly: src/sys/bus/isa/i386/isa.c,v 1.8 2006/10/25 20:55:51 dillon Exp $ */ /* @@ -66,14 +65,9 @@ #include "../isavar.h" #include "../isa_common.h" -#include "opt_compat_oldisa.h" - void isa_init(void) { -#ifdef COMPAT_OLDISA - isa_wrap_old_drivers(); -#endif } /* diff --git a/sys/bus/isa/i386/isa_compat.c b/sys/bus/isa/i386/isa_compat.c deleted file mode 100644 index 11086e6b14..0000000000 --- a/sys/bus/isa/i386/isa_compat.c +++ /dev/null @@ -1,301 +0,0 @@ -/*- - * Copyright (c) 1998 Doug Rabson - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/isa/isa_compat.c,v 1.18.2.1 2001/05/17 23:05:06 imp Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "../isavar.h" -#include "isa_compat.h" -#include "isa_device.h" - -struct isa_compat_resources { - struct resource *ports; - struct resource *memory; - struct resource *drq; - struct resource *irq; -}; - -struct isa_compat_driver { - driver_t driver; - struct old_isa_driver *op; -}; - -int -isa_compat_nextid(void) -{ - static int id = 2; /* id_id of -1, 0 and 1 are "used" */ - - return id++; -} - -static void -isa_compat_alloc_resources(device_t dev, struct isa_compat_resources *res) -{ - int rid; - u_long start, count; - - if (bus_get_resource(dev, SYS_RES_IOPORT, 0, - &start, &count) == 0) { - rid = 0; - res->ports = bus_alloc_resource(dev, SYS_RES_IOPORT, - &rid, 0ul, ~0ul, 1, - RF_ACTIVE); - if (res->ports == NULL && bootverbose) - kprintf("isa_compat: didn't get ports for %s\n", - device_get_name(dev)); - } else - res->ports = NULL; - - if (bus_get_resource(dev, SYS_RES_MEMORY, 0, - &start, &count) == 0 - && start != 0) { - rid = 0; - res->memory = bus_alloc_resource(dev, SYS_RES_MEMORY, - &rid, 0ul, ~0ul, 1, - RF_ACTIVE); - if (res->memory == NULL && bootverbose) - kprintf("isa_compat: didn't get memory for %s\n", - device_get_name(dev)); - } else - res->memory = NULL; - - if (bus_get_resource(dev, SYS_RES_DRQ, 0, - &start, &count) == 0) { - rid = 0; - res->drq = bus_alloc_resource(dev, SYS_RES_DRQ, - &rid, 0ul, ~0ul, 1, - RF_ACTIVE); - if (res->drq == NULL && bootverbose) - kprintf("isa_compat: didn't get drq for %s\n", - device_get_name(dev)); - } else - res->drq = NULL; - - if (bus_get_resource(dev, SYS_RES_IRQ, 0, - &start, &count) == 0) { - rid = 0; - res->irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &rid, 0ul, ~0ul, 1, - RF_SHAREABLE | RF_ACTIVE); - if (res->irq == NULL && bootverbose) - kprintf("isa_compat: didn't get irq for %s\n", - device_get_name(dev)); - } else - res->irq = NULL; -} - -static void -isa_compat_release_resources(device_t dev, struct isa_compat_resources *res) -{ - if (res->ports) { - bus_release_resource(dev, SYS_RES_IOPORT, 0, res->ports); - res->ports = NULL; - } - if (res->memory) { - bus_release_resource(dev, SYS_RES_MEMORY, 0, res->memory); - res->memory = NULL; - } - if (res->drq) { - bus_release_resource(dev, SYS_RES_DRQ, 0, res->drq); - res->drq = NULL; - } - if (res->irq) { - bus_release_resource(dev, SYS_RES_IRQ, 0, res->irq); - res->irq = NULL; - } -} - -#define irqmask(x) ((x) < 0 ? 0 : (1 << (x))) - -static int -isa_compat_probe(device_t dev) -{ - struct isa_device *dvp = device_get_softc(dev); - struct isa_compat_resources res; - struct old_isa_driver *op; - u_long start, count; - - /* No pnp support */ - if (isa_get_vendorid(dev)) - return (ENXIO); - - bzero(&res, sizeof(res)); - /* - * Fill in the isa_device fields. - */ - op = ((struct isa_compat_driver *)device_get_driver(dev))->op; - dvp->id_id = isa_compat_nextid(); - dvp->id_driver = op->driver; - if (bus_get_resource(dev, SYS_RES_IOPORT, 0, - &start, &count) == 0) - dvp->id_iobase = start; - else - dvp->id_iobase = -1; - if (bus_get_resource(dev, SYS_RES_IRQ, 0, - &start, &count) == 0) - dvp->id_irq = irqmask(start); - else - dvp->id_irq = 0; - if (bus_get_resource(dev, SYS_RES_DRQ, 0, - &start, &count) == 0) - dvp->id_drq = start; - else - dvp->id_drq = -1; - if (bus_get_resource(dev, SYS_RES_MEMORY, - 0, &start, &count) == 0) { - dvp->id_maddr = (void *)(uintptr_t)start; - dvp->id_msize = count; - } else { - dvp->id_maddr = NULL; - dvp->id_msize = 0; - } - dvp->id_unit = device_get_unit(dev); - dvp->id_flags = device_get_flags(dev); - dvp->id_enabled = device_is_enabled(dev); /* XXX unused */ - dvp->id_device = dev; - - /* - * Do the wrapped probe. - */ - if (dvp->id_driver->probe) { - int portsize; - void *maddr; - struct isa_device old; - - isa_compat_alloc_resources(dev, &res); - if (res.memory) - maddr = rman_get_virtual(res.memory); - else - maddr = NULL; - dvp->id_maddr = maddr; - old = *dvp; - portsize = dvp->id_driver->probe(dvp); - isa_compat_release_resources(dev, &res); - if (portsize != 0) { - if (portsize > 0 || dvp->id_iobase != old.id_iobase) { - bus_set_resource(dev, SYS_RES_IOPORT, 0, - dvp->id_iobase, portsize, -1); - } - if (dvp->id_irq != old.id_irq) { - int intr = ffs(dvp->id_irq) - 1; - - bus_set_resource(dev, SYS_RES_IRQ, 0, intr, 1, - machintr_legacy_intr_cpuid(intr)); - } - if (dvp->id_drq != old.id_drq) { - bus_set_resource(dev, SYS_RES_DRQ, 0, - dvp->id_drq, 1, -1); - } - if (dvp->id_maddr != old.id_maddr - || dvp->id_msize != old.id_msize) { - maddr = dvp->id_maddr; - if (maddr != NULL) { - bus_set_resource(dev, SYS_RES_MEMORY, 0, - kvtop(maddr), dvp->id_msize, -1); - } else { - bus_delete_resource(dev, - SYS_RES_MEMORY, 0); - } - } - return 0; - } - } - return ENXIO; -} - -static int -isa_compat_attach(device_t dev) -{ - struct isa_device *dvp = device_get_softc(dev); - struct isa_compat_resources res; - int error; - - bzero(&res, sizeof(res)); - isa_compat_alloc_resources(dev, &res); - if (dvp->id_driver->attach) - dvp->id_driver->attach(dvp); - if (res.irq && dvp->id_irq && dvp->id_intr) { - struct old_isa_driver *op; - void *ih; - - op = ((struct isa_compat_driver *)device_get_driver(dev))->op; - error = BUS_SETUP_INTR(device_get_parent(dev), dev, - res.irq, op->type, - dvp->id_intr, - (void *)(uintptr_t)dvp->id_unit, - &ih, NULL, NULL); - if (error) - kprintf("isa_compat_attach: failed to setup intr: %d\n", - error); - } - device_printf(dev, "driver is using old-style compatibility shims\n"); - return 0; -} - -static device_method_t isa_compat_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, isa_compat_probe), - DEVMETHOD(device_attach, isa_compat_attach), - - { 0, 0 } -}; - -/* - * Create a new style driver around each old isa driver. - */ -void -isa_wrap_old_drivers(void) -{ - int i; - struct old_isa_driver *op; - devclass_t isa_devclass = devclass_find("isa"); - struct isa_compat_driver *driver; - - for (i = 0, op = &old_drivers[0]; i < old_drivers_count; i++, op++) { - driver = kmalloc(sizeof(struct isa_compat_driver), M_DEVBUF, M_WAITOK | M_ZERO); - driver->driver.name = op->driver->name; - driver->driver.methods = isa_compat_methods; - driver->driver.size = sizeof(struct isa_device); - driver->op = op; - if (op->driver->sensitive_hw) - resource_set_int(op->driver->name, -1, "sensitive", 1); - devclass_add_driver(isa_devclass, (driver_t *)driver); - } -} diff --git a/sys/bus/isa/i386/isa_compat.h b/sys/bus/isa/i386/isa_compat.h deleted file mode 100644 index 3cb619a60f..0000000000 --- a/sys/bus/isa/i386/isa_compat.h +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * Copyright (c) 1998 Doug Rabson - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/isa/isa_compat.h,v 1.27.2.11 2002/10/05 18:31:48 scottl Exp $ - */ - -struct old_isa_driver { - int type; - struct isa_driver *driver; -}; - -extern struct isa_driver cydriver; - -static struct old_isa_driver old_drivers[] = { - -/* Sensitive TTY */ - -/* Sensitive BIO */ - -/* Sensitive NET */ - -/* Sensitive CAM */ - -/* TTY */ - -/* BIO */ - -/* NET */ - -/* MISC */ - -}; - -#define old_drivers_count NELEM(old_drivers) - diff --git a/sys/bus/isa/i386/isa_device.h b/sys/bus/isa/i386/isa_device.h index 36bb36a9e4..ec4b687630 100644 --- a/sys/bus/isa/i386/isa_device.h +++ b/sys/bus/isa/i386/isa_device.h @@ -32,7 +32,6 @@ * * from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91 * $FreeBSD: src/sys/i386/isa/isa_device.h,v 1.68 2000/01/29 18:01:10 peter Exp $ - * $DragonFly: src/sys/bus/isa/i386/isa_device.h,v 1.9 2006/10/23 21:50:31 dillon Exp $ */ #ifndef _BUS_ISA_ARCH_ISA_DEVICE_H_ @@ -82,8 +81,4 @@ struct isa_driver { int sensitive_hw; /* true if other probes confuse us */ }; -#ifdef _KERNEL -int isa_compat_nextid (void); -#endif - #endif /* !_BUS_ISA_ARCH_ISA_DEVICE_H_ */ diff --git a/sys/bus/isa/isa_compat.h b/sys/bus/isa/isa_compat.h deleted file mode 100644 index aa5b1ee51b..0000000000 --- a/sys/bus/isa/isa_compat.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2008 The DragonFly Project. All rights reserved. - * - * This code is derived from software contributed to The DragonFly Project - * by Matthew Dillon - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of The DragonFly Project nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific, prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $DragonFly: src/sys/bus/isa/isa_compat.h,v 1.1 2008/08/02 01:14:39 dillon Exp $ - */ - -#ifndef _BUS_ISA_ISA_COMPAT_H_ -#define _BUS_ISA_ISA_COMPAT_H_ - -#if defined(__i386__) -#include "i386/isa_compat.h" -#elif defined(__x86_64__) -#include "x86_64/isa_compat.h" -#else -#error "No isa_compat.h for this architecture" -#endif - -#endif - diff --git a/sys/bus/isa/x86_64/isa_device.h b/sys/bus/isa/x86_64/isa_device.h index 4864a98cfe..ec4b687630 100644 --- a/sys/bus/isa/x86_64/isa_device.h +++ b/sys/bus/isa/x86_64/isa_device.h @@ -81,8 +81,4 @@ struct isa_driver { int sensitive_hw; /* true if other probes confuse us */ }; -#ifdef _KERNEL -int isa_compat_nextid (void); -#endif - #endif /* !_BUS_ISA_ARCH_ISA_DEVICE_H_ */ diff --git a/sys/config/GENERIC b/sys/config/GENERIC index 09c59516d5..df6ea362fd 100644 --- a/sys/config/GENERIC +++ b/sys/config/GENERIC @@ -294,7 +294,6 @@ device ral # Ralink Technology 802.11 wireless NIC # and resources will always be dynamically assigned by the pccard code. device wi -# The probe order of these is presently determined by i386/isa/isa_compat.c. device lnc0 at isa? disable port 0x280 irq 10 drq 0 device cs0 at isa? disable port 0x300 device sn0 at isa? disable port 0x300 irq 10 diff --git a/sys/config/LINT b/sys/config/LINT index 5af22768fd..2751170b39 100644 --- a/sys/config/LINT +++ b/sys/config/LINT @@ -1031,7 +1031,6 @@ device pnpbios # reset the CPU for reboot. This is needed on some systems with broken # keyboard controllers. -options COMPAT_OLDISA #FreeBSD 2.2 and 3.x compatibility shims options AUTO_EOI_1 #options AUTO_EOI_2 options MAXMEM="(128*1024)" diff --git a/sys/config/X86_64_GENERIC b/sys/config/X86_64_GENERIC index 671eff1cda..4b554c3b9c 100644 --- a/sys/config/X86_64_GENERIC +++ b/sys/config/X86_64_GENERIC @@ -272,7 +272,6 @@ device ral # Ralink Technology 802.11 wireless NIC # and resources will always be dynamically assigned by the pccard code. device wi -# The probe order of these is presently determined by i386/isa/isa_compat.c. device lnc0 at isa? disable port 0x280 irq 10 drq 0 device cs0 at isa? disable port 0x300 device sn0 at isa? disable port 0x300 irq 10 diff --git a/sys/platform/pc32/conf/files b/sys/platform/pc32/conf/files index c7079faa5b..d86293c18a 100644 --- a/sys/platform/pc32/conf/files +++ b/sys/platform/pc32/conf/files @@ -265,7 +265,6 @@ dev/disk/fd/fd.c optional fd dev/disk/fd/fd_pccard.c optional fd pccard platform/pc32/isa/isa_intr.c standard bus/isa/i386/isa.c optional isa -bus/isa/i386/isa_compat.c optional nowerror isa compat_oldisa bus/isa/i386/isa_dma.c optional isa platform/pc32/isa/npx.c mandatory npx bus/pci/i386/legacy.c optional pci diff --git a/sys/platform/pc32/conf/options b/sys/platform/pc32/conf/options index 6e0d6b12aa..63533bd041 100644 --- a/sys/platform/pc32/conf/options +++ b/sys/platform/pc32/conf/options @@ -14,7 +14,6 @@ AUTO_EOI_2 opt_auto_eoi.h CONSPEED opt_comconsole.h I586_PMC_GUPROF opt_i586_guprof.h BROKEN_KEYBOARD_RESET opt_reset.h -COMPAT_OLDISA opt_compat_oldisa.h # Options for emulators. These should only be used at config time, so # they are handled like options for static file systems diff --git a/sys/platform/pc32/i386/userconfig.c b/sys/platform/pc32/i386/userconfig.c index f5c674cd2c..a7faa88537 100644 --- a/sys/platform/pc32/i386/userconfig.c +++ b/sys/platform/pc32/i386/userconfig.c @@ -97,7 +97,6 @@ **/ #include "opt_userconfig.h" -#define COMPAT_OLDISA /* get the definitions */ #include #include -- 2.41.0