aboutsummaryrefslogtreecommitdiff
path: root/interrupt_vector.S
blob: 3daef05dc0bd6287a5cbca6b780dddb212efe579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.section ".interrupt_vectors.text"

.global abort_handler
.global irq_handler
.local generic_handler	
.global _interrupt_vectors

_interrupt_vectors:
    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
abort_handler_caller:
	mov sp, #0x8000
	ldr r5, =abort_handler
	bx r5
irq:
	mov sp, #0x8000
	ldr r5, =abort_handler
    subs pc,lr,#4