Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/include Change the pci_attach_args definition t...



details:   https://anonhg.NetBSD.org/src/rev/2127b5c03b9a
branches:  trunk
changeset: 752422:2127b5c03b9a
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Thu Feb 25 20:48:34 2010 +0000

description:
Change the pci_attach_args definition to allow machine-dependent
code to override the default pci(9) behavior by creating a non-NULL
pci_attach_args_t (on x86, pci_attach_args_t is always NULL) containing
one or more non-NULL function pointers.

diffstat:

 sys/arch/x86/include/pci_machdep.h |  36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)

diffs (64 lines):

diff -r 6d8db652b0f2 -r 2127b5c03b9a sys/arch/x86/include/pci_machdep.h
--- a/sys/arch/x86/include/pci_machdep.h        Thu Feb 25 20:36:31 2010 +0000
+++ b/sys/arch/x86/include/pci_machdep.h        Thu Feb 25 20:48:34 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.h,v 1.12 2010/02/24 21:34:23 dyoung Exp $  */
+/*     $NetBSD: pci_machdep.h,v 1.13 2010/02/25 20:48:34 dyoung Exp $  */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -63,9 +63,8 @@
 extern struct x86_bus_dma_tag pci_bus_dma64_tag;
 #endif
 
-struct {
-       int dummy;
-} pci_chipset_tag;
+struct pci_chipset_tag;
+struct pci_attach_args;
 
 /*
  * Types provided to machine-independent PCI code
@@ -74,6 +73,34 @@
 typedef union x86_pci_tag_u pcitag_t;
 typedef int pci_intr_handle_t;
 
+struct pci_chipset_tag {
+       pcireg_t (*pc_conf_read)(pci_chipset_tag_t, pcitag_t, int);
+
+       void (*pc_conf_write)(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
+
+#if 0
+       int (*pc_find_rom)(struct pci_attach_args *, bus_space_tag_t,
+           bus_space_handle_t, int, bus_space_handle_t *, bus_space_size_t *);
+#endif
+
+       int (*pc_intr_map)(struct pci_attach_args *, pci_intr_handle_t *);
+
+       const char *(*pc_intr_string)(pci_chipset_tag_t, pci_intr_handle_t);
+
+       const struct evcnt *(*pc_intr_evcnt)(pci_chipset_tag_t,
+           pci_intr_handle_t);
+
+       void *(*pc_intr_establish)(pci_chipset_tag_t, pci_intr_handle_t, int,
+           int (*)(void *), void *);
+
+       void (*pc_intr_disestablish)(pci_chipset_tag_t, void *);
+
+       pcitag_t (*pc_make_tag)(pci_chipset_tag_t, int, int, int);
+
+       void (*pc_decompose_tag)(pci_chipset_tag_t, pcitag_t,
+           int *, int *, int *);
+};
+
 /*
  * i386-specific PCI variables and functions.
  * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.
@@ -81,7 +108,6 @@
 void           pci_mode_set(int);
 int            pci_mode_detect(void);
 int            pci_bus_flags(void);
-struct         pci_attach_args;
 
 /*
  * Functions provided to machine-independent PCI code.



Home | Main Index | Thread Index | Old Index