mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
xous: add can_call_from_interrupt() to SysCall
This function can be used to determine if a particular syscall may be called from an interrupt context. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
719549a2cb
commit
bb304d412a
1 changed files with 10 additions and 0 deletions
|
|
@ -847,6 +847,16 @@ impl SysCall {
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns `true` if the given syscall may be called from an IRQ context
|
||||||
|
pub fn can_call_from_interrupt(&self) -> bool {
|
||||||
|
matches!(self, SysCall::TrySendMessage(_, _)
|
||||||
|
| SysCall::TryConnect(_)
|
||||||
|
| SysCall::ReturnToParent(_, _)
|
||||||
|
| SysCall::ReturnScalar2(_, _, _)
|
||||||
|
| SysCall::ReturnScalar1(_, _)
|
||||||
|
| SysCall::ReturnMemory(_, _))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "Rust" {
|
extern "Rust" {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue