[−][src]Struct syscall::io::PhysBox
An RAII guard of a physical memory allocation. Currently all physically allocated memory are page-aligned and take up at least 4k of space (on x86_64).
Implementations
impl PhysBox
[src]
pub unsafe fn from_raw_parts(address: usize, size: usize) -> Self
[src]
Construct a PhysBox from an address and a size.
Safety
This function is unsafe because when dropping, Self has to a valid allocation.
pub fn address(&self) -> usize
[src]
Retrieve the byte address in physical memory, of this allocation.
pub fn size(&self) -> usize
[src]
Retrieve the size in bytes of the alloc.
pub fn new_in_32bit_space(size: usize) -> Result<Self>
[src]
Allocate physical memory that must reside in 32-bit space.
pub fn new_with_flags(size: usize, flags: PhysallocFlags) -> Result<Self>
[src]
pub fn new_partial_allocation(
size: usize,
flags: PhysallocFlags,
strategy: Option<PartialAllocStrategy>,
min: usize
) -> Result<Self>
[src]
size: usize,
flags: PhysallocFlags,
strategy: Option<PartialAllocStrategy>,
min: usize
) -> Result<Self>
"Partially" allocate physical memory, in the sense that the allocation may be smaller than expected, but still with a minimum limit. This is particularly useful when the physical memory space is fragmented, and a device supports scatter-gather I/O. In that case, the driver can optimistically request e.g. 1 alloc of 1 MiB, with the minimum of 512 KiB. If that first allocation only returns half the size, the driver can do another allocation and then let the device use both buffers.
pub fn new(size: usize) -> Result<Self>
[src]
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,