From patchwork Wed Dec 21 16:59:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13078969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E1A5C4167B for ; Wed, 21 Dec 2022 17:18:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p82Tx-0003Xk-1S; Wed, 21 Dec 2022 12:02:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p82Ss-0002s8-7q; Wed, 21 Dec 2022 12:01:13 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p82Sl-0008EV-6f; Wed, 21 Dec 2022 12:01:04 -0500 Received: by mail-ed1-x535.google.com with SMTP id d14so22801449edj.11; Wed, 21 Dec 2022 09:00:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0Hq2h6GKJj1uaJ0KwLEkcBzG/LOfXgaufyFvCR3c4dE=; b=C7oOiGrcFqPWErvh6BsuRF2VYiqV8i4QLh/++YPKCQTgob2jyBem1D1XJg5Q3n6qZ+ Y+SxQfHCwe4Nx8kyzUDLg0wyR+LBmaE05sqoWvwJmO4AgfDZod74ZpifVmp+EgT/ofrx Mz07kbqCFdgU3j27cle7aYRthjKOyPMemdIRS2k722isa67HuNr5yOMSUhBuOZK8cOl/ CtE5eZeXUoat6uQjmVyoejOQdWtr+AYuhut4MLnMSUc8H312CI92OckCI6ps9IsHhWPj p964ENfvfJ1KIHwhEXWE1H8RiIcc1fCM+TyFILCxwUEfM3TYP0LknU8KDH6hsaXt5paG w0LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0Hq2h6GKJj1uaJ0KwLEkcBzG/LOfXgaufyFvCR3c4dE=; b=5qLEIR0c0UJO4YSEFLKz6GtLEK//wFAwSc9frE7PIVNAokJnXcyKri9QRTaIVqPKwC xZgJhzTQ87XbmigJCMPQwTpkEkm+hKaqLHvSR+atgK0wJCq0mZ61s+HbqtTtrjx/wwo+ PauNbkRM5UBOz4pmG8A9NoGl7Kq+MTNuqcyx+lCFn5nqGnYjWFxm46a8KaHPH/FAfDE+ 93pmFLeMjnZG1lqrPGK+uvrUllIHhYOBIVFFF+CrOxRzzxSBXgIZC9EV3CnGWO9JK1DL E3b42BKTUZhcuI7cx8Rtr54EDyeDnUoYMhBM4zWr/ECJhwdn5emz0gt1xa4PnVziLVMS dDGA== X-Gm-Message-State: AFqh2kqxKewPUuoDeSVZGTsy/oNQsqdZML1URXotDz4sCka0sGmQwSmu iJxz/z3QxhSNneP9wtm1lKJK7bj6Iw0= X-Google-Smtp-Source: AMrXdXvQXjtN5F/AJqRuQt0aJpQjNBBAWzMp37wfwcFCmKOCJoP7vLjmGga/Ugxc6dUu8IU+O1UCow== X-Received: by 2002:a05:6402:790:b0:470:1e5a:a333 with SMTP id d16-20020a056402079000b004701e5aa333mr1908248edy.34.1671642056625; Wed, 21 Dec 2022 09:00:56 -0800 (PST) Received: from localhost.localdomain (dynamic-092-224-051-061.92.224.pool.telefonica.de. [92.224.51.61]) by smtp.gmail.com with ESMTPSA id n14-20020aa7db4e000000b0047466e46662sm7204019edt.39.2022.12.21.09.00.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 09:00:56 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , Igor Mammedov , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Herv?= =?utf-8?q?=C3=A9_Poussineau?= , Jiaxun Yang , Ani Sinha , John Snow , Gerd Hoffmann , "Michael S. Tsirkin" , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Bernhard Beschow , Peter Maydell Subject: [PATCH v4 09/30] hw/i386/pc: No need for rtc_state to be an out-parameter Date: Wed, 21 Dec 2022 17:59:42 +0100 Message-Id: <20221221170003.2929-10-shentey@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221170003.2929-1-shentey@gmail.com> References: <20221221170003.2929-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=shentey@gmail.com; helo=mail-ed1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Now that the RTC is created as part of the southbridges it doesn't need to be an out-parameter any longer. Signed-off-by: Bernhard Beschow Reviewed-by: Peter Maydell Reviewed-by: Michael S. Tsirkin Message-Id: <20221022150508.26830-12-shentey@gmail.com> Reviewed-by: Thomas Huth --- hw/i386/pc.c | 12 ++++++------ hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- include/hw/i386/pc.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index d154eedcb3..6990687211 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1246,7 +1246,7 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, void pc_basic_device_init(struct PCMachineState *pcms, ISABus *isa_bus, qemu_irq *gsi, - ISADevice **rtc_state, + ISADevice *rtc_state, bool create_fdctrl, uint32_t hpet_irqs) { @@ -1301,17 +1301,17 @@ void pc_basic_device_init(struct PCMachineState *pcms, } if (rtc_irq) { - qdev_connect_gpio_out(DEVICE(*rtc_state), 0, rtc_irq); + qdev_connect_gpio_out(DEVICE(rtc_state), 0, rtc_irq); } else { - uint32_t irq = object_property_get_uint(OBJECT(*rtc_state), + uint32_t irq = object_property_get_uint(OBJECT(rtc_state), "irq", &error_fatal); - isa_connect_gpio_out(*rtc_state, 0, irq); + isa_connect_gpio_out(rtc_state, 0, irq); } - object_property_add_alias(OBJECT(pcms), "rtc-time", OBJECT(*rtc_state), + object_property_add_alias(OBJECT(pcms), "rtc-time", OBJECT(rtc_state), "date"); - qemu_register_boot_set(pc_boot_set, *rtc_state); + qemu_register_boot_set(pc_boot_set, rtc_state); if (!xen_enabled() && (x86ms->pit == ON_OFF_AUTO_AUTO || x86ms->pit == ON_OFF_AUTO_ON)) { diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index d4a9c79713..5e6dba3558 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -277,7 +277,7 @@ static void pc_init1(MachineState *machine, } /* init basic PC hardware */ - pc_basic_device_init(pcms, isa_bus, x86ms->gsi, &rtc_state, true, + pc_basic_device_init(pcms, isa_bus, x86ms->gsi, rtc_state, true, 0x4); pc_nic_init(pcmc, isa_bus, pci_bus); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 92817a9ebd..ef3e1c72f0 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -293,7 +293,7 @@ static void pc_q35_init(MachineState *machine) } /* init basic PC hardware */ - pc_basic_device_init(pcms, isa_bus, x86ms->gsi, &rtc_state, !mc->no_floppy, + pc_basic_device_init(pcms, isa_bus, x86ms->gsi, rtc_state, !mc->no_floppy, 0xff0104); /* connect pm stuff to lpc */ diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index c95333514e..0cf3ccdf0d 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -169,7 +169,7 @@ uint64_t pc_pci_hole64_start(void); DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus); void pc_basic_device_init(struct PCMachineState *pcms, ISABus *isa_bus, qemu_irq *gsi, - ISADevice **rtc_state, + ISADevice *rtc_state, bool create_fdctrl, uint32_t hpet_irqs); void pc_cmos_init(PCMachineState *pcms,