4 #include "qemu-common.h"
7 typedef unsigned char intc_enum
;
14 #define INTC_VECT(enum_id, vect) { enum_id, vect }
18 intc_enum enum_ids
[32];
21 #define INTC_GROUP(enum_id, ...) { enum_id, { __VA_ARGS__ } }
23 struct intc_mask_reg
{
24 unsigned long set_reg
, clr_reg
, reg_width
;
25 intc_enum enum_ids
[32];
29 struct intc_prio_reg
{
30 unsigned long set_reg
, clr_reg
, reg_width
, field_width
;
31 intc_enum enum_ids
[16];
35 #define _INTC_ARRAY(a) a, ARRAY_SIZE(a)
39 intc_enum next_enum_id
;
41 int asserted
; /* emulates the interrupt signal line from device to intc */
44 int pending
; /* emulates the result of signal and masking */
45 struct intc_desc
*parent
;
50 MemoryRegion
*iomem_aliases
;
52 struct intc_source
*sources
;
54 struct intc_mask_reg
*mask_regs
;
56 struct intc_prio_reg
*prio_regs
;
58 int pending
; /* number of interrupt sources that has pending set */
61 int sh_intc_get_pending_vector(struct intc_desc
*desc
, int imask
);
62 struct intc_source
*sh_intc_source(struct intc_desc
*desc
, intc_enum id
);
63 void sh_intc_toggle_source(struct intc_source
*source
,
64 int enable_adj
, int assert_adj
);
66 void sh_intc_register_sources(struct intc_desc
*desc
,
67 struct intc_vect
*vectors
,
69 struct intc_group
*groups
,
72 int sh_intc_init(MemoryRegion
*sysmem
,
73 struct intc_desc
*desc
,
75 struct intc_mask_reg
*mask_regs
,
77 struct intc_prio_reg
*prio_regs
,
80 void sh_intc_set_irl(void *opaque
, int n
, int level
);
82 #endif /* SH_INTC_H */