From nobody Sun Nov 24 00:59:01 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=1728059757; cv=none; d=zohomail.com; s=zohoarc; b=AvYZJMFlcSNzVaHHFiY3M3DsvdNNbUMCJcT2XVGPCaULSZnBszNYFjPcgVn0MErN2lAfhaA7/XN5ENJjMhwY1qDe66ZTzKz1tNCIjUfCnyM3FwwRICtJcLqNqRtY3Vyzj3jKBMFyG9nS1trItj79jH778i9wEXGMrC64bv6x2pc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728059757; 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=dOkCKWbC4XaUTj+zlW7/8n4oz5mVQsEd+mLoNBOmOog=; b=mellgG5SviGANIO9EETAoNo5Q/nQU0fYXZZc5RelRdKjgSnuzXregSkEgPjLSACQnNaB8DkZZmarS2iSVAWGbHjwgAKR7pg7546BvWKh8GX4GPh3garibkLrgTZmmbJEF4IniHUFW+xYlPfYa6yiaCsNMt7aG9v4+gZYNYxq1bo= 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 1728059757744269.825861052984; Fri, 4 Oct 2024 09:35:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swlGt-0007SL-8W; Fri, 04 Oct 2024 12:35:15 -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 1swlGH-0006La-2q for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:34:37 -0400 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swlGD-00068c-L1 for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:34:36 -0400 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-53988c54ec8so2779778e87.0 for ; Fri, 04 Oct 2024 09:34:32 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.150]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539aff1d322sm1096e87.144.2024.10.04.09.34.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728059671; x=1728664471; 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=dOkCKWbC4XaUTj+zlW7/8n4oz5mVQsEd+mLoNBOmOog=; b=J6M9ww9Sx0QfpjWC9+bTOJMJPHFCi3bNw3zSUdIE2/UvH6pm5kYomiUBu/Db2LHeik N18JPj+5RgZoDfsuRoU+BLHGn6A0vOPmUpfHCRynRP+sMC0mHUn9Yq3CYVQhTZyrWDGf jOHUVM0efRzOygf2lk2OJCVxDSzkii0F/KfUu3MnxLnTrYpPa7wafLLA/u8JV9GAkuMJ Dwrj++aLcP8Fp5I8n12ziiAXP7Z6DMXH1nixNTvI0w0s+rF/bjH+z9DdOjzs2UHHEks4 NL8/TtlMIWrZUtYOYO1oenWy8mNyDf63NTEYYzGV23/H6FsojoNBUSKP6RaEzZqBlnyC 9f5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728059671; x=1728664471; 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=dOkCKWbC4XaUTj+zlW7/8n4oz5mVQsEd+mLoNBOmOog=; b=c6CNDdfY31yPWLqwgueZVZkwqp2GYWiqeSHAJlJMmS9dM2Cyxu0s5fZiAdbSwuzitE kJtKNOEGzcUdQxToJpCkDEbsb7nzx2oo/nkrBNCWENnyOABMT68X6gUEDVmaKYRt2+Am oEN6k4TQ5/9DSenM9M1jHVfOUfGC6z3WSlFRdS5uHCgQDXiR5hBNPiyv2JTJMr8VwYke xX+eVYJBSIpYATO9NziHKs4lD3QYw+Y7XjYLRCnQ2IxY5prX4OkCH+JxB4eZY3/vmWuA HSGEfxDAgbsAQZ0ONUVodjdgRdJ5Bt2HcKsajBPNAuWQYIPIbUtcWjkhgmLV2RJ3LSLx tLlg== X-Gm-Message-State: AOJu0Ywk45vt7ZG2ix92kV7Vh4q2/oJK0B56lgAXliybbqTcmmkAWYOw MiDzWWoRpk87MV/vRGbwXtTEE2cgetYMSSL16oRq4aDLCDm85A4iIjzUj1VMt2ngCd0CWOw5WHd TPkpXtw== X-Google-Smtp-Source: AGHT+IFypIXsz1g/PCzFyL9iJ3D4FqeWw3/EK9y7qPIrO561yhedYQKflkwOGJ1omPJhZt9CtBuwfQ== X-Received: by 2002:a05:6512:1382:b0:52e:9cc7:4461 with SMTP id 2adb3069b0e04-539ab86253bmr2275489e87.5.1728059671349; Fri, 04 Oct 2024 09:34:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , Richard Henderson , Pierrick Bouvier , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 15/25] target/rx: Use explicit little-endian LD/ST API Date: Fri, 4 Oct 2024 13:30:31 -0300 Message-ID: <20241004163042.85922-16-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004163042.85922-1-philmd@linaro.org> References: <20241004163042.85922-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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::130; envelope-from=philmd@linaro.org; helo=mail-lf1-x130.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1728059759660116600 The RX architecture uses little endianness. Directly use the little-endian LD/ST API. Mechanical change using: $ end=3Dle; \ for acc in uw w l q tul; do \ sed -i -e "s/ld${acc}_p(/ld${acc}_${end}_p(/" \ -e "s/st${acc}_p(/st${acc}_${end}_p(/" \ $(git grep -wlE '(ld|st)t?u?[wlq]_p' target/rx/); \ done Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/rx/cpu.c | 2 +- target/rx/gdbstub.c | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 36d2a6f1890..458b8ee072d 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -86,7 +86,7 @@ static void rx_cpu_reset_hold(Object *obj, ResetType type) resetvec =3D rom_ptr(0xfffffffc, 4); if (resetvec) { /* In the case of kernel, it is ignored because it is not set. */ - env->pc =3D ldl_p(resetvec); + env->pc =3D ldl_le_p(resetvec); } rx_cpu_unpack_psw(env, 0, 1); env->regs[0] =3D env->isp =3D env->usp =3D 0; diff --git a/target/rx/gdbstub.c b/target/rx/gdbstub.c index f222bf003be..30074c9da7b 100644 --- a/target/rx/gdbstub.c +++ b/target/rx/gdbstub.c @@ -56,7 +56,7 @@ int rx_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_= buf, int n) uint32_t psw; switch (n) { case 0 ... 15: - env->regs[n] =3D ldl_p(mem_buf); + env->regs[n] =3D ldl_le_p(mem_buf); if (n =3D=3D 0) { if (env->psw_u) { env->usp =3D env->regs[0]; @@ -66,38 +66,38 @@ int rx_cpu_gdb_write_register(CPUState *cs, uint8_t *me= m_buf, int n) } break; case 16: - env->usp =3D ldl_p(mem_buf); + env->usp =3D ldl_le_p(mem_buf); if (env->psw_u) { - env->regs[0] =3D ldl_p(mem_buf); + env->regs[0] =3D ldl_le_p(mem_buf); } break; case 17: - env->isp =3D ldl_p(mem_buf); + env->isp =3D ldl_le_p(mem_buf); if (!env->psw_u) { - env->regs[0] =3D ldl_p(mem_buf); + env->regs[0] =3D ldl_le_p(mem_buf); } break; case 18: - psw =3D ldl_p(mem_buf); + psw =3D ldl_le_p(mem_buf); rx_cpu_unpack_psw(env, psw, 1); break; case 19: - env->pc =3D ldl_p(mem_buf); + env->pc =3D ldl_le_p(mem_buf); break; case 20: - env->intb =3D ldl_p(mem_buf); + env->intb =3D ldl_le_p(mem_buf); break; case 21: - env->bpsw =3D ldl_p(mem_buf); + env->bpsw =3D ldl_le_p(mem_buf); break; case 22: - env->bpc =3D ldl_p(mem_buf); + env->bpc =3D ldl_le_p(mem_buf); break; case 23: - env->fintv =3D ldl_p(mem_buf); + env->fintv =3D ldl_le_p(mem_buf); break; case 24: - env->fpsw =3D ldl_p(mem_buf); + env->fpsw =3D ldl_le_p(mem_buf); break; case 25: return 8; --=20 2.45.2