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