Add user_stack_size to Machine and use it for threads sp

This commit is contained in:
Quentin Legot
2023-05-09 17:01:52 +02:00
parent 7d29b92eba
commit 7be0c0accc
6 changed files with 34 additions and 16 deletions

View File

@ -118,7 +118,8 @@ pub struct ThreadManager {
/// List of objects created by the thread manager (such as Locks and Semaphores)
obj_addrs: ObjAddr,
/// If true, enables debug mode
debug: bool
debug: bool,
sp_max: u64,
}
impl ThreadManager {
@ -130,7 +131,8 @@ impl ThreadManager {
g_alive: List::default(),
ready_list: List::default(),
obj_addrs: ObjAddr::init(),
debug
debug,
sp_max: 0
}
}
@ -423,6 +425,14 @@ impl ThreadManager {
}
}
pub fn get_sp_max(&self) -> u64 {
self.sp_max
}
pub fn set_sp_max(&mut self, sp_max: u64) {
self.sp_max = sp_max;
}
}
#[cfg(test)]