pub struct PowerManagementDevice { /* private fields */ }
Expand description
A power management + ACPI device.
See the module level docs for more details.
Implementations§
Source§impl PowerManagementDevice
impl PowerManagementDevice
Sourcepub fn new(
action: PowerActionFn,
acpi_interrupt: LineInterrupt,
register_pio: &mut dyn RegisterPortIoIntercept,
vmtime: VmTimeAccess,
enable_acpi_mode: Option<EnableAcpiMode>,
pm_timer_assist: Option<Box<dyn PmTimerAssist>>,
) -> Self
pub fn new( action: PowerActionFn, acpi_interrupt: LineInterrupt, register_pio: &mut dyn RegisterPortIoIntercept, vmtime: VmTimeAccess, enable_acpi_mode: Option<EnableAcpiMode>, pm_timer_assist: Option<Box<dyn PmTimerAssist>>, ) -> Self
Create a new PowerManagementDevice
.
Most arguments to this constructor are self describing, though there are some that merit additional explanation:
action
: a callback invoked whenever the PM initiates a power eventpio_control
andpio_status
: define where in the port IO space the control/status registers get mapped to.enable_acpi_mode
: see the docs forEnableAcpiMode
Sourcepub fn check_interrupt_assertion(&self)
pub fn check_interrupt_assertion(&self)
(used by the PIIX4 wrapper device)
Evaluates whether the power management (ACPI) interrupt should be asserted or de-asserted
If the state is out of sync with what it should be, this function will either assert or de-assert the interrupt. The logic for whether an ACPI interrupt should be sent is covered in various parts of Chapter 4 of any version of the ACPI spec.
reSearch query: CheckInterruptAssertion
Sourcepub fn update_dynamic_pio_mappings(&mut self, pio_dynamic_addr: Option<u16>)
pub fn update_dynamic_pio_mappings(&mut self, pio_dynamic_addr: Option<u16>)
(used by the PIIX4 wrapper device)
Remap dynamic registers based on config in the PCI config space
Sourcepub fn pcat_facp_acpi_enable(&mut self, enable: bool)
pub fn pcat_facp_acpi_enable(&mut self, enable: bool)
(used by the PIIX4 wrapper device)
See calling code in piix4_pm.rs for details on what this does.
Sourcepub fn power_action(&mut self) -> &mut PowerActionFn
pub fn power_action(&mut self) -> &mut PowerActionFn
(used by the PIIX4 wrapper device)
Get a mutable reference to the provided PowerActionFn
Trait Implementations§
Source§impl ChangeDeviceState for PowerManagementDevice
impl ChangeDeviceState for PowerManagementDevice
Source§impl ChipsetDevice for PowerManagementDevice
impl ChipsetDevice for PowerManagementDevice
Source§fn supports_pio(&mut self) -> Option<&mut dyn PortIoIntercept>
fn supports_pio(&mut self) -> Option<&mut dyn PortIoIntercept>
Source§fn supports_line_interrupt_target(
&mut self,
) -> Option<&mut dyn LineInterruptTarget>
fn supports_line_interrupt_target( &mut self, ) -> Option<&mut dyn LineInterruptTarget>
§fn supports_mmio(&mut self) -> Option<&mut (dyn MmioIntercept + 'static)>
fn supports_mmio(&mut self) -> Option<&mut (dyn MmioIntercept + 'static)>
§fn supports_pci(&mut self) -> Option<&mut (dyn PciConfigSpace + 'static)>
fn supports_pci(&mut self) -> Option<&mut (dyn PciConfigSpace + 'static)>
§fn supports_poll_device(&mut self) -> Option<&mut dyn PollDevice>
fn supports_poll_device(&mut self) -> Option<&mut dyn PollDevice>
§fn supports_handle_eoi(&mut self) -> Option<&mut dyn HandleEoi>
fn supports_handle_eoi(&mut self) -> Option<&mut dyn HandleEoi>
§fn supports_acknowledge_pic_interrupt(
&mut self,
) -> Option<&mut dyn AcknowledgePicInterrupt>
fn supports_acknowledge_pic_interrupt( &mut self, ) -> Option<&mut dyn AcknowledgePicInterrupt>
Source§impl InspectMut for PowerManagementDevice
impl InspectMut for PowerManagementDevice
Source§fn inspect_mut(&mut self, req: Request<'_>)
fn inspect_mut(&mut self, req: Request<'_>)
Source§impl LineInterruptTarget for PowerManagementDevice
impl LineInterruptTarget for PowerManagementDevice
Target for lines corresponding to bits in General Purpose Event Block 0.
For a full general description of this register, see the ACPI Spec. See section 4.7.1 in the ACPI 2.0 spec.