grml...
[seabios.git] / src / ssdt-pcihp.dsl
1 ACPI_EXTRACT_ALL_CODE ssdp_pcihp_aml
2
3 DefinitionBlock ("ssdt-pcihp.aml", "SSDT", 0x01, "BXPC", "BXSSDTPCIHP", 0x1)
4 {
5
6 /****************************************************************
7  * PCI hotplug
8  ****************************************************************/
9
10     /* Objects supplied by DSDT */
11     External (\_SB.PCI0, DeviceObj)
12     External (\_SB.PCI0.PCEJ, MethodObj)
13
14     Scope(\_SB.PCI0) {
15         /* Bulk generated PCI hotplug devices */
16         // Method _EJ0 can be patched by BIOS to EJ0_
17         // at runtime, if the slot is detected to not support hotplug.
18         // Extract the offset of the address dword and the
19         // _EJ0 name to allow this patching.
20 #define hotplug_slot(slot)                              \
21         Device (S##slot) {                              \
22            ACPI_EXTRACT_NAME_DWORD_CONST aml_adr_dword  \
23            Name (_ADR, 0x##slot##0000)                  \
24            ACPI_EXTRACT_METHOD_STRING aml_ej0_name      \
25            Method (_EJ0, 1) { Return(PCEJ(0x##slot)) }  \
26            Name (_SUN, 0x##slot)                        \
27         }
28
29         hotplug_slot(01)
30         hotplug_slot(02)
31         hotplug_slot(03)
32         hotplug_slot(04)
33         hotplug_slot(05)
34         hotplug_slot(06)
35         hotplug_slot(07)
36         hotplug_slot(08)
37         hotplug_slot(09)
38         hotplug_slot(0a)
39         hotplug_slot(0b)
40         hotplug_slot(0c)
41         hotplug_slot(0d)
42         hotplug_slot(0e)
43         hotplug_slot(0f)
44         hotplug_slot(10)
45         hotplug_slot(11)
46         hotplug_slot(12)
47         hotplug_slot(13)
48         hotplug_slot(14)
49         hotplug_slot(15)
50         hotplug_slot(16)
51         hotplug_slot(17)
52         hotplug_slot(18)
53         hotplug_slot(19)
54         hotplug_slot(1a)
55         hotplug_slot(1b)
56         hotplug_slot(1c)
57         hotplug_slot(1d)
58         hotplug_slot(1e)
59         hotplug_slot(1f)
60
61 #define gen_pci_hotplug(slot)   \
62             If (LEqual(Arg0, 0x##slot)) { Notify(S##slot, Arg1) }
63
64         Method(PCNT, 2) {
65             gen_pci_hotplug(01)
66             gen_pci_hotplug(02)
67             gen_pci_hotplug(03)
68             gen_pci_hotplug(04)
69             gen_pci_hotplug(05)
70             gen_pci_hotplug(06)
71             gen_pci_hotplug(07)
72             gen_pci_hotplug(08)
73             gen_pci_hotplug(09)
74             gen_pci_hotplug(0a)
75             gen_pci_hotplug(0b)
76             gen_pci_hotplug(0c)
77             gen_pci_hotplug(0d)
78             gen_pci_hotplug(0e)
79             gen_pci_hotplug(0f)
80             gen_pci_hotplug(10)
81             gen_pci_hotplug(11)
82             gen_pci_hotplug(12)
83             gen_pci_hotplug(13)
84             gen_pci_hotplug(14)
85             gen_pci_hotplug(15)
86             gen_pci_hotplug(16)
87             gen_pci_hotplug(17)
88             gen_pci_hotplug(18)
89             gen_pci_hotplug(19)
90             gen_pci_hotplug(1a)
91             gen_pci_hotplug(1b)
92             gen_pci_hotplug(1c)
93             gen_pci_hotplug(1d)
94             gen_pci_hotplug(1e)
95             gen_pci_hotplug(1f)
96         }
97     }
98 }