mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-18 03:56:42 +00:00
Use Dma APIs for virtio-block driver
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
d8a841f88a
commit
c3c6b0c19d
@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use aster_frame::vm::{DmaCoherent, DmaStream, HasDaddr};
|
||||
use aster_frame::vm::{DmaCoherent, DmaStream, DmaStreamSlice, HasDaddr};
|
||||
|
||||
/// A DMA-capable buffer.
|
||||
///
|
||||
@ -18,6 +18,12 @@ impl DmaBuf for DmaStream {
|
||||
}
|
||||
}
|
||||
|
||||
impl DmaBuf for DmaStreamSlice<'_> {
|
||||
fn len(&self) -> usize {
|
||||
self.nbytes()
|
||||
}
|
||||
}
|
||||
|
||||
impl DmaBuf for DmaCoherent {
|
||||
fn len(&self) -> usize {
|
||||
self.nbytes()
|
||||
|
Reference in New Issue
Block a user