From: Fabio G. <fg...@ti...> - 2002-04-11 08:57:19
|
Hi, Sirs This is my hamletic question. My board has a companion chip (CC) with its own interrupt enabel registers and its own interrutp status register. When someting wired to my CC generates an interupt request the CC generate an interrupt on IQR0 on my sh7709a. So I have to handle the IQR0 request choosing the rigth handler according to the exact source (keyboad, mouse, timer etc). In linux Sh if I understand good there are two ways to solve this problem: 1) using the IRQ0 handler writing an static struct irqaction irq0 = { CC_interrupt, SA_INTERRUPT, 0, "CC", NULL, NULL}; . . . setup_irq(CONFIG_ISP0110_IRQ, &irq0); . . . where CC_interrupt in the iterrupt handler of IRQ0 and inside this fuction I examine the correct source and I do the rigth thing for the exact interrupt source. 2) implementing a dedicated interrupt handler with a demux function. So i have to write: - static struct hw_interrupt_type CC_irq_type = { "CC-IRQ", startup_CC_irq, shutdown_CC_irq, enable_CC_irq, disable_CC_irq, mask_CC_isp0110, end_CC_irq }; - all these functions - for (i = CC_IRQ_BASE; i < CC_IRQ_BASE + 16; i++) { irq_desc[i].handler = &CC_irq_type; } - static struct irqaction irq_src_1 = { irq_src_1_interrupt, SA_INTERRUPT, 0, "SOURCE 1", NULL, NULL}; - static struct irqaction irq_src_2 = { irq_src_2_interrupt, SA_INTERRUPT, 0, "SOURCE 2", NULL, NULL}; and so on for all my external sources - all the functions irq_src_1_interrupt,irq_src_2_interrupt,... Correct? But here my doubts: 1) which way is the best according to performance; 2) which way is the best according to elegance of solution on the linux kernel; 3) what are the unwished effect of solution n.1 and solution .2 Thanks a lot for your support. |