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