vector_gcc.S 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. * 2018-10-06 ZhaoXiaowei the first version
  9. * 2024-03-28 Shell Move vector handling codes from context_gcc.S
  10. */
  11. #ifndef __ASSEMBLY__
  12. #define __ASSEMBLY__
  13. #endif
  14. #include <rtconfig.h>
  15. .text
  16. .globl system_vectors
  17. .globl vector_exception
  18. .globl vector_irq
  19. .globl vector_fiq
  20. system_vectors:
  21. .align 11
  22. .set VBAR, system_vectors
  23. .org VBAR
  24. /* Exception from CurrentEL (EL1) with SP_EL0 (SPSEL=1) */
  25. .org (VBAR + 0x00 + 0)
  26. b vector_serror /* Synchronous */
  27. .org (VBAR + 0x80 + 0)
  28. b vector_serror /* IRQ/vIRQ */
  29. .org (VBAR + 0x100 + 0)
  30. b vector_serror /* FIQ/vFIQ */
  31. .org (VBAR + 0x180 + 0)
  32. b vector_serror /* Error/vError */
  33. /* Exception from CurrentEL (EL1) with SP_ELn */
  34. .org (VBAR + 0x200 + 0)
  35. b vector_exception /* Synchronous */
  36. .org (VBAR + 0x280 + 0)
  37. b vector_irq /* IRQ/vIRQ */
  38. .org (VBAR + 0x300 + 0)
  39. b vector_fiq /* FIQ/vFIQ */
  40. .org (VBAR + 0x380 + 0)
  41. b vector_serror
  42. /* Exception from lower EL, aarch64 */
  43. .org (VBAR + 0x400 + 0)
  44. b vector_exception
  45. .org (VBAR + 0x480 + 0)
  46. b vector_irq
  47. .org (VBAR + 0x500 + 0)
  48. b vector_fiq
  49. .org (VBAR + 0x580 + 0)
  50. b vector_serror
  51. /* Exception from lower EL, aarch32 */
  52. .org (VBAR + 0x600 + 0)
  53. b vector_serror
  54. .org (VBAR + 0x680 + 0)
  55. b vector_serror
  56. .org (VBAR + 0x700 + 0)
  57. b vector_serror
  58. .org (VBAR + 0x780 + 0)
  59. b vector_serror
  60. #include "include/vector_gcc.h"
  61. START_POINT(vector_exception)
  62. SAVE_IRQ_CONTEXT
  63. stp x0, x1, [sp, #-0x10]!
  64. #ifdef RT_USING_SMART
  65. SAVE_USER_CTX
  66. #endif
  67. bl rt_hw_trap_exception
  68. #ifdef RT_USING_SMART
  69. ldp x0, x1, [sp]
  70. RESTORE_USER_CTX x0
  71. #endif
  72. ldp x0, x1, [sp], #0x10
  73. RESTORE_IRQ_CONTEXT_WITHOUT_MMU_SWITCH
  74. START_POINT_END(vector_exception)
  75. START_POINT(vector_serror)
  76. SAVE_IRQ_CONTEXT
  77. #ifdef RT_USING_SMART
  78. SAVE_USER_CTX
  79. #endif
  80. stp x0, x1, [sp, #-0x10]!
  81. bl rt_hw_trap_serror
  82. b .
  83. START_POINT_END(vector_serror)