isa_machdep.h revision 1.1
11.1Sthorpej/* $NetBSD: isa_machdep.h,v 1.1 2001/05/28 16:22:19 thorpej Exp $ */ 21.1Sthorpej 31.1Sthorpej/*- 41.1Sthorpej * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. 51.1Sthorpej * All rights reserved. 61.1Sthorpej * 71.1Sthorpej * This code is derived from software contributed to The NetBSD Foundation 81.1Sthorpej * by Jason R. Thorpe. 91.1Sthorpej * 101.1Sthorpej * Redistribution and use in source and binary forms, with or without 111.1Sthorpej * modification, are permitted provided that the following conditions 121.1Sthorpej * are met: 131.1Sthorpej * 1. Redistributions of source code must retain the above copyright 141.1Sthorpej * notice, this list of conditions and the following disclaimer. 151.1Sthorpej * 2. Redistributions in binary form must reproduce the above copyright 161.1Sthorpej * notice, this list of conditions and the following disclaimer in the 171.1Sthorpej * documentation and/or other materials provided with the distribution. 181.1Sthorpej * 3. All advertising materials mentioning features or use of this software 191.1Sthorpej * must display the following acknowledgement: 201.1Sthorpej * This product includes software developed by the NetBSD 211.1Sthorpej * Foundation, Inc. and its contributors. 221.1Sthorpej * 4. Neither the name of The NetBSD Foundation nor the names of its 231.1Sthorpej * contributors may be used to endorse or promote products derived 241.1Sthorpej * from this software without specific prior written permission. 251.1Sthorpej * 261.1Sthorpej * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 271.1Sthorpej * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 281.1Sthorpej * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 291.1Sthorpej * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 301.1Sthorpej * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 311.1Sthorpej * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 321.1Sthorpej * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 331.1Sthorpej * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 341.1Sthorpej * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 351.1Sthorpej * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 361.1Sthorpej * POSSIBILITY OF SUCH DAMAGE. 371.1Sthorpej */ 381.1Sthorpej 391.1Sthorpej/* 401.1Sthorpej * Copyright (c) 1996 Carnegie-Mellon University. 411.1Sthorpej * All rights reserved. 421.1Sthorpej * 431.1Sthorpej * Author: Chris G. Demetriou 441.1Sthorpej * 451.1Sthorpej * Permission to use, copy, modify and distribute this software and 461.1Sthorpej * its documentation is hereby granted, provided that both the copyright 471.1Sthorpej * notice and this permission notice appear in all copies of the 481.1Sthorpej * software, derivative works or modified versions, and any portions 491.1Sthorpej * thereof, and that both notices appear in supporting documentation. 501.1Sthorpej * 511.1Sthorpej * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 521.1Sthorpej * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 531.1Sthorpej * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 541.1Sthorpej * 551.1Sthorpej * Carnegie Mellon requests users of this software to return to 561.1Sthorpej * 571.1Sthorpej * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 581.1Sthorpej * School of Computer Science 591.1Sthorpej * Carnegie Mellon University 601.1Sthorpej * Pittsburgh PA 15213-3890 611.1Sthorpej * 621.1Sthorpej * any improvements or extensions that they make and grant Carnegie the 631.1Sthorpej * rights to redistribute these changes. 641.1Sthorpej */ 651.1Sthorpej 661.1Sthorpej#include <dev/isa/isadmavar.h> 671.1Sthorpej 681.1Sthorpej/* 691.1Sthorpej * Types provided to machine-independent ISA code. 701.1Sthorpej */ 711.1Sthorpejtypedef struct algor_isa_chipset *isa_chipset_tag_t; 721.1Sthorpej 731.1Sthorpejstruct algor_isa_chipset { 741.1Sthorpej void *ic_v; 751.1Sthorpej 761.1Sthorpej struct isa_dma_state ic_dmastate; 771.1Sthorpej 781.1Sthorpej void (*ic_attach_hook)(struct device *, struct device *, 791.1Sthorpej struct isabus_attach_args *); 801.1Sthorpej const struct evcnt *(*ic_intr_evcnt)(void *, int); 811.1Sthorpej void *(*ic_intr_establish)(void *, int, int, int, 821.1Sthorpej int (*)(void *), void *); 831.1Sthorpej void (*ic_intr_disestablish)(void *, void *); 841.1Sthorpej int (*ic_intr_alloc)(void *, int, int, int *); 851.1Sthorpej}; 861.1Sthorpej 871.1Sthorpej 881.1Sthorpej/* 891.1Sthorpej * Functions provided to machine-independent ISA code. 901.1Sthorpej */ 911.1Sthorpej#define isa_attach_hook(p, s, a) \ 921.1Sthorpej (*(a)->iba_ic->ic_attach_hook)((p), (s), (a)) 931.1Sthorpej#define isa_intr_evcnt(c, i) \ 941.1Sthorpej (*(c)->ic_intr_evcnt)((c)->ic_v, (i)) 951.1Sthorpej#define isa_intr_establish(c, i, t, l, f, a) \ 961.1Sthorpej (*(c)->ic_intr_establish)((c)->ic_v, (i), (t), (l), (f), (a)) 971.1Sthorpej#define isa_intr_disestablish(c, h) \ 981.1Sthorpej (*(c)->ic_intr_disestablish)((c)->ic_v, (h)) 991.1Sthorpej#define isa_intr_alloc(c, m, t, i) \ 1001.1Sthorpej (*(c)->ic_intr_alloc)((c)->ic_v, (m), (t), (i)) 1011.1Sthorpej 1021.1Sthorpej#define isa_dmainit(ic, bst, dmat, d) \ 1031.1Sthorpej _isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d)) 1041.1Sthorpej#define isa_dmacascade(ic, c) \ 1051.1Sthorpej _isa_dmacascade(&(ic)->ic_dmastate, (c)) 1061.1Sthorpej#define isa_dmamaxsize(ic, c) \ 1071.1Sthorpej _isa_dmamaxsize(&(ic)->ic_dmastate, (c)) 1081.1Sthorpej#define isa_dmamap_create(ic, c, s, f) \ 1091.1Sthorpej _isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f)) 1101.1Sthorpej#define isa_dmamap_destroy(ic, c) \ 1111.1Sthorpej _isa_dmamap_destroy(&(ic)->ic_dmastate, (c)) 1121.1Sthorpej#define isa_dmastart(ic, c, a, n, p, f, bf) \ 1131.1Sthorpej _isa_dmastart(&(ic)->ic_dmastate, (c), (a), (n), (p), (f), (bf)) 1141.1Sthorpej#define isa_dmaabort(ic, c) \ 1151.1Sthorpej _isa_dmaabort(&(ic)->ic_dmastate, (c)) 1161.1Sthorpej#define isa_dmacount(ic, c) \ 1171.1Sthorpej _isa_dmacount(&(ic)->ic_dmastate, (c)) 1181.1Sthorpej#define isa_dmafinished(ic, c) \ 1191.1Sthorpej _isa_dmafinished(&(ic)->ic_dmastate, (c)) 1201.1Sthorpej#define isa_dmadone(ic, c) \ 1211.1Sthorpej _isa_dmadone(&(ic)->ic_dmastate, (c)) 1221.1Sthorpej#define isa_dmafreeze(ic) \ 1231.1Sthorpej _isa_dmafreeze(&(ic)->ic_dmastate) 1241.1Sthorpej#define isa_dmathaw(ic) \ 1251.1Sthorpej _isa_dmathaw(&(ic)->ic_dmastate) 1261.1Sthorpej#define isa_dmamem_alloc(ic, c, s, ap, f) \ 1271.1Sthorpej _isa_dmamem_alloc(&(ic)->ic_dmastate, (c), (s), (ap), (f)) 1281.1Sthorpej#define isa_dmamem_free(ic, c, a, s) \ 1291.1Sthorpej _isa_dmamem_free(&(ic)->ic_dmastate, (c), (a), (s)) 1301.1Sthorpej#define isa_dmamem_map(ic, c, a, s, kp, f) \ 1311.1Sthorpej _isa_dmamem_map(&(ic)->ic_dmastate, (c), (a), (s), (kp), (f)) 1321.1Sthorpej#define isa_dmamem_unmap(ic, c, k, s) \ 1331.1Sthorpej _isa_dmamem_unmap(&(ic)->ic_dmastate, (c), (k), (s)) 1341.1Sthorpej#define isa_dmamem_mmap(ic, c, a, s, o, p, f) \ 1351.1Sthorpej _isa_dmamem_mmap(&(ic)->ic_dmastate, (c), (a), (s), (o), (p), (f)) 1361.1Sthorpej#define isa_drq_isfree(ic, c) \ 1371.1Sthorpej _isa_drq_isfree(&(ic)->ic_dmastate, (c)) 1381.1Sthorpej#define isa_malloc(ic, c, s, p, f) \ 1391.1Sthorpej _isa_malloc(&(ic)->ic_dmastate, (c), (s), (p), (f)) 1401.1Sthorpej#define isa_free(a, p) \ 1411.1Sthorpej _isa_free((a), (p)) 1421.1Sthorpej#define isa_mappage(m, o, p) \ 1431.1Sthorpej _isa_mappage((m), (o), (p)) 1441.1Sthorpej 1451.1Sthorpej/* 1461.1Sthorpej * algor-specific ISA functions. 1471.1Sthorpej * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE. 1481.1Sthorpej */ 1491.1Sthorpejint isa_display_console(bus_space_tag_t, bus_space_tag_t); 1501.1Sthorpejvoid isabeep(int, int); 1511.1Sthorpej 1521.1Sthorpej#ifdef _ALGOR_BUS_DMA_PRIVATE 1531.1Sthorpejint isadma_bounce_dmamap_create(bus_dma_tag_t, bus_size_t, int, 1541.1Sthorpej bus_size_t, bus_size_t, int, bus_dmamap_t *); 1551.1Sthorpejvoid isadma_bounce_dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); 1561.1Sthorpejint isadma_bounce_dmamap_load(bus_dma_tag_t, bus_dmamap_t, void *, 1571.1Sthorpej bus_size_t, struct proc *, int); 1581.1Sthorpejint isadma_bounce_dmamap_load_mbuf(bus_dma_tag_t, bus_dmamap_t, 1591.1Sthorpej struct mbuf *, int); 1601.1Sthorpejint isadma_bounce_dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t, 1611.1Sthorpej struct uio *, int); 1621.1Sthorpejint isadma_bounce_dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t, 1631.1Sthorpej bus_dma_segment_t *, int, bus_size_t, int); 1641.1Sthorpejvoid isadma_bounce_dmamap_unload(bus_dma_tag_t, bus_dmamap_t); 1651.1Sthorpejvoid isadma_bounce_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, 1661.1Sthorpej bus_addr_t, bus_size_t, int); 1671.1Sthorpej 1681.1Sthorpejint isadma_bounce_dmamem_alloc(bus_dma_tag_t, bus_size_t, bus_size_t, 1691.1Sthorpej bus_size_t, bus_dma_segment_t *, int, int *, int); 1701.1Sthorpej#endif /* _ALGOR_BUS_DMA_PRIVATE */ 171