voron

experimental ARM OS
git clone git://git.2f30.org/voron
Log | Files | Refs | README | LICENSE

commit 72c0ea32616df5f6e4054a6e2cefb1801679a365
parent 6443fb79dc04843ae686429d8d76080ae1a3fc1f
Author: oblique <psyberbits@gmail.com>
Date:   Mon,  5 Nov 2012 18:06:44 +0200

add suspend_task_no_schedule()

Diffstat:
Minclude/sched.h | 1+
Mkernel/sched.c | 11+++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/sched.h b/include/sched.h @@ -50,6 +50,7 @@ void msleep(u32 milliseconds); int kthread_create(void (*routine)(void *), void *arg); void schedule(void); void suspend_task(u32 channel); +void suspend_task_no_schedule(u32 channel); void resume_tasks(u32 channel); #endif /* __SCHED_H */ diff --git a/kernel/sched.c b/kernel/sched.c @@ -199,6 +199,17 @@ suspend_task(u32 channel) } void +suspend_task_no_schedule(u32 channel) +{ + irq_disable(); + current->sleep_chan = channel; + current->sleep_reason = SLEEPR_SUSPEND; + current->state = TASK_SLEEPING; + irq_enable(); + /* caller *must* run schedule() */ +} + +void resume_tasks(u32 channel) { struct list_head *iter, *n;