Skip to content

Commit e4ac58a

Browse files
committed
[MIPS] Rewrite all the assembler interrupt handlers to C.
Saves like 1,600 lines of code, is way easier to debug, compilers frequently do a better job than the cut and paste type of handlers many boards had. And finally having all the stuff done in a single place also means alot of bug potencial for the MT ASE is gone. The only surviving handler in assembler is the DECstation one; I hope Maciej will rewrite it. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent d35d473 commit e4ac58a

100 files changed

Lines changed: 1114 additions & 3388 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/mips/au1000/common/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Makefile for the Alchemy Au1000 CPU, generic files.
77
#
88

9-
obj-y += prom.o int-handler.o irq.o puts.o time.o reset.o \
9+
obj-y += prom.o irq.o puts.o time.o reset.o \
1010
au1xxx_irqmap.o clocks.o platform.o power.o setup.o \
1111
sleeper.o cputable.o dma.o dbdma.o gpio.o
1212

‎arch/mips/au1000/common/int-handler.S‎

Lines changed: 0 additions & 69 deletions
This file was deleted.

‎arch/mips/au1000/common/irq.c‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
#define EXT_INTC1_REQ1 5 /* IP 5 */
6767
#define MIPS_TIMER_IP 7 /* IP 7 */
6868

69-
extern asmlinkage void au1000_IRQ(void);
7069
extern void set_debug_traps(void);
7170
extern irq_cpustat_t irq_stat [NR_CPUS];
7271

@@ -446,7 +445,6 @@ void __init arch_init_irq(void)
446445
extern int au1xxx_ic0_nr_irqs;
447446

448447
cp0_status = read_c0_status();
449-
set_except_vector(0, au1000_IRQ);
450448

451449
/* Initialize interrupt controllers to a safe state.
452450
*/
@@ -661,3 +659,21 @@ restore_au1xxx_intctl(void)
661659
au_writel(sleep_intctl_mask[0], IC0_MASKSET); au_sync();
662660
}
663661
#endif /* CONFIG_PM */
662+
663+
asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
664+
{
665+
unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
666+
667+
if (pending & CAUSEF_IP7)
668+
mips_timer_interrupt(regs);
669+
else if (pending & CAUSEF_IP2)
670+
intc0_req0_irqdispatch(regs);
671+
else if (pending & CAUSEF_IP3)
672+
intc0_req1_irqdispatch(regs);
673+
else if (pending & CAUSEF_IP4)
674+
intc1_req0_irqdispatch(regs);
675+
else if (pending & CAUSEF_IP5)
676+
intc1_req1_irqdispatch(regs);
677+
else
678+
spurious_interrupt(regs);
679+
}

‎arch/mips/cobalt/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Makefile for the Cobalt micro systems family specific parts of the kernel
33
#
44

5-
obj-y := irq.o int-handler.o reset.o setup.o
5+
obj-y := irq.o reset.o setup.o
66

77
obj-$(CONFIG_EARLY_PRINTK) += console.o
88

‎arch/mips/cobalt/int-handler.S‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎arch/mips/cobalt/irq.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
#include <asm/mach-cobalt/cobalt.h>
2222

23-
extern void cobalt_handle_int(void);
24-
2523
/*
2624
* We have two types of interrupts that we handle, ones that come in through
2725
* the CPU interrupt lines, and ones that come in on the via chip. The CPU
@@ -79,7 +77,7 @@ static inline void via_pic_irq(struct pt_regs *regs)
7977
do_IRQ(irq, regs);
8078
}
8179

82-
asmlinkage void cobalt_irq(struct pt_regs *regs)
80+
asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
8381
{
8482
unsigned pending;
8583

@@ -122,8 +120,6 @@ void __init arch_init_irq(void)
122120
*/
123121
GALILEO_OUTL(0, GT_INTRMASK_OFS);
124122

125-
set_except_vector(0, cobalt_handle_int);
126-
127123
init_i8259_irqs(); /* 0 ... 15 */
128124
mips_cpu_irq_init(COBALT_CPU_IRQ); /* 16 ... 23 */
129125

‎arch/mips/ddb5xxx/ddb5074/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
# under Linux.
44
#
55

6-
obj-y += setup.o irq.o int-handler.o nile4_pic.o
6+
obj-y += setup.o irq.o nile4_pic.o
77

88
EXTRA_AFLAGS := $(CFLAGS)

‎arch/mips/ddb5xxx/ddb5074/int-handler.S‎

Lines changed: 0 additions & 120 deletions
This file was deleted.

‎arch/mips/ddb5xxx/ddb5074/irq.c‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#include <asm/ddb5xxx/ddb5074.h>
2222

2323

24-
extern asmlinkage void ddbIRQ(void);
25-
2624
static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };
2725

2826
#define M1543_PNP_CONFIG 0x03f0 /* PnP Config Port */
@@ -90,7 +88,7 @@ static void m1543_irq_setup(void)
9088

9189
}
9290

93-
void ddb_local0_irqdispatch(struct pt_regs *regs)
91+
static void ddb_local0_irqdispatch(struct pt_regs *regs)
9492
{
9593
u32 mask;
9694
int nile4_irq;
@@ -118,29 +116,41 @@ void ddb_local0_irqdispatch(struct pt_regs *regs)
118116
}
119117
}
120118

121-
void ddb_local1_irqdispatch(void)
119+
static void ddb_local1_irqdispatch(void)
122120
{
123121
printk("ddb_local1_irqdispatch called\n");
124122
}
125123

126-
void ddb_buserror_irq(void)
124+
static void ddb_buserror_irq(void)
127125
{
128126
printk("ddb_buserror_irq called\n");
129127
}
130128

131-
void ddb_8254timer_irq(void)
129+
static void ddb_8254timer_irq(void)
132130
{
133131
printk("ddb_8254timer_irq called\n");
134132
}
135133

134+
asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
135+
{
136+
unsigned int pending = read_c0_cause() & read_c0_status();
137+
138+
if (pending & CAUSEF_IP2)
139+
ddb_local0_irqdispatch(regs);
140+
else if (pending & CAUSEF_IP3)
141+
ddb_local1_irqdispatch();
142+
else if (pending & CAUSEF_IP6)
143+
ddb_buserror_irq();
144+
else if (pending & (CAUSEF_IP4 | CAUSEF_IP5))
145+
ddb_8254timer_irq();
146+
}
147+
136148
void __init arch_init_irq(void)
137149
{
138150
/* setup cascade interrupts */
139151
setup_irq(NILE4_IRQ_BASE + NILE4_INT_INTE, &irq_cascade);
140152
setup_irq(CPU_IRQ_BASE + CPU_NILE4_CASCADE, &irq_cascade);
141153

142-
set_except_vector(0, ddbIRQ);
143-
144154
nile4_irq_setup(NILE4_IRQ_BASE);
145155
m1543_irq_setup();
146156
init_i8259_irqs();

‎arch/mips/ddb5xxx/ddb5476/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# under Linux.
44
#
55

6-
obj-y += setup.o irq.o int-handler.o nile4_pic.o vrc5476_irq.o
6+
obj-y += setup.o irq.o nile4_pic.o vrc5476_irq.o
77
obj-$(CONFIG_KGDB) += dbg_io.o
88

99
EXTRA_AFLAGS := $(CFLAGS)

0 commit comments

Comments
 (0)