lwp_arch.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-07-18 JasonHu first version
  9. */
  10. #ifndef LWP_ARCH_H__
  11. #define LWP_ARCH_H__
  12. #include <lwp.h>
  13. #include <lwp_arch_comm.h>
  14. #include <stackframe.h>
  15. #ifdef ARCH_MM_MMU
  16. #define USER_VADDR_TOP 0xFFFFF000UL
  17. #define USER_HEAP_VEND 0xE0000000UL
  18. #define USER_HEAP_VADDR 0x90000000UL
  19. #define USER_STACK_VSTART 0x80000000UL
  20. #define USER_STACK_VEND USER_HEAP_VADDR
  21. #define LDSO_LOAD_VADDR 0x70000000UL
  22. #define USER_VADDR_START 0x40000000UL
  23. #define USER_LOAD_VADDR USER_VADDR_START
  24. #define SIGNAL_RETURN_SYSCAL_ID 0xe000
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. rt_thread_t rt_thread_sp_to_thread(void *spmember_addr);
  29. void lwp_signal_do_return(rt_hw_stack_frame_t *frame);
  30. rt_inline unsigned long rt_hw_ffz(unsigned long x)
  31. {
  32. return __builtin_ffsl(~x) - 1;
  33. }
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif /* ARCH_MM_MMU */
  38. #endif /*LWP_ARCH_H__*/