Pete Popov | bdf21b1 | 2005-07-14 17:47:57 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2002 Philips, Inc. All rights. |
| 3 | * Copyright (c) 2002 Red Hat, Inc. All rights. |
| 4 | * |
| 5 | * This software may be freely redistributed under the terms of the |
| 6 | * GNU General Public License. |
| 7 | * |
| 8 | * You should have received a copy of the GNU General Public License |
| 9 | * along with this program; if not, write to the Free Software |
| 10 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 11 | * |
| 12 | * Based upon arch/mips/galileo-boards/ev64240/int-handler.S |
| 13 | * |
| 14 | */ |
| 15 | #include <asm/asm.h> |
| 16 | #include <asm/mipsregs.h> |
| 17 | #include <asm/addrspace.h> |
| 18 | #include <asm/regdef.h> |
| 19 | #include <asm/stackframe.h> |
| 20 | |
| 21 | /* |
| 22 | * cp0_irqdispatch |
| 23 | * |
| 24 | * Code to handle in-core interrupt exception. |
| 25 | */ |
| 26 | |
| 27 | .align 5 |
| 28 | .set reorder |
| 29 | .set noat |
| 30 | NESTED(cp0_irqdispatch, PT_SIZE, sp) |
| 31 | SAVE_ALL |
| 32 | CLI |
| 33 | .set at |
| 34 | mfc0 t0,CP0_CAUSE |
| 35 | mfc0 t2,CP0_STATUS |
| 36 | |
| 37 | and t0,t2 |
| 38 | |
| 39 | andi t1,t0,STATUSF_IP2 /* int0 hardware line */ |
| 40 | bnez t1,ll_hw0_irq |
| 41 | nop |
| 42 | |
| 43 | andi t1,t0,STATUSF_IP7 /* int5 hardware line */ |
| 44 | bnez t1,ll_timer_irq |
| 45 | nop |
| 46 | |
| 47 | /* wrong alarm or masked ... */ |
| 48 | |
| 49 | j spurious_interrupt |
| 50 | nop |
| 51 | END(cp0_irqdispatch) |
| 52 | |
| 53 | .align 5 |
| 54 | .set reorder |
| 55 | ll_hw0_irq: |
| 56 | li a0,2 |
| 57 | move a1,sp |
| 58 | jal hw0_irqdispatch |
| 59 | nop |
| 60 | j ret_from_irq |
| 61 | nop |
| 62 | |
| 63 | .align 5 |
| 64 | .set reorder |
| 65 | ll_timer_irq: |
| 66 | mfc0 t3,CP0_CONFIG,7 |
| 67 | andi t4,t3,0x01c0 |
| 68 | beqz t4,ll_timer_out |
| 69 | nop |
| 70 | li a0,7 |
| 71 | move a1,sp |
| 72 | jal timer_irqdispatch |
| 73 | nop |
| 74 | |
| 75 | ll_timer_out: j ret_from_irq |
| 76 | nop |