Make unsafe more limited in memory initialization.
This commit is contained in:
parent
d35e8d253f
commit
4d94bc0ea8
|
@ -19,18 +19,17 @@ pub fn init_heap() {
|
|||
syscall::syscall(zion::kZionMemoryObjectCreate, &obj_req)
|
||||
.expect("Failed to create memory object");
|
||||
|
||||
unsafe {
|
||||
let mut vaddr: u64 = 0;
|
||||
let vmas_req = zion::ZAddressSpaceMapReq {
|
||||
vmmo_cap,
|
||||
vmas_cap: SELF_VMAS_CAP,
|
||||
vmas_cap: unsafe { SELF_VMAS_CAP },
|
||||
align: 0x2000,
|
||||
vaddr: &mut vaddr as *mut u64,
|
||||
vmas_offset: 0,
|
||||
};
|
||||
|
||||
syscall::syscall(zion::kZionAddressSpaceMap, &vmas_req)
|
||||
.expect("Failed to map memory object");
|
||||
syscall::syscall(zion::kZionAddressSpaceMap, &vmas_req).expect("Failed to map memory object");
|
||||
unsafe {
|
||||
ALLOCATOR.lock().init(vaddr as *mut u8, size as usize);
|
||||
CAN_ALLOC = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue