diff options
| author | Ralf Baechle <ralf@linux-mips.org> | 2006-04-03 12:56:36 -0400 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2006-04-18 22:14:21 -0400 |
| commit | e4ac58afdfac792c0583af30dbd9eae53e24c78b (patch) | |
| tree | 7517bef2c515fc630e4d3d238867b91cde96f558 /arch/mips/lasat | |
| parent | d35d473c25d43d7db3e5e18b66d558d2a631cca8 (diff) | |
[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>
Diffstat (limited to 'arch/mips/lasat')
| -rw-r--r-- | arch/mips/lasat/Makefile | 2 | ||||
| -rw-r--r-- | arch/mips/lasat/interrupt.c | 14 | ||||
| -rw-r--r-- | arch/mips/lasat/lasatIRQ.S | 69 |
3 files changed, 9 insertions, 76 deletions
diff --git a/arch/mips/lasat/Makefile b/arch/mips/lasat/Makefile index 0d5aec436725..99f5046fdf49 100644 --- a/arch/mips/lasat/Makefile +++ b/arch/mips/lasat/Makefile | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y += reset.o setup.o prom.o lasat_board.o \ | 5 | obj-y += reset.o setup.o prom.o lasat_board.o \ |
| 6 | at93c.o interrupt.o lasatIRQ.o | 6 | at93c.o interrupt.o |
| 7 | 7 | ||
| 8 | obj-$(CONFIG_LASAT_SYSCTL) += sysctl.o | 8 | obj-$(CONFIG_LASAT_SYSCTL) += sysctl.o |
| 9 | obj-$(CONFIG_DS1603) += ds1603.o | 9 | obj-$(CONFIG_DS1603) += ds1603.o |
diff --git a/arch/mips/lasat/interrupt.c b/arch/mips/lasat/interrupt.c index 852a41901a5e..2d3472b21ebb 100644 --- a/arch/mips/lasat/interrupt.c +++ b/arch/mips/lasat/interrupt.c | |||
| @@ -27,14 +27,13 @@ | |||
| 27 | #include <asm/bootinfo.h> | 27 | #include <asm/bootinfo.h> |
| 28 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
| 29 | #include <asm/lasat/lasatint.h> | 29 | #include <asm/lasat/lasatint.h> |
| 30 | #include <asm/time.h> | ||
| 30 | #include <asm/gdb-stub.h> | 31 | #include <asm/gdb-stub.h> |
| 31 | 32 | ||
| 32 | static volatile int *lasat_int_status = NULL; | 33 | static volatile int *lasat_int_status = NULL; |
| 33 | static volatile int *lasat_int_mask = NULL; | 34 | static volatile int *lasat_int_mask = NULL; |
| 34 | static volatile int lasat_int_mask_shift; | 35 | static volatile int lasat_int_mask_shift; |
| 35 | 36 | ||
| 36 | extern asmlinkage void lasatIRQ(void); | ||
| 37 | |||
| 38 | void disable_lasat_irq(unsigned int irq_nr) | 37 | void disable_lasat_irq(unsigned int irq_nr) |
| 39 | { | 38 | { |
| 40 | unsigned long flags; | 39 | unsigned long flags; |
| @@ -109,11 +108,17 @@ static unsigned long get_int_status_200(void) | |||
| 109 | return int_status; | 108 | return int_status; |
| 110 | } | 109 | } |
| 111 | 110 | ||
| 112 | void lasat_hw0_irqdispatch(struct pt_regs *regs) | 111 | asmlinkage void plat_irq_dispatch(struct pt_regs *regs) |
| 113 | { | 112 | { |
| 114 | unsigned long int_status; | 113 | unsigned long int_status; |
| 114 | unsigned int cause = read_c0_cause(); | ||
| 115 | int irq; | 115 | int irq; |
| 116 | 116 | ||
| 117 | if (cause & CAUSEF_IP7) { /* R4000 count / compare IRQ */ | ||
| 118 | ll_timer_interrupt(7, regs); | ||
| 119 | return; | ||
| 120 | } | ||
| 121 | |||
| 117 | int_status = get_int_status(); | 122 | int_status = get_int_status(); |
| 118 | 123 | ||
| 119 | /* if int_status == 0, then the interrupt has already been cleared */ | 124 | /* if int_status == 0, then the interrupt has already been cleared */ |
| @@ -147,9 +152,6 @@ void __init arch_init_irq(void) | |||
| 147 | panic("arch_init_irq: mips_machtype incorrect"); | 152 | panic("arch_init_irq: mips_machtype incorrect"); |
| 148 | } | 153 | } |
| 149 | 154 | ||
| 150 | /* Now safe to set the exception vector. */ | ||
| 151 | set_except_vector(0, lasatIRQ); | ||
| 152 | |||
| 153 | for (i = 0; i <= LASATINT_END; i++) { | 155 | for (i = 0; i <= LASATINT_END; i++) { |
| 154 | irq_desc[i].status = IRQ_DISABLED; | 156 | irq_desc[i].status = IRQ_DISABLED; |
| 155 | irq_desc[i].action = 0; | 157 | irq_desc[i].action = 0; |
diff --git a/arch/mips/lasat/lasatIRQ.S b/arch/mips/lasat/lasatIRQ.S deleted file mode 100644 index 2a2b0d056561..000000000000 --- a/arch/mips/lasat/lasatIRQ.S +++ /dev/null | |||
| @@ -1,69 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Carsten Langgaard, carstenl@mips.com | ||
| 3 | * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved. | ||
| 4 | * | ||
| 5 | * This program is free software; you can distribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License (Version 2) as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 12 | * for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along | ||
| 15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
| 17 | * | ||
| 18 | * Interrupt exception dispatch code. | ||
| 19 | */ | ||
| 20 | #include <asm/asm.h> | ||
| 21 | #include <asm/mipsregs.h> | ||
| 22 | #include <asm/regdef.h> | ||
| 23 | #include <asm/stackframe.h> | ||
| 24 | |||
| 25 | .text | ||
| 26 | .set noreorder | ||
| 27 | .align 5 | ||
| 28 | NESTED(lasatIRQ, PT_SIZE, sp) | ||
| 29 | .set noat | ||
| 30 | SAVE_ALL | ||
| 31 | CLI | ||
| 32 | .set at | ||
| 33 | .set noreorder | ||
| 34 | |||
| 35 | mfc0 s0, CP0_CAUSE # get irq mask | ||
| 36 | |||
| 37 | /* First we check for r4k counter/timer IRQ. */ | ||
| 38 | andi a0, s0, CAUSEF_IP7 | ||
| 39 | beq a0, zero, 1f | ||
| 40 | andi a0, s0, CAUSEF_IP2 # delay slot, check hw0 interrupt | ||
| 41 | |||
| 42 | /* Wheee, a timer interrupt. */ | ||
| 43 | li a0, 7 | ||
| 44 | jal ll_timer_interrupt | ||
| 45 | move a1, sp | ||
| 46 | |||
| 47 | j ret_from_irq | ||
| 48 | nop | ||
| 49 | |||
| 50 | 1: | ||
| 51 | /* Wheee, combined hardware level zero interrupt. */ | ||
| 52 | jal lasat_hw0_irqdispatch | ||
| 53 | move a0, sp # delay slot | ||
| 54 | |||
| 55 | j ret_from_irq | ||
| 56 | nop # delay slot | ||
| 57 | |||
| 58 | 1: | ||
| 59 | /* | ||
| 60 | * Here by mistake? This is possible, what can happen is that by the | ||
| 61 | * time we take the exception the IRQ pin goes low, so just leave if | ||
| 62 | * this is the case. | ||
| 63 | */ | ||
| 64 | move a1,s0 | ||
| 65 | mfc0 a1, CP0_EPC | ||
| 66 | |||
| 67 | j ret_from_irq | ||
| 68 | nop | ||
| 69 | END(lasatIRQ) | ||
