From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6oNt-0000cH-Ns for qemu-devel@nongnu.org; Wed, 09 Dec 2015 18:42:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6oNs-0004yJ-Ah for qemu-devel@nongnu.org; Wed, 09 Dec 2015 18:42:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6oNp-0004xh-FN for qemu-devel@nongnu.org; Wed, 09 Dec 2015 18:42:56 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 1E2118C1B1 for ; Wed, 9 Dec 2015 23:42:53 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.34.112.60]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB9Ng8Vm005315 for ; Wed, 9 Dec 2015 18:42:52 -0500 From: Igor Mammedov Date: Thu, 10 Dec 2015 00:41:40 +0100 Message-Id: <1449704528-289297-47-git-send-email-imammedo@redhat.com> In-Reply-To: <1449704528-289297-1-git-send-email-imammedo@redhat.com> References: <1449704528-289297-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH 46/74] pc: acpi: move DBUG() from DSDT to SSDT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Igor Mammedov --- hw/i386/acpi-build.c | 36 ++++++++++++++++++++++++++++++++++++ hw/i386/acpi-dsdt-dbug.dsl | 41 ----------------------------------------- hw/i386/acpi-dsdt.dsl | 2 -- hw/i386/q35-acpi-dsdt.dsl | 2 -- 4 files changed, 36 insertions(+), 45 deletions(-) delete mode 100644 hw/i386/acpi-dsdt-dbug.dsl diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 62f932e..4b7229d 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1171,6 +1171,41 @@ static void build_hpet_aml(Aml *table) aml_append(table, scope); } +static void build_dbg_aml(Aml *table) +{ + Aml *field; + Aml *method; + Aml *while_ctx; + Aml *scope = aml_scope("\\"); + Aml *a_buf = aml_local(0); + Aml *a_len = aml_local(1); + Aml *a_idx = aml_local(2); + + aml_append(scope, aml_operation_region("DBG", AML_SYSTEM_IO, + 0x0402, 0x01)); + field = aml_field("DBG", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE); + aml_append(field, aml_named_field("DBGB", 8)); + aml_append(scope, field); + + method = aml_method("DBUG", 1, AML_NOTSERIALIZED); + + aml_append(method, aml_to_hexstring(aml_arg(0), a_buf)); + aml_append(method, aml_to_buffer(a_buf, a_buf)); + aml_append(method, aml_subtract(aml_sizeof(a_buf), aml_int(1), a_len)); + aml_append(method, aml_store(aml_int(0), a_idx)); + + while_ctx = aml_while(aml_lless(a_idx, a_len)); + aml_append(while_ctx, + aml_store(aml_derefof(aml_index(a_buf, a_idx)), aml_name("DBGB"))); + aml_append(while_ctx, aml_increment(a_idx)); + aml_append(method, while_ctx); + + aml_append(method, aml_store(aml_int(0x0A), aml_name("DBGB"))); + aml_append(scope, method); + + aml_append(table, scope); +} + static void build_ssdt(GArray *table_data, GArray *linker, AcpiCpuInfo *cpu, AcpiPmInfo *pm, AcpiMiscInfo *misc, @@ -1191,6 +1226,7 @@ build_ssdt(GArray *table_data, GArray *linker, /* Reserve space for header */ acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader)); + build_dbg_aml(ssdt); build_hpet_aml(ssdt); build_cpu_hotplug_aml(ssdt); build_memory_hotplug_aml(ssdt, nr_mem, pm->mem_hp_io_base, diff --git a/hw/i386/acpi-dsdt-dbug.dsl b/hw/i386/acpi-dsdt-dbug.dsl deleted file mode 100644 index 86230f7..0000000 --- a/hw/i386/acpi-dsdt-dbug.dsl +++ /dev/null @@ -1,41 +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 . - */ - -/**************************************************************** - * Debugging - ****************************************************************/ - -Scope(\) { - /* Debug Output */ - OperationRegion(DBG, SystemIO, 0x0402, 0x01) - Field(DBG, ByteAcc, NoLock, Preserve) { - DBGB, 8, - } - - /* Debug method - use this method to send output to the QEMU - * BIOS debug port. This method handles strings, integers, - * and buffers. For example: DBUG("abc") DBUG(0x123) */ - Method(DBUG, 1) { - ToHexString(Arg0, Local0) - ToBuffer(Local0, Local0) - Subtract(SizeOf(Local0), 1, Local1) - Store(Zero, Local2) - While (LLess(Local2, Local1)) { - Store(DerefOf(Index(Local0, Local2)), DBGB) - Increment(Local2) - } - Store(0x0A, DBGB) - } -} diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl index aa7f549..55c2220 100644 --- a/hw/i386/acpi-dsdt.dsl +++ b/hw/i386/acpi-dsdt.dsl @@ -29,8 +29,6 @@ DefinitionBlock ( ) { -#include "acpi-dsdt-dbug.dsl" - Scope(\_SB) { Device(PCI0) { Name(_HID, EisaId("PNP0A03")) diff --git a/hw/i386/q35-acpi-dsdt.dsl b/hw/i386/q35-acpi-dsdt.dsl index e57adb8..bf3f974 100644 --- a/hw/i386/q35-acpi-dsdt.dsl +++ b/hw/i386/q35-acpi-dsdt.dsl @@ -35,8 +35,6 @@ DefinitionBlock ( ) { -#include "acpi-dsdt-dbug.dsl" - Scope(\_SB) { OperationRegion(PCST, SystemIO, 0xae00, 0x0c) OperationRegion(PCSB, SystemIO, 0xae0c, 0x01) -- 1.8.3.1