Changeset 169815e in mainline for kernel/generic/src/proc
- Timestamp:
- 2023-04-16T12:22:00Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fbaf6ac
- Parents:
- b2ec5cf
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-04-16 12:14:09)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-04-16 12:22:00)
- Location:
- kernel/generic/src/proc
- Files:
-
- 2 edited
-
scheduler.c (modified) (7 diffs)
-
thread.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/scheduler.c
rb2ec5cf r169815e 129 129 { 130 130 fpu_enable(); 131 irq_spinlock_lock(&CPU-> lock, false);131 irq_spinlock_lock(&CPU->fpu_lock, false); 132 132 133 133 /* Save old context */ … … 154 154 irq_spinlock_unlock(&THREAD->lock, false); 155 155 156 irq_spinlock_unlock(&CPU-> lock, false);156 irq_spinlock_unlock(&CPU->fpu_lock, false); 157 157 } 158 158 #endif /* CONFIG_FPU_LAZY */ … … 187 187 * This improves energy saving and hyperthreading. 188 188 */ 189 irq_spinlock_lock(&CPU->lock, false);190 189 CPU->idle = true; 191 irq_spinlock_unlock(&CPU->lock, false);192 190 193 191 /* … … 298 296 size_t n = 0; 299 297 300 irq_spinlock_lock(&CPU->lock, false);301 302 298 /* Move every list (except the one with highest priority) one level up. */ 303 299 for (int i = RQ_COUNT - 1; i > start; i--) { … … 322 318 irq_spinlock_unlock(&CPU->rq[start].lock, false); 323 319 } 324 325 irq_spinlock_unlock(&CPU->lock, false);326 320 } 327 321 … … 684 678 continue; 685 679 686 irq_spinlock_lock(&cpus[cpu].lock, true);687 688 680 /* Technically a data race, but we don't really care in this case. */ 689 681 int needs_relink = cpus[cpu].relink_deadline - cpus[cpu].current_clock_tick; … … 711 703 irq_spinlock_unlock(&(cpus[cpu].rq[i].lock), false); 712 704 } 713 714 irq_spinlock_unlock(&cpus[cpu].lock, true);715 705 } 716 706 } -
kernel/generic/src/proc/thread.c
rb2ec5cf r169815e 425 425 426 426 assert((thread->state == Exiting) || (thread->state == Lingering)); 427 assert(thread->cpu);428 427 429 428 /* Clear cpu->fpu_owner if set to this thread. */ 430 irq_spinlock_lock(&thread->cpu->lock, false); 431 if (thread->cpu->fpu_owner == thread) 432 thread->cpu->fpu_owner = NULL; 433 irq_spinlock_unlock(&thread->cpu->lock, false); 429 #ifdef CONFIG_FPU_LAZY 430 if (thread->cpu) { 431 irq_spinlock_lock(&thread->cpu->fpu_lock, false); 432 if (thread->cpu->fpu_owner == thread) 433 thread->cpu->fpu_owner = NULL; 434 irq_spinlock_unlock(&thread->cpu->fpu_lock, false); 435 } 436 #endif 434 437 435 438 interrupts_restore(ipl);
Note:
See TracChangeset
for help on using the changeset viewer.
