cpuport.h 849 B

1234567891011121314151617181920212223242526272829303132333435363738
  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-09-10 GuEe-GUI first version
  9. */
  10. #ifndef __CPUPORT_H__
  11. #define __CPUPORT_H__
  12. #include <rtdef.h>
  13. #define __WFI() __asm__ volatile ("wfi":::"memory")
  14. #define __WFE() __asm__ volatile ("wfe":::"memory")
  15. #define __SEV() __asm__ volatile ("sev")
  16. #define __ISB() __asm__ volatile ("isb 0xf":::"memory")
  17. #define __DSB() __asm__ volatile ("dsb 0xf":::"memory")
  18. #define __DMB() __asm__ volatile ("dmb 0xf":::"memory")
  19. rt_inline void rt_hw_isb(void)
  20. {
  21. __asm__ volatile ("isb":::"memory");
  22. }
  23. rt_inline void rt_hw_dmb(void)
  24. {
  25. __asm__ volatile ("dmb sy":::"memory");
  26. }
  27. rt_inline void rt_hw_dsb(void)
  28. {
  29. __asm__ volatile ("dsb sy":::"memory");
  30. }
  31. #endif /* __CPUPORT_H__ */