Mercurial > hg > Members > kono > Cerium
changeset 98:f320d1039d51
*** empty log message ***
author | akira |
---|---|
date | Thu, 28 Feb 2008 21:45:13 +0900 |
parents | 21958f9a31c7 |
children | 57bac9e07662 |
files | TaskManager/Cell/spe/CellScheduler.cc TaskManager/Test/simple_render/test/LoadTexture/spe/Load_Texture.cpp include/TaskManager/CellScheduler.h |
diffstat | 3 files changed, 32 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/spe/CellScheduler.cc Thu Feb 28 20:10:35 2008 +0900 +++ b/TaskManager/Cell/spe/CellScheduler.cc Thu Feb 28 21:45:13 2008 +0900 @@ -1,5 +1,4 @@ #include <malloc.h> -#include <stdio.h> #include "CellScheduler.h" #include "CellDmaManager.h" #include "error.h" @@ -7,21 +6,34 @@ // ユーザプログラムで定義 // なんだけど、それは微妙じゃね? extern void task_init(void); +void* CellScheduler::tex; void CellScheduler::init_impl(void) { connector = new CellDmaManager; - printf("%d\n", DMA_MAX_SIZE); - printf("%d\n", sizeof(TaskList)); - for (int i = 0; i < 2; i++) { + listBuf[i] = (TaskListPtr)memalign(DEFAULT_ALIGNMENT, sizeof(TaskList)); //listBuf[i] = (TaskListPtr)memalign(DEFAULT_ALIGNMENT, DMA_MAX_SIZE); - listBuf[i] = (TaskListPtr)memalign(DEFAULT_ALIGNMENT, sizeof(TaskList)); - readBuf[i] = memalign(DEFAULT_ALIGNMENT, DMA_MAX_SIZE); - writeBuf[i] = memalign(DEFAULT_ALIGNMENT, DMA_MAX_SIZE); + //readBuf[i] = memalign(DEFAULT_ALIGNMENT, DMA_MAX_SIZE); + //writeBuf[i] = memalign(DEFAULT_ALIGNMENT, DMA_MAX_SIZE); + readBuf[i] = 0; + writeBuf[i] = 0; } task_init(); } + + +void* +CellScheduler::get_state(int id) { + return state[id]; +} + +void* +CellScheduler::set_state(int id, void *value) { + void* reply = state[id]; + state[id] = value; + return reply; +}
--- a/TaskManager/Test/simple_render/test/LoadTexture/spe/Load_Texture.cpp Thu Feb 28 20:10:35 2008 +0900 +++ b/TaskManager/Test/simple_render/test/LoadTexture/spe/Load_Texture.cpp Thu Feb 28 21:45:13 2008 +0900 @@ -1,6 +1,8 @@ #include <stdio.h> #include <spu_intrinsics.h> #include <spu_mfcio.h> +#include <malloc.h> +#include "CellScheduler.h" #include "Load_Texture.h" #include "error.h" #include "SchedTask.h" @@ -13,7 +15,6 @@ #define height 128 #define width 128 -void *texture; int LoadTexture::run(void *rbuf , void *wbuf) @@ -98,5 +99,8 @@ SchedTask * createTask_LoadTexture(TaskListPtr _taskList, TaskPtr _task, void *rbuf, void *wbuf, DmaManager *dma) { + CellScheduler::tex = memalign(DEFAULT_ALIGNMENT, DMA_MAX_SIZE*3); + rbuf = CellScheduler::tex; + return new LoadTexture(_taskList, _task, rbuf, wbuf, dma); }
--- a/include/TaskManager/CellScheduler.h Thu Feb 28 20:10:35 2008 +0900 +++ b/include/TaskManager/CellScheduler.h Thu Feb 28 21:45:13 2008 +0900 @@ -5,9 +5,17 @@ # include "Scheduler.h" #endif + class CellScheduler : public Scheduler { public: + static void *tex; + void *state[16]; void init_impl(void); + void *get_state(int); + void *set_state(int,void*); }; +//extern void* CellScheduler::tex; +//const int CellScheduler::MAX_GLOBAL_STATE = 16; + #endif