qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] rtl8139 timer interrupt rewrote


From: Igor Kovalenko
Subject: Re: [Qemu-devel] [PATCH] rtl8139 timer interrupt rewrote
Date: Mon, 8 Feb 2010 08:33:35 +0300

On Sun, Feb 7, 2010 at 6:22 PM, Frediano Ziglio <address@hidden> wrote:
> rewrote timer implementation for rtl8139. Add a QEMU
> timer only when needed (timeout status not set, timeout irq wanted and
> timer set).
>
> Signed-off-by: Frediano Ziglio <address@hidden>
> --
> diff --git a/hw/rtl8139.c b/hw/rtl8139.c
> index f04dd54..0d877b7 100644
> --- a/hw/rtl8139.c
> +++ b/hw/rtl8139.c
> @@ -41,6 +41,10 @@
>  *                                  segmentation offloading
>  *                                  Removed slirp.h dependency
>  *                                  Added rx/tx buffer reset when
> enabling rx/tx operation
> + *
> + *  2009-Feb-04  Frediano Ziglio:   Rewrote timer support using QEMU timer 
> only
> + *                                  when strictly needed (required for for
> + *                                  Darwin)
>  */
>
>  #include "hw.h"
> @@ -61,7 +65,7 @@
>  #define RTL8139_CALCULATE_RXCRC 1
>
>  /* Uncomment to enable on-board timer interrupts */
> -//#define RTL8139_ONBOARD_TIMER 1
> +#define RTL8139_ONBOARD_TIMER 1

Please remove this macro.

>
> +static void rtl8139_pre_save(void *opaque)
> +{
> +    RTL8139State* s = opaque;
> +
> +    // set IntrStatus correctly
> +    int64_t current_time = qemu_get_clock(vm_clock);
> +    rtl8139_set_next_tctr_time(s, current_time);
> +    s->TCTR = muldiv64(current_time - s->TCTR_base, PCI_FREQUENCY,
> +                       get_ticks_per_sec());
> +}
> +

Seems like TCTR is not used after restoring from saved state. Is it intentional?

Can you please check if freebsd works with this change?

-- 
Kind regards,
Igor V. Kovalenko




reply via email to

[Prev in Thread] Current Thread [Next in Thread]