Changes in kernel/generic/src/time/clock.c [25939997:169815e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/time/clock.c
r25939997 r169815e 123 123 static void cpu_update_accounting(void) 124 124 { 125 // FIXME: get_cycle() is unimplemented on several platforms126 125 uint64_t now = get_cycle(); 127 atomic_time_increment(&CPU->busy_cycles, now - CPU _LOCAL->last_cycle);128 CPU _LOCAL->last_cycle = now;126 atomic_time_increment(&CPU->busy_cycles, now - CPU->last_cycle); 127 CPU->last_cycle = now; 129 128 } 130 129 … … 138 137 void clock(void) 139 138 { 140 size_t missed_clock_ticks = CPU _LOCAL->missed_clock_ticks;141 CPU _LOCAL->missed_clock_ticks = 0;142 143 CPU _LOCAL->current_clock_tick += missed_clock_ticks + 1;144 uint64_t current_clock_tick = CPU _LOCAL->current_clock_tick;139 size_t missed_clock_ticks = CPU->missed_clock_ticks; 140 CPU->missed_clock_ticks = 0; 141 142 CPU->current_clock_tick += missed_clock_ticks + 1; 143 uint64_t current_clock_tick = CPU->current_clock_tick; 145 144 clock_update_counters(current_clock_tick); 146 145 … … 187 186 188 187 if (THREAD) { 189 if (current_clock_tick >= CPU _LOCAL->preempt_deadline && PREEMPTION_ENABLED) {190 thread_yield();188 if (current_clock_tick >= CPU->preempt_deadline && PREEMPTION_ENABLED) { 189 scheduler(); 191 190 #ifdef CONFIG_UDEBUG 192 191 /*
Note:
See TracChangeset
for help on using the changeset viewer.