diff mbox

[v3,2/3] pc: rename ssdt-misc to dsdt-common

Message ID 1421686587-8354-3-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Jan. 19, 2015, 4:56 p.m. UTC
All the changes to generated files are in the header, so there is
no need to rebuild test data.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 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 mbox

Patch

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)
     }