Mercurial > hg > Members > kono > Cerium
changeset 316:1d88baf53e57
run に smanager を引数として渡すようにした
author | e065746@localhost.localdomain |
---|---|
date | Tue, 09 Jun 2009 22:28:13 +0900 |
parents | 2ddf79a7c5fb |
children | ca2d52243f92 |
files | TaskManager/Test/test_render/Camera.cpp TaskManager/kernel/schedule/SchedTask.cc example/many_task/spe/QuickSort.cc example/many_task/spe/QuickSort.h include/TaskManager/SchedTask.h |
diffstat | 5 files changed, 20 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/Camera.cpp Tue Jun 09 01:22:11 2009 +0900 +++ b/TaskManager/Test/test_render/Camera.cpp Tue Jun 09 22:28:13 2009 +0900 @@ -2,6 +2,7 @@ #include "SceneGraphRoot.h" #include "Camera.h" #include "sys.h" +#include "Scheduler.h" static void camera_move(SceneGraphPtr _node, int screen_w, int screen_h) @@ -23,6 +24,15 @@ } #endif + /* + * ここに show_dma_wait 表示をいれようか + */ + + /*if (pad->r1.isPush()) { + Scheduler *scheduler; + scheduler->show_dma_wait(); + }*/ + if (pad->r1.isPush() || pad->r1.isHold()) { node->xyz[2] += 10.0f; } else if (pad->l1.isPush() || pad->l1.isHold()) {
--- a/TaskManager/kernel/schedule/SchedTask.cc Tue Jun 09 01:22:11 2009 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Tue Jun 09 22:28:13 2009 +0900 @@ -40,6 +40,7 @@ ex_next = &SchedTask::ex_next_normal; run_func = &SchedTask::run; + run_func1 = &SchedTask::run; } /** @@ -180,6 +181,7 @@ //run(__readbuf, __writebuf); (this->*run_func)(__readbuf, __writebuf); + (this->*run_func1)(this, __readbuf, __writebuf); free(__readbuf);
--- a/example/many_task/spe/QuickSort.cc Tue Jun 09 01:22:11 2009 +0900 +++ b/example/many_task/spe/QuickSort.cc Tue Jun 09 22:28:13 2009 +0900 @@ -6,11 +6,11 @@ SchedDefineTask(QuickSort); int -QuickSort::run(void* rbuff, void* wbuff) { +QuickSort::run(SchedTask *smanager, void* rbuff, void* wbuff) { int begin = 0; - int end = get_param(0); - DataPtr r_data = (DataPtr)get_input(0); - DataPtr w_data = (DataPtr)get_output(0); + int end = smanager->get_param(0); + DataPtr r_data = (DataPtr)smanager->get_input(0); + DataPtr w_data = (DataPtr)smanager->get_output(0); //SpeProfile *prof = new SpeProfile; //prof->ProfStart();
--- a/example/many_task/spe/QuickSort.h Tue Jun 09 01:22:11 2009 +0900 +++ b/example/many_task/spe/QuickSort.h Tue Jun 09 22:28:13 2009 +0900 @@ -9,9 +9,9 @@ class QuickSort : public SchedTask { public: - SchedConstructor(QuickSort); + SchedConstructor(QuickSort); - int run(void *r, void *w); + int run(SchedTask *smanager, void *r, void *w); void quick_sort(Data *data, int left, int right); void bubble_sort(Data *data, int left, int right); void swap(Data *data, int left, int right );
--- a/include/TaskManager/SchedTask.h Tue Jun 09 01:22:11 2009 +0900 +++ b/include/TaskManager/SchedTask.h Tue Jun 09 22:28:13 2009 +0900 @@ -72,9 +72,11 @@ // ここをユーザが継承して // それぞれのタスクに対応した処理を記述する + virtual int run(SchedTask* smanager, void* r, void *w) { return 0; } virtual int run(void* r, void *w) { return 0; } int (SchedTask::*run_func)(void* r, void *w); + int (SchedTask::*run_func1)(SchedTask* smanager, void* r, void *w); //--- System API --- SchedTask* get_nextTask(TaskListPtr list);