Mercurial > hg > Members > kono > Cerium
changeset 257:e0e20d7227cc
merged
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 03 Jun 2009 18:50:15 +0900 |
parents | b42eed185bb4 (current diff) 465a871f4c07 (diff) |
children | a09588a03ea5 |
files | TaskManager/Cell/spe/CellDmaManager.cc~ example/HelloWorld/Makefile.ps3 example/basic/Makefile.ps3 example/many_task/Makefile.ps3 example/share_task/Makefile.ps3 |
diffstat | 134 files changed, 360 insertions(+), 346 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Wed Jun 03 18:50:15 2009 +0900 @@ -180,14 +180,11 @@ ppeManager->mail_check(mail_list, &waitTaskQueue); do { - int data; - + unsigned int data; // SPE Scheduler からの mail check - for (int id = 0; id < machineNum; id++) { - while (1) { - data = speThreads->get_mail(id); - if (data < 0) break; + for (int id = 0; id < machineNum; id++) { + while (speThreads->check_mail(id, 1, &data)) { /** * MY_SPE_STATUS_READY: SPE が持ってた Task 全て終了 @@ -209,16 +206,24 @@ * info[0] = alloc_id; (CellScheduler::mainMem_alloc 参照) * info[1] = alloc_addr; */ - unsigned int alloc_info[2]; + unsigned int alloc_info[3]; int alloc_size; + int command; - // ださい - while ((alloc_info[0] = speThreads->get_mail(id)) < 0); - while ((alloc_size = speThreads->get_mail(id)) < 0); + speThreads->get_mail(id, 2, alloc_info); + command = alloc_info[0]; + alloc_size = alloc_info[1]; + alloc_info[1] = (unsigned int)allocate(alloc_size); + /* + * allocate された領域は今の SPE buffer にリンクとして接続する + * ここでは TaskList を allocate(new) して登録してやろうか + */ - speThreads->send_mail(id, alloc_info, 2); + speThreads->add_output_tasklist(command, alloc_info[1], alloc_size); + + speThreads->send_mail(id, 2, alloc_info); } else if (data > MY_SPE_NOP) { __debug_ppe("[PPE] recv from [SPE %d] : 0x%x\n", id, data); check_task_finish((HTaskPtr)data); @@ -269,7 +274,7 @@ bufferManager->clear_taskList(speTaskList_bg[id]); - speThreads->send_mail(id, (unsigned int *)&speTaskList[id], 1); + speThreads->send_mail(id, 1, (unsigned int *)&speTaskList[id]); flag_sendTaskList[id] = 0; } @@ -280,7 +285,8 @@ void *buff; posix_memalign(&buff, DEFAULT_ALIGNMENT, size); - + + // bzero はコストが高いのでやりたくない bzero(buff, size); return buff;
--- a/TaskManager/Cell/SpeThreads.cc Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Cell/SpeThreads.cc Wed Jun 03 18:50:15 2009 +0900 @@ -10,7 +10,7 @@ int ret; for (int i = 0; i < spe_num; i++) { - send_mail(i, &mail, 1); + send_mail(i, 1, &mail); } for (int i = 0; i < spe_num; i++) { @@ -107,6 +107,7 @@ } } + /** * SPE からのメールを受信する。 * @@ -116,12 +117,20 @@ * if ([ret] < 0) no data read */ int -SpeThreads::get_mail(int speid) +SpeThreads::get_mail(int speid, int count, unsigned int* ret) +{ + while(spe_out_mbox_status(spe_ctx[speid]) < count); + return spe_out_mbox_read(spe_ctx[speid], ret, count); +} + +int +SpeThreads::check_mail(int speid, int count, unsigned int* ret) { - unsigned int ret = (unsigned int)(-1); - - spe_out_mbox_read(spe_ctx[speid], &ret, 1); - return ret; + if (spe_out_mbox_status(spe_ctx[speid]) >= count) { + return spe_out_mbox_read(spe_ctx[speid], ret, count); + } else { + return 0; + } } /** @@ -139,8 +148,19 @@ * @param [num] The number of messages */ void -SpeThreads::send_mail(int speid, unsigned int *data, int num) +SpeThreads::send_mail(int speid, int num, unsigned int *data) +{ + spe_in_mbox_write(spe_ctx[speid], data, num, SPE_MBOX_ALL_BLOCKING); +} + +void +SpeThreads::add_output_tasklist(int command, unsigned int buff, int alloc_size) { - while (spe_in_mbox_status(spe_ctx[speid]) < num); - spe_in_mbox_write(spe_ctx[speid], data, num, SPE_MBOX_ANY_NONBLOCKING); + /* + * output TaskList が無ければ新しく作る + * あれば TaskList に allocate した Task を追加 + * command に対応した Task の初期化を実行する + * SPE に data が書き出し終わった後に PPE 側で初期化 + */ + }
--- a/TaskManager/Cell/spe/CellDmaManager.cc Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Cell/spe/CellDmaManager.cc Wed Jun 03 18:50:15 2009 +0900 @@ -37,13 +37,44 @@ * * @param[in] mask Tag for Wait DMA process */ +void +CellDmaManager::start_dmawait_profile() +{ + wait_time = spu_readch(SPU_RdDec); + global_busy_time += busy_time - wait_time; + spu_writech(SPU_WrDec, 0xffffffff); +} + +void +CellDmaManager::end_dmawait_profile() +{ + wait_time = spu_readch(SPU_RdDec); + global_wait_time += 0xffffffff - wait_time; + busy_time = wait_time; +} + +void +CellDmaManager::show_dma_wait(int cpu) +{ + + printf("spu%d: global_wait_time = %lld\n",cpu, global_wait_time); + printf("spu%d: global_busy_time = %lld\n",cpu, global_busy_time); + printf("spu%d: busy_ratio = %g%%\n",cpu, + ((double)global_busy_time)/((double)(global_busy_time+global_wait_time))*100.0); +} void CellDmaManager::dma_wait(uint32 mask) { +#ifdef SPU_PROFILE + start_dmawait_profile(); +#endif mfc_write_tag_mask(1 << mask); mfc_write_tag_update_all(); mfc_read_tag_status(); +#ifdef SPU_PROFILE + end_dmawait_profile(); +#endif } void
--- a/TaskManager/Cell/spe/CellDmaManager.cc~ Mon Jun 01 10:54:09 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include "CellDmaManager.h" - -/** - * DMA Load - * - * @param[in] buf Buffer of Load Data - * @param[in] addr Address of Load Data at Main Memory - * @param[in] size Size of Load Data - * @param[in] mask DMA tag -*/ -void -CellDmaManager::dma_load(void *buf, uint32 addr, uint32 size, uint32 mask) -{ - if (size == 0) return ; - mfc_get((volatile void *)buf, addr, size, mask, 0, 0); -} - -/** - * DMA Store - * - * @param[in] buf Buffer of Store Data at SPE - * @param[in] addr Address of Store Data at Main Memory - * @param[in] size Size of Store Data - * @param[in] mask DMA tag -*/ -void -CellDmaManager::dma_store(void *buf, uint32 addr, uint32 size, uint32 mask) -{ - if (size == 0) return ; - mfc_put((volatile void *)buf, addr, size, mask, 0, 0); -} - -/** - * DMA Wait - * - * @param[in] mask Tag for Wait DMA process - */ -void -CellDmaManager::dma_wait(uint32 mask) -{ - mfc_write_tag_mask(1 << mask); - mfc_write_tag_update_all(); - mfc_read_tag_status(); -} - -void -CellDmaManager::mail_write(uint32 data) -{ - spu_write_out_mbox(data); -} - -unsigned int -CellDmaManager::mail_read(void) -{ - unsigned int mail = spu_read_in_mbox(); - return mail; -} - -void -CellDmaManager::dma_loadList(ListDataPtr list, void *buff, uint32 mask) -{ - mfc_getl(buff, 0, list->element, sizeof(mfc_list_element_t)*list->length, - mask, 0, 0); -} - -void -CellDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask) -{ - mfc_putl(buff, 0, list->element, sizeof(mfc_list_element_t)*list->length, - mask, 0, 0); -}
--- a/TaskManager/Cell/spe/SchedExit.cc Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Cell/spe/SchedExit.cc Wed Jun 03 18:50:15 2009 +0900 @@ -7,6 +7,7 @@ { delete p; + m->show_dma_wait(); __debug("SchedExit::next()\n"); return NULL;
--- a/TaskManager/Cell/spe/SchedMail.cc Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Cell/spe/SchedMail.cc Wed Jun 03 18:50:15 2009 +0900 @@ -18,7 +18,7 @@ __debug("[SchedMail:%s]\n", __FUNCTION__); if ((int)params_addr == MY_SPE_COMMAND_EXIT) { - return new SchedExit(); + return new SchedExit(); } else { return new SchedTaskList(params_addr, m); }
--- a/TaskManager/Cell/spe/main.cc Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Cell/spe/main.cc Wed Jun 03 18:50:15 2009 +0900 @@ -11,9 +11,9 @@ { CellScheduler *manager; - const unsigned ls_size = (unsigned)&argc; - unsigned code_size = (unsigned)&_end; - unsigned heap_size = ls_size - code_size; + //const unsigned ls_size = (unsigned)&argc; + //unsigned code_size = (unsigned)&_end; + //unsigned heap_size = ls_size - code_size; __debug(" ls_size:%10d bytes\n", ls_size); __debug("code_size:%10d bytes\n", code_size);
--- a/TaskManager/Makefile Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Makefile Wed Jun 03 18:50:15 2009 +0900 @@ -34,6 +34,7 @@ rm -f $(IMPL_FIFO_OBJS) $(IMPL_CELL_OBJS) $(MAKE) -f Makefile.cell cellclean $(MAKE) -f Makefile.fifo fifoclean + rm -f *.a tags: $(TAGS) $(TAGSOPTION)
--- a/TaskManager/Test/test_render/SceneGraph.cpp Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Test/test_render/SceneGraph.cpp Wed Jun 03 18:50:15 2009 +0900 @@ -426,7 +426,7 @@ /* this絖絖絖name絖違ゃ菴 NULL. */ SceneGraphPtr -SceneGraph::searchSceneGraph(char *name) +SceneGraph::searchSceneGraph(const char *name) { SceneGraphPtr tmp; SceneGraphPtr result;
--- a/TaskManager/Test/test_render/SceneGraph.h Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Test/test_render/SceneGraph.h Wed Jun 03 18:50:15 2009 +0900 @@ -70,7 +70,7 @@ SceneGraphPtr addBrother(SceneGraphPtr bro); SceneGraphPtr clone(void); SceneGraphPtr clone(void *buf); - SceneGraphPtr searchSceneGraph(char *name); + SceneGraphPtr searchSceneGraph(const char *name); void set_move_collision(SceneGraphPtr node, move_func new_move, collision_func new_collision); void set_move_collision(move_func new_move, collision_func new_collision);
--- a/TaskManager/Test/test_render/polygon.h Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Test/test_render/polygon.h Wed Jun 03 18:50:15 2009 +0900 @@ -22,8 +22,8 @@ class Polygon { public: long long size; - char *name; - char *parent_name; + const char *name; + const char *parent_name; //float *data; //"vertex" and "normal" and "texture" float *coord_xyz; // vertex coordinate array
--- a/TaskManager/Test/test_render/spe/CreatePolygon.cpp Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Test/test_render/spe/CreatePolygon.cpp Wed Jun 03 18:50:15 2009 +0900 @@ -85,11 +85,12 @@ if (pp->info.size >= MAX_SIZE_TRIANGLE) { PolygonPackPtr next; + // smanager Task 篏0 с PolygonPack->task_id smanager->mainMem_alloc(0, sizeof(PolygonPack)); smanager->mainMem_wait(); next = (PolygonPackPtr)smanager->mainMem_get(0); - pp->next = next; + pp->next = next; // TaskManager 眼с鴻 tmp_pp = pp; pp = send_pp; @@ -101,9 +102,11 @@ pp_addr = next; - smanager->dma_wait(PP_LOAD); + smanager->dma_wait(PP_LOAD); // 紊筝荀 smanager->dma_load(pp, (uint32)pp_addr, sizeof(PolygonPack), PP_LOAD); + // 罨< dma_wait 潟鴻蕭сゃゃ潟ч綽荀 + smanager->dma_wait(PP_LOAD); pp->init();
--- a/TaskManager/Test/test_render/spe/CreateSpan.cpp Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Test/test_render/spe/CreateSpan.cpp Wed Jun 03 18:50:15 2009 +0900 @@ -1,6 +1,7 @@ #include "CreateSpan.h" #include "viewer_types.h" +// DMA channel static const int SPAN_PACK_LOAD = 5; static const int SPAN_PACK_STORE = 6; static const int POLYGON_PACK_LOAD = 7; @@ -294,7 +295,7 @@ smanager->mainMem_wait(); next = (SpanPackPtr)smanager->mainMem_get(0); - spack->next = next; + spack->next = next; // TaskManager с tmp_spack = spack; spack = send_spack; @@ -486,6 +487,7 @@ sizeof(SpanPack), SPAN_PACK_STORE); smanager->dma_wait(SPAN_PACK_STORE); + // smanager allocate free smanager с鴻 free(free_pp); free(free_spack); free(vMid10);
--- a/TaskManager/Test/test_render/spe/DrawSpan.cpp Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Test/test_render/spe/DrawSpan.cpp Wed Jun 03 18:50:15 2009 +0900 @@ -184,7 +184,7 @@ tile->texture_addr = addr; - int index = hash->put(tile->texture_addr, tile); + hash->put(tile->texture_addr, tile); smanager->dma_load(tile->pixel, (uint32)addr, sizeof(uint32)*TEXTURE_BLOCK_SIZE, tag); }
--- a/TaskManager/Test/test_render/spe/DrawSpanRenew.cpp Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Test/test_render/spe/DrawSpanRenew.cpp Wed Jun 03 18:50:15 2009 +0900 @@ -216,7 +216,6 @@ free(zRow); free(args); -FINISH: /** * linebuf, zRow, args は RenewTask が引き継ぐ */
--- a/TaskManager/Test/test_render/spe/Load_Texture.cpp Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Test/test_render/spe/Load_Texture.cpp Wed Jun 03 18:50:15 2009 +0900 @@ -20,11 +20,11 @@ */ void *hash_tmp = smanager->global_alloc(GLOBAL_TEXTURE_HASH, sizeof(TileHash)); - TileHashPtr hashtable = new(hash_tmp) TileHash; + new(hash_tmp) TileHash; void *tileList_tmp = smanager->global_alloc(GLOBAL_TILE_LIST, sizeof(TileList)); - TileListPtr tileList = new(tileList_tmp) TileList; + new(tileList_tmp) TileList; return 0; }
--- a/TaskManager/Test/test_render/viewer.cpp Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/Test/test_render/viewer.cpp Wed Jun 03 18:50:15 2009 +0900 @@ -177,7 +177,7 @@ } task_next = manager->create_task(TASK_DUMMY); - task_next->set_post(&post2runLoop, NULL); + #if 0 // 茫娯с篁 SceneGraphPack 篏 @@ -192,13 +192,17 @@ for (int i = 0; i < spe_num; i++) { task_tex = manager->create_task(TASK_INIT_TEXTURE); - /* 絨篏帥鴻鐚 */ + /* + * 絨篏帥鴻鐚 + */ task_tex->set_cpu((CPU_TYPE)((int)SPE_0 + i)); task_next->wait_for(task_tex); task_tex->spawn(); } - task_next->spawn(); + task_next->set_post(&post2runLoop, NULL); // set_post(function(this->run_loop()), NULL) + task_next->spawn(); + // TASK_INIT_TEXTURE 腟c DUMMY_TASK Viewer::run_loop() 若 } void @@ -224,7 +228,7 @@ } task_next = manager->create_task(TASK_DUMMY); - task_next->set_post(post2runDraw, NULL); + #if 0 // SceneGraphPack update @@ -292,7 +296,11 @@ } task_create_pp->spawn(); + + // Barrier + task_next->set_post(post2runDraw, NULL); // set_post(function(this->run_draw()), NULL) task_next->spawn(); + // TASK_CREATE_SPAN 腟c DUMMY_TASK Viewer::run_draw() 若 } void @@ -302,7 +310,6 @@ HTaskPtr task_draw; task_next = manager->create_task(TASK_DUMMY); - task_next->set_post(post2runLoop, NULL); ppack->clear(); for (int i = 0; i < spackList_length; i++) { @@ -361,7 +368,9 @@ } } + task_next->set_post(post2runLoop, NULL); // set_post(function(this->run_loop()), NULL) task_next->spawn(); + // TASK_DRAW_SPAN 腟c DUMMY_TASK Viewer::run_loop() 若 frames++; }
--- a/TaskManager/kernel/main.cc Mon Jun 01 10:54:09 2009 +0900 +++ b/TaskManager/kernel/main.cc Wed Jun 03 18:50:15 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 Mon Jun 01 10:54:09 2009 +0900 +++ b/example/HelloWorld/Makefile Wed Jun 03 18:50:15 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 18:50:15 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 Mon Jun 01 10:54:09 2009 +0900 +++ b/example/HelloWorld/Makefile.def Wed Jun 03 18:50:15 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 Mon Jun 01 10:54:09 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 Mon Jun 01 10:54:09 2009 +0900 +++ b/example/HelloWorld/main.cc Wed Jun 03 18:50:15 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 Mon Jun 01 10:54:09 2009 +0900 +++ b/example/HelloWorld/spe/Makefile Wed Jun 03 18:50:15 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/example/basic/Makefile Mon Jun 01 10:54:09 2009 +0900 +++ b/example/basic/Makefile Wed Jun 03 18:50:15 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/basic/Makefile.cell Wed Jun 03 18:50:15 2009 +0900 @@ -0,0 +1,39 @@ +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/basic/Makefile.def Mon Jun 01 10:54:09 2009 +0900 +++ b/example/basic/Makefile.def Wed Jun 03 18:50:15 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/basic/Makefile.ps3 Mon Jun 01 10:54:09 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/basic/main.cc Mon Jun 01 10:54:09 2009 +0900 +++ b/example/basic/main.cc Wed Jun 03 18:50:15 2009 +0900 @@ -6,15 +6,16 @@ extern void task_init(void); -static int *data; static int length = DATA_NUM; +static int task = 1; -char *help_str = "Usage: ./twice [-length data_length]\n \ - -length Number of data (default DATA_NUM (Func.h))"; +const char *usr_help_str = "Usage: ./twice [-length data_length] [-count task_num]\n\ + -length Number of data (default DATA_NUM (Func.h))\n\ + -count Number of task (default 1)\n"; void -print_data(int *data, int size, char *title) +print_data(int *data, int size, const char *title) { printf("%s ---\n", title); for (int i = 0; i < size; i++) { @@ -29,6 +30,7 @@ void twice_result(void *a) { + int* data = (int*)a; print_data(data, length, "after"); free(data); } @@ -39,10 +41,8 @@ for (int i = 1; argv[i]; ++i) { if (strcmp(argv[i], "-length") == 0) { length = atoi(argv[++i]); - } - if (strcmp(argv[i], "--help") == 0) { - printf("%s\n", help_str); - return -1; + } else if (strcmp(argv[i], "-count") == 0) { + task = atoi(argv[++i]); } } @@ -54,7 +54,7 @@ { HTask *twice; - data = (int*)manager->malloc(sizeof(int)*length); + int *data = (int*)manager->allocate(sizeof(int)*length); for (int i = 0; i < length; i++) { data[i] = i; @@ -87,14 +87,14 @@ */ twice->add_param(length); - twice->set_post(twice_result, NULL); + twice->set_post(twice_result, (void*)data); // add Active Queue twice->spawn(); } int -cerium_main(int argc, char *argv[]) +TMmain(int argc, char *argv[]) { if (init(argc, argv) < 0) { return -1; @@ -104,7 +104,9 @@ // ppe/task_init.cc task_init(); - twice_init(); + for (int i = 0; i < task; ++i) { + twice_init(); + } return 0; }
--- a/example/basic/spe/Makefile Mon Jun 01 10:54:09 2009 +0900 +++ b/example/basic/spe/Makefile Wed Jun 03 18:50:15 2009 +0900 @@ -8,8 +8,8 @@ CC = spu-g++ CFLAGS = -g -Wall -fno-exceptions -fno-rtti #-DDEBUG -INCLUDE = -I${CERIUM}/include/TaskManager -I. -I.. -LIBS = -L${CERIUM}/TaskManager -lspemanager +INCLUDE = -I../${CERIUM}/include/TaskManager -I. -I.. +LIBS = -L../${CERIUM}/TaskManager -lspemanager .SUFFIXES: .cc .o
--- a/example/dependency_task/Makefile Mon Jun 01 10:54:09 2009 +0900 +++ b/example/dependency_task/Makefile Wed Jun 03 18:50:15 2009 +0900 @@ -10,11 +10,11 @@ ps3: 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
--- a/example/dependency_task/Makefile.def Mon Jun 01 10:54:09 2009 +0900 +++ b/example/dependency_task/Makefile.def Wed Jun 03 18:50:15 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/many_task/Makefile Mon Jun 01 10:54:09 2009 +0900 +++ b/example/many_task/Makefile Wed Jun 03 18:50:15 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/many_task/Makefile.cell Wed Jun 03 18:50:15 2009 +0900 @@ -0,0 +1,39 @@ +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/many_task/Makefile.def Mon Jun 01 10:54:09 2009 +0900 +++ b/example/many_task/Makefile.def Wed Jun 03 18:50:15 2009 +0900 @@ -5,4 +5,10 @@ #CERIUM = /Users/gongo/Source/Concurrency/Game_project/Cerium # ex: linux/ps3 -CERIUM = /home/gongo/Cerium \ No newline at end of file +CERIUM = ../../../Cerium + +CC = g++ +CFLAGS = -g -Wall -O9 + +INCLUDE = -I${CERIUM}/include/TaskManager -I. -I.. +LIBS = -L${CERIUM}/TaskManager
--- a/example/many_task/Makefile.ps3 Mon Jun 01 10:54:09 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +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) - -CC = g++ -CFLAGS = -g -Wall -O9 #-DDEBUG - -INCLUDE = -I${CERIUM}/include/TaskManager -I. -I.. -LIBS = -L${CERIUM}/TaskManager -lCellManager -lspe2 -lpthread - -.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/many_task/main.cc Mon Jun 01 10:54:09 2009 +0900 +++ b/example/many_task/main.cc Wed Jun 03 18:50:15 2009 +0900 @@ -28,7 +28,7 @@ gettimeofday(&tv, NULL); return tv.tv_sec + (double)tv.tv_usec*1e-6; } - +/* static void show_data(void) { @@ -38,8 +38,9 @@ } puts("-----------------------------------------------"); } +*/ -const char *help_str = "Usage: ./sort [option]\n \ +const char *usr_help_str = "Usage: ./sort [option]\n \ options\n\ -cpu Number of SPE used (default 1)\n\ -l, --length Sorted number of data (default 1200)\n\ @@ -52,10 +53,7 @@ if (strcmp(argv[i], "--length") == 0 || strcmp(argv[i], "-l") == 0) { length = atoi(argv[++i]); } - if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) { - printf("%s\n", help_str); - return -1; - } + } return 0;
--- a/example/many_task/spe/Makefile Mon Jun 01 10:54:09 2009 +0900 +++ b/example/many_task/spe/Makefile Wed Jun 03 18:50:15 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 +INCLUDE = -I../${CERIUM}/include/TaskManager -I. -I.. +LIBS = -L../${CERIUM}/TaskManager -lspemanager .SUFFIXES: .cc .o
--- a/example/share_task/Makefile Mon Jun 01 10:54:09 2009 +0900 +++ b/example/share_task/Makefile Wed Jun 03 18:50:15 2009 +0900 @@ -8,13 +8,13 @@ @echo "Make for Linux" @$(MAKE) -f Makefile.linux -ps3: FORCE - @echo "Make for PS3 (Cell)" - @$(MAKE) -f Makefile.ps3 +cell: FORCE + @echo "Make for CELL (Cell)" + @$(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/share_task/Makefile.cell Wed Jun 03 18:50:15 2009 +0900 @@ -0,0 +1,39 @@ +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/share_task/Makefile.def Mon Jun 01 10:54:09 2009 +0900 +++ b/example/share_task/Makefile.def Wed Jun 03 18:50:15 2009 +0900 @@ -2,10 +2,10 @@ # include/library path # ex: macosx -CERIUM = /Users/gongo/Source/Cerium +CERIUM = ../../../Cerium # ex: linux/ps3 -#CERIUM = /home/gongo/Cerium +#CERIUM = gongo/Cerium CC = g++ CFLAGS = -g -Wall -O9
--- a/example/share_task/Makefile.ps3 Mon Jun 01 10:54:09 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/share_task/main.cc Mon Jun 01 10:54:09 2009 +0900 +++ b/example/share_task/main.cc Wed Jun 03 18:50:15 2009 +0900 @@ -10,7 +10,7 @@ int numtask = 1; int length = DATA_NUM; -char *help_str = "Usage: ./share [-task numtask] [-length data_length]\n \ +const char *usr_help_str = "Usage: ./share [-task numtask] [-length data_length]\n \ -task Number of task (default 1) \n \ -length Number of data (default DATA_NUM (Func.h))"; @@ -20,7 +20,7 @@ HTaskPtr task_load; HTaskPtr task_exec; - idata = (int*)manager->malloc(sizeof(int)*length); + idata = (int*)manager->allocate(sizeof(int)*length); for (int i = 0; i < length; i++) { idata[i] = i; } @@ -58,10 +58,6 @@ if (strcmp(argv[i], "-length") == 0) { length = atoi(argv[++i]); } - if (strcmp(argv[i], "--help") == 0) { - printf("%s\n", help_str); - return -1; - } } return 0; @@ -69,7 +65,7 @@ //---------main関数----------- int -cerium_main(int argc, char *argv[]) +TMmain(int argc, char *argv[]) { if (init(argc, argv) < 0) {
--- a/example/share_task/spe/Makefile Mon Jun 01 10:54:09 2009 +0900 +++ b/example/share_task/spe/Makefile Wed Jun 03 18:50:15 2009 +0900 @@ -8,8 +8,8 @@ CC = spu-g++ CFLAGS = -g -Wall -fno-exceptions -fno-rtti #-DDEBUG -INCLUDE = -I${CERIUM}/include/TaskManager -I. -I.. -LIBS = -L${CERIUM}/TaskManager -lspemanager +INCLUDE = -I../${CERIUM}/include/TaskManager -I. -I.. +LIBS = -L../${CERIUM}/TaskManager -lspemanager .SUFFIXES: .cc .o
--- a/include/TaskManager/CellDmaManager.h Mon Jun 01 10:54:09 2009 +0900 +++ b/include/TaskManager/CellDmaManager.h Wed Jun 03 18:50:15 2009 +0900 @@ -11,6 +11,8 @@ #include <spu_mfcio.h> +#define SPU_PROFILE 1 + class CellDmaManager : public DmaManager { public: BASE_NEW_DELETE(CellDmaManager); @@ -21,11 +23,16 @@ } DmaList, *DmaListPtr; /* variables */ + unsigned int wait_time, busy_time; + unsigned long long global_busy_time, global_wait_time; /* functions */ void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask); void dma_store(void *buf, uint32 addr, uint32 size, uint32 mask); void dma_wait(uint32 mask) ; + void start_dmawait_profile(); + void end_dmawait_profile(); + void show_dma_wait(int cpu); void mail_write(uint32 data); uint32 mail_read(void);
--- a/include/TaskManager/DmaManager.h Mon Jun 01 10:54:09 2009 +0900 +++ b/include/TaskManager/DmaManager.h Wed Jun 03 18:50:15 2009 +0900 @@ -31,6 +31,7 @@ virtual void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask) {} virtual void dma_store(void *buf,uint32 addr, uint32 size, uint32 mask) {} virtual void dma_wait(uint32 mask) {} + virtual void show_dma_wait(int cpu) {} // API for SPU inbound/outbound mailbox virtual void mail_write(uint32 data) {}
--- a/include/TaskManager/SchedExit.h Mon Jun 01 10:54:09 2009 +0900 +++ b/include/TaskManager/SchedExit.h Wed Jun 03 18:50:15 2009 +0900 @@ -16,7 +16,7 @@ class SchedExit : public SchedTaskBase { public: BASE_NEW_DELETE(SchedExit); - + SchedTaskBase* next(Scheduler *, SchedTaskBase *); };
--- a/include/TaskManager/Scheduler.h Mon Jun 01 10:54:09 2009 +0900 +++ b/include/TaskManager/Scheduler.h Wed Jun 03 18:50:15 2009 +0900 @@ -159,6 +159,7 @@ void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask); void dma_store(void *buf,uint32 addr, uint32 size, uint32 mask); void dma_wait(uint32 mask); + void show_dma_wait() { connector->show_dma_wait(id); }; void mail_write(uint32 data); uint32 mail_read(void); void dma_loadList(ListDataPtr list, void *, uint32 mask);
--- a/include/TaskManager/SpeThreads.h Mon Jun 01 10:54:09 2009 +0900 +++ b/include/TaskManager/SpeThreads.h Wed Jun 03 18:50:15 2009 +0900 @@ -19,10 +19,12 @@ /* functions */ void init(void); - int get_mail(int speid); - void send_mail(int speid, unsigned int *data, int num); + int get_mail(int speid, int count, unsigned int* ret); // BLOCKING + int check_mail(int speid, int count, unsigned int* ret); // NONBLOCK + 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, unsigned int buff, int alloc_size); private: /* variables */
--- a/include/TaskManager/TaskList.h Mon Jun 01 10:54:09 2009 +0900 +++ b/include/TaskManager/TaskList.h Wed Jun 03 18:50:15 2009 +0900 @@ -19,7 +19,8 @@ int length; // 4 byte TaskList *next; // 4 byte Task tasks[TASK_MAX_SIZE]; // 512 - int a[2]; // padding + TaskList *output; // 4 byte + int a[1]; // padding static TaskList* append(TaskList*, TaskList*); };