From patchwork Mon Sep 30 22:07:32 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: 831584 Delivered-To: patch@linaro.org Received: by 2002:a5d:43d2:0:b0:367:895a:4699 with SMTP id v18csp11689wrr; Mon, 30 Sep 2024 15:08:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUXQcHA/7LLLWgmdWl8NrWSXdjBSodKBSbJl/z95NQzeIKwWNKD7dtGnVPrlE9MyXTzHvdTyw==@linaro.org X-Google-Smtp-Source: AGHT+IEV7TIwEOoIZxDmooDAtoql+J11+GO/jogpF7qZQE6tXoqkJowIVuSOnEwHN/muwP/wSmsU X-Received: by 2002:a05:6214:4989:b0:6c3:5c75:d2b1 with SMTP id 6a1803df08f44-6cb72922b9dmr20428906d6.5.1727734133210; Mon, 30 Sep 2024 15:08:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727734133; cv=none; d=google.com; s=arc-20240605; b=PsHsLb2M3v2txhuQMlViBf8y7v0cNNA4jGZGW3sbuHfKosHnlRCCDKlqxCzp0P562z QOsM4O/nJz9lodfcUwVT9bQB2/1OF2iHk325vS3xW271lnEYrqOFz8Kph0FPU2/p4C4l HSu4Zoy1cBV4g4GEajhuGZqchs8K4B8OaQIhTJRON6asMIM/a8b05Bhx2YY0EqWSKQOg ROVCF0S81D+W2RTXQrL4xZdy3n+RkFgVIL/l9w877HUwBIu/zJsQU79hHiGECJjYzsFl SYPXwfN9gAmkk/XhuzPaUAbGjZL2FA+UOoju2pAXW3q1GCC+NJYFbV1m9KEbr0llD6tU TxWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=/26k0XIki0PfJQkG3TkT8x6m4iNLUaC+2Zypof+nqPg=; fh=cybNDmaRz5gN2WiZUqxCLPH67HW+LEO8wZfKIeTOj/E=; b=jH6+pMUnPqZI9SH1i5+o8lT1RkpVbdOd891npi7qBVNk5SwHp3H7S1Iap2iVwSXHKc xlhrbF7uSylzdze7huzPEXGrmL8H7c89ejw5Y+8cu0tJ7w9TWytYSiDyRz0yEt64qpCi /Fy8WcLmojA6MET0Td+MpB6VnuFQcP31Df5CMlw8p+5rK6zLXfFhh4NyrhFR0X+rRpp6 oCJMNWMfxic308mIw+ayf0SPnxL+Z5TNI1g7GdIsaI8p7p22FTkGbFqkUCQo/UGh6gmO u07nr14xo5ylIXvePA3eRs5DAgnBaBenvRezUA0K2lMlhYup4ewCpYMWFgn+rtMnc+3S H0qg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mnHnCMbS; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6cb3b603b10si94740186d6.111.2024.09.30.15.08.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Sep 2024 15:08:53 -0700 (PDT) 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=mnHnCMbS; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svOYO-0006Qw-8E; Mon, 30 Sep 2024 18:07:40 -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 1svOYM-0006QS-Nl for qemu-devel@nongnu.org; Mon, 30 Sep 2024 18:07:38 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svOYL-00023T-6Q for qemu-devel@nongnu.org; Mon, 30 Sep 2024 18:07:38 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a8d2b24b7a8so1091103566b.1 for ; Mon, 30 Sep 2024 15:07:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727734055; x=1728338855; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/26k0XIki0PfJQkG3TkT8x6m4iNLUaC+2Zypof+nqPg=; b=mnHnCMbS6t/kx7dHdOvYyYw/bOO8XnNn2im1qfgORQm0D3Gr9g6TCBBbh6WBhmjuXJ yecGheHipiKe/oPwxfqMf6Zk//E/UPoZR/4uMRku8aXGDSIQEG6FjR2p1Pgemo4MnmnM 0HKqXxjN+pXyR8fU1Pf0HJux4yiHZhypDmv8Za2YFZjUIPH3dfLiPvs4QoSoXskOyZIa QGyyVGhRwnwIFy7KvoxPT+CRC31gKZQtd/w3LQOGOGubuwSMJEPSdNxrXF9IkUNI2Tp2 zWagmCXydur9lszkViPWj2wVSaqMpxEqj+GhTakMwU8jcFiFZqDThI7SVswf72sZGryJ 43lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727734055; x=1728338855; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/26k0XIki0PfJQkG3TkT8x6m4iNLUaC+2Zypof+nqPg=; b=Sg9BudZbroCGxRK8Tq+nwGDDVaeg9qk1zIv/OGDSmnHxn3AhC6eWiiqgwJGmZW8d4M vjKeCUhG+HRzB9IyzCEukFyPdOA0PwryP/JyLkhbIvtaQW6Q835JW5r9BZj3dkYLLHc9 A1BSbS0xx80k+OXDoYm+PxrvnuKtNxaVu6GtPbz1KuSk8jrXFtOKE5RSEc3N6YBN6wXY B+uQul44Ex6Nv3dE8Q2gl4IwyHE1GsyXhL/9gROvgxiTzTYxXcYOjVbiq+5TOXT+RQBp 54JftP+oVEbYJ8HxMZ7RrPyACESjakcC1Iwq26scUoc5n8K8TcHThl2HTBsBwdyy09Nu ezEw== X-Gm-Message-State: AOJu0YyniWL+AwpSdKa08KaR40VFfisgaBQzMuatktuItUVlSpd9jSXR agMyAHX2qky96pYgksWWXcQkHzgpN1ICH5jU0U4jXi20wJjMob8+uVtomtUgsRSXacXYu1u4IN8 cEis= X-Received: by 2002:a17:907:1b10:b0:a8d:4e69:4030 with SMTP id a640c23a62f3a-a967bf5350cmr100530866b.19.1727734054985; Mon, 30 Sep 2024 15:07:34 -0700 (PDT) Received: from localhost.localdomain (46.170.88.92.rev.sfr.net. [92.88.170.46]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c27c5aadsm593218966b.79.2024.09.30.15.07.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Sep 2024 15:07:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Magnus Damm , Thomas Huth , Yoshinori Sato , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH] hw/sh4/r2d: Replace tswap32() by stl_endian_p() Date: Tue, 1 Oct 2024 00:07:32 +0200 Message-ID: <20240930220732.58757-1-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Replace the target-specific tswap32() calls by stl_endian_p() which does the same but takes the endianness as argument, thus is target-agnostic. Signed-off-by: Philippe Mathieu-Daudé --- Based-on: <20240930073450.33195-2-philmd@linaro.org> "qemu/bswap: Introduce ld/st_endian_p() API" --- hw/sh4/r2d.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index e5ac6751bd..6739ac435a 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -353,9 +353,11 @@ static void r2d_init(MachineState *machine) } /* initialization which should be done by firmware */ - boot_params.loader_type = tswap32(1); - boot_params.initrd_start = tswap32(INITRD_LOAD_OFFSET); - boot_params.initrd_size = tswap32(initrd_size); + stl_endian_p(TARGET_BIG_ENDIAN, &boot_params.loader_type, 1); + stl_endian_p(TARGET_BIG_ENDIAN, &boot_params.initrd_start, + INITRD_LOAD_OFFSET); + stl_endian_p(TARGET_BIG_ENDIAN, &boot_params.initrd_size, + initrd_size); } if (kernel_cmdline) {