qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Cc: qemu-riscv@nongnu.org, "Anton Johansson" <anjo@rev.ng>,
	qemu-s390x@nongnu.org, qemu-ppc@nongnu.org,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Claudio Fontana" <cfontana@suse.de>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	qemu-arm@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH-for-9.1 12/21] system: Introduce QemuArchBit enum
Date: Fri, 15 Mar 2024 14:09:00 +0100	[thread overview]
Message-ID: <20240315130910.15750-13-philmd@linaro.org> (raw)
In-Reply-To: <20240315130910.15750-1-philmd@linaro.org>

Current QEMU_ARCH_foo definitions are used as masks.
Extract the bit values, so we can easily iterate over.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/sysemu/arch_init.h | 69 ++++++++++++++++++++++++++------------
 1 file changed, 47 insertions(+), 22 deletions(-)

diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index 8850cb1a14..cf597c40a3 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -1,30 +1,55 @@
 #ifndef QEMU_ARCH_INIT_H
 #define QEMU_ARCH_INIT_H
 
+typedef enum QemuArchBit {
+    QEMU_ARCH_BIT_ALPHA         = 0,
+    QEMU_ARCH_BIT_ARM           = 1,
+    QEMU_ARCH_BIT_CRIS          = 2,
+    QEMU_ARCH_BIT_I386          = 3,
+    QEMU_ARCH_BIT_M68K          = 4,
+    QEMU_ARCH_BIT_MICROBLAZE    = 6,
+    QEMU_ARCH_BIT_MIPS          = 7,
+    QEMU_ARCH_BIT_PPC           = 8,
+    QEMU_ARCH_BIT_S390X         = 9,
+    QEMU_ARCH_BIT_SH4           = 10,
+    QEMU_ARCH_BIT_SPARC         = 11,
+    QEMU_ARCH_BIT_XTENSA        = 12,
+    QEMU_ARCH_BIT_OPENRISC      = 13,
+    QEMU_ARCH_BIT_TRICORE       = 16,
+    QEMU_ARCH_BIT_NIOS2         = 17,
+    QEMU_ARCH_BIT_HPPA          = 18,
+    QEMU_ARCH_BIT_RISCV         = 19,
+    QEMU_ARCH_BIT_RX            = 20,
+    QEMU_ARCH_BIT_AVR           = 21,
+    QEMU_ARCH_BIT_HEXAGON       = 22,
+    QEMU_ARCH_BIT_LOONGARCH     = 23,
 
-enum {
+    QEMU_ARCH_BIT_LAST          = QEMU_ARCH_BIT_LOONGARCH
+} QemuArchBit;
+
+enum QemuArchMask {
     QEMU_ARCH_ALL = -1,
-    QEMU_ARCH_ALPHA = (1 << 0),
-    QEMU_ARCH_ARM = (1 << 1),
-    QEMU_ARCH_CRIS = (1 << 2),
-    QEMU_ARCH_I386 = (1 << 3),
-    QEMU_ARCH_M68K = (1 << 4),
-    QEMU_ARCH_MICROBLAZE = (1 << 6),
-    QEMU_ARCH_MIPS = (1 << 7),
-    QEMU_ARCH_PPC = (1 << 8),
-    QEMU_ARCH_S390X = (1 << 9),
-    QEMU_ARCH_SH4 = (1 << 10),
-    QEMU_ARCH_SPARC = (1 << 11),
-    QEMU_ARCH_XTENSA = (1 << 12),
-    QEMU_ARCH_OPENRISC = (1 << 13),
-    QEMU_ARCH_TRICORE = (1 << 16),
-    QEMU_ARCH_NIOS2 = (1 << 17),
-    QEMU_ARCH_HPPA = (1 << 18),
-    QEMU_ARCH_RISCV = (1 << 19),
-    QEMU_ARCH_RX = (1 << 20),
-    QEMU_ARCH_AVR = (1 << 21),
-    QEMU_ARCH_HEXAGON = (1 << 22),
-    QEMU_ARCH_LOONGARCH = (1 << 23),
+    QEMU_ARCH_ALPHA             = (1 << QEMU_ARCH_BIT_ALPHA),
+    QEMU_ARCH_ARM               = (1 << QEMU_ARCH_BIT_ARM),
+    QEMU_ARCH_CRIS              = (1 << QEMU_ARCH_BIT_CRIS),
+    QEMU_ARCH_I386              = (1 << QEMU_ARCH_BIT_I386),
+    QEMU_ARCH_M68K              = (1 << QEMU_ARCH_BIT_M68K),
+    QEMU_ARCH_MICROBLAZE        = (1 << QEMU_ARCH_BIT_MICROBLAZE),
+    QEMU_ARCH_MIPS              = (1 << QEMU_ARCH_BIT_MIPS),
+    QEMU_ARCH_PPC               = (1 << QEMU_ARCH_BIT_PPC),
+    QEMU_ARCH_S390X             = (1 << QEMU_ARCH_BIT_S390X),
+    QEMU_ARCH_SH4               = (1 << QEMU_ARCH_BIT_SH4),
+    QEMU_ARCH_SPARC             = (1 << QEMU_ARCH_BIT_SPARC),
+    QEMU_ARCH_XTENSA            = (1 << QEMU_ARCH_BIT_XTENSA),
+    QEMU_ARCH_OPENRISC          = (1 << QEMU_ARCH_BIT_OPENRISC),
+    QEMU_ARCH_TRICORE           = (1 << QEMU_ARCH_BIT_TRICORE),
+    QEMU_ARCH_NIOS2             = (1 << QEMU_ARCH_BIT_NIOS2),
+    QEMU_ARCH_HPPA              = (1 << QEMU_ARCH_BIT_HPPA),
+    QEMU_ARCH_RISCV             = (1 << QEMU_ARCH_BIT_RISCV),
+    QEMU_ARCH_RX                = (1 << QEMU_ARCH_BIT_RX),
+    QEMU_ARCH_AVR               = (1 << QEMU_ARCH_BIT_AVR),
+    QEMU_ARCH_HEXAGON           = (1 << QEMU_ARCH_BIT_HEXAGON),
+    QEMU_ARCH_LOONGARCH         = (1 << QEMU_ARCH_BIT_LOONGARCH),
 };
 
 extern const uint32_t arch_type;
-- 
2.41.0



  parent reply	other threads:[~2024-03-15 13:15 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15 13:08 [RFC PATCH-for-9.1 00/21] qapi: Make @query-cpu-definitions command target-agnostic Philippe Mathieu-Daudé
2024-03-15 13:08 ` [PATCH-for-9.1 01/21] target/i386: Declare CPU QOM types using DEFINE_TYPES() macro Philippe Mathieu-Daudé
2024-03-15 13:08 ` [PATCH-for-9.1 02/21] target/mips: " Philippe Mathieu-Daudé
2024-03-18  8:13   ` Zhao Liu
2024-03-15 13:08 ` [PATCH-for-9.1 03/21] target/ppc: " Philippe Mathieu-Daudé
2024-03-18  8:15   ` Zhao Liu
2024-03-15 13:08 ` [PATCH-for-9.1 04/21] target/sparc: " Philippe Mathieu-Daudé
2024-03-18  8:16   ` Zhao Liu
2024-03-15 13:08 ` [PATCH-for-9.1 05/21] cpus: Open code OBJECT_DECLARE_TYPE() in OBJECT_DECLARE_CPU_TYPE() Philippe Mathieu-Daudé
2024-03-18  8:31   ` Zhao Liu
2024-03-15 13:08 ` [PATCH-for-9.1 06/21] target/i386: Make X86_CPU common to new I386_CPU / X86_64_CPU types Philippe Mathieu-Daudé
2024-03-18  8:47   ` Zhao Liu
2024-03-26 10:57   ` Markus Armbruster
2024-03-26 12:17     ` Philippe Mathieu-Daudé
2024-03-15 13:08 ` [PATCH-for-9.1 07/21] target/mips: Make MIPS_CPU common to new MIPS32_CPU / MIPS64_CPU types Philippe Mathieu-Daudé
2024-03-19 18:12   ` Philippe Mathieu-Daudé
2024-03-15 13:08 ` [PATCH-for-9.1 08/21] target/sparc: Make SPARC_CPU common to new SPARC32_CPU/SPARC64_CPU types Philippe Mathieu-Daudé
2024-03-15 13:08 ` [PATCH-for-9.1 09/21] qapi: Merge machine-common.json with qapi/machine.json Philippe Mathieu-Daudé
2024-03-26 12:12   ` Markus Armbruster
2024-03-15 13:08 ` [PATCH-for-9.1 10/21] qapi: Make CpuModel* definitions target agnostic Philippe Mathieu-Daudé
2024-03-20  8:49   ` Philippe Mathieu-Daudé
2024-03-26 12:16   ` Markus Armbruster
2024-03-15 13:08 ` [PATCH-for-9.1 11/21] qapi: Make CpuDefinitionInfo " Philippe Mathieu-Daudé
2024-03-15 13:09 ` Philippe Mathieu-Daudé [this message]
2024-03-15 13:09 ` [PATCH-for-9.1 13/21] system: Introduce cpu_typename_by_arch_bit() Philippe Mathieu-Daudé
2024-03-15 13:09 ` [RFC PATCH-for-9.1 14/21] system: Introduce QMP generic_query_cpu_definitions() Philippe Mathieu-Daudé
2024-03-26 12:54   ` Markus Armbruster
2024-03-26 13:28   ` Markus Armbruster
2024-03-29 13:03     ` Philippe Mathieu-Daudé
2024-04-02  9:37       ` Markus Armbruster
2024-03-15 13:09 ` [RFC PATCH-for-9.1 15/21] target/arm: Use " Philippe Mathieu-Daudé
2024-03-15 13:09 ` [RFC PATCH-for-9.1 16/21] target/loongarch: " Philippe Mathieu-Daudé
2024-03-15 13:09 ` [RFC PATCH-for-9.1 17/21] target/riscv: " Philippe Mathieu-Daudé
2024-03-15 13:09 ` [RFC PATCH-for-9.1 18/21] target/i386: " Philippe Mathieu-Daudé
2024-03-15 13:09 ` [PATCH-for-9.1 19/21] target/ppc: Factor ppc_add_alias_definitions() out Philippe Mathieu-Daudé
2024-03-20  5:07   ` Nicholas Piggin
2024-03-15 13:09 ` [RFC PATCH-for-9.1 20/21] target/ppc: Use QMP generic_query_cpu_definitions() Philippe Mathieu-Daudé
2024-03-15 13:09 ` [RFC PATCH-for-9.1 21/21] qapi: Make @query-cpu-definitions target-agnostic Philippe Mathieu-Daudé
2024-03-26 13:32   ` Markus Armbruster
2024-03-26 10:18 ` [RFC PATCH-for-9.1 00/21] qapi: Make @query-cpu-definitions command target-agnostic Markus Armbruster
2024-03-26 13:37 ` Markus Armbruster
2025-03-11  7:56 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240315130910.15750-13-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=anjo@rev.ng \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=cfontana@suse.de \
    --cc=eduardo@habkost.net \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).