mirror of
https://github.com/AmbiML/sparrow-kata-full.git
synced 2025-08-11 18:12:41 +00:00
Merge "kata-memory-manager: remove dead code"
GitOrigin-RevId: e6f4bd529b9f934e3488cc7c162b4f825511b0a4
This commit is contained in:
parent
6ee08d8b47
commit
173e7211c7
@ -50,7 +50,7 @@ const UNTYPED_SLAB_CAPACITY: usize = 64; // # slabs kept inline
|
|||||||
// TODO(sleffler): support device-backed memory objects
|
// TODO(sleffler): support device-backed memory objects
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct UntypedSlab {
|
struct UntypedSlab {
|
||||||
pub size_bits: usize, // NB: only used to sort
|
pub _size_bits: usize, // NB: only used to sort
|
||||||
pub free_bytes: usize, // Available space in slab
|
pub free_bytes: usize, // Available space in slab
|
||||||
pub _base_paddr: seL4_Word, // Physical address of slab start
|
pub _base_paddr: seL4_Word, // Physical address of slab start
|
||||||
pub _last_paddr: seL4_Word, // Physical address of slab end
|
pub _last_paddr: seL4_Word, // Physical address of slab end
|
||||||
@ -59,15 +59,13 @@ struct UntypedSlab {
|
|||||||
impl UntypedSlab {
|
impl UntypedSlab {
|
||||||
fn new(ut: &seL4_UntypedDesc, free_bytes: usize, cptr: seL4_CPtr) -> Self {
|
fn new(ut: &seL4_UntypedDesc, free_bytes: usize, cptr: seL4_CPtr) -> Self {
|
||||||
UntypedSlab {
|
UntypedSlab {
|
||||||
size_bits: ut.size_bits(),
|
_size_bits: ut.size_bits(),
|
||||||
free_bytes,
|
free_bytes,
|
||||||
_base_paddr: ut.paddr,
|
_base_paddr: ut.paddr,
|
||||||
_last_paddr: ut.paddr + (1 << ut.size_bits()),
|
_last_paddr: ut.paddr + (1 << ut.size_bits()),
|
||||||
cptr,
|
cptr,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn _size(&self) -> usize { l2tob(self.size_bits) }
|
|
||||||
fn size_bits(&self) -> usize { self.size_bits }
|
|
||||||
}
|
}
|
||||||
pub struct MemoryManager {
|
pub struct MemoryManager {
|
||||||
untypeds: SmallVec<[UntypedSlab; UNTYPED_SLAB_CAPACITY]>,
|
untypeds: SmallVec<[UntypedSlab; UNTYPED_SLAB_CAPACITY]>,
|
||||||
|
Loading…
Reference in New Issue
Block a user