* [Qemu-devel] Serial port patch
@ 2006-08-24 14:20 Michael Brown
2006-08-24 14:45 ` [Qemu-devel] " Michael Brown
0 siblings, 1 reply; 2+ messages in thread
From: Michael Brown @ 2006-08-24 14:20 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 408 bytes --]
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.
Michael
[-- Attachment #2: Type: TEXT/PLAIN, Size: 971 bytes --]
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:18:19 -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_16s(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_16s(f,&s->divider);
qemu_get_8s(f,&s->rbr);
qemu_get_8s(f,&s->ier);
qemu_get_8s(f,&s->iir);
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Qemu-devel] Re: Serial port patch
2006-08-24 14:20 [Qemu-devel] Serial port patch Michael Brown
@ 2006-08-24 14:45 ` Michael Brown
0 siblings, 0 replies; 2+ messages in thread
From: Michael Brown @ 2006-08-24 14:45 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 556 bytes --]
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
[-- Attachment #2: Type: TEXT/PLAIN, Size: 975 bytes --]
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-24 14:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-24 14:20 [Qemu-devel] Serial port patch Michael Brown
2006-08-24 14:45 ` [Qemu-devel] " Michael Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).