tick.h 542 B

12345678910111213141516171819202122
  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. * 2018/10/28 Bernard The unify RISC-V porting code.
  9. */
  10. #ifndef TICK_H__
  11. #define TICK_H__
  12. //ask the CLINT for a timer interrupt.
  13. #define CLINT (0x2000000L)
  14. #define CLINT_MTIMECMP(hartid) (CLINT + 0x4000 + 4*(hartid))
  15. #define CLINT_MTIME (CLINT + 0xBFF8) // cycles since boot.
  16. int tick_isr(void);
  17. int rt_hw_tick_init(void);
  18. #endif