remove merge error => scheduler has to call "finish_task_switch"

This commit is contained in:
Stefan Lankes 2011-08-27 06:57:21 -07:00
parent eadaf67d06
commit 771db80f26
2 changed files with 8 additions and 5 deletions

View file

@ -93,6 +93,7 @@ int network_init(void)
// Initialize lwIP modules
tcpip_init(tcp_init_ok, NULL);
lwip_initialized = 0;
while(!lwip_initialized) {
reschedule();
}

View file

@ -107,7 +107,7 @@ size_t get_idle_task(uint32_t id)
#endif
}
static void finish_task_switch(void)
static void finish_task_switch(uint32_t irq)
{
uint8_t prio;
uint32_t core_id = CORE_ID;
@ -130,7 +130,8 @@ static void finish_task_switch(void)
}
spinlock_unlock(&runqueues[core_id].lock);
irq_enable();
if (irq)
irq_enable();
}
/** @brief Wakeup tasks which are waiting for a message from the current one
@ -388,7 +389,7 @@ int sys_fork(void)
// Leave the function without releasing the locks
// because the locks are already released
// by the parent task!
finish_task_switch();
finish_task_switch(1);
return 0;
}
@ -423,7 +424,7 @@ static int STDCALL kernel_entry(void* args)
int ret;
kernel_args_t* kernel_args = (kernel_args_t*) args;
finish_task_switch();
finish_task_switch(1);
if (BUILTIN_EXPECT(!kernel_args, 0))
return -EINVAL;
@ -679,7 +680,7 @@ static int STDCALL user_entry(void* arg)
{
int ret;
finish_task_switch();
finish_task_switch(1);
if (BUILTIN_EXPECT(!arg, 0))
return -EINVAL;
@ -1265,6 +1266,7 @@ get_task_out:
//kprintf("schedule from %u to %u with prio %u on core %u\n",
// orig_task->id, curr_task->id, (uint32_t)curr_task->prio, CORE_ID);
switch_task(curr_task->id);
finish_task_switch(0);
}
}