From ff57eae5f119ce2c6fbaab1313e3487969533fb9 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Wed, 6 Jan 2016 20:37:26 +0000 Subject: cuda: add missing fields to VMStateDescription Include some fields missed from the previous VMState conversion to the migration stream, as well as the new SR_INT delay timer. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/misc/macio/cuda.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'hw/misc/macio/cuda.c') diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index 8d450cfce2..0bd90e8456 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -705,15 +705,17 @@ static const VMStateDescription vmstate_cuda_timer = { static const VMStateDescription vmstate_cuda = { .name = "cuda", - .version_id = 2, - .minimum_version_id = 2, + .version_id = 3, + .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_UINT8(a, CUDAState), VMSTATE_UINT8(b, CUDAState), + VMSTATE_UINT8(last_b, CUDAState), VMSTATE_UINT8(dira, CUDAState), VMSTATE_UINT8(dirb, CUDAState), VMSTATE_UINT8(sr, CUDAState), VMSTATE_UINT8(acr, CUDAState), + VMSTATE_UINT8(last_acr, CUDAState), VMSTATE_UINT8(pcr, CUDAState), VMSTATE_UINT8(ifr, CUDAState), VMSTATE_UINT8(ier, CUDAState), @@ -728,6 +730,7 @@ static const VMStateDescription vmstate_cuda = { VMSTATE_STRUCT_ARRAY(timers, CUDAState, 2, 1, vmstate_cuda_timer, CUDATimer), VMSTATE_TIMER_PTR(adb_poll_timer, CUDAState), + VMSTATE_TIMER_PTR(sr_delay_timer, CUDAState), VMSTATE_END_OF_LIST() } }; -- cgit 1.4.1 From ff472a5badf8e6d964455de39ca67ea3a7758dea Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 22 Jan 2016 23:07:24 +0000 Subject: cuda.c: return error for unknown commands This avoids MacsBug hanging at startup in the absence of ADB mouse input, by replying with an error (which is also what MOL does) when it sends an unknown command (0x1c). Signed-off-by: Alyssa Milburn Signed-off-by: David Gibson --- hw/misc/macio/cuda.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/misc/macio/cuda.c') diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index 0bd90e8456..316c1ac8da 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -606,6 +606,11 @@ static void cuda_receive_packet(CUDAState *s, } break; default: + obuf[0] = ERROR_PACKET; + obuf[1] = 0x2; + obuf[2] = CUDA_PACKET; + obuf[3] = data[0]; + cuda_send_packet_to_host(s, obuf, 4); break; } } -- cgit 1.4.1