aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-03-07 17:53:35 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-03-07 17:53:35 +0100
commit92731869cbf96c96b6c79f49310b1982ba3f86ee (patch)
treec88287bb7bbf90a0d9bbecad95a417064d9d0ddb /src
parentcb6cef08023bee0feeaa60a84d19bc52745bb2e4 (diff)
downloadkogata-92731869cbf96c96b6c79f49310b1982ba3f86ee.tar.gz
kogata-92731869cbf96c96b6c79f49310b1982ba3f86ee.zip
Update readme ; change time-related function names.
Diffstat (limited to 'src')
-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 :*/