Mercurial > hg > Game > Cerium
annotate TaskManager/kernel/ppe/SimpleTask.h @ 1546:61164c687b29 draft
fix GpuScheduler flip
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 05 Feb 2013 13:15:46 +0900 |
parents | 9ed1c4a877ca |
children |
rev | line source |
---|---|
626
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #ifndef INCLUDED_SIPMLE_TASK |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 #define INCLUDED_SIPMLE_TASK |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 #include "base.h" |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 #include "types.h" |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 #define MAX_PARAMS 8 |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 class SimpleTask { |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 public: // variables |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 BASE_NEW_DELETE(SimpleTask); |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 int command; // 4 byte |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 memaddr self; // 4 byte (or 8byte on 64bit mode) |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 |
634 | 16 memaddr rbuf; |
17 memaddr wbuf; | |
18 int r_size; | |
19 int w_size; | |
897
6bd218d3f643
add return address in SimpleTask for debugging.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
895
diff
changeset
|
20 memaddr from; |
945
9ed1c4a877ca
sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
897
diff
changeset
|
21 memaddr param; // sizeof(SimpleTask)==32 |
634 | 22 |
626
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 public: // functions |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 SimpleTask() {}; |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 |
634 | 27 SimpleTask(int r, memaddr read, int w, memaddr write) { |
28 r_size = r; rbuf = read; | |
29 w_size = w; wbuf = write; | |
626
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 }; |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 |
634 | 32 void set_input(memaddr i,int size) { r_size = size; rbuf= i; } |
33 void set_output(memaddr o,int size) { w_size = size; wbuf= o; } | |
945
9ed1c4a877ca
sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
897
diff
changeset
|
34 void set_param(memaddr data) { param = data; } |
9ed1c4a877ca
sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
897
diff
changeset
|
35 memaddr get_param() { return param; } |
626
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 |
895
b662e9dd26b0
add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
893
diff
changeset
|
37 } __attribute__ ((aligned (DEFAULT_ALIGNMENT))); |
626
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 typedef SimpleTask *SimpleTaskPtr; |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 #endif |
0e91ddaad798
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 |