vector_gcc.S 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2024-03-28 Shell Move vector handling codes from context_gcc.S
  9. */
  10. #ifndef __ASSEMBLY__
  11. #define __ASSEMBLY__
  12. #endif
  13. #include "../include/vector_gcc.h"
  14. #include "context_gcc.h"
  15. #include <rtconfig.h>
  16. #include <asm-generic.h>
  17. #include <asm-fpu.h>
  18. #include <armv8.h>
  19. .section .text
  20. .align 8
  21. .globl vector_fiq
  22. vector_fiq:
  23. SAVE_IRQ_CONTEXT
  24. bl rt_hw_trap_fiq
  25. RESTORE_IRQ_CONTEXT
  26. .globl rt_interrupt_enter
  27. .globl rt_interrupt_leave
  28. .globl rt_thread_switch_interrupt_flag
  29. .globl rt_interrupt_from_thread
  30. .globl rt_interrupt_to_thread
  31. .globl rt_hw_context_switch_interrupt_do
  32. .align 8
  33. .globl vector_irq
  34. vector_irq:
  35. SAVE_IRQ_CONTEXT
  36. bl rt_interrupt_enter
  37. bl rt_hw_trap_irq
  38. bl rt_interrupt_leave
  39. /**
  40. * if rt_thread_switch_interrupt_flag set, jump to
  41. * rt_hw_context_switch_interrupt_do and don't return
  42. */
  43. ldr x1, =rt_thread_switch_interrupt_flag
  44. ldr x2, [x1]
  45. cmp x2, #1
  46. b.ne vector_irq_exit
  47. mov x2, #0 // clear flag
  48. str x2, [x1]
  49. bl rt_hw_context_switch_interrupt_do
  50. vector_irq_exit:
  51. RESTORE_IRQ_CONTEXT_WITHOUT_MMU_SWITCH