Mercurial > hg > Game > Cerium
comparison 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 |
comparison
equal
deleted
inserted
replaced
683:262f28511797 | 684:ecf7e09b1fe8 |
---|---|
6 #include "ListData.h" | 6 #include "ListData.h" |
7 #include "SimpleTask.h" | 7 #include "SimpleTask.h" |
8 | 8 |
9 #define MAX_PARAMS 8 | 9 #define MAX_PARAMS 8 |
10 | 10 |
11 #ifndef SIMPLE_TASK | |
11 class Task : public SimpleTask { | 12 class Task : public SimpleTask { |
12 public: // variables | 13 public: // variables |
13 | 14 |
14 BASE_NEW_DELETE(Task); | 15 BASE_NEW_DELETE(Task); |
15 #ifndef SIMPLE_TASK | |
16 int param_size; // 4 byte | 16 int param_size; // 4 byte |
17 memaddr param[MAX_PARAMS]; // 4*MAX_PARAMS byte | 17 memaddr param[MAX_PARAMS]; // 4*MAX_PARAMS byte |
18 ListData inData __attribute__ ((aligned (DEFAULT_ALIGNMENT))); | 18 ListData inData __attribute__ ((aligned (DEFAULT_ALIGNMENT))); |
19 ListData outData __attribute__ ((aligned (DEFAULT_ALIGNMENT))); | 19 ListData outData __attribute__ ((aligned (DEFAULT_ALIGNMENT))); |
20 #endif | |
21 | 20 |
22 public: // functions | 21 public: // functions |
23 int add_inData_t(memaddr addr, int size); // unsigned int ではなく 64bit | 22 int add_inData_t(memaddr addr, int size); // unsigned int ではなく 64bit |
24 int add_outData_t(memaddr addr, int size); // unsigned int ではなく 64bit | 23 int add_outData_t(memaddr addr, int size); // unsigned int ではなく 64bit |
25 int add_data(ListData &list, memaddr addr, int size); | 24 int add_data(ListData &list, memaddr addr, int size); |
26 int add_param0(memaddr param); // obsolete. do not use. | 25 int add_param_t(memaddr param); // obsolete. do not use. |
27 int set_param0(int index, memaddr param); | 26 int set_param_t(int index, memaddr param); |
28 | 27 |
29 #define add_param(param) add_param0((memaddr)(param)) | 28 #define add_param(param) add_param_t((memaddr)(param)) |
30 #define set_param(index,param) set_param0(index, (memaddr) (param)) | 29 #define set_param(index,param) set_param_t(index, (memaddr) (param)) |
31 | 30 |
32 #define add_inData(addr, size) \ | 31 #define add_inData(addr, size) \ |
33 add_inData_t((memaddr)(addr), (size)); | 32 add_inData_t((memaddr)(addr), (size)); |
34 #define add_outData(addr, size) \ | 33 #define add_outData(addr, size) \ |
35 add_outData_t((memaddr)(addr), (size)); | 34 add_outData_t((memaddr)(addr), (size)); |
36 }; | 35 }; |
36 #else | |
37 class Task { | |
38 public: // variables | |
39 | |
40 BASE_NEW_DELETE(Task); | |
41 | |
42 int size; | |
43 int param_size; | |
44 memaddr *param; | |
45 int inData_size; | |
46 ListEelemnt *inData; | |
47 int outData_size; | |
48 ListElement *outData; | |
49 | |
50 public: // functions | |
51 int add_inData_t(memaddr addr, int size); | |
52 int add_outData_t(memaddr addr, int size); | |
53 int set_inData_length(int length); | |
54 int set_inData_t(int index, memaddr addr, int size); | |
55 int set_outData_length(int length); | |
56 int set_outData_t(int index, memaddr addr, int size); | |
57 int add_data(ListData &list, memaddr addr, int size); | |
58 void set_param_length(int i); | |
59 int add_param_t(memaddr param); // obsolete. do not use. | |
60 int set_param_t(int index, memaddr param); | |
61 int size() { return size; } | |
62 | |
63 #define add_param(param) add_param_t((memaddr)(param)) | |
64 #define set_param(index,param) set_param_t(index, (memaddr) (param)) | |
65 | |
66 #define add_inData(addr, size) \ | |
67 add_inData_t((memaddr)(addr), (size)); | |
68 #define add_outData(addr, size) \ | |
69 add_outData_t((memaddr)(addr), (size)); | |
70 #define set_inData(index, addr, size) \ | |
71 set_inData_t(index, (memaddr)(addr), (size)); | |
72 #define set_outData(index, addr, size) \ | |
73 set_outData_t(index, (memaddr)(addr), (size)); | |
74 }; | |
75 #endif | |
37 | 76 |
38 typedef Task* TaskPtr; | 77 typedef Task* TaskPtr; |
39 | 78 |
40 #endif | 79 #endif |