summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/pcibus.c
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>1997-05-26 21:52:41 +0000
committerse <se@FreeBSD.org>1997-05-26 21:52:41 +0000
commitb80cb4d64d11b258df01bec3f0222c521b02f189 (patch)
tree9d7469382d93c93393f12d59858bea241f8842db /sys/i386/isa/pcibus.c
parentd3b40e61a72f912d95e1d111dfde12fb8fc11155 (diff)
downloadFreeBSD-src-b80cb4d64d11b258df01bec3f0222c521b02f189.zip
FreeBSD-src-b80cb4d64d11b258df01bec3f0222c521b02f189.tar.gz
Yet another fix for configuration mechanism 1 register accesses:
Adjust the data port address by adding the two low order bits of the register number. The address port takes only a word address (i.e. ignores the two low order bits written to it).
Diffstat (limited to 'sys/i386/isa/pcibus.c')
-rw-r--r--sys/i386/isa/pcibus.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/i386/isa/pcibus.c b/sys/i386/isa/pcibus.c
index 7085c1e..b801abd 100644
--- a/sys/i386/isa/pcibus.c
+++ b/sys/i386/isa/pcibus.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcibus.c,v 1.37 1997/05/26 21:11:05 se Exp $
+ * $Id: pcibus.c,v 1.38 1997/05/26 21:25:24 se Exp $
*
*/
@@ -59,9 +59,10 @@ pci_cfgenable(unsigned bus, unsigned slot, unsigned func, int reg, int bytes)
&& (reg & (bytes -1)) == 0) {
switch (cfgmech) {
case 1:
- outl(CONF1_ADDR_PORT, (1 << 31) |
- (bus << 16) | (slot << 11) | (func << 8) | reg);
- dataport = CONF1_DATA_PORT;
+ outl(CONF1_ADDR_PORT, (1 << 31)
+ | (bus << 16) | (slot << 11)
+ | (func << 8) | (reg & ~0x03));
+ dataport = CONF1_DATA_PORT + (reg & 0x03);
break;
case 2:
outb(CONF2_ENABLE_PORT, 0xf0 | (func << 1));
OpenPOWER on IntegriCloud