summaryrefslogtreecommitdiffstats
path: root/sys/isa/isahint.c
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1999-05-22 15:18:28 +0000
committerdfr <dfr@FreeBSD.org>1999-05-22 15:18:28 +0000
commit6f9e5e854190ab2e7fbe71ec2b59354a448a1950 (patch)
treeafd3454efd3e35a02a2f525336e9c7188ac49147 /sys/isa/isahint.c
parentcd70cc4f2c802c38796d000c8a8ad692a695e9f5 (diff)
downloadFreeBSD-src-6f9e5e854190ab2e7fbe71ec2b59354a448a1950.zip
FreeBSD-src-6f9e5e854190ab2e7fbe71ec2b59354a448a1950.tar.gz
* Factor out the common code between the isa bus drivers for i386 and alpha.
* Re-work the resource allocation code to use helper functions in subr_bus.c. * Add simple isa interface for manipulating the resource ranges which can be allocated and remove the code from isa_write_ivar() which was previously used for this purpose.
Diffstat (limited to 'sys/isa/isahint.c')
-rw-r--r--sys/isa/isahint.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/sys/isa/isahint.c b/sys/isa/isahint.c
index 8010195..c3dff33 100644
--- a/sys/isa/isahint.c
+++ b/sys/isa/isahint.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: isahint.c,v 1.1 1999/05/14 11:22:33 dfr Exp $
*/
#include <sys/param.h>
@@ -32,12 +32,13 @@
#include <sys/bus.h>
#include <sys/module.h>
#include <isa/isavar.h>
+#include <machine/resource.h>
static void
isahint_add_device(device_t parent, const char *name, int unit)
{
device_t child;
- int sensitive, t;
+ int sensitive, start, count, t;
static device_t last_sensitive;
/* device-specific flag overrides any wildcard */
@@ -54,27 +55,29 @@ isahint_add_device(device_t parent, const char *name, int unit)
else if (sensitive)
last_sensitive = child;
- if (resource_int_value(name, unit, "port", &t) == 0)
- isa_set_port(child, t);
+ start = 0;
+ count = 0;
+ if (resource_int_value(name, unit, "port", &start) == 0
+ || resource_int_value(name, unit, "portsize", &count) == 0)
+ ISA_SET_RESOURCE(parent, child, SYS_RES_IOPORT, 0,
+ start, count);
- if (resource_int_value(name, unit, "portsize", &t) == 0)
- isa_set_portsize(child, t);
+ start = 0;
+ count = 0;
+ if (resource_int_value(name, unit, "maddr", &start) == 0
+ || resource_int_value(name, unit, "msize", &count) == 0)
+ ISA_SET_RESOURCE(parent, child, SYS_RES_MEMORY, 0,
+ start, count);
- if (resource_int_value(name, unit, "maddr", &t) == 0)
- isa_set_maddr(child, t);
+ if (resource_int_value(name, unit, "irq", &start) == 0)
+ ISA_SET_RESOURCE(parent, child, SYS_RES_IRQ, 0, start, 1);
- if (resource_int_value(name, unit, "msize", &t) == 0)
- isa_set_msize(child, t);
+ if (resource_int_value(name, unit, "drq", &start) == 0)
+ ISA_SET_RESOURCE(parent, child, SYS_RES_DRQ, 0, start, 1);
if (resource_int_value(name, unit, "flags", &t) == 0)
isa_set_flags(child, t);
- if (resource_int_value(name, unit, "irq", &t) == 0)
- isa_set_irq(child, t);
-
- if (resource_int_value(name, unit, "drq", &t) == 0)
- isa_set_drq(child, t);
-
if (resource_int_value(name, unit, "disabled", &t) == 0 && t != 0)
device_disable(child);
}
OpenPOWER on IntegriCloud