From ec2f50f7d3827302d5bbca82241a041b4e2c05ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Rativel?= Date: Thu, 13 Apr 2023 14:45:57 +0200 Subject: [PATCH] implemented sc_lock_release TODO : to implement lock_release in thread_manager --- src/kernel/exception.rs | 5 +++++ src/kernel/thread_manager.rs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/kernel/exception.rs b/src/kernel/exception.rs index a396718..c260d3c 100644 --- a/src/kernel/exception.rs +++ b/src/kernel/exception.rs @@ -197,6 +197,11 @@ fn syscall(machine: &mut Machine, system: &mut System) -> Result Result{ + let id = machine.read_int_register(10) as i32; + system.get_thread_manager().lock_release(id, machine) +} + fn sc_lock_acquire(machine: &mut Machine, system: &mut System) -> Result { let id = machine.read_int_register(10) as i32; system.get_thread_manager().lock_acquire(id, machine) diff --git a/src/kernel/thread_manager.rs b/src/kernel/thread_manager.rs index 870a9fc..26911b8 100644 --- a/src/kernel/thread_manager.rs +++ b/src/kernel/thread_manager.rs @@ -282,6 +282,10 @@ impl ThreadManager { } } + pub fn lock_release(&mut self, id: i32, machine: &mut Machine) -> Result{ + todo!() + } + /// Currently running thread pub fn get_g_current_thread(&mut self) -> &Option>> { &self.g_current_thread