xref: /openbsd/sys/arch/amd64/include/pic.h (revision 8932bfb7)
1 /*	$OpenBSD: pic.h,v 1.6 2011/05/21 15:58:27 kettenis Exp $	*/
2 /*	$NetBSD: pic.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $	*/
3 
4 #ifndef _X86_PIC_H
5 #define _X86_PIC_H
6 
7 #include <sys/device.h>
8 #include <sys/mutex.h>
9 #include <sys/lock.h>
10 
11 struct cpu_info;
12 
13 /*
14  * Structure common to all PIC softcs
15  */
16 struct pic {
17 	struct device pic_dev;
18         int pic_type;
19 #ifdef MULTIPROCESSOR
20 	struct mutex pic_mutex;
21 #endif
22         void (*pic_hwmask)(struct pic *, int);
23         void (*pic_hwunmask)(struct pic *, int);
24 	void (*pic_addroute)(struct pic *, struct cpu_info *, int, int, int);
25 	void (*pic_delroute)(struct pic *, struct cpu_info *, int, int, int);
26 	struct intrstub *pic_level_stubs;
27 	struct intrstub *pic_edge_stubs;
28 };
29 
30 #define pic_name pic_dev.dv_xname
31 
32 /*
33  * PIC types.
34  */
35 #define PIC_I8259	0
36 #define PIC_IOAPIC	1
37 #define PIC_LAPIC	2
38 #define PIC_MSI		3
39 #define PIC_SOFT	4
40 
41 extern struct pic i8259_pic;
42 extern struct pic local_pic;
43 extern struct pic msi_pic;
44 extern struct pic softintr_pic;
45 #endif
46