Remove StorageManager capsule from the Tock tree, it's in sw/matcha now. Change-Id: Id2d8ff50f9c2d45d9d477802817d507b5563022c
diff --git a/Cargo.toml b/Cargo.toml index 4970e92..f96b11d 100644 --- a/Cargo.toml +++ b/Cargo.toml
@@ -17,7 +17,6 @@ "boards/nucleo_f429zi", "boards/nucleo_f446re", "boards/opentitan", - "boards/opentitan-matcha", "boards/redboard_artemis_nano", "boards/stm32f3discovery", "boards/stm32f412gdiscovery", @@ -28,7 +27,6 @@ "chips/e310x", "chips/earlgrey", "chips/lowrisc", - "chips/matcha", "chips/msp432", "chips/nrf52", "chips/nrf52832",
diff --git a/capsules/src/lib.rs b/capsules/src/lib.rs index 1b32616..da6bf36 100644 --- a/capsules/src/lib.rs +++ b/capsules/src/lib.rs
@@ -79,4 +79,3 @@ pub mod virtual_spi; pub mod virtual_timer; pub mod virtual_uart; -pub mod storage_manager;
diff --git a/capsules/src/storage_manager.rs b/capsules/src/storage_manager.rs deleted file mode 100644 index f2dca56..0000000 --- a/capsules/src/storage_manager.rs +++ /dev/null
@@ -1,128 +0,0 @@ -use crate::driver; -use kernel::debug; -use kernel::{AppId, AppSlice, Callback, Driver, Grant, ReturnCode, Shared}; - -// 0x50003 -pub const DRIVER_NUM: usize = driver::NUM::StorageManager as usize; - -#[derive(Default)] -pub struct AppData { - pub callback: Option<Callback>, - pub buffer: Option<AppSlice<Shared, u8>>, - pub minor_num: usize, - pub arg2: usize, - pub arg3: usize, -} - -/// Stub StorageManager implementation doesn't do anything yet. - -pub struct StorageManager { - app_data_grant: Grant<AppData>, -} - -impl StorageManager { - pub fn new(app_data_grant: Grant<AppData>) -> Self { - debug!("StorageManager::new()"); - return StorageManager { - app_data_grant: app_data_grant, - }; - } - - pub fn handle_command( - &self, - app_data: &mut AppData, - minor_num: usize, - arg2: usize, - arg3: usize, - ) -> ReturnCode { - debug!("StorageManager::handle_command({}, {}, {})", minor_num, arg2, arg3); - app_data.minor_num = minor_num; - app_data.arg2 = arg2; - app_data.arg3 = arg3; - match minor_num { - 0 => ReturnCode::SUCCESS, - 1 => { - if let Some(mut callback) = app_data.callback { - debug!("StorageManager::handle_command : Calling callback!"); - callback.schedule(1, 2, 3); - app_data.callback = Some(callback); - ReturnCode::SUCCESS - } - else { - debug!("StorageManager::handle_command : No callback!"); - ReturnCode::EINVAL - } - } - _ => ReturnCode::EINVAL, - } - } - - pub fn handle_subscribe( - &self, - app_data: &mut AppData, - minor_num: usize, - callback: Option<Callback>, - ) -> ReturnCode { - debug!("StorageManager::handle_subscribe({})", minor_num); - if callback.is_some() { - debug!("StorageManager::handle_subscribe got Some callback"); - } - else { - debug!("StorageManager::handle_subscribe got None callback"); - } - app_data.callback = callback; - return ReturnCode::SUCCESS; - } - - pub fn handle_allow( - &self, - app_data: &mut AppData, - _minor_num: usize, - slice: Option<AppSlice<Shared, u8>>, - ) -> ReturnCode { - if let Some(slice) = slice { - debug!("StorageManager::handle_allow({})", slice.len()); - app_data.buffer = Some(slice); - } - else { - debug!("StorageManager::handle_allow(None)"); - } - return ReturnCode::SUCCESS; - } -} - -/// Driver impl just enters the app_data grant and delegates to StorageManager. - -impl Driver for StorageManager { - fn subscribe(&self, minor_num: usize, callback: Option<Callback>, app_id: AppId) -> ReturnCode { - self - .app_data_grant - .enter(app_id, |app_data, _| { - self.handle_subscribe(app_data, minor_num, callback) - }) - .unwrap_or_else(|err| err.into()) - } - - fn command(&self, minor_num: usize, r2: usize, r3: usize, app_id: AppId) -> ReturnCode { - self - .app_data_grant - .enter(app_id, |app_data, _| { - self.handle_command(app_data, minor_num, r2, r3) - }) - .unwrap_or_else(|err| err.into()) - } - - fn allow( - &self, - app_id: AppId, - minor_num: usize, - slice: Option<AppSlice<Shared, u8>>, - ) -> ReturnCode { - self - .app_data_grant - .enter(app_id, |app_data, _| { - self.handle_allow(app_data, minor_num, slice) - }) - .unwrap_or_else(|err| err.into()) - } -}