Connect the ISA and PCI compatability shims to an option. In this case

it's options COMPAT_OLDISA and COMPAT_OLDPCI.  This is meant to be a
fairly strong incentive to update the older drivers to newbus, but doesn't
(quite) leave anybody hanging with no hardware support.  I was talking with
a few folks and I was encouraged to simply break or disable the shims but
that was a bit too drastic for my liking.
This commit is contained in:
Peter Wemm 2000-03-19 13:07:12 +00:00
parent 1aef042634
commit 80060e8897
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=58287
12 changed files with 53 additions and 8 deletions

View file

@ -56,6 +56,8 @@
* SUCH DAMAGE.
*/
#include "opt_compat_oldisa.h"
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/malloc.h>
@ -69,7 +71,9 @@
void
isa_init(void)
{
isa_wrap_old_drivers();
#ifdef COMPAT_OLDISA
isa_wrap_old_drivers();
#endif
}
/*

View file

@ -218,7 +218,7 @@ i386/isa/intr_machdep.c standard
i386/isa/ipl_funcs.c standard \
compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
i386/isa/isa.c optional isa
i386/isa/isa_compat.c optional isa
i386/isa/isa_compat.c optional isa compat_oldisa
i386/isa/isa_dma.c optional isa
i386/isa/istallion.c optional stli
i386/isa/labpc.c optional labpc

View file

@ -204,7 +204,7 @@ i386/isa/intr_machdep.c standard
i386/isa/ipl_funcs.c standard \
compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
i386/isa/isa.c optional isa
pc98/pc98/isa_compat.c optional isa
pc98/pc98/isa_compat.c optional isa compat_oldisa
pc98/pc98/isa_dma.c optional isa
i386/isa/istallion.c optional stli
i386/isa/labpc.c optional labpc

View file

@ -374,6 +374,7 @@ MSGBUF_SIZE opt_msgbuf.h
# PCI related options
PCI_QUIET opt_pci.h
COMPAT_OLDPCI
# NFS options
NFS_MINATTRTIMO opt_nfs.h

View file

@ -19,6 +19,7 @@ CONSPEED opt_comconsole.h
I586_PMC_GUPROF opt_i586_guprof.h
WLCACHE opt_wavelan.h
WLDEBUG opt_wavelan.h
COMPAT_OLDISA
# Options for emulators. These should only be used at config time, so
# they are handled like options for static file systems

View file

@ -19,6 +19,7 @@ CONSPEED opt_comconsole.h
I586_PMC_GUPROF opt_i586_guprof.h
WLCACHE opt_wavelan.h
WLDEBUG opt_wavelan.h
COMPAT_OLDISA
# Options for emulators. These should only be used at config time, so
# they are handled like options for static file systems

View file

@ -30,6 +30,7 @@
#include "opt_bus.h"
#include "opt_simos.h"
#include "opt_compat_oldpci.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -857,6 +858,9 @@ static struct cdevsw pcicdev = {
#include "pci_if.h"
static devclass_t pci_devclass;
#ifdef COMPAT_OLDPCI
/*
* A simple driver to wrap the old pci driver mechanism for back-compat.
*/
@ -919,8 +923,6 @@ static device_method_t pci_compat_methods[] = {
{ 0, 0 }
};
static devclass_t pci_devclass;
/*
* Create a new style driver around each old pci driver.
*/
@ -950,6 +952,7 @@ compat_pci_handler(module_t mod, int type, void *data)
}
return 0;
}
#endif
/*
* New style pci driver. Parent device is either a pci-host-bridge or a

View file

@ -137,6 +137,7 @@ typedef struct {
u_int8_t seclat; /* CardBus latency timer */
} pcih2cfgregs;
#if 0
/* PCI bus attach definitions (there could be multiple PCI bus *trees* ... */
typedef struct pciattach {
@ -144,6 +145,7 @@ typedef struct pciattach {
int pcibushigh;
struct pciattach *next;
} pciattach;
#endif
extern u_int32_t pci_numdevs;
@ -277,6 +279,12 @@ PCIB_ACCESSOR(hose, HOSE, u_int32_t)
#ifdef PCI_COMPAT
#ifdef _KERNEL
#include "opt_compat_oldpci.h"
#endif
/* all this is going some day */
typedef pcicfgregs *pcici_t;
typedef unsigned pcidi_t;
typedef void pci_inthand_t(void *arg);
@ -285,6 +293,7 @@ typedef void pci_inthand_t(void *arg);
/* just copied from old PCI code for now ... */
#ifdef COMPAT_OLDPCI
struct pci_device {
char* pd_name;
const char* (*pd_probe ) (pcici_t tag, pcidi_t type);
@ -292,6 +301,7 @@ struct pci_device {
u_long *pd_count;
int (*pd_shutdown) (int, int);
};
#endif
#ifdef __i386__
typedef u_short pci_port_t;
@ -312,6 +322,7 @@ int pci_unmap_int (pcici_t tag);
pcici_t pci_get_parent_from_tag(pcici_t tag);
int pci_get_bus_from_tag(pcici_t tag);
#ifdef COMPAT_OLDPCI
struct module;
int compat_pci_handler (struct module *, int, void *);
#define COMPAT_PCI_DRIVER(name, pcidata) \
@ -321,6 +332,7 @@ static moduledata_t name##_mod = { \
&pcidata \
}; \
DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_ANY)
#endif
#endif /* PCI_COMPAT */

View file

@ -56,6 +56,8 @@
* SUCH DAMAGE.
*/
#include "opt_compat_oldisa.h"
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/malloc.h>
@ -69,7 +71,9 @@
void
isa_init(void)
{
isa_wrap_old_drivers();
#ifdef COMPAT_OLDISA
isa_wrap_old_drivers();
#endif
}
/*

View file

@ -41,12 +41,14 @@
#ifndef _ISA_ISAVAR_H_
#include <i386/isa/isa_dma.h>
#endif
#include "opt_compat_oldisa.h"
#endif
/*
* ISA Bus Autoconfiguration
*/
#ifdef COMPAT_OLDISA
/*
* Per device structure.
*/
@ -95,4 +97,6 @@ int isa_compat_nextid __P((void));
#endif
#endif /* COMPAT_OLDISA */
#endif /* !_I386_ISA_ISA_DEVICE_H_ */

View file

@ -30,6 +30,7 @@
#include "opt_bus.h"
#include "opt_simos.h"
#include "opt_compat_oldpci.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -857,6 +858,9 @@ static struct cdevsw pcicdev = {
#include "pci_if.h"
static devclass_t pci_devclass;
#ifdef COMPAT_OLDPCI
/*
* A simple driver to wrap the old pci driver mechanism for back-compat.
*/
@ -919,8 +923,6 @@ static device_method_t pci_compat_methods[] = {
{ 0, 0 }
};
static devclass_t pci_devclass;
/*
* Create a new style driver around each old pci driver.
*/
@ -950,6 +952,7 @@ compat_pci_handler(module_t mod, int type, void *data)
}
return 0;
}
#endif
/*
* New style pci driver. Parent device is either a pci-host-bridge or a

View file

@ -137,6 +137,7 @@ typedef struct {
u_int8_t seclat; /* CardBus latency timer */
} pcih2cfgregs;
#if 0
/* PCI bus attach definitions (there could be multiple PCI bus *trees* ... */
typedef struct pciattach {
@ -144,6 +145,7 @@ typedef struct pciattach {
int pcibushigh;
struct pciattach *next;
} pciattach;
#endif
extern u_int32_t pci_numdevs;
@ -277,6 +279,12 @@ PCIB_ACCESSOR(hose, HOSE, u_int32_t)
#ifdef PCI_COMPAT
#ifdef _KERNEL
#include "opt_compat_oldpci.h"
#endif
/* all this is going some day */
typedef pcicfgregs *pcici_t;
typedef unsigned pcidi_t;
typedef void pci_inthand_t(void *arg);
@ -285,6 +293,7 @@ typedef void pci_inthand_t(void *arg);
/* just copied from old PCI code for now ... */
#ifdef COMPAT_OLDPCI
struct pci_device {
char* pd_name;
const char* (*pd_probe ) (pcici_t tag, pcidi_t type);
@ -292,6 +301,7 @@ struct pci_device {
u_long *pd_count;
int (*pd_shutdown) (int, int);
};
#endif
#ifdef __i386__
typedef u_short pci_port_t;
@ -312,6 +322,7 @@ int pci_unmap_int (pcici_t tag);
pcici_t pci_get_parent_from_tag(pcici_t tag);
int pci_get_bus_from_tag(pcici_t tag);
#ifdef COMPAT_OLDPCI
struct module;
int compat_pci_handler (struct module *, int, void *);
#define COMPAT_PCI_DRIVER(name, pcidata) \
@ -321,6 +332,7 @@ static moduledata_t name##_mod = { \
&pcidata \
}; \
DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_ANY)
#endif
#endif /* PCI_COMPAT */