diff options
Diffstat (limited to 'arch/m68k/sun3/sun3ints.c')
-rw-r--r-- | arch/m68k/sun3/sun3ints.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c index 6464ad3ae3e6..78b60f53e90a 100644 --- a/arch/m68k/sun3/sun3ints.c +++ b/arch/m68k/sun3/sun3ints.c | |||
@@ -51,25 +51,29 @@ void sun3_disable_irq(unsigned int irq) | |||
51 | 51 | ||
52 | static irqreturn_t sun3_int7(int irq, void *dev_id) | 52 | static irqreturn_t sun3_int7(int irq, void *dev_id) |
53 | { | 53 | { |
54 | *sun3_intreg |= (1 << irq); | 54 | unsigned int cnt; |
55 | if (!(kstat_cpu(0).irqs[irq] % 2000)) | 55 | |
56 | sun3_leds(led_pattern[(kstat_cpu(0).irqs[irq] % 16000) / 2000]); | 56 | cnt = kstat_irqs_cpu(irq, 0); |
57 | if (!(cnt % 2000)) | ||
58 | sun3_leds(led_pattern[cnt % 16000 / 2000]); | ||
57 | return IRQ_HANDLED; | 59 | return IRQ_HANDLED; |
58 | } | 60 | } |
59 | 61 | ||
60 | static irqreturn_t sun3_int5(int irq, void *dev_id) | 62 | static irqreturn_t sun3_int5(int irq, void *dev_id) |
61 | { | 63 | { |
64 | unsigned int cnt; | ||
65 | |||
62 | #ifdef CONFIG_SUN3 | 66 | #ifdef CONFIG_SUN3 |
63 | intersil_clear(); | 67 | intersil_clear(); |
64 | #endif | 68 | #endif |
65 | *sun3_intreg |= (1 << irq); | ||
66 | #ifdef CONFIG_SUN3 | 69 | #ifdef CONFIG_SUN3 |
67 | intersil_clear(); | 70 | intersil_clear(); |
68 | #endif | 71 | #endif |
69 | xtime_update(1); | 72 | xtime_update(1); |
70 | update_process_times(user_mode(get_irq_regs())); | 73 | update_process_times(user_mode(get_irq_regs())); |
71 | if (!(kstat_cpu(0).irqs[irq] % 20)) | 74 | cnt = kstat_irqs_cpu(irq, 0); |
72 | sun3_leds(led_pattern[(kstat_cpu(0).irqs[irq] % 160) / 20]); | 75 | if (!(cnt % 20)) |
76 | sun3_leds(led_pattern[cnt % 160 / 20]); | ||
73 | return IRQ_HANDLED; | 77 | return IRQ_HANDLED; |
74 | } | 78 | } |
75 | 79 | ||
@@ -79,29 +83,33 @@ static irqreturn_t sun3_vec255(int irq, void *dev_id) | |||
79 | return IRQ_HANDLED; | 83 | return IRQ_HANDLED; |
80 | } | 84 | } |
81 | 85 | ||
82 | static void sun3_inthandle(unsigned int irq, struct pt_regs *fp) | 86 | static void sun3_irq_enable(struct irq_data *data) |
83 | { | 87 | { |
84 | *sun3_intreg &= ~(1 << irq); | 88 | sun3_enable_irq(data->irq); |
89 | }; | ||
85 | 90 | ||
86 | __m68k_handle_int(irq, fp); | 91 | static void sun3_irq_disable(struct irq_data *data) |
87 | } | 92 | { |
93 | sun3_disable_irq(data->irq); | ||
94 | }; | ||
88 | 95 | ||
89 | static struct irq_controller sun3_irq_controller = { | 96 | static struct irq_chip sun3_irq_chip = { |
90 | .name = "sun3", | 97 | .name = "sun3", |
91 | .lock = __SPIN_LOCK_UNLOCKED(sun3_irq_controller.lock), | 98 | .irq_startup = m68k_irq_startup, |
92 | .startup = m68k_irq_startup, | 99 | .irq_shutdown = m68k_irq_shutdown, |
93 | .shutdown = m68k_irq_shutdown, | 100 | .irq_enable = sun3_irq_enable, |
94 | .enable = sun3_enable_irq, | 101 | .irq_disable = sun3_irq_disable, |
95 | .disable = sun3_disable_irq, | 102 | .irq_mask = sun3_irq_disable, |
103 | .irq_unmask = sun3_irq_enable, | ||
96 | }; | 104 | }; |
97 | 105 | ||
98 | void __init sun3_init_IRQ(void) | 106 | void __init sun3_init_IRQ(void) |
99 | { | 107 | { |
100 | *sun3_intreg = 1; | 108 | *sun3_intreg = 1; |
101 | 109 | ||
102 | m68k_setup_auto_interrupt(sun3_inthandle); | 110 | m68k_setup_irq_controller(&sun3_irq_chip, handle_level_irq, IRQ_AUTO_1, |
103 | m68k_setup_irq_controller(&sun3_irq_controller, IRQ_AUTO_1, 7); | 111 | 7); |
104 | m68k_setup_user_interrupt(VEC_USER, 128, NULL); | 112 | m68k_setup_user_interrupt(VEC_USER, 128); |
105 | 113 | ||
106 | if (request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL)) | 114 | if (request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL)) |
107 | pr_err("Couldn't register %s interrupt\n", "int5"); | 115 | pr_err("Couldn't register %s interrupt\n", "int5"); |