diff --git a/CHANGELOG.md b/CHANGELOG.md index e12e9faa89..aaf4ad865a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -199,6 +199,59 @@ sync with the newest highlights. the trampoline address to FACS.waking_vector before \_PTS(3). This is a separate Phase II.X.W commit. +## 2026-07-01 — Phase II.X.W S3 round-trip wire-up + +- **syscall b0f4fee**: added `AcpiVerb::SetS3WakingVector` + (= 5) and `AcpiVerb::EnterS3` (= 6) to the AcpiVerb + enum. Hardware-agnostic: works on any x86_64 + system with standard ACPI S3 support (Dell, HP, Lenovo, + LG Gram 14). +- **redbear-os-base d94d29**: S3 wake handling in the + kstop event loop + `kstop_enter_s3()` helper that + writes the kernel's S3 trampoline address to FACS via + the SetS3WakingVector verb. Calls + `wake_from_sleep_state(3)` on S3 wake. +- **redbear-os-kernel 9bc1fbf**: + - **Comprehensive FACS parser** matching Linux 7.1's + `struct acpi_table_facs` from `include/acpi/actbl.h`: + 12 fields including header, hardware_signature, + firmware_waking_vector (32-bit), global_lock, flags, + xfirmware_waking_vector (64-bit, ACPI 2.0+), version, + reserved[3], ospm_flags (ACPI 4.0+), reserved1[24]. + - **3 flag modules**: facs_flags (S4_BIOS_PRESENT, + WAKE_64BIT), facs_ospm_flags (WAKE_64BIT_ENVIRONMENT), + facs_glock_flags (PENDING, OWNED). + - **FADT.x_firmware_ctrl + firmware_ctrl accessors**: + FADT offsets 140 and 36. + - **Sdt.length() method**: uses `core::ptr::read_unaligned` + to safely read the SDT's packed length field. + - **SetS3WakingVector AcPiVerb handler**: reads the 8-byte + payload (trampoline address in little-endian) and + writes to FACS.xfirmware_waking_vector. A zero payload + is a sentinel for "use the kernel's default + trampoline address" (s3_trampoline symbol). + - **acpi init** (src/acpi/mod.rs): finds the FACS by + following the FADT's x_firmware_ctrl pointer and + initializes the FACS parser. Logs a warning if FACS + is not found. +- **Full S3 round-trip flow** is now wired: + 1. acpid: enter_sleep_state(3) does the AML prep + (`_TTS(3)`, `_PTS(3)`, `_SST(3)`) + 2. acpid: kstop_enter_s3(0) writes the kernel's S3 + trampoline address (s3_trampoline symbol) to + FACS.xfirmware_waking_vector + 3. acpid: writes 's3' to /scheme/sys/kstop with the + SLP_TYP byte + 4. kernel: stop::enter_s3 reads S3_SLP_TYP, writes + SLP_TYP|SLP_EN to PM1a_CNT + 5. firmware: enters S3 + 6. ... on wake ... firmware jumps to FACS.waking_vector + 7. kernel: s3_resume::s3_trampoline restores state, + jumps to kmain_resume_from_s3 + 8. acpid: receives kstop reason=3, runs + wake_from_sleep_state(3) (`_SST(2)` -> `_WAK(3)` -> + `_SST(1)`) + ## 2026-07-01 — Build system: explicit patch verification The user requested "build system must report complete when