Module Name: src Committed By: pgoyette Date: Thu May 27 05:53:35 UTC 2010
Modified Files: src/sys/dev/pci: pci_verbose.c pcivar.h Added Files: src/sys/dev/pci: pci_verbose.h Log Message: Extract pci_verbose interface definitions into their own header file so we don't need to include pcivar.h in the module. pcivar.h tries to pull in machine/pci_machdep.h which doesn't exist on all machine/architecture combos. Keeping track and building the module only for those that work would have been a maintenance headache; this change allows us to build the module on all systems, regardless of whether the system has pci support or not. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/pci_verbose.c cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/pci_verbose.h cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pci/pcivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/pci_verbose.c diff -u src/sys/dev/pci/pci_verbose.c:1.2 src/sys/dev/pci/pci_verbose.c:1.3 --- src/sys/dev/pci/pci_verbose.c:1.2 Tue May 25 08:35:45 2010 +++ src/sys/dev/pci/pci_verbose.c Thu May 27 05:53:35 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_verbose.c,v 1.2 2010/05/25 08:35:45 pgoyette Exp $ */ +/* $NetBSD: pci_verbose.c,v 1.3 2010/05/27 05:53:35 pgoyette Exp $ */ /* * Copyright (c) 1997 Zubin D. Dittia. All rights reserved. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pci_verbose.c,v 1.2 2010/05/25 08:35:45 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_verbose.c,v 1.3 2010/05/27 05:53:35 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_pci.h" @@ -55,12 +55,11 @@ #endif #include <dev/pci/pcireg.h> +#include <dev/pci/pcidevs.h> #ifdef _KERNEL -#include <dev/pci/pcivar.h> +#include <dev/pci/pci_verbose.h> #endif -#include <dev/pci/pcidevs.h> - /* * Descriptions of of known vendors and devices ("products"). */ Index: src/sys/dev/pci/pcivar.h diff -u src/sys/dev/pci/pcivar.h:1.88 src/sys/dev/pci/pcivar.h:1.89 --- src/sys/dev/pci/pcivar.h:1.88 Tue May 25 08:35:45 2010 +++ src/sys/dev/pci/pcivar.h Thu May 27 05:53:35 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pcivar.h,v 1.88 2010/05/25 08:35:45 pgoyette Exp $ */ +/* $NetBSD: pcivar.h,v 1.89 2010/05/27 05:53:35 pgoyette Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -45,11 +45,11 @@ #include <sys/pmf.h> #include <sys/bus.h> #include <dev/pci/pcireg.h> +#include <dev/pci/pci_verbose.h> /* * Structures and definitions needed by the machine-dependent header. */ -typedef u_int32_t pcireg_t; /* configuration space register XXX */ struct pcibus_attach_args; struct pci_softc; @@ -279,15 +279,6 @@ /* * Misc. */ -const char *pci_findvendor_real(pcireg_t); -const char *pci_findproduct_real(pcireg_t); -const char *pci_null(pcireg_t); -void pci_verbose_ctl(bool); - -extern const char *(*pci_findvendor)(pcireg_t); -extern const char *(*pci_findproduct)(pcireg_t); -extern const char *pci_unmatched; - int pci_find_device(struct pci_attach_args *pa, int (*match)(struct pci_attach_args *)); int pci_dma64_available(struct pci_attach_args *); Added files: Index: src/sys/dev/pci/pci_verbose.h diff -u /dev/null src/sys/dev/pci/pci_verbose.h:1.1 --- /dev/null Thu May 27 05:53:35 2010 +++ src/sys/dev/pci/pci_verbose.h Thu May 27 05:53:35 2010 @@ -0,0 +1,50 @@ +/* $NetBSD: pci_verbose.h,v 1.1 2010/05/27 05:53:35 pgoyette Exp $ */ + +/* + * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. + * Copyright (c) 1994 Charles M. Hannum. 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Charles M. Hannum. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. + */ + +#ifndef _DEV_PCI_PCIVERBOSE_H_ +#define _DEV_PCI_PCIVERBOSE_H + +/* + * Misc. + */ +typedef u_int32_t pcireg_t; /* configuration space register XXX */ + +const char *pci_findvendor_real(pcireg_t); +const char *pci_findproduct_real(pcireg_t); +const char *pci_null(pcireg_t); +void pci_verbose_ctl(bool); + +extern const char *(*pci_findvendor)(pcireg_t); +extern const char *(*pci_findproduct)(pcireg_t); +extern const char *pci_unmatched; + +#endif /* _DEV_PCI_PCIVERBOSE_H */