Home | History | Annotate | Line # | Download | only in include
isa_machdep.h revision 1.7
      1 /*	$NetBSD: isa_machdep.h,v 1.7 2000/02/07 22:07:29 thorpej Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 1998 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
      9  * NASA Ames Research Center.
     10  *
     11  * Redistribution and use in source and binary forms, with or without
     12  * modification, are permitted provided that the following conditions
     13  * are met:
     14  * 1. Redistributions of source code must retain the above copyright
     15  *    notice, this list of conditions and the following disclaimer.
     16  * 2. Redistributions in binary form must reproduce the above copyright
     17  *    notice, this list of conditions and the following disclaimer in the
     18  *    documentation and/or other materials provided with the distribution.
     19  * 3. All advertising materials mentioning features or use of this software
     20  *    must display the following acknowledgement:
     21  *	This product includes software developed by the NetBSD
     22  *	Foundation, Inc. and its contributors.
     23  * 4. Neither the name of The NetBSD Foundation nor the names of its
     24  *    contributors may be used to endorse or promote products derived
     25  *    from this software without specific prior written permission.
     26  *
     27  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     28  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     29  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     30  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     31  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     32  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     33  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     34  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     35  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     36  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     37  * POSSIBILITY OF SUCH DAMAGE.
     38  */
     39 
     40 /*
     41  * Copyright (c) 1997 Leo Weppelman.  All rights reserved.
     42  *
     43  * Redistribution and use in source and binary forms, with or without
     44  * modification, are permitted provided that the following conditions
     45  * are met:
     46  * 1. Redistributions of source code must retain the above copyright
     47  *    notice, this list of conditions and the following disclaimer.
     48  * 2. Redistributions in binary form must reproduce the above copyright
     49  *    notice, this list of conditions and the following disclaimer in the
     50  *    documentation and/or other materials provided with the distribution.
     51  * 3. All advertising materials mentioning features or use of this software
     52  *    must display the following acknowledgement:
     53  *	This product includes software developed by Leo Weppelman.
     54  * 4. The name of the author may not be used to endorse or promote products
     55  *    derived from this software without specific prior written permission.
     56  *
     57  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     58  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     59  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     60  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     61  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     62  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     63  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     64  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     65  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     66  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     67  */
     68 
     69 #ifndef _ATARI_ISA_MACHDEP_H_
     70 #define _ATARI_ISA_MACHDEP_H_
     71 
     72 #include <machine/bus.h>
     73 #include <dev/isa/isadmavar.h>
     74 #include <atari/atari/intr.h>
     75 
     76 #define	ISA_IOSTART	0xfff30000	/* XXX: Range with byte frobbing */
     77 #define	ISA_MEMSTART	0xff000000	/* XXX: Hades only	*/
     78 
     79 struct atari_isa_chipset {
     80 	struct isa_dma_state ic_dmastate;
     81 };
     82 
     83 typedef struct atari_isa_chipset *isa_chipset_tag_t;
     84 
     85 typedef struct	{
     86 	int		slot;	/* 1/2, determines interrupt line	*/
     87 	int		ipl;	/* ipl requested			*/
     88 	int		(*ifunc) __P((void *));	/* function to call	*/
     89 	void		*iarg;	/* argument for 'ifunc'			*/
     90 	struct intrhand	*ihand;	/* save this for disestablishing	*/
     91 } isa_intr_info_t;
     92 
     93 /*
     94  * Functions provided to machine-independent ISA code.
     95  */
     96 void	isa_attach_hook __P((struct device *, struct device *,
     97 	    struct isabus_attach_args *));
     98 int	isa_intr_alloc __P((isa_chipset_tag_t, int, int, int *));
     99 void	*isa_intr_establish __P((isa_chipset_tag_t ic, int irq, int type,
    100 	    int level, int (*)(void *), void *ih_arg));
    101 void	isa_intr_disestablish __P((isa_chipset_tag_t ic, void *handler));
    102 
    103 #define	isa_dmainit(ic, bst, dmat, d)					\
    104 	_isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d))
    105 #define	isa_dmacascade(ic, c)						\
    106 	_isa_dmacascade(&(ic)->ic_dmastate, (c))
    107 #define	isa_dmamaxsize(ic, c)						\
    108 	_isa_dmamaxsize(&(ic)->ic_dmastate, (c))
    109 #define	isa_dmamap_create(ic, c, s, f)					\
    110 	_isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f))
    111 #define	isa_dmamap_destroy(ic, c)					\
    112 	_isa_dmamap_destroy(&(ic)->ic_dmastate, (c))
    113 #define	isa_dmastart(ic, c, a, n, p, f, bf)				\
    114 	_isa_dmastart(&(ic)->ic_dmastate, (c), (a), (n), (p), (f), (bf))
    115 #define	isa_dmaabort(ic, c)						\
    116 	_isa_dmaabort(&(ic)->ic_dmastate, (c))
    117 #define	isa_dmacount(ic, c)						\
    118 	_isa_dmacount(&(ic)->ic_dmastate, (c))
    119 #define	isa_dmafinished(ic, c)						\
    120 	_isa_dmafinished(&(ic)->ic_dmastate, (c))
    121 #define	isa_dmadone(ic, c)						\
    122 	_isa_dmadone(&(ic)->ic_dmastate, (c))
    123 #define	isa_dmafreeze(ic)						\
    124 	_isa_dmafreeze(&(ic)->ic_dmastate)
    125 #define	isa_dmathaw(ic)							\
    126 	_isa_dmathaw(&(ic)->ic_dmastate)
    127 #define	isa_dmamem_alloc(ic, c, s, ap, f)				\
    128 	_isa_dmamem_alloc(&(ic)->ic_dmastate, (c), (s), (ap), (f))
    129 #define	isa_dmamem_free(ic, c, a, s)					\
    130 	_isa_dmamem_free(&(ic)->ic_dmastate, (c), (a), (s))
    131 #define	isa_dmamem_map(ic, c, a, s, kp, f)				\
    132 	_isa_dmamem_map(&(ic)->ic_dmastate, (c), (a), (s), (kp), (f))
    133 #define	isa_dmamem_unmap(ic, c, k, s)					\
    134 	_isa_dmamem_unmap(&(ic)->ic_dmastate, (c), (k), (s))
    135 #define	isa_dmamem_mmap(ic, c, a, s, o, p, f)				\
    136 	_isa_dmamem_mmap(&(ic)->ic_dmastate, (c), (a), (s), (o), (p), (f))
    137 #define	isa_drq_isfree(ic, c)						\
    138 	_isa_drq_isfree(&(ic)->ic_dmastate, (c))
    139 #define	isa_malloc(ic, c, s, p, f)					\
    140 	_isa_malloc(&(ic)->ic_dmastate, (c), (s), (p), (f))
    141 #define	isa_free(a, p)							\
    142 	_isa_free((a), (p))
    143 #define	isa_mappage(m, o, p)						\
    144 	_isa_mappage((m), (o), (p))
    145 
    146 #endif /* _ATARI_ISA_MACHDEP_H_ */
    147