Subversion Repositories HelenOS-historic

Rev

Rev 1026 | Rev 1048 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1026 Rev 1040
Line 67... Line 67...
67
 */
67
 */
68
task_t *task_create(as_t *as)
68
task_t *task_create(as_t *as)
69
{
69
{
70
    ipl_t ipl;
70
    ipl_t ipl;
71
    task_t *ta;
71
    task_t *ta;
-
 
72
    int i;
72
   
73
   
73
    ta = (task_t *) malloc(sizeof(task_t), 0);
74
    ta = (task_t *) malloc(sizeof(task_t), 0);
74
 
75
 
75
    spinlock_initialize(&ta->lock, "task_ta_lock");
76
    spinlock_initialize(&ta->lock, "task_ta_lock");
76
    list_initialize(&ta->th_head);
77
    list_initialize(&ta->th_head);
77
    list_initialize(&ta->tasks_link);
78
    list_initialize(&ta->tasks_link);
78
    ta->as = as;
79
    ta->as = as;
79
 
80
 
-
 
81
   
80
    ipc_answerbox_init(&ta->answerbox);
82
    ipc_answerbox_init(&ta->answerbox);
-
 
83
    for (i=0; i < IPC_MAX_PHONES;i++)
81
    memsetb((__address)&ta->phones, sizeof(ta->phones[0])*IPC_MAX_PHONES, 0);
84
        ipc_phone_init(&ta->phones[i]);
82
    if (ipc_phone_0)
85
    if (ipc_phone_0)
83
        ipc_phone_init(&ta->phones[0], ipc_phone_0);
86
        ipc_phone_connect(&ta->phones[0], ipc_phone_0);
84
    atomic_set(&ta->active_calls, 0);
87
    atomic_set(&ta->active_calls, 0);
85
   
88
   
86
    ipl = interrupts_disable();
89
    ipl = interrupts_disable();
87
    spinlock_lock(&tasks_lock);
90
    spinlock_lock(&tasks_lock);
88
 
91