Ignore:
Timestamp:
2018-11-09T22:03:24Z (5 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:
b389f95
Parents:
90efa3b
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-08 18:00:23)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-09 22:03:24)
Message:

Allow thread_create_arch() to fail

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/proc/thread.c

    r90efa3b rdeacd722  
    6262}
    6363
    64 void thread_create_arch(thread_t *t)
     64errno_t thread_create_arch(thread_t *t, thread_flags_t flags)
    6565{
    66         if ((t->uspace) && (!t->arch.uspace_window_buffer)) {
     66        if ((flags & THREAD_FLAG_USPACE) && (!t->arch.uspace_window_buffer)) {
    6767                /*
    6868                 * The thread needs userspace window buffer and the object
    6969                 * returned from the slab allocator doesn't have any.
    7070                 */
    71                 t->arch.uspace_window_buffer = slab_alloc(uwb_cache, 0);
     71                t->arch.uspace_window_buffer = slab_alloc(uwb_cache, FRAME_ATOMIC);
     72                if (!t->arch.uspace_window_buffer)
     73                        return ENOMEM;
    7274        } else {
    7375                uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer;
     
    8082                    UWB_ALIGNMENT);
    8183        }
     84        return EOK;
    8285}
    8386
Note: See TracChangeset for help on using the changeset viewer.