qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: drjones@redhat.com, mst@redhat.com, zhaoshenglong@huawei.com,
	marcel.a@redhat.com
Subject: [Qemu-devel] [PATCH v4 39/42] pc: acpi-build: drop remaining ssdt_misc template
Date: Wed, 18 Feb 2015 19:14:52 +0000	[thread overview]
Message-ID: <1424286895-21611-40-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1424286895-21611-1-git-send-email-imammedo@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 <imammedo@redhat.com>
---
 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 ee254df..027a906 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 <http://www.gnu.org/licenses/>.
- */
-#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

  parent reply	other threads:[~2015-02-18 19:16 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 19:14 [Qemu-devel] [PATCH v4 00/42] ACPI refactoring: replace template patching with C AML API Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 01/42] acpi: introduce AML composer aml_append() Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 02/42] acpi: add aml_scope() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 03/42] pc: acpi-build: use aml_scope() for \_SB scope Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 04/42] acpi: add aml_device() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 05/42] acpi: add aml_method() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 06/42] acpi: add aml_if() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 07/42] acpi: add aml_name() & aml_name_decl() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 08/42] acpi: add aml_int() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 09/42] acpi: add aml_return() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 10/42] acpi: add aml_arg() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 11/42] acpi: add aml_store() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 12/42] acpi: add aml_and() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 13/42] acpi: add aml_notify() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 14/42] acpi: add aml_call1(), aml_call2(), aml_call3(), aml_call4() helpers Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 15/42] acpi: add aml_package() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 16/42] pc: acpi-build: generate _S[345] packages dynamically Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 17/42] acpi: add aml_buffer() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 18/42] acpi: add aml_resource_template() helper Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 19/42] acpi: add aml_io() helper Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 20/42] acpi: include PkgLength size only when requested Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 21/42] acpi: add aml_operation_region() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 22/42] acpi: add aml_field() & aml_named_field() terms Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 23/42] acpi: add aml_local() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 24/42] acpi: add aml_string() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 25/42] pc: acpi-build: generate pvpanic device description dynamically Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 26/42] acpi: add aml_varpackage() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 27/42] acpi: add aml_equal() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 28/42] acpi: add aml_processor() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 29/42] acpi: add aml_eisaid() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 30/42] pc: acpi-build: drop template patching and CPU hotplug objects dynamically Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 31/42] pc: acpi-build: create CPU hotplug IO region dynamically Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 32/42] acpi: add aml_reserved_field() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 33/42] pc: acpi-build: drop template patching and memory hotplug objects dynamically Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 34/42] pc: acpi-build: create memory hotplug IO region dynamically Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 35/42] acpi: add aml_word_bus_number(), aml_word_io(), aml_dword_memory(), aml_qword_memory() terms Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 36/42] pc: pcihp: expose MMIO base and len as properties Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 37/42] pc: acpi-build: reserve PCIHP MMIO resources Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 38/42] pc: acpi-build: create PCI0._CRS dynamically Igor Mammedov
2015-02-18 20:25   ` Michael S. Tsirkin
2015-02-18 19:14 ` Igor Mammedov [this message]
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 40/42] acpi: add acpi_irq_no_flags() term Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 41/42] pc: export applesmc IO port/len Igor Mammedov
2015-02-18 19:14 ` [Qemu-devel] [PATCH v4 42/42] pc: acpi-build: drop template patching and create Device(SMC) dynamically Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424286895-21611-40-git-send-email-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=drjones@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhaoshenglong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).