From patchwork Mon Jan 19 16:56:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 430610 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8F7E214010F for ; Tue, 20 Jan 2015 03:57:18 +1100 (AEDT) Received: from localhost ([::1]:38507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDFdc-0000gP-Ow for incoming@patchwork.ozlabs.org; Mon, 19 Jan 2015 11:57:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDFd2-00087m-Ao for qemu-devel@nongnu.org; Mon, 19 Jan 2015 11:56:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDFd0-0001r8-LY for qemu-devel@nongnu.org; Mon, 19 Jan 2015 11:56:40 -0500 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:38140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDFd0-0001qq-C1 for qemu-devel@nongnu.org; Mon, 19 Jan 2015 11:56:38 -0500 Received: by mail-we0-f169.google.com with SMTP id p10so9031228wes.0 for ; Mon, 19 Jan 2015 08:56:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=sKSn1bINJo27W22fyxX/TM5cs/RDV4lihehB7Yrmer4=; b=ZKHNF6kQBuK4QRL1KDJGYpi1KhTzjToXEheqL1Cw1Ja6H27lkWndZAia0z0LVK4Y83 z+I87ljD5AkK5gAog2khKWhTt3dB0fHklHiv69j9ByvSayQZV4d0oSBGXF2VWUqcBd15 qr1ow2dWZyUGXuvA4UFk50od4N5yGJsyk7/BrVm0tkmHCr8YVRDhVMT0ORC9p2z0Pvvd xahr/YM9wP3MdYc9gIevzM/YOX7hgMn5WYmqr+li6ceU/xFQIceWb58GmsIY9M1rpbiO a8brm1+tmBbxkX0d9EYpS/8Rz85QIDlRgnX4F/S2AknEKanF15Fta0pWHUVFBIVdfUpQ X21g== X-Received: by 10.180.187.67 with SMTP id fq3mr36326369wic.37.1421686597701; Mon, 19 Jan 2015 08:56:37 -0800 (PST) Received: from playground.station (net-2-34-66-95.cust.vodafonedsl.it. [2.34.66.95]) by mx.google.com with ESMTPSA id jp3sm14881732wid.9.2015.01.19.08.56.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jan 2015 08:56:36 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 19 Jan 2015 17:56:26 +0100 Message-Id: <1421686587-8354-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1421686587-8354-1-git-send-email-pbonzini@redhat.com> References: <1421686587-8354-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::229 Cc: imammedo@redhat.com, mst@redhat.com Subject: [Qemu-devel] [PATCH v3 2/3] pc: rename ssdt-misc to dsdt-common X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org All the changes to generated files are in the header, so there is no need to rebuild test data. Signed-off-by: Paolo Bonzini --- hw/i386/Makefile.objs | 2 +- hw/i386/acpi-build.c | 33 +++++++++++----------- hw/i386/{ssdt-misc.dsl => acpi-dsdt-common.dsl} | 8 +++--- ...ex.generated => acpi-dsdt-common.hex.generated} | 30 ++++++++++---------- hw/i386/acpi-dsdt.dsl | 2 +- 5 files changed, 38 insertions(+), 37 deletions(-) rename hw/i386/{ssdt-misc.dsl => acpi-dsdt-common.dsl} (94%) rename hw/i386/{ssdt-misc.hex.generated => acpi-dsdt-common.hex.generated} (93%) diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs index 9d419ad..fe6b846 100644 --- a/hw/i386/Makefile.objs +++ b/hw/i386/Makefile.objs @@ -9,7 +9,7 @@ obj-y += kvmvapic.o obj-y += acpi-build.o obj-y += bios-linker-loader.o hw/i386/acpi-build.o: hw/i386/acpi-build.c hw/i386/acpi-dsdt.hex \ - hw/i386/ssdt-proc.hex hw/i386/ssdt-pcihp.hex hw/i386/ssdt-misc.hex \ + hw/i386/ssdt-proc.hex hw/i386/ssdt-pcihp.hex hw/i386/acpi-dsdt-common.hex \ hw/i386/acpi-dsdt.hex hw/i386/q35-acpi-dsdt.hex \ hw/i386/q35-acpi-dsdt.hex hw/i386/ssdt-mem.hex \ hw/i386/ssdt-tpm.hex diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index c8eac00..4ed30d8 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -718,7 +718,7 @@ 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/acpi-dsdt-common.hex" #include "hw/i386/ssdt-pcihp.hex" #include "hw/i386/ssdt-tpm.hex" @@ -1064,38 +1064,39 @@ static void patch_pci_windows(PcPciInfo *pci, uint8_t *start, unsigned size) } } -#define SSDT_MISC_SIZE (sizeof(ssdt_misc_aml) - sizeof(AcpiTableHeader)) +#define DSDT_COMMON_SIZE (sizeof(dsdt_common_aml) - sizeof(AcpiTableHeader)) static void -push_ssdt_misc(GArray *table_data, AcpiPmInfo *pm, AcpiMiscInfo *misc, +push_dsdt_common(GArray *table_data, AcpiPmInfo *pm, AcpiMiscInfo *misc, PcPciInfo *pci) { MachineState *machine = MACHINE(qdev_get_machine()); uint32_t nr_mem = machine->ram_slots; - uint8_t *ssdt_ptr; + uint8_t *dsdt_ptr; /* Copy header and patch values in the S3_ / S4_ / S5_ packages */ - ssdt_ptr = g_memdup(ssdp_misc_aml, sizeof(ssdp_misc_aml)); + dsdt_ptr = g_memdup(dsdt_common_aml, sizeof(dsdt_common_aml)); if (pm->s3_disabled) { - ssdt_ptr[acpi_s3_name[0]] = 'X'; + dsdt_ptr[acpi_s3_name[0]] = 'X'; } if (pm->s4_disabled) { - ssdt_ptr[acpi_s4_name[0]] = 'X'; + dsdt_ptr[acpi_s4_name[0]] = 'X'; } else { - ssdt_ptr[acpi_s4_pkg[0] + 1] = ssdt_ptr[acpi_s4_pkg[0] + 3] = + dsdt_ptr[acpi_s4_pkg[0] + 1] = dsdt_ptr[acpi_s4_pkg[0] + 3] = pm->s4_val; } - patch_pci_windows(pci, ssdt_ptr, sizeof(ssdp_misc_aml)); + patch_pci_windows(pci, dsdt_ptr, sizeof(dsdt_common_aml)); - ACPI_BUILD_SET_LE(ssdt_ptr, sizeof(ssdp_misc_aml), - ssdt_isa_pest[0], 16, misc->pvpanic_port); + ACPI_BUILD_SET_LE(dsdt_ptr, sizeof(dsdt_common_aml), + dsdt_isa_pest[0], 16, misc->pvpanic_port); - ACPI_BUILD_SET_LE(ssdt_ptr, sizeof(ssdp_misc_aml), - ssdt_mctrl_nr_slots[0], 32, nr_mem); + ACPI_BUILD_SET_LE(dsdt_ptr, sizeof(dsdt_common_aml), + dsdt_mctrl_nr_slots[0], 32, nr_mem); - g_array_append_vals(table_data, ssdt_ptr + sizeof(AcpiTableHeader), SSDT_MISC_SIZE); - g_free(ssdt_ptr); + g_array_append_vals(table_data, dsdt_ptr + sizeof(AcpiTableHeader), + DSDT_COMMON_SIZE); + g_free(dsdt_ptr); } static void @@ -1450,7 +1451,7 @@ build_dsdt(GArray *table_data, GArray *linker, AcpiPmInfo *pm, dsdt = acpi_data_push(table_data, misc->dsdt_size); memcpy(dsdt, misc->dsdt_code, misc->dsdt_size); - push_ssdt_misc(table_data, pm, misc, pci); + push_dsdt_common(table_data, pm, misc, pci); memset(dsdt, 0, sizeof *dsdt); build_header(linker, table_data, (void *)(table_data->data + dsdt_start), diff --git a/hw/i386/ssdt-misc.dsl b/hw/i386/acpi-dsdt-common.dsl similarity index 94% rename from hw/i386/ssdt-misc.dsl rename to hw/i386/acpi-dsdt-common.dsl index 1e3baae..f7849c0 100644 --- a/hw/i386/ssdt-misc.dsl +++ b/hw/i386/acpi-dsdt-common.dsl @@ -14,9 +14,9 @@ */ #include "hw/acpi/pc-hotplug.h" -ACPI_EXTRACT_ALL_CODE ssdp_misc_aml +ACPI_EXTRACT_ALL_CODE dsdt_common_aml -DefinitionBlock ("ssdt-misc.aml", "SSDT", 0x01, "BXPC", "BXSSDTSUSP", 0x1) +DefinitionBlock ("acpi-dsdt-common.aml", "SSDT", 0x01, "BXPC", "BXDSDTCOMM", 0x1) { /**************************************************************** @@ -36,7 +36,7 @@ DefinitionBlock ("ssdt-misc.aml", "SSDT", 0x01, "BXPC", "BXSSDTSUSP", 0x1) Name(P1E, Buffer() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }) ACPI_EXTRACT_NAME_BUFFER8 acpi_pci64_length Name(P1L, Buffer() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }) - ACPI_EXTRACT_NAME_DWORD_CONST ssdt_mctrl_nr_slots + ACPI_EXTRACT_NAME_DWORD_CONST dsdt_mctrl_nr_slots Name(MEMORY_SLOTS_NUMBER, 0x12345678) } @@ -81,7 +81,7 @@ DefinitionBlock ("ssdt-misc.aml", "SSDT", 0x01, "BXPC", "BXSSDTSUSP", 0x1) Device(PEVT) { Name(_HID, "QEMU0001") /* PEST will be patched to be Zero if no such device */ - ACPI_EXTRACT_NAME_WORD_CONST ssdt_isa_pest + ACPI_EXTRACT_NAME_WORD_CONST dsdt_isa_pest Name(PEST, 0xFFFF) OperationRegion(PEOR, SystemIO, PEST, 0x01) Field(PEOR, ByteAcc, NoLock, Preserve) { diff --git a/hw/i386/ssdt-misc.hex.generated b/hw/i386/acpi-dsdt-common.hex.generated similarity index 93% rename from hw/i386/ssdt-misc.hex.generated rename to hw/i386/acpi-dsdt-common.hex.generated index cbcf61d..5127845 100644 --- a/hw/i386/ssdt-misc.hex.generated +++ b/hw/i386/acpi-dsdt-common.hex.generated @@ -4,8 +4,8 @@ static unsigned char acpi_pci64_length[] = { static unsigned char acpi_s4_pkg[] = { 0x99 }; -static unsigned char ssdt_mctrl_nr_slots[] = { -0x7d +static unsigned char acpi_s4_name[] = { +0x92 }; static unsigned char acpi_s3_name[] = { 0x86 @@ -16,7 +16,10 @@ static unsigned char acpi_pci32_start[] = { static unsigned char acpi_pci64_valid[] = { 0x43 }; -static unsigned char ssdp_misc_aml[] = { +static unsigned char dsdt_isa_pest[] = { +0xda +}; +static unsigned char dsdt_common_aml[] = { 0x53, 0x53, 0x44, @@ -26,7 +29,7 @@ static unsigned char ssdp_misc_aml[] = { 0x0, 0x0, 0x1, -0x3, +0x2f, 0x42, 0x58, 0x50, @@ -39,8 +42,8 @@ static unsigned char ssdp_misc_aml[] = { 0x53, 0x44, 0x54, -0x53, -0x55, +0x43, +0x4f, 0x1, 0x0, 0x0, @@ -49,9 +52,9 @@ static unsigned char ssdp_misc_aml[] = { 0x4e, 0x54, 0x4c, -0x28, -0x8, -0x14, +0x13, +0x9, +0x12, 0x20, 0x10, 0x4c, @@ -382,12 +385,6 @@ static unsigned char ssdp_misc_aml[] = { 0x4d, 0x58 }; -static unsigned char ssdt_isa_pest[] = { -0xda -}; -static unsigned char acpi_s4_name[] = { -0x92 -}; static unsigned char acpi_pci64_start[] = { 0x4d }; @@ -397,3 +394,6 @@ static unsigned char acpi_pci64_end[] = { static unsigned char acpi_pci32_end[] = { 0x39 }; +static unsigned char dsdt_mctrl_nr_slots[] = { +0x7d +}; diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl index a611e07..e50efeb 100644 --- a/hw/i386/acpi-dsdt.dsl +++ b/hw/i386/acpi-dsdt.dsl @@ -170,7 +170,7 @@ DefinitionBlock ( Return (0x0) } - /* Hotplug notification method supplied by SSDT */ + /* Hotplug notification method in acpi-dsdt-common.dsl */ External(\_SB.PCI0.PCNT, MethodObj) }