qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 for-8.0] hw/rtc/mc146818rtc: Make this rtc device target i


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 for-8.0] hw/rtc/mc146818rtc: Make this rtc device target independent
Date: Fri, 9 Dec 2022 15:26:17 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

On 9/12/22 12:15, Thomas Huth wrote:
The only reason for this code being target dependent is the apic-related
code in rtc_policy_slew_deliver_irq(). Since these apic functions are rather
simple, we can easily move them into a new, separate file (apic_irqcount.c)
which will always be compiled and linked if either APIC or the mc146818 device
are required. This way we can get rid of the #ifdef TARGET_I386 switches in
mc146818rtc.c and declare it in the softmmu_ss instead of specific_ss, so
that the code only gets compiled once for all targets.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
  v2: Move the apic functions into a separate file instead of using
      an ugly function pointer

  include/hw/i386/apic.h          |  1 +
  include/hw/i386/apic_internal.h |  1 -
  include/hw/rtc/mc146818rtc.h    |  1 +
  hw/intc/apic_common.c           | 27 -----------------
  hw/intc/apic_irqcount.c         | 53 +++++++++++++++++++++++++++++++++
  hw/rtc/mc146818rtc.c            | 25 +++++-----------
  hw/intc/meson.build             |  6 +++-
  hw/rtc/meson.build              |  3 +-
  8 files changed, 68 insertions(+), 49 deletions(-)
  create mode 100644 hw/intc/apic_irqcount.c

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]