# HG changeset patch # User Shinji KONO # Date 1244042419 -32400 # Node ID 8622eae386d1de57bce67bb89f251a6514d9e9e4 # Parent 6ecb2b8a25052b42572fc48d944a372bded4c69e merge diff -r 6ecb2b8a2505 -r 8622eae386d1 example/HelloWorld/ppe/#Hello.cc# --- a/example/HelloWorld/ppe/#Hello.cc# Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -#include -#include "SchedTask.h" -#include "Hello.h" -#include "Func.h" - -/* ’¤³’¤ì’¤Ï’ɬ’¿Ü */ - - -int -Hello::run(void *rbuf, void *wbuf) -{ - int task_id = get_param(0); - - printf("[%d] Hello, World!!\n", task_id); - - return 0; -} diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/Func.h --- a/example/busy_rate/Func.h Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -enum { - BUSY_TASK, -}; diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/Makefile --- a/example/busy_rate/Makefile Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -default: macosx - -macosx: FORCE - @echo "Make for Mac OS X" - @$(MAKE) -f Makefile.macosx - -linux: FORCE - @echo "Make for Linux" - @$(MAKE) -f Makefile.linux - -ps3: FORCE - @echo "Make for PS3 (Cell)" - @$(MAKE) -f Makefile.ps3 - -FORCE: - -clean: - @$(MAKE) -f Makefile.macosx clean - @$(MAKE) -f Makefile.linux clean - @$(MAKE) -f Makefile.ps3 clean \ No newline at end of file diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/Makefile.def --- a/example/busy_rate/Makefile.def Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -TARGET = busy - -# include/library path -# ex: macosx -#CERIUM = /Users/gongo/Source/Cerium - -# ex: linux/ps3 -CERIUM = /Users/e065746/Works/lab/hg/hiroki/Game_Project/Cerium - -CC = g++ -CFLAGS = -g -Wall -O9 - -INCLUDE = -I${CERIUM}/include/TaskManager -I. -I.. -LIBS = -L${CERIUM}/TaskManager diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/Makefile.linux --- a/example/busy_rate/Makefile.linux Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +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 += -lFifoManager - -.SUFFIXES: .cc .o - -.cc.o: - $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ - -all: $(TARGET) - -$(TARGET): $(OBJS) $(TASK_OBJS) - $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) - -link: - $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) - -debug: $(TARGET) - sudo gdb ./$(TARGET) - -clean: - rm -f $(TARGET) $(OBJS) $(TASK_OBJS) - rm -f *~ \#* - rm -f ppe/*~ ppe/\#* - rm -f spe/*~ spe/\#* diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/Makefile.macosx --- a/example/busy_rate/Makefile.macosx Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +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 += -lFifoManager `sdl-config --libs` - -.SUFFIXES: .cc .o - -.cc.o: - $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ - -all: $(TARGET) - -$(TARGET): $(OBJS) $(TASK_OBJS) - $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) - -link: - $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) - -debug: $(TARGET) - sudo gdb ./$(TARGET) - -clean: - rm -f $(TARGET) $(OBJS) $(TASK_OBJS) - rm -f *~ \#* - rm -f ppe/*~ ppe/\#* - rm -f spe/*~ spe/\#* diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/Makefile.ps3 --- a/example/busy_rate/Makefile.ps3 Thu Jun 04 00:16:56 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 diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/busy Binary file example/busy_rate/busy has changed diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/hello Binary file example/busy_rate/hello has changed diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/main.cc --- a/example/busy_rate/main.cc Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -#include -#include -#include -#include "TaskManager.h" -#include "Func.h" - -extern void task_init(void); - -void -busy_init(void) -{ - HTask *busy; - - for (int i = 0; i < 6; i++) { - - busy = manager->create_task(BUSY_TASK); - busy->set_cpu(SPE_ANY); - - busy->add_param(i); - busy->spawn(); - } -} - -int -TMmain(int argc, char *argv[]) -{ - task_init(); - busy_init(); - - return 0; -} diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/ppe/busy_rate.cc --- a/example/busy_rate/ppe/busy_rate.cc Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -#include -#include "SchedTask.h" -#include "busy_rate.h" -#include "Func.h" - - -SchedDefineTask(Busy_rate); - -int -Busy_rate::run(void *rbuf, void *wbuf) -{ - int task_id = get_param(0); - - printf("[%d] Busy World!\n", task_id); - - return 0; -} diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/ppe/busy_rate.h --- a/example/busy_rate/ppe/busy_rate.h Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -#ifndef INCLUDED_SCHED_TASK -# include "SchedTask.h" -#endif - -class Busy_rate : public SchedTask { -public: - SchedConstructor(Busy_rate); - - int run(void *r, void *w); -}; diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/ppe/task_init.cc --- a/example/busy_rate/ppe/task_init.cc Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -#include "Func.h" -#include "Scheduler.h" - -SchedExternTask(Busy_rate); - -void -task_init(void) -{ - SchedRegisterTask(BUSY_TASK, Busy_rate); -} diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/spe-main Binary file example/busy_rate/spe-main has changed diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/spe/Makefile --- a/example/busy_rate/spe/Makefile Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -default: macosx - -macosx: FORCE - @echo "Make for Mac OS X" - @$(MAKE) -f Makefile.macosx - -linux: FORCE - @echo "Make for Linux" - @$(MAKE) -f Makefile.linux - -ps3: FORCE - @echo "Make for PS3 (Cell)" - @$(MAKE) -f Makefile.ps3 - -FORCE: - -clean: - @$(MAKE) -f Makefile.macosx clean - @$(MAKE) -f Makefile.linux clean - @$(MAKE) -f Makefile.ps3 clean \ No newline at end of file diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/spe/busy_rate.cc --- a/example/busy_rate/spe/busy_rate.cc Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -#include -#include "busy_rate.h" -#include "Func.h" - -SchedDefineTask(Busy_rate); - -int -Busy_rate::run(void *rbuf, void *wbuf) -{ - printf("Busy World!\n"); - - return 0; -} diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/spe/busy_rate.h --- a/example/busy_rate/spe/busy_rate.h Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -#ifndef INCLUDED_SCHED_TASK -# include "SchedTask.h" -#endif - -class Busy_rate : public SchedTask { -public: - SchedConstructor(Busy_rate); - - int run(void *r, void *w); -}; diff -r 6ecb2b8a2505 -r 8622eae386d1 example/busy_rate/spe/spe-main.cc --- a/example/busy_rate/spe/spe-main.cc Thu Jun 04 00:16:56 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -#include "Func.h" -#include "Scheduler.h" - -SchedExternTask(Busy_rate); - -void -task_init(void) -{ - SchedRegisterTask(BUSY_TASK, Busy_rate); -}