port_gcc.S 447 B

1234567891011121314151617181920212223
  1. /*
  2. * Copyright (c) 2021-2023 HPMicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #include "cpuport.h"
  8. .globl rt_hw_do_after_save_above
  9. .type rt_hw_do_after_save_above,@function
  10. rt_hw_do_after_save_above:
  11. addi sp, sp, -4
  12. STORE ra, 0 * REGBYTES(sp)
  13. csrr t1, mcause
  14. andi t1, t1, 0x3FF
  15. /* get ISR */
  16. la t2, trap_entry
  17. jalr t2
  18. LOAD ra, 0 * REGBYTES(sp)
  19. addi sp, sp, 4
  20. ret