2 * linux/arch/m68k/sun3/sun3ints.c -- Sun-3(x) Linux interrupt handling code
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive
9 #include <linux/types.h>
10 #include <linux/kernel.h>
11 #include <linux/sched.h>
12 #include <linux/kernel_stat.h>
13 #include <linux/interrupt.h>
14 #include <asm/segment.h>
15 #include <asm/intersil.h>
16 #include <asm/oplib.h>
17 #include <asm/sun3ints.h>
18 #include <asm/irq_regs.h>
19 #include <linux/seq_file.h>
21 extern void sun3_leds (unsigned char);
23 void sun3_disable_interrupts(void)
28 void sun3_enable_interrupts(void)
33 static int led_pattern
[8] = {
40 volatile unsigned char* sun3_intreg
;
42 void sun3_enable_irq(unsigned int irq
)
44 *sun3_intreg
|= (1 << irq
);
47 void sun3_disable_irq(unsigned int irq
)
49 *sun3_intreg
&= ~(1 << irq
);
52 static irqreturn_t
sun3_int7(int irq
, void *dev_id
)
56 cnt
= kstat_irqs_cpu(irq
, 0);
58 sun3_leds(led_pattern
[cnt
% 16000 / 2000]);
62 static irqreturn_t
sun3_int5(int irq
, void *dev_id
)
73 update_process_times(user_mode(get_irq_regs()));
74 cnt
= kstat_irqs_cpu(irq
, 0);
76 sun3_leds(led_pattern
[cnt
% 160 / 20]);
80 static irqreturn_t
sun3_vec255(int irq
, void *dev_id
)
86 static void sun3_irq_enable(struct irq_data
*data
)
88 sun3_enable_irq(data
->irq
);
91 static void sun3_irq_disable(struct irq_data
*data
)
93 sun3_disable_irq(data
->irq
);
96 static struct irq_chip sun3_irq_chip
= {
98 .irq_startup
= m68k_irq_startup
,
99 .irq_shutdown
= m68k_irq_shutdown
,
100 .irq_enable
= sun3_irq_enable
,
101 .irq_disable
= sun3_irq_disable
,
102 .irq_mask
= sun3_irq_disable
,
103 .irq_unmask
= sun3_irq_enable
,
106 void __init
sun3_init_IRQ(void)
110 m68k_setup_irq_controller(&sun3_irq_chip
, handle_level_irq
, IRQ_AUTO_1
,
112 m68k_setup_user_interrupt(VEC_USER
, 128);
114 if (request_irq(IRQ_AUTO_5
, sun3_int5
, 0, "int5", NULL
))
115 pr_err("Couldn't register %s interrupt\n", "int5");
116 if (request_irq(IRQ_AUTO_7
, sun3_int7
, 0, "int7", NULL
))
117 pr_err("Couldn't register %s interrupt\n", "int7");
118 if (request_irq(IRQ_USER
+127, sun3_vec255
, 0, "vec255", NULL
))
119 pr_err("Couldn't register %s interrupt\n", "vec255");