Changeset ab855cd in mainline
- Timestamp:
- 2022-08-15T17:20:56Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eda43238
- Parents:
- 61ae4b0
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2022-08-15 17:16:41)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2022-08-15 17:20:56)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/time/clock.c
r61ae4b0 rab855cd 138 138 { 139 139 size_t missed_clock_ticks = CPU->missed_clock_ticks; 140 CPU->missed_clock_ticks = 0; 141 140 142 CPU->current_clock_tick += missed_clock_ticks + 1; 141 143 uint64_t current_clock_tick = CPU->current_clock_tick; … … 150 152 * 151 153 */ 152 size_t i; 153 for (i = 0; i <= missed_clock_ticks; i++) { 154 /* Update counters and accounting */ 155 156 cpu_update_accounting(); 154 155 irq_spinlock_lock(&CPU->timeoutlock, false); 156 157 link_t *cur; 158 while ((cur = list_first(&CPU->timeout_active_list)) != NULL) { 159 timeout_t *timeout = list_get_instance(cur, timeout_t, link); 160 161 if (current_clock_tick <= timeout->deadline) { 162 break; 163 } 164 165 list_remove(cur); 166 timeout_handler_t handler = timeout->handler; 167 void *arg = timeout->arg; 168 169 irq_spinlock_unlock(&CPU->timeoutlock, false); 170 171 handler(arg); 157 172 158 173 irq_spinlock_lock(&CPU->timeoutlock, false); 159 160 link_t *cur;161 while ((cur = list_first(&CPU->timeout_active_list)) != NULL) {162 timeout_t *timeout = list_get_instance(cur, timeout_t,163 link);164 165 if (current_clock_tick <= timeout->deadline) {166 break;167 }168 169 list_remove(cur);170 timeout_handler_t handler = timeout->handler;171 void *arg = timeout->arg;172 173 irq_spinlock_unlock(&CPU->timeoutlock, false);174 175 handler(arg);176 177 irq_spinlock_lock(&CPU->timeoutlock, false);178 }179 180 irq_spinlock_unlock(&CPU->timeoutlock, false);181 174 } 182 CPU->missed_clock_ticks = 0; 175 176 irq_spinlock_unlock(&CPU->timeoutlock, false); 183 177 184 178 /*
Note:
See TracChangeset
for help on using the changeset viewer.