lwp_arch.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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-05-18 Jesven first version
  9. */
  10. #ifndef LWP_ARCH_H__
  11. #define LWP_ARCH_H__
  12. #include <lwp.h>
  13. #include <lwp_arch_comm.h>
  14. #ifdef ARCH_MM_MMU
  15. #define USER_VADDR_TOP 0x0001000000000000UL
  16. #define USER_HEAP_VADDR (0x0000ffff40000000UL)
  17. #define USER_HEAP_VEND USER_STACK_VSTART
  18. #define USER_STACK_VSTART 0x0000ffff70000000UL
  19. #define USER_STACK_VEND (USER_STACK_VSTART + 0x10000000)
  20. #define USER_ARG_VADDR USER_STACK_VEND
  21. #define LDSO_LOAD_VADDR 0x60000000UL
  22. #define USER_VADDR_START 0x00200000UL
  23. #define USER_LOAD_VADDR USER_VADDR_START
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. unsigned long rt_hw_ffz(unsigned long x);
  28. rt_inline void icache_invalid_all(void)
  29. {
  30. asm volatile ("ic ialluis\n\tisb sy":::"memory");
  31. }
  32. /**
  33. * @brief Save signal-related context to user stack
  34. *
  35. * @param user_sp the current sp of user
  36. * @param exp_frame exception frame to resume former execution
  37. * @param psiginfo pointer to the siginfo
  38. * @param elr pc of former execution
  39. * @param spsr program status of former execution
  40. * @return void* the new user sp
  41. */
  42. void *arch_signal_ucontext_save(rt_base_t user_sp, siginfo_t *psiginfo,
  43. struct rt_hw_exp_stack *exp_frame,
  44. lwp_sigset_t *save_sig_mask);
  45. /**
  46. * @brief Restore the signal mask after return
  47. *
  48. * @param user_sp sp of user
  49. * @return void*
  50. */
  51. void *arch_signal_ucontext_restore(rt_base_t user_sp);
  52. #ifdef __cplusplus
  53. }
  54. #endif
  55. #endif
  56. #endif /*LWP_ARCH_H__*/