cp15.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2011-09-15 Bernard first version
  9. */
  10. #ifndef __CP15_H__
  11. #define __CP15_H__
  12. #ifndef __STATIC_FORCEINLINE
  13. #define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline
  14. #endif
  15. #define __WFI() __asm__ volatile ("wfi":::"memory")
  16. #define __WFE() __asm__ volatile ("wfe":::"memory")
  17. #define __SEV() __asm__ volatile ("sev")
  18. __STATIC_FORCEINLINE void __ISB(void)
  19. {
  20. __asm__ volatile ("isb 0xF":::"memory");
  21. }
  22. /**
  23. \brief Data Synchronization Barrier
  24. \details Acts as a special kind of Data Memory Barrier.
  25. It completes when all explicit memory accesses before this instruction complete.
  26. */
  27. __STATIC_FORCEINLINE void __DSB(void)
  28. {
  29. __asm__ volatile ("dsb 0xF":::"memory");
  30. }
  31. /**
  32. \brief Data Memory Barrier
  33. \details Ensures the apparent order of the explicit memory operations before
  34. and after the instruction, without ensuring their completion.
  35. */
  36. __STATIC_FORCEINLINE void __DMB(void)
  37. {
  38. __asm__ volatile ("dmb 0xF":::"memory");
  39. }
  40. unsigned long rt_cpu_get_smp_id(void);
  41. void rt_cpu_mmu_disable(void);
  42. void rt_cpu_mmu_enable(void);
  43. void rt_cpu_tlb_set(volatile unsigned long*);
  44. void rt_cpu_dcache_clean_flush(void);
  45. void rt_cpu_icache_flush(void);
  46. void rt_cpu_vector_set_base(rt_ubase_t addr);
  47. void rt_hw_mmu_init(void);
  48. void rt_hw_vector_init(void);
  49. void set_timer_counter(unsigned int counter);
  50. void set_timer_control(unsigned int control);
  51. #endif