vector_gcc.S 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2006-2024, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018/10/28 Bernard The unify RISC-V porting implementation
  9. * 2018/12/27 Jesven Add SMP support
  10. * 2021/02/02 lizhirui Add userspace support
  11. * 2022/10/22 Shell Support User mode RVV;
  12. * Trimming process switch context
  13. * 2024/09/01 Shell Separated vector ctx from the generic
  14. */
  15. #include "cpuport.h"
  16. #include "stackframe.h"
  17. /**
  18. * @param a0 pointer to frame bottom
  19. */
  20. .global rt_hw_vector_ctx_save
  21. rt_hw_vector_ctx_save:
  22. SAVE_VECTOR a0
  23. ret
  24. /**
  25. * @param a0 pointer to frame bottom
  26. */
  27. .global rt_hw_vector_ctx_restore
  28. rt_hw_vector_ctx_restore:
  29. RESTORE_VECTOR a0
  30. ret
  31. .global rt_hw_disable_vector
  32. rt_hw_disable_vector:
  33. li t0, SSTATUS_VS
  34. csrc sstatus, t0
  35. ret
  36. .global rt_hw_enable_vector
  37. rt_hw_enable_vector:
  38. li t0, SSTATUS_VS
  39. csrs sstatus, t0
  40. ret