Mercurial > hg > Game > Cerium
changeset 67:7d2874fb0671
*** empty log message ***
author | gongo |
---|---|
date | Sun, 17 Feb 2008 19:04:29 +0900 |
parents | 1034077dd217 |
children | 35a6cf176c38 |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Test/simple_render/Makefile TaskManager/Test/simple_render/main.cpp TaskManager/Test/simple_render/spe/spe-main.cpp TaskManager/Test/simple_render/viewer.cpp TaskManager/kernel/ppe/TaskManager.cc include/TaskManager/CellTaskManagerImpl.h |
diffstat | 7 files changed, 44 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Sun Feb 17 18:29:08 2008 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Sun Feb 17 19:04:29 2008 +0900 @@ -6,6 +6,11 @@ #include "types.h" #include "error.h" +CellTaskManagerImpl::CellTaskManagerImpl(int num) +{ + machineNum = num; +} + void CellTaskManagerImpl::init(void) { @@ -41,10 +46,6 @@ __debug_ppe("[PPE] recv from [SPE %d] : 0x%x\n", data, id); bufferManager->check_task_finish((HTaskPtr)data); } - - send = (unsigned int)id; - //¥ئ¥¹¥بحر - speThreads->send_mail(id, &send); } } @@ -55,5 +56,5 @@ TaskManagerImpl* create_impl(int num) { - return new CellTaskManagerImpl(); + return new CellTaskManagerImpl(num); }
--- a/TaskManager/Test/simple_render/Makefile Sun Feb 17 18:29:08 2008 +0900 +++ b/TaskManager/Test/simple_render/Makefile Sun Feb 17 19:04:29 2008 +0900 @@ -13,9 +13,9 @@ EXTRA_CFLAGS = `sdl-config --cflags` `xml2-config --cflags`\ -LIBS = `sdl-config --libs` -lSDL_image -Wl,-framework,OpenGL \ +LIBS = `sdl-config --libs` -lSDL_image -lGL \ `xml2-config --libs`\ - -L../../ -lmanager #-lspe2 -lpthread + -L../../ -lmanager -lspe2 -lpthread .SUFFIXES: .cpp .o @@ -27,6 +27,9 @@ $(TARGET): $(OBJS) $(TASK_OBJS) $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) +link: + $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) + clean: rm -f $(TARGET) $(OBJS) $(TASK_OBJS) rm -f *~ \#*
--- a/TaskManager/Test/simple_render/main.cpp Sun Feb 17 18:29:08 2008 +0900 +++ b/TaskManager/Test/simple_render/main.cpp Sun Feb 17 19:04:29 2008 +0900 @@ -119,7 +119,7 @@ int main(int argc, char *argv[]) { - manager = new TaskManager(1); + manager = new TaskManager(3); manager->init(); task_initialize();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/simple_render/spe/spe-main.cpp Sun Feb 17 19:04:29 2008 +0900 @@ -0,0 +1,20 @@ +#include <stdio.h> +#include <spu_mfcio.h> + +int +main(unsigned int speid, + unsigned long long argc, unsigned long long argv) +{ + unsigned int mail; + + printf("[SPE] Hello, Word! \n"); + + spu_writech(SPU_WrOutMbox, speid); + + while (1) { + mail = spu_readch(SPU_RdInMbox); + spu_writech(SPU_WrOutMbox, mail+1); + } + + return 0; +}
--- a/TaskManager/Test/simple_render/viewer.cpp Sun Feb 17 18:29:08 2008 +0900 +++ b/TaskManager/Test/simple_render/viewer.cpp Sun Feb 17 19:04:29 2008 +0900 @@ -27,12 +27,17 @@ void Viewer::sdl_init() { - if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) - { + if (SDL_Init( SDL_INIT_VIDEO ) < 0) { fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError()); exit( 1 ); } - screen = SDL_SetVideoMode( width, height, bpp, SDL_HWSURFACE ); + + screen = SDL_SetVideoMode( width, height, bpp, SDL_HWSURFACE); + if (screen == NULL) { + fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError()); + SDL_Quit(); + exit(1); + } } @@ -319,14 +324,9 @@ sgp_buff, pp_buff, NULL); task = manager->create_task(fd, 0, 0, 0, NULL); - //manager->set_task_depend(task_update_sgp, task); - //manager->set_task_depend(task_create_pp, task); task->set_depend(task_update_sgp); task->set_depend(task_create_pp); - //manager->spawn_task(task_update_sgp); - //manager->spawn_task(task_create_pp); - //manager->spawn_task(task); task_update_sgp->spawn(); task_create_pp->spawn(); task->spawn();
--- a/TaskManager/kernel/ppe/TaskManager.cc Sun Feb 17 18:29:08 2008 +0900 +++ b/TaskManager/kernel/ppe/TaskManager.cc Sun Feb 17 19:04:29 2008 +0900 @@ -1,10 +1,7 @@ #include "TaskManager.h" #include "SymTable.h" -TaskManager::TaskManager(int num) -{ - machineNum = num; -} +TaskManager::TaskManager(int num) : machineNum(num) {} /** * create_impl(int);
--- a/include/TaskManager/CellTaskManagerImpl.h Sun Feb 17 18:29:08 2008 +0900 +++ b/include/TaskManager/CellTaskManagerImpl.h Sun Feb 17 19:04:29 2008 +0900 @@ -11,6 +11,9 @@ class CellTaskManagerImpl : public TaskManagerImpl { public: + /* constructor */ + CellTaskManagerImpl(int num = 1); + /* variables */ SpeThreads *speThreads;