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