From 2a3d8f3550d72fe90863a2ffea9dc87e307f60a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Wed, 15 Mar 2023 10:10:53 +0100 Subject: [PATCH] Exported macro init_system --- src/kernel/system.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/kernel/system.rs b/src/kernel/system.rs index b3cb768..3e526f3 100644 --- a/src/kernel/system.rs +++ b/src/kernel/system.rs @@ -4,6 +4,18 @@ use crate::simulator::machine::Machine; use super::thread_manager::ThreadManager; +/// This macro properly initializes the system +#[macro_export] +macro_rules! init_system { + () => {{ + let m = Machine::init_machine(); + init_system!(m) + }}; + ($a:expr) => {{ + System::new($a) + }}; +} + /// # System /// /// This structure represents the state of the threads running on the operating system. @@ -71,16 +83,6 @@ mod tests { use crate::{System, Machine}; - macro_rules! init_system { - () => {{ - let m = Machine::init_machine(); - init_system!(m) - }}; - ($a:expr) => {{ - System::new($a) - }}; - } - #[test] fn test_init_system() { init_system!();