cpuport.h 889 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. */
  9. #ifndef CPUPORT_H__
  10. #define CPUPORT_H__
  11. #include <armv8.h>
  12. #include <rtdef.h>
  13. #ifdef RT_USING_SMP
  14. typedef union {
  15. unsigned long slock;
  16. struct __arch_tickets {
  17. unsigned short owner;
  18. unsigned short next;
  19. } tickets;
  20. } rt_hw_spinlock_t;
  21. #endif
  22. rt_inline void rt_hw_isb(void)
  23. {
  24. __asm__ volatile ("isb":::"memory");
  25. }
  26. rt_inline void rt_hw_dmb(void)
  27. {
  28. __asm__ volatile ("dmb ish":::"memory");
  29. }
  30. rt_inline void rt_hw_wmb(void)
  31. {
  32. __asm__ volatile ("dmb ishst":::"memory");
  33. }
  34. rt_inline void rt_hw_rmb(void)
  35. {
  36. __asm__ volatile ("dmb ishld":::"memory");
  37. }
  38. rt_inline void rt_hw_dsb(void)
  39. {
  40. __asm__ volatile ("dsb ish":::"memory");
  41. }
  42. void _thread_start(void);
  43. #endif /*CPUPORT_H__*/