[Yellowstone] Read init file from disk.
This commit is contained in:
parent
b880c11ac7
commit
8d3f77e648
4 changed files with 28 additions and 3 deletions
|
|
@ -4,6 +4,7 @@ use mammoth::{cap::Capability, zion::ZError};
|
|||
|
||||
pub struct File {
|
||||
memory: mammoth::mem::MemoryRegion,
|
||||
len: usize,
|
||||
}
|
||||
|
||||
impl File {
|
||||
|
|
@ -15,10 +16,11 @@ impl File {
|
|||
|
||||
Ok(Self {
|
||||
memory: mammoth::mem::MemoryRegion::from_cap(Capability::take(resp.memory))?,
|
||||
len: resp.size as usize,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn slice(&self) -> &[u8] {
|
||||
self.memory.slice()
|
||||
&self.memory.slice()[..self.len]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,3 +23,7 @@ fn get_client() -> &'static mut VFSClient {
|
|||
VFS_CLIENT.as_mut().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_client(client: VFSClient) {
|
||||
unsafe { VFS_CLIENT = Some(client) };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue