cpuport.h 664 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #ifdef RT_USING_SMP
  13. typedef union {
  14. unsigned long slock;
  15. struct __arch_tickets {
  16. unsigned short owner;
  17. unsigned short next;
  18. } tickets;
  19. } rt_hw_spinlock_t;
  20. #endif
  21. rt_inline void rt_hw_isb(void)
  22. {
  23. asm volatile ("isb":::"memory");
  24. }
  25. rt_inline void rt_hw_dmb(void)
  26. {
  27. asm volatile ("dmb sy":::"memory");
  28. }
  29. rt_inline void rt_hw_dsb(void)
  30. {
  31. asm volatile ("dsb sy":::"memory");
  32. }
  33. #endif /*CPUPORT_H__*/