Home | History | Annotate | Line # | Download | only in include
isa_machdep.h revision 1.8.108.1
      1  1.8.108.1     yamt /* $NetBSD: isa_machdep.h,v 1.8.108.1 2008/05/16 02:21:45 yamt Exp $ */
      2        1.6  thorpej 
      3        1.6  thorpej /*-
      4        1.6  thorpej  * Copyright (c) 2000 The NetBSD Foundation, Inc.
      5        1.6  thorpej  * All rights reserved.
      6        1.6  thorpej  *
      7        1.6  thorpej  * This code is derived from software contributed to The NetBSD Foundation
      8        1.6  thorpej  * by Jason R. Thorpe.
      9        1.6  thorpej  *
     10        1.6  thorpej  * Redistribution and use in source and binary forms, with or without
     11        1.6  thorpej  * modification, are permitted provided that the following conditions
     12        1.6  thorpej  * are met:
     13        1.6  thorpej  * 1. Redistributions of source code must retain the above copyright
     14        1.6  thorpej  *    notice, this list of conditions and the following disclaimer.
     15        1.6  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     16        1.6  thorpej  *    notice, this list of conditions and the following disclaimer in the
     17        1.6  thorpej  *    documentation and/or other materials provided with the distribution.
     18        1.6  thorpej  *
     19        1.6  thorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20        1.6  thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21        1.6  thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22        1.6  thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23        1.6  thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24        1.6  thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25        1.6  thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26        1.6  thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27        1.6  thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28        1.6  thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29        1.6  thorpej  * POSSIBILITY OF SUCH DAMAGE.
     30        1.6  thorpej  */
     31        1.1      cgd 
     32        1.1      cgd /*
     33        1.3      cgd  * Copyright (c) 1996 Carnegie-Mellon University.
     34        1.1      cgd  * All rights reserved.
     35        1.1      cgd  *
     36        1.1      cgd  * Author: Chris G. Demetriou
     37        1.1      cgd  *
     38        1.1      cgd  * Permission to use, copy, modify and distribute this software and
     39        1.1      cgd  * its documentation is hereby granted, provided that both the copyright
     40        1.1      cgd  * notice and this permission notice appear in all copies of the
     41        1.1      cgd  * software, derivative works or modified versions, and any portions
     42        1.1      cgd  * thereof, and that both notices appear in supporting documentation.
     43        1.1      cgd  *
     44        1.1      cgd  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     45        1.1      cgd  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     46        1.1      cgd  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     47        1.1      cgd  *
     48        1.1      cgd  * Carnegie Mellon requests users of this software to return to
     49        1.1      cgd  *
     50        1.1      cgd  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     51        1.1      cgd  *  School of Computer Science
     52        1.1      cgd  *  Carnegie Mellon University
     53        1.1      cgd  *  Pittsburgh PA 15213-3890
     54        1.1      cgd  *
     55        1.1      cgd  * any improvements or extensions that they make and grant Carnegie the
     56        1.1      cgd  * rights to redistribute these changes.
     57        1.1      cgd  */
     58        1.1      cgd 
     59        1.3      cgd #include <dev/isa/isadmavar.h>
     60        1.3      cgd 
     61        1.3      cgd /*
     62        1.3      cgd  * Types provided to machine-independent ISA code.
     63        1.3      cgd  */
     64        1.3      cgd typedef struct alpha_isa_chipset *isa_chipset_tag_t;
     65        1.3      cgd 
     66        1.3      cgd struct alpha_isa_chipset {
     67        1.3      cgd 	void	*ic_v;
     68        1.3      cgd 
     69        1.3      cgd 	struct isa_dma_state ic_dmastate;
     70        1.3      cgd 
     71        1.5      cgd 	void	(*ic_attach_hook)(struct device *, struct device *,
     72        1.5      cgd 		    struct isabus_attach_args *);
     73        1.7      cgd 	const struct evcnt *(*ic_intr_evcnt)(void *, int);
     74        1.5      cgd 	void	*(*ic_intr_establish)(void *, int, int, int,
     75        1.5      cgd 		    int (*)(void *), void *);
     76        1.5      cgd 	void	(*ic_intr_disestablish)(void *, void *);
     77        1.5      cgd 	int	(*ic_intr_alloc)(void *, int, int, int *);
     78        1.3      cgd };
     79        1.3      cgd 
     80        1.3      cgd 
     81        1.3      cgd /*
     82        1.3      cgd  * Functions provided to machine-independent ISA code.
     83        1.3      cgd  */
     84        1.3      cgd #define	isa_attach_hook(p, s, a)					\
     85        1.3      cgd     (*(a)->iba_ic->ic_attach_hook)((p), (s), (a))
     86        1.7      cgd #define	isa_intr_evcnt(c, i)					\
     87        1.7      cgd     (*(c)->ic_intr_evcnt)((c)->ic_v, (i))
     88        1.3      cgd #define	isa_intr_establish(c, i, t, l, f, a)				\
     89        1.3      cgd     (*(c)->ic_intr_establish)((c)->ic_v, (i), (t), (l), (f), (a))
     90        1.3      cgd #define	isa_intr_disestablish(c, h)					\
     91        1.3      cgd     (*(c)->ic_intr_disestablish)((c)->ic_v, (h))
     92        1.3      cgd #define	isa_intr_alloc(c, m, t, i)					\
     93        1.3      cgd     (*(c)->ic_intr_alloc)((c)->ic_v, (m), (t), (i))
     94        1.3      cgd 
     95        1.3      cgd #define	isa_dmainit(ic, bst, dmat, d)					\
     96        1.3      cgd 	_isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d))
     97        1.3      cgd #define	isa_dmacascade(ic, c)						\
     98        1.3      cgd 	_isa_dmacascade(&(ic)->ic_dmastate, (c))
     99        1.4  thorpej #define	isa_dmamaxsize(ic, c)						\
    100        1.4  thorpej 	_isa_dmamaxsize(&(ic)->ic_dmastate, (c))
    101        1.3      cgd #define	isa_dmamap_create(ic, c, s, f)					\
    102        1.3      cgd 	_isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f))
    103        1.3      cgd #define	isa_dmamap_destroy(ic, c)					\
    104        1.3      cgd 	_isa_dmamap_destroy(&(ic)->ic_dmastate, (c))
    105        1.3      cgd #define	isa_dmastart(ic, c, a, n, p, f, bf)				\
    106        1.3      cgd 	_isa_dmastart(&(ic)->ic_dmastate, (c), (a), (n), (p), (f), (bf))
    107        1.3      cgd #define	isa_dmaabort(ic, c)						\
    108        1.3      cgd 	_isa_dmaabort(&(ic)->ic_dmastate, (c))
    109        1.3      cgd #define	isa_dmacount(ic, c)						\
    110        1.3      cgd 	_isa_dmacount(&(ic)->ic_dmastate, (c))
    111        1.3      cgd #define	isa_dmafinished(ic, c)						\
    112        1.3      cgd 	_isa_dmafinished(&(ic)->ic_dmastate, (c))
    113        1.3      cgd #define	isa_dmadone(ic, c)						\
    114        1.3      cgd 	_isa_dmadone(&(ic)->ic_dmastate, (c))
    115        1.3      cgd #define	isa_dmafreeze(ic)						\
    116        1.3      cgd 	_isa_dmafreeze(&(ic)->ic_dmastate)
    117        1.3      cgd #define	isa_dmathaw(ic)							\
    118        1.3      cgd 	_isa_dmathaw(&(ic)->ic_dmastate)
    119        1.3      cgd #define	isa_dmamem_alloc(ic, c, s, ap, f)				\
    120        1.3      cgd 	_isa_dmamem_alloc(&(ic)->ic_dmastate, (c), (s), (ap), (f))
    121        1.3      cgd #define	isa_dmamem_free(ic, c, a, s)					\
    122        1.3      cgd 	_isa_dmamem_free(&(ic)->ic_dmastate, (c), (a), (s))
    123        1.3      cgd #define	isa_dmamem_map(ic, c, a, s, kp, f)				\
    124        1.3      cgd 	_isa_dmamem_map(&(ic)->ic_dmastate, (c), (a), (s), (kp), (f))
    125        1.3      cgd #define	isa_dmamem_unmap(ic, c, k, s)					\
    126        1.3      cgd 	_isa_dmamem_unmap(&(ic)->ic_dmastate, (c), (k), (s))
    127        1.3      cgd #define	isa_dmamem_mmap(ic, c, a, s, o, p, f)				\
    128        1.3      cgd 	_isa_dmamem_mmap(&(ic)->ic_dmastate, (c), (a), (s), (o), (p), (f))
    129        1.8     fvdl #define isa_drq_alloc(ic, c)						\
    130        1.8     fvdl 	_isa_drq_alloc(&(ic)->ic_dmastate, c)
    131        1.8     fvdl #define isa_drq_free(ic, c)						\
    132        1.8     fvdl 	_isa_drq_free(&(ic)->ic_dmastate, c)
    133        1.3      cgd #define	isa_drq_isfree(ic, c)						\
    134        1.3      cgd 	_isa_drq_isfree(&(ic)->ic_dmastate, (c))
    135        1.3      cgd #define	isa_malloc(ic, c, s, p, f)					\
    136        1.3      cgd 	_isa_malloc(&(ic)->ic_dmastate, (c), (s), (p), (f))
    137        1.3      cgd #define	isa_free(a, p)							\
    138        1.3      cgd 	_isa_free((a), (p))
    139        1.3      cgd #define	isa_mappage(m, o, p)						\
    140        1.3      cgd 	_isa_mappage((m), (o), (p))
    141        1.3      cgd 
    142        1.3      cgd /*
    143        1.3      cgd  * alpha-specific ISA functions.
    144        1.3      cgd  * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.
    145        1.3      cgd  */
    146        1.6  thorpej int	isa_display_console(bus_space_tag_t, bus_space_tag_t);
    147        1.6  thorpej void	isabeep(int, int);
    148        1.3      cgd 
    149        1.6  thorpej #ifdef _ALPHA_BUS_DMA_PRIVATE
    150        1.6  thorpej int	isadma_bounce_dmamap_create(bus_dma_tag_t, bus_size_t, int,
    151        1.6  thorpej 	    bus_size_t, bus_size_t, int, bus_dmamap_t *);
    152        1.6  thorpej void	isadma_bounce_dmamap_destroy(bus_dma_tag_t, bus_dmamap_t);
    153        1.6  thorpej int	isadma_bounce_dmamap_load(bus_dma_tag_t, bus_dmamap_t, void *,
    154        1.6  thorpej 	    bus_size_t, struct proc *, int);
    155        1.6  thorpej int	isadma_bounce_dmamap_load_mbuf(bus_dma_tag_t, bus_dmamap_t,
    156        1.6  thorpej 	    struct mbuf *, int);
    157        1.6  thorpej int	isadma_bounce_dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t,
    158        1.6  thorpej 	    struct uio *, int);
    159        1.6  thorpej int	isadma_bounce_dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t,
    160        1.6  thorpej 	    bus_dma_segment_t *, int, bus_size_t, int);
    161        1.6  thorpej void	isadma_bounce_dmamap_unload(bus_dma_tag_t, bus_dmamap_t);
    162        1.6  thorpej void	isadma_bounce_dmamap_sync(bus_dma_tag_t, bus_dmamap_t,
    163        1.6  thorpej 	    bus_addr_t, bus_size_t, int);
    164        1.6  thorpej 
    165        1.6  thorpej int	isadma_bounce_dmamem_alloc(bus_dma_tag_t, bus_size_t, bus_size_t,
    166        1.6  thorpej 	    bus_size_t, bus_dma_segment_t *, int, int *, int);
    167        1.6  thorpej #endif /* _ALPHA_BUS_DMA_PRIVATE */
    168