mirror of
https://github.com/AmbiML/sparrow-kata-full.git
synced 2025-04-27 10:31:31 +00:00
kata-shell: make ml support optional
The "ml_support" feature controls MlCoordinator commands are included. The "TEST_ML_COORDINATOR" feature is now dependent on "ml_support". Change-Id: I13e3e0b467f006a564bb2cf4839a11ab8a1b04c8 GitOrigin-RevId: 133e8842848c73644e593ebfd4c9115fde1afd3b
This commit is contained in:
parent
a9901bfff9
commit
bf2be62e71
@ -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
|
||||
|
@ -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" }
|
||||
|
@ -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<T: io::BufRead>(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<Item = &str>,
|
||||
_input: &mut dyn io::BufRead,
|
||||
|
Loading…
Reference in New Issue
Block a user