]>
git.proxmox.com Git - mirror_qemu.git/blob - hw/sh_intc.h
4 #include "qemu-common.h"
6 #include "exec-memory.h"
8 typedef unsigned char intc_enum
;
15 #define INTC_VECT(enum_id, vect) { enum_id, vect }
19 intc_enum enum_ids
[32];
22 #define INTC_GROUP(enum_id, ...) { enum_id, { __VA_ARGS__ } }
24 struct intc_mask_reg
{
25 unsigned long set_reg
, clr_reg
, reg_width
;
26 intc_enum enum_ids
[32];
30 struct intc_prio_reg
{
31 unsigned long set_reg
, clr_reg
, reg_width
, field_width
;
32 intc_enum enum_ids
[16];
36 #define _INTC_ARRAY(a) a, ARRAY_SIZE(a)
40 intc_enum next_enum_id
;
42 int asserted
; /* emulates the interrupt signal line from device to intc */
45 int pending
; /* emulates the result of signal and masking */
46 struct intc_desc
*parent
;
51 MemoryRegion
*iomem_aliases
;
53 struct intc_source
*sources
;
55 struct intc_mask_reg
*mask_regs
;
57 struct intc_prio_reg
*prio_regs
;
59 int pending
; /* number of interrupt sources that has pending set */
62 int sh_intc_get_pending_vector(struct intc_desc
*desc
, int imask
);
63 struct intc_source
*sh_intc_source(struct intc_desc
*desc
, intc_enum id
);
64 void sh_intc_toggle_source(struct intc_source
*source
,
65 int enable_adj
, int assert_adj
);
67 void sh_intc_register_sources(struct intc_desc
*desc
,
68 struct intc_vect
*vectors
,
70 struct intc_group
*groups
,
73 int sh_intc_init(MemoryRegion
*sysmem
,
74 struct intc_desc
*desc
,
76 struct intc_mask_reg
*mask_regs
,
78 struct intc_prio_reg
*prio_regs
,
81 void sh_intc_set_irl(void *opaque
, int n
, int level
);
83 #endif /* __SH_INTC_H__ */