From patchwork Thu Feb 15 17:57:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 772964 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp966039wre; Thu, 15 Feb 2024 10:03:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUSHQ9iyaQQ1skt7KUxLs81RxdZAnaTTHn5rMpqqOl1gVaQBAB4Qr8cvwDzXFS7keV+ybDgzsD/tQePXbuZEsDy X-Google-Smtp-Source: AGHT+IF2MtepUpDufiL2YqtZjGc0l/WayWDiH1gPMPmLRBhqzzp4YvIH6xOjVRFwMJGDc2izBanF X-Received: by 2002:a05:6358:1099:b0:176:a5f5:d266 with SMTP id j25-20020a056358109900b00176a5f5d266mr3235763rwi.6.1708020221171; Thu, 15 Feb 2024 10:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708020221; cv=none; d=google.com; s=arc-20160816; b=miepQIWpLDeZ2F0OeC9nma5ysfzpTpiBTw7klMoenSUUNjK1AC0dvZKJn+wFrcWFAY rY1vL2VneYGptCWl2gz8Mom5VYW5/F3HNWjZoZv2yo43w6CPfKWEbxDNiy15sHv+p436 R5ZIRbOu3dLpnPk1baE86EB+u6oYC2s4rgJhaDvQmv8AXPyOAJnBRxv/2xsVQFjHPZgk A7XA3uN9fi10Sgfd9kXIsScZPXaxf/+kFsbYMOflHQtIrAfoeprpTwcPpQ8L8D9rE/Xi ZExljWHtCAD6YDrwXYL80K92W/Een+bER390dtuOT9nMcenXCS6EbT1GWwlMUvb02TcE shRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VB2HvOhj++MQuV2OC6cpVOGxVaetf77tz8Ps5+PnfHo=; fh=6aSFKu/7wZylmASNxpBRoG/DnM93aTF68R44OiZ4gG4=; b=h6/jSR0+UqZSmPcaipggwYWiEy/n4uYRumR0bkPDgt1it6cB1h5kbj5NRvfPS9ZGKs 5wTTaRx0S8RRLdukRvkd6HnJWpV9XkTHuzx8kjYGSkI1HJy1BvrkuBfHaNepKve+8jtN OvQR83gF7q1iuM/mBaR4WiE0y6ai3xjqNwIcEEj3bgk8mzyrXbupKlT7/3bpkIlQk5Vn sZ/DJFSFPqt6wc07GkKe+jNoImMrO/LzX2uu4QHHWoUxud2gLIJH3wRG8u5WaklN90WD DfSOnt2u56i0/W/Xjxhb+4njCTnIbZtv/CXlTHNb6qwtGT+3GEO2lGtY15lTZ7DW4Ee7 OVEg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JzyX1D1E; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ie12-20020a0561022c0c00b0046d6df6fc2fsi431420vsb.737.2024.02.15.10.03.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Feb 2024 10:03:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JzyX1D1E; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rag3H-0002zT-Sh; Thu, 15 Feb 2024 13:01:40 -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 1rag3A-0002qB-Sg for qemu-devel@nongnu.org; Thu, 15 Feb 2024 13:01:33 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rag38-0002VQ-Ds for qemu-devel@nongnu.org; Thu, 15 Feb 2024 13:01:32 -0500 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a26fa294e56so175743266b.0 for ; Thu, 15 Feb 2024 10:01:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708020088; x=1708624888; darn=nongnu.org; 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=VB2HvOhj++MQuV2OC6cpVOGxVaetf77tz8Ps5+PnfHo=; b=JzyX1D1EIt4/krNzw6j5g5htFeR7YEbAUgRfXQFfnIMzInSPy7ugN5doIIMhsGWdsT evNocsCn1mumw/ZCBni3xhgOz2f9vNwTMStbfzGqHWD5eq+AtruZ99crTtJlAzjH8fpt YeIOxEVu+slVEec8OccYEH5J1FIiWjjKENhtqtHj8oWGFF6ZIw8Xg0Po/Skm2teBoza2 bMMICcHW+Bh+P2HVkJaC3ZI7B+YaKcSh1OmfOPk8iN3E51EU+RGqrZb2DjEFB4vnXLfN fOEPW4XDnLDJPlxDOiETONJfXzilYlTrRZIrml9L7RpLIrelibV1SjeXPaU8cfniET+A zzbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708020088; x=1708624888; 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=VB2HvOhj++MQuV2OC6cpVOGxVaetf77tz8Ps5+PnfHo=; b=fJboswfgtjWKR6+ssyqEstcTcMI3UuvkiRWE2j2arP59YWTqjW3Szq/A/6kN73av0A BFtVhftggSXvc1Yxftsbj8Rs0IZ2AA+arARZtiH3uD5PecSt2/PYSaKHP4EHQXtGbdzY 5aBdH3srb5TGJ3PehSOvcS75tUHDcBD5lZSfyZwDgewYk6BsYN/RXXoZgPZM+gawzinj byXfkKycCt/8aC/0gzTFOU5fADzPIwJJZq9wbZMMbG2UzHZLX5ON3GRSfXgbiBzLVUGM lEdRGEv0bXjlbRRXRqV18JAIV7VhNBvNcck/nmE86QELOvylEyLDibGO4fhylQNfHdVz 32wA== X-Gm-Message-State: AOJu0YylpNU1oMt60E4WI5A6GIOGCA3DIsfPyUi8VoPe+jo5cwF0xEMN MA+uGl3wXJxqIwxpyCfCMxSQNYOsIVJPC11wUTm1SQlrswyW4DNqr5Kiutk5zprieK0tVm+95+3 6Pvk= X-Received: by 2002:a17:906:2b55:b0:a3d:624d:3e7 with SMTP id b21-20020a1709062b5500b00a3d624d03e7mr2042719ejg.45.1708020088563; Thu, 15 Feb 2024 10:01:28 -0800 (PST) Received: from m1x-phil.lan ([176.187.193.50]) by smtp.gmail.com with ESMTPSA id kt22-20020a170906aad600b00a3d07f3ac61sm789679ejb.101.2024.02.15.10.01.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 15 Feb 2024 10:01:28 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , =?utf-8?q?Cl=C3=A9ment_Chigot?= , Frederic Konrad , Mark Cave-Ayland , Artyom Tarasenko Subject: [PULL 32/56] hw/sparc/leon3: Have write_bootloader() take a void pointer argument Date: Thu, 15 Feb 2024 18:57:26 +0100 Message-ID: <20240215175752.82828-33-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240215175752.82828-1-philmd@linaro.org> References: <20240215175752.82828-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Directly use the void pointer argument returned by memory_region_get_ram_ptr(). Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240215132824.67363-3-philmd@linaro.org> --- hw/sparc/leon3.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 5c670b92db..fa4fbe4b30 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -94,9 +94,9 @@ static uint32_t *gen_store_u32(uint32_t *code, hwaddr addr, uint32_t val) * state (eg: initialized by the bootloader). This little code reproduces * this behavior. */ -static void write_bootloader(uint8_t *base, hwaddr kernel_addr) +static void write_bootloader(void *ptr, hwaddr kernel_addr) { - uint32_t *p = (uint32_t *) base; + uint32_t *p = ptr; /* Initialize the UARTs */ /* *UART_CONTROL = UART_RECEIVE_ENABLE | UART_TRANSMIT_ENABLE; */ @@ -338,10 +338,7 @@ static void leon3_generic_hw_init(MachineState *machine) * the machine in an initialized state through a little * bootloader. */ - uint8_t *bootloader_entry; - - bootloader_entry = memory_region_get_ram_ptr(prom); - write_bootloader(bootloader_entry, entry); + write_bootloader(memory_region_get_ram_ptr(prom), entry); reset_info->entry = LEON3_PROM_OFFSET; } }