xref: /openbsd-src/sys/arch/loongson/include/isa_machdep.h (revision d57a735de47d85360a79381cc34c0aef76964930)
1 /*	$OpenBSD: isa_machdep.h,v 1.2 2010/05/08 21:59:56 miod Exp $	*/
2 
3 /*
4  * Copyright (c) 2007 Miodrag Vallat.
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice, this permission notice, and the disclaimer below
9  * appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef	_MACHINE_ISA_MACHDEP_H_
21 #define	_MACHINE_ISA_MACHDEP_H_
22 
23 #include <machine/bus.h>
24 
25 #define	__NO_ISA_INTR_CHECK
26 
27 typedef	struct mips_isa_chipset *isa_chipset_tag_t;
28 
29 struct mips_isa_chipset {
30 	void	*ic_v;
31 
32 	void	(*ic_attach_hook)(struct device *, struct device *,
33 		    struct isabus_attach_args *);
34 	void	*(*ic_intr_establish)(void *, int, int, int, int (*)(void *),
35 		    void *, char *);
36 	void	(*ic_intr_disestablish)(void *, void *);
37 };
38 
39 #define	isa_attach_hook(p, s, iba)					\
40     (*(iba)->iba_ic->ic_attach_hook)((p), (s), (iba))
41 #define	isa_intr_establish(c, i, t, l, f, a, n)				\
42     (*(c)->ic_intr_establish)((c)->ic_v, (i), (t), (l), (f), (a), (n))
43 #define	isa_intr_disestablish(c, h)					\
44     (*(c)->ic_intr_disestablish)((c)->ic_v, (h))
45 
46 void	loongson_generic_isa_attach_hook(struct device *, struct device *,
47 	    struct isabus_attach_args *);
48 void	loongson_isa_specific_eoi(int);
49 void	loongson_set_isa_imr(uint);
50 
51 #endif
52