chipset::cmos_rtc

Struct Rtc

Source
pub struct Rtc { /* private fields */ }
Expand description

CMOS RTC device

Implementations§

Source§

impl Rtc

Source

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.

Source

pub fn raw_cmos(&mut self) -> &mut [u8; 256]

(for use by wrapper devices) reference to the raw underlying CMOS data

Source

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.

Source

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.

Trait Implementations§

Source§

impl ChangeDeviceState for Rtc

Source§

fn start(&mut self)

Starts a device, allowing it to interact with the guest asynchronously. Read more
Source§

async fn stop(&mut self)

Stops a device’s asynchronous work. Read more
Source§

async fn reset(&mut self)

Resets the device state to its initial state, for a fresh boot. Read more
Source§

impl ChipsetDevice for Rtc

Source§

fn supports_pio(&mut self) -> Option<&mut dyn PortIoIntercept>

Optionally returns a trait object to send IO port intercepts to.
Source§

fn supports_poll_device(&mut self) -> Option<&mut dyn PollDevice>

Optionally returns a trait object to send poll requests to.
§

fn supports_mmio(&mut self) -> Option<&mut (dyn MmioIntercept + 'static)>

Optionally returns a trait object to send MMIO port intercepts to.
§

fn supports_pci(&mut self) -> Option<&mut (dyn PciConfigSpace + 'static)>

Optionally returns a trait object to send PCI config space accesses to.
§

fn supports_line_interrupt_target( &mut self, ) -> Option<&mut dyn LineInterruptTarget>

Optionally returns a trait object to send interrupt line changes to.
§

fn supports_handle_eoi(&mut self) -> Option<&mut dyn HandleEoi>

Optionally returns a trait object to send EOI requests to.
§

fn supports_acknowledge_pic_interrupt( &mut self, ) -> Option<&mut dyn AcknowledgePicInterrupt>

Optionally returns a trait object with which to acknowledge PIC interrupts.
Source§

impl InspectMut for Rtc

Source§

fn inspect_mut(&mut self, req: Request<'_>)

Inspects the object.
Source§

impl PollDevice for Rtc

Source§

fn poll_device(&mut self, cx: &mut Context<'_>)

Poll the device for asynchronous work. Read more
Source§

impl PortIoIntercept for Rtc

Source§

fn io_read(&mut self, io_port: u16, data: &mut [u8]) -> IoResult

Dispatch an IO port read to the device with the given address.
Source§

fn io_write(&mut self, io_port: u16, data: &[u8]) -> IoResult

Dispatch an IO port write to the device with the given address.
Source§

fn get_static_regions(&mut self) -> &[(&str, RangeInclusive<u16>)]

Report a set of static io port regions (region_name, port_range) that cannot be remapped at runtime and are always registered. Read more
Source§

impl SaveRestore for Rtc

Source§

type SavedState = SavedState

The concrete saved state type.
Source§

fn save(&mut self) -> Result<Self::SavedState, SaveError>

Saves the object’s state.
Source§

fn restore(&mut self, state: Self::SavedState) -> Result<(), RestoreError>

Restores the object’s state.

Auto Trait Implementations§

§

impl Freeze for Rtc

§

impl !RefUnwindSafe for Rtc

§

impl Send for Rtc

§

impl !Sync for Rtc

§

impl Unpin for Rtc

§

impl !UnwindSafe for Rtc

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ProtobufSaveRestore for T
where T: SaveRestore, <T as SaveRestore>::SavedState: 'static + Send + SavedStateRoot,

§

fn save(&mut self) -> Result<SavedStateBlob, SaveError>

Save the object.
§

fn restore(&mut self, state: SavedStateBlob) -> Result<(), RestoreError>

Restore the object.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more