diff --git a/src/arch/x86_64/memory/mod.rs b/src/arch/x86_64/memory/mod.rs index c05ce04..23d6d05 100644 --- a/src/arch/x86_64/memory/mod.rs +++ b/src/arch/x86_64/memory/mod.rs @@ -79,6 +79,8 @@ pub trait FrameAllocator { pub fn init(boot_info: &BootInformation) { + assert_first_call!("memory::init() can only be called once!"); + let memory_map_tag = boot_info.memory_map_tag() .expect("multiboot: Memory map tag required"); let elf_sections_tag = boot_info.elf_sections_tag() diff --git a/src/lib.rs b/src/lib.rs index caa5899..389c589 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,6 +7,8 @@ #[macro_use] extern crate log; +#[macro_use] +extern crate once; extern crate rlibc; extern crate spin; extern crate volatile;