From ea8f2106b6a7b80dbc7f2a0296ab11eccc2eb658 Mon Sep 17 00:00:00 2001 From: Within Date: Thu, 24 Oct 2019 09:47:09 -0400 Subject: [PATCH] cleanups --- src/allocator.rs | 5 ++++- src/hack.rs | 14 +++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/allocator.rs b/src/allocator.rs index a983c77..5891a73 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -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, frame_allocator: &mut impl FrameAllocator, ) -> 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(()) } diff --git a/src/hack.rs b/src/hack.rs index 30a7868..21a3427 100644 --- a/src/hack.rs +++ b/src/hack.rs @@ -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!(); }