46
|
1 #ifndef INCLUDED_TYPES
|
|
2 #define INCLUDED_TYPES
|
|
3
|
109
|
4 #include <stdint.h>
|
|
5
|
|
6 typedef uint32_t uint32;
|
|
7 typedef uint64_t uint64;
|
46
|
8
|
|
9 #define SPE_ALIGNMENT 16
|
|
10 #define SPE_ALIGNMENT_FULL 128
|
|
11 #define SPE_ALIGN __attribute__((aligned(SPE_ALIGNMENT)))
|
|
12 #define SPE_ALIGN_FULL __attribute__((aligned(SPE_ALIGNMENT_FULL))
|
|
13 #define ROUND_UP_ALIGN(value, alignment) \
|
|
14 (((value) + ((alignment) - 1))&(~((alignment)-1)))
|
|
15 #define DEFAULT_ALIGNMENT SPE_ALIGNMENT
|
109
|
16 //#define DEFAULT_ALIGNMENT SPE_ALIGNMENT_FULL
|
46
|
17
|
58
|
18 #define DMA_MAX_SIZE 16384
|
|
19
|
88
|
20 #define round_up16(value) ROUND_UP_ALIGN(value, 16)
|
|
21 #define round_up128(value) ROUND_UP_ALIGN(value, 128)
|
|
22
|
65
|
23 // ここも typedef しとくか?
|
46
|
24 enum {
|
109
|
25 // どの方向かで enum 分けるだろjk...
|
|
26 // PPE -> SPE
|
|
27 MY_SPE_NOP = 0,
|
46
|
28 MY_SPE_COMMAND_EXIT,
|
|
29 MY_SPE_COMMAND_GO,
|
|
30
|
109
|
31 // SPE -> PPE
|
46
|
32 MY_SPE_STATUS_BUSY,
|
109
|
33 MY_SPE_STATUS_READY,
|
|
34 MY_SPE_COMMAND_MALLOC,
|
46
|
35 };
|
|
36
|
109
|
37 #define MAX_USE_SPE_NUM 6
|
|
38
|
65
|
39 typedef enum {
|
109
|
40 CPU_PPE = 0, // default
|
|
41 CPU_SPE = 1,
|
|
42 SPE_ANY = CPU_SPE,
|
|
43 SPE_0 = 2,
|
|
44 SPE_1 = 3,
|
|
45 SPE_2 = 4,
|
|
46 SPE_3 = 5,
|
|
47 SPE_4 = 6,
|
|
48 SPE_5 = 7,
|
65
|
49 } CPU_TYPE;
|
|
50
|
46
|
51 #endif
|