asm-generic.h 999 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2006-2023 RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023-03-12 WangXiaoyao the first version
  9. */
  10. #ifndef __ASM_GENERIC_H__
  11. #define __ASM_GENERIC_H__
  12. /* use to mark a start point where every task start from */
  13. #define START_POINT(funcname) \
  14. .global funcname; \
  15. .type funcname, %function; \
  16. funcname: \
  17. .cfi_sections .debug_frame, .eh_frame; \
  18. .cfi_startproc; \
  19. .cfi_undefined x30
  20. #define START_POINT_END(name) \
  21. .cfi_endproc; \
  22. .size name, .-name;
  23. .macro GET_THREAD_SELF, dst:req
  24. #ifdef ARCH_USING_HW_THREAD_SELF
  25. mrs x0, tpidr_el1
  26. #else /* !ARCH_USING_HW_THREAD_SELF */
  27. bl rt_thread_self
  28. #endif /* ARCH_USING_HW_THREAD_SELF */
  29. .if \dst != x0
  30. mov dst, x0
  31. .endif
  32. .endm
  33. #endif /* __ASM_GENERIC_H__ */