lwp_arch.h 1.6 KB

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