Mercurial > hg > Game > Cerium
view TaskManager/kernel/ppe/Task.h @ 684:ecf7e09b1fe8 draft
adding Array Task.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 06 Dec 2009 11:33:09 +0900 |
parents | c7199f162b64 |
children | 6e42b20f6198 |
line wrap: on
line source
#ifndef INCLUDED_TASK #define INCLUDED_TASK #include "base.h" #include "types.h" #include "ListData.h" #include "SimpleTask.h" #define MAX_PARAMS 8 #ifndef SIMPLE_TASK class Task : public SimpleTask { public: // variables BASE_NEW_DELETE(Task); int param_size; // 4 byte memaddr param[MAX_PARAMS]; // 4*MAX_PARAMS byte ListData inData __attribute__ ((aligned (DEFAULT_ALIGNMENT))); ListData outData __attribute__ ((aligned (DEFAULT_ALIGNMENT))); public: // functions int add_inData_t(memaddr addr, int size); // unsigned int ではなく 64bit int add_outData_t(memaddr addr, int size); // unsigned int ではなく 64bit int add_data(ListData &list, memaddr addr, int size); int add_param_t(memaddr param); // obsolete. do not use. int set_param_t(int index, memaddr param); #define add_param(param) add_param_t((memaddr)(param)) #define set_param(index,param) set_param_t(index, (memaddr) (param)) #define add_inData(addr, size) \ add_inData_t((memaddr)(addr), (size)); #define add_outData(addr, size) \ add_outData_t((memaddr)(addr), (size)); }; #else class Task { public: // variables BASE_NEW_DELETE(Task); int size; int param_size; memaddr *param; int inData_size; ListEelemnt *inData; int outData_size; ListElement *outData; public: // functions int add_inData_t(memaddr addr, int size); int add_outData_t(memaddr addr, int size); int set_inData_length(int length); int set_inData_t(int index, memaddr addr, int size); int set_outData_length(int length); int set_outData_t(int index, memaddr addr, int size); int add_data(ListData &list, memaddr addr, int size); void set_param_length(int i); int add_param_t(memaddr param); // obsolete. do not use. int set_param_t(int index, memaddr param); int size() { return size; } #define add_param(param) add_param_t((memaddr)(param)) #define set_param(index,param) set_param_t(index, (memaddr) (param)) #define add_inData(addr, size) \ add_inData_t((memaddr)(addr), (size)); #define add_outData(addr, size) \ add_outData_t((memaddr)(addr), (size)); #define set_inData(index, addr, size) \ set_inData_t(index, (memaddr)(addr), (size)); #define set_outData(index, addr, size) \ set_outData_t(index, (memaddr)(addr), (size)); }; #endif typedef Task* TaskPtr; #endif