diff --git a/xous-rs/src/definitions.rs b/xous-rs/src/definitions.rs index 8213b7a75..f8a6ddb0c 100644 --- a/xous-rs/src/definitions.rs +++ b/xous-rs/src/definitions.rs @@ -783,7 +783,7 @@ pub enum Result { /// The syscall should be attempted again. This is returned when calling /// functions such as `try_connect()` and `try_send()` that may block. - WouldBlock, + RetryCall, /// The message was successful but no value was returned. None, @@ -838,7 +838,7 @@ impl Result { 0, ] } - Result::WouldBlock => [16, 0, 0, 0, 0, 0, 0, 0], + Result::RetryCall => [16, 0, 0, 0, 0, 0, 0, 0], Result::None => [17, 0, 0, 0, 0, 0, 0, 0], Result::MemoryReturned(offset, valid) => [ 18, @@ -923,7 +923,7 @@ impl Result { SID::from_u32(src[1] as _, src[2] as _, src[3] as _, src[4] as _), src[5] as _, ), - 16 => Result::WouldBlock, + 16 => Result::RetryCall, 17 => Result::None, 18 => Result::MemoryReturned(MemorySize::new(src[1]), MemorySize::new(src[2])), _ => Result::UnknownResult(src[0], src[1], src[2], src[3], src[4], src[5], src[6]), diff --git a/xous-rs/src/definitions/atomic.rs b/xous-rs/src/definitions/atomic.rs new file mode 100644 index 000000000..17edc87fd --- /dev/null +++ b/xous-rs/src/definitions/atomic.rs @@ -0,0 +1,18 @@ +pub enum AtomicOperation { + /// Lock the mutex at the given address. If the Mutex is locked, this + /// thread will block. + MutexLock(usize /* Address */), + + /// Unlock the mutex at the given address. If arg 2 is `true`, then + /// the next thread that is waiting on this Mutex will be activated. + /// This can be used to prevent deadlocks. If no thread is waiting, + /// then no thread switch is made and execution resumes in the current + /// thread. + MutexUnlock(usize /* Address */, bool /* Should Switch Immediately */), + + + CondvarWait(usize /* Address */), + CondvarWaitTimeout(usize /* Address */, usize /* Timeout (ms) */), + CondvarNotifyOne(usize /* Address */), + CondvarNotifyAll(usize /* Address */), +} \ No newline at end of file