From patchwork Thu Feb 15 13:28:24 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: 772893 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp827671wre; Thu, 15 Feb 2024 05:28:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUUNiXj1Ze0Zt+quNiCp75ZY8Y2Ht9Y0ribIASHWR8pVxhpz13I9V86tpZXQUA/ChwiQYG1iU3+OIF46ZtJ5Y+o X-Google-Smtp-Source: AGHT+IFARZ1ZKXMzciYh7H69cFoU61SfDE/tHehnPIiIiWV52OtjQvvAo6514ZZ9y59PnzJQp7fW X-Received: by 2002:a05:620a:46:b0:783:afb3:d16 with SMTP id t6-20020a05620a004600b00783afb30d16mr2073555qkt.30.1708003738343; Thu, 15 Feb 2024 05:28:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708003738; cv=none; d=google.com; s=arc-20160816; b=yRTewMWvKUkWVCgY2VSEwokpgaPolBa0LvDtEHUpwlrsJ//oLwMwLv8P+Z6DbNXfoD vN4/LyXh3c8lekEHqZs/UBnRejqZvBiGsWRPbXrCkb24M9TpDO9IwBNce4Ki8lfPn9WJ LduvFVdDWIsYXIQrhwiBBoRFUXXAVXOqsSnsT96qowFomvLhhBuEtqhbOkKBR/QBfE3/ Wbv+DVysfBJSLL079s7nmf20c7QTay4vd98v1r1gOEs5kzD04zsL2v6d4nAiOgx5+L4I lv9IcDmQ3OHRiW5HrH8CzmWI45nUxl7R7xRGqxL/AROdcSdyjOznOMDFuKmGDJrtYfxr V0Pw== 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=bseUpOju7YvUN3+/fm6a697urfBk+5lMG7vEa3ydvK4=; fh=mQKCequP4C09lLwWPkzV0gYr2OXFJAerQjJ9ifUbVZ4=; b=oy67vpUbLhsCPLyKW8t/LzBWlqCs819JJNOnSbu3dg4nRfZ9ak28/8ruAtOD1DyKje oBIY/RRXpqfcV4GttVntZoGiIYL1VrnI6yAAw4Hl07kVnaqec+jLadB9Qb9ZyWMiGX3e 4yboXfBdnujYgzOn+UztOR8Ah/H/WGBfdWXfyMyrlLAw4UsuSVMDdU9V1WFuWj9pS+wc PzGXhCR7tVpbJamwckopT7kYOqGaDBT5Sj7i3g5P3LIldSzLNc1M+HZez6tis8c3ZlsI QF6PWjrUz9auJ97B57jq9uwZ10AmIqGuqrJQ/ZtFmFGeshjydkOLdOuqlUSpaJG0ohqf ++pQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PK67UTuw; 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 j25-20020a05620a001900b007869b745e1esi1498626qki.696.2024.02.15.05.28.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Feb 2024 05:28:58 -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=PK67UTuw; 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 1rabnH-0004oD-TU; Thu, 15 Feb 2024 08:28:51 -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 1rabn9-0004ht-Fo for qemu-devel@nongnu.org; Thu, 15 Feb 2024 08:28:43 -0500 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rabn7-0004oZ-SM for qemu-devel@nongnu.org; Thu, 15 Feb 2024 08:28:43 -0500 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5118d65cf9cso1049592e87.0 for ; Thu, 15 Feb 2024 05:28:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708003719; x=1708608519; 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=bseUpOju7YvUN3+/fm6a697urfBk+5lMG7vEa3ydvK4=; b=PK67UTuwczeTU1trXoRyNCSN/xJiZMA+c4p2+tMwAxU9qpw6jB4RTt3SOHj1dzaSB8 cCuwRX6nXlg2RKNZdFoC5mL0QGsnkDKrUIPqBdMrn7jKIvJpLaYk5zZv4YLtyUcEulaj Tt2p11Ff0u+GtrYN4x1082jTrXfvPVRLFeIRJb0rO7IMbng/7TTffhArHAkGf8PlSxKy cqWYEHfUrfA1qN+IpIxsZiNZBbGSIWRq3RPQiPF6isR7W96WnzI5aoosUJSCLeXzZjJl 0JKQ4KhYOCdmrO4lzA9gXCjof7mTvqmw81K+PzDIeV02ps89oqJk6RA0/aNErRsiGrXO VpZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708003720; x=1708608520; 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=bseUpOju7YvUN3+/fm6a697urfBk+5lMG7vEa3ydvK4=; b=IaqLOcvJ4huk+uZQLxXKARRwug5rKut6JE8eHnMcd27Aw0OoY6ithXnY4HIJPq1AN/ iRqOTAMrcRsW9Q/Rt9IOf4oO0PKRRjxsKEBUUULaBGDTBATafwetv5QUF0VILCdAOGE0 EvGlUXx7eTpYXHoaq6QCb7hA3SqYwAp3AuycQm86XagG8eZ//r1sHiuONeWxq/xkUOto CJiNKt6u8Kt8EKzMnGRTfLbBXe0wPrVnX110U6FPaarB6nFqt5EYvS3lta5KPyt9+DRr e8ZH6r8uE7eivHiXhBkdtxks4mZYi1eG9QxFdVRG9N1hf+jxQG4YVuFb2rRWDen/Vf70 TPtg== X-Gm-Message-State: AOJu0Yzv0/Pq4efn3QJ/o52gwsv/K/Pjm66SYrkz22XjzBrHRlLqfzVg EXQkaYiRrhPdvNnZFhKVBTAZUP4/0+9J4en+Ijr1YKve5XLwPhhI4e6H4zcOETYK2kVOIaXRXoK jEIs= X-Received: by 2002:a05:6512:3baa:b0:512:88b2:abff with SMTP id g42-20020a0565123baa00b0051288b2abffmr1271397lfv.6.1708003719656; Thu, 15 Feb 2024 05:28:39 -0800 (PST) Received: from m1x-phil.lan ([176.187.193.50]) by smtp.gmail.com with ESMTPSA id vx2-20020a170907a78200b00a3d9a94b13fsm446246ejc.136.2024.02.15.05.28.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 15 Feb 2024 05:28:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Artyom Tarasenko , Manos Pitsidianakis , Mark Cave-Ayland , Michael Tokarev , Pierrick Bouvier , Frederic Konrad , =?utf-8?q?Cl=C3=A9ment_Chigot?= , qemu-trivial@nongnu.org, Fabien Chouteau , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/2] hw/sparc/leon3: Have write_bootloader() take a void pointer argument Date: Thu, 15 Feb 2024 14:28:24 +0100 Message-ID: <20240215132824.67363-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240215132824.67363-1-philmd@linaro.org> References: <20240215132824.67363-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=philmd@linaro.org; helo=mail-lf1-x12b.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(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- 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 d096fb04cb..8717c72e77 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 = (uint32_t *) 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); env->pc = LEON3_PROM_OFFSET; env->npc = LEON3_PROM_OFFSET + 4; reset_info->entry = LEON3_PROM_OFFSET;