Merge branch 'thread_scheduler' of https://gitlab.istic.univ-rennes1.fr/simpleos/burritos into thread_scheduler
This commit is contained in:
commit
9c3501eb40
@ -1,3 +1,7 @@
|
|||||||
|
//! # System module
|
||||||
|
//!
|
||||||
|
//! Module containing structs and methods pertaining to the state of the operating system
|
||||||
|
|
||||||
use std::{cell::RefCell, rc::Rc};
|
use std::{cell::RefCell, rc::Rc};
|
||||||
|
|
||||||
use crate::simulator::machine::Machine;
|
use crate::simulator::machine::Machine;
|
||||||
|
@ -3,6 +3,15 @@ use crate::{simulator::machine::{NUM_INT_REGS, NUM_FP_REGS, STACK_REG}};
|
|||||||
|
|
||||||
const STACK_FENCEPOST: u32 = 0xdeadbeef;
|
const STACK_FENCEPOST: u32 = 0xdeadbeef;
|
||||||
|
|
||||||
|
/// Polymorphic macro to get thread without passing a name by default
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! get_new_thread {
|
||||||
|
() => { Thread::new(DEFAULT_THREAD_NAME) };
|
||||||
|
($a:literal) => {
|
||||||
|
Thread::new(&$a.to_string())
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Debug)]
|
||||||
pub struct ThreadContext {
|
pub struct ThreadContext {
|
||||||
pub int_registers: [i64; NUM_INT_REGS],
|
pub int_registers: [i64; NUM_INT_REGS],
|
||||||
@ -102,14 +111,6 @@ mod test {
|
|||||||
use super::{Thread, ThreadContext, NUM_INT_REGS, NUM_FP_REGS, ObjectType};
|
use super::{Thread, ThreadContext, NUM_INT_REGS, NUM_FP_REGS, ObjectType};
|
||||||
const DEFAULT_THREAD_NAME: &str = "test_thread";
|
const DEFAULT_THREAD_NAME: &str = "test_thread";
|
||||||
|
|
||||||
/// Polymorphic macro to get thread without passing a name by default
|
|
||||||
macro_rules! get_new_thread {
|
|
||||||
() => { Thread::new(DEFAULT_THREAD_NAME) };
|
|
||||||
($a:literal) => {
|
|
||||||
Thread::new(&$a.to_string())
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This macro allows for getting a Thread for which we've ensured proper initial state
|
/// This macro allows for getting a Thread for which we've ensured proper initial state
|
||||||
/// in case a commit further down the line changes the initial state of threads generated
|
/// in case a commit further down the line changes the initial state of threads generated
|
||||||
/// from Thread::new
|
/// from Thread::new
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
|
//! Data structure and definition of a genericsingle-linked LIFO list.
|
||||||
|
|
||||||
/// Data structure and definition of a genericsingle-linked LIFO list.
|
|
||||||
///
|
|
||||||
/// This is a
|
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq)]
|
||||||
pub struct List<T: PartialEq> {
|
pub struct List<T: PartialEq> {
|
||||||
head: Link<T>,
|
head: Link<T>,
|
||||||
|
Loading…
Reference in New Issue
Block a user