aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfimov Vasily <real@ispras.ru>2016-06-22 15:24:57 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2016-06-29 14:03:46 +0200
commit3638439d541835f20fb76346f14549800046af76 (patch)
treeedc7c8e791da2354745ca4238a34e92a51e251d2
parent250263033c5343012b2cd6f01210ffb5b908a159 (diff)
downloadqemu-3638439d541835f20fb76346f14549800046af76.zip
qemu-3638439d541835f20fb76346f14549800046af76.tar.gz
qemu-3638439d541835f20fb76346f14549800046af76.tar.bz2
MC146818 RTC: add GPIO access to output IRQ
The MC146818 RTC device has output IRQ line. Currently the corresponding field is only accessible through direct access. Such access violates Qemu model. The patch makes the field accessible through GPIO. It also updates the setting of the IRQ during initialization. Signed-off-by: Efimov Vasily <real@ispras.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--hw/timer/mc146818rtc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index f4e333e..ea625f2 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -906,6 +906,8 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
object_property_add_alias(qdev_get_machine(), "rtc-time",
OBJECT(s), "date", NULL);
+
+ qdev_init_gpio_out(dev, &s->irq, 1);
}
ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
@@ -920,9 +922,9 @@ ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
qdev_prop_set_int32(dev, "base_year", base_year);
qdev_init_nofail(dev);
if (intercept_irq) {
- s->irq = intercept_irq;
+ qdev_connect_gpio_out(dev, 0, intercept_irq);
} else {
- isa_init_irq(isadev, &s->irq, RTC_ISA_IRQ);
+ isa_connect_gpio_out(isadev, 0, RTC_ISA_IRQ);
}
QLIST_INSERT_HEAD(&rtc_devices, s, link);