From patchwork Tue Mar 25 13:02:18 2025 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: 876005 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp2641030wrb; Tue, 25 Mar 2025 06:04:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUkpU0K0MgMigCRdXQeou61bm79cbQJRLiu/oalDZ7Mn8mz+6jQ4WRLUFTT7XZRIRV00J+89Q==@linaro.org X-Google-Smtp-Source: AGHT+IEI62I8RSwAxviKJQfn/lIuogmAQHSmbxRRMceM9Mpt81xwyEVVb8+xi6Z4ENManLgKmftH X-Received: by 2002:a2e:be8b:0:b0:30d:b309:21b6 with SMTP id 38308e7fff4ca-30db309230fmr6739441fa.6.1742907840296; Tue, 25 Mar 2025 06:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742907840; cv=none; d=google.com; s=arc-20240605; b=CC9RlK5NyZo2NHgJSrQiRq/gCt/HbjtV/SinuxcVM5k03Qxy1pxKZL+z+OvKZBheph g/7AA9WhaTW3/jtG+SX2ZeWrXOIIj/gogaHmtWeza5a8JHe0p1XgE5c2dXlRxLN0QEdw kGyhiu1HWGDCeNI/6u0+BhpUuonAREX+HGOuKupVoYXjXgIpT2G/rFvcFLhc9U5zzclL f4ogF4b4Lb6UI3bhqrW8WOzfxHOo7GAMuzzcB7j6rWu+f8RW5/DwlJb82BbV9DHrqP3A Z0r/8+ywA1pjr395bCYOpDfVdzPa5FmutLdj3oCk0rJZiBMVQzyU9UGUqN4YrKcsnRF4 kpyg== 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=J/DOA8hAmAVfg6M/0jKhvBqsPxQAowypQJ33xuaxeRc=; fh=ysnDffzSNfm5jz9gUyTVF3JREAFBsYVnv8uksZgX2oo=; b=ctTKGwi6wF5U2TbIrV6utrDhw/UI9QOTgsf1B6NUjoirGrWQKhpo7IQk6PY+ng4ml4 h97NDFuNKiKpaV/dHogEAWCfvTd1C1H8K2WXRjAnx0Jq2z3lFSC1cUEspIkoK61Gej1D qQJDSBugLbPC83cUSWytCmh7as1i87F5RfnFrT8Cxvc3rsQoXb4/4vYFvYAv4JYSdOKu 4up1RslTXtne/S7++1n7tJeDSJBUERWHxCDbret2n3V8fHklC6XJr+/K1NIP+pWZvDN+ tQGlXBvdeqdPG3DbCNSkeuYU7H4oBuBT8bb6bJS5kRDOL13G1meXWatCbhmK6YQjL+2v SBcg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zHmbEOfi; 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 38308e7fff4ca-30d7d88ca23si45086511fa.193.2025.03.25.06.04.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Mar 2025 06:04:00 -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=zHmbEOfi; 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 1tx3wJ-0001B3-GR; Tue, 25 Mar 2025 09:03:31 -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 1tx3vY-0000sG-1J for qemu-devel@nongnu.org; Tue, 25 Mar 2025 09:02:46 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tx3vV-000833-Eg for qemu-devel@nongnu.org; Tue, 25 Mar 2025 09:02:43 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-43bb6b0b898so53663675e9.1 for ; Tue, 25 Mar 2025 06:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742907759; x=1743512559; 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=J/DOA8hAmAVfg6M/0jKhvBqsPxQAowypQJ33xuaxeRc=; b=zHmbEOfiP8/YbteXBDxqsoUfUnkBO+XvhsMFySm0A4rz6zkN/4owWPfPE5ry5a9uoN 30Fi7C4a/dNw3xwEN9N42VSv6OlbTX8iV4SuUDoMIYrHNKxSjHMfdZEA+0vVZgz46F0G jp9OuIiZcaSkLeL/wE+/6dxd2nH0MuwU01eOn4OwXByd1AdMdmjDLyaepW+bvhk3W8Qz RV2mykVD23wVgXj3vS3OmgjKKUd3bfghJvDVz0HPw/GFEIBbQSrbjoH/P/t9+Kaku8N/ 391tv1UDo7Ye4z+1D7ltxh5HfegRfCgxT64SQyANdz49I9vTqF2YfLSBnsKwYg3EypUa EYdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742907759; x=1743512559; 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=J/DOA8hAmAVfg6M/0jKhvBqsPxQAowypQJ33xuaxeRc=; b=OrZya6DqYrCR9szV1b/FdxbRSqlrZtCBq5lW8nnbJBj5lGkyBSDRPhQajsSUP9T3+2 ZINVJtfDRoZwUoVZzdBuRXWpROhyc5TXQiOxOsZnaRortIoSBzbA/ferxcJGrntGCV6j FG2PGEJumRPm8HMl16+LWYmxMsrmaVl3wrIwmIZrDXJN+riC/kH+J/zUbC4VqYWkHBSJ Mwd5FwgX6V2W+fiRiUujsTWOj83BWG49nyuwGToTSWMMxCwjttIiFwZmbBrX8TS90qs8 9Mpj1wki2ep/cE+tq8E/zXUy5Vbh2EcDQ7wq9YN014oH3Ec5AjYwyTlyl5rCMl7Y8vVi KtjQ== X-Gm-Message-State: AOJu0YxzF1WSB/esRcekG+ztcAcADLfa9sJgkc4jIdsXQ0oRbhIB/1GS rqxFlkWH+ESAeXXBa7rFn1mvz+E8ypUi+ea0ri7cRrgrVnQ7egSgW+hkG3Nk10hkulrfuSwaRtx z X-Gm-Gg: ASbGncuENMfbHFMdZ5Y4Oue9sxPDEqzsrFrjzF6Bugy//FnYWuMfyAeKC5K8GvvDq8G qp+uEELsykXMzp+Swd6wa+yBXlxPuV9EOXxpjbumPY853hMQLKY9kaRu2KNw8B+VbfXZc1t8T6s 0XtV3nAvlYl0PE3y8qgB7MUrbw6ym2+22ug2cJUZuic2XRFg11UfnwTkwn/vrxFcp4A/Io3PTrI kaLEjICk8nsTWvO5bgJxToACZ164fqcHyjkS5QBcNMEloqiZ4EWwX3SJH3X0kdDRs8UrjZ827jX MY3PURpIYG7y5+02Pe0d1f3OM1iygv3oxu1b4PSIAbAClHDf5JoJ/++5KQH13lTnnNyWtieOxv1 nrBUgGxIYhlF4SSQK2mc= X-Received: by 2002:a05:6000:1ac9:b0:390:fbdd:994d with SMTP id ffacd0b85a97d-3997f910670mr15533763f8f.27.1742907758574; Tue, 25 Mar 2025 06:02:38 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d43f43e50sm198899785e9.12.2025.03.25.06.02.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 25 Mar 2025 06:02:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Eduardo Habkost , Zhao Liu , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Riku Voipio , Paolo Bonzini , Nicholas Piggin , Richard Henderson , qemu-ppc@nongnu.org Subject: [PATCH-for-10.1 3/5] target/ppc/gdbstub: Replace TARGET_LONG_SIZE -> sizeof(target_ulong) Date: Tue, 25 Mar 2025 14:02:18 +0100 Message-ID: <20250325130221.76116-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250325130221.76116-1-philmd@linaro.org> References: <20250325130221.76116-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 TARGET_LONG_SIZE is equivalent of sizeof(target_ulong). Since this is the single use of TARGET_LONG_SIZE in a source file, use the equivalent form to be able to remove the definition in a pair of commits. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/gdbstub.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index 3b28d4e21c7..4d36dcfb563 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -367,6 +367,7 @@ static int gdb_get_spr_reg(CPUState *cs, GByteArray *buf, int n) { PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + target_ulong val; int reg; int len; @@ -375,10 +376,7 @@ static int gdb_get_spr_reg(CPUState *cs, GByteArray *buf, int n) return 0; } - len = TARGET_LONG_SIZE; - /* Handle those SPRs that are not part of the env->spr[] array */ - target_ulong val; switch (reg) { #if defined(TARGET_PPC64) case SPR_CFAR: @@ -402,6 +400,7 @@ static int gdb_get_spr_reg(CPUState *cs, GByteArray *buf, int n) } gdb_get_regl(buf, val); + len = sizeof(val); ppc_maybe_bswap_register(env, gdb_get_reg_ptr(buf, len), len); return len; } @@ -410,6 +409,7 @@ static int gdb_set_spr_reg(CPUState *cs, uint8_t *mem_buf, int n) { PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + target_ulong val; int reg; int len; @@ -418,11 +418,11 @@ static int gdb_set_spr_reg(CPUState *cs, uint8_t *mem_buf, int n) return 0; } - len = TARGET_LONG_SIZE; + len = sizeof(val); ppc_maybe_bswap_register(env, mem_buf, len); /* Handle those SPRs that are not part of the env->spr[] array */ - target_ulong val = ldn_p(mem_buf, len); + val = ldn_p(mem_buf, len); switch (reg) { #if defined(TARGET_PPC64) case SPR_CFAR: