123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- .macro save_volatile_to_stack
-
- stp x0, x1, [sp,
- stp x2, x3, [sp,
- stp x4, x5, [sp,
- stp x6, x7, [sp,
- stp x8, x9, [sp,
- stp x10, x11, [sp,
- stp x12, x13, [sp,
- stp x14, x15, [sp,
- stp x16, x17, [sp,
- str x18, [sp,
- stp x29, x30, [sp,
-
- mrs x0, elr_el1
- mrs x1, spsr_el1
- stp x0, x1, [sp,
- .endm
- .macro restore_volatile_from_stack
-
- ldp x2, x3, [sp,
- ldp x4, x5, [sp,
- ldp x6, x7, [sp,
- ldp x8, x9, [sp,
- ldp x10, x11, [sp,
- ldp x12, x13, [sp,
- ldp x14, x15, [sp,
- ldp x16, x17, [sp,
- ldr x18, [sp,
- ldp x29, x30, [sp,
-
- ldp x0, x1, [sp,
- msr elr_el1, x0
- msr spsr_el1, x1
-
- ldp x0, x1, [sp],
- .endm
- .macro current_exception_sp0 handler:req
- msr spsel,
- save_volatile_to_stack
- bl \handler
- restore_volatile_from_stack
- msr spsel,
- eret
- .endm
- .macro current_exception_spx handler:req
- save_volatile_to_stack
- bl \handler
- restore_volatile_from_stack
- eret
- .endm
- .section .text.vector_table_el1, "ax"
- .global vector_table_el1
- .balign 0x800
- vector_table_el1:
- sync_cur_sp0:
- current_exception_sp0 sync_exception_current
- .balign 0x80
- irq_cur_sp0:
- current_exception_sp0 irq_current
- .balign 0x80
- fiq_cur_sp0:
- current_exception_sp0 fiq_current
- .balign 0x80
- serr_cur_sp0:
- current_exception_sp0 serr_current
- .balign 0x80
- sync_cur_spx:
- current_exception_spx sync_exception_current
- .balign 0x80
- irq_cur_spx:
- current_exception_spx irq_current
- .balign 0x80
- fiq_cur_spx:
- current_exception_spx fiq_current
- .balign 0x80
- serr_cur_spx:
- current_exception_spx serr_current
- .balign 0x80
- sync_lower_64:
- current_exception_spx sync_lower
- .balign 0x80
- irq_lower_64:
- current_exception_spx irq_lower
- .balign 0x80
- fiq_lower_64:
- current_exception_spx fiq_lower
- .balign 0x80
- serr_lower_64:
- current_exception_spx serr_lower
- .balign 0x80
- sync_lower_32:
- current_exception_spx sync_lower
- .balign 0x80
- irq_lower_32:
- current_exception_spx irq_lower
- .balign 0x80
- fiq_lower_32:
- current_exception_spx fiq_lower
- .balign 0x80
- serr_lower_32:
- current_exception_spx serr_lower
|