Remove the shim kernel crate

This commit is contained in:
Zhang Junyang
2024-08-19 19:15:22 +08:00
committed by Tate, Hongliang Tian
parent d76c7a5b1e
commit dafd16075f
416 changed files with 231 additions and 273 deletions

View File

@ -0,0 +1,35 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! The process status
use super::TermStatus;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ProcessStatus {
// Not ready to run
Uninit,
/// Can be scheduled to run
Runnable,
/// Exit while not reaped by parent
Zombie(TermStatus),
}
impl ProcessStatus {
pub fn set_zombie(&mut self, term_status: TermStatus) {
*self = ProcessStatus::Zombie(term_status);
}
pub fn is_zombie(&self) -> bool {
matches!(self, ProcessStatus::Zombie(_))
}
pub fn set_runnable(&mut self) {
*self = ProcessStatus::Runnable;
}
pub fn is_runnable(&self) -> bool {
*self == ProcessStatus::Runnable
}
}