xref: /openbsd/sys/arch/amd64/include/pic.h (revision 73471bf0)
1 /*	$OpenBSD: pic.h,v 1.7 2014/12/16 21:20:23 tedu 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 
10 struct cpu_info;
11 
12 /*
13  * Structure common to all PIC softcs
14  */
15 struct pic {
16 	struct device pic_dev;
17         int pic_type;
18 #ifdef MULTIPROCESSOR
19 	struct mutex pic_mutex;
20 #endif
21         void (*pic_hwmask)(struct pic *, int);
22         void (*pic_hwunmask)(struct pic *, int);
23 	void (*pic_addroute)(struct pic *, struct cpu_info *, int, int, int);
24 	void (*pic_delroute)(struct pic *, struct cpu_info *, int, int, int);
25 	struct intrstub *pic_level_stubs;
26 	struct intrstub *pic_edge_stubs;
27 };
28 
29 #define pic_name pic_dev.dv_xname
30 
31 /*
32  * PIC types.
33  */
34 #define PIC_I8259	0
35 #define PIC_IOAPIC	1
36 #define PIC_LAPIC	2
37 #define PIC_MSI		3
38 #define PIC_SOFT	4
39 
40 extern struct pic i8259_pic;
41 extern struct pic local_pic;
42 extern struct pic msi_pic;
43 extern struct pic softintr_pic;
44 #endif
45