Ignore:
File:
1 edited

Legend:

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

    r8cbf1c3 rcd3b380  
    192192        kmflags &= ~FRAME_HIGHMEM;
    193193       
    194         thread->kstack = (uint8_t *)
    195             PA2KA(frame_alloc(STACK_FRAMES, kmflags, 0));
    196         if (!thread->kstack) {
     194        uintptr_t stack_phys =
     195            frame_alloc(STACK_FRAMES, kmflags, STACK_SIZE - 1);
     196        if (!stack_phys) {
    197197#ifdef CONFIG_FPU
    198198                if (thread->saved_fpu_context)
     
    202202        }
    203203       
     204        thread->kstack = (uint8_t *) PA2KA(stack_phys);
     205       
    204206#ifdef CONFIG_UDEBUG
    205207        mutex_initialize(&thread->udebug.lock, MUTEX_PASSIVE);
     
    217219        thr_destructor_arch(thread);
    218220       
    219         frame_free(KA2PA(thread->kstack));
     221        frame_free(KA2PA(thread->kstack), STACK_FRAMES);
    220222       
    221223#ifdef CONFIG_FPU
Note: See TracChangeset for help on using the changeset viewer.