Home | History | Annotate | Line # | Download | only in include
isa_machdep.h revision 1.5
      1 /* $NetBSD: isa_machdep.h,v 1.5 2000/06/01 00:04:50 cgd Exp $ */
      2 
      3 /*
      4  * Copyright (c) 1996 Carnegie-Mellon University.
      5  * All rights reserved.
      6  *
      7  * Author: Chris G. Demetriou
      8  *
      9  * Permission to use, copy, modify and distribute this software and
     10  * its documentation is hereby granted, provided that both the copyright
     11  * notice and this permission notice appear in all copies of the
     12  * software, derivative works or modified versions, and any portions
     13  * thereof, and that both notices appear in supporting documentation.
     14  *
     15  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     16  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     17  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     18  *
     19  * Carnegie Mellon requests users of this software to return to
     20  *
     21  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     22  *  School of Computer Science
     23  *  Carnegie Mellon University
     24  *  Pittsburgh PA 15213-3890
     25  *
     26  * any improvements or extensions that they make and grant Carnegie the
     27  * rights to redistribute these changes.
     28  */
     29 
     30 #include <dev/isa/isadmavar.h>
     31 
     32 /*
     33  * Types provided to machine-independent ISA code.
     34  */
     35 typedef struct alpha_isa_chipset *isa_chipset_tag_t;
     36 
     37 struct alpha_isa_chipset {
     38 	void	*ic_v;
     39 
     40 	struct isa_dma_state ic_dmastate;
     41 
     42 	void	(*ic_attach_hook)(struct device *, struct device *,
     43 		    struct isabus_attach_args *);
     44 	void	*(*ic_intr_establish)(void *, int, int, int,
     45 		    int (*)(void *), void *);
     46 	void	(*ic_intr_disestablish)(void *, void *);
     47 	int	(*ic_intr_alloc)(void *, int, int, int *);
     48 };
     49 
     50 
     51 /*
     52  * Functions provided to machine-independent ISA code.
     53  */
     54 #define	isa_attach_hook(p, s, a)					\
     55     (*(a)->iba_ic->ic_attach_hook)((p), (s), (a))
     56 #define	isa_intr_establish(c, i, t, l, f, a)				\
     57     (*(c)->ic_intr_establish)((c)->ic_v, (i), (t), (l), (f), (a))
     58 #define	isa_intr_disestablish(c, h)					\
     59     (*(c)->ic_intr_disestablish)((c)->ic_v, (h))
     60 #define	isa_intr_alloc(c, m, t, i)					\
     61     (*(c)->ic_intr_alloc)((c)->ic_v, (m), (t), (i))
     62 
     63 #define	isa_dmainit(ic, bst, dmat, d)					\
     64 	_isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d))
     65 #define	isa_dmacascade(ic, c)						\
     66 	_isa_dmacascade(&(ic)->ic_dmastate, (c))
     67 #define	isa_dmamaxsize(ic, c)						\
     68 	_isa_dmamaxsize(&(ic)->ic_dmastate, (c))
     69 #define	isa_dmamap_create(ic, c, s, f)					\
     70 	_isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f))
     71 #define	isa_dmamap_destroy(ic, c)					\
     72 	_isa_dmamap_destroy(&(ic)->ic_dmastate, (c))
     73 #define	isa_dmastart(ic, c, a, n, p, f, bf)				\
     74 	_isa_dmastart(&(ic)->ic_dmastate, (c), (a), (n), (p), (f), (bf))
     75 #define	isa_dmaabort(ic, c)						\
     76 	_isa_dmaabort(&(ic)->ic_dmastate, (c))
     77 #define	isa_dmacount(ic, c)						\
     78 	_isa_dmacount(&(ic)->ic_dmastate, (c))
     79 #define	isa_dmafinished(ic, c)						\
     80 	_isa_dmafinished(&(ic)->ic_dmastate, (c))
     81 #define	isa_dmadone(ic, c)						\
     82 	_isa_dmadone(&(ic)->ic_dmastate, (c))
     83 #define	isa_dmafreeze(ic)						\
     84 	_isa_dmafreeze(&(ic)->ic_dmastate)
     85 #define	isa_dmathaw(ic)							\
     86 	_isa_dmathaw(&(ic)->ic_dmastate)
     87 #define	isa_dmamem_alloc(ic, c, s, ap, f)				\
     88 	_isa_dmamem_alloc(&(ic)->ic_dmastate, (c), (s), (ap), (f))
     89 #define	isa_dmamem_free(ic, c, a, s)					\
     90 	_isa_dmamem_free(&(ic)->ic_dmastate, (c), (a), (s))
     91 #define	isa_dmamem_map(ic, c, a, s, kp, f)				\
     92 	_isa_dmamem_map(&(ic)->ic_dmastate, (c), (a), (s), (kp), (f))
     93 #define	isa_dmamem_unmap(ic, c, k, s)					\
     94 	_isa_dmamem_unmap(&(ic)->ic_dmastate, (c), (k), (s))
     95 #define	isa_dmamem_mmap(ic, c, a, s, o, p, f)				\
     96 	_isa_dmamem_mmap(&(ic)->ic_dmastate, (c), (a), (s), (o), (p), (f))
     97 #define	isa_drq_isfree(ic, c)						\
     98 	_isa_drq_isfree(&(ic)->ic_dmastate, (c))
     99 #define	isa_malloc(ic, c, s, p, f)					\
    100 	_isa_malloc(&(ic)->ic_dmastate, (c), (s), (p), (f))
    101 #define	isa_free(a, p)							\
    102 	_isa_free((a), (p))
    103 #define	isa_mappage(m, o, p)						\
    104 	_isa_mappage((m), (o), (p))
    105 
    106 /*
    107  * alpha-specific ISA functions.
    108  * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.
    109  */
    110 int isa_display_console(bus_space_tag_t, bus_space_tag_t);
    111 
    112 void isabeep(int, int);
    113