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
6 * Copyright (C) 2016 Imagination Technologies
10 #ifndef MIPS_GICTIMER_H
11 #define MIPS_GICTIMER_H
13 typedef struct MIPSGICTimerVPState MIPSGICTimerVPState
;
14 typedef struct MIPSGICTimerState MIPSGICTimerState
;
16 typedef void MIPSGICTimerCB(void *opaque
, uint32_t vp_index
);
18 struct MIPSGICTimerVPState
{
22 MIPSGICTimerState
*gictimer
;
25 struct MIPSGICTimerState
{
28 uint32_t sh_counterlo
;
30 MIPSGICTimerVPState
*vptimers
;
34 uint32_t mips_gictimer_get_freq(MIPSGICTimerState
*gic
);
35 uint32_t mips_gictimer_get_sh_count(MIPSGICTimerState
*gic
);
36 void mips_gictimer_store_sh_count(MIPSGICTimerState
*gic
, uint64_t count
);
37 uint32_t mips_gictimer_get_vp_compare(MIPSGICTimerState
*gictimer
,
39 void mips_gictimer_store_vp_compare(MIPSGICTimerState
*gic
, uint32_t vp_index
,
41 uint8_t mips_gictimer_get_countstop(MIPSGICTimerState
*gic
);
42 void mips_gictimer_start_count(MIPSGICTimerState
*gic
);
43 void mips_gictimer_stop_count(MIPSGICTimerState
*gic
);
44 MIPSGICTimerState
*mips_gictimer_init(void *opaque
, uint32_t nvps
,
47 #endif /* MIPS_GICTIMER_H */