From 324253095debaadc039debfa9f18681b313783c1 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Mon, 6 Jul 2020 12:46:23 -0400 Subject: [PATCH] refactor: clarify interval duration is not macro --- runtime/include/software_interrupt.h | 2 +- runtime/src/local_runqueue_minheap.c | 2 +- runtime/src/main.c | 2 +- runtime/src/software_interrupt.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/include/software_interrupt.h b/runtime/include/software_interrupt.h index a046768..5fb63ce 100644 --- a/runtime/include/software_interrupt.h +++ b/runtime/include/software_interrupt.h @@ -9,7 +9,7 @@ ***********/ extern __thread volatile sig_atomic_t software_interrupt_is_disabled; -extern uint64_t SOFTWARE_INTERRUPT_INTERVAL_DURATION_IN_CYCLES; +extern uint64_t software_interrupt_interval_duration_in_cycles; /************************* * Public Static Inlines * diff --git a/runtime/src/local_runqueue_minheap.c b/runtime/src/local_runqueue_minheap.c index 6d32d1d..40f93bc 100644 --- a/runtime/src/local_runqueue_minheap.c +++ b/runtime/src/local_runqueue_minheap.c @@ -119,7 +119,7 @@ local_runqueue_minheap_preempt(ucontext_t *user_context) // TODO: Factor quantum and/or sandbox allocation time into decision // uint64_t global_deadline = global_request_scheduler_peek() - - // SOFTWARE_INTERRUPT_INTERVAL_DURATION_IN_CYCLES; + // software_interrupt_interval_duration_in_cycles; bool should_enable_software_interrupt = true; uint64_t local_deadline = priority_queue_peek(&local_runqueue_minheap); diff --git a/runtime/src/main.c b/runtime/src/main.c index d4054a8..f68d727 100644 --- a/runtime/src/main.c +++ b/runtime/src/main.c @@ -202,7 +202,7 @@ main(int argc, char **argv) memset(runtime_worker_threads, 0, sizeof(pthread_t) * WORKER_THREAD_CORE_COUNT); runtime_processor_speed_MHz = runtime_get_processor_speed_MHz(); - SOFTWARE_INTERRUPT_INTERVAL_DURATION_IN_CYCLES = (uint64_t)SOFTWARE_INTERRUPT_INTERVAL_DURATION_IN_USEC + software_interrupt_interval_duration_in_cycles = (uint64_t)SOFTWARE_INTERRUPT_INTERVAL_DURATION_IN_USEC * runtime_processor_speed_MHz; debuglog("Detected processor speed of %f MHz\n", runtime_processor_speed_MHz); diff --git a/runtime/src/software_interrupt.c b/runtime/src/software_interrupt.c index 979daaa..a8c3453 100644 --- a/runtime/src/software_interrupt.c +++ b/runtime/src/software_interrupt.c @@ -20,7 +20,7 @@ ******************/ static const int software_interrupt_supported_signals[] = { SIGALRM, SIGUSR1 }; -uint64_t SOFTWARE_INTERRUPT_INTERVAL_DURATION_IN_CYCLES; +uint64_t software_interrupt_interval_duration_in_cycles; /****************** * Thread Globals *