annotate TaskManager/include/types.h @ 631:30dd8a3deb4a draft

Cell 64 bit tried, but not yet worked. Cell's list DMA is 32bit.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 18 Nov 2009 13:32:58 +0900
parents 0e91ddaad798
children 7ba4ad4538b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
46
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
1 #ifndef INCLUDED_TYPES
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
2 #define INCLUDED_TYPES
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
3
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
4 #include <stdint.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
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
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
7 typedef uint32_t uint32;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
8 typedef uint64_t uint64;
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 387
diff changeset
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
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 387
diff changeset
23
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 387
diff changeset
24
46
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
25 #define SPE_ALIGNMENT 16
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
26 #define SPE_ALIGNMENT_FULL 128
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
27 #define SPE_ALIGN __attribute__((aligned(SPE_ALIGNMENT)))
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
28 #define SPE_ALIGN_FULL __attribute__((aligned(SPE_ALIGNMENT_FULL))
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
29 #define ROUND_UP_ALIGN(value, alignment) \
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
30 (((value) + ((alignment) - 1))&(~((alignment)-1)))
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
31 #define DEFAULT_ALIGNMENT SPE_ALIGNMENT
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
32 //#define DEFAULT_ALIGNMENT SPE_ALIGNMENT_FULL
46
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
33
58
7492eb28b577 *** empty log message ***
gongo
parents: 46
diff changeset
34 #define DMA_MAX_SIZE 16384
7492eb28b577 *** empty log message ***
gongo
parents: 46
diff changeset
35
88
504899860e66 *** empty log message ***
gongo
parents: 65
diff changeset
36 #define round_up16(value) ROUND_UP_ALIGN(value, 16)
504899860e66 *** empty log message ***
gongo
parents: 65
diff changeset
37 #define round_up128(value) ROUND_UP_ALIGN(value, 128)
504899860e66 *** empty log message ***
gongo
parents: 65
diff changeset
38
298
768452fab95e from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
39 // ここも typedef しとくか?
46
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
40 enum {
298
768452fab95e from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
41 // どの方向かで enum 分けるだろjk...
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
42 // PPE -> SPE
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
43 MY_SPE_NOP = 0,
46
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
44 MY_SPE_COMMAND_EXIT,
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
45 MY_SPE_COMMAND_GO,
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
46
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
47 // SPE -> PPE
46
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
48 MY_SPE_STATUS_BUSY,
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
49 MY_SPE_STATUS_READY,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
50 MY_SPE_COMMAND_MALLOC,
46
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
51 };
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
52
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
53 #define MAX_USE_SPE_NUM 6
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
54
65
519d24aa7ac8 *** empty log message ***
gongo
parents: 58
diff changeset
55 typedef enum {
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
56 CPU_PPE = 0, // default
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
57 CPU_SPE = 1,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
58 SPE_ANY = CPU_SPE,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
59 SPE_0 = 2,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
60 SPE_1 = 3,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
61 SPE_2 = 4,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
62 SPE_3 = 5,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
63 SPE_4 = 6,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
64 SPE_5 = 7,
65
519d24aa7ac8 *** empty log message ***
gongo
parents: 58
diff changeset
65 } CPU_TYPE;
519d24aa7ac8 *** empty log message ***
gongo
parents: 58
diff changeset
66
46
f154d9d07a42 *** empty log message ***
gongo
parents:
diff changeset
67 #endif