forked from Rativel/BurritOS
Removed Rc<RefCell<Machine>>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user