On Wed, Jul 07, 2010 at 12:57:05AM -0400, Kevin O'Connor wrote:
Hi,
I've been playing with the cpu hotplug SSDT changes. Attached is a proposal for an alternative method of adding ACPI support.
The idea is to continue to build a dynamic SSDT based on CountCPUs and MaxCountCPUs. The dynamic SSDT entries just call methods in the main DSDT.
If it is doable and remains to be debugable it is great.
This is completely untested. Hopefully the patch will demonstrate the idea though.
The objective is to dynamically build an SSDT that looks something like:
=========================================================== { Scope (_SB) { External(CPMA, MethodObj) External(CPST, MethodObj) External(CPEJ, MethodObj) #define DefCPU(nr) \ Processor (CP##nr, 0x##nr, 0x0000b010, 0x06) { \ Name (_HID, "ACPI0007") \ Name (ID, 0x##nr) \ Method(_MAT, 0) { \ Return(CPMA(ID)) \ } \ Method (_STA) { \ Return(CPST(ID)) \ } \ Method (_EJ0, 1, NotSerialized) { \ Return(CPEJ(ID, Arg0)) \ } \ } DefCPU(00) DefCPU(01) DefCPU(02) DefCPU(03) DefCPU(AA) Name(CPUS, Package() { CP00, CP01, CP02, CP03, CPAA, }) Name(CPON, Package() { One, One, One, Zero, Zero }) } } ===========================================================
with a dynamic number of cpus.
The "CPUS" package stores references to the Processor objects, and the "CPON" package stores the state of which cpus are active. With this info, hopefully there is no need to update the MADT tables.
The way you wrote it acpi_id is always equal to lapic_id which is not alway true. By using MADT from memory we remove this dependency from DSDT code.
-- Gleb.