From patchwork Fri Mar 15 13:09:00 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: 1912538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=op75yWP2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tx4bC0mS5z1yX0 for ; Sat, 16 Mar 2024 00:19:19 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rl7L8-0000ek-Jf; Fri, 15 Mar 2024 09:11:14 -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 1rl7Kh-0007Zx-UV for qemu-ppc@nongnu.org; Fri, 15 Mar 2024 09:10:49 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rl7KX-0008CO-Kg for qemu-ppc@nongnu.org; Fri, 15 Mar 2024 09:10:44 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a36126ee41eso254167666b.2 for ; Fri, 15 Mar 2024 06:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710508235; x=1711113035; 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=Ziq2wowWWC1u1AFoZqkoU9Vq9nlm9ySbjwCpiWVML/s=; b=op75yWP2kBjzzxO4AdYFmO4Wwo0v7v88JOe1Ykk8tAKJ0uI0EFjvxmuiLe0nmavjWX MJVkOvgR18oqw+jMCWtIu7E5CruYbj5uTFZiOdFfOZ37VzhYmpwLTJXyJYO0JCTmlKnJ Czkzl93KzuaVFic86Yf2+OYELIHTTNMivoaIe527tsfKkbf5YkKgEfn1ZZ0Cxp2AuNLh Gu44qFgAQXlZg3lk25436nEktmosFjajJCT5A3HXGkgQJs0XM1Jm12dAf+CyJG9IXyZB yBYDGRgL3AUXmRIgzQ6CtU3pXGijOhy1IhNy2GvuJpP4yOI1M/BL2QJiw737yDPN+QyL csmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710508235; x=1711113035; 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=Ziq2wowWWC1u1AFoZqkoU9Vq9nlm9ySbjwCpiWVML/s=; b=wPqcfraMY3WsqIcEvjXPue86rrUAc6gRY/Mzrd6CLMDAV2y/zgrEoOP5sU2qm04wOR hEVD3ib8DqI2Nrw5fJ4EL8EccWAxkOixFaxsBjCvTpmgv/Ni72Ck1iMWFxnfRQg6C+TJ hWyoPSYFhs18szmHRU1i9jV0ZJETtmUAR0UcquNaP3r2u1M6/DQhF/BV15IDWQ9BlUqT KoNAUc+CTzAjq6ffusD+5w3pVkfifBNQ3yH8hr/2Mv5QpGR1Rhi2zTkog/Vixr1F8lgA iG1fghLuYydgZTcl1QV8NYk5WAB6YxjHMBU5do1kiSn7spmH0Zq9Oag69UOZyC+3KmjX Avhw== X-Forwarded-Encrypted: i=1; AJvYcCUpJ9XwtNtYzPBG0Mia9rcfDaQqYx/wOTk4Z3baXVhxaCjUycQel/Yz/xBsP1t4wydo/644/b1ouU4sHPUWo7E6WmTb X-Gm-Message-State: AOJu0YxiZOsEfN5IG5q2Rn2NzQhaPxTMeuaZyUCOynJ2trHYDAEYjrg7 buQnK5QxY6Ls4EtTGxBmMRACG25zbVrt3dL4wIGLDX6OUAG/WJtOc0WhO1I2sDPacZd3cAJha0u q X-Google-Smtp-Source: AGHT+IGM9lKIGYFKaZaCihcgLpVmcmySzlNiRx+Vc9T9AfUSHHHR2fR0Hvp2VtpFFpo3dT3QgLPrVA== X-Received: by 2002:a17:906:40ca:b0:a45:2e21:c776 with SMTP id a10-20020a17090640ca00b00a452e21c776mr3334104ejk.3.1710508235156; Fri, 15 Mar 2024 06:10:35 -0700 (PDT) Received: from m1x-phil.lan ([176.176.145.26]) by smtp.gmail.com with ESMTPSA id c19-20020a170906341300b00a462736feedsm1691257ejb.62.2024.03.15.06.10.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 15 Mar 2024 06:10:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-riscv@nongnu.org, Anton Johansson , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Daniel_P_=2E_Berrang?= =?utf-8?q?=C3=A9?= , Paolo Bonzini , Eduardo Habkost , Claudio Fontana , Richard Henderson , Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Manos Pitsidianakis , Zhao Liu , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.1 12/21] system: Introduce QemuArchBit enum Date: Fri, 15 Mar 2024 14:09:00 +0100 Message-ID: <20240315130910.15750-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240315130910.15750-1-philmd@linaro.org> References: <20240315130910.15750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01, UPPERCASE_50_75=0.008 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.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é --- 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;