diff --git a/devices/src/virtio/interrupt.rs b/devices/src/virtio/interrupt.rs index 91a3942384..2568080d02 100644 --- a/devices/src/virtio/interrupt.rs +++ b/devices/src/virtio/interrupt.rs @@ -72,9 +72,15 @@ impl Interrupt { self.signal(self.config_msix_vector, INTERRUPT_STATUS_CONFIG_CHANGED) } - /// Handle interrupt resampling event + /// Handle interrupt resampling event, reading the value from the event and doing the resample. pub fn interrupt_resample(&self) { let _ = self.interrupt_resample_evt.read(); + self.do_interrupt_resample(); + } + + /// Read the status and write to the interrupt event. Don't read the resample event, assume the + /// resample has been requested. + pub fn do_interrupt_resample(&self) { if self.interrupt_status.load(Ordering::SeqCst) != 0 { self.interrupt_evt.write(1).unwrap(); }