From 4b7076ea351a93ed49ec893da421f6291344206e Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 4 Dec 2010 17:06:33 +0000 Subject: Introduce a new pci routine, pci_conf_size(), which returns the size of a given pcitag_t configuration address space. Currently, all pci controllers will return the usual 0x100 bytes of PCI configuration space, but this will eventually change on PCIe-capable controlers. ok kettenis@ --- sys/arch/i386/pci/pci_machdep.c | 8 +++++++- sys/arch/i386/pci/pci_machdep.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'sys/arch/i386') diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c index d47c18b6e53..15a4e0cbfcd 100644 --- a/sys/arch/i386/pci/pci_machdep.c +++ b/sys/arch/i386/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.54 2010/09/06 19:05:48 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.55 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */ /*- @@ -260,6 +260,12 @@ pci_decompose_tag(pci_chipset_tag_t pc, pcitag_t tag, int *bp, int *dp, int *fp) } } +int +pci_conf_size(pci_chipset_tag_t pc, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t pci_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) { diff --git a/sys/arch/i386/pci/pci_machdep.h b/sys/arch/i386/pci/pci_machdep.h index 853792de17d..dcc0f1fa42d 100644 --- a/sys/arch/i386/pci/pci_machdep.h +++ b/sys/arch/i386/pci/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.19 2010/06/29 22:08:28 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.20 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: pci_machdep.h,v 1.7 1997/06/06 23:29:18 thorpej Exp $ */ /* @@ -88,6 +88,7 @@ void pci_attach_hook(struct device *, struct device *, struct pcibus_attach_args *); int pci_bus_maxdevs(pci_chipset_tag_t, int); pcitag_t pci_make_tag(pci_chipset_tag_t, int, int, int); +int pci_conf_size(pci_chipset_tag_t, pcitag_t); pcireg_t pci_conf_read(pci_chipset_tag_t, pcitag_t, int); void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t); -- cgit v1.2.3