1 | // $Id: vbox-cpuhotplug.dsl 60616 2016-04-21 08:25:26Z vboxsync $
|
---|
2 | /// @file
|
---|
3 | //
|
---|
4 | // VirtualBox ACPI
|
---|
5 | //
|
---|
6 | // Copyright (C) 2006-2015 Oracle Corporation
|
---|
7 | //
|
---|
8 | // This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | // available from http://www.virtualbox.org. This file is free software;
|
---|
10 | // you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | // General Public License (GPL) as published by the Free Software
|
---|
12 | // Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | // VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | // hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 |
|
---|
16 | DefinitionBlock ("SSDT-cpuhotplug.aml", "SSDT", 1, "VBOX ", "VBOXCPUT", 2)
|
---|
17 | {
|
---|
18 | External(CPUC)
|
---|
19 | External(CPUL)
|
---|
20 | External(CPEV)
|
---|
21 | External(CPET)
|
---|
22 |
|
---|
23 | // Method to check for the CPU status
|
---|
24 | Method(CPCK, 1)
|
---|
25 | {
|
---|
26 | Store (Arg0, CPUC)
|
---|
27 | Return(LEqual(CPUL, 0x01))
|
---|
28 | }
|
---|
29 |
|
---|
30 | // Method to notify the VMM that a CPU is not
|
---|
31 | // in use anymore and can be safely removed.
|
---|
32 | // Using the extra method here because the CPUL
|
---|
33 | // register identifer clashes with the CPUL object defined
|
---|
34 | // below making iasl starting with version 20150930 fail.
|
---|
35 | //
|
---|
36 | // Think of CPLO as "CPU Lock Open"
|
---|
37 | Method(CPLO, 1)
|
---|
38 | {
|
---|
39 | Store(Arg0, CPUL)
|
---|
40 | }
|
---|
41 |
|
---|
42 | Scope (\_SB)
|
---|
43 | {
|
---|
44 |
|
---|
45 | #define GENERATE_CPU_OBJECT(id, sck, sckuid, cpu, cpuuid)<NL> \
|
---|
46 | Device (sck) \
|
---|
47 | { \
|
---|
48 | Name (_HID, "ACPI0004") \
|
---|
49 | Name (_UID, sckuid) \
|
---|
50 | \
|
---|
51 | <NL> \
|
---|
52 | Processor (cpu, /* Name */ \
|
---|
53 | id, /* Id */ \
|
---|
54 | 0x0, /* Processor IO ports range start */ \
|
---|
55 | 0x0 /* Processor IO ports range length */ \
|
---|
56 | ) \
|
---|
57 | { \
|
---|
58 | Name (_HID, "ACPI0007") \
|
---|
59 | Name (_UID, cpuuid) \
|
---|
60 | Name (_PXM, 0x00) \
|
---|
61 | <NL> \
|
---|
62 | Method(_MAT, 0, Serialized) \
|
---|
63 | { \
|
---|
64 | Name (APIC, Buffer (8) {0x00, 0x08, id, id}) \
|
---|
65 | IF (CPCK(id)) \
|
---|
66 | { \
|
---|
67 | Store (One, Index (APIC, 4)) \
|
---|
68 | } \
|
---|
69 | Else \
|
---|
70 | { \
|
---|
71 | Store (Zero, Index (APIC, 4)) \
|
---|
72 | } \
|
---|
73 | Return (APIC) \
|
---|
74 | } \
|
---|
75 | <NL> \
|
---|
76 | Method(_STA) /* Used for device presence detection */ \
|
---|
77 | { \
|
---|
78 | IF (CPCK(id)) \
|
---|
79 | { \
|
---|
80 | Return (0xF) \
|
---|
81 | } \
|
---|
82 | Else \
|
---|
83 | { \
|
---|
84 | Return (0x0) \
|
---|
85 | } \
|
---|
86 | } \
|
---|
87 | <NL> \
|
---|
88 | Method(_EJ0, 1) \
|
---|
89 | { \
|
---|
90 | CPLO(id) /* Unlock the CPU */ \
|
---|
91 | Return \
|
---|
92 | } \
|
---|
93 | } \
|
---|
94 | } \
|
---|
95 |
|
---|
96 | GENERATE_CPU_OBJECT(0x00, SCK0, "SCKCPU0", CPU0, "SCK0-CPU0")
|
---|
97 | GENERATE_CPU_OBJECT(0x01, SCK1, "SCKCPU1", CPU1, "SCK1-CPU0")
|
---|
98 | GENERATE_CPU_OBJECT(0x02, SCK2, "SCKCPU2", CPU2, "SCK2-CPU0")
|
---|
99 | GENERATE_CPU_OBJECT(0x03, SCK3, "SCKCPU3", CPU3, "SCK3-CPU0")
|
---|
100 | GENERATE_CPU_OBJECT(0x04, SCK4, "SCKCPU4", CPU4, "SCK4-CPU0")
|
---|
101 | GENERATE_CPU_OBJECT(0x05, SCK5, "SCKCPU5", CPU5, "SCK5-CPU0")
|
---|
102 | GENERATE_CPU_OBJECT(0x06, SCK6, "SCKCPU6", CPU6, "SCK6-CPU0")
|
---|
103 | GENERATE_CPU_OBJECT(0x07, SCK7, "SCKCPU7", CPU7, "SCK7-CPU0")
|
---|
104 | GENERATE_CPU_OBJECT(0x08, SCK8, "SCKCPU8", CPU8, "SCK8-CPU0")
|
---|
105 | GENERATE_CPU_OBJECT(0x09, SCK9, "SCKCPU9", CPU9, "SCK9-CPU0")
|
---|
106 | GENERATE_CPU_OBJECT(0x0a, SCKA, "SCKCPUA", CPUA, "SCKA-CPU0")
|
---|
107 | GENERATE_CPU_OBJECT(0x0b, SCKB, "SCKCPUB", CPUB, "SCKB-CPU0")
|
---|
108 | GENERATE_CPU_OBJECT(0x0c, SCKC, "SCKCPUC", CPUC, "SCKC-CPU0")
|
---|
109 | GENERATE_CPU_OBJECT(0x0d, SCKD, "SCKCPUD", CPUD, "SCKD-CPU0")
|
---|
110 | GENERATE_CPU_OBJECT(0x0e, SCKE, "SCKCPUE", CPUE, "SCKE-CPU0")
|
---|
111 | GENERATE_CPU_OBJECT(0x0f, SCKF, "SCKCPUF", CPUF, "SCKF-CPU0")
|
---|
112 | GENERATE_CPU_OBJECT(0x10, SCKG, "SCKCPUG", CPUG, "SCKG-CPU0")
|
---|
113 | GENERATE_CPU_OBJECT(0x11, SCKH, "SCKCPUH", CPUH, "SCKH-CPU0")
|
---|
114 | GENERATE_CPU_OBJECT(0x12, SCKI, "SCKCPUI", CPUI, "SCKI-CPU0")
|
---|
115 | GENERATE_CPU_OBJECT(0x13, SCKJ, "SCKCPUJ", CPUJ, "SCKJ-CPU0")
|
---|
116 | GENERATE_CPU_OBJECT(0x14, SCKK, "SCKCPUK", CPUK, "SCKK-CPU0")
|
---|
117 | GENERATE_CPU_OBJECT(0x15, SCKL, "SCKCPUL", CPUL, "SCKL-CPU0")
|
---|
118 | GENERATE_CPU_OBJECT(0x16, SCKM, "SCKCPUM", CPUM, "SCKM-CPU0")
|
---|
119 | GENERATE_CPU_OBJECT(0x17, SCKN, "SCKCPUN", CPUN, "SCKN-CPU0")
|
---|
120 | GENERATE_CPU_OBJECT(0x18, SCKO, "SCKCPUO", CPUO, "SCKO-CPU0")
|
---|
121 | GENERATE_CPU_OBJECT(0x19, SCKP, "SCKCPUP", CPUP, "SCKP-CPU0")
|
---|
122 | GENERATE_CPU_OBJECT(0x1a, SCKQ, "SCKCPUQ", CPUQ, "SCKQ-CPU0")
|
---|
123 | GENERATE_CPU_OBJECT(0x1b, SCKR, "SCKCPUR", CPUR, "SCKR-CPU0")
|
---|
124 | GENERATE_CPU_OBJECT(0x1c, SCKS, "SCKCPUS", CPUS, "SCKS-CPU0")
|
---|
125 | GENERATE_CPU_OBJECT(0x1d, SCKT, "SCKCPUT", CPUT, "SCKT-CPU0")
|
---|
126 | GENERATE_CPU_OBJECT(0x1e, SCKU, "SCKCPUU", CPUU, "SCKU-CPU0")
|
---|
127 | GENERATE_CPU_OBJECT(0x1f, SCKV, "SCKCPUV", CPUV, "SCKV-CPU0")
|
---|
128 |
|
---|
129 | #undef GENERATE_CPU_OBJECT
|
---|
130 | }
|
---|
131 |
|
---|
132 | Scope (\_GPE)
|
---|
133 | {
|
---|
134 |
|
---|
135 | #define CHECK_CPU(cpu, sck, cpuname) \
|
---|
136 | IF (LEqual(Local0, cpu)) \
|
---|
137 | { \
|
---|
138 | Notify (\_SB.sck.cpuname, Local1) \
|
---|
139 | } \
|
---|
140 |
|
---|
141 | // GPE bit 1 handler
|
---|
142 | // GPE.1 must be set and SCI raised when
|
---|
143 | // processor info changed and CPU must be
|
---|
144 | // re-evaluated
|
---|
145 | Method (_L01, 0, NotSerialized)
|
---|
146 | {
|
---|
147 | Store(CPEV, Local0)
|
---|
148 | Store(CPET, Local1)
|
---|
149 |
|
---|
150 | CHECK_CPU(0x01, SCK1, CPU1)
|
---|
151 | CHECK_CPU(0x02, SCK2, CPU2)
|
---|
152 | CHECK_CPU(0x03, SCK3, CPU3)
|
---|
153 | CHECK_CPU(0x04, SCK4, CPU4)
|
---|
154 | CHECK_CPU(0x05, SCK5, CPU5)
|
---|
155 | CHECK_CPU(0x06, SCK6, CPU6)
|
---|
156 | CHECK_CPU(0x07, SCK7, CPU7)
|
---|
157 | CHECK_CPU(0x08, SCK8, CPU8)
|
---|
158 | CHECK_CPU(0x09, SCK9, CPU9)
|
---|
159 | CHECK_CPU(0x0a, SCKA, CPUA)
|
---|
160 | CHECK_CPU(0x0b, SCKB, CPUB)
|
---|
161 | CHECK_CPU(0x0c, SCKC, CPUC)
|
---|
162 | CHECK_CPU(0x0d, SCKD, CPUD)
|
---|
163 | CHECK_CPU(0x0e, SCKE, CPUE)
|
---|
164 | CHECK_CPU(0x0f, SCKF, CPUF)
|
---|
165 | CHECK_CPU(0x10, SCKG, CPUG)
|
---|
166 | CHECK_CPU(0x11, SCKH, CPUH)
|
---|
167 | CHECK_CPU(0x12, SCKI, CPUI)
|
---|
168 | CHECK_CPU(0x13, SCKJ, CPUJ)
|
---|
169 | CHECK_CPU(0x14, SCKK, CPUK)
|
---|
170 | CHECK_CPU(0x15, SCKL, CPUL)
|
---|
171 | CHECK_CPU(0x16, SCKM, CPUM)
|
---|
172 | CHECK_CPU(0x17, SCKN, CPUN)
|
---|
173 | CHECK_CPU(0x18, SCKO, CPUO)
|
---|
174 | CHECK_CPU(0x19, SCKP, CPUP)
|
---|
175 | CHECK_CPU(0x1a, SCKQ, CPUQ)
|
---|
176 | CHECK_CPU(0x1b, SCKR, CPUR)
|
---|
177 | CHECK_CPU(0x1c, SCKS, CPUS)
|
---|
178 | CHECK_CPU(0x1d, SCKT, CPUT)
|
---|
179 | CHECK_CPU(0x1e, SCKU, CPUU)
|
---|
180 | CHECK_CPU(0x1f, SCKV, CPUV)
|
---|
181 | }
|
---|
182 |
|
---|
183 | #undef CHECK_CPU
|
---|
184 | }
|
---|
185 |
|
---|
186 | }
|
---|
187 |
|
---|
188 | /*
|
---|
189 | * Local Variables:
|
---|
190 | * comment-start: "//"
|
---|
191 | * End:
|
---|
192 | */
|
---|