Tock V2 port - rebased and updated (#620)

* Changes from #580

* fixes USB cancel panic

* style fixes

* Update src/env/tock/storage.rs

Co-authored-by: Zach Halvorsen <zhalvorsen@google.com>

---------

Co-authored-by: Zach Halvorsen <zhalvorsen@google.com>
This commit is contained in:
kaczmarczyck
2023-05-05 09:55:16 +02:00
committed by GitHub
parent 645c1ba3a7
commit f25cdd6acc
78 changed files with 4079 additions and 4699 deletions

View File

@@ -0,0 +1,24 @@
diff --git a/kernel/src/syscall_driver.rs b/kernel/src/syscall_driver.rs
index 0e2943fe4..3b5b42486 100644
--- a/kernel/src/syscall_driver.rs
+++ b/kernel/src/syscall_driver.rs
@@ -102,6 +102,19 @@ impl CommandReturn {
self.0
}
+ /// Check whether the inner `SyscallReturn` value is successful
+ pub fn is_success(&self) -> bool {
+ matches!(
+ self.0,
+ SyscallReturn::Success
+ | SyscallReturn::SuccessU32(_)
+ | SyscallReturn::SuccessU32U32(_, _)
+ | SyscallReturn::SuccessU32U32U32(_, _, _)
+ | SyscallReturn::SuccessU32U64(_, _)
+ | SyscallReturn::SuccessU64(_)
+ )
+ }
+
/// Command error
pub fn failure(rc: ErrorCode) -> Self {
CommandReturn(SyscallReturn::Failure(rc))