From nobody Wed Nov 12 13:14:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571405852; cv=none; d=zoho.com; s=zohoarc; b=jxVDRLyabAN3+bXi5QiwBa5sLVE1HgPcPkv/EBWo+hSrFI5Ko+XSMCKCGcWxLUkcVUhOyu/O3jlQpgubpbOkJM99wicYQ29VgoVBZyU8e4AQrkj+nZmY4wOg/cqdEAypNJaG1qBPeKZWC9UoRpGn/2bBJw9ckCu+MTqLvmA0rR0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571405852; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2rG5FQgYAcKx3rRDC4In4zSv2VKfpWv6oHblqH68UH4=; b=J0mjljuwozQBpBG76iJIAXrKWQIqCbL+JKPUrIH5xEdsgtPs80adS2OGbSeV7tLkRU4JmAY7sJrJ12ekHDy8KZsaGAmTjUYPDXvlG2QNUP9Q2dEx+1F6XA5NU9AWkc3OlZ8mfrAyO0ObB97StoVXkt0CnL1vOW3FTU6zwhx5CP4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157140585272968.95657106254498; Fri, 18 Oct 2019 06:37:32 -0700 (PDT) Received: from localhost ([::1]:40104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLSRb-0008EB-Gk for importer@patchew.org; Fri, 18 Oct 2019 09:37:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52809) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLSQG-00073i-Sl for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLSQF-0007X7-8N for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53420) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLSQE-0007WZ-71 for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:02 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 56B2C30789A0; Fri, 18 Oct 2019 13:36:01 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7DEA93CC8; Fri, 18 Oct 2019 13:35:58 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/4] mc146818rtc: move structure to header file Date: Fri, 18 Oct 2019 15:35:44 +0200 Message-Id: <20191018133547.10936-2-philmd@redhat.com> In-Reply-To: <20191018133547.10936-1-philmd@redhat.com> References: <20191018133547.10936-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 18 Oct 2019 13:36:01 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aleksandar Markovic , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Herv=C3=A9 Poussineau We are now able to embed a timer in another object. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Herv=C3=A9 Poussineau Message-Id: <20171216090228.28505-4-hpoussin@reactos.org> Reviewed-by: Aleksandar Markovic Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/timer/mc146818rtc.c | 30 ------------------------------ include/hw/timer/mc146818rtc.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 6cb378751b..e40b54e743 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -71,36 +71,6 @@ #define RTC_CLOCK_RATE 32768 #define UIP_HOLD_LENGTH (8 * NANOSECONDS_PER_SECOND / 32768) =20 -#define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RTC) - -typedef struct RTCState { - ISADevice parent_obj; - - MemoryRegion io; - MemoryRegion coalesced_io; - uint8_t cmos_data[128]; - uint8_t cmos_index; - int32_t base_year; - uint64_t base_rtc; - uint64_t last_update; - int64_t offset; - qemu_irq irq; - int it_shift; - /* periodic timer */ - QEMUTimer *periodic_timer; - int64_t next_periodic_time; - /* update-ended timer */ - QEMUTimer *update_timer; - uint64_t next_alarm_time; - uint16_t irq_reinject_on_ack_count; - uint32_t irq_coalesced; - uint32_t period; - QEMUTimer *coalesced_timer; - LostTickPolicy lost_tick_policy; - Notifier suspend_notifier; - QLIST_ENTRY(RTCState) link; -} RTCState; - static void rtc_set_time(RTCState *s); static void rtc_update_time(RTCState *s); static void rtc_set_cmos(RTCState *s, const struct tm *tm); diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc146818rtc.h index fe6ed63f71..0f1c886e5b 100644 --- a/include/hw/timer/mc146818rtc.h +++ b/include/hw/timer/mc146818rtc.h @@ -1,10 +1,43 @@ #ifndef MC146818RTC_H #define MC146818RTC_H =20 +#include "qapi/qapi-types-misc.h" +#include "qemu/queue.h" +#include "qemu/timer.h" #include "hw/isa/isa.h" #include "hw/timer/mc146818rtc_regs.h" =20 #define TYPE_MC146818_RTC "mc146818rtc" +#define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RTC) + +typedef struct RTCState { + ISADevice parent_obj; + + MemoryRegion io; + MemoryRegion coalesced_io; + uint8_t cmos_data[128]; + uint8_t cmos_index; + int32_t base_year; + uint64_t base_rtc; + uint64_t last_update; + int64_t offset; + qemu_irq irq; + int it_shift; + /* periodic timer */ + QEMUTimer *periodic_timer; + int64_t next_periodic_time; + /* update-ended timer */ + QEMUTimer *update_timer; + uint64_t next_alarm_time; + uint16_t irq_reinject_on_ack_count; + uint32_t irq_coalesced; + uint32_t period; + QEMUTimer *coalesced_timer; + Notifier clock_reset_notifier; + LostTickPolicy lost_tick_policy; + Notifier suspend_notifier; + QLIST_ENTRY(RTCState) link; +} RTCState; =20 ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq); --=20 2.21.0 From nobody Wed Nov 12 13:14:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571405927; cv=none; d=zoho.com; s=zohoarc; b=FRa6qZ9hMho+4cmzk3qObfjh3UDfHqMkpMX29F61yGfJH5YN3nzhE4v31uofQg7JNSCT4QtwNMoe1MAd8vYmw5nW0gXtMVrC3C0CBF0YXuk3YKuTXvvzdmD/inK32Oc+Ik0+gyR3qgUHWi8Bu+JnrfqqOceune3jty/1yacIC0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571405927; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hjQ/+n5d8/LB2/Q9unhBzVKuauQp1XcLA8KLvnXqSmg=; b=HLnK4q9WxrNVi1aKRp4wn6hPuJ192kep5thRTCLj3GD3BmscIs0+4S424s+BC+921yA/H/QnP7WbKctoGmoJkn2/AizOsLHuPyZjfeUxS79+alW5MdD8p6blVW+5J2YVglZEpdoFEzFKz//J6wIGB3T4q0OFXBriqVCv6EDIhYA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571405927633107.36502182233914; Fri, 18 Oct 2019 06:38:47 -0700 (PDT) Received: from localhost ([::1]:40124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLSSs-0001oi-KT for importer@patchew.org; Fri, 18 Oct 2019 09:38:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52845) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLSQO-00076P-6P for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLSQI-0007aC-Am for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56828) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLSQH-0007Yg-PT for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:06 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 071E810F12; Fri, 18 Oct 2019 13:36:05 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 082D1194BE; Fri, 18 Oct 2019 13:36:01 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/4] mc146818rtc: Move RTC_ISA_IRQ definition Date: Fri, 18 Oct 2019 15:35:45 +0200 Message-Id: <20191018133547.10936-3-philmd@redhat.com> In-Reply-To: <20191018133547.10936-1-philmd@redhat.com> References: <20191018133547.10936-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 18 Oct 2019 13:36:05 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 The ISA default number for the RTC devices is not related to its registers neither. Move this definition to "hw/timer/mc146818rtc.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- include/hw/timer/mc146818rtc.h | 2 ++ include/hw/timer/mc146818rtc_regs.h | 2 -- tests/rtc-test.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc146818rtc.h index 0f1c886e5b..17761cf6d9 100644 --- a/include/hw/timer/mc146818rtc.h +++ b/include/hw/timer/mc146818rtc.h @@ -39,6 +39,8 @@ typedef struct RTCState { QLIST_ENTRY(RTCState) link; } RTCState; =20 +#define RTC_ISA_IRQ 8 + ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq); void rtc_set_memory(ISADevice *dev, int addr, int val); diff --git a/include/hw/timer/mc146818rtc_regs.h b/include/hw/timer/mc14681= 8rtc_regs.h index bfbb57e570..631f71cfd9 100644 --- a/include/hw/timer/mc146818rtc_regs.h +++ b/include/hw/timer/mc146818rtc_regs.h @@ -27,8 +27,6 @@ =20 #include "qemu/timer.h" =20 -#define RTC_ISA_IRQ 8 - #define RTC_SECONDS 0 #define RTC_SECONDS_ALARM 1 #define RTC_MINUTES 2 diff --git a/tests/rtc-test.c b/tests/rtc-test.c index 6309b0ef6c..18f895690f 100644 --- a/tests/rtc-test.c +++ b/tests/rtc-test.c @@ -15,6 +15,7 @@ =20 #include "libqtest-single.h" #include "qemu/timer.h" +#include "hw/timer/mc146818rtc.h" #include "hw/timer/mc146818rtc_regs.h" =20 #define UIP_HOLD_LENGTH (8 * NANOSECONDS_PER_SECOND / 32768) --=20 2.21.0 From nobody Wed Nov 12 13:14:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571405859; cv=none; d=zoho.com; s=zohoarc; b=U30QGippMufACRcWYWP87NNBRpQ4khJD1Zd/4U6gNBhsicITrbwITFDlcEy0SUyicimQdDEmgx1cEjQa1e2ToIZgSSsESNg2N6jk514JoSSlVixZhH1l/j2eCUcnZ5L99Z0qn2wKhmmJbscW2Q5J4g7/H4Sx0LguhSWBdUwmuU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571405859; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9j68SDHOI1X1eTXZ/NkJtWzSytrOorUgb4RObiYLWRM=; b=gEArA5PBxk83LzEMQpfQDPsggzqSq8Rtf8/Oy9fnSyaO8l+gURsVcNgqB8i+C9WWbYCikuH0hf4f5q+1JkZXH/kqbOnVWgJAf2H+RWFawHz5KWFmhakSSZe9rUfGlrQnnJvy1gvTlcUl4J/h+Xax6nOcr2DPaB5f5PF0/3HJ3vY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571405859928669.3264108806164; Fri, 18 Oct 2019 06:37:39 -0700 (PDT) Received: from localhost ([::1]:40106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLSRl-00006S-PC for importer@patchew.org; Fri, 18 Oct 2019 09:37:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52905) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLSQY-0007Du-Cp for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLSQU-0007i2-TU for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44240) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLSQR-0007fY-Fk for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:16 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31AB446671; Fri, 18 Oct 2019 13:36:13 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7AF34194BE; Fri, 18 Oct 2019 13:36:05 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 3/4] mc146818rtc: Include mc146818rtc_regs.h directly in mc146818rtc.c Date: Fri, 18 Oct 2019 15:35:46 +0200 Message-Id: <20191018133547.10936-4-philmd@redhat.com> In-Reply-To: <20191018133547.10936-1-philmd@redhat.com> References: <20191018133547.10936-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 18 Oct 2019 13:36:13 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Devices/boards wanting to use the MC146818 RTC don't need the knowledge its internal registers. Move the "mc146818rtc_regs.h" inclusion to mc146818rtc.c where it is required. We can not move this file from include/hw/timer/ to hw/timer/ for local inclusion because the ACPI FADT table use the RTC_CENTURY register address. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/timer/mc146818rtc.c | 1 + include/hw/timer/mc146818rtc.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index e40b54e743..0c04b74c2e 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -41,6 +41,7 @@ #include "qapi/qapi-events-misc-target.h" #include "qapi/visitor.h" #include "exec/address-spaces.h" +#include "hw/timer/mc146818rtc_regs.h" =20 #ifdef TARGET_I386 #include "hw/i386/apic.h" diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc146818rtc.h index 17761cf6d9..a857dcdc69 100644 --- a/include/hw/timer/mc146818rtc.h +++ b/include/hw/timer/mc146818rtc.h @@ -5,7 +5,6 @@ #include "qemu/queue.h" #include "qemu/timer.h" #include "hw/isa/isa.h" -#include "hw/timer/mc146818rtc_regs.h" =20 #define TYPE_MC146818_RTC "mc146818rtc" #define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RTC) --=20 2.21.0 From nobody Wed Nov 12 13:14:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571406003; cv=none; d=zoho.com; s=zohoarc; b=NJzOlm42d7bHfambvx6TC7nUN1QYMlz3EAkGMIGMbUTvf7B++NQNJfzscKyRsekD74iI/KjyR0Xx/xKK3A+OwDnjjS5aQVWOvO3w8g4uxESR6vZTHebP6wS60Ab6gLUb7c29kl7Kig5hbUxGNajIIT0W8lotRhZZ1H/o6joMvUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571406003; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aj2GGERbCYpiVDgUnyWb/VOke/bU7G77q5lWwnRywxI=; b=idgyykPrEOw/tDmh3rkolfTX97i4vSKYbc9kuDdbehd68I+1rV5QcRQRDeBBMYM5oFkUE3kP1Gvs5kDApQFy2UHNXplkMFm9u34vawejIBaq2eV33McyqDfHLz1w7rGpNx+s1x7s5OdgLfmUDGs2vYl6KpBgjvkXzNUDXDZKTEY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15714060034731000.4056060919838; Fri, 18 Oct 2019 06:40:03 -0700 (PDT) Received: from localhost ([::1]:40144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLSU5-00036y-Gm for importer@patchew.org; Fri, 18 Oct 2019 09:40:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52927) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLSQe-0007Kf-Qq for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLSQd-0007mz-OA for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33644) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLSQd-0007lm-Hq for qemu-devel@nongnu.org; Fri, 18 Oct 2019 09:36:27 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C33BA10CC1E6; Fri, 18 Oct 2019 13:36:26 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1C2F58B5; Fri, 18 Oct 2019 13:36:13 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 4/4] mc146818rtc: always register rtc to rtc list Date: Fri, 18 Oct 2019 15:35:47 +0200 Message-Id: <20191018133547.10936-5-philmd@redhat.com> In-Reply-To: <20191018133547.10936-1-philmd@redhat.com> References: <20191018133547.10936-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Fri, 18 Oct 2019 13:36:26 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Herv=C3=A9 Poussineau We are not required anymore to use rtc_init() function. Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Herv=C3=A9 Poussineau Message-Id: <20171216090228.28505-5-hpoussin@reactos.org> [PMD: rebased, fix OBJECT() value] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/timer/mc146818rtc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 0c04b74c2e..8f7d3a9cdf 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -963,17 +963,16 @@ static void rtc_realizefn(DeviceState *dev, Error **e= rrp) object_property_add_tm(OBJECT(s), "date", rtc_get_date, NULL); =20 qdev_init_gpio_out(dev, &s->irq, 1); + QLIST_INSERT_HEAD(&rtc_devices, s, link); } =20 ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercep= t_irq) { DeviceState *dev; ISADevice *isadev; - RTCState *s; =20 isadev =3D isa_create(bus, TYPE_MC146818_RTC); dev =3D DEVICE(isadev); - s =3D MC146818_RTC(isadev); qdev_prop_set_int32(dev, "base_year", base_year); qdev_init_nofail(dev); if (intercept_irq) { @@ -981,9 +980,8 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year= , qemu_irq intercept_irq) } else { isa_connect_gpio_out(isadev, 0, RTC_ISA_IRQ); } - QLIST_INSERT_HEAD(&rtc_devices, s, link); =20 - object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(s), + object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(isade= v), "date", NULL); =20 return isadev; @@ -1015,8 +1013,6 @@ static void rtc_class_initfn(ObjectClass *klass, void= *data) dc->reset =3D rtc_resetdev; dc->vmsd =3D &vmstate_rtc; dc->props =3D mc146818rtc_properties; - /* Reason: needs to be wired up by rtc_init() */ - dc->user_creatable =3D false; } =20 static const TypeInfo mc146818rtc_info =3D { --=20 2.21.0