add ability to do intr-binding based on given device tree node
[lunaix-os.git] / lunaix-os / arch / aarch64 / exception / entries.S
1 #define __ASM__
2 #include <asm/aa64_exception.h>
3 #include <asm/aa64_msrs.h>
4
5 .macro aa64_exception_entry type
6     .align 7
7     .type  _exception_entry_t\type, @function
8
9     // each handler has at most 128 bytes (32 insts)
10     _exception_entry_t\type:
11         stp x1,  x0,  [sp, #-16]
12
13         // re-purpose the [63, 56] of ESR to exception
14         //  type identifier
15
16         mov x0,  #\type
17         lsl x0,  x0, #56
18         mrs x1,  ESR_EL1
19         orr x0,  x0, x1
20
21         ldr x1,  [sp, #-8]
22         str x0,  [sp, #-8]!
23         ldr x0,  [sp, #-8]
24
25         b _aa64_evec_prehandle
26 .endm
27
28 .section .text
29
30     .globl aa64_vbase
31     .align 7
32
33     aa64_vbase:
34     aa64_exception_entry EXCEPTION_SYNC
35     aa64_exception_entry EXCEPTION_IRQ
36     aa64_exception_entry EXCEPTION_FIQ
37     aa64_exception_entry EXCEPTION_SERR