From 799c1c3822df29fc5ef4f957d19c88a53a73ab79 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 22 Sep 2020 21:19:37 +0800 Subject: [PATCH] xous: definitions: add Scalar1 and Scalar2 return values These return values can be used to return something other than "Success" from a blocking call. Signed-off-by: Sean Cross --- xous-rs/src/definitions.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xous-rs/src/definitions.rs b/xous-rs/src/definitions.rs index f61817b61..2df8c6468 100644 --- a/xous-rs/src/definitions.rs +++ b/xous-rs/src/definitions.rs @@ -422,6 +422,12 @@ pub enum Result { /// The process is blocked and should perform the read() again BlockedProcess, + /// A scalar with one value + Scalar1(usize), + + /// A scalar with two values + Scalar2(usize, usize), + UnknownResult(usize, usize, usize, usize, usize, usize, usize), } @@ -451,6 +457,8 @@ impl Result { Result::ProcessID(pid) => [10, pid.get() as _, 0, 0, 0, 0, 0, 0], Result::Unimplemented => [11, 0, 0, 0, 0, 0, 0, 0], Result::BlockedProcess => [12, 0, 0, 0, 0, 0, 0, 0], + Result::Scalar1(a) => [13, *a, 0, 0, 0, 0, 0, 0], + Result::Scalar2(a, b) => [14, *a, *b, 0, 0, 0, 0, 0], Result::UnknownResult(arg1, arg2, arg3, arg4, arg5, arg6, arg7) => { [usize::MAX, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7] } @@ -512,6 +520,8 @@ impl Result { 10 => Result::ProcessID(PID::new(src[1] as _).unwrap()), 11 => Result::Unimplemented, 12 => Result::BlockedProcess, + 13 => Result::Scalar1(src[1]), + 14 => Result::Scalar2(src[1], src[2]), _ => Result::UnknownResult(src[0], src[1], src[2], src[3], src[4], src[5], src[6]), } }