Mercurial > hg > Game > CbCTaskManager
changeset 6:51c3a631a7bc
add taskinit.
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 25 Dec 2009 17:55:24 +0900 |
parents | 91a07e20e06d |
children | 299cc57f332b |
files | taskinit.cbc taskinit.h |
diffstat | 2 files changed, 43 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskinit.cbc Fri Dec 25 17:55:24 2009 +0900 @@ -0,0 +1,15 @@ +#include "Task.h" +#include "taskinit.h" + +const int max_tasktype = MAX_TASKCLASS; + +#undef DEFINETASKTYPE +#define DEFINETASKTYPE(_var, _code0, _name, _type) \ + { _code0, _name, _type }, + +const TaskType tasktypes[] = { + #include "task.def" +}; + + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskinit.h Fri Dec 25 17:55:24 2009 +0900 @@ -0,0 +1,28 @@ + +/* 自動生成ファイル? */ +/* Ceriumが自動で生成するけど、ユーザ側でコンパイルするべきかな */ + +/* ユーザはtasks.defを定義する */ +/* DEFINETASK(TASK, code, "task name", CPU_TYPE) */ + +/* define code segment of tasks. */ +#undef DEFINETASKTYPE +#define DEFINETASKTYPE(_var, _code0, _name, _type) \ + extern __code _code0(void*,void*,void*); + +#include "task.def" + +//extern __code taskA(Scheduler, void*, void*); +//extern __code taskB(Scheduler, void*, void*); + +/* define task type id. */ +#undef DEFINETASKTYPE +#define DEFINETASKTYPE(_var, _code0, _name, _type) \ + _var, +enum typeid { + NOP = 0, + DUMMY, + #include "task.def" + MAX_TASKCLASS +}; +