From 8d08aa3662ed44ef2f4b35b1e79f44adaf3229c9 Mon Sep 17 00:00:00 2001 From: vetch Date: Thu, 2 Jan 2020 17:49:42 +0100 Subject: update, may not work now --- interrupt_vector.S | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) (limited to 'interrupt_vector.S') diff --git a/interrupt_vector.S b/interrupt_vector.S index f71330b..3daef05 100644 --- a/interrupt_vector.S +++ b/interrupt_vector.S @@ -1,16 +1,42 @@ .section ".interrupt_vectors.text" .global abort_handler +.global irq_handler .local generic_handler .global _interrupt_vectors + _interrupt_vectors: - b generic_handler - b generic_handler - b generic_handler - b abort_handler_caller - b abort_handler_caller - b generic_handler - b generic_handler + ldr pc,reset_handler + ldr pc,undefined_handler + ldr pc,swi_handler + ldr pc,prefetch_handler + ldr pc,data_handler + ldr pc,unused_handler + ldr pc,irq_handler_caller + ldr pc,fiq_handler + reset_handler: .word abort + undefined_handler: .word abort + swi_handler: .word abort + prefetch_handler: .word abort + data_handler: .word abort + unused_handler: .word abort + irq_handler_caller: .word irq + fiq_handler: .word abort + //b abort_handler_caller + //b abort_handler_caller + //b abort_handler_caller + //b abort_handler_caller + //b abort_handler_caller + //b abort_handler_caller + //b abort_handler_caller + + +.globl enable_irq +enable_irq: + mrs r0,cpsr + bic r0,r0,#0x80 + msr cpsr_c,r0 + bx lr generic_handler: b generic_handler @@ -18,3 +44,7 @@ abort_handler_caller: mov sp, #0x8000 ldr r5, =abort_handler bx r5 +irq: + mov sp, #0x8000 + ldr r5, =abort_handler + subs pc,lr,#4 \ No newline at end of file -- cgit v1.2.3