From nobody Sun Nov 24 03:40:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1727685917; cv=none; d=zohomail.com; s=zohoarc; b=FI5mt+jxuKIlxOwMy05fCuE194PuqBYm4bBFCgT8MohDQrlIj/pJScz5FexcnZMYOsK5rOAOqG7IEjGBuaI9TxLaCcyNpcyCVGND9W6i4EEwThYW9GnPaWoj8LOirlXmxdcgRTAHlYq8UBaW/UOFsgbBdwV4DdyebjMNANsbGkI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727685917; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Zn1QOBKpxwHC7pwp1nDkwIemv7qUJthxbF0WBocU5ZE=; b=OXMzQE5GwjEASRO6z7BEYz2uCWaMwkgW3eADFxjYPVIIKiwV7m0kU0QKGVR9pswFRBS9gwQ6CSn6kNFnASoPK5JaumA/kuO20y/ON6nZ/2oj/ITf4XvfdiroZV+MGNY8B/3pcPMzfieMy9ekrBnJxQ44LRM+iPnTn60qvKCGNl8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727685917213672.018803617795; Mon, 30 Sep 2024 01:45:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svAzl-0004Ra-Oe; Mon, 30 Sep 2024 03:39:04 -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 1svAzG-0004Av-8J for qemu-devel@nongnu.org; Mon, 30 Sep 2024 03:38:32 -0400 Received: from [2a00:1450:4864:20::436] (helo=mail-wr1-x436.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svAyV-00009T-5d for qemu-devel@nongnu.org; Mon, 30 Sep 2024 03:38:19 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-37cdac05af9so2062353f8f.0 for ; Mon, 30 Sep 2024 00:36:10 -0700 (PDT) Received: from localhost.localdomain (186.red-88-28-13.dynamicip.rima-tde.net. [88.28.13.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd565e881sm8323063f8f.44.2024.09.30.00.35.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Sep 2024 00:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727681762; x=1728286562; 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=Zn1QOBKpxwHC7pwp1nDkwIemv7qUJthxbF0WBocU5ZE=; b=vbqqrfJsm9kB5r/lSvVVwyyqRkJpsM4GtfPs4XpiHI1pmBjjZsQae8l8q8nLZSTPFE L0PwIn4O097hCvRm0KzpZY2ZGbTeCu2WmXBo6RzEvU9cX+z7Z3DKo7PqjKwtOtEJWfjo Iuhwg7X1NtJiTe+LPmMMeL82cUFZIvWmxcS4RBa58QVSixjlycgzRr5fo+rzo/5i00WE CWKJaShmXxDuP4AjFe/KEKE9XfjOVG8e9nxPhpgFfdXCYOti9PO18TuhRSPW+a2lrD0o MgVyyrUZvOnzUYPF4DKj2M8N54HHMqrT+K1lzKJcbzsKnENJJLP5d+n8iIWzDCQhih/E hbVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727681762; x=1728286562; 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=Zn1QOBKpxwHC7pwp1nDkwIemv7qUJthxbF0WBocU5ZE=; b=CPKlBAIo+bzZsd+7EFaqqvBKAXhahijdThC6wMzDpjnsEx/KQHs4wstaQ18E7rTClv RhK/js2Xu/s/snQnuWLe6jzCrChWm1VHSTbz/35fyj8gZQabqyBIwZxbR91WiglBYJDQ 4GAg9iAIBkj3fwnXprAeDQwvl2giVZRuF8yVbhpIB0L28YnWVK0L9DkcwvxqJAOwIjH/ SioRpsNqRRru9j2dOKs56rI0xaEiW7jRdZVTzahqsowbTfZLVmgMuWSb338k556ea3EU xEbN5LnF6D0MNroSVsRCXZYk35QC13L6OrEuANDMRzDRMDHHeZH2+tplbGghYYee4RkB fQGQ== X-Gm-Message-State: AOJu0YyeOmM3n1JNdjWfNbDMWH1J9QjhIpyngfljJktaMEWGHHJ6LnAL Qaetq9xBxJZafen6iISs7bA827hlFtfyxMqgqTIzbTZQfcUfm80fOa0hNcDuOpA3FZPKdJzJPWi DnMY= X-Google-Smtp-Source: AGHT+IF/2ju8dp/hlgQNQQYphCSWWra4wcESmtISLsZng/9+YCPMt/FRqGKyK9eINYIKLWFa++fX7A== X-Received: by 2002:a5d:414c:0:b0:37c:cfbb:d357 with SMTP id ffacd0b85a97d-37cd5aa681cmr10399551f8f.30.1727681762102; Mon, 30 Sep 2024 00:36:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mahmoud Mandour , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alexandre Iooss , Jason Wang , Aleksandar Rikalo , Anton Johansson , Peter Maydell , Huacai Chen , "Michael S. Tsirkin" , Sven Schnelle , Jiaxun Yang , qemu-arm@nongnu.org, Aurelien Jarno , Pierrick Bouvier , Max Filippov , Paul Burton Subject: [PATCH 08/13] hw/xtensa/xtfpga: Replace memcpy()+tswap32() by stl_endian_p() Date: Mon, 30 Sep 2024 09:34:45 +0200 Message-ID: <20240930073450.33195-9-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240930073450.33195-1-philmd@linaro.org> References: <20240930073450.33195-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::436 (deferred) 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@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=0.01 autolearn=no 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1727685918792116600 Replace a pair of memcpy() + tswap32() by stl_endian_p(), which also swap the value using target endianness. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/xtensa/xtfpga.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 228f00b045..521fe84b01 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -438,11 +438,9 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, = MachineState *machine) const size_t boot_sz =3D TARGET_BIG_ENDIAN ? sizeof(boot_be) : sizeof(boot_le); uint8_t *boot =3D TARGET_BIG_ENDIAN ? boot_be : boot_le; - uint32_t entry_pc =3D tswap32(entry_point); - uint32_t entry_a2 =3D tswap32(tagptr); =20 - memcpy(boot + 4, &entry_pc, sizeof(entry_pc)); - memcpy(boot + 8, &entry_a2, sizeof(entry_a2)); + stl_endian_p(TARGET_BIG_ENDIAN, boot + 4, entry_point); + stl_endian_p(TARGET_BIG_ENDIAN, boot + 8, tagptr); cpu_physical_memory_write(env->pc, boot, boot_sz); } } else { --=20 2.45.2