summaryrefslogtreecommitdiffstats
path: root/sys/pci/pcivar.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-04-24 19:59:20 +0000
committerpeter <peter@FreeBSD.org>1999-04-24 19:59:20 +0000
commite7462e4ae57c4f138096d5845ab761b06a08fb0a (patch)
tree9ee3e749205bf562cf331a25d5e24364dcfa94bb /sys/pci/pcivar.h
parent484e1a3ce13414a858152975b70ae9751604a37a (diff)
downloadFreeBSD-src-e7462e4ae57c4f138096d5845ab761b06a08fb0a.zip
FreeBSD-src-e7462e4ae57c4f138096d5845ab761b06a08fb0a.tar.gz
Replace the pcidevice_set linker set based configuration mechanism for old
style pci drivers with a simple one-line change to use a module that registers itself under new-bus and should in theory enable just about all of the pci drivers to be loadable (kldload and loader(8)) but without having the impact of converting the APIs yet. This also fixes the problem of having undefined variables when only new-style pci drivers are present.
Diffstat (limited to 'sys/pci/pcivar.h')
-rw-r--r--sys/pci/pcivar.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/pci/pcivar.h b/sys/pci/pcivar.h
index 3607132..3df7074 100644
--- a/sys/pci/pcivar.h
+++ b/sys/pci/pcivar.h
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcivar.h,v 1.26 1999/04/16 21:22:52 peter Exp $
+ * $Id: pcivar.h,v 1.27 1999/04/17 08:36:07 peter Exp $
*
*/
@@ -271,7 +271,6 @@ typedef void pci_inthand_t(void *arg);
/* just copied from old PCI code for now ... */
-extern struct linker_set pcidevice_set;
extern int pci_mechanism;
struct pci_device {
@@ -300,5 +299,16 @@ int pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
intrmask_t *maskptr, u_int flags);
int pci_unmap_int (pcici_t tag);
+struct moduledata;
+int compat_pci_handler (struct moduledata *, int, void *);
+#define COMPAT_PCI_DRIVER(name, pcidata) \
+static moduledata_t name##_mod = { \
+ #name, \
+ compat_pci_handler, \
+ &pcidata \
+}; \
+DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_ANY)
+
+
#endif /* PCI_COMPAT */
#endif /* _PCIVAR_H_ */
OpenPOWER on IntegriCloud