cleanups
This commit is contained in:
parent
43f5f9196a
commit
ea8f2106b6
|
@ -7,6 +7,7 @@ use x86_64::{
|
||||||
},
|
},
|
||||||
VirtAddr,
|
VirtAddr,
|
||||||
};
|
};
|
||||||
|
use crate::{println};
|
||||||
|
|
||||||
pub struct Dummy;
|
pub struct Dummy;
|
||||||
|
|
||||||
|
@ -21,12 +22,13 @@ unsafe impl GlobalAlloc for Dummy {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const HEAP_START: usize = 0x_4444_4444_0000;
|
pub const HEAP_START: usize = 0x_4444_4444_0000;
|
||||||
pub const HEAP_SIZE: usize = 32 * 1024 * 1024; // 32 MiB
|
pub const HEAP_SIZE: usize = 4 * 1024 * 1024; // 4 MiB
|
||||||
|
|
||||||
pub fn init_heap(
|
pub fn init_heap(
|
||||||
mapper: &mut impl Mapper<Size4KiB>,
|
mapper: &mut impl Mapper<Size4KiB>,
|
||||||
frame_allocator: &mut impl FrameAllocator<Size4KiB>,
|
frame_allocator: &mut impl FrameAllocator<Size4KiB>,
|
||||||
) -> Result<(), MapToError> {
|
) -> Result<(), MapToError> {
|
||||||
|
println!("creating heap");
|
||||||
let page_range = {
|
let page_range = {
|
||||||
let heap_start = VirtAddr::new(HEAP_START as u64);
|
let heap_start = VirtAddr::new(HEAP_START as u64);
|
||||||
let heap_end = heap_start + HEAP_SIZE - 1u64;
|
let heap_end = heap_start + HEAP_SIZE - 1u64;
|
||||||
|
@ -47,6 +49,7 @@ pub fn init_heap(
|
||||||
super::ALLOCATOR.lock().init(HEAP_START, HEAP_SIZE);
|
super::ALLOCATOR.lock().init(HEAP_START, HEAP_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
println!("heap created");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
src/hack.rs
14
src/hack.rs
|
@ -1,20 +1,20 @@
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
extern "C" fn fmod(x: f64, _y: f64) -> f64 { x }
|
extern "C" fn fmod(x: f64, _y: f64) -> f64 { unimplemented!(); }
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
extern "C" fn fmodf(x: f32, _y: f32) -> f32 { x }
|
extern "C" fn fmodf(x: f32, _y: f32) -> f32 { unimplemented!(); }
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
extern "C" fn fmin(x: f64, _y: f64) -> f64 { x }
|
extern "C" fn fmin(x: f64, _y: f64) -> f64 { unimplemented!(); }
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
extern "C" fn fminf(x: f32, _y: f32) -> f32 { x }
|
extern "C" fn fminf(x: f32, _y: f32) -> f32 { unimplemented!(); }
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
extern "C" fn fmax(x: f64, _y: f64) -> f64 { x }
|
extern "C" fn fmax(x: f64, _y: f64) -> f64 { unimplemented!(); }
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
extern "C" fn fmaxf(x: f32, _y: f32) -> f32 { x }
|
extern "C" fn fmaxf(x: f32, _y: f32) -> f32 { unimplemented!(); }
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
extern "C" fn __truncdfsf2(x: f64) -> f32 { 0.0 }
|
extern "C" fn __truncdfsf2(x: f64) -> f32 { unimplemented!(); }
|
||||||
|
|
Loading…
Reference in New Issue