From patchwork Sun Feb 12 12:37:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13137410 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 CC93DC05027 for ; Sun, 12 Feb 2023 12:42:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRBdP-0007la-8J; Sun, 12 Feb 2023 07:39:11 -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 1pRBcz-0007ZN-4e; Sun, 12 Feb 2023 07:38:46 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRBcw-0001Ip-S5; Sun, 12 Feb 2023 07:38:44 -0500 Received: by mail-ej1-x62d.google.com with SMTP id c26so21081160ejz.10; Sun, 12 Feb 2023 04:38:41 -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=Q5BAqb4NSt5JyGYzPVIU20MjmxdB3dJtY4VU4Q5VqfA=; b=ot+SRUV6qEUZzRY5VZhUdyt4fnxW+p2Eow+7+9LS8JW7aXSExGsx3NT40w28g6AfIL 3PpdqgQU3soOXJvaPP08q4feP7Otjw6lmUMR2KOTBkHdDpy1utLAZdCuALrWK+j1wxbg 2C1VLQaZCh/LGCkY7KuMl7Y8YLjtiP/qmt6GklDTQbvB4rBj1F7DzIL247AT12I7JDc2 zXun6RGV5Wj9EBR2bCKb9KpaGPLCQz4fY60RULAnCQNB0wSzwgZ272Ek50S4v9Eme+ZU EMRh/cFsFNgqTy230OMjB6TZUgW7pQFL70fowXR5R4ttmYo6YbJEqBfLAamUW/UFQOk5 b31Q== 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=Q5BAqb4NSt5JyGYzPVIU20MjmxdB3dJtY4VU4Q5VqfA=; b=LFbSEMHZxahYXGwBJqWSXly6MnO5GgE74Bm1BClqivY7LPCvSMnUI28237v0Mmml6v 2CzAAaxCjvwdBVYCITLwLbwUQ2YCUmTICP+z6f6CQgKcRwsWxuzFuZBkv7MlQKiVDvLG DXM8UheLBFEBNylTNWd9sK1pM0YJi3XAN7wvkadatGsOlmNwdBvdbY13I+Z9SaBegV7z 5MKP6LFQ/eCn8+wXuhbmx5qNJsmfI1brFGbUW1Xu3DJs9Z/J1oBTs9tQTmZp3DYoDdmx 8VkmmzdAIbalaxLT6cPTWDFCEAwRaBAbM/rnlVGrnUHVqJ5xSZ60+83EDnqkAbi6AAdo MqAA== X-Gm-Message-State: AO0yUKX0HKimYjap//6hm3sUJDTBu+b9MKA9cS8ZiFZtmmm6Wun5Fm9U EB7eUu7N1ImVopSDkljG6OHbZJYMClU= X-Google-Smtp-Source: AK7set8Rd18wry9QE4xPUCYuuUn+kEFeqIYmoLD2mecKAPOkIAYdxUv1UMXXTWqOIrwt26WZie847A== X-Received: by 2002:a17:906:3ecf:b0:879:9c05:f5e8 with SMTP id d15-20020a1709063ecf00b008799c05f5e8mr20603658ejj.62.1676205519669; Sun, 12 Feb 2023 04:38:39 -0800 (PST) Received: from localhost.localdomain (dynamic-077-011-172-153.77.11.pool.telefonica.de. [77.11.172.153]) by smtp.gmail.com with ESMTPSA id qw14-20020a170906fcae00b008af1f1bee79sm5233164ejb.9.2023.02.12.04.38.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Feb 2023 04:38:39 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , qemu-arm@nongnu.org, Elena Ufimtseva , qemu-block@nongnu.org, Richard Henderson , Jiaxun Yang , Peter Maydell , Gerd Hoffmann , Ani Sinha , John Snow , Marcel Apfelbaum , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Paolo Bonzini , Jagannathan Raman , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Igor Mammedov , John G Johnson , Bernhard Beschow , Thomas Huth Subject: [PATCH v7 02/23] hw/i386/pc: No need for rtc_state to be an out-parameter Date: Sun, 12 Feb 2023 13:37:44 +0100 Message-Id: <20230212123805.30799-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230212123805.30799-1-shentey@gmail.com> References: <20230212123805.30799-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=shentey@gmail.com; helo=mail-ej1-x62d.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 Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20221022150508.26830-12-shentey@gmail.com> --- include/hw/i386/pc.h | 2 +- hw/i386/pc.c | 12 ++++++------ hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 66e3d059ef..5ba814aca6 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -168,7 +168,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, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 44daa36338..16b7bd40ef 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1251,7 +1251,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) { @@ -1306,17 +1306,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 8f894714e5..a577ea2f4e 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -276,7 +276,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 3b1a0d0cfd..ade8c26bfd 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -294,7 +294,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 */