From patchwork Tue Jul 2 05:00:53 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: 809025 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp43786wru; Mon, 1 Jul 2024 22:02:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUCKyvRcmrkM5yBW6tX5CTuaj/5ObUkddrFVwhrOnmryQabtsMpDDdePOuvps7MGWnr4TjErTXW0Hf2kTtFa4sC X-Google-Smtp-Source: AGHT+IFoP7Paqzd3/9GazhO23lD9jOiVQP8VlLXfxXkiCC1SmPstxaTJVt7MAE99htjnbBXbEJJr X-Received: by 2002:a05:6214:5090:b0:6b5:61:53a9 with SMTP id 6a1803df08f44-6b5b70b263dmr68984626d6.28.1719896554016; Mon, 01 Jul 2024 22:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719896553; cv=none; d=google.com; s=arc-20160816; b=Mk/njgq1aDeUEhM17ejV8sx8TIKdAYQrrDZWq74QD8uh/1ERh94G1LMV+Jb8n6i2+g 6y1uQNpOtNgYvDiIGmNvUG+bvwlfERWz2ara5FEKrqQSW8MJKscmaUJdLhwjgpeDlfuD ufduw5BS+nnz9fi6VAuQHZ+axMbmjjDXn5hUQpWWi8oAD1BhwGAEk4JpOpGO6ZHlxyQ5 uTAupMJJ+scHEWwN47bPBlUbIiNG4SsG3ewA7/zURVDuxhyAyHvRfWt6K71AiakO2ZDq Fewrdoa9N6gI8/cv5blM9oHBBqqHRXlzvzSuIKhmadg1PLCr/VA43Q1oc5AS0P5SzR9L s/qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=ojuMSOD3mJ6z5l/dHTXyuiUf8CYGwAbSuIgUM0ljX7g=; fh=B/0b1FThncQQQALBQMKdmnM3E+nS03h1GE8Rgi7aa2k=; b=MvXL9B3BumBrvBam7W0mADoHHMJxvGc2/CgW/l4QUdJp/VWZM3XkSevgVrb2pUIBKI KJ2USJ4dnKMQELAxaKYZBH+I2m6HDlndtdSdYHZ+S1Q6k5E3qU6nKCAo/FozB57CjSTK XA7xwW4F2Dv2rhDWnChzOkWrL/c3CzT+FxPkMOY5CCMv15zbMzcmVrWOlVtKospyHtJw 6IBSzJaVrqC4AKiADoYyzJXpW24RZy8fNsYuSXVTqp4itr+N0e9YPWnv/SXOTdHkvDEh Q/vMtveAVjrYvH8pZ2us5rOGUaBpd843kQTic7FqujL01AgrGnvimciw2gKu0zm/NmJI 2CQw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gH2Kv6GV; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b59e622ccasi96683706d6.593.2024.07.01.22.02.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 22:02:33 -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=gH2Kv6GV; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOVeS-0007Ix-V0; Tue, 02 Jul 2024 01:02:02 -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 1sOVeQ-0007Ic-MH for qemu-devel@nongnu.org; Tue, 02 Jul 2024 01:01:58 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOVeO-00070K-Ue for qemu-devel@nongnu.org; Tue, 02 Jul 2024 01:01:58 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-52cdfb69724so4660797e87.1 for ; Mon, 01 Jul 2024 22:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719896515; x=1720501315; 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=ojuMSOD3mJ6z5l/dHTXyuiUf8CYGwAbSuIgUM0ljX7g=; b=gH2Kv6GVBmyBUo1pg2skAixpDRIvTjbeLtLtha2JP7ldtjj0bnHcpdyK8xHC3xutdC 0YJ9tposCWfnWCPAluzT+rqy3I39tJcRxRqKP5yjCeF+8783ONYtj8JPl8noL/WHzH8o gMCzEIdJEWKhm23URhK5di/vm8IC4ZdpraOVijCoPL5bwVVOYU5fsZ13fCA22gAVX7H/ UTzRZYMdmJngU6XUUdhXJtJ2FK3neuDL9ALzrKVH+JAJHckDd/xCSN2PjEg43XzzSpZm ApSNuThLREb4g704TQ2rnELYS+kw7ti52a9kW4zV/EiWUGE9LkOt9CHz1S7W1+wmXpRs rUhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719896515; x=1720501315; 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=ojuMSOD3mJ6z5l/dHTXyuiUf8CYGwAbSuIgUM0ljX7g=; b=EVK886pTR4LWBrmvVKeaqFXnuJ97shjmQRd1KX2P5SV0fSEdTYAAvzDJbT0Q9z1Uu8 TOPnVvwmDeSXzu063uH+N9Qdruz/eV6r3FbRZ/awEoRzPQntHdizygkHntLp3Yqfi4nq oZVV5O33WCir0hrlUSJFffvYdBMXTeeMP0hHL1awDgJikgZVRjrhdHEpoSi6twncx1sm lfqE3RLxIYl36cTp9FwG1sf4YUwbR6dzmtwDgNdw101liAC5+pD5gYbVMeTD9pB02Koz z9YZ2mXg4SpEBRypUNd04aGKKvzye7gBr7/skoNmW2rLQMHwvbGUAg1S45uMNnT6ybmx IsDQ== X-Gm-Message-State: AOJu0YwtjAiNTqu41qI19RLXJngroHeQh8sGUCSmYyp1oovCWVUbgWgg 9rvIR5JAxCNJPOAVADmNVvBLcLBOjq/8mwxbKCsDHydMeSdJ85doNlm+q0n0Cp3C30hvzQvAYqr b X-Received: by 2002:a05:651c:244:b0:2ee:7255:5032 with SMTP id 38308e7fff4ca-2ee72555309mr15962701fa.34.1719896493894; Mon, 01 Jul 2024 22:01:33 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.58]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4257bc89832sm109373675e9.42.2024.07.01.22.01.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 01 Jul 2024 22:01:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 03/22] hw/arm: convert 'virt' machine definitions to use new macros Date: Tue, 2 Jul 2024 07:00:53 +0200 Message-ID: <20240702050112.35907-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240702050112.35907-1-philmd@linaro.org> References: <20240702050112.35907-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=philmd@linaro.org; helo=mail-lf1-x12d.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 From: Daniel P. Berrangé This changes the DEFINE_VIRT_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240620165742.1711389-3-berrange@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/virt.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 0784ee7f46..08990b9abe 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -101,33 +101,35 @@ static void arm_virt_compat_set(MachineClass *mc) arm_virt_compat_len); } -#define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \ - static void virt_##major##_##minor##_class_init(ObjectClass *oc, \ - void *data) \ +#define DEFINE_VIRT_MACHINE_IMPL(latest, ...) \ + static void MACHINE_VER_SYM(class_init, virt, __VA_ARGS__)( \ + ObjectClass *oc, \ + void *data) \ { \ MachineClass *mc = MACHINE_CLASS(oc); \ arm_virt_compat_set(mc); \ - virt_machine_##major##_##minor##_options(mc); \ - mc->desc = "QEMU " # major "." # minor " ARM Virtual Machine"; \ + MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ + mc->desc = "QEMU " MACHINE_VER_STR(__VA_ARGS__) " ARM Virtual Machine"; \ if (latest) { \ mc->alias = "virt"; \ } \ } \ - static const TypeInfo machvirt_##major##_##minor##_info = { \ - .name = MACHINE_TYPE_NAME("virt-" # major "." # minor), \ - .parent = TYPE_VIRT_MACHINE, \ - .class_init = virt_##major##_##minor##_class_init, \ - }; \ - static void machvirt_machine_##major##_##minor##_init(void) \ + static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) = \ { \ - type_register_static(&machvirt_##major##_##minor##_info); \ + .name = MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ + .parent = TYPE_VIRT_MACHINE, \ + .class_init = MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \ + }; \ + static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ + { \ + type_register_static(&MACHINE_VER_SYM(info, virt, __VA_ARGS__)); \ } \ - type_init(machvirt_machine_##major##_##minor##_init); + type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); #define DEFINE_VIRT_MACHINE_AS_LATEST(major, minor) \ - DEFINE_VIRT_MACHINE_LATEST(major, minor, true) + DEFINE_VIRT_MACHINE_IMPL(true, major, minor) #define DEFINE_VIRT_MACHINE(major, minor) \ - DEFINE_VIRT_MACHINE_LATEST(major, minor, false) + DEFINE_VIRT_MACHINE_IMPL(false, major, minor) /* Number of external interrupt lines to configure the GIC with */