PhysAllocator

Struct PhysAllocator 

Source
pub struct PhysAllocator {
    segs: Vec<PhysSeg>,
    nfree: usize,
    lookup_lists: [Arc<Mutex<[[[IndexSet<Arc<VmPage>, FxBuildHasher>; 13]; 3]; 2]>>; 2],
}
Expand description

Provides methods to allocate physical memory.

Fields§

§segs: Vec<PhysSeg>§nfree: usize§lookup_lists: [Arc<Mutex<[[[IndexSet<Arc<VmPage>, FxBuildHasher>; 13]; 3]; 2]>>; 2]

Implementations§

Source§

impl PhysAllocator

Source

pub fn new(phys_avail: &[u64; 61], ma: Option<&MemAffinity>) -> Self

See vm_phys_init on the Orbis for a reference.

§Reference offsets
VersionOffset
PS4 11.000x15F410
Source

pub fn segment(&self, i: usize) -> &PhysSeg

§Panics

If i is not valid.

Source

pub fn segment_index(&self, pa: u64) -> Option<usize>

See vm_phys_paddr_to_segind on the Orbis for a reference. Our implementation is a bit differences here. Orbis will panic if segment not found but we return None instead.

§Reference offsets
VersionOffset
PS4 11.000x15FC40
Source

pub fn alloc_page( &self, pages: &[Arc<VmPage>], vm: usize, pool: usize, order: usize, ) -> Option<Arc<VmPage>>

See vm_phys_alloc_pages on the Orbis for a reference.

§Reference offsets
VersionOffset
PS4 11.000x160520
Source

fn alloc_freelist( &self, pages: &[Arc<VmPage>], list: &mut [[IndexSet<Arc<VmPage>, FxBuildHasher>; 13]; 3], pool: usize, order: usize, ) -> Option<Arc<VmPage>>

See vm_phys_alloc_freelist_pages on the Orbis for a reference.

§Reference offsets
VersionOffset
PS4 11.000x1605D0
Source

fn create_seg( segs: &mut Vec<PhysSeg>, ma: Option<&MemAffinity>, queues: &[Arc<Mutex<[[[IndexSet<Arc<VmPage>, FxBuildHasher>; 13]; 3]; 2]>>; 2], start: u64, end: u64, flind: usize, )

See vm_phys_create_seg on the Orbis for a reference.

§Reference offsets
VersionOffset
PS4 11.000x15F8A0

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.