syscalls: fix nanosleep, thanks to gemini, sorry for that

This commit is contained in:
2025-09-03 16:35:07 +03:00
parent 5b922ea773
commit 63938e1acd
2 changed files with 55 additions and 27 deletions
+4 -3
View File
@@ -315,10 +315,11 @@ uint32_t sys_nanosleep(TrapFrame *tf)
//debug_log("waiting for 0x%X ms\n", ms);
size_t start_time = timer_ticks;
scheduler_lock();
current->wake_up_time = timer_ticks + ms;
//debug_log("setting wake up time to %X (current time is %X)\n", current->wake_up_time, timer_ticks);
//TODO: find a way to call the scheduler from here without fucking shit up
current->state = Waiting;
schedule();
scheduler_unlock();
return 0;
}