diff --git a/apps/system/components/DebugConsole/DebugConsole.camkes b/apps/system/components/DebugConsole/DebugConsole.camkes index 4435a78..1921837 100644 --- a/apps/system/components/DebugConsole/DebugConsole.camkes +++ b/apps/system/components/DebugConsole/DebugConsole.camkes @@ -34,7 +34,7 @@ component DebugConsole { provides LoggerInterface logger; uses MemoryInterface memory; - uses MlCoordinatorInterface mlcoord; + maybe uses MlCoordinatorInterface mlcoord; uses PackageManagementInterface pkg_mgmt; uses ProcessControlInterface proc_ctrl; // TODO(b/200707300): for debugging diff --git a/apps/system/components/DebugConsole/kata-shell/Cargo.toml b/apps/system/components/DebugConsole/kata-shell/Cargo.toml index 49208fe..78ce720 100644 --- a/apps/system/components/DebugConsole/kata-shell/Cargo.toml +++ b/apps/system/components/DebugConsole/kata-shell/Cargo.toml @@ -24,6 +24,7 @@ sel4-config = { path = "../../kata-os-common/src/sel4-config" } [features] default = [ + "ml_support", "TEST_GLOBAL_ALLOCATOR", "TEST_MAILBOX", "TEST_MEMORY_MANAGER", @@ -32,6 +33,7 @@ default = [ "TEST_SECURITY_COORDINATOR", "TEST_TIMER_SERVICE", ] +ml_support = ["kata-ml-interface"] CONFIG_DEBUG_BUILD = [] CONFIG_PRINTING = [] CONFIG_KERNEL_MCS = [] @@ -56,7 +58,7 @@ hex = { version = "0.4.3", default-features = false, features = ["alloc"] } kata-io = { path = "../kata-io" } kata-line-reader = { path = "../kata-line-reader" } kata-memory-interface = { path = "../../MemoryManager/kata-memory-interface" } -kata-ml-interface = { path = "../../MlCoordinator/kata-ml-interface" } +kata-ml-interface = { path = "../../MlCoordinator/kata-ml-interface", optional = true } kata-proc-interface = { path = "../../ProcessManager/kata-proc-interface" } kata-os-common = { path = "../../kata-os-common" } kata-security-interface = { path = "../../SecurityCoordinator/kata-security-interface" } diff --git a/apps/system/components/DebugConsole/kata-shell/src/lib.rs b/apps/system/components/DebugConsole/kata-shell/src/lib.rs index f2f9df8..6163ca5 100644 --- a/apps/system/components/DebugConsole/kata-shell/src/lib.rs +++ b/apps/system/components/DebugConsole/kata-shell/src/lib.rs @@ -24,6 +24,7 @@ use hashbrown::HashMap; use kata_io as io; use kata_line_reader::LineReader; use kata_memory_interface::*; +#[cfg(feature = "ml_support")] use kata_ml_interface::*; use kata_os_common::sel4_sys; use kata_os_common::slot_allocator; @@ -50,7 +51,7 @@ mod fringe_cmds; mod test_global_allocator; #[cfg(feature = "TEST_MEMORY_MANAGER")] mod test_memory_manager; -#[cfg(feature = "TEST_ML_COORDINATOR")] +#[cfg(all(feature = "ml_support", feature = "TEST_ML_COORDINATOR"))] mod test_ml_coordinator; #[cfg(feature = "TEST_PANIC")] mod test_panic; @@ -131,15 +132,16 @@ pub fn repl(output: &mut dyn io::Write, input: &mut T, builtin_c ("start", start_command as CmdFn), ("stop", stop_command as CmdFn), ("uninstall", uninstall_command as CmdFn), - ("state_mlcoord", state_mlcoord_command as CmdFn), ]); + #[cfg(feature = "ml_support")] + cmds.extend([("state_mlcoord", state_mlcoord_command as CmdFn)]); #[cfg(feature = "FRINGE_CMDS")] fringe_cmds::add_cmds(&mut cmds); #[cfg(feature = "TEST_GLOBAL_ALLOCATOR")] test_global_allocator::add_cmds(&mut cmds); #[cfg(feature = "TEST_MEMORY_MANAGER")] test_memory_manager::add_cmds(&mut cmds); - #[cfg(feature = "TEST_ML_COORDINATOR")] + #[cfg(all(feature = "ml_support", feature = "TEST_ML_COORDINATOR"))] test_ml_coordinator::add_cmds(&mut cmds); #[cfg(feature = "TEST_PANIC")] test_panic::add_cmds(&mut cmds); @@ -285,6 +287,7 @@ fn capscan_command( Some("process") => { let _ = kata_proc_interface::kata_proc_ctrl_capscan(); } + #[cfg(feature = "ml_support")] Some("mlcoord") => { let _ = kata_mlcoord_capscan(); } @@ -307,6 +310,7 @@ fn capscan_command( writeln!(output, " console (DebugConsole)")?; writeln!(output, " memory (MemoryManager)")?; writeln!(output, " process (ProcessManager)")?; + #[cfg(feature = "ml_support")] writeln!(output, " mlcoord (MlCoordinator)")?; writeln!(output, " sdk (SDKRuntime)")?; writeln!(output, " securiy (SecurityCoordinator)")?; @@ -578,6 +582,7 @@ fn mstats_command( Ok(()) } +#[cfg(feature = "ml_support")] fn state_mlcoord_command( _args: &mut dyn Iterator, _input: &mut dyn io::BufRead,