On Thu, 24 Aug 2006, Michael Brown wrote:
I've found what looks like a bug in hw/serial.c; the structure field
"divider" is only a uint8_t, but should be a uint16_t. This currently
breaks Etherboot, which is somewhat paranoid about the UART and will
verify that both bytes of the divider are functional. (Don't ask me
why.)
The attached patch fixes the problem for Etherboot.
Please cc me on any replies, since I am not a list member.
Sorry; sent the wrong version of the patch by mistake. This should be the
right one!
Michael
Index: hw/serial.c
===================================================================
RCS file: /sources/qemu/qemu/hw/serial.c,v
retrieving revision 1.12
diff -u -r1.12 serial.c
--- hw/serial.c 12 Apr 2006 20:42:42 -0000 1.12
+++ hw/serial.c 24 Aug 2006 14:44:43 -0000
@@ -71,7 +71,7 @@
#define UART_LSR_DR 0x01 /* Receiver data ready */
struct SerialState {
- uint8_t divider;
+ uint16_t divider;
uint8_t rbr; /* receive register */
uint8_t ier;
uint8_t iir; /* read only */
@@ -310,7 +310,7 @@
{
SerialState *s = opaque;
- qemu_put_8s(f,&s->divider);
+ qemu_put_be16s(f,&s->divider);
qemu_put_8s(f,&s->rbr);
qemu_put_8s(f,&s->ier);
qemu_put_8s(f,&s->iir);
@@ -328,7 +328,7 @@
if(version_id != 1)
return -EINVAL;
- qemu_get_8s(f,&s->divider);
+ qemu_get_be16s(f,&s->divider);
qemu_get_8s(f,&s->rbr);
qemu_get_8s(f,&s->ier);
qemu_get_8s(f,&s->iir);
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel