Mercurial > hg > Members > kono > Cerium
changeset 649:55f898a58748
MailManager Fifo fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 22 Nov 2009 18:53:05 +0900 |
parents | f1e10ba45d28 |
children | 1622da029306 |
files | Renderer/Engine/Func.h Renderer/Engine/RenderingGlobal.h Renderer/Engine/RenderingTasks.h TaskManager/Makefile.def TaskManager/kernel/ppe/HTaskInfo.cc TaskManager/kernel/ppe/MailManager.cc TaskManager/test/MailManagerTest.cc TaskManager/test/Makefile example/dependency_task/Makefile.def example/dependency_task/Makefile.macosx example/word_count/Func.h example/word_count/Makefile.macosx |
diffstat | 12 files changed, 59 insertions(+), 54 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/Func.h Sat Nov 21 20:14:45 2009 +0900 +++ b/Renderer/Engine/Func.h Sun Nov 22 18:53:05 2009 +0900 @@ -1,40 +1,10 @@ enum { - - INIT, - SDL_INIT, - FINISH, - - Create_SGP, - Update_SGP, - CreatePolygon, - CreatePolygonFromSceneGraph, - CreateSpan, - - DrawSpan, - DrawBack, - - LoadTexture, - SetTexture, - - Move, - Draw, - - Dummy, - - UpdateKey, - InitKey, - - ShowTime, - Switch, - - ChainMove, - ChainCal, - ChainInit, - - - RUN_FINISH, - +#include "SysTasks.h" +#include "RenderingTasks.h" }; -#define DATA_ID 0 +enum { +#include "RenderingGlobal.h" +}; +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Engine/RenderingGlobal.h Sun Nov 22 18:53:05 2009 +0900 @@ -0,0 +1,1 @@ + DATA_ID,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Engine/RenderingTasks.h Sun Nov 22 18:53:05 2009 +0900 @@ -0,0 +1,34 @@ + INIT, + SDL_INIT, + FINISH, + + Create_SGP, + Update_SGP, + CreatePolygon, + CreatePolygonFromSceneGraph, + CreateSpan, + + DrawSpan, + DrawBack, + + LoadTexture, + SetTexture, + + Move, + Draw, + + Dummy, + + UpdateKey, + InitKey, + + ShowTime, + Switch, + + ChainMove, + ChainCal, + ChainInit, + + + RUN_FINISH, +
--- a/TaskManager/Makefile.def Sat Nov 21 20:14:45 2009 +0900 +++ b/TaskManager/Makefile.def Sun Nov 22 18:53:05 2009 +0900 @@ -29,8 +29,8 @@ ABIBIT = 32 -SIMPLE_TASK=-DSIMPLE_TASK -# SIMPLE_TASK= +# SIMPLE_TASK=-DSIMPLE_TASK +SIMPLE_TASK= CC = g++ CFLAGS = $(SIMPLE_TASK) -Wall `sdl-config --cflags` -g -m$(ABIBIT) # -O9
--- a/TaskManager/kernel/ppe/HTaskInfo.cc Sat Nov 21 20:14:45 2009 +0900 +++ b/TaskManager/kernel/ppe/HTaskInfo.cc Sun Nov 22 18:53:05 2009 +0900 @@ -90,7 +90,7 @@ task->set_output(wbuf, ws); return task; #else - fprintf("TaskManager is not SIMPLE_TASK mode\n"); + fprintf(stderr, "TaskManager is not SIMPLE_TASK mode\n"); return 0; #endif }
--- a/TaskManager/kernel/ppe/MailManager.cc Sat Nov 21 20:14:45 2009 +0900 +++ b/TaskManager/kernel/ppe/MailManager.cc Sun Nov 22 18:53:05 2009 +0900 @@ -29,20 +29,19 @@ MailManager::send(memaddr data) { queue[write++] = data; + write &= mask; if (write==read) { - - calc_mask(size*2); - - memaddr *newq = New(memaddr,size); - int i; - while(count()>0) { - newq[i++] = recv(); + 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; } - write &= mask; } memaddr
--- a/TaskManager/test/MailManagerTest.cc Sat Nov 21 20:14:45 2009 +0900 +++ b/TaskManager/test/MailManagerTest.cc Sun Nov 22 18:53:05 2009 +0900 @@ -11,10 +11,10 @@ tester(MailManagerPtr m, int size) { - for(int i=0;i<16;i++) { + for(int i=0;i<size;i++) { m->send((memaddr)i); } - for(int i=0;i<16;i++) { + for(int i=0;i<size;i++) { if (m->count()==0) { fail("early read fail\n"); break; }
--- a/TaskManager/test/Makefile Sat Nov 21 20:14:45 2009 +0900 +++ b/TaskManager/test/Makefile Sun Nov 22 18:53:05 2009 +0900 @@ -1,6 +1,6 @@ include ../Makefile.def -CPPFLAGS += -I../../include -m$(ABIBIT) +CPPFLAGS += -g -Wall -I../../include -m$(ABIBIT) TARGET=MailManagerTest
--- a/example/dependency_task/Makefile.def Sat Nov 21 20:14:45 2009 +0900 +++ b/example/dependency_task/Makefile.def Sun Nov 22 18:53:05 2009 +0900 @@ -7,7 +7,9 @@ # ex: linux/ps3 CERIUM = ../../../Cerium -CC = g++ +ABIBIT=32 + +CC = g++ -m$(ABIBIT) CFLAGS = -g -Wall -O9 INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
--- a/example/dependency_task/Makefile.macosx Sat Nov 21 20:14:45 2009 +0900 +++ b/example/dependency_task/Makefile.macosx Sun Nov 22 18:53:05 2009 +0900 @@ -1,7 +1,5 @@ include ./Makefile.def -CC += -m64 - SRCS_TMP = $(wildcard *.cc) SRCS_EXCLUDE = # 除外するファイルを書く SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))