diff --git a/src/scheme/acpi.rs b/src/scheme/acpi.rs index dec7ddf000..13c3483e17 100644 --- a/src/scheme/acpi.rs +++ b/src/scheme/acpi.rs @@ -256,6 +256,34 @@ impl KernelScheme for AcpiScheme { // reason value. Ok(*KSTOP_FLAG.lock(token.token()) as usize) } + AcpiVerb::EnterS2Idle => { + // Phase J: typed-AcpiVerb path. acpid calls + // this (via kcall_wo) instead of writing the + // "s2idle" string to the kstop handle. The + // payload is empty; the verb code is the + // signal. Hardware-agnostic — works on any + // platform with Modern Standby firmware + // (Dell, HP, Lenovo, LG Gram, etc.). + if handle != HandleBits::KSTOP_HANDLE { + return Err(Error::new(EINVAL)); + } + s2idle_request_set(); + kstop_set_reason(2); // s2idle wake reason + Ok(0) + } + AcpiVerb::ExitS2Idle => { + // Phase J: s2idle wake. The kernel's mwait_loop + // post-handler already clears S2IDLE_REQUESTED + // and signals the kstop event with reason=2; + // this verb is provided for completeness (e.g. + // when acpid wants to force the wake path + // without going through MWAIT). + if handle != HandleBits::KSTOP_HANDLE { + return Err(Error::new(EINVAL)); + } + s2idle_signal_wake(); + Ok(0) + } } } } \ No newline at end of file