[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/4] pc: move common parts of the DSDT to dsdt-commo
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 3/4] pc: move common parts of the DSDT to dsdt-common |
Date: |
Wed, 24 Dec 2014 14:12:42 +0100 |
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i386/acpi-build.c | 7 ++-----
hw/i386/acpi-dsdt-common.dsl | 14 +++++++++++---
hw/i386/acpi-dsdt-isa.dsl | 6 +++++-
hw/i386/acpi-dsdt.dsl | 10 ++--------
hw/i386/q35-acpi-dsdt.dsl | 9 ++-------
5 files changed, 22 insertions(+), 24 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 0712dd3..328a108 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -53,6 +53,7 @@
#include "hw/i386/q35-acpi-dsdt.hex"
#include "hw/i386/acpi-dsdt.hex"
+#include "hw/i386/acpi-dsdt-common.hex"
#include "qapi/qmp/qint.h"
#include "qom/qom-qobject.h"
@@ -116,7 +117,6 @@ typedef struct AcpiBuildPciBusHotplugState {
static void acpi_get_dsdt(AcpiMiscInfo *info)
{
- uint16_t *applesmc_sta;
Object *piix = piix4_pm_find();
Object *lpc = ich9_lpc_find();
assert(!!piix != !!lpc);
@@ -124,16 +124,14 @@ static void acpi_get_dsdt(AcpiMiscInfo *info)
if (piix) {
info->dsdt_code = AcpiDsdtAmlCode;
info->dsdt_size = sizeof AcpiDsdtAmlCode;
- applesmc_sta = piix_dsdt_applesmc_sta;
}
if (lpc) {
info->dsdt_code = Q35AcpiDsdtAmlCode;
info->dsdt_size = sizeof Q35AcpiDsdtAmlCode;
- applesmc_sta = q35_dsdt_applesmc_sta;
}
/* Patch in appropriate value for AppleSMC _STA */
- *(uint8_t *)(info->dsdt_code + *applesmc_sta) =
+ *(uint8_t *)(info->dsdt_code + dsdt_applesmc_sta[0]) =
applesmc_find() ? 0x0b : 0x00;
}
@@ -715,7 +713,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/acpi-dsdt-common.hex"
#include "hw/i386/ssdt-pcihp.hex"
#include "hw/i386/ssdt-tpm.hex"
diff --git a/hw/i386/acpi-dsdt-common.dsl b/hw/i386/acpi-dsdt-common.dsl
index f7849c0..1929f8f 100644
--- a/hw/i386/acpi-dsdt-common.dsl
+++ b/hw/i386/acpi-dsdt-common.dsl
@@ -19,6 +19,17 @@ ACPI_EXTRACT_ALL_CODE dsdt_common_aml
DefinitionBlock ("acpi-dsdt-common.aml", "SSDT", 0x01, "BXPC", "BXSSDTCOMM",
0x1)
{
+ External(\_SB.PCI0, DeviceObj)
+ External(\_SB.PCI0.ISA, DeviceObj)
+ External(\_SB.PCI0.PCI, DeviceObj)
+
+#include "hw/acpi/pc-hotplug.h"
+#include "acpi-dsdt-dbug.dsl"
+#include "acpi-dsdt-hpet.dsl"
+#include "acpi-dsdt-isa.dsl"
+#include "acpi-dsdt-mem-hotplug.dsl"
+
+
/****************************************************************
* PCI memory ranges
****************************************************************/
@@ -74,9 +85,6 @@ DefinitionBlock ("acpi-dsdt-common.aml", "SSDT", 0x01,
"BXPC", "BXSSDTCOMM", 0x1
})
}
- External(\_SB.PCI0, DeviceObj)
- External(\_SB.PCI0.ISA, DeviceObj)
-
Scope(\_SB.PCI0.ISA) {
Device(PEVT) {
Name(_HID, "QEMU0001")
diff --git a/hw/i386/acpi-dsdt-isa.dsl b/hw/i386/acpi-dsdt-isa.dsl
index deb37de..a8851b0 100644
--- a/hw/i386/acpi-dsdt-isa.dsl
+++ b/hw/i386/acpi-dsdt-isa.dsl
@@ -19,7 +19,7 @@ Scope(\_SB.PCI0.ISA) {
Device (SMC) {
Name(_HID, EisaId("APP0001"))
/* _STA will be patched to 0x0B if AppleSMC is present */
- ACPI_EXTRACT_NAME_BYTE_CONST DSDT_APPLESMC_STA
+ ACPI_EXTRACT_NAME_BYTE_CONST dsdt_applesmc_sta
Name(_STA, 0xF0)
Name(_CRS, ResourceTemplate () {
IO (Decode16, 0x0300, 0x0300, 0x01, 0x20)
@@ -58,6 +58,7 @@ Scope(\_SB.PCI0.ISA) {
})
}
+ External(FDEN)
Device(FDC0) {
Name(_HID, EisaId("PNP0700"))
Method(_STA, 0, NotSerialized) {
@@ -76,6 +77,7 @@ Scope(\_SB.PCI0.ISA) {
})
}
+ External(LPEN)
Device(LPT) {
Name(_HID, EisaId("PNP0400"))
Method(_STA, 0, NotSerialized) {
@@ -92,6 +94,7 @@ Scope(\_SB.PCI0.ISA) {
})
}
+ External(CAEN)
Device(COM1) {
Name(_HID, EisaId("PNP0501"))
Name(_UID, 0x01)
@@ -109,6 +112,7 @@ Scope(\_SB.PCI0.ISA) {
})
}
+ External(CBEN)
Device(COM2) {
Name(_HID, EisaId("PNP0501"))
Name(_UID, 0x02)
diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl
index e50efeb..71d1e3f 100644
--- a/hw/i386/acpi-dsdt.dsl
+++ b/hw/i386/acpi-dsdt.dsl
@@ -29,9 +29,6 @@ DefinitionBlock (
)
{
-#include "acpi-dsdt-dbug.dsl"
-
-
/****************************************************************
* PCI Bus definition
****************************************************************/
@@ -86,7 +83,6 @@ DefinitionBlock (
}
#include "acpi-dsdt-pci-crs.dsl"
-#include "acpi-dsdt-hpet.dsl"
/****************************************************************
@@ -130,9 +126,6 @@ DefinitionBlock (
}
}
-#define DSDT_APPLESMC_STA piix_dsdt_applesmc_sta
-#include "acpi-dsdt-isa.dsl"
-
/****************************************************************
* PCI hotplug
@@ -297,7 +290,6 @@ DefinitionBlock (
#include "hw/acpi/pc-hotplug.h"
#define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE
#include "acpi-dsdt-cpu-hotplug.dsl"
-#include "acpi-dsdt-mem-hotplug.dsl"
/****************************************************************
@@ -318,6 +310,8 @@ DefinitionBlock (
// CPU hotplug event
\_SB.PRSC()
}
+ External(\_SB.PCI0.MEMORY_HOTPLUG_DEVICE, DeviceObj)
+ External(\_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD,
MethodObj)
Method(_E03) {
// Memory hotplug event
\_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD()
diff --git a/hw/i386/q35-acpi-dsdt.dsl b/hw/i386/q35-acpi-dsdt.dsl
index e1cee5d..398aec1 100644
--- a/hw/i386/q35-acpi-dsdt.dsl
+++ b/hw/i386/q35-acpi-dsdt.dsl
@@ -34,7 +34,6 @@ DefinitionBlock (
)
{
-#include "acpi-dsdt-dbug.dsl"
Scope(\_SB) {
OperationRegion(PCST, SystemIO, 0xae00, 0x0c)
@@ -132,8 +131,6 @@ DefinitionBlock (
}
#include "acpi-dsdt-pci-crs.dsl"
-#include "acpi-dsdt-hpet.dsl"
-
/****************************************************************
* LPC ISA bridge
@@ -168,9 +165,6 @@ DefinitionBlock (
}
}
-#define DSDT_APPLESMC_STA q35_dsdt_applesmc_sta
-#include "acpi-dsdt-isa.dsl"
-
/****************************************************************
* PCI IRQs
@@ -405,7 +399,6 @@ DefinitionBlock (
#include "hw/acpi/pc-hotplug.h"
#define CPU_STATUS_BASE ICH9_CPU_HOTPLUG_IO_BASE
#include "acpi-dsdt-cpu-hotplug.dsl"
-#include "acpi-dsdt-mem-hotplug.dsl"
/****************************************************************
@@ -422,6 +415,8 @@ DefinitionBlock (
// CPU hotplug event
\_SB.PRSC()
}
+ External(\_SB.PCI0.MEMORY_HOTPLUG_DEVICE, DeviceObj)
+ External(\_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD,
MethodObj)
Method(_E03) {
// Memory hotplug event
\_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD()
--
1.8.3.1
- [Qemu-devel] [PATCH 0/4] acpi: move common parts of the SSDT to the DSDT (and preview of things to come), Paolo Bonzini, 2014/12/24
- [Qemu-devel] [PATCH 3/4] pc: move common parts of the DSDT to dsdt-common,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 1/4] pc: append ssdt-misc.dsl to the DSDT, Paolo Bonzini, 2014/12/24
- [Qemu-devel] [PATCH 4/4] pc: merge DSDT common parts into acpi-dsdt-common.dsl, Paolo Bonzini, 2014/12/24
- [Qemu-devel] [PATCH 5/4] pc: introduce new ACPI table sizing algorithm, Paolo Bonzini, 2014/12/24
- [Qemu-devel] [PATCH 2/4] pc: rename ssdt-misc to dsdt-common, Paolo Bonzini, 2014/12/24
- [Qemu-devel] [PATCH 6/4] pc: clean up pre-2.1 compatibility code, Paolo Bonzini, 2014/12/24
- [Qemu-devel] [PATCH 7/4] pc: go back to smaller ACPI tables, Paolo Bonzini, 2014/12/24
- Re: [Qemu-devel] [PATCH 0/4] acpi: move common parts of the SSDT to the DSDT (and preview of things to come), Paolo Bonzini, 2014/12/24
- Re: [Qemu-devel] [PATCH 0/4] acpi: move common parts of the SSDT to the DSDT (and preview of things to come), Michael S. Tsirkin, 2014/12/24