Start migrating migration code into a migration directory
[qemu.git] / hw / i386 / ssdt-misc.dsl
blob1e3baaed3d7f2d14f9818d68fd2a3e458db19757
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 /****************************************************************
45  * Suspend
46  ****************************************************************/
48     Scope(\) {
49     /*
50      * S3 (suspend-to-ram), S4 (suspend-to-disk) and S5 (power-off) type codes:
51      * must match piix4 emulation.
52      */
54         ACPI_EXTRACT_NAME_STRING acpi_s3_name
55         Name(_S3, Package(0x04) {
56             One,  /* PM1a_CNT.SLP_TYP */
57             One,  /* PM1b_CNT.SLP_TYP */
58             Zero,  /* reserved */
59             Zero   /* reserved */
60         })
61         ACPI_EXTRACT_NAME_STRING acpi_s4_name
62         ACPI_EXTRACT_PKG_START acpi_s4_pkg
63         Name(_S4, Package(0x04) {
64             0x2,  /* PM1a_CNT.SLP_TYP */
65             0x2,  /* PM1b_CNT.SLP_TYP */
66             Zero,  /* reserved */
67             Zero   /* reserved */
68         })
69         Name(_S5, Package(0x04) {
70             Zero,  /* PM1a_CNT.SLP_TYP */
71             Zero,  /* PM1b_CNT.SLP_TYP */
72             Zero,  /* reserved */
73             Zero   /* reserved */
74         })
75     }
77     External(\_SB.PCI0, DeviceObj)
78     External(\_SB.PCI0.ISA, DeviceObj)
80     Scope(\_SB.PCI0.ISA) {
81         Device(PEVT) {
82             Name(_HID, "QEMU0001")
83             /* PEST will be patched to be Zero if no such device */
84             ACPI_EXTRACT_NAME_WORD_CONST ssdt_isa_pest
85             Name(PEST, 0xFFFF)
86             OperationRegion(PEOR, SystemIO, PEST, 0x01)
87             Field(PEOR, ByteAcc, NoLock, Preserve) {
88                 PEPT,   8,
89             }
91             Method(_STA, 0, NotSerialized) {
92                 Store(PEST, Local0)
93                 If (LEqual(Local0, Zero)) {
94                     Return (0x00)
95                 } Else {
96                     Return (0x0F)
97                 }
98             }
100             Method(RDPT, 0, NotSerialized) {
101                 Store(PEPT, Local0)
102                 Return (Local0)
103             }
105             Method(WRPT, 1, NotSerialized) {
106                 Store(Arg0, PEPT)
107             }
109             Name(_CRS, ResourceTemplate() {
110                 IO(Decode16, 0x00, 0x00, 0x01, 0x01, IO)
111             })
113             CreateWordField(_CRS, IO._MIN, IOMN)
114             CreateWordField(_CRS, IO._MAX, IOMX)
116             Method(_INI, 0, NotSerialized) {
117                 Store(PEST, IOMN)
118                 Store(PEST, IOMX)
119             }
120         }
121     }