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

2010/2/8 Igor Kovalenko <igor.v.kovalenko@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.
>

Removed (see updated patch)

>>
>> +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?
>

Yes, wanted, mainly TCTR is computed from TCTR_base and tick counts so
is currently quite unused but is computed for compatibility with
previous state.

> Can you please check if freebsd works with this change?
>

Yes, it works correctly. I don't know FreeBSD that much but I
downloaded latest 8.0 live version, got a shell, configured with
network manually with old ifconfig and tried some data exchange
(mainly scp/ssh).

Regards
 Frediano Ziglio

  reply	other threads:[~2010-02-08 10: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
2010-02-08 10:33   ` Frediano Ziglio [this message]
  -- 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=aa1b71111002080233i927024cra3960f9d586a818b@mail.gmail.com \
    --to=freddy77@gmail.com \
    --cc=igor.v.kovalenko@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).