Mercurial > hg > Members > kono > Cerium
changeset 253:1d8b8a4ac453
usr_help_str is nessesary for example
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Sun May 31 20:08:42 2009 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Wed Jun 03 14:32:41 2009 +0900 @@ -212,7 +212,7 @@ speThreads->get_mail(id, 2, alloc_info); command = alloc_info[0]; - allock_size = alloc_info[1]; + alloc_size = alloc_info[1]; alloc_info[1] = (unsigned int)allocate(alloc_size);
--- a/TaskManager/Cell/SpeThreads.cc Sun May 31 20:08:42 2009 +0900 +++ b/TaskManager/Cell/SpeThreads.cc Wed Jun 03 14:32:41 2009 +0900 @@ -154,7 +154,7 @@ } void -SpeThreads::add_output_tasklist(int command, void *buff, int alloc_size) +SpeThreads::add_output_tasklist(int command, unsigned int buff, int alloc_size) { /* * output TaskList が無ければ新しく作る
--- a/TaskManager/kernel/main.cc Sun May 31 20:08:42 2009 +0900 +++ b/TaskManager/kernel/main.cc Wed Jun 03 14:32:41 2009 +0900 @@ -11,27 +11,32 @@ defaultTMend(void) {} TaskManager *manager; -static char help_str[] = "\n\ +const char *help_str = "\n\ * Cerium program option *\n\ - -chelp Print this message \n\ + -help Print this message \n\ -cpu Number of CPU (default 1) \n"; +extern const char *usr_help_str; + int main(int argc, char *argv[]) { - int cpuNum = 1; + int machineNum = 1; for (int i = 1; argv[i]; ++i) { if (strcmp(argv[i], "-cpu") == 0) { - cpuNum = atoi(argv[++i]); + machineNum = atoi(argv[++i]); } - if (strcmp(argv[i], "-chelp") == 0) { - printf("%s\n", help_str); + if (strcmp(argv[i], "-help") == 0) { + if (usr_help_str) { + printf("%s", usr_help_str); + } + printf("%s", help_str); return EXIT_SUCCESS; } } - manager = new TaskManager(cpuNum); + manager = new TaskManager(machineNum); manager->init(); manager->set_TMend(defaultTMend);
--- a/example/HelloWorld/Makefile Sun May 31 20:08:42 2009 +0900 +++ b/example/HelloWorld/Makefile Wed Jun 03 14:32:41 2009 +0900 @@ -8,13 +8,13 @@ @echo "Make for Linux" @$(MAKE) -f Makefile.linux -ps3: FORCE +cell: FORCE @echo "Make for PS3 (Cell)" - @$(MAKE) -f Makefile.ps3 + @$(MAKE) -f Makefile.cell FORCE: clean: @$(MAKE) -f Makefile.macosx clean @$(MAKE) -f Makefile.linux clean - @$(MAKE) -f Makefile.ps3 clean \ No newline at end of file + @$(MAKE) -f Makefile.cell clean \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/HelloWorld/Makefile.cell Wed Jun 03 14:32:41 2009 +0900 @@ -0,0 +1,42 @@ +include ./Makefile.def + +SRCS_TMP = $(wildcard *.cc) +SRCS_EXCLUDE = # 除外するファイルを書く +SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) +OBJS = $(SRCS:.cc=.o) + +TASK_DIR = ppe +TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) +TASK_SRCS_EXCLUDE = +TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) +TASK_OBJS = $(TASK_SRCS:.cc=.o) + +LIBS += -lCellManager -lspe2 -lpthread -Wl,--gc-sections + +.SUFFIXES: .cc .o + +.cc.o: + $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + +all: $(TARGET) speobject + +$(TARGET): $(OBJS) $(TASK_OBJS) + $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) + +speobject: + cd spe; $(MAKE) + +run: + ./$(TARGET) -cpu 6 + +link: + $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) + +debug: $(TARGET) + sudo ppu-gdb ./$(TARGET) + +clean: + rm -f $(TARGET) $(OBJS) $(TASK_OBJS) + rm -f *~ \#* + rm -f ppe/*~ ppe/\#* + cd spe; $(MAKE) clean
--- a/example/HelloWorld/Makefile.def Sun May 31 20:08:42 2009 +0900 +++ b/example/HelloWorld/Makefile.def Wed Jun 03 14:32:41 2009 +0900 @@ -5,7 +5,7 @@ #CERIUM = /Users/gongo/Source/Cerium # ex: linux/ps3 -CERIUM = /home/gongo/Cerium +CERIUM = ../../../Cerium CC = g++ CFLAGS = -g -Wall -O9
--- a/example/HelloWorld/Makefile.ps3 Sun May 31 20:08:42 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -include ./Makefile.def - -SRCS_TMP = $(wildcard *.cc) -SRCS_EXCLUDE = # 除外するファイルを書く -SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) -OBJS = $(SRCS:.cc=.o) - -TASK_DIR = ppe -TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) -TASK_SRCS_EXCLUDE = -TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) -TASK_OBJS = $(TASK_SRCS:.cc=.o) - -LIBS += -lCellManager -lspe2 -lpthread -Wl,--gc-sections - -.SUFFIXES: .cc .o - -.cc.o: - $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ - -all: $(TARGET) speobject - -$(TARGET): $(OBJS) $(TASK_OBJS) - $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) - -speobject: - cd spe; $(MAKE) - -link: - $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) - -debug: $(TARGET) - sudo ppu-gdb ./$(TARGET) - -clean: - rm -f $(TARGET) $(OBJS) $(TASK_OBJS) - rm -f *~ \#* - rm -f ppe/*~ ppe/\#* - cd spe; $(MAKE) clean
--- a/example/HelloWorld/main.cc Sun May 31 20:08:42 2009 +0900 +++ b/example/HelloWorld/main.cc Wed Jun 03 14:32:41 2009 +0900 @@ -10,7 +10,7 @@ extern TaskManager *manager; -char *help_str = "Usage: ./hello [-cpu spe_num] [-count N]\n\ +const char *usr_help_str = "Usage: ./hello [-cpu spe_num] [-count N]\n\ -cpu Number of SPE (default 1) \n\ -count Number of task is print \"Hello, World!!\""; @@ -21,10 +21,7 @@ if (strcmp(argv[i], "-count") == 0) { count = atoi(argv[++i]); } - if (strcmp(argv[i], "--help") == 0) { - printf("%s\n", help_str); - return -1; - } + } return 0; @@ -60,7 +57,7 @@ } int -cerium_main(int argc, char *argv[]) +TMmain(int argc, char *argv[]) { if (init(argc, argv) < 0) { return -1;
--- a/example/HelloWorld/spe/Makefile Sun May 31 20:08:42 2009 +0900 +++ b/example/HelloWorld/spe/Makefile Wed Jun 03 14:32:41 2009 +0900 @@ -8,8 +8,8 @@ CC = spu-g++ CFLAGS = -O9 -g -Wall -fno-exceptions -fno-rtti#-DDEBUG -INCLUDE = -I${CERIUM}/include/TaskManager -I. -I.. -LIBS = -L${CERIUM}/TaskManager -lspemanager -Wl,--gc-sections +INCLUDE = -I../${CERIUM}/include/TaskManager -I. -I.. +LIBS = -L../${CERIUM}/TaskManager -lspemanager -Wl,--gc-sections .SUFFIXES: .cc .o
--- a/include/TaskManager/SpeThreads.h Sun May 31 20:08:42 2009 +0900 +++ b/include/TaskManager/SpeThreads.h Wed Jun 03 14:32:41 2009 +0900 @@ -24,7 +24,7 @@ void send_mail(int speid, int num, unsigned int *data); // BLOCKING static void *spe_thread_run(void *arg); static void *frontend_thread_run(void *arg); - void add_output_tasklist(int command, void *buff, int alloc_size); + void add_output_tasklist(int command, unsigned int buff, int alloc_size); private: /* variables */