Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Extract pci_verbose interface definitions into t...
details: https://anonhg.NetBSD.org/src/rev/19bb306ad08c
branches: trunk
changeset: 755194:19bb306ad08c
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Thu May 27 05:53:35 2010 +0000
description:
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.
diffstat:
sys/dev/pci/pci_verbose.c | 9 +++----
sys/dev/pci/pci_verbose.h | 50 +++++++++++++++++++++++++++++++++++++++++++++++
sys/dev/pci/pcivar.h | 13 +----------
3 files changed, 56 insertions(+), 16 deletions(-)
diffs (125 lines):
diff -r 299011206a67 -r 19bb306ad08c sys/dev/pci/pci_verbose.c
--- a/sys/dev/pci/pci_verbose.c Thu May 27 05:52:29 2010 +0000
+++ b/sys/dev/pci/pci_verbose.c Thu May 27 05:53:35 2010 +0000
@@ -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").
*/
diff -r 299011206a67 -r 19bb306ad08c sys/dev/pci/pci_verbose.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/pci/pci_verbose.h Thu May 27 05:53:35 2010 +0000
@@ -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 */
diff -r 299011206a67 -r 19bb306ad08c sys/dev/pci/pcivar.h
--- a/sys/dev/pci/pcivar.h Thu May 27 05:52:29 2010 +0000
+++ b/sys/dev/pci/pcivar.h Thu May 27 05:53:35 2010 +0000
@@ -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 *);
Home |
Main Index |
Thread Index |
Old Index