Mercurial > hg > Game > Cerium
annotate TaskManager/include/types.h @ 1553:21ddbc06dcde draft
fix GpuScheduler
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 17 Feb 2013 19:42:36 +0900 |
parents | 5ca4e9469c65 |
children | 4fed76f4d101 |
rev | line source |
---|---|
46 | 1 #ifndef INCLUDED_TYPES |
2 #define INCLUDED_TYPES | |
3 | |
109 | 4 #include <stdint.h> |
5 | |
387
b6fce69839b5
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
367
diff
changeset
|
6 typedef uint16_t uint16; |
109 | 7 typedef uint32_t uint32; |
8 typedef uint64_t uint64; | |
395 | 9 |
631
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
10 // HOST main memory address |
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
11 // SPU's (void *) is always 32bit (actually 18bit (256kbyte)) |
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
12 // memaddr is different from (void *) in SPU. |
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
13 // |
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
14 #ifdef __SPU__ |
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
15 #if ABIBIT>32 |
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
16 typedef uint64_t memaddr; |
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
17 #else |
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
18 typedef uint32_t memaddr; |
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
19 #endif |
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
20 #else |
625
94d82f2c842f
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
604
diff
changeset
|
21 typedef char* memaddr; |
631
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
626
diff
changeset
|
22 #endif |
395 | 23 |
24 | |
868
08ed5e750d78
[aquarium]: update screen scope on linda with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
647
diff
changeset
|
25 #define Newq(Type,Count) ((Type *)malloc(sizeof(Type)*Count)) |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
631
diff
changeset
|
26 #define ReAlloc(Pointer,Type,Count) ((Type *)realloc((void*)Pointer,sizeof(Type)*Count)) |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
631
diff
changeset
|
27 |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
631
diff
changeset
|
28 |
46 | 29 #define SPE_ALIGNMENT 16 |
30 #define SPE_ALIGNMENT_FULL 128 | |
31 #define SPE_ALIGN __attribute__((aligned(SPE_ALIGNMENT))) | |
32 #define SPE_ALIGN_FULL __attribute__((aligned(SPE_ALIGNMENT_FULL)) | |
33 #define ROUND_UP_ALIGN(value, alignment) \ | |
34 (((value) + ((alignment) - 1))&(~((alignment)-1))) | |
35 #define DEFAULT_ALIGNMENT SPE_ALIGNMENT | |
109 | 36 //#define DEFAULT_ALIGNMENT SPE_ALIGNMENT_FULL |
46 | 37 |
58 | 38 #define DMA_MAX_SIZE 16384 |
39 | |
88 | 40 #define round_up16(value) ROUND_UP_ALIGN(value, 16) |
41 #define round_up128(value) ROUND_UP_ALIGN(value, 128) | |
42 | |
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:
868
diff
changeset
|
43 #define TaskArray (-1) |
9ed1c4a877ca
sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
868
diff
changeset
|
44 #define TaskArray1 (-2) |
9ed1c4a877ca
sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
868
diff
changeset
|
45 |
9ed1c4a877ca
sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
868
diff
changeset
|
46 // SPU 依存 (よろしくないが...) |
9ed1c4a877ca
sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
868
diff
changeset
|
47 |
298 | 48 // ここも typedef しとくか? |
46 | 49 enum { |
298 | 50 // どの方向かで enum 分けるだろjk... |
109 | 51 // PPE -> SPE |
52 MY_SPE_NOP = 0, | |
46 | 53 MY_SPE_COMMAND_EXIT, |
54 MY_SPE_COMMAND_GO, | |
55 | |
109 | 56 // SPE -> PPE |
46 | 57 MY_SPE_STATUS_BUSY, |
109 | 58 MY_SPE_STATUS_READY, |
59 MY_SPE_COMMAND_MALLOC, | |
46 | 60 }; |
61 | |
1477
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
62 #define MAX_USE_SPE_NUM 32 |
109 | 63 |
65 | 64 typedef enum { |
109 | 65 CPU_PPE = 0, // default |
1477
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
66 GPU_0 = 1, |
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
67 GPU_1 = 2, |
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
68 GPU_2 = 3, |
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
69 GPU_3 = 4, |
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
70 CPU_SPE = 5, |
109 | 71 SPE_ANY = CPU_SPE, |
1477
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
72 SPE_0 = 6, |
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
73 SPE_1 = 7, |
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
74 SPE_2 = 8, |
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
75 SPE_3 = 9, |
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
76 SPE_4 = 10, |
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
77 SPE_5 = 11, |
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
78 |
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
945
diff
changeset
|
79 |
65 | 80 } CPU_TYPE; |
81 | |
46 | 82 #endif |