pub struct Rtc { /* private fields */ }
Expand description
CMOS RTC device
Implementations§
Source§impl Rtc
impl Rtc
Sourcepub fn new(
real_time_source: Box<dyn InspectableLocalClock>,
interrupt: LineInterrupt,
vmtime_source: &VmTimeSource,
century_reg_idx: u8,
initial_cmos: Option<[u8; 256]>,
enlightened_interrupts: bool,
) -> Self
pub fn new( real_time_source: Box<dyn InspectableLocalClock>, interrupt: LineInterrupt, vmtime_source: &VmTimeSource, century_reg_idx: u8, initial_cmos: Option<[u8; 256]>, enlightened_interrupts: bool, ) -> Self
Create a new CMOS RTC device
century_reg_idx
sets which byte of CMOS RAM to use as the century
byte. This index is not standard between different platforms. e.g: on
modern x86 platforms, the presence / index of the century register is
determined by an entry in the FADT ACPI table.
If enlightened_interrupts
, then whenever a timer expires and the
interrupt line would be set, pulse the interrupt line low then high to
ensure an interrupt is delivered. This is used by older Windows guests
to allow them to skip an extra PIO exit to clear the status C register.
This behavior is indicated to the guest via an appropriate flag is set
in the WAET ACPI table. See Windows ACPI Emulated Devices Table.
Sourcepub fn raw_cmos(&mut self) -> &mut [u8; 256]
pub fn raw_cmos(&mut self) -> &mut [u8; 256]
(for use by wrapper devices) reference to the raw underlying CMOS data
Sourcepub fn set_cmos_byte(&mut self, addr: u8, data: u8)
pub fn set_cmos_byte(&mut self, addr: u8, data: u8)
Directly write a byte in the CMOS.
This method is marked pub
to in order to implement wrapper devices
that inject platform-specific CMOS memory contents. e.g: the AMI RTC
device.
Sourcepub fn get_cmos_byte(&mut self, addr: u8) -> u8
pub fn get_cmos_byte(&mut self, addr: u8) -> u8
Directly read a byte in the CMOS.
This method is marked pub
to in order to implement wrapper devices
that inject platform-specific CMOS memory contents. e.g: the AMI RTC
device.