From patchwork Wed Mar 5 00:52:20 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: 870495 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:178f:b0:38f:210b:807b with SMTP id e15csp540761wrg; Tue, 4 Mar 2025 16:53:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXjRQZaJ6DwOxTfdksHikeTK+mj2rqmsORXpihrpfrlS32R7Vbo4hKNFyIVXPoI1YjKr+JDnQ==@linaro.org X-Google-Smtp-Source: AGHT+IHjyamTtdtTf5isbJB1RvIzH25zn2xwX1xu4W4Igga+Vxk08h2u4LuCOE2OYoO6LbQVz219 X-Received: by 2002:a05:622a:24d:b0:474:fb73:6987 with SMTP id d75a77b69052e-4750b4d82bfmr16225861cf.50.1741136001206; Tue, 04 Mar 2025 16:53:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741136001; cv=none; d=google.com; s=arc-20240605; b=cgrLPc5wVqR4c3ZEWMVY+O3mOrQhA2uINbjkQ263lRMcuTjAUPJwYhyv8IIzqhN/Dp B1meTDJjEEAyYxz2BRNC+EbnAi14OWEd4e16VibQP95jUA572bXD99s3hdPgsQ80MXpQ 1sP/w7e0bS1pgNstcRRJdU4QgHx5Y5AH07/8VoMv9d+erHjfPWdJtnt/lDJYmvVzO7UY OwEW0CXZL5KTtxiQBxiPK5SY8d/w10bGhp6PPjjfpig7PLslKanQf2OpkH5J9fvoByjU FqPKqh7AEaWrcN1TECH/hy37J+UAgrHdhUyRQ7p6Hogo1wpEnDPDnRz74KnUK5vXkbI/ WXxQ== 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=aI7bGdusWwalQtQ/oihM/Pr8zgv/ivF1OVwRKsBRxKw=; fh=BW2TZvblXUTHno32gRgjkSOAINcocKVvD//AVk+YV+0=; b=c2WNuJaQQoP0nHFvYG6IfSdSJrqsIlBy0Ji8GqlEtRLHDxVe3aHzwQjukEmIO4iGbu BEu6RYxmgcYwGvFNi1Lv9e3XVWux/4IpmZD/Ux+5z9P/cq4p4HLSxb8YXPzv9pOHYf2H jIEFrb327zNLUgm+21svWBd6HiJ8EnzzMto4sdxWd6ADz91XlWwaNxLcNfdKWJo3BXCW mpm4y7j+kLMvaw2SDNCTEKdFxO32zAknsXAPKaSRSmNrYze48LxK1MK3q/ZjYWk+2J1w lJwA6gytSnNWqLIRdLCvcTFkX/5y+IOsf/Iz8kizNB47NKvOVgQ0HxHyYu13d7Vp4sbk NkOw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g3whpSgM; 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-474fee72f43si22141331cf.363.2025.03.04.16.53.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Mar 2025 16:53:21 -0800 (PST) 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=g3whpSgM; 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 1tpd0S-00022M-J7; Tue, 04 Mar 2025 19:53:04 -0500 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 1tpd0Q-00022A-Ux for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:02 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpd0O-0007Uh-Us for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:02 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-390eebcc371so2710193f8f.0 for ; Tue, 04 Mar 2025 16:53:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741135979; x=1741740779; 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=aI7bGdusWwalQtQ/oihM/Pr8zgv/ivF1OVwRKsBRxKw=; b=g3whpSgMsjfDpFlmtAsVyRlysniRThxnmibzudnqjCWKjl1E5iFCW/ty37mXHiiXol hu6vog9URuJA8U6KdqasYWEET7zCsSRf6pUKFT3LnCBXI0OvoEJuMEvlhi3F6tt6Gsu9 KuJiC0fV5q3Q0u2vhvFV0fJpJ2ZtE9nSaQfEXlpWvgohOXTnJqzbMs0PXkWUNXLj/VbC /6vGf1q8r/trHZ94M1N50UgiIuPd7u95alxDWeBXJ6tWazTGnFMYJcTdZwG22Y3AZ14L IJ5n+QkTk+Cz360OAOUCKa50IyC+CBzWSMZ+IXaet/FayLsbs5N1SvX6Lhmf2k2+ti1Q K5nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741135979; x=1741740779; 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=aI7bGdusWwalQtQ/oihM/Pr8zgv/ivF1OVwRKsBRxKw=; b=EJsxJpqeMiQT2q3oBkXOm41d3ZI0iu6PFY6Nao/Vrx8x7Wa6LNGSSB/VF6uCch4Ryq epfpDMFyK1KU7JWP8a4FW/PEF0CoPTWxG4HfDQBP8Eq1Q3YlUX0vJBUe1iw2H3u0l9jK ExXbvNKdQ8Auchmj3/zdAWw1fS6QaY/LrqLjEZ97GzVhhF8xUQOHeySQTXrCm9KmyRFR YDdKEajX2jV3IDadaJpG5JpdBxiHecBJ/7hhpuZmS08TAMkpHV9blJ3+/L0eAUkiUpZt CSLn4rtxmVkgfnxgEoh3Ok4SyWI3P6eE4r0YVkrwVf2DH0tZzLEePc5kULkTd9nN8jtC eT6w== X-Gm-Message-State: AOJu0Ywg8w1n2Cimo61fYQ6qZ3cukyH6Lcfg0SXXuzSIsCdcfiQ70Wid UDDyThebxodO5T62a4zTr40kxCn6uJoqVSHNrbL5zH7hueS/weIznbCY3u6xwGkq1CCojqvY9bc dp1k= X-Gm-Gg: ASbGnctMbkMx++0DE3RLniqMCE8UsbSPnubqso9jN3By6qb2aylaJpzHhJi5aBigCyq VTsFpZvo4uZZwFGv5synPaI/QwSkMxJlHH92/pIls6gs0sdMerlsNS6uAQe5QvN9zbUqEjJzhn7 OqaKzx6VCAeS6AduaRA7vsQeYAHSOney2eOYdoqV6gTbACG/bzPirq7Av9yW80bdSWNARQW5aHW DlcMLVjc/e5kxLjX8EtF994EREKh3CJl4Xhk4c2zl/gdPtbCYfq1G14Vv4YSpv0gMwe5Cq2fu3w 6TUVnINT0VfwAKAQ7O1SryaC/RaSWt5/4arJzTAAsufe1ftij690lUi4w4oQ0vB9eviuyIMlsn8 IHatGGKkx0lfTrYPKNhg= X-Received: by 2002:a05:6000:18a7:b0:38f:483f:8319 with SMTP id ffacd0b85a97d-3911f7c17f2mr662075f8f.51.1741135978743; Tue, 04 Mar 2025 16:52:58 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd42b7478sm1496035e9.17.2025.03.04.16.52.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:52:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?utf-8?q?Daniel_P=2E_Berra?= =?utf-8?q?ng=C3=A9?= , Richard Henderson , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [RFC PATCH 06/11] include: Declare target_name() in common "qemu/arch_info.h" Date: Wed, 5 Mar 2025 01:52:20 +0100 Message-ID: <20250305005225.95051-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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=ham 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 No need to include the huge "hw/core/cpu.h" header to get a simple prototype declaration such target_name(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/core/cpu.h | 2 -- include/qemu/arch_info.h | 2 ++ arch_info-target.c | 5 +++++ cpu-target.c | 5 ----- hw/core/machine-qmp-cmds.c | 1 + system/vl.c | 1 - 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5d11d26556a..4f538a8f96d 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1162,8 +1162,6 @@ bool cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); void cpu_exec_reset_hold(CPUState *cpu); -const char *target_name(void); - #ifdef COMPILING_PER_TARGET #ifndef CONFIG_USER_ONLY diff --git a/include/qemu/arch_info.h b/include/qemu/arch_info.h index 3cb95926e27..613dc2037db 100644 --- a/include/qemu/arch_info.h +++ b/include/qemu/arch_info.h @@ -46,6 +46,8 @@ typedef enum QemuArchBit { #define QEMU_ARCH_LOONGARCH BIT(QEMU_ARCH_BIT_LOONGARCH) #define QEMU_ARCH_ALL -1 +const char *target_name(void); + bool qemu_arch_available(unsigned qemu_arch_mask); #endif diff --git a/arch_info-target.c b/arch_info-target.c index 6c11c73feb9..61007415b30 100644 --- a/arch_info-target.c +++ b/arch_info-target.c @@ -24,6 +24,11 @@ #include "qemu/osdep.h" #include "qemu/arch_info.h" +const char *target_name(void) +{ + return TARGET_NAME; +} + bool qemu_arch_available(unsigned qemu_arch_mask) { return qemu_arch_mask & BIT(QEMU_ARCH_BIT); diff --git a/cpu-target.c b/cpu-target.c index f7e17a650c0..1177e93c444 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -158,8 +158,3 @@ bool target_words_bigendian(void) { return TARGET_BIG_ENDIAN; } - -const char *target_name(void) -{ - return TARGET_NAME; -} diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 3130c5cd456..3bf280cef16 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -19,6 +19,7 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/type-helpers.h" #include "qemu/uuid.h" +#include "qemu/arch_info.h" #include "qom/qom-qobject.h" #include "system/hostmem.h" #include "system/hw_accel.h" diff --git a/system/vl.c b/system/vl.c index e96c72e5400..a41ba4a2d5f 100644 --- a/system/vl.c +++ b/system/vl.c @@ -80,7 +80,6 @@ #include "hw/block/block.h" #include "hw/i386/x86.h" #include "hw/i386/pc.h" -#include "hw/core/cpu.h" #include "migration/cpr.h" #include "migration/misc.h" #include "migration/snapshot.h"