Skip to content

Commit

Permalink
feat(virtio-blk): add interrupt enable and disable function for virti…
Browse files Browse the repository at this point in the history
…o-blk (#133)
  • Loading branch information
fslongjin authored May 2, 2024
1 parent 191d9b8 commit 442c6e0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/device/blk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ impl<H: Hal, T: Transport> VirtIOBlk<H, T> {
self.transport.ack_interrupt()
}

/// Enables interrupts from the device.
pub fn enable_interrupts(&mut self) {
self.queue.set_dev_notify(true);
}

/// Disables interrupts from the device.
pub fn disable_interrupts(&mut self) {
self.queue.set_dev_notify(false);
}

/// Sends the given request to the device and waits for a response, with no extra data.
fn request(&mut self, request: BlkReq) -> Result {
let mut resp = BlkResp::default();
Expand Down

0 comments on commit 442c6e0

Please sign in to comment.