Mercurial > hg > Members > yutaka > manager
diff 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 |
line wrap: on
line diff
--- a/ppe/Sys.cc Mon Apr 12 00:32:34 2010 +0900 +++ b/ppe/Sys.cc Mon Apr 12 23:58:19 2010 +0900 @@ -67,13 +67,23 @@ } +void* +get_addr(void *buff, int size) +{ + + char* p; + p = (char*)buff; + p = p + size; + + return p; + +} + void fix_type(task_t *task, void *buff) { - char *p; - p = (char*)buff; - p = p + sizeof(task_head_t); + void *p = get_addr(buff, sizeof(task_head_t)); task->head = (task_head_t*)buff; task->input = p; @@ -84,7 +94,7 @@ task_allocate(int in_size, int out_size) { - if (in_size % 16) { + if (in_size % 16 || in_size + sizeof(task_head_t) > MAX_DMA_SIZE ) { printf("allocate in_size is not multiple of 16\n"); }