Changeset 085d973 in mainline for generic/src/proc/thread.c


Ignore:
Timestamp:
2006-02-08T12:34:05Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5e3757d
Parents:
eb1b8b6
Message:

Cleanup o frame allocator.
Removed early_malloc & initial heap.
Will break ia64, ppc & sparc.
Added e820 table print.

File:
1 edited

Legend:

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

    reb1b8b6 r085d973  
    3030#include <proc/thread.h>
    3131#include <proc/task.h>
    32 #include <mm/heap.h>
    3332#include <mm/frame.h>
    3433#include <mm/page.h>
     
    9695{
    9796        thread_t *t = (thread_t *)obj;
     97        pfn_t pfn;
    9898
    9999        spinlock_initialize(&t->lock, "thread_t_lock");
     
    103103        link_initialize(&t->threads_link);
    104104       
    105         t->kstack = (__u8 *)frame_alloc(ONE_FRAME, FRAME_KA | kmflags);
     105        pfn = frame_alloc(ONE_FRAME, FRAME_KA | kmflags);
     106        t->kstack = (__u8 *)PA2KA(PFN2ADDR(pfn));
    106107        if (!t->kstack)
    107108                return -1;
     
    115116        thread_t *t = (thread_t *)obj;
    116117
    117         frame_free((__address) t->kstack);
     118        frame_free(ADDR2PFN(KA2PA(t->kstack)));
    118119        return 1; /* One page freed */
    119120}
     
    194195        spinlock_unlock(&t->cpu->lock);
    195196
    196         if (t->ustack)
    197                 frame_free((__address) t->ustack);
    198        
    199197        /*
    200198         * Detach from the containing task.
     
    229227{
    230228        thread_t *t;
    231         __address frame_us = NULL;
    232229
    233230        t = (thread_t *) slab_alloc(thread_slab, 0);
     
    235232                ipl_t ipl;
    236233       
    237                 if (THREAD_USER_STACK & flags) {
    238                         frame_us = frame_alloc(ONE_FRAME, FRAME_KA);
    239                 }
    240 
    241234                /* Not needed, but good for debugging */
    242235                memsetb((__address)t->kstack, THREAD_STACK_SIZE, 0);
     
    247240                spinlock_unlock(&tidlock);
    248241                interrupts_restore(ipl);
    249                
    250                 t->ustack = (__u8 *) frame_us;
    251242               
    252243                context_save(&t->saved_context);
Note: See TracChangeset for help on using the changeset viewer.