From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOsDg-0004jq-Mm for qemu-devel@nongnu.org; Fri, 20 Feb 2015 13:22:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOsDf-0000iB-7E for qemu-devel@nongnu.org; Fri, 20 Feb 2015 13:22:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOsDf-0000i3-0b for qemu-devel@nongnu.org; Fri, 20 Feb 2015 13:22:31 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1KIMTK6008692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 20 Feb 2015 13:22:30 -0500 From: Igor Mammedov Date: Fri, 20 Feb 2015 18:22:09 +0000 Message-Id: <1424456540-27854-6-git-send-email-imammedo@redhat.com> In-Reply-To: <1424456540-27854-1-git-send-email-imammedo@redhat.com> References: <1424456540-27854-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v5 05/16] pc: acpi-build: drop remaining ssdt_misc template List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: marcel@redhat.com, mst@redhat.com It drops empty ssdt_misc templete. It also hides from user almost all pointer arithmetic when building SSDT which makes resulting code a bit cleaner and concentrating only on composing ASL construct /i.e. a task build_ssdt() should be doing/. Also it makes one binary blob less stored in QEMU source tree by removing need to keep and update hw/i386/ssdt-misc.hex.generated file here in total saving us ~430LOC. Signed-off-by: Igor Mammedov --- hw/i386/Makefile.objs | 1 - hw/i386/acpi-build.c | 7 ++----- hw/i386/ssdt-misc.dsl | 21 --------------------- 3 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 hw/i386/ssdt-misc.dsl diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs index 45b90a8..9b00568 100644 --- a/hw/i386/Makefile.objs +++ b/hw/i386/Makefile.objs @@ -10,7 +10,6 @@ obj-y += acpi-build.o hw/i386/acpi-build.o: hw/i386/acpi-build.c \ hw/i386/acpi-dsdt.hex hw/i386/q35-acpi-dsdt.hex \ hw/i386/ssdt-pcihp.hex \ - hw/i386/ssdt-misc.hex \ hw/i386/ssdt-tpm.hex iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \ diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 2700154..01d988c 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -526,7 +526,6 @@ static inline char acpi_get_hex(uint32_t val) #define ACPI_SSDT_SIGNATURE 0x54445353 /* SSDT */ #define ACPI_SSDT_HEADER_LENGTH 36 -#include "hw/i386/ssdt-misc.hex" #include "hw/i386/ssdt-pcihp.hex" #include "hw/i386/ssdt-tpm.hex" @@ -850,7 +849,6 @@ build_ssdt(GArray *table_data, GArray *linker, MachineState *machine = MACHINE(qdev_get_machine()); uint32_t nr_mem = machine->ram_slots; unsigned acpi_cpus = guest_info->apic_id_limit; - uint8_t *ssdt_ptr; Aml *ssdt, *sb_scope, *scope, *pkg, *dev, *method, *crs, *field, *ifctx; int i; @@ -860,9 +858,8 @@ build_ssdt(GArray *table_data, GArray *linker, QEMU_BUILD_BUG_ON(ACPI_CPU_HOTPLUG_ID_LIMIT > 256); g_assert(acpi_cpus <= ACPI_CPU_HOTPLUG_ID_LIMIT); - /* Copy header and patch values in the S3_ / S4_ / S5_ packages */ - ssdt_ptr = acpi_data_push(ssdt->buf, sizeof(ssdp_misc_aml)); - memcpy(ssdt_ptr, ssdp_misc_aml, sizeof(ssdp_misc_aml)); + /* Reserve space for header */ + acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader)); scope = aml_scope("\\_SB.PCI0"); /* build PCI0._CRS */ diff --git a/hw/i386/ssdt-misc.dsl b/hw/i386/ssdt-misc.dsl deleted file mode 100644 index 8d61f21..0000000 --- a/hw/i386/ssdt-misc.dsl +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that 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 for more details. - - * You should have received a copy of the GNU General Public License along - * with this program; if not, see . - */ -#include "hw/acpi/pc-hotplug.h" - -ACPI_EXTRACT_ALL_CODE ssdp_misc_aml - -DefinitionBlock ("ssdt-misc.aml", "SSDT", 0x01, "BXPC", "BXSSDTSUSP", 0x1) -{ -} -- 1.8.3.1