1/* $OpenBSD: pic.h,v 1.8 2024/01/19 18:38:16 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
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 int (*pic_allocidtvec)(struct pic *, 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
41extern struct pic i8259_pic;
42extern struct pic local_pic;
43extern struct pic msi_pic;
44extern struct pic softintr_pic;
45#endif