1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 **************************************************************************** 11 ****************************************************************************/ 12 #ifndef __ASM_SH_HW_IRQ_H 13 #define __ASM_SH_HW_IRQ_H 14 15 #include <linux/init.h> 16 #include <asm/atomic.h> 17 18 struct ipr_data { 19 unsigned char irq; 20 unsigned char ipr_idx; 21 unsigned char shift; 22 unsigned char priority; 23 }; 24 25 struct ipr_desc { 26 unsigned long *ipr_offsets; 27 unsigned int nr_offsets; 28 struct ipr_data *ipr_data; 29 unsigned int nr_irqs; 30 struct irq_chip chip; 31 }; 32 33 typedef unsigned char intc_enum; 34 35 struct intc_vect { 36 intc_enum enum_id; 37 unsigned short vect; 38 }; 39 40 #define INTC_VECT(enum_id, vect) { enum_id, vect } 41 #define INTC_IRQ(enum_id, irq) INTC_VECT(enum_id, irq2evt(irq)) 42 43 struct intc_group { 44 intc_enum enum_id; 45 intc_enum enum_ids[32]; 46 }; 47 48 #define INTC_GROUP(enum_id, ids...) { enum_id, { ids } } 49 50 struct intc_mask_reg { 51 unsigned long set_reg, clr_reg, reg_width; 52 intc_enum enum_ids[32]; 53 }; 54 55 struct intc_prio_reg { 56 unsigned long set_reg, clr_reg, reg_width, field_width; 57 intc_enum enum_ids[16]; 58 }; 59 60 struct intc_sense_reg { 61 unsigned long reg, reg_width, field_width; 62 intc_enum enum_ids[16]; 63 }; 64 65 #define INTC_SMP(stride, nr) 66 67 struct intc_desc { 68 struct intc_vect *vectors; 69 unsigned int nr_vectors; 70 struct intc_group *groups; 71 unsigned int nr_groups; 72 struct intc_mask_reg *mask_regs; 73 unsigned int nr_mask_regs; 74 struct intc_prio_reg *prio_regs; 75 unsigned int nr_prio_regs; 76 struct intc_sense_reg *sense_regs; 77 unsigned int nr_sense_regs; 78 char *name; 79 struct intc_mask_reg *ack_regs; 80 unsigned int nr_ack_regs; 81 }; 82 83 #define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) 84 #define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, mask_regs, prio_regs, sense_regs) struct intc_desc symbol __initdata = { _INTC_ARRAY(vectors), _INTC_ARRAY(groups), _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), _INTC_ARRAY(sense_regs), chipname, } 85 86 #define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, mask_regs, prio_regs, sense_regs, ack_regs) struct intc_desc symbol __initdata = { _INTC_ARRAY(vectors), _INTC_ARRAY(groups), _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), _INTC_ARRAY(sense_regs), chipname, _INTC_ARRAY(ack_regs), } 87 88 enum { IRQ_MODE_IRQ, IRQ_MODE_IRQ7654, IRQ_MODE_IRQ3210, 89 IRQ_MODE_IRL7654_MASK, IRQ_MODE_IRL3210_MASK, 90 IRQ_MODE_IRL7654, IRQ_MODE_IRL3210 }; 91 92 #endif 93