aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/core/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/core/thread.c')
-rw-r--r--src/kernel/core/thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kernel/core/thread.c b/src/kernel/core/thread.c
index 43b56a5..d59b71d 100644
--- a/src/kernel/core/thread.c
+++ b/src/kernel/core/thread.c
@@ -11,6 +11,7 @@
#include <worker.h>
#include <process.h>
#include <freemem.h>
+#include <prng.h>
void save_context_and_enter_scheduler(saved_context_t *ctx);
void resume_context(saved_context_t *ctx);
@@ -124,6 +125,9 @@ void run_scheduler() {
current_thread = dequeue_thread();
if (current_thread != 0) {
+ thread_t *ptr = current_thread;
+ prng_add_entropy((uint8_t*)&ptr, sizeof(ptr));
+
set_kernel_stack(current_thread->stack_region->addr + current_thread->stack_region->size);
resume_context(&current_thread->ctx);
} else {