Changeset 169815e in mainline for kernel/generic/src/proc/thread.c


Ignore:
Timestamp:
2023-04-16T12:22:00Z (21 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
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)
Message:

Split cpu_t::lock into fpu_lock and tlb_lock

For all other purposes, locking is unnecessary, since the fields
in question are only accessed locally from the CPU they belong to.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified kernel/generic/src/proc/thread.c

    rb2ec5cf r169815e  
    425425
    426426        assert((thread->state == Exiting) || (thread->state == Lingering));
    427         assert(thread->cpu);
    428427
    429428        /* 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
    434437
    435438        interrupts_restore(ipl);
Note: See TracChangeset for help on using the changeset viewer.