Hi Kalle, On 25/11/18 19:58, Kalle Olavi Niemitalo wrote: > Perhaps this code should first check whether the SCI_EN bit is > already set, as described in ACPI 5.0 section 4.8.2.5 > "Legacy/ACPI Select and the SCI Interrupt", and skip the outb if > so. Section 5.2.9 "Fixed ACPI Description Table (FADT)" says the > SMI_CMD field of FADT can be zero. > Thanks for the information, I will do this.
>> +#define SLP_TYP0 (0x0 << 10) >> +#define SLP_TYP5 (0x5 << 10) > > This hardcodes QEMU-specific values. ACPI 5.0 section 7.3.4 says > the values for PM1a_CNT.SLP_TYP must be read from the \S0-\S5 > objects. Damn, I want to avoid putting a whole AML interpreter into hurd. I thought the sleep value for S5 == 0x5 but clearly this is not the case. Now that you have pointed this out, I dont know how to make this work for all cases without putting an AML interpreter into hurd as you said. >DSDT of my laptop also has: > > If (LEqual (S3DS, One)) > { > Name (_S3, Package (0x04) // _S3_: S3 System State > { > 0x05, > Zero, > Zero, > Zero > }) > } Surely S5 always has to exist, how else do you power off the machine? Some machines don't have suspend S3. Maybe I can do some clever walk of the binary to find the _S5 object and extract the SLP_TYP value instead of a whole AML interpreter? > Maybe it's good enough if S5 works on QEMU. In that case though, > I would like to see a comment warning about this limitation. For now I will indeed add a comment stating the limitation. Thanks for review! Damien