cpuport.h 683 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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-7-14 JasonHu The first version
  9. */
  10. #ifndef __CPUPORT_H__
  11. #define __CPUPORT_H__
  12. #include <rtconfig.h>
  13. #include <rtdef.h>
  14. #ifndef __ASSEMBLY__
  15. /* write memory */
  16. rt_inline void rt_hw_dsb(void)
  17. {
  18. asm volatile ("sfence": : :"memory");
  19. }
  20. /* read memory */
  21. rt_inline void rt_hw_dmb(void)
  22. {
  23. asm volatile ("lfence": : :"memory");
  24. }
  25. /* instruction */
  26. rt_inline void rt_hw_isb(void)
  27. {
  28. asm volatile ("": : :"memory");
  29. }
  30. #endif /* __ASSEMBLY__ */
  31. void rt_hw_cpu_init();
  32. #endif /* __CPUPORT_H__ */