diff options
author | imp <imp@FreeBSD.org> | 2004-10-05 07:18:11 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2004-10-05 07:18:11 +0000 |
commit | ea0652cf81d9005477429d7cf40ffb6e146c95e7 (patch) | |
tree | a1aa08ed8a71816c68a14d79efcf6f06da0bbcdd | |
parent | 5d8d686529b286170a39d0f37f7830b367cc38bb (diff) | |
download | FreeBSD-src-ea0652cf81d9005477429d7cf40ffb6e146c95e7.zip FreeBSD-src-ea0652cf81d9005477429d7cf40ffb6e146c95e7.tar.gz |
Yet another case of resources:
+ * 9: 0x3f0-0x3f3,0x3f4-0x3f5,0x3f7
This requires only one change to support. Rather than keying on the
size of the resource being 2, instead key off the end & 7 being 3.
This covers the same cases that the size of 2 would catch, but also
covers the new above case.
In addition, I think it is clearer to use the end in preference to the
size and start for case #8 as well. Turns two tests into one, and
catches no other cases.
Make minor commentary changes to deal with new case #9.
# This change is specifically minimal to allow easy MFC. A more
# extensive change will go into current once I've had a chance to test
# it on a lot of hardware...
-rw-r--r-- | sys/dev/fdc/fdc_isa.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/fdc/fdc_isa.c b/sys/dev/fdc/fdc_isa.c index 0833fed..6700e75 100644 --- a/sys/dev/fdc/fdc_isa.c +++ b/sys/dev/fdc/fdc_isa.c @@ -82,6 +82,7 @@ fdc_isa_alloc_resources(device_t dev, struct fdc_data *fdc) * 6: 0x3f2-0x3f3,0x3f4-0x3f5,0x3f7 # becoming common * 7: 0x3f2-0x3f3,0x3f4-0x3f5 # rare * 8: 0x3f0-0x3f1,0x3f2-0x3f3,0x3f4-0x3f5,0x3f7 + * 9: 0x3f0-0x3f3,0x3f4-0x3f5,0x3f7 * * The following code is generic for any value of 0x3fx :-) */ @@ -99,8 +100,7 @@ again_ioport: nports); return (ENXIO); } - if ((rman_get_start(fdc->res_ioport) & 0x7) == 0 && - rman_get_size(fdc->res_ioport) == 2) { + if ((rman_get_end(fdc->res_ioport) & 0x7) == 1) { /* Case 8 */ bus_release_resource(dev, SYS_RES_IOPORT, fdc->rid_ioport, fdc->res_ioport); @@ -116,9 +116,9 @@ again_ioport: fdc->port_off = -(fdc->porth & 0x7); /* - * Deal with case 6, 7, and 8: FDSTS and FDSATA are in rid 1. + * Deal with case 6-9: FDSTS and FDDATA. */ - if (rman_get_size(fdc->res_ioport) == 2) { + if ((rman_get_end(fdc->res_ioport) & 0x7) == 3) { fdc->rid_sts = fdc->rid_ioport + 1; fdc->res_sts = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &fdc->rid_sts, RF_ACTIVE); |