asm-generic.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #define TRACE_SYMBOL(name)
  24. .macro NEVER_RETURN
  25. #ifdef RT_USING_DEBUG
  26. b .
  27. #endif /* RT_USING_DEBUG */
  28. .endm
  29. .macro GET_THREAD_SELF, dst:req
  30. #ifdef ARCH_USING_HW_THREAD_SELF
  31. mrs x0, tpidr_el1
  32. #else /* !ARCH_USING_HW_THREAD_SELF */
  33. bl rt_thread_self
  34. #endif /* ARCH_USING_HW_THREAD_SELF */
  35. .if \dst != x0
  36. mov dst, x0
  37. .endif
  38. .endm
  39. #endif /* __ASM_GENERIC_H__ */