1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /****************************************************************
5 ****************************************************************/
8 /* Objects filled in by run-time generated SSDT */
9 External(NTFY, MethodObj)
10 External(CPON, PkgObj)
12 /* Methods called by run-time generated SSDT Processor objects */
13 Method(CPMA, 1, NotSerialized) {
14 // _MAT method - create an madt APIC buffer
15 // Arg0 = Processor ID = Local APIC ID
16 // Local0 = CPON flag for this cpu
17 Local0 = DerefOf (CPON [Arg0])
18 // Local1 = Buffer (in madt APIC form) to return
19 Local1 = Buffer(8) {0x00, 0x08, 0x00, 0x00, 0x00, 0, 0, 0}
20 // Update the processor id, Local APIC id, and enable/disable status
26 Method(CPST, 1, NotSerialized) {
27 // _STA method - return ON status of cpu
28 // Arg0 = Processor ID = Local APIC ID
29 // Local0 = CPON flag for this cpu
30 Local0 = DerefOf (CPON [Arg0])
37 Method(CPEJ, 2, NotSerialized) {
38 // _EJ0 method - eject callback
42 /* CPU hotplug notify method */
43 OperationRegion(PRST, SystemIO, 0xaf00, 32)
44 Field(PRST, ByteAcc, NoLock, Preserve) {
48 // Local5 = active CPU bitmap
50 // Local2 = last read byte from bitmap
52 // Local0 = Processor ID / APIC ID iterator
54 While (Local0 < SizeOf(CPON)) {
55 // Local1 = CPON flag for this cpu
56 Local1 = DerefOf (CPON [Local0])
58 // Shift down previously read bitmap byte
61 // Read next byte from CPU bitmap
62 Local2 = DerefOf (Local5 [Local0 >> 3])
64 // Local3 = active state for this cpu
67 If (Local1 != Local3) {
68 // State change - update CPON with new state
69 CPON [Local0] = Local3