mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
pc: acpi: cpuhp: move PRSC() method into SSDT
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
40f981a02d
commit
f294ecbc13
8 changed files with 71 additions and 42 deletions
|
@ -1340,7 +1340,7 @@ build_ssdt(GArray *table_data, GArray *linker,
|
|||
* Method(NTFY, 2) {If (LEqual(Arg0, 0x00)) {Notify(CP00, Arg1)} ...}
|
||||
*/
|
||||
/* Arg0 = Processor ID = APIC ID */
|
||||
method = aml_method("NTFY", 2, AML_NOTSERIALIZED);
|
||||
method = aml_method(AML_NOTIFY_METHOD, 2, AML_NOTSERIALIZED);
|
||||
for (i = 0; i < acpi_cpus; i++) {
|
||||
ifctx = aml_if(aml_equal(aml_arg(0), aml_int(i)));
|
||||
aml_append(ifctx,
|
||||
|
|
|
@ -19,42 +19,5 @@
|
|||
|
||||
Scope(\_SB) {
|
||||
/* Objects filled in by run-time generated SSDT */
|
||||
External(NTFY, MethodObj)
|
||||
External(CPON, PkgObj)
|
||||
External(PRS, FieldUnitObj)
|
||||
|
||||
/* Methods called by run-time generated SSDT Processor objects */
|
||||
Method(PRSC, 0) {
|
||||
// Local5 = active cpu bitmap
|
||||
Store(PRS, Local5)
|
||||
// Local2 = last read byte from bitmap
|
||||
Store(Zero, Local2)
|
||||
// Local0 = Processor ID / APIC ID iterator
|
||||
Store(Zero, Local0)
|
||||
While (LLess(Local0, SizeOf(CPON))) {
|
||||
// Local1 = CPON flag for this cpu
|
||||
Store(DerefOf(Index(CPON, Local0)), Local1)
|
||||
If (And(Local0, 0x07)) {
|
||||
// Shift down previously read bitmap byte
|
||||
ShiftRight(Local2, 1, Local2)
|
||||
} Else {
|
||||
// Read next byte from cpu bitmap
|
||||
Store(DerefOf(Index(Local5, ShiftRight(Local0, 3))), Local2)
|
||||
}
|
||||
// Local3 = active state for this cpu
|
||||
Store(And(Local2, 1), Local3)
|
||||
|
||||
If (LNotEqual(Local1, Local3)) {
|
||||
// State change - update CPON with new state
|
||||
Store(Local3, Index(CPON, Local0))
|
||||
// Do CPU notify
|
||||
If (LEqual(Local3, 1)) {
|
||||
NTFY(Local0, 1)
|
||||
} Else {
|
||||
NTFY(Local0, 3)
|
||||
}
|
||||
}
|
||||
Increment(Local0)
|
||||
}
|
||||
}
|
||||
External(CPU_SCAN_METHOD, MethodObj)
|
||||
}
|
||||
|
|
|
@ -268,7 +268,7 @@ DefinitionBlock (
|
|||
}
|
||||
Method(_E02) {
|
||||
// CPU hotplug event
|
||||
\_SB.PRSC()
|
||||
\_SB.CPU_SCAN_METHOD()
|
||||
}
|
||||
Method(_L04) {
|
||||
}
|
||||
|
|
|
@ -401,7 +401,7 @@ DefinitionBlock (
|
|||
}
|
||||
Method(_E02) {
|
||||
// CPU hotplug event
|
||||
\_SB.PRSC()
|
||||
\_SB.CPU_SCAN_METHOD()
|
||||
}
|
||||
Method(_L04) {
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue