Mercurial > hg > Members > kono > Cerium
changeset 648:f1e10ba45d28
Mail modification. Working on Mac OS X.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 21 Nov 2009 20:14:45 +0900 |
parents | 7c9ded1ea750 |
children | 55f898a58748 |
files | TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/Makefile.def TaskManager/kernel/ppe/HTaskInfo.cc TaskManager/test/MailManagerTest.cc TaskManager/test/Makefile |
diffstat | 5 files changed, 67 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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();
--- 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
--- 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 }
--- /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 <stdio.h> +#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 */
--- /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)