gtimer.h 746 B

123456789101112131415161718192021222324252627282930313233
  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. * 2011-12-20 GuEe-GUI first version
  9. */
  10. #ifndef __GTIMER_H__
  11. #define __GTIMER_H__
  12. #include <rtdef.h>
  13. void rt_hw_gtimer_init(void);
  14. void rt_hw_gtimer_local_enable(void);
  15. void rt_hw_gtimer_local_disable(void);
  16. void rt_hw_gtimer_enable();
  17. rt_inline void rt_hw_gtimer_disable(void)
  18. {
  19. __asm__ volatile ("msr CNTP_CTL_EL0, xzr":::"memory");
  20. }
  21. void rt_hw_set_gtimer_val(rt_uint64_t value);
  22. rt_uint64_t rt_hw_get_gtimer_val();
  23. rt_uint64_t rt_hw_get_cntpct_val();
  24. rt_uint64_t rt_hw_get_gtimer_frq();
  25. rt_uint64_t rt_hw_set_gtimer_frq(rt_uint64_t value);
  26. #endif /* __GTIMER_H__ */