Merge branch 'master' of git://www.b-labs.co.uk/bora/git/codezero into bora

Conflicts:
	config/cml/container_ruleset.template
	config/configuration.py
	conts/examples/example1/SConstruct
	conts/libl4thread/include/l4thread/thread.h
This commit is contained in:
Bahadir Balban
2009-11-19 14:41:07 +02:00
37 changed files with 604 additions and 67 deletions

View File

@@ -210,7 +210,7 @@ int mutex_control_unlock(struct mutex_queue_head *mqhead,
* now wake all of them up in FIFO order.
* FIXME: Make sure this is FIFO order. It doesn't seem so.
*/
wake_up(&mutex_queue->wqh_contenders, WAKEUP_ASYNC);
wake_up_all(&mutex_queue->wqh_contenders, WAKEUP_ASYNC);
/* Since noone is left, delete the mutex queue */
mutex_control_remove(mqhead, mutex_queue);

View File

@@ -105,12 +105,18 @@ int thread_destroy_children(void)
void thread_destroy_self(unsigned int exit_code)
{
thread_destroy_children();
/* Wake up waiters */
wake_up_all(&current->wqh_send, WAKEUP_INTERRUPT);
wake_up_all(&current->wqh_recv, WAKEUP_INTERRUPT);
current->exit_code = exit_code;
sched_exit_sync();
}
int thread_wait(struct ktcb *task)
{
unsigned int exit_code;
int ret;
/* Wait until task switches to desired state */
@@ -118,8 +124,12 @@ int thread_wait(struct ktcb *task)
task->state == TASK_DEAD, ret);
if (ret < 0)
return ret;
else
return (int)task->exit_code;
else {
exit_code = (int)task->exit_code;
tcb_remove(task);
tcb_delete(task);
return exit_code;
}
}
int thread_destroy(struct ktcb *task, unsigned int exit_code)

View File

@@ -105,7 +105,7 @@ BEGIN_PROC(arm_invalidate_dcache)
END_PROC(arm_invalidate_dcache)
BEGIN_PROC(arm_clean_dcache)
mcr p15, 0 , pc, c7, c10, 3 @ Test/clean dcache line
mrc p15, 0 , pc, c7, c10, 3 @ Test/clean dcache line
bne arm_clean_dcache
mcr p15, 0, ip, c7, c10, 4 @ Drain WB
mov pc, lr

View File

@@ -233,10 +233,10 @@ void sched_exit_sync(void)
sched_rq_remove_task(current);
current->state = TASK_DEAD;
current->flags &= ~TASK_EXITING;
preempt_enable();
if (current->pagerid != current->tid)
wake_up(&current->wqh_pager, 0);
preempt_enable();
schedule();
}
@@ -247,10 +247,10 @@ void sched_exit_async(void)
sched_rq_remove_task(current);
current->state = TASK_DEAD;
current->flags &= ~TASK_EXITING;
preempt_enable();
if (current->pagerid != current->tid)
wake_up(&current->wqh_pager, 0);
preempt_enable();
need_resched = 1;
}
@@ -265,10 +265,10 @@ void sched_suspend_sync(void)
sched_rq_remove_task(current);
current->state = TASK_INACTIVE;
current->flags &= ~TASK_SUSPENDING;
preempt_enable();
if (current->pagerid != current->tid)
wake_up(&current->wqh_pager, 0);
preempt_enable();
schedule();
}
@@ -279,10 +279,10 @@ void sched_suspend_async(void)
sched_rq_remove_task(current);
current->state = TASK_INACTIVE;
current->flags &= ~TASK_SUSPENDING;
preempt_enable();
if (current->pagerid != current->tid)
wake_up(&current->wqh_pager, 0);
preempt_enable();
need_resched = 1;
}