4 #include "exec/memory.h"
6 typedef unsigned char intc_enum
;
13 #define INTC_VECT(enum_id, vect) { enum_id, vect }
17 intc_enum enum_ids
[32];
20 #define INTC_GROUP(enum_id, ...) { enum_id, { __VA_ARGS__ } }
22 struct intc_mask_reg
{
23 unsigned long set_reg
, clr_reg
, reg_width
;
24 intc_enum enum_ids
[32];
28 struct intc_prio_reg
{
29 unsigned long set_reg
, clr_reg
, reg_width
, field_width
;
30 intc_enum enum_ids
[16];
34 #define _INTC_ARRAY(a) a, ARRAY_SIZE(a)
38 intc_enum next_enum_id
;
40 int asserted
; /* emulates the interrupt signal line from device to intc */
43 int pending
; /* emulates the result of signal and masking */
44 struct intc_desc
*parent
;
49 MemoryRegion
*iomem_aliases
;
51 struct intc_source
*sources
;
53 struct intc_mask_reg
*mask_regs
;
55 struct intc_prio_reg
*prio_regs
;
57 int pending
; /* number of interrupt sources that has pending set */
60 int sh_intc_get_pending_vector(struct intc_desc
*desc
, int imask
);
61 struct intc_source
*sh_intc_source(struct intc_desc
*desc
, intc_enum id
);
62 void sh_intc_toggle_source(struct intc_source
*source
,
63 int enable_adj
, int assert_adj
);
65 void sh_intc_register_sources(struct intc_desc
*desc
,
66 struct intc_vect
*vectors
,
68 struct intc_group
*groups
,
71 int sh_intc_init(MemoryRegion
*sysmem
,
72 struct intc_desc
*desc
,
74 struct intc_mask_reg
*mask_regs
,
76 struct intc_prio_reg
*prio_regs
,
79 void sh_intc_set_irl(void *opaque
, int n
, int level
);
81 #endif /* SH_INTC_H */