Mercurial > hg > Game > Cerium
changeset 651:e78f70dc7ef8 draft
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 23 Nov 2009 10:01:02 +0900 |
parents | 0e9230150a38 |
children | aefb5ee6fcd0 c7199f162b64 |
files | TaskManager/kernel/ppe/MailManager.cc TaskManager/kernel/ppe/MailManager.h example/HelloWorld/Func.h example/MemList/Func.h example/basic/Func.h example/dependency_task/Func.h example/get_segment/Func.h example/mainMem/Func.h example/many_task/Func.h example/many_task/README example/many_task/sort.cc example/many_task/sort.h example/post_function/Func.h example/renew_task/Func.h example/share_task/Func.h example/task_queue/Func.h example/word_count3/Func.h |
diffstat | 17 files changed, 42 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/MailManager.cc Sun Nov 22 18:59:21 2009 +0900 +++ b/TaskManager/kernel/ppe/MailManager.cc Mon Nov 23 10:01:02 2009 +0900 @@ -5,7 +5,7 @@ MailManager::calc_mask(unsigned int qsize) { mask = 1; - while((qsize>>= 1)>0) { + while(qsize>mask) { mask <<= 1; } size = mask; @@ -26,21 +26,27 @@ } void +MailManager::extend() +{ + memaddr *newq = New(memaddr,size*2); + int i = 0; + while(i<size) { + newq[i++] = queue[read++]; + read &= mask; + } + read = 0; write = i; + calc_mask(size*2); + free(queue); + queue = newq; +} + +void MailManager::send(memaddr data) { queue[write++] = data; write &= mask; if (write==read) { - memaddr *newq = New(memaddr,size*2); - int i = 0; - while(i<size) { - newq[i++] = queue[read++]; - read &= mask; - } - read = 0; write = i; - calc_mask(size*2); - free(queue); - queue = newq; + externd(); } }
--- a/TaskManager/kernel/ppe/MailManager.h Sun Nov 22 18:59:21 2009 +0900 +++ b/TaskManager/kernel/ppe/MailManager.h Mon Nov 23 10:01:02 2009 +0900 @@ -24,6 +24,7 @@ unsigned int mask; void calc_mask(unsigned int qsize); + void extend(); }; typedef MailManager *MailManagerPtr;
--- a/example/HelloWorld/Func.h Sun Nov 22 18:59:21 2009 +0900 +++ b/example/HelloWorld/Func.h Mon Nov 23 10:01:02 2009 +0900 @@ -1,4 +1,5 @@ enum { +#include "SysTasks.h" HELLO_TASK, RUN_FINISH, };
--- a/example/MemList/Func.h Sun Nov 22 18:59:21 2009 +0900 +++ b/example/MemList/Func.h Mon Nov 23 10:01:02 2009 +0900 @@ -1,4 +1,5 @@ enum { +#include "SysTasks.h" HELLO_TASK, RUN_FINISH, };
--- a/example/basic/Func.h Sun Nov 22 18:59:21 2009 +0900 +++ b/example/basic/Func.h Mon Nov 23 10:01:02 2009 +0900 @@ -1,4 +1,5 @@ enum { +#include "SysTasks.h" TWICE_TASK, };
--- a/example/dependency_task/Func.h Sun Nov 22 18:59:21 2009 +0900 +++ b/example/dependency_task/Func.h Mon Nov 23 10:01:02 2009 +0900 @@ -1,4 +1,5 @@ enum { +#include "SysTasks.h" TASK_EXEC, TASK_PRINT, RUN_FINISH,
--- a/example/get_segment/Func.h Sun Nov 22 18:59:21 2009 +0900 +++ b/example/get_segment/Func.h Mon Nov 23 10:01:02 2009 +0900 @@ -1,4 +1,5 @@ enum { +#include "SysTasks.h" RUN_FINISH, HELLO_TASK, HELLO_TASK1,
--- a/example/mainMem/Func.h Sun Nov 22 18:59:21 2009 +0900 +++ b/example/mainMem/Func.h Mon Nov 23 10:01:02 2009 +0900 @@ -1,4 +1,5 @@ enum { +#include "SysTasks.h" HELLO_TASK, RUN_FINISH, };
--- a/example/many_task/Func.h Sun Nov 22 18:59:21 2009 +0900 +++ b/example/many_task/Func.h Mon Nov 23 10:01:02 2009 +0900 @@ -1,3 +1,4 @@ enum { +#include "SysTasks.h" QUICK_SORT, };
--- a/example/many_task/README Sun Nov 22 18:59:21 2009 +0900 +++ b/example/many_task/README Mon Nov 23 10:01:02 2009 +0900 @@ -10,3 +10,5 @@ がんばって解読してください。 わからないことがあれば前期ゲーム班に聞いてください。 e065723 Kinjo とか e065748 Nunota がわかると思います。 + +
--- a/example/many_task/sort.cc Sun Nov 22 18:59:21 2009 +0900 +++ b/example/many_task/sort.cc Mon Nov 23 10:01:02 2009 +0900 @@ -12,7 +12,7 @@ static int last_block_num; static int half_block_num; static int last_half_block_num; -static TaskManager *manager; +static TaskManger *manager; static void sort_restart(SchedTask *, void *, void *); static void sort_start(); @@ -62,6 +62,8 @@ if (--sort_count < 0) { return; } +#ifdef SIMPLE_TASK +#endif HTaskPtr fsort[split_num]; @@ -123,9 +125,10 @@ } void -sort_init(TaskManager *manager_, int cpuNum, int length) +sort_init(TaskManager *_manager, int cpuNum , int length ) { - manager = manager_; + + manager = _manager; data = (DataPtr)manager->allocate(sizeof(Data)*length); data_length = length; @@ -148,3 +151,4 @@ sort_start(); } +/* end */
--- a/example/many_task/sort.h Sun Nov 22 18:59:21 2009 +0900 +++ b/example/many_task/sort.h Mon Nov 23 10:01:02 2009 +0900 @@ -7,7 +7,7 @@ int pad[2]; } Data, *DataPtr; -extern void sort_init(TaskManager *,int, int); +extern void sort_init(SchedTask *,void *, void *); #define MAX_BLOCK_SIZE (int)(1024*16/(sizeof(Data)))
--- a/example/post_function/Func.h Sun Nov 22 18:59:21 2009 +0900 +++ b/example/post_function/Func.h Mon Nov 23 10:01:02 2009 +0900 @@ -1,5 +1,6 @@ enum { - HELLO_TASK = 0, +#include "SysTasks.h" + HELLO_TASK, }; #define DATA_NUM 12
--- a/example/renew_task/Func.h Sun Nov 22 18:59:21 2009 +0900 +++ b/example/renew_task/Func.h Mon Nov 23 10:01:02 2009 +0900 @@ -1,5 +1,6 @@ enum { - RENEW_START = 0, +#include "SysTasks.h" + RENEW_START, RENEW_REPEAT, RENEW1, RENEW2,
--- a/example/share_task/Func.h Sun Nov 22 18:59:21 2009 +0900 +++ b/example/share_task/Func.h Mon Nov 23 10:01:02 2009 +0900 @@ -1,4 +1,5 @@ enum { +#include "SysTasks.h" TASK_LOAD, TASK_EXEC, RUN_FINISH,