Mercurial > hg > Game > Cerium
changeset 105:3e331f7576a1
*** empty log message ***
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/simple_render/Func.h Mon Mar 03 18:55:28 2008 +0900 @@ -0,0 +1,16 @@ +enum { + INIT, + SDL_INIT, + FINISH, + VIEWER_RUN_INIT, + VIEWER_RUN_LOOP, + VIEWER_RUN_DRAW, + VIEWER_RUN_FINISH, + + TASK_INIT_TEXTURE, + TASK_CREATE_SGP, + TASK_UPDATE_SGP, + TASK_CREATE_PP, + TASK_CREATE_SPAN, + TASK_DRAW +};
--- a/TaskManager/Test/simple_render/Makefile Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/Test/simple_render/Makefile Mon Mar 03 18:55:28 2008 +0900 @@ -8,7 +8,7 @@ TASK_OBJS = $(TASK_SRCS:.cpp=.o) CC = g++ -CFLAGS = -g -Wall# -DDEBUG +CFLAGS = -O9 -g -Wall# -DDEBUG INCLUDE = -I../../../include/TaskManager -I. EXTRA_CFLAGS = `sdl-config --cflags` `xml2-config --cflags` -I/usr/local/include/SDL
--- a/TaskManager/Test/simple_render/main.cpp Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/Test/simple_render/main.cpp Mon Mar 03 18:55:28 2008 +0900 @@ -1,5 +1,6 @@ #include <iostream> #include "viewer.h" +#include "Func.h" #include "polygon.h" #include "demonstration.h" #include "pad.h" @@ -10,8 +11,7 @@ int init(void*, void*); int sdl_init(void*, void*); -int zrow_init(void*, void*); -int run(void*, void*); +int run_init(void*, void*); int finish(void*, void*); extern void task_initialize(); @@ -29,29 +29,29 @@ int init(void *r, void *w) { - int fd_sdl_init, fd_zrow_init, fd_run; - HTaskPtr task_sdl_init, task_zrow_init, task_run; + HTaskPtr task_sdl_init, task_run; __debug("[%s]\n", __FUNCTION__); screen = new Viewer(initArg->bpp, initArg->w, initArg->h); - - fd_sdl_init = manager->open("sdl_init"); - fd_zrow_init = manager->open("zRow_init"); - fd_run = manager->open("run"); + + // obsolute API + // シンボル名登録してほげほげと + // ユーザが自分で ID つけるのどっちがいいかな。 + // 現段階では、ppe と spe の func_list を共有できないので + // シンボル名よりは ID の方が楽。 + //fd_sdl_init = manager->open("sdl_init"); + //fd_zrow_init = manager->open("zRow_init"); + //fd_run = manager->open("run"); + //task_sdl_init = manager->create_task(fd_sdl_init, 0, 0, 0, NULL); + //task_zrow_init = manager->create_task(fd_zrow_init, 0, 0, 0, NULL); + //task_run = manager->create_task(fd_run, 0, 0, 0, NULL); - task_sdl_init = manager->create_task(fd_sdl_init, 0, 0, 0, NULL); - task_zrow_init = manager->create_task(fd_zrow_init, 0, 0, 0, NULL); - task_run = manager->create_task(fd_run, 0, 0, 0, NULL); - - //manager->set_task_depend(task_sdl_init, task_run); - //manager->set_task_depend(task_zrow_init, task_run); - + task_sdl_init = manager->create_task(SDL_INIT, 0, 0, 0, NULL); + task_run = manager->create_task(VIEWER_RUN_INIT, 0, 0, 0, NULL); task_run->set_depend(task_sdl_init); - task_run->set_depend(task_zrow_init); task_sdl_init->spawn(); - task_zrow_init->spawn(); task_run->spawn(); free(initArg); @@ -68,14 +68,7 @@ return 0; } -int zRow_init(void *r, void *w) -{ - __debug("[%s]\n", __FUNCTION__); - screen->zRow_init(); - return 0; -} - -int run(void *r, void *w) +int run_init(void *r, void *w) { __debug("[%s]\n", __FUNCTION__); screen->run_init(); @@ -123,6 +116,7 @@ // 本当は、dlsym みたいなものを使いたいんだけど // 静的なやつはできないん? +#if 0 manager->set_symbol("init", (void*)init); manager->set_symbol("sdl_init", (void*)sdl_init); manager->set_symbol("zRow_init", (void*)zRow_init); @@ -131,6 +125,15 @@ manager->set_symbol("ViewerRunLoop", (void*)run_loop); manager->set_symbol("ViewerRunDraw", (void*)run_draw); manager->set_symbol("ViewerRunFinish", (void*)run_finish); +#else + manager->set_func(INIT, init); + manager->set_func(SDL_INIT, sdl_init); + manager->set_func(FINISH, finish); + manager->set_func(VIEWER_RUN_INIT, run_init); + manager->set_func(VIEWER_RUN_LOOP, run_loop); + manager->set_func(VIEWER_RUN_DRAW, run_draw); + manager->set_func(VIEWER_RUN_FINISH, run_finish); +#endif int bpp = 0; int width = 640; @@ -156,15 +159,14 @@ // その場合は引数とか固定か。まあ引数は argc, argv を持つ // 構造体で固定しても問題はない・・・か? HTaskPtr task_init; - int fd_init; initArg = new struct init_arg; initArg->bpp = bpp; initArg->w = width; initArg->h = height; - fd_init = manager->open("init"); - task_init = manager->create_task(fd_init, 0, 0, 0, NULL); - //manager->spawn_task(task_init); + //fd_init = manager->open("init"); + //task_init = manager->create_task(fd_init, 0, 0, 0, NULL); + task_init = manager->create_task(INIT, 0, 0, 0, NULL); task_init->spawn(); manager->run();
--- a/TaskManager/Test/simple_render/spe/CreatePolygonPack.cpp Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/Test/simple_render/spe/CreatePolygonPack.cpp Mon Mar 03 18:55:28 2008 +0900 @@ -1,38 +1,17 @@ #include <stdio.h> -#include <spu_intrinsics.h> +#include <stdlib.h> +#include <malloc.h> #include "CreatePolygonPack.h" #include "polygon_pack.h" #include "scene_graph_pack.h" -#include "sys.h" void CreatePolygonPack::read(void) { - printf("CreatePolgonPack\n"); - SchedTask::read(); } -//create_pp(SceneGraphPack *sgp, PolygonPack *pp) -//create_pp(void *read, void *write) -//CreatePolygonPack::run(SceneGraphPack *sgp, PolygonPack *pp) -inline float -CreatePolygonPack::sum_across_float4(vector float v) -{ - vector float c12, c2, c3, c4, c34; - vector float result; - - c2 = spu_rlqwbyte(v, 4); - c3 = spu_rlqwbyte(v, 8); - c4 = spu_rlqwbyte(v, 12); - c12 = spu_add(v, c2); - c34 = spu_add(c3, c4); - - result = spu_add(c12, c34); - return (spu_extract(result, 0)); -} - int CreatePolygonPack::run(void *rbuf, void *wbuf) { @@ -92,9 +71,17 @@ } void +CreatePolygonPack::write(void) +{ + SchedTask::write(); + + free(readbuf); + free(writebuf); +} + +void CreatePolygonPack::rotate(float *xyz, float *matrix) { -#if 1 float abc[4]; abc[0] = xyz[0]; @@ -105,50 +92,17 @@ // SIMD 使えるよね for (int i=0; i<4; i++) { - xyz[i] = abc[0]*matrix[i] + abc[1]*matrix[i+4] + abc[2]*matrix[i+8] + abc[3]*matrix[i+12]; + xyz[i] = abc[0]*matrix[i] + abc[1]*matrix[i+4] + + abc[2]*matrix[i+8] + abc[3]*matrix[i+12]; } -#else - vector float *abc = (vector float *)xyz; - float tmp[4]; - - vector float matrixT0 = (vector float){matrix[0], matrix[4], matrix[8], matrix[12]}; - vector float matrixT1 = (vector float){matrix[1], matrix[5], matrix[9], matrix[13]}; - vector float matrixT2 = (vector float){matrix[2], matrix[6], matrix[10], matrix[14]}; - vector float matrixT3 = (vector float){matrix[3], matrix[7], matrix[11], matrix[15]}; - -#if 1 - vector float *v_tmp = (vector float *)tmp; - - *v_tmp = spu_mul(*abc, matrixT0); - xyz[0] = tmp[0] + tmp[1] + tmp[2] + tmp[3]; - *v_tmp = spu_mul(*abc, matrixT1); - xyz[1] = tmp[0] + tmp[1] + tmp[2] + tmp[3]; - *v_tmp = spu_mul(*abc, matrixT2); - xyz[2] = tmp[0] + tmp[1] + tmp[2] + tmp[3]; - *v_tmp = spu_mul(*abc, matrixT3); - xyz[3] = tmp[0] + tmp[1] + tmp[2] + tmp[3]; -#else - vector float v_tmp; - - v_tmp = spu_mul(*abc, matrixT0); - xyz[0] = sum_across_float4(v_tmp); - v_tmp = spu_mul(*abc, matrixT1); - xyz[1] = sum_across_float4(v_tmp); - v_tmp = spu_mul(*abc, matrixT2); - xyz[2] = sum_across_float4(v_tmp); - v_tmp = spu_mul(*abc, matrixT3); - xyz[3] = sum_across_float4(v_tmp); -#endif -#endif - } SchedTask* createTask_createPolygonPack(TaskListPtr _taskList, TaskPtr _task, void *rbuff, void *wbuff, DmaManager *dma) { - //rbuff = memalign(16, sizeof(SceneGraphPack)); - //wbuff = memalign(16, sizeof(PolygonPack)); + rbuff = memalign(16, sizeof(SceneGraphPack)); + wbuff = memalign(16, sizeof(PolygonPack)); return new CreatePolygonPack(_taskList, _task, rbuff, wbuff, dma); }
--- a/TaskManager/Test/simple_render/spe/CreatePolygonPack.h Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/Test/simple_render/spe/CreatePolygonPack.h Mon Mar 03 18:55:28 2008 +0900 @@ -12,6 +12,7 @@ :SchedTask(_tlist, _task, _rbuf, _wbuf, _con) {} void read(void); int run(void *readbuf, void *writebuf); + void write(void); private: void rotate(float *xyz, float *matrix);
--- a/TaskManager/Test/simple_render/spe/Makefile Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/Test/simple_render/spe/Makefile Mon Mar 03 18:55:28 2008 +0900 @@ -4,7 +4,7 @@ OBJS = $(SRCS:.cpp=.o) CC = spu-g++ -CFLAGS = -g -Wall #-DDEBUG +CFLAGS = -O9 -g -Wall #-DDEBUG INCLUDE = -I../../../../include/TaskManager -I. -I.. LIBS = -L../../.. -lspemanager# -lm
--- a/TaskManager/Test/simple_render/spe/SpuDraw.cpp Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/Test/simple_render/spe/SpuDraw.cpp Mon Mar 03 18:55:28 2008 +0900 @@ -34,10 +34,19 @@ { int y = 8; int x = IMG_MAX_X; - float z = 65535; + float z = 65535.0f; + int length = x*y; + + zRow = (float*)malloc(sizeof(float)*length); - zRow = (float*)malloc(sizeof(float)*x*y); - memset(zRow, *(int*)&z, sizeof(float)*x*y); +#if 1 + for (int i = 0; i < length; i++) { + zRow[i] = 65536.0f; + } +#else // 当然、こっちが早い。けど、float MAX で memset はどうすれば。。。 + //memset(zRow, *(int*)&z, sizeof(float)*x*y); + memset(zRow, (int)&z, sizeof(float)*length); +#endif } @@ -48,7 +57,6 @@ return (char*)texture_image+(3*((128)*ty+tx)); } - Uint32 SpuDraw::get_rgb(int tx, int ty, void *texture) { @@ -89,8 +97,6 @@ zRow_init(); linebuf_init(); - //void *texture = CellScheduler::tex; - render_y = sp->span[0].y; render_y += 1080/2; render_y = (render_y/8)*8; @@ -136,7 +142,8 @@ tex_ypos = (int)((span->tex_width-1) * tex_y); if (z < zRow[x + j + (width*(y%8))]) { - __debug("x = %d, y = %d, width = %d, end = %d, z = %f\n", x, y, width, end, z); + __debug("x=%d, y=%d, width=%d, end=%d, z=%f\n", + x, y, width, end, z); rgb = get_rgb(tex_xpos,tex_ypos,CellScheduler::tex); zRow[j + x + (width*(y%8))] = z; __debug("rgb = %d\n", rgb); @@ -159,21 +166,19 @@ for (int i = 0; i < 8; i++) { spu_mfcdma32(&linebuf[i*IMG_MAX_X], fbdev_addr + (4*1920*(y+i)), sizeof(int)*IMG_MAX_X, i+5, MFC_PUT_CMD); - connector->dma_wait(i+5); - //dma_tags |= 1 << (i+5); + //connector->dma_wait(i+5); + dma_tags |= 1 << (i+5); } } -#if 0 void SpuDraw::write(void) { SchedTask::write(); - //spu_writech(MFC_WrTagMask, dma_tags); - //spu_mfcstat(MFC_TAG_UPDATE_ALL); + spu_writech(MFC_WrTagMask, dma_tags); + spu_mfcstat(MFC_TAG_UPDATE_ALL); } -#endif SchedTask* createTask_spuDraw(TaskListPtr _taskList, TaskPtr _task,
--- a/TaskManager/Test/simple_render/spe/SpuDraw.h Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/Test/simple_render/spe/SpuDraw.h Mon Mar 03 18:55:28 2008 +0900 @@ -5,8 +5,8 @@ # include "SchedTask.h" #endif -//#define IMG_MAX_X 1080 -#define IMG_MAX_X 512 +//#define IMG_MAX_X 1920 +#define IMG_MAX_X 640 #ifndef NULL # define NULL (0) @@ -58,7 +58,7 @@ unsigned int dma_tags; int run(void *readbuf, void *writebuf); - //void write(void); + void write(void); private: void zRow_init(void);
--- a/TaskManager/Test/simple_render/spe/spe-main.cpp Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/Test/simple_render/spe/spe-main.cpp Mon Mar 03 18:55:28 2008 +0900 @@ -1,3 +1,4 @@ +#include "../Func.h" #include "SchedTask.h" //extern SchedTask* @@ -27,6 +28,6 @@ task_init(void) { //set_task(2, createTask_createPolygonPack); - set_task(0, createTask_LoadTexture); - set_task(1, createTask_spuDraw); + set_task(TASK_INIT_TEXTURE, createTask_LoadTexture); + set_task(TASK_DRAW, createTask_spuDraw); }
--- a/TaskManager/Test/simple_render/task/task_init.cpp Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/Test/simple_render/task/task_init.cpp Mon Mar 03 18:55:28 2008 +0900 @@ -1,3 +1,4 @@ +#include "../Func.h" #include "polygon.h" #include "scene_graph_pack.h" #include "polygon_pack.h" @@ -10,15 +11,17 @@ extern int update_sgp(SceneGraphPack *sgp, SceneGraphPack *_sgp); extern int create_pp(SceneGraphPack *sgp, PolygonPack *pp); extern int create_span(void *wbuf, void *rbuf); -//extern int spu_span(SPANPACKLIST *spl, SPUSPANLIST *ssl); -//extern int spu_span(SPLSSL *splssl, SPUSPANLIST *a); void task_initialize() { - manager->set_symbol("CreateSGP", (void*)create_sgp); - manager->set_symbol("UpdateSGP", (void*)update_sgp); - manager->set_symbol("CreatePP", (void*)create_pp); - manager->set_symbol("CreateSP", (void*)create_span); - //manager->set_symbol("SpuSP", (void*)spu_span); + //manager->set_symbol("CreateSGP", (void*)create_sgp); + //manager->set_symbol("UpdateSGP", (void*)update_sgp); + //manager->set_symbol("CreatePP", (void*)create_pp); + //manager->set_symbol("CreateSP", (void*)create_span); + + manager->set_func(TASK_CREATE_SGP, (SymTable::FuncObject)create_sgp); + manager->set_func(TASK_UPDATE_SGP, (SymTable::FuncObject)update_sgp); + manager->set_func(TASK_CREATE_PP, (SymTable::FuncObject)create_pp); + manager->set_func(TASK_CREATE_SPAN, create_span); }
--- a/TaskManager/Test/simple_render/viewer.cpp Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/Test/simple_render/viewer.cpp Mon Mar 03 18:55:28 2008 +0900 @@ -4,6 +4,7 @@ #include "viewer.h" #include "sys.h" #include "spu_span.h" +#include "Func.h" using namespace std; #define redMask 0x00ff0000 @@ -12,8 +13,6 @@ #define alphaMask 0 extern int create_sgp(Polygon *sg, SceneGraphPack *sgp); -extern int update_sgp(SceneGraphPack *sgp, SceneGraphPack *_sgp); -extern int create_pp(SceneGraphPack *sgp, PolygonPack *pp); Viewer::Viewer(int b, int w, int h) { @@ -242,11 +241,6 @@ Viewer::run_init() { HTaskPtr task; - int fd; - - //SceneGraphPack *sgp; - //PolygonPack *pp; - //SPUSPANLIST *ssl; start_time = get_ticks(); this_time = 0; @@ -293,13 +287,14 @@ width*4, redMask, greenMask, blueMask, alphaMask); - fd = manager->open("ViewerRunLoop"); - task = manager->create_task(fd, 0, 0, 0, NULL); + task = manager->create_task(VIEWER_RUN_LOOP, 0, 0, 0, NULL); task->spawn(); posix_memalign((void**)&__texture, 16, 128*128*3); memcpy(__texture, polygon->texture_image->pixels, 128*128*3); - HTaskPtr task_init_tex = manager->create_task(0, 0, (uint32)__texture, 0, NULL); + HTaskPtr task_init_tex + = manager->create_task(TASK_INIT_TEXTURE, 0, + (uint32)__texture, 0, NULL); task_init_tex->set_cpu(CPU_SPE); task_init_tex->spawn(); } @@ -311,21 +306,15 @@ HTaskPtr task_create_pp = NULL; HTaskPtr task_create_sp = NULL; HTaskPtr task_finish = NULL; - int fd_update_sgp; - int fd_create_pp; - int fd_create_sp; - int fd_finish; HTaskPtr task; - int fd; bool quit_flg; quit_flg = quit_check(); if (quit_flg == true) { this_time = get_ticks(); - fd_finish = manager->open("ViewerRunFinish"); - task_finish = manager->create_task(fd_finish, 0, 0, 0, NULL); + task_finish = manager->create_task(VIEWER_RUN_FINISH, 0, 0, 0, NULL); task_finish->spawn(); return; } @@ -339,32 +328,15 @@ // これ自身、一つのタスクとして回す方がよいか //graph_line(); - fd_update_sgp = manager->open("UpdateSGP"); - fd_create_pp = manager->open("CreatePP"); - fd_create_sp = manager->open("CreateSP"); - fd = manager->open("ViewerRunDraw"); - -#if 0 // USE DOUBLE BUFFER task_update_sgp - = manager->create_task(fd_update_sgp, sizeof(SceneGraphPack), - sgp_buff, sgp_buff, NULL); - task_create_pp - = manager->create_task(fd_create_pp, sizeof(SceneGraphPack), - sgp_buff, pp_buff, NULL); - task_create_sp - = manager->create_task(fd_create_sp, sizeof(SceneGraphPack), - pp_buff, ssl_buff, NULL); -#else - task_update_sgp - = manager->create_task(fd_update_sgp, sizeof(SceneGraphPack), + = manager->create_task(TASK_UPDATE_SGP, sizeof(SceneGraphPack), (uint32)sgp, (uint32)sgp, NULL); task_create_pp - = manager->create_task(fd_create_pp, sizeof(SceneGraphPack), + = manager->create_task(TASK_CREATE_PP, sizeof(SceneGraphPack), (uint32)sgp, (uint32)pp, NULL); task_create_sp - = manager->create_task(fd_create_sp, sizeof(PolygonPack), + = manager->create_task(TASK_CREATE_SPAN, sizeof(PolygonPack), (uint32)pp, 0, NULL); -#endif #if 0 @@ -377,7 +349,7 @@ task_draw_finish->set_depend(tas_spu_draw[i]); } #endif - task = manager->create_task(fd, 0, 0, 0, NULL); + task = manager->create_task(VIEWER_RUN_DRAW, 0, 0, 0, NULL); task->set_depend(task_update_sgp); task->set_depend(task_create_pp); @@ -407,18 +379,20 @@ { HTaskPtr task; HTaskPtr task_draw[6][10]; - int fd; - fd = manager->open("ViewerRunLoop"); - task = manager->create_task(fd, 0, 0, 0, NULL); + //fd = manager->open("ViewerRunLoop"); + //task = manager->create_task(fd, 0, 0, 0, NULL); + task = manager->create_task(VIEWER_RUN_LOOP, 0, 0, 0, NULL); #if 1 for (int j = 0; j < 6; j++) { for (int i = 0; i < 10; i++) { if (ssl->ss[j].spp[i].info.size < 1) continue; + // memcpy はもちろんだめ。だけど。。。 + // SPUSPAN->ss は配列で、各要素がアライメントとれてないと駄目。 memcpy(&send_pack[j][i], &ssl->ss[j].spp[i], sizeof(SPANPACK)); task_draw[j][i] - = manager->create_task(1, sizeof(SPANPACK), + = manager->create_task(TASK_DRAW, sizeof(SPANPACK), (uint32)&send_pack[j][i], fbdev_addr, NULL); task_draw[j][i]->set_cpu(CPU_SPE); task->set_depend(task_draw[j][i]);
--- a/TaskManager/kernel/ppe/SymTable.cc Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/kernel/ppe/SymTable.cc Mon Mar 03 18:55:28 2008 +0900 @@ -21,7 +21,7 @@ } void -SymTable::set_symbol(const char *sym, void *addr) +SymTable::set_symbol(const char *sym, FuncObject addr) { SymTbPtr tb = &symtb[symtb_index++]; @@ -30,7 +30,15 @@ tb->address = addr; } -void* +void +SymTable::set_func(int id, FuncObject addr) +{ + SymTbPtr tb = &symtb[id]; + + tb->address = addr; +} + +SymTable::FuncObject SymTable::get_address(int fd) { if (fd >= symtb_index) {
--- a/TaskManager/kernel/ppe/TaskManager.cc Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/kernel/ppe/TaskManager.cc Mon Mar 03 18:55:28 2008 +0900 @@ -106,11 +106,17 @@ // ここは、バイナリから自動的に読めるとうれしいけど // どうやるんだろうね。ユーザに追加させるのはめんどくさい void -TaskManager::set_symbol(const char *sym, void *addr) +TaskManager::set_symbol(const char *sym, SymTable::FuncObject addr) { symtb->set_symbol(sym, addr); } +void +TaskManager::set_func(int id, SymTable::FuncObject addr) +{ + symtb->set_func(id, addr); +} + /** * open というか、今は topen (task open) ? 違うな */ @@ -120,7 +126,7 @@ return symtb->get_fd(sym); } -void* +SymTable::FuncObject TaskManager::get_address(int fd) { return symtb->get_address(fd);
--- a/TaskManager/kernel/schedule/SchedTask.cc Mon Mar 03 17:21:20 2008 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Mon Mar 03 18:55:28 2008 +0900 @@ -45,8 +45,9 @@ // ごちゃごちゃしてるな // 最初から void* じゃなくて 関数ポインタ としていれるべきか? - int (*func)(void*, void*) - = (int (*)(void*,void*))TaskManager::get_address(task->command); + //int (*func)(void*, void*) + //= (int (*)(void*,void*))TaskManager::get_address(task->command); + SymTable::FuncObject func = TaskManager::get_address(task->command); task->in_size = func(readbuf, writebuf); //task->in_size = func((void*)task->in_addr, (void*)task->out_addr); connector->dma_store(writebuf, task->out_addr, task->in_size, DMA_WRITE);
--- a/include/TaskManager/CellBufferManager.h Mon Mar 03 17:21:20 2008 +0900 +++ b/include/TaskManager/CellBufferManager.h Mon Mar 03 18:55:28 2008 +0900 @@ -21,7 +21,7 @@ void clear_cellTaskList(void); #if 0 - virtual TaskListPtr get_available_taskList(void); + TaskListPtr get_available_taskList(void); virtual void clear_taskList(void); virtual void append_waitTask(HTaskPtr); #endif
--- a/include/TaskManager/SchedTask.h Mon Mar 03 17:21:20 2008 +0900 +++ b/include/TaskManager/SchedTask.h Mon Mar 03 18:55:28 2008 +0900 @@ -25,13 +25,6 @@ DmaManager* connector; - // work area - // global variable 用とか - // 次の task に引き渡したり - // size : デフォルトで 4k - // ppuから教えてもらう? task に入れる - void (*func)(void *wbuf, void *rbuf); - /* functions */ SchedTaskBase* next(Scheduler *, SchedTaskBase *);
--- a/include/TaskManager/SymTable.h Mon Mar 03 17:21:20 2008 +0900 +++ b/include/TaskManager/SymTable.h Mon Mar 03 18:55:28 2008 +0900 @@ -3,22 +3,25 @@ #define SYM_MAX_SIZE 64 -typedef struct sym_table { - char *sym; - void *address; -} SymTb, *SymTbPtr; - class SymTable { public: ~SymTable(void); + typedef int (*FuncObject)(void *, void*); + + typedef struct sym_table { + char *sym; + FuncObject address; + } SymTb, *SymTbPtr; + SymTbPtr symtb; int symtb_index; void init(void); - void set_symbol(const char *sym, void *addr); + void set_symbol(const char *sym, FuncObject addr); + void set_func(int id, FuncObject addr); int get_fd(const char *sym); - void* get_address(int fd); + FuncObject get_address(int fd); }; #endif
--- a/include/TaskManager/TaskManager.h Mon Mar 03 17:21:20 2008 +0900 +++ b/include/TaskManager/TaskManager.h Mon Mar 03 18:55:28 2008 +0900 @@ -31,9 +31,10 @@ void set_init_task(const char *sym); - void set_symbol(const char *sym, void *addr); + void set_symbol(const char *sym, SymTable::FuncObject addr); + void set_func(int id, SymTable::FuncObject addr); int open(const char *sym); - static void* get_address(int fd); + static SymTable::FuncObject get_address(int fd); DmaBuffer* allocate(int size);
--- a/include/TaskManager/task.h Mon Mar 03 17:21:20 2008 +0900 +++ b/include/TaskManager/task.h Mon Mar 03 18:55:28 2008 +0900 @@ -1,7 +1,7 @@ #ifndef INCLUDED_TASK #define INCLUDED_TASK -#define TASK_MAX_SIZE 30 +#define TASK_MAX_SIZE 15 typedef struct task_queue TaskQueue, *TaskQueuePtr; typedef struct htask HTask, *HTaskPtr;