From nobody Tue Feb 10 08:31:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247518652499.36445212801834; Mon, 31 Oct 2022 13:18:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbBu-0007d1-7X; Mon, 31 Oct 2022 16:15:26 -0400 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 1opbBr-0007bM-EK; Mon, 31 Oct 2022 16:15:23 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBp-0000gY-Ic; Mon, 31 Oct 2022 16:15:23 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbBf-0003Dd-4t; Mon, 31 Oct 2022 20:15:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WmhDBcUW9WRacFuVqQ9e646FOZuBckQuO9Vj70jaVXA=; b=1QKh5YjdGMXYcM6tI0iMU95FB2 2qi7I01EdA3CYteCZFjm2RWTgStIeXaET21EwS54n91dBe6lNM4QzNkav+ZluTO4g56AK/4RjWJPw +VJiQBV+vNgUGdBFnp9I142KfHdkGtvzeojyNKmcQxRYmxwaX4ebpOvjwlgkx5F6F6tftyrjUlpCe r9/KD90rblB4fUbrN0c+ci5uLDAtDUxybo9Qokd4NFysqufbOUW7nts1eRg9COZbP0VQvnFD00Z8v BLTkuuL5X6Cf2HpE3J2WUXBBWnQOT6UkuLynxWOmzR5dwF5VpEe/WK4CVwpHOmgn52Grmnjvv7wAm Tobp1NNjyTgW2UHnXuQCNyfHO3VgbQDua/Yc4b4o+jeHjdK25HBj9mYoCtJhhi4liaghoz7wWeXXY aK8YXDTPVzq0JEOOC81iw1aSeBgV0ixjhGAyrQ5dNBdd1YHQI0l3Vpvmfcakd2/lI854RJs0ii/3q WKx+zqGRVDgioEc/L8jehTs+/kJBGGP7eclLxK5cFyzYf1aG6pczannPpcpA71HgzM6b9ccGaxtUn 3/VKvQV+42bDIsSQr5lt5flUrFSsQLy/KGyX33ki8uthLQ885TUUQYmXcLTi9HgsAg4eClWC8RMhI YITelzlJiy8l8xJNjvvY5yX9dBPKAqUCsjW4bUDaQ=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:23 +0000 Message-Id: <20221031201435.677168-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 02/14] mac_oldworld: Drop some more variables X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247520045100011 From: BALATON Zoltan Drop some more local variables additionally to commit b8df32555ce5 to match clean ups done to mac_newwold in previous patch. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: <1b9a448431d9b1198432151af0511316cfc20d21.1666957578.git.balato= n@eik.bme.hu> Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac_oldworld.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 03732ca7ed..86512d31ad 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -80,14 +80,13 @@ static void ppc_heathrow_reset(void *opaque) =20 static void ppc_heathrow_init(MachineState *machine) { - ram_addr_t ram_size =3D machine->ram_size; const char *bios_name =3D machine->firmware ?: PROM_FILENAME; - const char *boot_device =3D machine->boot_config.order; PowerPCCPU *cpu =3D NULL; CPUPPCState *env =3D NULL; char *filename; - int i; + int i, bios_size; MemoryRegion *bios =3D g_new(MemoryRegion, 1); + uint64_t bios_addr; uint32_t kernel_base, initrd_base, cmdline_base =3D 0; int32_t kernel_size, initrd_size; PCIBus *pci_bus; @@ -97,16 +96,13 @@ static void ppc_heathrow_init(MachineState *machine) SysBusDevice *s; DeviceState *dev, *pic_dev, *grackle_dev; BusState *adb_bus; - uint64_t bios_addr; - int bios_size; - unsigned int smp_cpus =3D machine->smp.cpus; uint16_t ppc_boot_device; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; void *fw_cfg; uint64_t tbfreq; =20 /* init CPUs */ - for (i =3D 0; i < smp_cpus; i++) { + for (i =3D 0; i < machine->smp.cpus; i++) { cpu =3D POWERPC_CPU(cpu_create(machine->cpu_type)); env =3D &cpu->env; =20 @@ -116,9 +112,9 @@ static void ppc_heathrow_init(MachineState *machine) } =20 /* allocate RAM */ - if (ram_size > 2047 * MiB) { + if (machine->ram_size > 2047 * MiB) { error_report("Too much memory for this machine: %" PRId64 " MB, " - "maximum 2047 MB", ram_size / MiB); + "maximum 2047 MB", machine->ram_size / MiB); exit(1); } =20 @@ -165,12 +161,12 @@ static void ppc_heathrow_init(MachineState *machine) NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0); if (kernel_size < 0) kernel_size =3D load_aout(machine->kernel_filename, kernel_bas= e, - ram_size - kernel_base, bswap_needed, - TARGET_PAGE_SIZE); + machine->ram_size - kernel_base, + bswap_needed, TARGET_PAGE_SIZE); if (kernel_size < 0) kernel_size =3D load_image_targphys(machine->kernel_filename, kernel_base, - ram_size - kernel_base); + machine->ram_size - kernel_b= ase); if (kernel_size < 0) { error_report("could not load kernel '%s'", machine->kernel_filename); @@ -182,7 +178,7 @@ static void ppc_heathrow_init(MachineState *machine) KERNEL_GAP); initrd_size =3D load_image_targphys(machine->initrd_filename, initrd_base, - ram_size - initrd_base); + machine->ram_size - initrd_b= ase); if (initrd_size < 0) { error_report("could not load initial ram disk '%s'", machine->initrd_filename); @@ -201,19 +197,22 @@ static void ppc_heathrow_init(MachineState *machine) initrd_base =3D 0; initrd_size =3D 0; ppc_boot_device =3D '\0'; - for (i =3D 0; boot_device[i] !=3D '\0'; i++) { - /* TOFIX: for now, the second IDE channel is not properly + for (i =3D 0; machine->boot_config.order[i] !=3D '\0'; i++) { + /* + * TOFIX: for now, the second IDE channel is not properly * used by OHW. The Mac floppy disk are not emulated. * For now, OHW cannot boot from the network. */ #if 0 - if (boot_device[i] >=3D 'a' && boot_device[i] <=3D 'f') { - ppc_boot_device =3D boot_device[i]; + if (machine->boot_config.order[i] >=3D 'a' && + machine->boot_config.order[i] <=3D 'f') { + ppc_boot_device =3D machine->boot_config.order[i]; break; } #else - if (boot_device[i] >=3D 'c' && boot_device[i] <=3D 'd') { - ppc_boot_device =3D boot_device[i]; + if (machine->boot_config.order[i] >=3D 'c' && + machine->boot_config.order[i] <=3D 'd') { + ppc_boot_device =3D machine->boot_config.order[i]; break; } #endif @@ -266,7 +265,7 @@ static void ppc_heathrow_init(MachineState *machine) } =20 /* Connect the heathrow PIC outputs to the 6xx bus */ - for (i =3D 0; i < smp_cpus; i++) { + for (i =3D 0; i < machine->smp.cpus; i++) { switch (PPC_INPUT(env)) { case PPC_FLAGS_INPUT_6xx: /* XXX: we register only 1 output pin for heathrow PIC */ @@ -323,9 +322,9 @@ static void ppc_heathrow_init(MachineState *machine) sysbus_mmio_map(s, 0, CFG_ADDR); sysbus_mmio_map(s, 1, CFG_ADDR + 2); =20 - fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)smp_cpus); + fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpu= s); - fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, ARCH_HEATHROW); fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_base); fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); --=20 2.30.2