Skip to content
Snippets Groups Projects
Verified Commit afa61601 authored by Jacob Lorentzon's avatar Jacob Lorentzon :speech_balloon:
Browse files

Add ContextStatus::HardBlocked.

parent 23fede5d
No related branches found
No related tags found
1 merge request!238Demand paging
...@@ -35,10 +35,27 @@ int_like!(ContextId, AtomicContextId, usize, AtomicUsize); ...@@ -35,10 +35,27 @@ int_like!(ContextId, AtomicContextId, usize, AtomicUsize);
#[derive(Copy, Clone, Debug, Eq, PartialEq)] #[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum Status { pub enum Status {
Runnable, Runnable,
// TODO: Rename to SoftBlocked and move status_reason to this variant.
/// Not currently runnable, typically due to some blocking syscall, but it can be trivially
/// unblocked by e.g. signals.
Blocked, Blocked,
/// Not currently runnable, and cannot be runnable until manually unblocked, depending on what
/// reason.
HardBlocked { reason: HardBlockedReason },
Stopped(usize), Stopped(usize),
Exited(usize), Exited(usize),
} }
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum HardBlockedReason {
AwaitingMmap,
// TODO: PageFaultOom?
// TODO: NotYetStarted/ManuallyBlocked (when new contexts are created)
// TODO: ptrace_stop?
}
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
pub struct WaitpidKey { pub struct WaitpidKey {
......
...@@ -43,7 +43,7 @@ pub fn resource() -> Result<Vec<u8>> { ...@@ -43,7 +43,7 @@ pub fn resource() -> Result<Vec<u8>> {
context::Status::Runnable => { context::Status::Runnable => {
stat_string.push('R'); stat_string.push('R');
}, },
context::Status::Blocked => if context.wake.is_some() { context::Status::Blocked | context::Status::HardBlocked { .. } => if context.wake.is_some() {
stat_string.push('S'); stat_string.push('S');
} else { } else {
stat_string.push('B'); stat_string.push('B');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment