1/* $OpenBSD: pic.h,v 1.2 2014/12/16 21:40:05 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
10struct cpu_info;
11
12/*
13 * Structure common to all PIC softcs
14 */
15struct 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_SOFT 3
38
39extern struct pic i8259_pic;
40extern struct pic local_pic;
41extern struct pic softintr_pic;
42#endif