Module battery

Source
Expand description

Virtual battery device.

This virtual battery device simulates the host’s battery state for the guest. Rather than modeling a real device, it’s a Hyper-V specific design, tailored to meet the ACPI Battery and Power Subsystem Firmware Implementation and the additional requirements imposed by the Windows Hardware Design Guidelines.

This device was implemented alongside the ACPI code in Hyper-V UEFI. For more information, refer to the DSDT in the UEFI codebase: mu_msvm.

For historical context, this device was originally designed for x86 and was later adapted for ARM64.

This device uses LineInterrupts to signal state changes to interested parties (e.g: the PM device on x86, a system IRQ on Aarch64). A mesh channel is used to receive battery state updates from the host platform.

Refer to the following resources for more context:

Modules§

resolver
Resolver for battery devices.

Structs§

BatteryDevice
Virtual battery device.
BatteryRuntimeDeps
Various runtime objects used by the BatteryDevice
RegisterOffset

Constants§

ACPI_DEVICE_NOTIFY_BIX_CHANGED
ACPI_DEVICE_NOTIFY_BST_CHANGED
ACPI_DEVICE_NOTIFY_VALID_BITS
BATTERY_DEVICE_MMIO_REGION_MASK
BATTERY_DEVICE_MMIO_REGION_SIZE
BATTERY_MMIO_REGION_BASE_ADDRESS_ARM
BATTERY_MMIO_REGION_BASE_ADDRESS_X64
BATTERY_STATUS_GPE0_LINE
BATTERY_STATUS_IRQ_NO
VIRTUAL_BATTERY_CAPACITY