} sched_task_state_t;
struct sched {
- void (*tick)(struct sched*);
+ int (*tick)(struct sched*);
int (*sleep)(struct sched*, struct task*);
int (*wakeup)(struct sched*, struct task*, int);
#include <config.h>
+#include <corax/types.h>
#include <corax/errno.h>
+#include <corax/heap.h>
#include <arch.h>
#include <sched.h>
#include <kq.h>
task_lock(task);
- if(t->t_state != TASK_STATE_WAITING) {
- t->t_state = TASK_STATE_WAITING;
+ if(task->t_state != TASK_STATE_WAITING) {
+ task->t_state = TASK_STATE_WAITING;
ret_val = 0;
}
task_lock(task);
/* don't resume tasks that aren't waiting to be resumed */
- if(t->t_state == TASK_STATE_WAITING) {
- t->t_state = flags ? TASK_STATE_SIGNAL : TASK_STATE_READY;
+ if(task->t_state == TASK_STATE_WAITING) {
+ task->t_state = flags ? TASK_STATE_SIGNAL : TASK_STATE_READY;
ret_val = 0;
} else {
ret_val = -EBUSY;
if(!ret_val) {
_LOCK(lazy);
- ret_val = kq_rm(&(lazy->waitq, task));
+ ret_val = kq_rm(&(lazy->waitq), task);
/* don't enqueue the task if it wasn't on the wait queue */
if(!ret_val) {
sched = kmalloc(sizeof(*sched));
if(sched) {
- sched->parent.tick = (void(*)(struct sched*))_lazy_tick;
+ sched->parent.tick = (int(*)(struct sched*))_lazy_tick;
sched->parent.sleep = (int(*)(struct sched*, struct task*))_lazy_sleep;
sched->parent.wakeup = (int(*)(struct sched*, struct task*, int))_lazy_wakeup;
sched->parent.schedule = (int(*)(struct sched*, struct task*))_lazy_schedule;
int sched_lazy_free(struct sched *sched, struct sched *other)
{
-
+ return(-ENOSYS);
}