1 /* 2 * Handler routines. 3 * 4 * Copyright (C) 2015 Nicholas FitzRoy-Dale <wzdd.code@lardcave.net> 5 * Copyright (C) 2015 Paul Boddie <paul@boddie.org.uk> 6 * 7 * This program is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 .text 22 .extern irq_handle 23 .globl interrupt_handler 24 .set noreorder 25 .set noat 26 27 interrupt_handler: 28 sw $at, -4($sp) 29 sw $v0, -8($sp) 30 sw $v1, -12($sp) 31 sw $a0, -16($sp) 32 sw $a1, -20($sp) 33 sw $a2, -24($sp) 34 sw $a3, -28($sp) 35 sw $t0, -32($sp) 36 sw $t1, -36($sp) 37 sw $t2, -40($sp) 38 sw $t3, -44($sp) 39 sw $t4, -48($sp) 40 sw $t5, -52($sp) 41 sw $t6, -56($sp) 42 sw $t7, -60($sp) 43 sw $s0, -64($sp) 44 sw $s1, -68($sp) 45 sw $s2, -72($sp) 46 sw $s3, -76($sp) 47 sw $s4, -80($sp) 48 sw $s5, -84($sp) 49 sw $s6, -88($sp) 50 sw $s7, -92($sp) 51 sw $t8, -96($sp) 52 sw $t9, -100($sp) 53 sw $gp, -104($sp) 54 sw $fp, -108($sp) 55 sw $ra, -112($sp) 56 57 addi $sp, $sp, -112 58 59 /* Invoke the handler. */ 60 61 jal irq_handle 62 nop 63 64 addi $sp, $sp, 112 65 66 lw $at, -4($sp) 67 lw $v0, -8($sp) 68 lw $v1, -12($sp) 69 lw $a0, -16($sp) 70 lw $a1, -20($sp) 71 lw $a2, -24($sp) 72 lw $a3, -28($sp) 73 lw $t0, -32($sp) 74 lw $t1, -36($sp) 75 lw $t2, -40($sp) 76 lw $t3, -44($sp) 77 lw $t4, -48($sp) 78 lw $t5, -52($sp) 79 lw $t6, -56($sp) 80 lw $t7, -60($sp) 81 lw $s0, -64($sp) 82 lw $s1, -68($sp) 83 lw $s2, -72($sp) 84 lw $s3, -76($sp) 85 lw $s4, -80($sp) 86 lw $s5, -84($sp) 87 lw $s6, -88($sp) 88 lw $s7, -92($sp) 89 lw $t8, -96($sp) 90 lw $t9, -100($sp) 91 lw $gp, -104($sp) 92 lw $fp, -108($sp) 93 lw $ra, -112($sp) 94 95 eret 96 nop 97 98 .set reorder 99 .set at