qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

hw/mips_gictimer: provide API for retrieving frequency

Provide a new function mips_gictimer_get_freq() which returns the
frequency at which a GIC timer will count. This will be useful for
boards which perform setup based upon this frequency.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>

authored by

Paul Burton and committed by
Yongbok Kim
eb90ab94 08944be1

+6
+5
hw/timer/mips_gictimer.c
··· 14 14 15 15 #define TIMER_PERIOD 10 /* 10 ns period for 100 Mhz frequency */ 16 16 17 + uint32_t mips_gictimer_get_freq(MIPSGICTimerState *gic) 18 + { 19 + return NANOSECONDS_PER_SECOND / TIMER_PERIOD; 20 + } 21 + 17 22 static void gic_vptimer_update(MIPSGICTimerState *gictimer, 18 23 uint32_t vp_index, uint64_t now) 19 24 {
+1
include/hw/timer/mips_gictimer.h
··· 31 31 MIPSGICTimerCB *cb; 32 32 }; 33 33 34 + uint32_t mips_gictimer_get_freq(MIPSGICTimerState *gic); 34 35 uint32_t mips_gictimer_get_sh_count(MIPSGICTimerState *gic); 35 36 void mips_gictimer_store_sh_count(MIPSGICTimerState *gic, uint64_t count); 36 37 uint32_t mips_gictimer_get_vp_compare(MIPSGICTimerState *gictimer,