mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
kernel: services: minor documentation improvements
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
cfe7c4a3bc
commit
da2036a182
1 changed files with 7 additions and 5 deletions
|
|
@ -317,10 +317,8 @@ impl SystemServices {
|
||||||
pid: PID,
|
pid: PID,
|
||||||
context: CtxID,
|
context: CtxID,
|
||||||
) -> Result<(), xous::Error> {
|
) -> Result<(), xous::Error> {
|
||||||
// Get the current process (which was just interrupted) and mark it as
|
// Get the current process (which was the interrupt handler) and mark it
|
||||||
// "ready to run". If this function is called when the current process
|
// as Ready. Note that the new PID may very well be the same PID.
|
||||||
// isn't running, that means the system has gotten into an invalid
|
|
||||||
// state.
|
|
||||||
{
|
{
|
||||||
let current_pid = self.current_pid();
|
let current_pid = self.current_pid();
|
||||||
let mut current = self
|
let mut current = self
|
||||||
|
|
@ -337,9 +335,13 @@ impl SystemServices {
|
||||||
// is in a very bad state.
|
// is in a very bad state.
|
||||||
{
|
{
|
||||||
let mut process = self.get_process_mut(pid)?;
|
let mut process = self.get_process_mut(pid)?;
|
||||||
|
// Ensure the new context is available to be run
|
||||||
let available_contexts = match process.state {
|
let available_contexts = match process.state {
|
||||||
ProcessState::Ready(x) if x & 1 << context != 0 => x & !(1 << context),
|
ProcessState::Ready(x) if x & 1 << context != 0 => x & !(1 << context),
|
||||||
other => panic!("process was in an invalid state"),
|
other => panic!(
|
||||||
|
"process was in an invalid state {:?} -- ctxid {} not available to run",
|
||||||
|
other, context
|
||||||
|
),
|
||||||
};
|
};
|
||||||
process.state = ProcessState::Running(available_contexts);
|
process.state = ProcessState::Running(available_contexts);
|
||||||
process.current_context = context as u8;
|
process.current_context = context as u8;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue