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