aboutsummaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/core/thread.c4
-rw-r--r--src/kernel/core/worker.c4
-rw-r--r--src/kernel/include/worker.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/kernel/core/thread.c b/src/kernel/core/thread.c
index 144a905..43b56a5 100644
--- a/src/kernel/core/thread.c
+++ b/src/kernel/core/thread.c
@@ -117,7 +117,7 @@ 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();
+ current_thread->last_ran = get_kernel_time();
if (current_thread->proc) current_thread->proc->last_ran = current_thread->last_ran;
enqueue_thread(current_thread, true);
}
@@ -217,7 +217,7 @@ static void delete_thread(thread_t *t) {
// ========== //
static void irq0_handler(registers_t *regs) {
- worker_notify_time(1000000 / TASK_SWITCH_FREQUENCY);
+ notify_time_pass(1000000 / TASK_SWITCH_FREQUENCY);
if (current_thread != 0 && current_thread->critical_level == CL_USER) {
save_context_and_enter_scheduler(&current_thread->ctx);
}
diff --git a/src/kernel/core/worker.c b/src/kernel/core/worker.c
index c3fa04d..e367115 100644
--- a/src/kernel/core/worker.c
+++ b/src/kernel/core/worker.c
@@ -88,7 +88,7 @@ bool worker_push(entry_t fun, void* data) {
return worker_push_in(0, fun, data);
}
-void worker_notify_time(int usecs) {
+void notify_time_pass(int usecs) {
time += usecs;
if (next_task_time <= time) {
for (int i = 0; i < nworkers; i++) {
@@ -97,7 +97,7 @@ void worker_notify_time(int usecs) {
}
}
-uint64_t worker_get_time() {
+uint64_t get_kernel_time() {
return time;
}
diff --git a/src/kernel/include/worker.h b/src/kernel/include/worker.h
index ec76dc4..e2f1cd4 100644
--- a/src/kernel/include/worker.h
+++ b/src/kernel/include/worker.h
@@ -8,8 +8,8 @@ void start_workers(int num_worker_threads); // default : one is enough
bool worker_push(entry_t fun, void* data);
bool worker_push_in(int usecs, entry_t fun, void* data);
-void worker_notify_time(int usecs); // time source : PIT IRQ0
+void notify_time_pass(int usecs); // time source : PIT IRQ0
-uint64_t worker_get_time(); // usecs since we started some worker threads, ie since kernel startup
+uint64_t get_kernel_time(); // usecs since we started some worker threads, ie since kernel startup
/* vim: set ts=4 sw=4 tw=0 noet :*/