xref: /openbmc/qemu/include/hw/intc/m68k_irqc.h (revision e3ae2bbf)
1 /*
2  * SPDX-License-Identifier: GPL-2.0-or-later
3  *
4  * QEMU Motorola 680x0 IRQ Controller
5  *
6  * (c) 2020 Laurent Vivier <laurent@vivier.eu>
7  *
8  */
9 
10 #ifndef M68K_IRQC_H
11 #define M68K_IRQC_H
12 
13 #include "hw/sysbus.h"
14 
15 #define TYPE_M68K_IRQC "m68k-irq-controller"
16 #define M68K_IRQC(obj) OBJECT_CHECK(M68KIRQCState, (obj), \
17                                     TYPE_M68K_IRQC)
18 
19 #define M68K_IRQC_AUTOVECTOR_BASE 25
20 
21 enum {
22     M68K_IRQC_LEVEL_1 = 0,
23     M68K_IRQC_LEVEL_2,
24     M68K_IRQC_LEVEL_3,
25     M68K_IRQC_LEVEL_4,
26     M68K_IRQC_LEVEL_5,
27     M68K_IRQC_LEVEL_6,
28     M68K_IRQC_LEVEL_7,
29 };
30 #define M68K_IRQC_LEVEL_NUM (M68K_IRQC_LEVEL_7 - M68K_IRQC_LEVEL_1 + 1)
31 
32 typedef struct M68KIRQCState {
33     SysBusDevice parent_obj;
34 
35     uint8_t ipr;
36 
37     /* statistics */
38     uint64_t stats_irq_count[M68K_IRQC_LEVEL_NUM];
39 } M68KIRQCState;
40 
41 #endif
42