qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Kovalenko <igor.v.kovalenko@gmail.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] rtl8139 timer interrupt rewrote
Date: Mon, 8 Feb 2010 08:33:35 +0300	[thread overview]
Message-ID: <b2fa41d61002072133jb7dc1d0na02a9f26c549450@mail.gmail.com> (raw)
In-Reply-To: <aa1b71111002070722s525aa6dfj8f5a7e67eea60e3b@mail.gmail.com>

On Sun, Feb 7, 2010 at 6:22 PM, Frediano Ziglio <freddy77@gmail.com> 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 <freddy77@gmail.com>
> --
> 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	other threads:[~2010-02-08  5:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-07 15:22 [Qemu-devel] [PATCH] rtl8139 timer interrupt rewrote Frediano Ziglio
2010-02-08  5:33 ` Igor Kovalenko [this message]
2010-02-08 10:33   ` Frediano Ziglio
  -- strict thread matches above, loose matches on Subject: below --
2010-02-08  9:19 Frediano Ziglio

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=b2fa41d61002072133jb7dc1d0na02a9f26c549450@mail.gmail.com \
    --to=igor.v.kovalenko@gmail.com \
    --cc=freddy77@gmail.com \
    --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).