From nobody Thu Nov 6 14:34:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541383357494144.47607221029227; Sun, 4 Nov 2018 18:02:37 -0800 (PST) Received: from localhost ([::1]:60984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJUDr-000358-EI for importer@patchew.org; Sun, 04 Nov 2018 21:02:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJTvA-0008PB-Kw for qemu-devel@nongnu.org; Sun, 04 Nov 2018 20:43:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJTv9-0003LM-EC for qemu-devel@nongnu.org; Sun, 04 Nov 2018 20:43:16 -0500 Received: from mga05.intel.com ([192.55.52.43]:26671) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gJTv9-0003Ia-2y; Sun, 04 Nov 2018 20:43:15 -0500 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Nov 2018 17:43:14 -0800 Received: from emurphy1-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.252.26.250]) by fmsmga005.fm.intel.com with ESMTP; 04 Nov 2018 17:43:10 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,466,1534834800"; d="scan'208";a="277074476" From: Samuel Ortiz To: qemu-devel@nongnu.org Date: Mon, 5 Nov 2018 02:40:41 +0100 Message-Id: <20181105014047.26447-19-sameo@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181105014047.26447-1-sameo@linux.intel.com> References: <20181105014047.26447-1-sameo@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.43 Subject: [Qemu-devel] [PATCH v5 18/24] hw: i386: Export the MADT build method X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefano Stabellini , Eduardo Habkost , "Michael S. Tsirkin" , Shannon Zhao , Igor Mammedov , qemu-arm@nongnu.org, Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" It is going to be used by the PC machine type as the MADT table builder method and thus needs to be exported outside of acpi-build.c Also, now that the generic build_madt() API is exported, we have to rename the ARM static one in order to avoid build time conflicts. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Samuel Ortiz --- include/hw/i386/acpi.h | 28 ++++++++++++++++++++++++++++ hw/arm/virt-acpi-build.c | 4 ++-- hw/i386/acpi-build.c | 4 ++-- 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 include/hw/i386/acpi.h diff --git a/include/hw/i386/acpi.h b/include/hw/i386/acpi.h new file mode 100644 index 0000000000..b7a887111d --- /dev/null +++ b/include/hw/i386/acpi.h @@ -0,0 +1,28 @@ +/* + * + * Copyright (c) 2018 Intel Corportation + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2 or later, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License f= or + * more details. + * + * You should have received a copy of the GNU General Public License along= with + * this program. If not, see . + */ + +#ifndef HW_I386_ACPI_H +#define HW_I386_ACPI_H + +#include "hw/acpi/acpi.h" +#include "hw/acpi/bios-linker-loader.h" + +/* ACPI MADT (Multiple APIC Description Table) build method */ +void build_madt(GArray *table_data, BIOSLinker *linker, + MachineState *ms, AcpiConfiguration *conf); + +#endif diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index b5e165543a..b0354c5f03 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -564,7 +564,7 @@ build_gtdt(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) =20 /* MADT */ static void -build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) +virt_build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *= vms) { VirtMachineClass *vmc =3D VIRT_MACHINE_GET_CLASS(vms); int madt_start =3D table_data->len; @@ -745,7 +745,7 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTa= bles *tables) build_fadt_rev5(tables_blob, tables->linker, vms, dsdt); =20 acpi_add_table(table_offsets, tables_blob); - build_madt(tables_blob, tables->linker, vms); + virt_build_madt(tables_blob, tables->linker, vms); =20 acpi_add_table(table_offsets, tables_blob); build_gtdt(tables_blob, tables->linker, vms); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index bef5b23168..4b1d8fbe3f 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -35,7 +35,6 @@ #include "hw/acpi/acpi.h" #include "hw/acpi/cpu.h" #include "hw/nvram/fw_cfg.h" -#include "hw/acpi/bios-linker-loader.h" #include "hw/loader.h" #include "hw/isa/isa.h" #include "hw/block/fdc.h" @@ -60,6 +59,7 @@ #include "qom/qom-qobject.h" #include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" +#include "hw/i386/acpi.h" =20 #include "hw/acpi/ipmi.h" =20 @@ -279,7 +279,7 @@ void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid, } } =20 -static void +void build_madt(GArray *table_data, BIOSLinker *linker, MachineState *ms, AcpiConfiguration *acpi_conf) { --=20 2.19.1