cuda: factor out timebase-derived counter value and load time
commitce19480e916fe2f854a98b99149a18d0d78e71e5
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fri, 9 Feb 2018 18:51:38 +0000 (9 18:51 +0000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Sat, 10 Feb 2018 23:16:52 +0000 (11 10:16 +1100)
tree5302976555e78ecc04a23793e428654d7187c503
parenta797ec500ae90b201b9098655c8f875303f1d843
cuda: factor out timebase-derived counter value and load time

Commit b981289c49 "PPC: Cuda: Use cuda timer to expose tbfreq to guest" altered
the timer calculations from those based upon the hardware CUDA clock frequency
to those based upon the CPU timebase frequency.

In fact we can isolate the differences to 2 simple changes: one to the counter
read value and another to the counter load time. Move these changes into
separate functions so the implementation can be swapped later.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/misc/macio/cuda.c