1
0
forked from Rativel/BurritOS

Removed Rc<RefCell<Machine>>

This commit is contained in:
François Autin
2023-03-15 14:56:05 +01:00
parent 84d8bcc84f
commit abb97d17d5
2 changed files with 14 additions and 14 deletions

View File

@@ -35,7 +35,7 @@ macro_rules! init_system {
/// - The scheduler which acts upon these threads
#[derive(PartialEq)]
pub struct System {
g_machine: RefCell<Machine>,
machine: Machine,
thread_manager: Rc<RefCell<ThreadManager>>
}
@@ -44,7 +44,7 @@ impl System {
/// System constructor
pub fn new(machine: Machine) -> System {
Self {
g_machine: RefCell::new(machine),
machine,
thread_manager: Rc::new(RefCell::new(ThreadManager::new()))
}
}
@@ -62,8 +62,8 @@ impl System {
/// Returns the Machine
///
/// Useful to access RAM, devices, ...
pub fn get_g_machine(&self) -> &RefCell<Machine> {
&self.g_machine
pub fn get_machine(&self) -> Machine {
self.machine
}
pub fn get_thread_manager(&self) -> Rc<RefCell<ThreadManager>> {
@@ -73,8 +73,8 @@ impl System {
// Setters
/// Assign a machine to the system
pub fn set_g_machine(&mut self, machine: RefCell<Machine>) {
self.g_machine = machine
pub fn set_machine(&mut self, machine: Machine) {
self.machine = machine
}
}