view TaskManager/kernel/sys_task/TaskArray.cc @ 684:458a1ad91427

Task Array generation worked.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 06 Dec 2009 23:03:28 +0900
parents 9a6cb2439593
children b386522827ae
line wrap: on
line source

#include "Finish.h"
#include "SysFunc.h"
#include "Scheduler.h"
#include "Task.h"


SchedDefineTask(TaskArray);

#ifdef SIMPLE_TASK
static Task *
next(Task *t) 
{
    char *p = (char*)t;
    p += t->size();
    return (Task*)p;
}
#endif

static int
run(SchedTask *s,void *rbuf, void *wbuf)
{
#ifdef SIMPLE_TASK
    Task *task = (Task *)rbuf;
    Task *last = (Task*)(((char*)rbuf)+ s->read_size());

    s->printf("last = %lx\n"   ,(long) last);
    while( task <  last) {
	s->printf("  task = %lx\n"   ,(long) task);
	task->print();
	task = next(task);
    }
#endif

    return 0;
}