qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 01/22] hw/rtc/mc146818rtc: QOM'ify IRQ number


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 01/22] hw/rtc/mc146818rtc: QOM'ify IRQ number
Date: Sun, 27 Feb 2022 23:10:39 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1

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 <shentey@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é <f4bug@amsat.org>



reply via email to

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