summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2001-02-12 10:18:59 +0000
committersos <sos@FreeBSD.org>2001-02-12 10:18:59 +0000
commit2fbc9d3d2404c662fe1bb5af501cd360f5c81d9b (patch)
treed212711fb0d0424221bb5c569ce7dcf05bb2f39d /sys
parent528b64e56699e1b7e0d72be227c8bdce239c2b67 (diff)
downloadFreeBSD-src-2fbc9d3d2404c662fe1bb5af501cd360f5c81d9b.zip
FreeBSD-src-2fbc9d3d2404c662fe1bb5af501cd360f5c81d9b.tar.gz
Dont rely on isa includes to get at the std port adresses.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ata/ata-all.c6
-rw-r--r--sys/dev/ata/ata-all.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c
index 7c1ff7e..a268231 100644
--- a/sys/dev/ata/ata-all.c
+++ b/sys/dev/ata/ata-all.c
@@ -51,8 +51,10 @@
#include <pci/pcivar.h>
#include <pci/pcireg.h>
#endif
+#if NISA > 0
#include <isa/isavar.h>
#include <isa/isareg.h>
+#endif
#ifdef __alpha__
#include <machine/md_var.h>
#endif
@@ -551,7 +553,7 @@ ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
case ATA_IOADDR_RID:
if (ATA_MASTERDEV(dev)) {
myrid = 0;
- start = (channel == 0 ? IO_WD1 : IO_WD2);
+ start = (channel ? ATA_SECONDARY : ATA_PRIMARY);
end = start + ATA_IOSIZE - 1;
count = ATA_IOSIZE;
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
@@ -569,7 +571,7 @@ ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
case ATA_ALTADDR_RID:
if (ATA_MASTERDEV(dev)) {
myrid = 0;
- start = (channel == 0 ? IO_WD1 : IO_WD2) + ATA_ALTOFFSET;
+ start = (channel ? ATA_SECONDARY : ATA_PRIMARY) + ATA_ALTOFFSET;
end = start + ATA_ALTIOSIZE - 1;
count = ATA_ALTIOSIZE;
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
diff --git a/sys/dev/ata/ata-all.h b/sys/dev/ata/ata-all.h
index 78ebba0..2b87f5a 100644
--- a/sys/dev/ata/ata-all.h
+++ b/sys/dev/ata/ata-all.h
@@ -107,6 +107,8 @@
#define ATA_A_4BIT 0x08 /* 4 head bits */
/* misc defines */
+#define ATA_PRIMARY 0x1f0
+#define ATA_SECONDARY 0x170
#define ATA_MASTER 0x00
#define ATA_SLAVE 0x10
#define ATA_IOSIZE 0x08
OpenPOWER on IntegriCloud