[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] upgrading emulated UART to 16550A
From: |
Thiemo Seufer |
Subject: |
Re: [Qemu-devel] [PATCH] upgrading emulated UART to 16550A |
Date: |
Tue, 5 Aug 2008 15:57:38 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Stefano Stabellini wrote:
> This patch upgrades the emulated UART to 16550A, the code comes from
> xen-unstable.
> The main improvement was introduced with the following patch and
> subsequent email thread:
>
> http://lists.xensource.com/archives/html/xen-devel/2007-12/msg00129.html
>
> I only made few changes to use qemu_get_clock instead of
> clock_gettime, as Anthony suggested a little while ago.
>
> Signed-off-by: Stefano Stabellini <address@hidden>
>
> ---
>
>
> diff --git a/hw/serial.c b/hw/serial.c
> index ffd6ac9..f63e62a 100644
> --- a/hw/serial.c
> +++ b/hw/serial.c
> @@ -1,5 +1,5 @@
> /*
> - * QEMU 16450 UART emulation
> + * QEMU 16550A UART emulation
> *
> * Copyright (c) 2003-2004 Fabrice Bellard
I think it needs also an updated copyright notice.
[snip]
> +/* Rate limit serial requests so that e.g. grub on a serial console
> + doesn't kill dom0. Simple token bucket. If we get some actual
> + data from the user, instantly refil the bucket. */
> +
> +/* How long it takes to generate a token, in nanoseconds. */
> +#define TOKEN_PERIOD 1000000
> +/* Maximum and initial size of token bucket */
> +#define TOKENS_MAX 100000
This token business probably needs a bit more explanation, at a glance
I didn't figure out what it is meant to do (and why the constants above
are good).
Thiemo