Changeset f2cb80a in mainline for kernel/generic/src/time/clock.c
- Timestamp:
- 2024-02-23T17:57:23Z (11 months ago)
- Children:
- 192019f
- Parents:
- 86f862c (diff), 90ba06c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- boba-buba <120932204+boba-buba@…> (2024-02-23 17:57:23)
- git-committer:
- GitHub <noreply@…> (2024-02-23 17:57:23)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/time/clock.c
r86f862c rf2cb80a 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.