From patchwork Tue Mar 11 19:51:19 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: 872492 Delivered-To: patch@linaro.org Received: by 2002:a5d:64ce:0:b0:38f:210b:807b with SMTP id f14csp1659948wri; Tue, 11 Mar 2025 12:55:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVnfAxpPri530Wrf5I/gpfN64l7cvcEBcLLgiWuTPuQWP/+wD+Y5+/goi9FgaV0mYUhBh03aA==@linaro.org X-Google-Smtp-Source: AGHT+IFcjFpD/d1vtLejjK5oUUEH8OVNPe5O1bMLTF7RY1XolUpWKCZVurhwVvQ3yaRZ765glRjE X-Received: by 2002:a05:620a:6087:b0:7c5:3ce4:7396 with SMTP id af79cd13be357-7c55e939580mr769570085a.48.1741722955505; Tue, 11 Mar 2025 12:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741722955; cv=none; d=google.com; s=arc-20240605; b=BIbkNwzCCZ5Lzd8tUkv+/EeYqnh+SDV3h8KjG5A7/LfJDxeUVPBfKq4kPP5EeQGM23 Ukbf6KhRf9ZP+zb0pCn7436ycjZo9Gzd/fZxgxGQhuxRWoFF5EFbqq++ZuvAdKMEQ/Fp RddyE/aoq9zLjD1G+iCv1S2ZWJjuIbNySSJAX/MyyaUZSLSBv2EU+ygoBrw/EQqfXsbV n+yNkwgnMw9aFPH6j95zfh6H5MYK+pcNrr7sxqgzv50wplCGK+nMx8mK+spwz9P1B0iD TzGYJrZgRkh8uqNloFTpU1xfhx4zm9nKasG/x8I2qfCB7gh73St8rnsbeNucMvFr20Zy BR+Q== 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=MBo2I2SdAyn3zmLJlBPf5O0YjymMe7D9mRmgdIXVIEw=; fh=TjOkNAx+/Iu+BCwVALffuoMZeAeHyET0fYnH3pI79xQ=; b=INSqepP9XQt3G5CDB4JddT+EYNPPHSCGZi/uiCPSpT/qxEg/A7BY1ru4JNjpLmaafs 0X82I//0+H52+VriFa0R+RMDWS3TwtwmnF+c5YmII+2u8CBOtEIlymE06xJUGezf/MXX MFeyf9Cfr2t8PqYZUyx94WqRAZz3aQIri27qnsUm5YJcqBMOksFGqMwk7a4pg91aPd97 JF+Kp0q8mcfFH/xPloWgKRkgL2K+B3UoywMtDcHX8PYiBqC/WUVilWQBvEDQihLi7Xsw yuG3D/LXvtAVknRk/0kYd8Lr82zSFNZYhLZ9BK1OjqBrLRHePVfifwMvDHgkR160A88v zpBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eN609VIJ; 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-47683c4f9f4si51225941cf.666.2025.03.11.12.55.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Mar 2025 12:55:55 -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=eN609VIJ; 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 1ts5eH-0007C8-5P; Tue, 11 Mar 2025 15:52:21 -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 1ts5eE-00077l-S7 for qemu-devel@nongnu.org; Tue, 11 Mar 2025 15:52:19 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ts5eD-0007WM-59 for qemu-devel@nongnu.org; Tue, 11 Mar 2025 15:52:18 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-43cf06eabdaso33996675e9.2 for ; Tue, 11 Mar 2025 12:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741722734; x=1742327534; 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=MBo2I2SdAyn3zmLJlBPf5O0YjymMe7D9mRmgdIXVIEw=; b=eN609VIJg8KVOIFWVzeW22ons5xPmCazNGUE60BdJ228ePxSfJTUsfXVxnVK0TWXw3 1VyiRreECcmG7SKqLytKil7Dga+gGwlRU861Prl66/TJEkYAZIthwuJNLN4c2ygpRswg uhQhu1qEV19GBqVjV2sRCQQSlbmuCG6Iq5dah9RCqknk9tXgnsxl9sM78Nmm1qW3mu9f c5eLHafOOcMPNSlLPIqPKTVh/yMt7WY87rAF8zewyCoX7eYO6EoiA5fvwixnWo4CQ9Dg VSAlhpsqoZqYwKHzliu+wrWbXfErpD0D0ml3X5FMIgRF30lACZWPHkqIdWKnUo5/rYYI yqXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741722734; x=1742327534; 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=MBo2I2SdAyn3zmLJlBPf5O0YjymMe7D9mRmgdIXVIEw=; b=QxTN/GR4in+JaEjMx/Rkf0v8KQI3G90GQqbmyLzlN7Nz7EXOVatzyEqe1XLoLsZP8K YecfFaIk1AzyfbfcERv6uuQd2sBjjD6QU31L8lhpojb2uT+yqNZCSReAPCx7VZZdTaGn NrG2cAsGq/wSDlE2nASN8sTv+W0hS6GiMATzw4D/Zw7cEU7z5L0uJw5ntCCZLUVMoWKp e0bq8m4LfDgk2HO3jQmjy5ylouhjCGOqyn46xUJo+QafIoCdFvkp8Vpb2R9YpIbfLTPT I8Omia61+RuBX4WRGxnF46m3Bm9STH4uoG1FxeDodHU2T2ReasHatp5yma/CdhKVuZ7B /9rA== X-Gm-Message-State: AOJu0Yw3B62pHJnU6EGoS+bUrbuTsW+FjADnwp2xMMhsKRv2Fw+TfjDt jwynhICmUbJEol+m0q7zyzSFQ+MxqvM3lU+xG0Q/l1yAK33fg1ct+r1pU0mHM5F2Y6fYLZP/rTg DD+4= X-Gm-Gg: ASbGncuF1s3vDG7MeX6epbPyXXepQBNOy5fLuXFd2foqlaoi8TsjmFPxHkR8HwaWOoC VEDciSa+t6THAh2P3lL/B/0qoGS9dpW+uwRTeqUiq43VvmMqJQwEP5yVJ+sq+pBkxFHgoH90546 vk4BNMfkAczQIupD6o/SDC0vjG+zIfYqyI+5jrq3fCK9J0y4QSH6/AF+Dvgi4/jzvmkEf9GD6Ud Uf6DDdgDEeGdusOJPFx6EfQxk1AYem7HpFKjZ1mYTwFsQM+tIf1Xj4pgbcX3C2Pz4yN7i1Wjk5A OmX6xArYOz/abgRwHDycqbKIChVaAKG5iK0gFxRKZtNbAryK4kJJfJPWzuy8x04ttRnX9RPuSb+ Y3R47ZhTYE/ckFZhgt8Y= X-Received: by 2002:a05:600c:4fc5:b0:43c:f969:13c0 with SMTP id 5b1f17b1804b1-43cf9691636mr102410835e9.29.1741722734023; Tue, 11 Mar 2025 12:52:14 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d06fd90fesm20981745e9.17.2025.03.11.12.52.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Mar 2025 12:52:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ani Sinha Subject: [PULL 10/14] hw/acpi: Introduce acpi_builtin() helper Date: Tue, 11 Mar 2025 20:51:19 +0100 Message-ID: <20250311195123.94212-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250311195123.94212-1-philmd@linaro.org> References: <20250311195123.94212-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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. Reviewed-by: Ani Sinha Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20250307223949.54040-3-philmd@linaro.org> --- 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;