⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module acpi_pm

Module acpi_pm 

Source
Expand description

ACPI Power Management for x86_64.

Implements ACPI sleep state transitions (S0-S5), SCI interrupt handling, and wake event processing. Reads PM1a/PM1b control and status registers from the FADT to orchestrate suspend (S3), hibernate (S4), and soft-off (S5).

CPU context save/restore for S3 resume uses inline assembly to capture and restore general-purpose registers, segment descriptors, and CR3.

Enums§

AcpiSleepState
ACPI system sleep states.
AcpiWakeEvent
Types of wake events that can resume the system from sleep.
LidState
Laptop lid state.

Functions§

acpi_handle_sci
Handle an ACPI SCI (System Control Interrupt).
acpi_hibernate_s4
Hibernate (ACPI S4).
acpi_pm_init
Initialize the ACPI power management subsystem.
acpi_shutdown_s5
Soft power off via ACPI S5.
acpi_suspend_s3
Suspend to RAM (ACPI S3).
current_state
Get the current ACPI sleep state.
is_initialized
Check if ACPI PM is initialized.
is_state_supported
Check if a given sleep state is supported.
last_wake_event
Get the last wake event type.
lid_state
Get the current lid state.
supported_states_string
Get supported sleep states as a formatted string.
wake_event_count
Get the total number of wake events since boot.