From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NeMFl-000666-OQ for qemu-devel@nongnu.org; Mon, 08 Feb 2010 00:33:45 -0500 Received: from [199.232.76.173] (port=59321 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeMFk-00065s-RC for qemu-devel@nongnu.org; Mon, 08 Feb 2010 00:33:44 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NeMFf-0007UD-8d for qemu-devel@nongnu.org; Mon, 08 Feb 2010 00:33:44 -0500 Received: from mail-fx0-f209.google.com ([209.85.220.209]:55650) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NeMFe-0007TD-M5 for qemu-devel@nongnu.org; Mon, 08 Feb 2010 00:33:39 -0500 Received: by fxm1 with SMTP id 1so6552991fxm.4 for ; Sun, 07 Feb 2010 21:33:35 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 8 Feb 2010 08:33:35 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH] rtl8139 timer interrupt rewrote From: Igor Kovalenko Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Frediano Ziglio Cc: qemu-devel@nongnu.org On Sun, Feb 7, 2010 at 6:22 PM, Frediano Ziglio 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 > -- > 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 @@ > =A0* =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0s= egmentation offloading > =A0* =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0R= emoved slirp.h dependency > =A0* =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0A= dded rx/tx buffer reset when > enabling rx/tx operation > + * > + * =A02009-Feb-04 =A0Frediano Ziglio: =A0 Rewrote timer support using QE= MU timer only > + * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0wh= en strictly needed (required for for > + * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Da= rwin) > =A0*/ > > =A0#include "hw.h" > @@ -61,7 +65,7 @@ > =A0#define RTL8139_CALCULATE_RXCRC 1 > > =A0/* 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) > +{ > + =A0 =A0RTL8139State* s =3D opaque; > + > + =A0 =A0// set IntrStatus correctly > + =A0 =A0int64_t current_time =3D qemu_get_clock(vm_clock); > + =A0 =A0rtl8139_set_next_tctr_time(s, current_time); > + =A0 =A0s->TCTR =3D muldiv64(current_time - s->TCTR_base, PCI_FREQUENCY, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 get_ticks_per_sec()); > +} > + Seems like TCTR is not used after restoring from saved state. Is it intenti= onal? Can you please check if freebsd works with this change? --=20 Kind regards, Igor V. Kovalenko