comparison include/TaskManager/types.h @ 109:028ffc9c0375 draft

Cerium cvs version
author gongo@gendarme.local
date Wed, 12 Nov 2008 17:39:33 +0900
parents 504899860e66
children 768452fab95e
comparison
equal deleted inserted replaced
108:6f3b3dd3c095 109:028ffc9c0375
1 #ifndef INCLUDED_TYPES 1 #ifndef INCLUDED_TYPES
2 #define INCLUDED_TYPES 2 #define INCLUDED_TYPES
3 3
4 typedef unsigned int uint32; 4 #include <stdint.h>
5 typedef unsigned long long uint64; 5
6 typedef uint32_t uint32;
7 typedef uint64_t uint64;
6 8
7 #define SPE_ALIGNMENT 16 9 #define SPE_ALIGNMENT 16
8 #define SPE_ALIGNMENT_FULL 128 10 #define SPE_ALIGNMENT_FULL 128
9 #define SPE_ALIGN __attribute__((aligned(SPE_ALIGNMENT))) 11 #define SPE_ALIGN __attribute__((aligned(SPE_ALIGNMENT)))
10 #define SPE_ALIGN_FULL __attribute__((aligned(SPE_ALIGNMENT_FULL)) 12 #define SPE_ALIGN_FULL __attribute__((aligned(SPE_ALIGNMENT_FULL))
11 #define ROUND_UP_ALIGN(value, alignment) \ 13 #define ROUND_UP_ALIGN(value, alignment) \
12 (((value) + ((alignment) - 1))&(~((alignment)-1))) 14 (((value) + ((alignment) - 1))&(~((alignment)-1)))
13 #define DEFAULT_ALIGNMENT SPE_ALIGNMENT 15 #define DEFAULT_ALIGNMENT SPE_ALIGNMENT
16 //#define DEFAULT_ALIGNMENT SPE_ALIGNMENT_FULL
14 17
15 #define DMA_MAX_SIZE 16384 18 #define DMA_MAX_SIZE 16384
16 19
17 #define round_up16(value) ROUND_UP_ALIGN(value, 16) 20 #define round_up16(value) ROUND_UP_ALIGN(value, 16)
18 #define round_up128(value) ROUND_UP_ALIGN(value, 128) 21 #define round_up128(value) ROUND_UP_ALIGN(value, 128)
19 22
20 // ここも typedef しとくか? 23 // ここも typedef しとくか?
21 enum { 24 enum {
25 // どの方向かで enum 分けるだろjk...
26 // PPE -> SPE
27 MY_SPE_NOP = 0,
22 MY_SPE_COMMAND_EXIT, 28 MY_SPE_COMMAND_EXIT,
23 MY_SPE_COMMAND_GO, 29 MY_SPE_COMMAND_GO,
24 30
31 // SPE -> PPE
25 MY_SPE_STATUS_BUSY, 32 MY_SPE_STATUS_BUSY,
26 MY_SPE_STATUS_READY 33 MY_SPE_STATUS_READY,
34 MY_SPE_COMMAND_MALLOC,
27 }; 35 };
28 36
37 #define MAX_USE_SPE_NUM 6
38
29 typedef enum { 39 typedef enum {
30 CPU_PPE, // default 40 CPU_PPE = 0, // default
31 CPU_SPE 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,
32 } CPU_TYPE; 49 } CPU_TYPE;
33 50
34 #endif 51 #endif