From 06868b516f599e27b60d3944f56bbb4e8f09b2ba Mon Sep 17 00:00:00 2001 From: able Date: Mon, 26 Jun 2023 18:42:55 -0500 Subject: [PATCH] fix compile error --- kernel/src/scheduler.rs | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/kernel/src/scheduler.rs b/kernel/src/scheduler.rs index 4b685264..6543e6c7 100644 --- a/kernel/src/scheduler.rs +++ b/kernel/src/scheduler.rs @@ -1,25 +1,22 @@ -use { - crate::host::TrapHandler, - alloc::vec::Vec, - hbvm::{validate::validate, vm::Vm}, -}; +use {crate::host::TrapHandler, alloc::vec::Vec, hbvm::vm::Vm}; pub struct Scheduler<'a> { data: Vec>, } impl Scheduler<'_> { - fn new_process(&mut self, program: Vec) { - #[allow(clippy::redundant_else)] - if let Err(e) = validate(&program) { - log::error!("Program validation error: {e:?}"); - } else { - log::info!("valid program"); - unsafe { - let mut vm = Vm::new_unchecked(&program, TrapHandler); - vm.memory.insert_test_page(); - self.data.push(vm); - } - } - } + // fn new_process(&mut self, program: Vec) { + // let prog = program.clone(); + // #[allow(clippy::redundant_else)] + // if let Err(e) = validate(&prog) { + // log::error!("Program validation error: {e:?}"); + // } else { + // log::info!("valid program"); + // unsafe { + // let mut vm = Vm::new_unchecked(&prog, TrapHandler); + // vm.memory.insert_test_page(); + // self.data.push(vm); + // } + // } + // } }