1 /* $OpenBSD: isa_machdep.h,v 1.15 2015/08/15 19:15:18 miod Exp $ */ 2 /* $NetBSD: isa_machdep.h,v 1.3 1996/11/19 04:53:07 cgd Exp $ */ 3 4 /* 5 * Copyright (c) 1996 Carnegie-Mellon University. 6 * All rights reserved. 7 * 8 * Author: Chris G. Demetriou 9 * 10 * Permission to use, copy, modify and distribute this software and 11 * its documentation is hereby granted, provided that both the copyright 12 * notice and this permission notice appear in all copies of the 13 * software, derivative works or modified versions, and any portions 14 * thereof, and that both notices appear in supporting documentation. 15 * 16 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 17 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 18 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 19 * 20 * Carnegie Mellon requests users of this software to return to 21 * 22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 23 * School of Computer Science 24 * Carnegie Mellon University 25 * Pittsburgh PA 15213-3890 26 * 27 * any improvements or extensions that they make and grant Carnegie the 28 * rights to redistribute these changes. 29 */ 30 31 /* 32 * Types provided to machine-independent ISA code. 33 */ 34 typedef struct alpha_isa_chipset *isa_chipset_tag_t; 35 36 struct alpha_isa_chipset { 37 void *ic_v; 38 39 void (*ic_attach_hook)(struct device *, struct device *, 40 struct isabus_attach_args *); 41 void *(*ic_intr_establish)(void *, int, int, int, 42 int (*)(void *), void *, const char *); 43 void (*ic_intr_disestablish)(void *, void *); 44 int (*ic_intr_alloc)(isa_chipset_tag_t, int, int, int *); 45 int (*ic_intr_check)(isa_chipset_tag_t, int, int); 46 }; 47 48 /* 49 * Functions provided to machine-independent ISA code. 50 */ 51 #define isa_attach_hook(p, s, a) \ 52 (*(a)->iba_ic->ic_attach_hook)((p), (s), (a)) 53 #define isa_intr_establish(c, i, t, l, f, a, nm) \ 54 (*(c)->ic_intr_establish)((c)->ic_v, (i), (t), (l), (f), (a), (nm)) 55 #define isa_intr_disestablish(c, h) \ 56 (*(c)->ic_intr_disestablish)((c)->ic_v, (h)) 57 #define isa_intr_alloc(c, m, t, i) \ 58 (*(c)->ic_intr_alloc)((c)->ic_v, (m), (t), (i)) 59 #define isa_intr_check(c, i, t) \ 60 (*(c)->ic_intr_check)((c)->ic_v, (i), (t)) 61 62 /* 63 * alpha-specific ISA functions. 64 * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE. 65 */ 66 int isa_display_console(bus_space_tag_t, bus_space_tag_t); 67 68 #ifdef _ALPHA_BUS_DMA_PRIVATE 69 int isadma_bounce_dmamap_create(bus_dma_tag_t, bus_size_t, int, 70 bus_size_t, bus_size_t, int, bus_dmamap_t *); 71 void isadma_bounce_dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); 72 int isadma_bounce_dmamap_load(bus_dma_tag_t, bus_dmamap_t, void *, 73 bus_size_t, struct proc *, int); 74 int isadma_bounce_dmamap_load_mbuf(bus_dma_tag_t, bus_dmamap_t, 75 struct mbuf *, int); 76 int isadma_bounce_dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t, 77 struct uio *, int); 78 int isadma_bounce_dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t, 79 bus_dma_segment_t *, int, bus_size_t, int); 80 void isadma_bounce_dmamap_unload(bus_dma_tag_t, bus_dmamap_t); 81 void isadma_bounce_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t, 82 bus_size_t, int); 83 int isadma_bounce_dmamem_alloc(bus_dma_tag_t, bus_size_t, bus_size_t, 84 bus_size_t, bus_dma_segment_t *, int, int *, int); 85 #endif /* _ALPHA_BUS_DMA_PRIVATE */ 86