@@ -31,6 +31,7 @@ extern u32 auto_irqhandler_fixup[];
3131extern u32 user_irqhandler_fixup [];
3232extern u16 user_irqvec_fixup [];
3333
34+ #ifndef CONFIG_GENERIC_HARDIRQS
3435/* table for system interrupt handlers */
3536static struct irq_data * irq_list [NR_IRQS ];
3637static struct irq_chip * irq_chip [NR_IRQS ];
@@ -41,6 +42,8 @@ static inline int irq_set_chip(unsigned int irq, struct irq_chip *chip)
4142 irq_chip [irq ] = chip ;
4243 return 0 ;
4344}
45+ #define irq_set_chip_and_handler (irq , chip , dummy ) irq_set_chip(irq, chip)
46+ #endif /* !CONFIG_GENERIC_HARDIRQS */
4447
4548static int m68k_first_user_vec ;
4649
@@ -56,8 +59,10 @@ static struct irq_chip user_irq_chip = {
5659 .irq_shutdown = m68k_irq_shutdown ,
5760};
5861
62+ #ifndef CONFIG_GENERIC_HARDIRQS
5963#define NUM_IRQ_NODES 100
6064static struct irq_data nodes [NUM_IRQ_NODES ];
65+ #endif /* !CONFIG_GENERIC_HARDIRQS */
6166
6267/*
6368 * void init_IRQ(void)
@@ -81,7 +86,7 @@ void __init init_IRQ(void)
8186 }
8287
8388 for (i = IRQ_AUTO_1 ; i <= IRQ_AUTO_7 ; i ++ )
84- irq_set_chip (i , & auto_irq_chip );
89+ irq_set_chip_and_handler (i , & auto_irq_chip , handle_simple_irq );
8590
8691 mach_init_IRQ ();
8792}
@@ -128,6 +133,35 @@ void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt,
128133 flush_icache ();
129134}
130135
136+ #ifdef CONFIG_GENERIC_HARDIRQS
137+
138+ /**
139+ * m68k_setup_irq_controller
140+ * @chip: irq chip which controls specified irq
141+ * @handle: flow handler which handles specified irq
142+ * @irq: first irq to be managed by the controller
143+ * @cnt: number of irqs to be managed by the controller
144+ *
145+ * Change the controller for the specified range of irq, which will be used to
146+ * manage these irq. auto/user irq already have a default controller, which can
147+ * be changed as well, but the controller probably should use m68k_irq_startup/
148+ * m68k_irq_shutdown.
149+ */
150+ void m68k_setup_irq_controller (struct irq_chip * chip ,
151+ irq_flow_handler_t handle , unsigned int irq ,
152+ unsigned int cnt )
153+ {
154+ int i ;
155+
156+ for (i = 0 ; i < cnt ; i ++ ) {
157+ irq_set_chip (irq + i , chip );
158+ if (handle )
159+ irq_set_handler (irq + i , handle );
160+ }
161+ }
162+
163+ #else /* !CONFIG_GENERIC_HARDIRQS */
164+
131165/**
132166 * m68k_setup_irq_chip
133167 * @contr: irq controller which controls specified irq
@@ -316,6 +350,8 @@ void disable_irq_nosync(unsigned int irq) __attribute__((alias("disable_irq")));
316350
317351EXPORT_SYMBOL (disable_irq_nosync );
318352
353+ #endif /* !CONFIG_GENERIC_HARDIRQS */
354+
319355unsigned int m68k_irq_startup_irq (unsigned int irq )
320356{
321357 if (irq <= IRQ_AUTO_7 )
@@ -341,6 +377,8 @@ void m68k_irq_shutdown(struct irq_data *data)
341377}
342378
343379
380+ #ifndef CONFIG_GENERIC_HARDIRQS
381+
344382/*
345383 * Do we need these probe functions on the m68k?
346384 *
@@ -367,6 +405,7 @@ int probe_irq_off (unsigned long irqs)
367405}
368406
369407EXPORT_SYMBOL (probe_irq_off );
408+ #endif /* CONFIG_GENERIC_HARDIRQS */
370409
371410unsigned int irq_canonicalize (unsigned int irq )
372411{
@@ -379,6 +418,7 @@ unsigned int irq_canonicalize(unsigned int irq)
379418
380419EXPORT_SYMBOL (irq_canonicalize );
381420
421+ #ifndef CONFIG_GENERIC_HARDIRQS
382422void generic_handle_irq (unsigned int irq )
383423{
384424 struct irq_data * node ;
@@ -428,3 +468,13 @@ void init_irq_proc(void)
428468 /* Insert /proc/irq driver here */
429469}
430470#endif
471+
472+ #else /* CONFIG_GENERIC_HARDIRQS */
473+
474+ asmlinkage void handle_badint (struct pt_regs * regs )
475+ {
476+ atomic_inc (& irq_err_count );
477+ pr_warn ("unexpected interrupt from %u\n" , regs -> vector );
478+ }
479+
480+ #endif /* CONFIG_GENERIC_HARDIRQS */
0 commit comments