lwp_arch.h 972 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. */
  9. #ifndef LWP_ARCH_H__
  10. #define LWP_ARCH_H__
  11. #include <lwp.h>
  12. #ifdef RT_USING_USERSPACE
  13. #define USER_HEAP_VADDR 0x300000000UL
  14. #define USER_STACK_VSTART 0x270000000UL
  15. #define USER_STACK_VEND USER_HEAP_VADDR
  16. #define LDSO_LOAD_VADDR 0x200000000UL
  17. #define USER_VADDR_START 0x100000000UL
  18. #define USER_LOAD_VADDR USER_VADDR_START
  19. #define MMU_MAP_U_RWCB 0
  20. #define MMU_MAP_U_RW 0
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. int arch_user_space_init(struct rt_lwp *lwp);
  25. void arch_user_space_vtable_free(struct rt_lwp *lwp);
  26. void *arch_kernel_mmu_table_get(void);
  27. void arch_kuser_init(rt_mmu_info *mmu_info, void *vectors);
  28. int arch_expand_user_stack(void *addr);
  29. rt_inline unsigned long ffz(unsigned long x)
  30. {
  31. return __builtin_ffs(~x) - 1;
  32. }
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif
  37. #endif /*LWP_ARCH_H__*/