Kernel: Rewrite whole scheduler

Current context saving was very hacky and dependant on compiler
behaviour that was not consistent. Now we always use iret for
context saving. This makes everything more clean.
This commit is contained in:
2024-03-29 18:02:12 +02:00
parent 1b65f850ee
commit 5050047cef
18 changed files with 364 additions and 364 deletions

View File

@@ -16,8 +16,10 @@ namespace Kernel
[[noreturn]] void start();
void yield();
void timer_reschedule();
void reschedule();
void irq_reschedule();
void reschedule_if_idling();
void set_current_thread_sleeping(uint64_t wake_time);
@@ -30,9 +32,6 @@ namespace Kernel
Thread& current_thread();
static pid_t current_tid();
[[noreturn]] void execute_current_thread();
[[noreturn]] void delete_current_process_and_thread();
// This is no return if called on current thread
void terminate_thread(Thread*);
@@ -41,11 +40,7 @@ namespace Kernel
void set_current_thread_sleeping_impl(Semaphore* semaphore, uint64_t wake_time);
[[nodiscard]] bool save_current_thread();
void advance_current_thread();
[[noreturn]] void execute_current_thread_locked();
[[noreturn]] void execute_current_thread_stack_loaded();
void setup_next_thread();
BAN::ErrorOr<void> add_thread(Thread*);