rust-osdev / rust-osdev/acpi

Pm1ControlRegisterBlock::set_sleep_typ doesn't write SLP_TYPb

Open
#328 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
245
Forks
93
Avg merge
2d 8h
Merged PRs (30d)
15

Description

From the spec:

OSPM writes SLP_TYPb (from the _S5 object) with the SLP_ENb bit set to the PM1b_CNT register, or writes the HW-reduced ACPI Sleep Type value for S5 and the SLP_EN bit to the Sleep Control Register.

The current behavior is that the same value is written to both SLP_TYPa and SLP_TYPb.

My recommended solution is to remove the set_sleep_typ method and instead create a function called enter_soft_off (can also have functions for sleep, although my OS is not at the point where I can implement sleep). This function can do the proper procedure, including checking if it is HW reduced and doing the right steps for HW reduced. I can make a PR with this, but currently my test devices (QEMU q35 and Lenovo Z560 both are not HW reduced, so I can't test the HW reduced logic).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Pm1ControlRegisterBlock::set_sleep_typ and compare its PM1a/PM1b writes with the linked ACPI specification. Determine the API and test coverage needed for separate non-HW-reduced writes and HW-reduced handling; done means the implementation follows the S5 procedure without assuming both registers use the same value.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.