# HG changeset patch # User Shinji KONO # Date 1329613647 -32400 # Node ID 5b024efa2429ab1f546a10ba244ce8a29c115779 # Parent f40558ec00a82544c4ca5766cb3358d268d9df1f fix free on non copy DMA diff -r f40558ec00a8 -r 5b024efa2429 Renderer/Engine/TODO --- a/Renderer/Engine/TODO Sat Feb 18 17:26:32 2012 +0900 +++ b/Renderer/Engine/TODO Sun Feb 19 10:07:27 2012 +0900 @@ -1,3 +1,7 @@ +Sat Feb 18 17:31:10 JST 2012 + +Texture でenbugしたらしい。こういうのどうやってdebugするんだろう? + Sat Jul 30 15:57:25 JST 2011 SceneGraph diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/Fifo/FifoTaskManagerImpl.cc --- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Sun Feb 19 10:07:27 2012 +0900 @@ -339,7 +339,7 @@ #endif if (num == 0) { - return new FifoTaskManagerImpl(num); + return new FifoTaskManagerImpl(num); } else { Threads *cpus = new CpuThreads(num,useRefDma); return new CellTaskManagerImpl(num,cpus); diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/Fifo/MainScheduler.cc --- a/TaskManager/Fifo/MainScheduler.cc Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/Fifo/MainScheduler.cc Sun Feb 19 10:07:27 2012 +0900 @@ -10,13 +10,13 @@ void MainScheduler::init_impl(int useRefDma) { - if (useRefDma & 0x10) { - fifoDmaManager = new PreRefDmaManager(); - } else if (useRefDma & 0x01) { - fifoDmaManager = new ReferencedDmaManager(); - } else { - fifoDmaManager = new FifoDmaManager(); - } + if (useRefDma & 0x10) { + fifoDmaManager = new PreRefDmaManager(); + } else if (useRefDma & 0x01) { + fifoDmaManager = new FifoDmaManager(); + } else { + fifoDmaManager = new ReferencedDmaManager(); + } connector = fifoDmaManager; } diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/Fifo/PreRefDmaManager.cc --- a/TaskManager/Fifo/PreRefDmaManager.cc Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/Fifo/PreRefDmaManager.cc Sun Feb 19 10:07:27 2012 +0900 @@ -19,3 +19,6 @@ return (void*)addr; } +void +PreRefDmaManager::free(void *buf) { +} diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/Fifo/PreRefDmaManager.h --- a/TaskManager/Fifo/PreRefDmaManager.h Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/Fifo/PreRefDmaManager.h Sun Feb 19 10:07:27 2012 +0900 @@ -8,6 +8,7 @@ public: /* functions */ virtual void *dma_load(Scheduler *s, void *buf, memaddr addr, uint32 size, uint32 mask); + virtual void free(void *buf); } ; #endif/* PRE_REFERENCED_DMA_MANAGER */ diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/Fifo/ReferencedDmaManager.cc --- a/TaskManager/Fifo/ReferencedDmaManager.cc Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/Fifo/ReferencedDmaManager.cc Sun Feb 19 10:07:27 2012 +0900 @@ -29,3 +29,9 @@ return (void*)elm->addr; } + +void +ReferencedDmaManager::free(void *buf) { +} + + diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/Fifo/ReferencedDmaManager.h --- a/TaskManager/Fifo/ReferencedDmaManager.h Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/Fifo/ReferencedDmaManager.h Sun Feb 19 10:07:27 2012 +0900 @@ -8,7 +8,8 @@ public: /* functions */ virtual void *dma_load(Scheduler *s, void *buf, memaddr addr, uint32 size, uint32 mask); - virtual void *dma_loadList(Scheduler *s, ListDataPtr list, void *buff, uint32 mask); + virtual void *dma_loadList(Scheduler *s, ListDataPtr list, void *buff, uint32 mask); + virtual void free(void *buff); } ; #endif/* REFERENCED_DMA_MANAGER */ diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/Makefile.cell --- a/TaskManager/Makefile.cell Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/Makefile.cell Sun Feb 19 10:07:27 2012 +0900 @@ -39,7 +39,7 @@ # $(wildcard $(CELL_SPE_DIR)/*.cc) -CELL_SPE_OBJS = $(CELL_SPE_SRCS:.cc=.o) $(CELL_SPE_SCHEDULE_OBJ) $(CELL_SPE_TASK_SRCS:.cc=.o) $(CELL_SPE_PROFILE:.cc=.o) +CELL_SPE_OBJS = $(CELL_SPE_SRCS:.cc=.o) $(CELL_SPE_SCHEDULE_OBJ) $(CELL_SPE_TASK_SRCS:.cc=.o) # $(CELL_SPE_PROFILE:.cc=.o) SPUCC = spu-g++ -DABIBIT=$(ABIBIT) diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/kernel/main.cc --- a/TaskManager/kernel/main.cc Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/kernel/main.cc Sun Feb 19 10:07:27 2012 +0900 @@ -35,24 +35,21 @@ { int machineNum = 0; int speIdle = 0; - int poll_pattern = 0; - int useRefDma = 0; + int useRefDma = 0; for (int i = 1; argv[i]; ++i) { if (strcmp(argv[i], "-cpu") == 0) { - machineNum = atoi(argv[++i]); + machineNum = atoi(argv[++i]); } else if (strcmp(argv[i], "-p") == 0) { - profile = 1; - } else if (strcmp(argv[i], "-speidle") == 0) { - speIdle = atoi(argv[++i]); - } else if (strcmp(argv[i], "-poll") == 0) { - poll_pattern = 1; - } else if (strcmp(argv[i], "-ref") == 0) { - useRefDma |= 0x01; - } else if (strcmp(argv[i], "-pre") == 0) { - useRefDma |= 0x10; - } - } + profile = 1; + } else if (strcmp(argv[i], "-speidle") == 0) { // これなんだよ? + speIdle = atoi(argv[++i]); + } else if (strcmp(argv[i], "-copy") == 0) { // force copy DMA in FifoManager + useRefDma |= 0x01; + } else if (strcmp(argv[i], "-pre") == 0) { // deplicated + useRefDma |= 0x10; + } + } TaskManager *manager = new TaskManager(machineNum); manager->init(speIdle,useRefDma); diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/kernel/schedule/DmaManager.h --- a/TaskManager/kernel/schedule/DmaManager.h Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/kernel/schedule/DmaManager.h Sun Feb 19 10:07:27 2012 +0900 @@ -23,9 +23,10 @@ BASE_NEW_DELETE(DmaManager); // API for DMA transfer - virtual void *dma_load(Scheduler *s, void *buf, memaddr addr, uint32 size, uint32 mask) { return 0;} - virtual void *dma_store(void *buf,memaddr addr, uint32 size, uint32 mask) { return 0;} - virtual void *get_writebuf(Scheduler *s, memaddr addr, uint32 size) { return 0;} + virtual void *dma_load(Scheduler *s, void *buf, memaddr addr, uint32 size, uint32 mask) { return 0; } + virtual void *dma_store(void *buf,memaddr addr, uint32 size, uint32 mask) { return 0; } + virtual void free(void *buf) { free(buf); } + virtual void *get_writebuf(Scheduler *s, memaddr addr, uint32 size) { return 0; } virtual void dma_wait(uint32 mask) {} virtual void dma_wait(uint32 mask, int cmd) {} virtual void show_dma_wait(Scheduler *s, int cpu) {} @@ -38,9 +39,9 @@ virtual memaddr task_list_mail_read() { return 0; } // API for MFC list DMA transfer - virtual void *dma_loadList(Scheduler *s, ListDataPtr list, void *,uint32 mask) { return 0;} + virtual void *dma_loadList(Scheduler *s, ListDataPtr list, void *,uint32 mask) { return 0; } virtual void dma_storeList(ListDataPtr, void *buff, uint32 mask) {} - virtual void *get_writebuf(Scheduler *s, ListDataPtr, uint32 size) { return 0;} + virtual void *get_writebuf(Scheduler *s, ListDataPtr, uint32 size) { return 0; } virtual uint32 get_tag() { return 0;} virtual void bound(ListData *) {} }; diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/kernel/schedule/SchedTask.cc --- a/TaskManager/kernel/schedule/SchedTask.cc Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Sun Feb 19 10:07:27 2012 +0900 @@ -95,11 +95,7 @@ } connector->dma_wait(DMA_READ + this->tag); run(this, readbuf, writebuf); - //;TODO - //ReferencedDmaManagerを使う場合ここでfreeすると、wordcountが動かない - //wordcountのmain.ccのrun16が実行されるときに、readbufをポインタで受けてる - free(readbuf); - + connector->free(readbuf); // 書き込む領域がなければ無視 @@ -114,7 +110,7 @@ __debug("[SchedTask:%s]\n", __FUNCTION__); connector->dma_wait(DMA_WRITE); - free(writebuf); + connector->free(writebuf); #ifdef TASK_LIST_MAIL if (!(cur_index < list->length) ) connector->mail_write(waiter); diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/kernel/schedule/SchedTaskArray.cc --- a/TaskManager/kernel/schedule/SchedTaskArray.cc Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArray.cc Sun Feb 19 10:07:27 2012 +0900 @@ -105,7 +105,7 @@ outListData.bound = (int*)manager->allocate(outListData.length*sizeof(int)); connector->bound(&outListData); - free(writebuf); + // connector->free(writebuf); what?! writebuf = connector->get_writebuf(scheduler, &outListData, outListData.size); //if (outListData.element == inListData.element ) { // printf("bad %x\n",outListData.element); @@ -126,7 +126,7 @@ } connector->dma_wait((DMA_READ + this->tag)); run(this, get_input(readbuf, 0), get_output(writebuf, 0)); - free(readbuf); + connector->free(readbuf); // 書き込む領域がなければ無視 // User 側で作る方法が必要... @@ -146,7 +146,7 @@ { connector->dma_wait(DMA_WRITE); - free(writebuf); + connector->free(writebuf); free(inListData.bound); free(outListData.bound); } diff -r f40558ec00a8 -r 5b024efa2429 TaskManager/kernel/schedule/SchedTaskArrayNop.cc --- a/TaskManager/kernel/schedule/SchedTaskArrayNop.cc Sat Feb 18 17:26:32 2012 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArrayNop.cc Sun Feb 19 10:07:27 2012 +0900 @@ -57,7 +57,7 @@ { savedTask->write(); - free(atask); + connector->free(atask); delete savedTask; savedTask = 0; } diff -r f40558ec00a8 -r 5b024efa2429 example/Bulk/Makefile.def --- a/example/Bulk/Makefile.def Sat Feb 18 17:26:32 2012 +0900 +++ b/example/Bulk/Makefile.def Sun Feb 19 10:07:27 2012 +0900 @@ -8,7 +8,7 @@ CERIUM = ../../../Cerium CC = g++ -OPT = -g -O9 +OPT = -g # -O9 CFLAGS = -Wall $(OPT) ABIBIT = 64 diff -r f40558ec00a8 -r 5b024efa2429 example/many_task/Makefile.def --- a/example/many_task/Makefile.def Sat Feb 18 17:26:32 2012 +0900 +++ b/example/many_task/Makefile.def Sun Feb 19 10:07:27 2012 +0900 @@ -6,9 +6,9 @@ CERIUM = ../../../Cerium -OPT = -O9 +# OPT = -O9 # OPT = -g -O9 -# OPT = -g +OPT = -g CC = g++ CFLAGS = -DUSE_SIMPLE_TASK -Wall $(OPT) # CFLAGS = -Wall $(OPT)