qemu/hw/i386/ssdt-misc.dsl
Igor Mammedov ebc3028f7a pc: acpi-build: generate _S[345] packages dynamically
Replaces template patching with packages composed
using AML API.

Note on behavior change:
If S3 or S4 is disabled, respective packages won't
be created and put into SSDT. Which saves us some
space in SSDT and doesn't confuse guest OS with
mangled package names as it was done originally.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-02-26 13:04:13 +01:00

90 lines
2.9 KiB
Plaintext

/*
* 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)
{
/****************************************************************
* PCI memory ranges
****************************************************************/
Scope(\) {
ACPI_EXTRACT_NAME_DWORD_CONST acpi_pci32_start
Name(P0S, 0x12345678)
ACPI_EXTRACT_NAME_DWORD_CONST acpi_pci32_end
Name(P0E, 0x12345678)
ACPI_EXTRACT_NAME_BYTE_CONST acpi_pci64_valid
Name(P1V, 0x12)
ACPI_EXTRACT_NAME_BUFFER8 acpi_pci64_start
Name(P1S, Buffer() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 })
ACPI_EXTRACT_NAME_BUFFER8 acpi_pci64_end
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
Name(MEMORY_SLOTS_NUMBER, 0x12345678)
}
External(\_SB.PCI0, DeviceObj)
External(\_SB.PCI0.ISA, DeviceObj)
Scope(\_SB.PCI0.ISA) {
Device(PEVT) {
Name(_HID, "QEMU0001")
/* PEST will be patched to be Zero if no such device */
ACPI_EXTRACT_NAME_WORD_CONST ssdt_isa_pest
Name(PEST, 0xFFFF)
OperationRegion(PEOR, SystemIO, PEST, 0x01)
Field(PEOR, ByteAcc, NoLock, Preserve) {
PEPT, 8,
}
Method(_STA, 0, NotSerialized) {
Store(PEST, Local0)
If (LEqual(Local0, Zero)) {
Return (0x00)
} Else {
Return (0x0F)
}
}
Method(RDPT, 0, NotSerialized) {
Store(PEPT, Local0)
Return (Local0)
}
Method(WRPT, 1, NotSerialized) {
Store(Arg0, PEPT)
}
Name(_CRS, ResourceTemplate() {
IO(Decode16, 0x00, 0x00, 0x01, 0x01, IO)
})
CreateWordField(_CRS, IO._MIN, IOMN)
CreateWordField(_CRS, IO._MAX, IOMX)
Method(_INI, 0, NotSerialized) {
Store(PEST, IOMN)
Store(PEST, IOMX)
}
}
}
}