From f79b63e930129340cba70e3064b1e33637d606c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Rativel?= Date: Wed, 5 Apr 2023 16:43:09 +0200 Subject: [PATCH] implemented getter for objaddr --- src/kernel/system.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/kernel/system.rs b/src/kernel/system.rs index 167a1ef..b0d70da 100644 --- a/src/kernel/system.rs +++ b/src/kernel/system.rs @@ -3,6 +3,8 @@ //! Module containing structs and methods pertaining to the state of the operating system use super::{thread_manager::ThreadManager}; +use crate::utility; +use crate::utility::objaddr::{ObjAddr, SynchObj}; /// # System /// @@ -14,12 +16,12 @@ use super::{thread_manager::ThreadManager}; /// - The list of active threads /// - The thread to be destroyed next /// - The scheduler which acts upon these threads -#[derive(PartialEq)] -pub struct System { - thread_manager: ThreadManager +pub struct System<'a> { + thread_manager: ThreadManager, + obj_addrs: ObjAddr<'a> } -impl System { +impl<'a> System<'a> { // GETTERS @@ -27,12 +29,14 @@ impl System { &mut self.thread_manager } + pub fn get_obj_addrs(&mut self) -> &'a mut ObjAddr { &mut self.obj_addrs } + } -impl Default for System { +impl<'a> Default for System<'a> { /// System constructor fn default() -> Self { - Self { thread_manager: ThreadManager::new() } + Self { thread_manager: ThreadManager::new(), obj_addrs: ObjAddr::init() } } }