aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/core/thread.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-20 15:47:51 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-20 15:47:51 +0100
commit9ba449a6e5f9db20923fb9802eefe0f090ba5fff (patch)
treef0f58bfa44a30e61e30caf08af1cdf03bef822f0 /src/kernel/core/thread.c
parent2d4d64189501c253ed6a5b5ff5e27da1cb34407a (diff)
downloadkogata-9ba449a6e5f9db20923fb9802eefe0f090ba5fff.tar.gz
kogata-9ba449a6e5f9db20923fb9802eefe0f090ba5fff.zip
Change mode of operation for mmap_file (see readme)
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 7f9f25e..60dccde 100644
--- a/src/kernel/core/thread.c
+++ b/src/kernel/core/thread.c
@@ -7,6 +7,7 @@
#include <frame.h>
#include <paging.h>
#include <worker.h>
+#include <process.h>
void save_context_and_enter_scheduler(saved_context_t *ctx);
void resume_context(saved_context_t *ctx);
@@ -84,6 +85,8 @@ void run_scheduler() {
// This function is expected NEVER TO RETURN
if (current_thread != 0 && current_thread->state == T_STATE_RUNNING) {
+ current_thread->last_ran = worker_get_time();
+ if (current_thread->proc) current_thread->proc->last_ran = current_thread->last_ran;
enqueue_thread(current_thread, true);
}
@@ -141,6 +144,7 @@ thread_t *new_thread(entry_t entry, void* data) {
t->ctx.eip = (void(*)())run_thread;
t->state = T_STATE_PAUSED;
+ t->last_ran = 0;
t->current_pd_d = get_kernel_pagedir();