From patchwork Fri Mar 7 15:15:38 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: 871208 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp813629wri; Fri, 7 Mar 2025 07:17:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWKoHizVgF2G/yqjrHO5to5WLSupSZN5ei3o7II99MOGqMN5/sr2HkdoDVUFXFfSJko37SFEQ==@linaro.org X-Google-Smtp-Source: AGHT+IEV4jXvbjiFqNUqimRBTS+CoqvrfrpZLPruyYwrsdKkQTqBDm28Jb257hWe/Kq67WoNZw7o X-Received: by 2002:a05:6214:76c:b0:6e8:90eb:e591 with SMTP id 6a1803df08f44-6e90065264emr40677686d6.24.1741360653273; Fri, 07 Mar 2025 07:17:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741360653; cv=none; d=google.com; s=arc-20240605; b=P96dx/KTK+BJLB7R1BOe18etKqfgljUw0ZhuwIqB7cORuFcZTpFu3hxmp5AuhYDDsy kBhj7VcYLIhtsSWvVrrOmp3nCB/eUCgUM6NWFbYtUZ1ujix3clnlIk1iK262tLPac849 NWDhwvVbfRj3PN9UMdYRVcNcNnkTWnTN032SH9PnxTyLMmWzDVbVwwhIBkSC1FOLW6ET m5pohcNz6Xcj/ePl11LrcRlq+29acrXFBvWQ371qLVmH2oB78WJKJ/cpXtb21Pcrb0mv 5UUpUMk0vd/0tfU2HvrM/cwRQ5QvpOH+UAaNfyzXVWiZkyLRIwz6tOsQfP63mYduIAX0 wEeA== 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=oJ6QS8bPHspYWexuxW/Mo3/+G0MWF76KuZRGtLsMeFA=; fh=FXtWUx7amUH5pCqcNLOkhTwo5r7IFsByJZRWfWxnad8=; b=LXv1HaqtVxpFt5nAn0pUNc9Kc7j3nGDi3deE+dv5u/8WtG6HdkXY8omubxFVNBPQfl 72TdqKF/U5ozHQSpHUV8grkT4EYh6Uf9RBlLSWr5GaqA43rEonvvBY2xYrcrcckEBZFF iBpepjkLtUhppVUC9JRB3DsHKSjcHou0GlBh9CjcIXqv3FNSpftXrIBQE7UfGo+IcGxk 2ybie23SARmu4WrZyrwYS5/dqcviR+DZl/Az/eJLhGMthj9ExhUICqOgCrN2w0KsM/WH a6U3phkmGCEJoqZU9Z7+lin0D84OdRQZZ+9ZKm5rQCrFuIRF/HUIDG54r1cYzk1skBx6 td/g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fA/hhJRy"; 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 6a1803df08f44-6e8f707cf0bsi36478766d6.84.2025.03.07.07.17.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 07:17:33 -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="fA/hhJRy"; 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 1tqZRw-00060T-2U; Fri, 07 Mar 2025 10:17:21 -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 1tqZQe-0005pz-RE for qemu-devel@nongnu.org; Fri, 07 Mar 2025 10:16:06 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqZQd-0003cy-0X for qemu-devel@nongnu.org; Fri, 07 Mar 2025 10:16:00 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43bd87f7c2eso11395935e9.3 for ; Fri, 07 Mar 2025 07:15:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741360556; x=1741965356; 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=oJ6QS8bPHspYWexuxW/Mo3/+G0MWF76KuZRGtLsMeFA=; b=fA/hhJRylF7WJsSoWEQvloCOypH9P60jFhquyRMNytYvJY3jBMphqwPMWP8mV3l5z3 oMkMwPG+yaEWFgVFZdumjZSNP1hysX6ylV3rJdgejDwknBAOb6X1n2sXWya3JfZ8/x3o snTgttPFVav/qFvYKeuw6Q3IMIvHj5qRP9n3/gGz1R3g/qiK0kTPlBib9e/bTu1P0eN5 KpdGlrYZt6ngIztmIYHERIpqgwtr2cy/A76fHnSfCmLXXu/nZHQhV06IdMFupRz1v3Dr k6HvfzyCJQG8ZteL3FZqOdiPJlPF42EcKA3S3HPgObyjL4AFWplFZs8jp+zEor6oE75c uesg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741360556; x=1741965356; 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=oJ6QS8bPHspYWexuxW/Mo3/+G0MWF76KuZRGtLsMeFA=; b=iAI/QIcOfscneJb3CXKz0ZBCKs70LJGV7ZbjVTgil1w7h7PeRB22ByzqOKVOAJ6EOg c1EKHc1+JBz6jlN+c7WXr7oi7TJN/Itf0fUmnnhrzVe2Z3sWDWW8+nkHeqPShyvq+T5Q MpwmIUU2V7YFb9n4EGlJhLO3BLALwmv6BuJ1cF7li6d+dk+qrSgbnvzxICO6pwUOUy5p 8v4CxajcYlxzODwLWGRIvC1S9So/h1XYe7zFAoDldHb2PLUTR6odw36rcxNPvJ4DbA0G ilUCa/mgQvLUcHo35at49uB4r4vxENpQr1oBXuWjVNlOA8t9ZaEK6xEfeec4xsT4mQ12 xEPA== X-Gm-Message-State: AOJu0Yxd5ZUWp4LYUdR68ECXX1A6kfMKdJ7uKSyAF+i9uRL/jxwOLx8R ZQGQmshRzjqbEDxlPdapjgnfmMpl7Bpwpqx9cf/ByGAgzd6mNNmInw33lVXWiK/J8FLcejOb124 BCBM= X-Gm-Gg: ASbGncsVM/GS8udDZEScZk/Dm0jK6XL/y31RcCoHVmcYd2EOuyOtnCgvAbAY/liUINM +Dba8/0cNEGRcgBJOGGxNy6QYnFmIZRhVaKDRs4/rbkrDgRJM8d8H4fTje6cllp4ywHtxMF/J1Q tua8iDTVLVy5oPvNEuUvrfveLenFazM10+BDWdi2hkbzU+rwW4yRuSY+FOxZr5yFk9uSJvlAcod h5Tfan12/tbTff7yuWswAvAKL97tcgHZLKj3ifvTw+vIRdUWJa+OxbXDk697ynMNSoj5nkp2VaM Iai2ngGl8gLRfCUUeAhsc6XtxS9OhLtHtEh9N0eXQMJAXttqoPz16l1T6e3w5ijjBWrLRoHBL/0 QvmOum1OuQ8yDbmI5KVQ= X-Received: by 2002:a5d:5f45:0:b0:390:fb37:1bd with SMTP id ffacd0b85a97d-39132da8e47mr2305456f8f.46.1741360555832; Fri, 07 Mar 2025 07:15:55 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3912bfdfa52sm5474263f8f.21.2025.03.07.07.15.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 07:15:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Ani Sinha , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini , "Michael S. Tsirkin" , Richard Henderson , David Hildenbrand , Igor Mammedov , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/7] hw/acpi: Introduce acpi_builtin() helper Date: Fri, 7 Mar 2025 16:15:38 +0100 Message-ID: <20250307151543.8156-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307151543.8156-1-philmd@linaro.org> References: <20250307151543.8156-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 acpi_builtin() can be used to check at runtime whether the ACPI subsystem is built in a qemu-system binary. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Ani Sinha --- include/hw/acpi/acpi.h | 3 +++ hw/acpi/acpi-stub.c | 5 +++++ hw/acpi/core.c | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h index e0e51e85b41..d1a4fa2af84 100644 --- a/include/hw/acpi/acpi.h +++ b/include/hw/acpi/acpi.h @@ -150,6 +150,9 @@ struct ACPIREGS { Notifier wakeup; }; +/* Return whether ACPI subsystem is built in */ +bool acpi_builtin(void); + /* PM_TMR */ void acpi_pm_tmr_update(ACPIREGS *ar, bool enable); void acpi_pm_tmr_calc_overflow_time(ACPIREGS *ar); diff --git a/hw/acpi/acpi-stub.c b/hw/acpi/acpi-stub.c index e268ce9b1a9..790bf509e5d 100644 --- a/hw/acpi/acpi-stub.c +++ b/hw/acpi/acpi-stub.c @@ -25,3 +25,8 @@ void acpi_table_add(const QemuOpts *opts, Error **errp) { g_assert_not_reached(); } + +bool acpi_builtin(void) +{ + return false; +} diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 870391ed7c8..58f8964e130 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -78,6 +78,11 @@ static void acpi_register_config(void) opts_init(acpi_register_config); +bool acpi_builtin(void) +{ + return true; +} + static int acpi_checksum(const uint8_t *data, int len) { int sum, i;