isa_common.h revision 50477
147398Sdfr/*-
247398Sdfr * Copyright (c) 1999 Doug Rabson
347398Sdfr * All rights reserved.
447398Sdfr *
547398Sdfr * Redistribution and use in source and binary forms, with or without
647398Sdfr * modification, are permitted provided that the following conditions
747398Sdfr * are met:
847398Sdfr * 1. Redistributions of source code must retain the above copyright
947398Sdfr *    notice, this list of conditions and the following disclaimer.
1047398Sdfr * 2. Redistributions in binary form must reproduce the above copyright
1147398Sdfr *    notice, this list of conditions and the following disclaimer in the
1247398Sdfr *    documentation and/or other materials provided with the distribution.
1347398Sdfr *
1447398Sdfr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1547398Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1647398Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1747398Sdfr * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1847398Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1947398Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2047398Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2147398Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2247398Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2347398Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2447398Sdfr * SUCH DAMAGE.
2547398Sdfr *
2650477Speter * $FreeBSD: head/sys/isa/isa_common.h 50477 1999-08-28 01:08:13Z peter $
2747398Sdfr */
2847398Sdfr
2947398Sdfr/*
3047398Sdfr * Parts of the ISA bus implementation common to all architectures.
3147398Sdfr *
3247398Sdfr * Drivers must not depend on information in this file as it can change
3347398Sdfr * without notice.
3447398Sdfr */
3547398Sdfr
3647398SdfrMALLOC_DECLARE(M_ISADEV);
3747398Sdfr
3847398Sdfr/*
3947398Sdfr * The structure used to attach devices to the isa bus.
4047398Sdfr */
4147398Sdfrstruct isa_device {
4247398Sdfr	struct resource_list	id_resources;
4347398Sdfr	int			id_flags;
4447613Sdfr	u_int32_t		id_vendorid; /* pnp vendor id */
4547613Sdfr	u_int32_t		id_serial; /* pnp serial */
4647613Sdfr	u_int32_t		id_logicalid; /* pnp logical device id */
4747613Sdfr	u_int32_t		id_compatid; /* pnp compat device id */
4847398Sdfr};
4947398Sdfr
5047398Sdfr#define DEVTOISA(dev)	((struct isa_device *) device_get_ivars(dev))
5147398Sdfr
5247398Sdfr/*
5347398Sdfr * These functions are architecture dependant.
5447398Sdfr */
5547398Sdfrextern void isa_init(void);
5647398Sdfrextern struct resource *isa_alloc_resource(device_t bus, device_t child,
5747398Sdfr					   int type, int *rid,
5847398Sdfr					   u_long start, u_long end,
5947398Sdfr					   u_long count, u_int flags);
6047398Sdfrextern int isa_release_resource(device_t bus, device_t child,
6147398Sdfr				int type, int rid,
6247398Sdfr				struct resource *r);
6347398Sdfr
6447398Sdfr/* XXX alphe declares these elsewhere */
6547398Sdfr#ifndef __alpha__
6647398Sdfrextern int isa_setup_intr(device_t bus, device_t child,
6747398Sdfr			  struct resource *r, int flags,
6847398Sdfr			  void (*ihand)(void *), void *arg, void **cookiep);
6947398Sdfrextern int isa_teardown_intr(device_t bus, device_t child,
7047398Sdfr			     struct resource *r, void *cookie);
7147398Sdfr#endif
7247398Sdfr
73