This commit is contained in:
Cadey Ratio 2019-10-24 09:47:09 -04:00
parent 43f5f9196a
commit ea8f2106b6
2 changed files with 11 additions and 8 deletions

View File

@ -7,6 +7,7 @@ use x86_64::{
},
VirtAddr,
};
use crate::{println};
pub struct Dummy;
@ -21,12 +22,13 @@ unsafe impl GlobalAlloc for Dummy {
}
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(
mapper: &mut impl Mapper<Size4KiB>,
frame_allocator: &mut impl FrameAllocator<Size4KiB>,
) -> Result<(), MapToError> {
println!("creating heap");
let page_range = {
let heap_start = VirtAddr::new(HEAP_START as u64);
let heap_end = heap_start + HEAP_SIZE - 1u64;
@ -47,6 +49,7 @@ pub fn init_heap(
super::ALLOCATOR.lock().init(HEAP_START, HEAP_SIZE);
}
println!("heap created");
Ok(())
}

View File

@ -1,20 +1,20 @@
#[no_mangle]
extern "C" fn fmod(x: f64, _y: f64) -> f64 { x }
extern "C" fn fmod(x: f64, _y: f64) -> f64 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmodf(x: f32, _y: f32) -> f32 { x }
extern "C" fn fmodf(x: f32, _y: f32) -> f32 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmin(x: f64, _y: f64) -> f64 { x }
extern "C" fn fmin(x: f64, _y: f64) -> f64 { unimplemented!(); }
#[no_mangle]
extern "C" fn fminf(x: f32, _y: f32) -> f32 { x }
extern "C" fn fminf(x: f32, _y: f32) -> f32 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmax(x: f64, _y: f64) -> f64 { x }
extern "C" fn fmax(x: f64, _y: f64) -> f64 { unimplemented!(); }
#[no_mangle]
extern "C" fn fmaxf(x: f32, _y: f32) -> f32 { x }
extern "C" fn fmaxf(x: f32, _y: f32) -> f32 { unimplemented!(); }
#[no_mangle]
extern "C" fn __truncdfsf2(x: f64) -> f32 { 0.0 }
extern "C" fn __truncdfsf2(x: f64) -> f32 { unimplemented!(); }