2
0

mips_gictimer.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2016 Imagination Technologies
  7. *
  8. */
  9. #ifndef MIPS_GICTIMER_H
  10. #define MIPS_GICTIMER_H
  11. typedef struct MIPSGICTimerVPState MIPSGICTimerVPState;
  12. typedef struct MIPSGICTimerState MIPSGICTimerState;
  13. typedef void MIPSGICTimerCB(void *opaque, uint32_t vp_index);
  14. struct MIPSGICTimerVPState {
  15. QEMUTimer *qtimer;
  16. uint32_t vp_index;
  17. uint32_t comparelo;
  18. MIPSGICTimerState *gictimer;
  19. };
  20. struct MIPSGICTimerState {
  21. void *opaque;
  22. uint8_t countstop;
  23. uint32_t sh_counterlo;
  24. int32_t num_vps;
  25. MIPSGICTimerVPState *vptimers;
  26. MIPSGICTimerCB *cb;
  27. };
  28. uint32_t mips_gictimer_get_freq(MIPSGICTimerState *gic);
  29. uint32_t mips_gictimer_get_sh_count(MIPSGICTimerState *gic);
  30. void mips_gictimer_store_sh_count(MIPSGICTimerState *gic, uint64_t count);
  31. uint32_t mips_gictimer_get_vp_compare(MIPSGICTimerState *gictimer,
  32. uint32_t vp_index);
  33. void mips_gictimer_store_vp_compare(MIPSGICTimerState *gic, uint32_t vp_index,
  34. uint64_t compare);
  35. uint8_t mips_gictimer_get_countstop(MIPSGICTimerState *gic);
  36. void mips_gictimer_start_count(MIPSGICTimerState *gic);
  37. void mips_gictimer_stop_count(MIPSGICTimerState *gic);
  38. MIPSGICTimerState *mips_gictimer_init(void *opaque, uint32_t nvps,
  39. MIPSGICTimerCB *cb);
  40. #endif /* MIPS_GICTIMER_H */