4 #include <linux/ioport.h>
6 typedef unsigned char intc_enum
;
13 #define INTC_VECT(enum_id, vect) { enum_id, vect }
14 #define INTC_IRQ(enum_id, irq) INTC_VECT(enum_id, irq2evt(irq))
18 intc_enum enum_ids
[32];
21 #define INTC_GROUP(enum_id, ids...) { enum_id, { ids } }
23 struct intc_mask_reg
{
24 unsigned long set_reg
, clr_reg
, reg_width
;
25 intc_enum enum_ids
[32];
26 #ifdef CONFIG_INTC_BALANCING
27 unsigned long dist_reg
;
34 struct intc_prio_reg
{
35 unsigned long set_reg
, clr_reg
, reg_width
, field_width
;
36 intc_enum enum_ids
[16];
42 struct intc_sense_reg
{
43 unsigned long reg
, reg_width
, field_width
;
44 intc_enum enum_ids
[16];
47 #ifdef CONFIG_INTC_BALANCING
48 #define INTC_SMP_BALANCING(reg) .dist_reg = (reg)
50 #define INTC_SMP_BALANCING(reg)
54 #define INTC_SMP(stride, nr) .smp = (stride) | ((nr) << 8)
56 #define INTC_SMP(stride, nr)
60 struct intc_vect
*vectors
;
61 unsigned int nr_vectors
;
62 struct intc_group
*groups
;
63 unsigned int nr_groups
;
64 struct intc_mask_reg
*mask_regs
;
65 unsigned int nr_mask_regs
;
66 struct intc_prio_reg
*prio_regs
;
67 unsigned int nr_prio_regs
;
68 struct intc_sense_reg
*sense_regs
;
69 unsigned int nr_sense_regs
;
70 struct intc_mask_reg
*ack_regs
;
71 unsigned int nr_ack_regs
;
74 #define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a)
75 #define INTC_HW_DESC(vectors, groups, mask_regs, \
76 prio_regs, sense_regs, ack_regs) \
78 _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \
79 _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \
80 _INTC_ARRAY(sense_regs), _INTC_ARRAY(ack_regs), \
85 struct resource
*resource
;
86 unsigned int num_resources
;
87 intc_enum force_enable
;
88 intc_enum force_disable
;
89 struct intc_hw_desc hw
;
92 #define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \
93 mask_regs, prio_regs, sense_regs) \
94 struct intc_desc symbol __initdata = { \
96 .hw = INTC_HW_DESC(vectors, groups, mask_regs, \
97 prio_regs, sense_regs, NULL), \
100 #define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \
101 mask_regs, prio_regs, sense_regs, ack_regs) \
102 struct intc_desc symbol __initdata = { \
104 .hw = INTC_HW_DESC(vectors, groups, mask_regs, \
105 prio_regs, sense_regs, ack_regs), \
108 int __init
register_intc_controller(struct intc_desc
*desc
);
109 int intc_set_priority(unsigned int irq
, unsigned int prio
);
111 #ifdef CONFIG_INTC_USERIMASK
112 int register_intc_userimask(unsigned long addr
);
114 static inline int register_intc_userimask(unsigned long addr
)
120 int reserve_irq_vector(unsigned int irq
);
121 void reserve_irq_legacy(void);
123 #endif /* __SH_INTC_H */