# HG changeset patch # User Shinji KONO # Date 1258802085 -32400 # Node ID 40bbccca363d46e7a6e81b283da9dd145e2f8ec6 # Parent 7ba4ad4538b10b9b62ade953dd40bd7e5a73e440 Mail modification. Working on Mac OS X. diff -r 7ba4ad4538b1 -r 40bbccca363d TaskManager/Fifo/FifoTaskManagerImpl.cc --- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Sat Nov 21 16:18:47 2009 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Sat Nov 21 20:14:45 2009 +0900 @@ -151,7 +151,8 @@ mainScheduler->mail_write_from_host((memaddr)list); // EXIT_COMMAND (番兵的な意味で) - // mainScheduler->send_mail_from_host((memaddr)MY_SPE_COMMAND_EXIT); + // これを読むと、mainScheduler->run() から抜けて来る。 + mainScheduler->mail_write_from_host((memaddr)MY_SPE_COMMAND_EXIT); // scheduler は受け取ったメールを元に実行する mainScheduler->run(); diff -r 7ba4ad4538b1 -r 40bbccca363d TaskManager/Makefile.def --- a/TaskManager/Makefile.def Sat Nov 21 16:18:47 2009 +0900 +++ b/TaskManager/Makefile.def Sat Nov 21 20:14:45 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 diff -r 7ba4ad4538b1 -r 40bbccca363d TaskManager/kernel/ppe/HTaskInfo.cc --- a/TaskManager/kernel/ppe/HTaskInfo.cc Sat Nov 21 16:18:47 2009 +0900 +++ b/TaskManager/kernel/ppe/HTaskInfo.cc Sat Nov 21 20:14:45 2009 +0900 @@ -90,6 +90,7 @@ task->set_output(wbuf, ws); return task; #else + fprintf("TaskManager is not SIMPLE_TASK mode\n"); return 0; #endif } diff -r 7ba4ad4538b1 -r 40bbccca363d TaskManager/test/MailManagerTest.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/test/MailManagerTest.cc Sat Nov 21 20:14:45 2009 +0900 @@ -0,0 +1,47 @@ +#include +#include "TaskManager/MailManager.h" + +static void +fail(const char *reason) +{ + printf("MailManagerTest failed %s", reason); +} + +static void +tester(MailManagerPtr m, int size) +{ + + for(int i=0;i<16;i++) { + m->send((memaddr)i); + } + for(int i=0;i<16;i++) { + if (m->count()==0) { + fail("early read fail\n"); break; + } + if (m->recv()!=(memaddr)i) { + fail("read data fail\n"); break; + } + } +} + +static void +test1() { + MailManagerPtr m = new MailManager(); + tester(m,16); + tester(m,32); + tester(m,48); + delete m; + MailManagerPtr m1 = new MailManager(40); + tester(m1,16); + tester(m1,48); + delete m1; +} + +int +main(int ac, const char *av[]) +{ + test1(); + printf("MailManagerTest succeed\n"); +} + +/* end */ diff -r 7ba4ad4538b1 -r 40bbccca363d TaskManager/test/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/test/Makefile Sat Nov 21 20:14:45 2009 +0900 @@ -0,0 +1,15 @@ +include ../Makefile.def + +CPPFLAGS += -I../../include -m$(ABIBIT) + +TARGET=MailManagerTest + +$(TARGET) : + +LIBS += ../libFifoManager.a + +MailManagerTest : MailManagerTest.o + $(CC) $(CFLAGS) -o $@ $? $(LIBS) + +clean: + rm -rf *.o $(TARGET)