diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2016-04-18 10:07:45 +0200 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 20:03:49 -0600 |
commit | 9f6f44219b9189b007da7a09cfdefd97a327b9b5 (patch) | |
tree | fdf922009f50fd9ef155ecfd610cc11463985d83 | |
parent | d9583ca65e7cbcbaa84dcb36ae9b1e5b7b1380ec (diff) | |
download | hqemu-9f6f44219b9189b007da7a09cfdefd97a327b9b5.zip hqemu-9f6f44219b9189b007da7a09cfdefd97a327b9b5.tar.gz |
cuda: fix off-by-one error in SET_TIME command
With the new framework the cuda_cmd_set_time command directly receive
the data, without the command byte. Therefore the time is stored at
in_data[0], not at in_data[1].
This fixes the "hwclock --systohc" command in a guest.
Cc: Hervé Poussineau <hpoussin@reactos.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
[this fixes a regression introduced by e647317 "cuda: port SET_TIME
command to new framework"]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r-- | hw/misc/macio/cuda.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index c7472aa..f15f301 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -685,8 +685,8 @@ static bool cuda_cmd_set_time(CUDAState *s, return false; } - ti = (((uint32_t)in_data[1]) << 24) + (((uint32_t)in_data[2]) << 16) - + (((uint32_t)in_data[3]) << 8) + in_data[4]; + ti = (((uint32_t)in_data[0]) << 24) + (((uint32_t)in_data[1]) << 16) + + (((uint32_t)in_data[2]) << 8) + in_data[3]; s->tick_offset = ti - (qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) / NANOSECONDS_PER_SECOND); return true; |