1 /* $OpenBSD: eisa_machdep.h,v 1.8 2009/08/22 02:54:50 mk Exp $ */ 2 /* $NetBSD: eisa_machdep.h,v 1.1 1996/04/12 05:39:51 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 EISA code. 33 */ 34 typedef struct alpha_eisa_chipset *eisa_chipset_tag_t; 35 typedef int eisa_intr_handle_t; 36 37 struct alpha_eisa_chipset { 38 void *ec_v; 39 int ec_maxslots; 40 41 void (*ec_attach_hook)(struct device *, struct device *, 42 struct eisabus_attach_args *); 43 int (*ec_intr_map)(void *, u_int, 44 eisa_intr_handle_t *); 45 const char *(*ec_intr_string)(void *, eisa_intr_handle_t); 46 void *(*ec_intr_establish)(void *, eisa_intr_handle_t, 47 int, int, int (*)(void *), void *, const char *); 48 void (*ec_intr_disestablish)(void *, void *); 49 }; 50 51 /* 52 * Functions provided to machine-independent EISA code. 53 */ 54 #define eisa_attach_hook(p, s, a) \ 55 (*(a)->eba_ec->ec_attach_hook)((p), (s), (a)) 56 #define eisa_maxslots(c) \ 57 ((c)->ec_maxslots) 58 #define eisa_intr_map(c, i, hp) \ 59 (*(c)->ec_intr_map)((c)->ec_v, (i), (hp)) 60 #define eisa_intr_string(c, h) \ 61 (*(c)->ec_intr_string)((c)->ec_v, (h)) 62 #define eisa_intr_establish(c, h, t, l, f, a, nm) \ 63 (*(c)->ec_intr_establish)((c)->ec_v, (h), (t), (l), (f), (a), (nm)) 64 #define eisa_intr_disestablish(c, h) \ 65 (*(c)->ec_intr_disestablish)((c)->ec_v, (h)) 66 67 /* 68 * Internal functions, NOT TO BE USED BY MACHINE-INDEPENDENT CODE! 69 */ 70 71 void eisa_init(eisa_chipset_tag_t); 72