On 6/12/22 21:06, Thomas Huth wrote:
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(-)

Cool!

Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>


Reply via email to