From patchwork Fri Oct 4 16:30:34 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: 832763 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp872918wra; Fri, 4 Oct 2024 09:41:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVCkPtVnIQibYYnqN6cF5FoPYQkrOX+q84Gkm/qZCbtgwtjxyCr5K5ueKnkjhB6ezA7CpVYUg==@linaro.org X-Google-Smtp-Source: AGHT+IFVBTGPEzXz2PtIsEWZ9s6dDKFK+7s8h8LiIHiFu/nNC6O0aDFQNafIY5Rzhy+WoFFH3ic4 X-Received: by 2002:adf:b35b:0:b0:37c:f997:5b94 with SMTP id ffacd0b85a97d-37d049ea426mr4805092f8f.12.1728060101468; Fri, 04 Oct 2024 09:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728060101; cv=none; d=google.com; s=arc-20240605; b=ATALQrks6v7nCCaHcZ1bEf4yTGoJaetrGDUCN3SoSvAeoTLhpfuxbuGchsvGbV28RX 19AvKb4/nWMH8RJJurqhVInPmT8VVxj4Cu4Wp1gv3kSBJ/tZiNTwONKxGcQHTuEfjLAB roL6f09JBDEILJu14uD458/yQkuPW+aQ/7HKl4BKX1xjGpot7kmdPHcRfCEahNKIMN8O WpNIGRads/MLzGuiPr3rhLPmQ1tQK2p/uqQUu4UKWj9Sf0fvArGphEqrF1K95ZSqa5bZ /Bqm33DW2v3nrhnlA28AoVbS8G5++d00K048hMpKxoVptzak1pLlxbk6bbR9YwNAc7Vo ViHg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0hTPF2P0wkzOAl3QcmMS55AC0dIObjOQe3WnAgnhe+k=; fh=Cyx8393Oz+CWhBBtvLnsw/Ha6TQ3OyuB9akIVJXTJlY=; b=OK4E54w1Sqkq8Fps4Nt8VojC3pKQ5NmPOUlL5cpfSUxAnL82whA1XcEXKVvxjbnL5N 3qHt/tkVEXPCnLQFA7YraX71HLzaGiv3MR4hWLnikZiMRRxnJ529SParRdCDwoXxnPyD wvUfFYyOc8iDePvByLCh1eYObXmM/Wnz6tm5pulULPoqzO7M4GA8GA/XpSqp/PxyEFpX tWNHVbMUbvXY+h5Gax3BWD6GYEoJ6IW1HG0TDmdYX2rjY3VIs8ZxyGJUf+S/cJJ6QMpg RNOy06bL4R3rcQB9mKHHZ1zgLyqw9uyKVpqfYbK6ZSQen7gxHI1TZLsejqSoNOh3O3q/ UwuQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZuB0jU4K; 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 ffacd0b85a97d-37d1695efdesi16758f8f.476.2024.10.04.09.41.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2024 09:41:41 -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=ZuB0jU4K; 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 1swlJB-0004yU-L9; Fri, 04 Oct 2024 12:37:37 -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 1swlH1-0008M7-PA for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:35:23 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swlGz-0006Sb-0u for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:35:23 -0400 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2facf00b0c7so30477241fa.1 for ; Fri, 04 Oct 2024 09:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728059719; x=1728664519; 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=0hTPF2P0wkzOAl3QcmMS55AC0dIObjOQe3WnAgnhe+k=; b=ZuB0jU4K88OVDQVNrOJZ8HeMX1m0z8jd4vIL4a/dgxfoaGJOSJqkl/3aQO/s9eOlhy Kb2wCgRnEmDJ+PiQio03iDUpj1jsOOakdt06e4YSjxzcZ6E3Xb7DC4jqWSgGyKzxsxoN 09BepvsgLUw63Xpdy6wPeUoDO4njTCovkRb6WyqRCPJHnVGFdskZ/58+CaiBokkA/pVf nGPb4fdtBBS6hHn0nuClei+fhxjL8AQ3pTNs3uJkMRXZEEylwf2gD9Wql0Ee6LPJ5XjG XL5z3l3qO+eeQIfPj3SfGwEeFQRxqEIRG5PvwIaECEAxiDCc3l/4Z0o6xYWfdk/S2nF5 28wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728059719; x=1728664519; 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=0hTPF2P0wkzOAl3QcmMS55AC0dIObjOQe3WnAgnhe+k=; b=QWWO26xAxTEo+RG6jo7+AZlZE78QcXxSpEcJHkICq7bQckhYGfXnl0wFEhWRfvOd53 cNQRsTDjVnE/drzcxyhBjrAfmGTHNTMlOuTKuFhuX7ERN3+X9Ms6rhLChenyfSj7lc19 lF3kYsTxzbDxT148al2jWGxgrT8vTp51qXTETPG552iD4bxcySnP+4W6Auw9Oh7qWvSR rUVPNBMr2AgVaW+gut40r6VS9KyGirE1KQ4/T1UxmHZtfZ/SYoPhzMhxOgTqHn+bBOob xNZnh6FKkFVoYoF1ki39kdYVV3h/fkuffuiw0Xo/AeCiDRMqxt7bywe3HMENw0NCrdZL CCsg== X-Gm-Message-State: AOJu0YwAic126m9e1+HPJbpb0uukaqPY9x1g5wKomL2OEytb30ihbMRZ NnP6V4EqqLFaqjUh32ZGVY6zNbpmfGLGSNLOFZLaVLKeEACVFxDrSeGj1BQKdCqaKokufmKPBbj 463sWvQ== X-Received: by 2002:a05:651c:1989:b0:2fa:cfba:fb65 with SMTP id 38308e7fff4ca-2faea1b7d1dmr26392521fa.3.1728059718985; Fri, 04 Oct 2024 09:35:18 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.150]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2faf9b24991sm201001fa.83.2024.10.04.09.35.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:35:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 18/25] target/m68k: Use explicit big-endian LD/ST API Date: Fri, 4 Oct 2024 13:30:34 -0300 Message-ID: <20241004163042.85922-19-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 Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=philmd@linaro.org; helo=mail-lj1-x22a.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The M68K architecture uses big endianness. Directly use the big-endian LD/ST API. Mechanical change using: $ end=be; \ 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/m68k/); \ done Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/m68k/gdbstub.c | 2 +- target/m68k/helper.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/m68k/gdbstub.c b/target/m68k/gdbstub.c index 15547e2313c..136159f98f2 100644 --- a/target/m68k/gdbstub.c +++ b/target/m68k/gdbstub.c @@ -52,7 +52,7 @@ int m68k_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) CPUM68KState *env = cpu_env(cs); uint32_t tmp; - tmp = ldl_p(mem_buf); + tmp = ldl_be_p(mem_buf); if (n < 8) { /* D0-D7 */ diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 4c85badd5d3..9d3db8419de 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -57,15 +57,15 @@ static int cf_fpu_gdb_set_reg(CPUState *cs, uint8_t *mem_buf, int n) if (n < 8) { float_status s; - env->fregs[n].d = float64_to_floatx80(ldq_p(mem_buf), &s); + env->fregs[n].d = float64_to_floatx80(ldq_be_p(mem_buf), &s); return 8; } switch (n) { case 8: /* fpcontrol */ - cpu_m68k_set_fpcr(env, ldl_p(mem_buf)); + cpu_m68k_set_fpcr(env, ldl_be_p(mem_buf)); return 4; case 9: /* fpstatus */ - env->fpsr = ldl_p(mem_buf); + env->fpsr = ldl_be_p(mem_buf); return 4; case 10: /* fpiar, not implemented */ return 4; @@ -107,10 +107,10 @@ static int m68k_fpu_gdb_set_reg(CPUState *cs, uint8_t *mem_buf, int n) } switch (n) { case 8: /* fpcontrol */ - cpu_m68k_set_fpcr(env, ldl_p(mem_buf)); + cpu_m68k_set_fpcr(env, ldl_be_p(mem_buf)); return 4; case 9: /* fpstatus */ - cpu_m68k_set_fpsr(env, ldl_p(mem_buf)); + cpu_m68k_set_fpsr(env, ldl_be_p(mem_buf)); return 4; case 10: /* fpiar, not implemented */ return 4;