annotate TaskManager/kernel/ppe/SimpleTask.h @ 895:b662e9dd26b0 draft

add alignment of classes in SPU width and height are automatically set in frame buffer API
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 16 Jul 2010 17:23:49 +0900
parents 2faa1f62d925
children 6bd218d3f643
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
16 memaddr rbuf;
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
17 memaddr wbuf;
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
18 int r_size;
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
19 int w_size;
893
2faa1f62d925 fix SimpleTask alignment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
20 int dm1; // sizeof(SimpleTask)==32
2faa1f62d925 fix SimpleTask alignment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
21 int dm2;
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
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
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
27 SimpleTask(int r, memaddr read, int w, memaddr write) {
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
28 r_size = r; rbuf = read;
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
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
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
32 void set_input(memaddr i,int size) { r_size = size; rbuf= i; }
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
33 void set_output(memaddr o,int size) { w_size = size; wbuf= o; }
626
0e91ddaad798 64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
895
b662e9dd26b0 add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 893
diff changeset
35 } __attribute__ ((aligned (DEFAULT_ALIGNMENT)));
626
0e91ddaad798 64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
0e91ddaad798 64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 typedef SimpleTask *SimpleTaskPtr;
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 #endif
0e91ddaad798 64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40