Skip to content

Conversation

@williampMSFT
Copy link
Contributor

@williampMSFT williampMSFT commented Jan 23, 2026

This change implements an ACPI time-and-alarm device as defined in section 9.18 of the ACPI 6.4 spec.

Such a device needs to interface with the not-yet-existent power service to trigger wakes and subscribe to power source notifications, so those interface points are stubbed out for now.

Resolves #138, #139, #140, #141, #142, #143, #144

Copilot AI review requested due to automatic review settings January 23, 2026 21:23
@williampMSFT
Copy link
Contributor Author

Replaces #501, which was targeting the main branch (this now depends on the comms rework that's currently only available in v0.2.0).

@github-actions
Copy link

github-actions bot commented Jan 23, 2026

Cargo Vet Audit Passed

cargo vet has passed in this PR. No new unvetted dependencies were found.

@github-actions github-actions bot added the cargo vet PRs pending auditor review label Jan 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements an ACPI time-and-alarm device as defined in section 9.18 of the ACPI 6.4 specification. The implementation includes a new service for managing AC and DC power timers with wake capabilities, timer status tracking, and timezone/DST management. Power service integration points are stubbed for future implementation.

Changes:

  • Adds time-alarm-service crate with timer logic, persistent storage, and ACPI command handling
  • Adds time-alarm-service-messages crate with message serialization/deserialization for ACPI time/alarm operations
  • Integrates the service into the eSPI MCTP relay system
  • Removes legacy TimeAlarm structures from EC memory map in favor of the new service-based approach
  • Updates dependency versions (num_enum 0.7.4 → 0.7.5, PAC updates, embassy-imxrt updates)

Reviewed changes

Copilot reviewed 15 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
time-alarm-service/src/lib.rs Main service implementation with ACPI command handling and power source management
time-alarm-service/src/timer.rs Timer state machine with wake policy handling and expiration logic
time-alarm-service/src/task.rs Async task definitions for command handling and timer tasks
time-alarm-service-messages/src/lib.rs ACPI message types and serialization/deserialization
time-alarm-service-messages/src/acpi_timestamp.rs ACPI timestamp structure with timezone and DST support
time-alarm-service/Cargo.toml Service dependencies and feature configuration
time-alarm-service-messages/Cargo.toml Message library dependencies
espi-service/src/mctp.rs Integration of TimeAlarm service into MCTP relay
espi-service/Cargo.toml Added time-alarm-service-messages dependency
embedded-service/src/relay/mod.rs Explicit trait qualification to avoid ambiguity
embedded-service/src/ec_type/structure.rs Removed legacy TimeAlarm structure
embedded-service/src/ec_type/mod.rs Removed legacy time alarm memory map functions
embedded-service/src/ec_type/generator/ec_memory_map.yaml Removed TimeAlarm from memory map definition
examples/rt685s-evk/src/bin/time_alarm.rs Example demonstrating service usage with mock eSPI
examples/rt685s-evk/Cargo.toml Added time-alarm service dependencies
Cargo.toml Added time-alarm service workspace members and updated num_enum version
Cargo.lock, examples/*/Cargo.lock Dependency lock file updates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 23, 2026 22:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 22 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 23, 2026 22:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 22 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 24, 2026 00:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 22 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@williampMSFT williampMSFT marked this pull request as ready for review January 26, 2026 16:47
@williampMSFT williampMSFT requested review from a team as code owners January 26, 2026 16:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 22 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

kurtjd
kurtjd previously approved these changes Jan 26, 2026
Copy link
Contributor

@kurtjd kurtjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The mctp.rs file could use the same treatment in uart-service as is done here for eSPI service, but can be a separate PR.

Copilot AI review requested due to automatic review settings January 26, 2026 18:55
philgweber
philgweber previously approved these changes Jan 26, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 24 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

kurtjd
kurtjd previously approved these changes Jan 26, 2026
tullom
tullom previously approved these changes Jan 26, 2026
@williampMSFT williampMSFT enabled auto-merge (squash) January 27, 2026 01:39
Copy link
Contributor

@jerrysxie jerrysxie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@williampMSFT How can we do integration testing with the time-alarm service? Mocking out the underlying datetime and storage and checking that the correct fields has been set in response to ACPI commands? Using a mock timer to generate expiration and wake events?

// TODO [SPEC] section 9.18.7 indicates that when a timer expires, both timers have their wake policies reset,
// but I can't find any similar rule for the actual timer value - that seems odd to me, verify that's actually how
// it's supposed to work
let _ = self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this infallible? Thus, we are throwing away the error.

@williampMSFT williampMSFT dismissed stale reviews from tullom, kurtjd, and philgweber via 2b56070 January 27, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cargo vet PRs pending auditor review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants