From: Michael Brown <mbrown@fensystems.co.uk>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: Serial port patch
Date: Thu, 24 Aug 2006 15:45:15 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.62.0608241544110.17165@dolphin.home> (raw)
In-Reply-To: <Pine.LNX.4.62.0608241517570.2090@dolphin.home>
[-- 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);
prev parent reply other threads:[~2006-08-24 14:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-24 14:20 [Qemu-devel] Serial port patch Michael Brown
2006-08-24 14:45 ` Michael Brown [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.62.0608241544110.17165@dolphin.home \
--to=mbrown@fensystems.co.uk \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).