summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/pci/mpcpcibus.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/macppc/pci/mpcpcibus.c')
-rw-r--r--sys/arch/macppc/pci/mpcpcibus.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/arch/macppc/pci/mpcpcibus.c b/sys/arch/macppc/pci/mpcpcibus.c
index 2b89fabe80e..b6b8a94a43f 100644
--- a/sys/arch/macppc/pci/mpcpcibus.c
+++ b/sys/arch/macppc/pci/mpcpcibus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpcpcibus.c,v 1.40 2009/08/22 02:54:50 mk Exp $ */
+/* $OpenBSD: mpcpcibus.c,v 1.41 2010/12/04 17:06:31 miod Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
@@ -61,6 +61,7 @@ void mpc_attach_hook(struct device *, struct device *,
int mpc_bus_maxdevs(void *, int);
pcitag_t mpc_make_tag(void *, int, int, int);
void mpc_decompose_tag(void *, pcitag_t, int *, int *, int *);
+int mpc_conf_size(void *, pcitag_t);
pcireg_t mpc_conf_read(void *, pcitag_t, int);
void mpc_conf_write(void *, pcitag_t, int, pcireg_t);
@@ -437,6 +438,7 @@ mpcpcibrattach(struct device *parent, struct device *self, void *aux)
lcp->lc_pc.pc_bus_maxdevs = mpc_bus_maxdevs;
lcp->lc_pc.pc_make_tag = mpc_make_tag;
lcp->lc_pc.pc_decompose_tag = mpc_decompose_tag;
+ lcp->lc_pc.pc_conf_size = mpc_conf_size;
lcp->lc_pc.pc_conf_read = mpc_conf_read;
lcp->lc_pc.pc_conf_write = mpc_conf_write;
lcp->lc_pc.pc_ether_hw_addr = of_ether_hw_addr;
@@ -768,6 +770,12 @@ mpc_gen_config_reg(void *cpv, pcitag_t tag, int offset)
return reg;
}
+int
+mpc_conf_size(void *cpv, pcitag_t tag)
+{
+ return PCI_CONFIG_SPACE_SIZE;
+}
+
/* #define DEBUG_CONFIG */
pcireg_t
mpc_conf_read(void *cpv, pcitag_t tag, int offset)
@@ -780,7 +788,8 @@ mpc_conf_read(void *cpv, pcitag_t tag, int offset)
faultbuf env;
void *oldh;
- if (offset & 3 || offset < 0 || offset >= 0x100) {
+ if (offset & 3 ||
+ offset < 0 || offset >= PCI_CONFIG_SPACE_SIZE) {
#ifdef DEBUG_CONFIG
printf ("pci_conf_read: bad reg %x\n", offset);
#endif /* DEBUG_CONFIG */