[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 38/46] hw/rtc/mc146818rtc: Make the mc146818 RTC device target ind
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 38/46] hw/rtc/mc146818rtc: Make the mc146818 RTC device target independent |
Date: |
Fri, 13 Jan 2023 16:45:24 +0100 |
From: Thomas Huth <thuth@redhat.com>
The only reason for this code being target dependent was the IRQ-counting
related code in rtc_policy_slew_deliver_irq(). Since these functions have
been moved into a new, separate file (kvm_irqcount.c) which is now always
compiled and linked if necessary, 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>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20230110095351.611724-4-thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/rtc/mc146818rtc.c | 14 --------------
hw/rtc/meson.build | 3 +--
include/hw/rtc/mc146818rtc.h | 1 +
3 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index 947d68c257..bc1192b7ae 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -45,10 +45,6 @@
#include "qapi/visitor.h"
#include "hw/rtc/mc146818rtc_regs.h"
-#ifdef TARGET_I386
-#include "qapi/qapi-commands-misc-target.h"
-#endif
-
//#define DEBUG_CMOS
//#define DEBUG_COALESCED
@@ -112,7 +108,6 @@ static void rtc_coalesced_timer_update(RTCState *s)
static QLIST_HEAD(, RTCState) rtc_devices =
QLIST_HEAD_INITIALIZER(rtc_devices);
-#ifdef TARGET_I386
void qmp_rtc_reset_reinjection(Error **errp)
{
RTCState *s;
@@ -145,13 +140,6 @@ static void rtc_coalesced_timer(void *opaque)
rtc_coalesced_timer_update(s);
}
-#else
-static bool rtc_policy_slew_deliver_irq(RTCState *s)
-{
- assert(0);
- return false;
-}
-#endif
static uint32_t rtc_periodic_clock_ticks(RTCState *s)
{
@@ -922,12 +910,10 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
rtc_set_date_from_host(isadev);
switch (s->lost_tick_policy) {
-#ifdef TARGET_I386
case LOST_TICK_POLICY_SLEW:
s->coalesced_timer =
timer_new_ns(rtc_clock, rtc_coalesced_timer, s);
break;
-#endif
case LOST_TICK_POLICY_DISCARD:
break;
default:
diff --git a/hw/rtc/meson.build b/hw/rtc/meson.build
index dc33973384..34a4d316fa 100644
--- a/hw/rtc/meson.build
+++ b/hw/rtc/meson.build
@@ -13,5 +13,4 @@ softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true:
files('aspeed_rtc.c'))
softmmu_ss.add(when: 'CONFIG_GOLDFISH_RTC', if_true: files('goldfish_rtc.c'))
softmmu_ss.add(when: 'CONFIG_LS7A_RTC', if_true: files('ls7a_rtc.c'))
softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-rtc.c'))
-
-specific_ss.add(when: 'CONFIG_MC146818RTC', if_true: files('mc146818rtc.c'))
+softmmu_ss.add(when: 'CONFIG_MC146818RTC', if_true: files('mc146818rtc.c'))
diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
index 1db0fcee92..45bcd6f040 100644
--- a/include/hw/rtc/mc146818rtc.h
+++ b/include/hw/rtc/mc146818rtc.h
@@ -55,5 +55,6 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
qemu_irq intercept_irq);
void rtc_set_memory(ISADevice *dev, int addr, int val);
int rtc_get_memory(ISADevice *dev, int addr);
+void qmp_rtc_reset_reinjection(Error **errp);
#endif /* HW_RTC_MC146818RTC_H */
--
2.38.1
- [PULL 27/46] mips: Remove support for trap and emulate KVM, (continued)
- [PULL 27/46] mips: Remove support for trap and emulate KVM, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 28/46] mips: Always include nanomips disassembler, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 29/46] hw/pci/pci_host: Trace config accesses on unexisting functions, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 30/46] hw/pci/pci: Factor out pci_bus_map_irqs() from pci_bus_irqs(), Philippe Mathieu-Daudé, 2023/01/13
- [PULL 31/46] hw/isa/piix3: Decouple INTx-to-LNKx routing which is board-specific, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 32/46] hw/isa/piix4: Decouple INTx-to-LNKx routing which is board-specific, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 33/46] hw/mips/Kconfig: Track Malta's PIIX dependencies via Kconfig, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 35/46] hw/intc/i8259: Make using the isa_pic singleton more type-safe, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 34/46] hw/usb/hcd-uhci: Introduce TYPE_ defines for device models, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 36/46] hw/intc: Extract the IRQ counting functions into a separate file, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 38/46] hw/rtc/mc146818rtc: Make the mc146818 RTC device target independent,
Philippe Mathieu-Daudé <=
- [PULL 39/46] softmmu/rtc: Emit warning when using driftfix=slew on systems without mc146818, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 40/46] hw/pci-host/bonito: Convert to 3-phase reset, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 41/46] hw/pci-host/bonito: Use 'bonito_host' for PCI host bridge code, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 42/46] hw/pci-host/bonito: Use 'bonito_pci' for PCI function #0 code, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 44/46] hw/mips/boston: Rename MachineState 'mc' pointer to 'ms', Philippe Mathieu-Daudé, 2023/01/13
- [PULL 43/46] hw/pci-host/bonito: Declare TYPE_BONITO_PCI_HOST_BRIDGE in header, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 37/46] hw/core/qdev-properties-system: Allow the 'slew' policy only on x86, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 46/46] scripts/git.orderfile: Display MAINTAINERS changes first, Philippe Mathieu-Daudé, 2023/01/13
- [PULL 45/46] target/mips: Restrict 'qapi-commands-machine.h' to system emulation, Philippe Mathieu-Daudé, 2023/01/13
- Re: [PULL 00/46] MIPS patches for 2023-01-13, Peter Maydell, 2023/01/13