1 1.10 bouyer /* $NetBSD: pic.h,v 1.10 2020/04/25 15:26:18 bouyer Exp $ */ 2 1.1 fvdl 3 1.1 fvdl #ifndef _X86_PIC_H 4 1.1 fvdl #define _X86_PIC_H 5 1.1 fvdl 6 1.1 fvdl struct cpu_info; 7 1.1 fvdl 8 1.1 fvdl /* 9 1.1 fvdl * Structure common to all PIC softcs 10 1.1 fvdl */ 11 1.1 fvdl struct pic { 12 1.5 drochner const char *pic_name; 13 1.5 drochner int pic_type; 14 1.2 christos int pic_vecbase; 15 1.2 christos int pic_apicid; 16 1.1 fvdl __cpu_simple_lock_t pic_lock; 17 1.5 drochner void (*pic_hwmask)(struct pic *, int); 18 1.5 drochner void (*pic_hwunmask)(struct pic *, int); 19 1.1 fvdl void (*pic_addroute)(struct pic *, struct cpu_info *, int, int, int); 20 1.1 fvdl void (*pic_delroute)(struct pic *, struct cpu_info *, int, int, int); 21 1.7 ad bool (*pic_trymask)(struct pic *, int); 22 1.1 fvdl struct intrstub *pic_level_stubs; 23 1.1 fvdl struct intrstub *pic_edge_stubs; 24 1.5 drochner struct ioapic_softc *pic_ioapic; /* if pic_type == PIC_IOAPIC */ 25 1.8 knakahar struct msipic *pic_msipic; /* if (pic_type == PIC_MSI) || (pic_type == PIC_MSIX) */ 26 1.10 bouyer /* interface for subr_interrupt.c */ 27 1.10 bouyer void (*pic_intr_get_devname)(const char *, char *, size_t); 28 1.10 bouyer void (*pic_intr_get_assigned)(const char *, kcpuset_t *); 29 1.10 bouyer uint64_t (*pic_intr_get_count)(const char *, u_int); 30 1.1 fvdl }; 31 1.1 fvdl 32 1.1 fvdl /* 33 1.1 fvdl * PIC types. 34 1.1 fvdl */ 35 1.1 fvdl #define PIC_I8259 0 36 1.1 fvdl #define PIC_IOAPIC 1 37 1.1 fvdl #define PIC_LAPIC 2 38 1.8 knakahar #define PIC_MSI 3 39 1.8 knakahar #define PIC_MSIX 4 40 1.8 knakahar #define PIC_SOFT 5 41 1.9 cherry #define PIC_XEN 6 42 1.1 fvdl 43 1.1 fvdl extern struct pic i8259_pic; 44 1.1 fvdl extern struct pic local_pic; 45 1.1 fvdl extern struct pic softintr_pic; 46 1.9 cherry extern struct pic xen_pic; 47 1.1 fvdl #endif 48