Home | History | Annotate | Line # | Download | only in include
      1 /*	$NetBSD: isa_machdep.h,v 1.2 2016/10/18 22:04:34 jdolecek Exp $	*/
      2 
      3 /*	$OpenBSD: isa_machdep.h,v 1.2 1999/05/05 02:36:54 todd Exp $	*/
      4 
      5 /*
      6  * Copyright (c) 1998-2004 Michael Shalayeff
      7  * All rights reserved.
      8  *
      9  * Redistribution and use in source and binary forms, with or without
     10  * modification, are permitted provided that the following conditions
     11  * are met:
     12  * 1. Redistributions of source code must retain the above copyright
     13  *    notice, this list of conditions and the following disclaimer.
     14  * 2. Redistributions in binary form must reproduce the above copyright
     15  *    notice, this list of conditions and the following disclaimer in the
     16  *    documentation and/or other materials provided with the distribution.
     17  *
     18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
     22  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     24  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     27  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     28  * THE POSSIBILITY OF SUCH DAMAGE.
     29  */
     30 
     31 #ifndef _ISA_MACHDEP_H_
     32 #define _ISA_MACHDEP_H_
     33 /*
     34  * Types provided to machine-independent ISA code.
     35  */
     36 typedef struct hppa_isa_chipset *isa_chipset_tag_t;
     37 
     38 struct hppa_isa_chipset {
     39 	void	*ic_v;
     40 
     41 	void	(*ic_attach_hook)(device_t, device_t,
     42 		    struct isabus_attach_args *);
     43 	void	*(*ic_intr_establish)(void *, int, int, int,
     44 		    int (*)(void *), void *);
     45 	void	(*ic_intr_disestablish)(void *, void *);
     46 	int	(*ic_intr_check)(void *, int, int);
     47 	void    (*ic_detach_hook)(isa_chipset_tag_t, device_t);
     48 };
     49 
     50 /*
     51  * Functions provided to machine-independent ISA code.
     52  */
     53 #define	isa_attach_hook(p, s, a)					\
     54     (*(a)->iba_ic->ic_attach_hook)((p), (s), (a))
     55 #define	isa_detach_hook(c, s)						\
     56     (*(c)->ic_detach_hook)((c), (s))
     57 #define	isa_intr_establish(c, i, t, l, f, a)			\
     58     (*(c)->ic_intr_establish)((c)->ic_v, (i), (t), (l), (f), (a))
     59 #define	isa_intr_establish_xname(c, i, t, l, f, a, x)			\
     60     (*(c)->ic_intr_establish)((c)->ic_v, (i), (t), (l), (f), (a))
     61 #define	isa_intr_disestablish(c, h)					\
     62     (*(c)->ic_intr_disestablish)((c)->ic_v, (h))
     63 #define isa_intr_check(c, i, t)						\
     64     (*(c)->ic_intr_check)((c)->ic_v, (i), (t))
     65 
     66 #endif /* _ISA_MACHDEP_H_ */
     67