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:
24
patches/tock/05-kernel-utility-method.patch
Normal file
24
patches/tock/05-kernel-utility-method.patch
Normal 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))
|
||||
Reference in New Issue
Block a user