Skip to content

Commit

Permalink
[MIPS] Rewrite all the assembler interrupt handlers to C.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ralf Baechle committed Apr 19, 2006
1 parent d35d473 commit e4ac58a
Show file tree
Hide file tree
Showing 100 changed files with 1,114 additions and 3,388 deletions.
2 changes: 1 addition & 1 deletion arch/mips/au1000/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Makefile for the Alchemy Au1000 CPU, generic files.
#

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

Expand Down
69 changes: 0 additions & 69 deletions arch/mips/au1000/common/int-handler.S

This file was deleted.

20 changes: 18 additions & 2 deletions arch/mips/au1000/common/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
#define EXT_INTC1_REQ1 5 /* IP 5 */
#define MIPS_TIMER_IP 7 /* IP 7 */

extern asmlinkage void au1000_IRQ(void);
extern void set_debug_traps(void);
extern irq_cpustat_t irq_stat [NR_CPUS];

Expand Down Expand Up @@ -446,7 +445,6 @@ void __init arch_init_irq(void)
extern int au1xxx_ic0_nr_irqs;

cp0_status = read_c0_status();
set_except_vector(0, au1000_IRQ);

/* Initialize interrupt controllers to a safe state.
*/
Expand Down Expand Up @@ -661,3 +659,21 @@ restore_au1xxx_intctl(void)
au_writel(sleep_intctl_mask[0], IC0_MASKSET); au_sync();
}
#endif /* CONFIG_PM */

asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
{
unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;

if (pending & CAUSEF_IP7)
mips_timer_interrupt(regs);
else if (pending & CAUSEF_IP2)
intc0_req0_irqdispatch(regs);
else if (pending & CAUSEF_IP3)
intc0_req1_irqdispatch(regs);
else if (pending & CAUSEF_IP4)
intc1_req0_irqdispatch(regs);
else if (pending & CAUSEF_IP5)
intc1_req1_irqdispatch(regs);
else
spurious_interrupt(regs);
}
2 changes: 1 addition & 1 deletion arch/mips/cobalt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for the Cobalt micro systems family specific parts of the kernel
#

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

obj-$(CONFIG_EARLY_PRINTK) += console.o

Expand Down
25 changes: 0 additions & 25 deletions arch/mips/cobalt/int-handler.S

This file was deleted.

6 changes: 1 addition & 5 deletions arch/mips/cobalt/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

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

extern void cobalt_handle_int(void);

/*
* We have two types of interrupts that we handle, ones that come in through
* the CPU interrupt lines, and ones that come in on the via chip. The CPU
Expand Down Expand Up @@ -79,7 +77,7 @@ static inline void via_pic_irq(struct pt_regs *regs)
do_IRQ(irq, regs);
}

asmlinkage void cobalt_irq(struct pt_regs *regs)
asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
{
unsigned pending;

Expand Down Expand Up @@ -122,8 +120,6 @@ void __init arch_init_irq(void)
*/
GALILEO_OUTL(0, GT_INTRMASK_OFS);

set_except_vector(0, cobalt_handle_int);

init_i8259_irqs(); /* 0 ... 15 */
mips_cpu_irq_init(COBALT_CPU_IRQ); /* 16 ... 23 */

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/ddb5xxx/ddb5074/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# under Linux.
#

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

EXTRA_AFLAGS := $(CFLAGS)
120 changes: 0 additions & 120 deletions arch/mips/ddb5xxx/ddb5074/int-handler.S

This file was deleted.

26 changes: 18 additions & 8 deletions arch/mips/ddb5xxx/ddb5074/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#include <asm/ddb5xxx/ddb5074.h>


extern asmlinkage void ddbIRQ(void);

static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };

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

}

void ddb_local0_irqdispatch(struct pt_regs *regs)
static void ddb_local0_irqdispatch(struct pt_regs *regs)
{
u32 mask;
int nile4_irq;
Expand Down Expand Up @@ -118,29 +116,41 @@ void ddb_local0_irqdispatch(struct pt_regs *regs)
}
}

void ddb_local1_irqdispatch(void)
static void ddb_local1_irqdispatch(void)
{
printk("ddb_local1_irqdispatch called\n");
}

void ddb_buserror_irq(void)
static void ddb_buserror_irq(void)
{
printk("ddb_buserror_irq called\n");
}

void ddb_8254timer_irq(void)
static void ddb_8254timer_irq(void)
{
printk("ddb_8254timer_irq called\n");
}

asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
{
unsigned int pending = read_c0_cause() & read_c0_status();

if (pending & CAUSEF_IP2)
ddb_local0_irqdispatch(regs);
else if (pending & CAUSEF_IP3)
ddb_local1_irqdispatch();
else if (pending & CAUSEF_IP6)
ddb_buserror_irq();
else if (pending & (CAUSEF_IP4 | CAUSEF_IP5))
ddb_8254timer_irq();
}

void __init arch_init_irq(void)
{
/* setup cascade interrupts */
setup_irq(NILE4_IRQ_BASE + NILE4_INT_INTE, &irq_cascade);
setup_irq(CPU_IRQ_BASE + CPU_NILE4_CASCADE, &irq_cascade);

set_except_vector(0, ddbIRQ);

nile4_irq_setup(NILE4_IRQ_BASE);
m1543_irq_setup();
init_i8259_irqs();
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/ddb5xxx/ddb5476/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# under Linux.
#

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

EXTRA_AFLAGS := $(CFLAGS)
Loading

0 comments on commit e4ac58a

Please sign in to comment.