paul@68 | 1 | /* |
paul@114 | 2 | * Interrupt and TLB miss handling support. |
paul@68 | 3 | * |
paul@114 | 4 | * Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk> |
paul@68 | 5 | * |
paul@68 | 6 | * This program is free software: you can redistribute it and/or modify |
paul@68 | 7 | * it under the terms of the GNU General Public License as published by |
paul@68 | 8 | * the Free Software Foundation, either version 3 of the License, or |
paul@68 | 9 | * (at your option) any later version. |
paul@68 | 10 | * |
paul@68 | 11 | * This program is distributed in the hope that it will be useful, |
paul@68 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@68 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@68 | 14 | * GNU General Public License for more details. |
paul@68 | 15 | * |
paul@68 | 16 | * You should have received a copy of the GNU General Public License |
paul@68 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
paul@68 | 18 | */ |
paul@68 | 19 | |
paul@68 | 20 | .text |
paul@114 | 21 | .extern tlb_handler |
paul@86 | 22 | .extern interrupt_handler |
paul@114 | 23 | .globl _tlb_entry |
paul@68 | 24 | .globl _irq_entry |
paul@68 | 25 | .globl _end_entries |
paul@68 | 26 | .set noreorder |
paul@68 | 27 | |
paul@114 | 28 | _tlb_entry: |
paul@127 | 29 | /* Save registers that the assembler wants to trash. */ |
paul@127 | 30 | |
paul@127 | 31 | sw $t9, -100($sp) |
paul@127 | 32 | sw $gp, -104($sp) |
paul@127 | 33 | sw $ra, -112($sp) |
paul@127 | 34 | |
paul@126 | 35 | lui $gp, %hi(_GLOBAL_OFFSET_TABLE_) |
paul@126 | 36 | ori $gp, $gp, %lo(_GLOBAL_OFFSET_TABLE_) |
paul@122 | 37 | la $k0, tlb_handler |
paul@114 | 38 | jr $k0 |
paul@114 | 39 | nop |
paul@114 | 40 | |
paul@68 | 41 | _irq_entry: |
paul@127 | 42 | /* Save registers that the assembler wants to trash. */ |
paul@127 | 43 | |
paul@127 | 44 | sw $t9, -100($sp) |
paul@127 | 45 | sw $gp, -104($sp) |
paul@127 | 46 | sw $ra, -112($sp) |
paul@127 | 47 | |
paul@126 | 48 | lui $gp, %hi(_GLOBAL_OFFSET_TABLE_) |
paul@126 | 49 | ori $gp, $gp, %lo(_GLOBAL_OFFSET_TABLE_) |
paul@122 | 50 | la $k0, interrupt_handler |
paul@68 | 51 | jr $k0 |
paul@68 | 52 | nop |
paul@68 | 53 | |
paul@68 | 54 | _end_entries: |
paul@68 | 55 | |
paul@68 | 56 | .set reorder |