Changeset 0366d09d in mainline for kernel/generic/src/proc/scheduler.c


Ignore:
Timestamp:
2023-02-07T16:49:43Z (15 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
78acbc72
Parents:
1eaead4
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2022-08-14 14:08:42)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-07 16:49:43)
Message:

Avoid separate allocation for FPU context

With _Alignas, we can encode alignment in the type itself and
include it directly as a member of thread_t, thus removing
the need for a separate allocation.

The alignment requirement is never more than 16 bytes,
so this adds only minimal extra padding to the structure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/scheduler.c

    r1eaead4 r0366d09d  
    9797        fpu_enable();
    9898        if (THREAD->fpu_context_exists)
    99                 fpu_context_restore(THREAD->saved_fpu_context);
     99                fpu_context_restore(&THREAD->fpu_context);
    100100        else {
    101101                fpu_init();
     
    140140        if (CPU->fpu_owner != NULL) {
    141141                irq_spinlock_lock(&CPU->fpu_owner->lock, false);
    142                 fpu_context_save(CPU->fpu_owner->saved_fpu_context);
     142                fpu_context_save(&CPU->fpu_owner->fpu_context);
    143143
    144144                /* Don't prevent migration */
     
    150150        irq_spinlock_lock(&THREAD->lock, false);
    151151        if (THREAD->fpu_context_exists) {
    152                 fpu_context_restore(THREAD->saved_fpu_context);
     152                fpu_context_restore(&THREAD->fpu_context);
    153153        } else {
    154154                fpu_init();
     
    325325
    326326#if (defined CONFIG_FPU) && (!defined CONFIG_FPU_LAZY)
    327                 fpu_context_save(THREAD->saved_fpu_context);
     327                fpu_context_save(&THREAD->fpu_context);
    328328#endif
    329329                if (!context_save(&THREAD->saved_context)) {
Note: See TracChangeset for help on using the changeset viewer.