Mercurial > hg > Members > yutaka > manager
comparison ppe/Sys.cc @ 8:ec2c1003f9b6 default tip
fix mandel
author | yutaka@localhost.localdomain |
---|---|
date | Mon, 12 Apr 2010 23:58:19 +0900 |
parents | 8b4d6bf8c43d |
children |
comparison
equal
deleted
inserted
replaced
7:febf899d0043 | 8:ec2c1003f9b6 |
---|---|
65 posix_memalign(&buff, alignment, size); | 65 posix_memalign(&buff, alignment, size); |
66 return buff; | 66 return buff; |
67 | 67 |
68 } | 68 } |
69 | 69 |
70 void* | |
71 get_addr(void *buff, int size) | |
72 { | |
73 | |
74 char* p; | |
75 p = (char*)buff; | |
76 p = p + size; | |
77 | |
78 return p; | |
79 | |
80 } | |
81 | |
70 void | 82 void |
71 fix_type(task_t *task, void *buff) | 83 fix_type(task_t *task, void *buff) |
72 { | 84 { |
73 | 85 |
74 char *p; | 86 void *p = get_addr(buff, sizeof(task_head_t)); |
75 p = (char*)buff; | |
76 p = p + sizeof(task_head_t); | |
77 | 87 |
78 task->head = (task_head_t*)buff; | 88 task->head = (task_head_t*)buff; |
79 task->input = p; | 89 task->input = p; |
80 | 90 |
81 } | 91 } |
82 | 92 |
83 task_t* | 93 task_t* |
84 task_allocate(int in_size, int out_size) | 94 task_allocate(int in_size, int out_size) |
85 { | 95 { |
86 | 96 |
87 if (in_size % 16) { | 97 if (in_size % 16 || in_size + sizeof(task_head_t) > MAX_DMA_SIZE ) { |
88 printf("allocate in_size is not multiple of 16\n"); | 98 printf("allocate in_size is not multiple of 16\n"); |
89 } | 99 } |
90 | 100 |
91 if (out_size % 16) { | 101 if (out_size % 16) { |
92 printf("allocate out_size is not multiple of 16\n"); | 102 printf("allocate out_size is not multiple of 16\n"); |