mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-19 20:46:35 +00:00
Implement a new set of physical page APIs
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
6e1c36965a
commit
cdac59beda
@ -34,10 +34,10 @@ impl TxBuffer {
|
||||
let dma_stream = if let Some(stream) = pool.lock().pop_front() {
|
||||
stream
|
||||
} else {
|
||||
let segment = FrameAllocOptions::new(TX_BUFFER_LEN / PAGE_SIZE)
|
||||
.alloc_contiguous()
|
||||
let segment = FrameAllocOptions::new()
|
||||
.alloc_segment(TX_BUFFER_LEN / PAGE_SIZE)
|
||||
.unwrap();
|
||||
DmaStream::map(segment, DmaDirection::ToDevice, false).unwrap()
|
||||
DmaStream::map(segment.into(), DmaDirection::ToDevice, false).unwrap()
|
||||
};
|
||||
|
||||
let tx_buffer = {
|
||||
|
@ -152,9 +152,9 @@ impl DmaPage {
|
||||
pool: Weak<DmaPool>,
|
||||
) -> Result<Self, ostd::Error> {
|
||||
let dma_stream = {
|
||||
let segment = FrameAllocOptions::new(1).alloc_contiguous()?;
|
||||
let segment = FrameAllocOptions::new().alloc_segment(1)?;
|
||||
|
||||
DmaStream::map(segment, direction, is_cache_coherent)
|
||||
DmaStream::map(segment.into(), direction, is_cache_coherent)
|
||||
.map_err(|_| ostd::Error::AccessDenied)?
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user