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


Ignore:
Timestamp:
2018-11-09T22:03:24Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
abf6c01
Parents:
4f3aa76
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-08 17:08:07)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-09 22:03:24)
Message:

Always allocate FPU context ahead of time, even when switching is lazy

File:
1 edited

Legend:

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

    r4f3aa76 rba9a150  
    165165
    166166#ifdef CONFIG_FPU
    167 #ifdef CONFIG_FPU_LAZY
    168         thread->saved_fpu_context = NULL;
    169 #else /* CONFIG_FPU_LAZY */
    170167        thread->saved_fpu_context = slab_alloc(fpu_context_cache, kmflags);
    171168        if (!thread->saved_fpu_context)
    172169                return ENOMEM;
    173 #endif /* CONFIG_FPU_LAZY */
    174170#endif /* CONFIG_FPU */
    175171
     
    200196        if (!stack_phys) {
    201197#ifdef CONFIG_FPU
    202                 if (thread->saved_fpu_context)
    203                         slab_free(fpu_context_cache, thread->saved_fpu_context);
     198                assert(thread->saved_fpu_context);
     199                slab_free(fpu_context_cache, thread->saved_fpu_context);
    204200#endif
    205201                return ENOMEM;
     
    226222
    227223#ifdef CONFIG_FPU
    228         if (thread->saved_fpu_context)
    229                 slab_free(fpu_context_cache, thread->saved_fpu_context);
     224        assert(thread->saved_fpu_context);
     225        slab_free(fpu_context_cache, thread->saved_fpu_context);
    230226#endif
    231227
Note: See TracChangeset for help on using the changeset viewer.