[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] rtl8139 timer interrupt rewrote
From: |
Frediano Ziglio |
Subject: |
Re: [Qemu-devel] [PATCH] rtl8139 timer interrupt rewrote |
Date: |
Mon, 8 Feb 2010 11:33:31 +0100 |
2010/2/8 Igor Kovalenko <address@hidden>:
> 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.
>
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