From nobody Tue Dec 16 03:21:18 2025 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=1752007576; cv=none; d=zohomail.com; s=zohoarc; b=FnJhb9DL8wfW9V+psRkDI+t73bpzfYO64efzGsVI8WaU+pSNYrp4Z1i4/URyedbKWEhc3b+/zp2PyzpYDhjHedqEyyBFF1Bu7wq6V/35clnmpBGkdb/J9BKVTqKHwSxuAvg0Sk/jDoxG3sWFawZD3gcOZFstIB7Zi/IEcbHG/vg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752007576; 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=hg2dyL7tW3tL/dDdSwNEK/JVBUdUtkDstPfeG3qxYtE=; b=d7W1NEJjIxvIN08HsGNO4iiNrJknq+yXuJWPhpkWzj/uCEwvqgWnl8tSidNNi6vsoNhN+EKLN2ExFPW9qezL8P/rwD38Tk06eKEBGKso8dziXbgBospUVBW17P3nLlYeQvRFbKJTOGXqoPxBxBA7HbeNHHSaUAp/hGKQ9UPLDNw= 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 1752007576401444.30813052245105; Tue, 8 Jul 2025 13:46:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uZFAT-0003G4-Ob; Tue, 08 Jul 2025 16:43:57 -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 1uZDXl-0005XO-9Z for qemu-devel@nongnu.org; Tue, 08 Jul 2025 14:59:57 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uZDXY-00027D-AV for qemu-devel@nongnu.org; Tue, 08 Jul 2025 14:59:49 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-60c51860bf5so7726923a12.1 for ; Tue, 08 Jul 2025 11:59:04 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b471b975efsm13281509f8f.46.2025.07.08.10.22.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 08 Jul 2025 10:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752001143; x=1752605943; 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=hg2dyL7tW3tL/dDdSwNEK/JVBUdUtkDstPfeG3qxYtE=; b=wEsKloeiQsjYQZdTYGkDHPDjHFKt/8p5TwlH4raKwcZsz3hvPfYjbgI/fz6MncJDKg HOPEkI9tBkeqtLjbH9uJKUZzvfLRRQjP8SVI6BOKBvPHr22cxj/OgqO5/fBreS8imQsV RTpXCmngMVNxYnmBfi1Hqu+9kk7kOAtMg6srloOEN/Vzukv1ba2X9Ehc3yXun+HC1H0Y 9VYzWyR5by+wOm1PFXMEI8r59xknwFg1hBc4qpxn5k51DptuI0Wu5kDJNPRjscEvPcBi qRyrO3c/ol/F+zFK07kMFUS8x2wq8rBfX4PRRYlzh9FrnqKWVv1VU1ep5+xaDuOOyopw rruw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752001143; x=1752605943; 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=hg2dyL7tW3tL/dDdSwNEK/JVBUdUtkDstPfeG3qxYtE=; b=nvcmexEU/x+cze1PC5fLsqT6oTlf4teuZTRGYeE6eGuqeJArvMk9J9GzwRj+Lkx32W BQNsEzR2wk/WzAs6nEgG+PU6neU2dzveHObjZsd81xbDfoz9t0ZBNClGzoQvmfbx1W6d fWH49SBjTwbJAXmqocMk9k2qvqqAKkhujU5ItasTHLRi4uHGgWvQ8BEtYyMleoEqBXLd k2blCVEoBanqnTicGk5QpGkYhfYqBLsdgyjEw+zX0+7T0Wn235bTHjb66Y7SYrnuNFAJ j2WGZzySIw3Rt3k1K2HgO+v77eG+jceXUalHWw0YAq8rTRQM3TmWYr5faft7eASYh6+r qidA== X-Gm-Message-State: AOJu0YxZqkIVladgrt4gwjiwCZXM8a6nHQYKcxpfdQEpteTNMIhRHgiO PYsCqsZaBcTa19ESTA8dubqVZPXtY2cKhV7aKRtW7ofruvyZk7doC5MwAoh9Vwws5Nj2rwrAIcE Q0dHV X-Gm-Gg: ASbGncteMzXKNk8k28W792Z0A16BrWCHLKfJHO24i2GQ32Qn9SkUflzHU7JOR4/D/Y2 n6QafESeGgJ8rsCmcreBN1wZzRpoy9n5HIK/BimKkWDJsUZHqdYIa7Mr1Hb9C/u75dVdlMcj+RF vMt0OrJw6yooJwhi6fvPSXnDhCzabs1OwARRLtsbV1dk81ipcwLXinWMfuq2oEXdNB5tKCprGQd yZ1Dyzj8SFcfCn2rxuNr6uYdBclBvXufDJkBVZD1yFGOH7HJM393bAaUNxhHrjdTvBr4ipsLGxi XOPbddXp4mhfgAYKAkdmxY4FdJPe5I/sOZqDVGqk65NcdziwV+1jpxu/vUxbjKGKgeWwahP78Lq M/Rhi8TxNyiWbZOu3d27ggPPv13iqACZiPzqV X-Google-Smtp-Source: AGHT+IEl3xAFgAOmbbj7qgMvicNw9rf+A5S0u5RVkXBNEJvLMdLB/qGhc6bLcFco17sXFzqEy1AtOw== X-Received: by 2002:adf:9c81:0:b0:3a4:cbc6:9db0 with SMTP id ffacd0b85a97d-3b5ddea1b98mr3138124f8f.51.1751995365618; Tue, 08 Jul 2025 10:22:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Manos Pitsidianakis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Thomas Huth , qemu-arm@nongnu.org, qemu-s390x@nongnu.org, Pierrick Bouvier , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Richard Henderson , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Zhao Liu , Gerd Hoffmann , Peter Xu , David Hildenbrand , Fabiano Rosas , Laurent Vivier Subject: [PATCH-for-10.1 v7 5/8] qemu: Convert target_words_bigendian() to TargetInfo API Date: Tue, 8 Jul 2025 19:19:45 +0200 Message-ID: <20250708171949.62500-6-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250708171949.62500-1-philmd@linaro.org> References: <20250708171949.62500-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::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.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: 1752007578831116600 Reviewed-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/exec/tswap.h | 13 +------------ include/qemu/target-info.h | 8 ++++++++ cpu-target.c | 7 ------- hw/core/cpu-system.c | 2 +- hw/display/vga.c | 2 +- hw/virtio/virtio.c | 2 +- system/memory.c | 1 + system/qtest.c | 1 + target-info.c | 5 +++++ 9 files changed, 19 insertions(+), 22 deletions(-) diff --git a/include/exec/tswap.h b/include/exec/tswap.h index 49511f26117..55ffa633598 100644 --- a/include/exec/tswap.h +++ b/include/exec/tswap.h @@ -9,18 +9,7 @@ #define TSWAP_H =20 #include "qemu/bswap.h" - -/** - * target_big_endian: - * Returns true if the (default) endianness of the target is big endian, - * false otherwise. Common code should normally never need to know about t= he - * endianness of the target, so please do *not* use this function unless y= ou - * know very well what you are doing! - */ -bool target_big_endian(void); -#ifdef COMPILING_PER_TARGET -#define target_big_endian() TARGET_BIG_ENDIAN -#endif +#include "qemu/target-info.h" =20 /* * If we're in target-specific code, we can hard-code the swapping diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index dde0e7d968a..18a8c4ff6e8 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -38,4 +38,12 @@ const char *target_machine_typename(void); */ const char *target_cpu_type(void); =20 +/** + * target_big_endian: + * + * Returns: %true if the (default) endianness of the target is big endian, + * %false otherwise. + */ +bool target_big_endian(void); + #endif diff --git a/cpu-target.c b/cpu-target.c index 1c90a307593..20db5ff3108 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -22,7 +22,6 @@ #include "system/accel-ops.h" #include "system/cpus.h" #include "exec/cpu-common.h" -#include "exec/tswap.h" #include "exec/replay-core.h" #include "exec/log.h" #include "hw/core/cpu.h" @@ -85,9 +84,3 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...) #endif abort(); } - -#undef target_big_endian -bool target_big_endian(void) -{ - return TARGET_BIG_ENDIAN; -} diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 3c84176a0c5..a975405d3a0 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -24,7 +24,7 @@ #include "exec/cputlb.h" #include "system/memory.h" #include "exec/tb-flush.h" -#include "exec/tswap.h" +#include "qemu/target-info.h" #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/core/sysemu-cpu-ops.h" diff --git a/hw/display/vga.c b/hw/display/vga.c index 20475ebbd31..90b89cf4044 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -26,7 +26,7 @@ #include "qemu/units.h" #include "system/reset.h" #include "qapi/error.h" -#include "exec/tswap.h" +#include "qemu/target-info.h" #include "hw/display/vga.h" #include "hw/i386/x86.h" #include "hw/pci/pci.h" diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 82a285a31d1..0f4d28033d7 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -20,7 +20,7 @@ #include "qemu/log.h" #include "qemu/main-loop.h" #include "qemu/module.h" -#include "exec/tswap.h" +#include "qemu/target-info.h" #include "qom/object_interfaces.h" #include "hw/core/cpu.h" #include "hw/virtio/virtio.h" diff --git a/system/memory.c b/system/memory.c index e8d9b15b28f..38da62f5052 100644 --- a/system/memory.c +++ b/system/memory.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/qemu-print.h" +#include "qemu/target-info.h" #include "qom/object.h" #include "trace.h" #include "system/ram_addr.h" diff --git a/system/qtest.c b/system/qtest.c index 301b03be2d3..fa42c9f9215 100644 --- a/system/qtest.c +++ b/system/qtest.c @@ -29,6 +29,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/cutils.h" +#include "qemu/target-info.h" #include "qom/object_interfaces.h" =20 #define MAX_IRQ 256 diff --git a/target-info.c b/target-info.c index a756c0714c4..3110ab32f75 100644 --- a/target-info.c +++ b/target-info.c @@ -47,3 +47,8 @@ EndianMode target_endian_mode(void) { return target_info()->endianness; } + +bool target_big_endian(void) +{ + return target_endian_mode() =3D=3D ENDIAN_MODE_BIG; +} --=20 2.49.0