From patchwork Tue Oct 15 15:44:19 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: 835471 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c8f:0:b0:37d:45d0:187 with SMTP id z15csp305100wrs; Tue, 15 Oct 2024 08:47:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUDODEjsubRpSHcGyGLHbVsP0iK1yulStGwxzoL+17yc74CadwXVZVrKvn1ZgGcUveqnultKQ==@linaro.org X-Google-Smtp-Source: AGHT+IEZntuMTSV/pbAri0pC1ygDoquLl3u9oqARK0sslFtvB1knu+E+CR7Pz4iBjjBU0XLKD4Lp X-Received: by 2002:a05:622a:5594:b0:45f:40f5:1434 with SMTP id d75a77b69052e-46058445eb0mr221695991cf.35.1729007238286; Tue, 15 Oct 2024 08:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729007238; cv=none; d=google.com; s=arc-20240605; b=lF8K2AtXa9Mo5ddh7UGDZDjTwpMF9HVulFVhpVpNH3198WrZvIajn3i14/1JCl5PlU un5Uolwx4yQ0z/JTjayC8/AJ+slJaYB1pk9Yo4NblkmHQs3U8ct53dL0/7XA1I7YtTIX /iyMsDuzhrkOhiyz7z5PSHpTboPBk4LQiXHpjDQuW+cGomMvxjWQvEQ7WLUJ+aC7+COZ AF5+7toyznghvbAu8ooAsWczkxQAbus6IQQG6THBru8eW4UByfRtlKq+99SIx27nnr1g 7fhnOa6uqv+lwq458LyuZmwrV7DWbkSbndculi31L3343zvV3xBGm+6jNTqKswpTsBFM 2bVA== 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=IZLWKxN76C8sY7IOvNsANw/zHjCd07PTHy82cP8hbyw=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=AQjGRJCwn8OZvizbl9Buw0swlx7X8Zqmhh4mmarhHN5Latp6VOhaiJfiY8nTCJXZYe 3fFUvsKKcfNMVLArvEunAcrfPQLI8hPRxAyLBi+cyJlg276IoB5DSoRGcfZAN8fx62IT 3XA+W1xTOhZT0WRrqqs48xP1Qs33nDU2OWHoUMAeAVksoJgN+W2OcF0hw+67BEAa77I2 LGQ4bfzU4ca0S5GUztUB/R+vnMwEY9wwuoOC5A6J8wyBDzZgIjGuZS/uvWe+X1nFFGIP nD4rbYrkwqKTK1hHP2O8Ddfr2haUFdIcH2n2NHNOSl7yW2NUv4kV4dMzLML1XAsVN2BD kW5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YIVWbctz; 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 d75a77b69052e-4607b4c4c2bsi16474381cf.534.2024.10.15.08.47.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Oct 2024 08:47:18 -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=YIVWbctz; 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 1t0jkr-0001aO-65; Tue, 15 Oct 2024 11:46: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 1t0jkI-0000nd-0v for qemu-devel@nongnu.org; Tue, 15 Oct 2024 11:46:04 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t0jkF-0000ns-Db for qemu-devel@nongnu.org; Tue, 15 Oct 2024 11:46:01 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-7ea7e250c54so1544699a12.0 for ; Tue, 15 Oct 2024 08:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729007157; x=1729611957; 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=IZLWKxN76C8sY7IOvNsANw/zHjCd07PTHy82cP8hbyw=; b=YIVWbctz/euO2msYVM+jEVt3Ne+kvsNrR7ofuLlTomoOs4FeAAG+AZM6h6Wu6x229t tEuD+8HhCRixK75sEyVr6KtIyZpKQVPQaGCOZKsv4fnyZdCd40R0ohK5z56xpOPIQ9rR 34yfg10hqf+znlTOVwzpBgsI7DLMvLmzD+oqoiV9V6IQJsOEL83DOxnUV7dbNnj0ezIH KnZHCPhJuANmDjP5ZW1EDihqMoPJx/dhNqeZSpxEGF0YucNHSEN7BEiXrEvX1BR5PvFe yPXu8VPrUyiqhK5K4qvhUBeKidjoE7XubF3v1by91GkJMOSkQDw0393Z9HfF47+VNPko iqjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729007157; x=1729611957; 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=IZLWKxN76C8sY7IOvNsANw/zHjCd07PTHy82cP8hbyw=; b=brj8+yq8Ogm+ktsNTnsSaaNqXC15jDtKqYcxvvfkuf3dq72q2cXb0diDDZy/jhsIqo iaJpbIgVz5M3ZVCF/RtXsz4WrJ3X5kX1LnXB1ixtZ2nV0dQIPzAjP6TcFqi1SxR1S1rg i5VvP5HV0P5B2k3H6o0lRe5JGleusgd2fT/RKv0ExkpQv9cQ0PhZj6RzQrORXGQzHBN+ 7LZ7HCa4f5IiDugSA/JAnijv9sjpuTJy4ZMuug760G++JqSWTRp4EFg2kfaGytdvl/4P Oq6pjvUiT9HwY6bN8L778nccKnURXKHprWhCJ1K0A3oQqO9MZvT9y+WUx/W/CwTQmPBi WA3w== X-Gm-Message-State: AOJu0Yx0l5ZlR3NUOIy5+hca/nNe8xqY4NYYvrESvZ5F0VVi624coBSg nMbAijtNec51TPj76of90GhcCs66MWVyM+0eo8EGgTb1WFEmC7Ar3cpwLvS/T/722zqqYZUivUP h X-Received: by 2002:a05:6a21:1743:b0:1d8:aca7:912 with SMTP id adf61e73a8af0-1d8c95d5a38mr18109100637.28.1729007157463; Tue, 15 Oct 2024 08:45:57 -0700 (PDT) Received: from localhost.localdomain ([45.176.88.167]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e774cf306sm1409704b3a.153.2024.10.15.08.45.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Oct 2024 08:45:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 10/33] target/avr: Use explicit little-endian LD/ST API Date: Tue, 15 Oct 2024 12:44:19 -0300 Message-ID: <20241015154443.71763-11-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241015154443.71763-1-philmd@linaro.org> References: <20241015154443.71763-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-pg1-x52b.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The AVR architecture uses little endianness. Directly use the little-endian LD/ST API. Mechanical change using: $ end=le; \ 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/avr/); \ done Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20241004163042.85922-11-philmd@linaro.org> --- target/avr/gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/avr/gdbstub.c b/target/avr/gdbstub.c index d6d3c1479b3..aea71282a58 100644 --- a/target/avr/gdbstub.c +++ b/target/avr/gdbstub.c @@ -69,13 +69,13 @@ int avr_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) /* SP */ if (n == 33) { - env->sp = lduw_p(mem_buf); + env->sp = lduw_le_p(mem_buf); return 2; } /* PC */ if (n == 34) { - env->pc_w = ldl_p(mem_buf) / 2; + env->pc_w = ldl_le_p(mem_buf) / 2; return 4; }