thread_init_early

来源:互联网 发布:书生商友推广软件 编辑:程序博客网 时间:2024/05/23 01:59
lk/kernel/thread.c:
thread_init_early:

/** * @brief  Initialize threading system * * This function is called once, from kmain() */void thread_init_early(void){    int i;

    DEBUG_ASSERT(arch_curr_cpu_num() == 0);

    /* initialize the run queues */    for (i=0; i < NUM_PRIORITIES; i++)        list_initialize(&run_queue[i]);

    /* initialize the thread list */    list_initialize(&thread_list);

    /* create a thread to cover the current running state */    thread_t *t = idle_thread(0);    init_thread_struct(t, "bootstrap");

    /* half construct this thread, since we're already running */    t->priority = HIGHEST_PRIORITY;    t->state = THREAD_RUNNING;    t->flags = THREAD_FLAG_DETACHED;    thread_set_curr_cpu(t, 0);    thread_set_pinned_cpu(t, 0);    wait_queue_init(&t->retcode_wait_queue);    list_add_head(&thread_list, &t->thread_list_node);    set_current_thread(t);}

 
0 0
原创粉丝点击