[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/29] rtc: add RTC_ISA_BASE
From: |
Michael S. Tsirkin |
Subject: |
[PULL 08/29] rtc: add RTC_ISA_BASE |
Date: |
Mon, 4 May 2020 10:29:32 -0400 |
From: Gerd Hoffmann <address@hidden>
Add and use RTC_ISA_BASE define instead of hardcoding 0x70.
Signed-off-by: Gerd Hoffmann <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
---
include/hw/rtc/mc146818rtc.h | 1 +
hw/rtc/mc146818rtc.c | 5 ++---
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
index 10c93a096a..3713181b56 100644
--- a/include/hw/rtc/mc146818rtc.h
+++ b/include/hw/rtc/mc146818rtc.h
@@ -47,6 +47,7 @@ typedef struct RTCState {
} RTCState;
#define RTC_ISA_IRQ 8
+#define RTC_ISA_BASE 0x70
ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
qemu_irq intercept_irq);
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index dc4269cc55..d18c09911b 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -908,7 +908,6 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
{
ISADevice *isadev = ISA_DEVICE(dev);
RTCState *s = MC146818_RTC(dev);
- int base = 0x70;
s->cmos_data[RTC_REG_A] = 0x26;
s->cmos_data[RTC_REG_B] = 0x02;
@@ -951,7 +950,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
qemu_register_suspend_notifier(&s->suspend_notifier);
memory_region_init_io(&s->io, OBJECT(s), &cmos_ops, s, "rtc", 2);
- isa_register_ioport(isadev, &s->io, base);
+ isa_register_ioport(isadev, &s->io, RTC_ISA_BASE);
/* register rtc 0x70 port for coalesced_pio */
memory_region_set_flush_coalesced(&s->io);
@@ -960,7 +959,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
memory_region_add_subregion(&s->io, 0, &s->coalesced_io);
memory_region_add_coalescing(&s->coalesced_io, 0, 1);
- qdev_set_legacy_instance_id(dev, base, 3);
+ qdev_set_legacy_instance_id(dev, RTC_ISA_BASE, 3);
qemu_register_reset(rtc_reset, s);
object_property_add_tm(OBJECT(s), "date", rtc_get_date, NULL);
--
MST
- [PULL 00/29] virtio,acpi,pci,pc: backlog from pre-5.0, Michael S. Tsirkin, 2020/05/04
- [PULL 01/29] hw/pci/pcie: Forbid hot-plug if it's disabled on the slot, Michael S. Tsirkin, 2020/05/04
- [PULL 02/29] hw/pci/pcie: Replace PCI_DEVICE() casts with existing variable, Michael S. Tsirkin, 2020/05/04
- [PULL 03/29] move 'typedef Aml' to qemu/types.h, Michael S. Tsirkin, 2020/05/04
- [PULL 05/29] qtest: allow DSDT acpi table changes, Michael S. Tsirkin, 2020/05/04
- [PULL 06/29] acpi: drop pointless _STA method, Michael S. Tsirkin, 2020/05/04
- [PULL 07/29] acpi: add ISADeviceClass->build_aml(), Michael S. Tsirkin, 2020/05/04
- [PULL 08/29] rtc: add RTC_ISA_BASE,
Michael S. Tsirkin <=
- [PULL 09/29] virtio-vga: fix virtio-vga bar ordering, Michael S. Tsirkin, 2020/05/04
- [PULL 11/29] vhost-user-blk: fix invalid memory access, Michael S. Tsirkin, 2020/05/04
- [PULL 12/29] checkpatch: fix acpi check with multiple file name, Michael S. Tsirkin, 2020/05/04
- [PULL 13/29] checkpatch: ignore allowed diff list, Michael S. Tsirkin, 2020/05/04
- [PULL 14/29] acpi: DSDT without _STA, Michael S. Tsirkin, 2020/05/04
- [PULL 15/29] hw/acpi/nvdimm: Fix for NVDIMM incorrect DSM output buffer length, Michael S. Tsirkin, 2020/05/04
- [PULL 16/29] nvdimm: Use configurable ACPI IO base and size, Michael S. Tsirkin, 2020/05/04
- [PULL 20/29] bios-tables-test: test pc-dimm and nvdimm coldplug for arm/virt, Michael S. Tsirkin, 2020/05/04
- [PULL 21/29] tests/acpi: add expected tables for bios-tables-test, Michael S. Tsirkin, 2020/05/04
- [PULL 22/29] Refactor vhost_user_set_mem_table functions, Michael S. Tsirkin, 2020/05/04