Mercurial > hg > Game > Cerium
annotate TaskManager/include/types.h @ 604:78c0cb72ea61 draft
fix mail box size
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 07 Nov 2009 14:23:40 +0900 |
parents | 57ec231bc8ac |
children | 94d82f2c842f |
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 |
602
92b0d490e839
64bit mode try... not worked.
e075740@nw0740.st.ie.u-ryukyu.ac.jp
parents:
395
diff
changeset
|
10 #if SPU // ifdef SPU |
365 | 11 typedef uint64_t memaddr; |
364 | 12 #else |
367 | 13 #ifdef MODE64 |
365 | 14 typedef uint64_t memaddr; |
364 | 15 #else |
604 | 16 // In LP64, sizeof(unsigned long)==8 |
17 typedef unsigned long memaddr; | |
364 | 18 #endif |
19 #endif | |
46 | 20 |
395 | 21 |
22 | |
23 | |
46 | 24 #define SPE_ALIGNMENT 16 |
25 #define SPE_ALIGNMENT_FULL 128 | |
26 #define SPE_ALIGN __attribute__((aligned(SPE_ALIGNMENT))) | |
27 #define SPE_ALIGN_FULL __attribute__((aligned(SPE_ALIGNMENT_FULL)) | |
28 #define ROUND_UP_ALIGN(value, alignment) \ | |
29 (((value) + ((alignment) - 1))&(~((alignment)-1))) | |
30 #define DEFAULT_ALIGNMENT SPE_ALIGNMENT | |
109 | 31 //#define DEFAULT_ALIGNMENT SPE_ALIGNMENT_FULL |
46 | 32 |
58 | 33 #define DMA_MAX_SIZE 16384 |
34 | |
88 | 35 #define round_up16(value) ROUND_UP_ALIGN(value, 16) |
36 #define round_up128(value) ROUND_UP_ALIGN(value, 128) | |
37 | |
298 | 38 // ここも typedef しとくか? |
46 | 39 enum { |
298 | 40 // どの方向かで enum 分けるだろjk... |
109 | 41 // PPE -> SPE |
42 MY_SPE_NOP = 0, | |
46 | 43 MY_SPE_COMMAND_EXIT, |
44 MY_SPE_COMMAND_GO, | |
45 | |
109 | 46 // SPE -> PPE |
46 | 47 MY_SPE_STATUS_BUSY, |
109 | 48 MY_SPE_STATUS_READY, |
49 MY_SPE_COMMAND_MALLOC, | |
46 | 50 }; |
51 | |
109 | 52 #define MAX_USE_SPE_NUM 6 |
53 | |
65 | 54 typedef enum { |
109 | 55 CPU_PPE = 0, // default |
56 CPU_SPE = 1, | |
57 SPE_ANY = CPU_SPE, | |
58 SPE_0 = 2, | |
59 SPE_1 = 3, | |
60 SPE_2 = 4, | |
61 SPE_3 = 5, | |
62 SPE_4 = 6, | |
63 SPE_5 = 7, | |
65 | 64 } CPU_TYPE; |
65 | |
46 | 66 #endif |