Add user_stack_size to Machine and use it for threads sp
This commit is contained in:
@ -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)]
|
||||
|
Reference in New Issue
Block a user