On 22/2/22 20:34, Bernhard Beschow wrote:
Exposing the IRQ number as a QOM property not only allows it to be
configurable but also to be printed by standard QOM mechanisms. This allows
isabus_dev_print() to be retired eventually.

Signed-off-by: Bernhard Beschow <shen...@gmail.com>
---
  hw/isa/piix4.c               |  2 +-
  hw/rtc/mc146818rtc.c         | 13 +++++++++++--
  include/hw/rtc/mc146818rtc.h |  1 +
  3 files changed, 13 insertions(+), 3 deletions(-)

@@ -975,6 +982,7 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, 
qemu_irq intercept_irq)
static Property mc146818rtc_properties[] = {
      DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980),
+    DEFINE_PROP_UINT32("irq", RTCState, isairq, RTC_ISA_IRQ),
      DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
                                 lost_tick_policy, LOST_TICK_POLICY_DISCARD),
      DEFINE_PROP_END_OF_LIST(),

diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
index 5b45b22924..c7586589ad 100644
--- a/include/hw/rtc/mc146818rtc.h
+++ b/include/hw/rtc/mc146818rtc.h
@@ -26,6 +26,7 @@ struct RTCState {
      uint8_t cmos_data[128];
      uint8_t cmos_index;
      int32_t base_year;
+    uint32_t isairq;
      uint64_t base_rtc;
      uint64_t last_update;
      int64_t offset;

Enough using DEFINE_PROP_UINT8 / uint8_t, otherwise:

Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org>

Reply via email to