Am 9. Dezember 2022 09:00:56 UTC schrieb Thomas Huth <th...@redhat.com>:
>On 07/12/2022 15.47, Bernhard Beschow wrote:
>>
>>
>> Am 6. Dezember 2022 20:06:41 UTC schrieb Thomas Huth <th...@redhat.com>:
>>> The only code that is really, really target dependent is the apic-related
>>> code in rtc_policy_slew_deliver_irq(). By moving this code into the hw/i386/
>>> folder (renamed to rtc_apic_policy_slew_deliver_irq()) and passing this
>>> function as parameter to mc146818_rtc_init(), we can make the RTC completely
>>> target-independent.
>>>
>>> Signed-off-by: Thomas Huth <th...@redhat.com>
>>> ---
>>> include/hw/rtc/mc146818rtc.h | 7 +++++--
>>> hw/alpha/dp264.c | 2 +-
>>> hw/hppa/machine.c | 2 +-
>>> hw/i386/microvm.c | 3 ++-
>>> hw/i386/pc.c | 10 +++++++++-
>>> hw/mips/jazz.c | 2 +-
>>> hw/ppc/pnv.c | 2 +-
>>> hw/rtc/mc146818rtc.c | 34 +++++++++++-----------------------
>>> hw/rtc/meson.build | 3 +--
>>> 9 files changed, 32 insertions(+), 33 deletions(-)
>>>
>>> diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
>>> index 1db0fcee92..c687953cc4 100644
>>> --- a/include/hw/rtc/mc146818rtc.h
>>> +++ b/include/hw/rtc/mc146818rtc.h
>>> @@ -46,14 +46,17 @@ struct RTCState {
>>> Notifier clock_reset_notifier;
>>> LostTickPolicy lost_tick_policy;
>>
>> This lost_tick_policy attribute along with its enum is now redundant and can
>> be removed. Removing it avoids an error condition (see below).
>
>lost_tick_policy is used for a property of the device which gets set from
>softmmu/rtc.c, so I would not say that it is unused ... or do I miss something?
Never mind. I was mislead by the switch statement but there are more policies.
Also, the enum is also used in the PIT.
Best regards,
Bernhard
>
> Thomas
>