cuda.c: return error for unknown commands
authorAlyssa Milburn <fuzzie@fuzzie.org>
Fri, 22 Jan 2016 23:07:24 +0000 (23:07 +0000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Sat, 30 Jan 2016 12:37:38 +0000 (23:37 +1100)
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 <fuzzie@fuzzie.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/misc/macio/cuda.c

index 0bd90e84565ff7937b63b9a14248af7c9b01a3bf..316c1ac8da582b79ed3b4ca0aa18869251f633bc 100644 (file)
@@ -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;
     }
 }