pc: acpi-build: generate _S[345] packages dynamically
[qemu/cris-port.git] / hw / i386 / ssdt-misc.dsl
blob26b924154463c0b9e2ee646f19c051f35e9e2751
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with this program; if not, see <http://www.gnu.org/licenses/>.
14  */
15 #include "hw/acpi/pc-hotplug.h"
17 ACPI_EXTRACT_ALL_CODE ssdp_misc_aml
19 DefinitionBlock ("ssdt-misc.aml", "SSDT", 0x01, "BXPC", "BXSSDTSUSP", 0x1)
22 /****************************************************************
23  * PCI memory ranges
24  ****************************************************************/
26     Scope(\) {
27        ACPI_EXTRACT_NAME_DWORD_CONST acpi_pci32_start
28        Name(P0S, 0x12345678)
29        ACPI_EXTRACT_NAME_DWORD_CONST acpi_pci32_end
30        Name(P0E, 0x12345678)
31        ACPI_EXTRACT_NAME_BYTE_CONST acpi_pci64_valid
32        Name(P1V, 0x12)
33        ACPI_EXTRACT_NAME_BUFFER8 acpi_pci64_start
34        Name(P1S, Buffer() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 })
35        ACPI_EXTRACT_NAME_BUFFER8 acpi_pci64_end
36        Name(P1E, Buffer() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 })
37        ACPI_EXTRACT_NAME_BUFFER8 acpi_pci64_length
38        Name(P1L, Buffer() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 })
39        ACPI_EXTRACT_NAME_DWORD_CONST ssdt_mctrl_nr_slots
40        Name(MEMORY_SLOTS_NUMBER, 0x12345678)
41     }
44     External(\_SB.PCI0, DeviceObj)
45     External(\_SB.PCI0.ISA, DeviceObj)
47     Scope(\_SB.PCI0.ISA) {
48         Device(PEVT) {
49             Name(_HID, "QEMU0001")
50             /* PEST will be patched to be Zero if no such device */
51             ACPI_EXTRACT_NAME_WORD_CONST ssdt_isa_pest
52             Name(PEST, 0xFFFF)
53             OperationRegion(PEOR, SystemIO, PEST, 0x01)
54             Field(PEOR, ByteAcc, NoLock, Preserve) {
55                 PEPT,   8,
56             }
58             Method(_STA, 0, NotSerialized) {
59                 Store(PEST, Local0)
60                 If (LEqual(Local0, Zero)) {
61                     Return (0x00)
62                 } Else {
63                     Return (0x0F)
64                 }
65             }
67             Method(RDPT, 0, NotSerialized) {
68                 Store(PEPT, Local0)
69                 Return (Local0)
70             }
72             Method(WRPT, 1, NotSerialized) {
73                 Store(Arg0, PEPT)
74             }
76             Name(_CRS, ResourceTemplate() {
77                 IO(Decode16, 0x00, 0x00, 0x01, 0x01, IO)
78             })
80             CreateWordField(_CRS, IO._MIN, IOMN)
81             CreateWordField(_CRS, IO._MAX, IOMX)
83             Method(_INI, 0, NotSerialized) {
84                 Store(PEST, IOMN)
85                 Store(PEST, IOMX)
86             }
87         }
88     }