Mercurial > hg > Members > kono > Cerium
annotate TaskManager/Cell/CellTaskListInfo.cc @ 808:8a6f1fa038de
TaskListInfo version
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 22 May 2010 22:32:41 +0900 |
parents | 8843edf37c0e |
children |
rev | line source |
---|---|
57 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 #include "CellTaskListInfo.h" | |
4 | |
60 | 5 #define NEXT_ADDR(addr, size) \ |
629
8843edf37c0e
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
109
diff
changeset
|
6 (TaskListPtr)((memaddr)(addr) + (size)) |
60 | 7 |
57 | 8 int |
808 | 9 TaskListInfo::extend_pool(int num) |
57 | 10 { |
808 | 11 TaskListPtr q; |
57 | 12 int unit_size; |
13 | |
109 | 14 unit_size = (ROUND_UP_ALIGN(sizeof(TaskList), DEFAULT_ALIGNMENT)); |
15 posix_memalign((void**)&q, DEFAULT_ALIGNMENT, unit_size*(num+1)); | |
57 | 16 |
808 | 17 // First Queue is previous pool |
18 q->waiter = waiter; waiter = q; | |
19 q++; | |
20 | |
21 /* Connect all free queue in the pool */ | |
22 TaskListPtr p = q; | |
23 for (; num-- > 0; p++) { | |
24 p->waiter = NULL; | |
25 taskListPool.addLast(p); | |
57 | 26 } |
27 | |
28 return 0; | |
29 } | |
808 | 30 |
31 /* end */ |