Mercurial > hg > Game > Cerium
changeset 1368:6e388be03bb1 draft
merge
author | Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 20 Jan 2012 16:50:30 +0900 |
parents | 6748a09c63cb (current diff) a5797dff2262 (diff) |
children | 6af1f474db3e 7afeb56ba212 |
files | |
diffstat | 11 files changed, 221 insertions(+), 134 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraphRoot.cc Fri Jan 20 16:50:09 2012 +0900 +++ b/Renderer/Engine/SceneGraphRoot.cc Fri Jan 20 16:50:30 2012 +0900 @@ -232,9 +232,6 @@ doc = xmlParseFile(xmlfile); cur = xmlDocGetRootElement(doc); - /* ?? */ - xmlStrcmp(cur->name,(xmlChar*)"OBJECT-3D"); - /* XMLのノードを一つずつ解析 */ for (cur=cur->children; cur; cur=cur->next) { /*初期化:curをドキュメントルートの一個下に設定 @@ -370,6 +367,10 @@ polylist_count = 0; vcsum = 0; + limit = 0; + vmember = 0; + + images_flag=0; } int polylist; int library_images; @@ -399,11 +400,17 @@ char *name; char *tex_picname; + + int images_flag; + int vcsum; -}; + int limit; + int vmember; +}; + + static texture_list list[TABLE_SIZE]; -static texture_list *texture_info; void get_texpic(char *filename, SceneGraphPtr sg, xmlNodePtr cur, TaskManager *manager) { @@ -411,22 +418,19 @@ if (filename == NULL || filename[0] == 0) { return; } - /** * image_name を既に Load していれば何もしない */ int tex_id; /* ball test */ if (sgid_hash.sg_hash_regist(/*filename*/"Ball", tex_id) == -1) { - SDL_Surface *texture_image = sg->load_decode_image(filename, image_name, cur); if (texture_image==0) { printf("Can't load image %s\n",filename); exit(0); } - texture_info->texture_id = sg->makeTapestries(manager, texture_image, tex_id); - tex_id = texture_info->texture_id; - + sg->texture_info->texture_id = sg->makeTapestries(manager, texture_image, tex_id); + tex_id = sg->texture_info->texture_id; if (unlink(image_name)) { printf("unlink error\n"); } @@ -434,28 +438,24 @@ /** * 以前に Load されている Texture を共用 */ - texture_info->texture_id = tex_id; + sg->texture_info->texture_id = tex_id; } - - // こんなことすると list[] のいみあるのかなーと // 微妙に思う、自分で書き換えた感想 by gongo - texture_info->t_w = list[tex_id].t_w; - texture_info->t_h = list[tex_id].t_h;; - texture_info->pixels_orig = list[tex_id].pixels_orig; - texture_info->pixels = list[tex_id].pixels; - texture_info->scale_max = list[tex_id].scale_max; - texture_info->texture_image = list[tex_id].texture_image; - + sg->texture_info->t_w = list[tex_id].t_w; + sg->texture_info->t_h = list[tex_id].t_h;; + sg->texture_info->pixels_orig = list[tex_id].pixels_orig; + sg->texture_info->pixels = list[tex_id].pixels; + sg->texture_info->scale_max = list[tex_id].scale_max; + sg->texture_info->texture_image = list[tex_id].texture_image; } -void decode_float_array(xmlNodePtr cur,LIST_P list ){ +void decode_float_array(xmlNodePtr cur,LIST_P list){ SOURCE_P src = (SOURCE_P)malloc(sizeof(SOURCE)); char *id = (char*)xmlGetProp(cur, (xmlChar*)"id"); src->id = (char*)xmlGetProp(cur, (xmlChar*)"id"); int count = atoi((char*)xmlGetProp(cur, (xmlChar*)"count")); src->count = atoi((char*)xmlGetProp(cur, (xmlChar*)"count")); - //src->u.array = (float*)malloc(sizeof(float)*src->count); src->u.array = new float[src->count]; char *cont =(char*)xmlNodeGetContent(cur); //const char *id = get_property("id", cur); @@ -474,84 +474,103 @@ void get_points(xmlNodePtr cur, collada_state *s, TaskManager *manager){ - printf("start decode points\n"); char *pcont = (char*)xmlNodeGetContent(cur); for (int i = 0;i < s->polylist_count;i++){ s->vcsum += s->vcount[i]; + s->vmember = i; } - - //s->pcount = (float*)malloc(sizeof(float)*vcsum); - s->pcount = new float[s->vcsum]; + s->limit = s->vcsum * 2; + if (s->texcoord_offset == 2){ + s->limit = s->vcsum * 3; + } + s->pcount = new float[s->limit]; + for (int i=0;i<s->limit;i++){ + s->pcount[i] = 0; + } for (int i=0; pcont != NULL; i++) { pcont = pickup_float(pcont, s->pcount+i); } } -void -decode_points(xmlNodePtr cur, collada_state *s, TaskManager *manager){ - int vertexp[s->vcsum]; + +SceneGraph* +decode_points(collada_state *s, TaskManager *manager, SceneGraphPtr sg){ + int *vertexp; + vertexp = new int[s->vcsum]; for (int i=0;i<s->vcsum;i++){ vertexp[i]=0; } - //float *vertex_table; - //float *normal_table; - //float *texcoord_table; - - float vertex_table[s->vertex_float->count]; - //vertex_table = new float[s->vertex_float->count]; - //float *vertex_table = (float*)malloc(sizeof(float)*s->vertex_float->count) ; - - float normal_table[s->normal_float->count]; - //normal_table = new float[s->normal_float->count]; - //float *normal_table = (float*)malloc(sizeof(float)*s->normal_float->count); - - float texcoord_table[s->texcoord_float->count]; - //texcoord_table = new float[s->texcoord_float->count]; - //float *texcoord_table = (float*)malloc(sizeof(float)*s->texcoord_float->count) ; - - int limit = s->vcsum * 2; - if (s->texcoord_offset == 2){ - limit = s->vcsum * 3; + /* + * vertex_tableだけはpolygonを作る際にvcountが4の場合重複する点が + * 出てくるのでサイズを2倍用意しておく + */ + float *vertex_table; + float *normal_table; + float *texcoord_table; + vertex_table = new float[(s->vcsum)*2]; + normal_table = new float[s->vcsum]; + texcoord_table = new float[s->vcsum]; + for (int i=0;i < s->vcsum;i++){ + vertex_table[i] = 0; + normal_table[i] = 0; + texcoord_table[i] = 0; } + /** + * s->vcsum と s->vertex_float->countの値が違うので大きい方をとりあえず使っておく + */ + /* p separate vertex position and nomal position. */ - for (int i=0,j=0; i < limit; i+=2,j++) { - vertexp[j] = s->pcount[i]; - normal_table[j] = s->normal_float->u.array[(int)s->pcount[i+1]]; - if (s->texcoord_offset == 2) { + if (s->texcoord_offset == 2){ + for (int i=0,j=0; i < s->limit; i+=3,j++) { + vertexp[j] = (int)s->pcount[i]; + normal_table[j] = s->normal_float->u.array[(int)s->pcount[i+1]]; texcoord_table[j] = s->texcoord_float->u.array[(int)s->pcount[i+2]]; - i++; + } + } else{ + for (int i=0,j=0; i < s->limit; i+=2,j++) { + vertexp[j] = (int)s->pcount[i]; + normal_table[j] = s->normal_float->u.array[(int)s->pcount[i+1]]; } } - for (int i=0;i<s->vcsum;i++) { + /* make triangle */ + int k=0,l=0; + for (int i=0;i<s->vmember;i++) { if (s->vcount[i] == 4) { - for (int j=0; j < s->vcount[i]; j++) { - vertex_table[i] = s->vertex_float->u.array[vertexp[i]]; - vertex_table[i+3] = s->vertex_float->u.array[vertexp[i+1]]; - i += 2; - } - }else if (s->vcount[i]==3) { - vertex_table[i] = s->vertex_float->u.array[vertexp[i]]; - } + vertex_table[k++] = s->vertex_float->u.array[vertexp[l]]; + vertex_table[k++] = s->vertex_float->u.array[vertexp[l+1]]; + vertex_table[k++] = s->vertex_float->u.array[vertexp[l+2]]; + vertex_table[k++] = s->vertex_float->u.array[vertexp[l+1]]; + vertex_table[k++] = s->vertex_float->u.array[vertexp[l+2]]; + vertex_table[k++] = s->vertex_float->u.array[vertexp[l+3]]; + l+=4; + } else if (s->vcount[i]==3) { + vertex_table[k++] = s->vertex_float->u.array[vertexp[l++]]; + vertex_table[k++] = s->vertex_float->u.array[vertexp[l++]]; + vertex_table[k++] = s->vertex_float->u.array[vertexp[l++]]; + } } - /** + + /** * (SceneGraph.cc) * pickup_normal,pickup_coordinate,pickup_textureの処理 * vcsumは頂点の数,countは面の数 */ int count = s->vcsum / 3; //polygonの作成 - SceneGraphPtr sg = new SceneGraph(manager); sg->pp_num = (count + MAX_SIZE_TRIANGLE - 1) / MAX_SIZE_TRIANGLE; - sg->pp = (PolygonPack*)malloc(sizeof(PolygonPack)*sg->pp_num); - //sg->pp = new PolygonPack[sg->pp_num]; + sg->pp = new PolygonPack[sg->pp_num]; for (int i = 0;i < sg->pp_num; i++ ){ - PolygonPackPtr pp = sg->pp; + PolygonPackPtr pp = sg->pp; TrianglePackPtr tri = pp[i].tri; // TrianglePack の size のチェック - int tri_size = (count < MAX_SIZE_TRIANGLE) ? count : MAX_SIZE_TRIANGLE ; + int tri_size = (count < MAX_SIZE_TRIANGLE) ? count : MAX_SIZE_TRIANGLE ; pp[i].info.size = tri_size; + /* default texture peste */ + if (s->images_flag==0) { + get_texpic("collada_file/default.jpg", sg, (xmlNodePtr)NULL, manager); + } int k = 0; int m = 0; int n = 0; @@ -594,29 +613,21 @@ } sg->c_xyz[0] = sg->c_xyz[1] = sg->c_xyz[2] = 0; - /*TEST*/ - for (int i=0; i<s->vcsum; i++) { - printf("vertexp = %d\n", vertexp[i]); - //printf("vertex_table= %f\n", s->vertex_table[i]); - } - int tex_id = 0; - sgid_hash.sg_hash_regist("Ball", tex_id); - //get_texpic(s->tex_picname, sg, cur , manager); - //free(vertexp); - //free(vertex_table); - //free(normal_table); - //free(texcoord_table); - - //delete []vertex_table; - //delete []normal_table; - //delete []texcoord_table; + //int tex_id = 0; + //sgid_hash.sg_hash_regist(s->name, tex_id); + + delete []vertexp; + delete []vertex_table; + delete []normal_table; + delete []texcoord_table; /* got out of polylist */ s->polylist = 0; + return sg; } static void -xml_walk(xmlNodePtr cur, struct collada_state *s, LIST_P list,SceneGraphRoot *root) +xml_walk(xmlNodePtr cur, struct collada_state *s, LIST_P list,SceneGraphPtr sg, SceneGraphRoot *root) { int in_polylist=0; printf("name = %s, child:%s\n", (char *)cur->name, (char *)cur->children); @@ -631,8 +642,10 @@ s->library_images=1;// library_images is wrote at texture image name. only use one image file } else if (s->library_images && !xmlStrcmp(cur->name, (xmlChar*)"init_from")) { s->tex_picname = (char*)xmlGetProp(cur, (xmlChar*)"init_from"); + get_texpic(s->tex_picname, sg, cur , root->tmanager); printf("------------------%s",s->tex_picname); s->library_images=0; + s->images_flag=1; } else if (!s->polylist && !xmlStrcmp(cur->name, (xmlChar*)"input")) { char *semantic = (char*)xmlGetProp(cur, (xmlChar*)"semantic"); if (!xmlStrcmp((xmlChar*)semantic, (xmlChar*)"POSITION")) { @@ -655,7 +668,6 @@ } } else if (!xmlStrcmp(cur->name, (xmlChar*)"vcount")) { char *vcont = (char*)xmlNodeGetContent(cur); - //s->vcount = (float*)malloc(sizeof(float)*s->polylist_count); s->vcount = new float[s->polylist_count]; for (int i=0; vcont!=NULL; i++) { /* store vcount list */ @@ -668,10 +680,9 @@ decode_float_array(cur,list); } else if (!xmlStrcmp(cur->name, (xmlChar*)"node" )) { s->name = (char*)xmlGetProp(cur, (xmlChar*)"id"); - decode_points(cur,s,root->tmanager); } for (cur=cur->children; cur; cur=cur->next){ - xml_walk(cur,s,list,root); + xml_walk(cur,s,list,sg,root); } } @@ -699,12 +710,14 @@ /* node analyze */ struct collada_state s; + SceneGraphPtr sg = new SceneGraph(manager); for (cur=cur->children; cur; cur=cur->next){ LIST list; init_list(&list); - xml_walk(cur,&s,&list,this); + xml_walk(cur,&s,&list,sg,this); } - //xmlFreeDoc(doc); + registSceneGraph(decode_points(&s,manager,sg)); + xmlFreeDoc(doc); } void @@ -718,9 +731,6 @@ doc = xmlParseMemory(data, len); cur = xmlDocGetRootElement(doc); - /* ?? */ - xmlStrcmp(cur->name,(xmlChar*)"OBJECT-3D"); - /* XMLのノードを一つずつ解析 */ for (cur=cur->children; cur; cur=cur->next) { /* 扱うのはsurfaceオンリー */ @@ -858,9 +868,6 @@ light_vector[i*4+3] = light_vector_tmp[i*4+3]; } - - - } }
--- a/Renderer/Engine/base64_de.cc Fri Jan 20 16:50:09 2012 +0900 +++ b/Renderer/Engine/base64_de.cc Fri Jan 20 16:50:30 2012 +0900 @@ -10,6 +10,7 @@ int nlen; }; +const char* szB64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; unsigned char CtoNum(int c) { @@ -89,3 +90,78 @@ return 0; } + +/*const char *encode(const char *infile, int outfile) +{ + int i,j,outfile_; + char *outputString; + + if (outfile==-1) + outfile_ = strlen(infile); + else + outfile_ = outfile; + + outputString = new char[(int)((double)(outfile_)*1.5)+10]; + for(i = 0,j = 0; i < (outfile_ - (outfile_ % 3)); i+=3) + { + outputString[j] = szB64[(infile[i] & 0xfc) >> 2]; + outputString[j+1] = szB64[((infile[i] &0x03) << 4)|((infile[i+1] & 0xf0) >> 4)]; + outputString[j+2] = szB64[((infile[i+1] & 0x0f) <<2 )|((infile[i+2] & 0xc0) >> 6)]; + outputString[j+3] = szB64[(infile[i+2] & 0x3f)]; + j += 4; + } + i = outfile_-(outfile_ % 3); + switch(outfile_ % 3) + { + case 2: + { + outputString[j] = szB64[(infile[i] & 0xfc) >> 2]; + outputString[j+1] = szB64[((infile[i] &0x03) << 4)|((infile[i+1] & 0xf0) >> 4)]; + outputString[j+2] = szB64[((infile[i+1] & 0x0f) <<2 )]; + outputString[j+3] = szB64[64]; // Pad + outputString[j+4] = '\0'; + } + break; + case 1: + { + outputString[j] = szB64[(infile[i] & 0xfc) >> 2]; + outputString[j+1] = szB64[((infile[i] &0x03) << 4)]; + outputString[j+2] = szB64[64]; // Pad + outputString[j+3] = szB64[64]; // Pad + outputString[j+4] = '\0'; + } + break; + } + outputString[j+4] = '\0'; + return outputString; + +}*/ +void encode(istream& istr, ostream& ostr) +{ + int iRet=76; + int i; + char c[3]; + + i = 0; + while(!istr.eof()) + { + c[0] = c[1] = c[2] = '\0'; + istr.read(c,3); + + ostr << szB64[(c[0] & 0xfc) >> 2]; + i++; if(i >= iRet && iRet != -1){ ostr << endl; i = 0; } + ostr << szB64[((c[0] &0x03) << 4) | ((c[1] & 0xf0) >> 4)]; + i++; if(i >= iRet && iRet != -1){ ostr << endl; i = 0; } + if(istr.gcount() == 1) + ostr << szB64[64]; + else + ostr << szB64[((c[1] & 0x0f) <<2 ) | ((c[2] & 0xc0) >> 6)]; + i++; if(i >= iRet && iRet != -1){ ostr << endl; i = 0; } + if(istr.gcount() == 3) + ostr << szB64[(c[2] & 0x3f)]; + else + ostr << szB64[64]; + i++; if(i >= iRet && iRet != -1){ ostr << endl; i = 0; } + } + ostr.flush(); +}
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Fri Jan 20 16:50:09 2012 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Fri Jan 20 16:50:30 2012 +0900 @@ -26,9 +26,6 @@ spe_running = 0; spuIdle = spuIdle_; - //speThreads = new SpeThreads(machineNum); - //speThreads->init(); - // 実行される Task 用の パイプライン用のダブルバッファ speTaskList = new QueueInfo<TaskList>*[machineNum]; // spe上の走っている Task の配列 taskListInfo = new QueueInfo<TaskList>*[machineNum]; // 次に走る Task の配列 @@ -46,6 +43,8 @@ set_scheduler(mscheduler); ppeManager->init(mscheduler, this, useRefDma); // ここで HTaskInfo が共有される。 + speThreads->init(); + // 実行可能な HTask のリスト。 FifoTaskManager と共有される activeTaskQueue = ppeManager->activeTaskQueue; // HTask の factory。 HTaskInfo ならなんでもいい。 @@ -358,7 +357,6 @@ create_impl(int num, int useRefDma) { Threads *cpus = new SpeThreads(num); - cpus->init(); return new CellTaskManagerImpl(num,cpus); } #endif // __CERIUM_CELL
--- a/TaskManager/Fifo/FifoDmaManager.cc Fri Jan 20 16:50:09 2012 +0900 +++ b/TaskManager/Fifo/FifoDmaManager.cc Fri Jan 20 16:50:30 2012 +0900 @@ -11,15 +11,15 @@ { if (size == 0) return buf; - //unsigned long long wait = 0; - //(this->*start_dmawait_profile)(); + unsigned long long wait = 0; + (this->*start_dmawait_profile)(); if (s) buf = s->manager->allocate(size); memcpy(buf, (void*)addr, size); - //(this->*end_dmawait_profile)(&wait); - //global_load_time += wait; - //dma_load_time += wait; + (this->*end_dmawait_profile)(&wait); + global_load_time += wait; + dma_load_time += wait; return buf; } @@ -36,14 +36,14 @@ { if (size == 0) return buf; - //unsigned long long wait = 0; - //(this->*start_dmawait_profile)(); + unsigned long long wait = 0; + (this->*start_dmawait_profile)(); memcpy((void*)addr, buf, size); - //(this->*end_dmawait_profile)(&wait); - //global_store_time += wait; - //dma_store_time += wait; + (this->*end_dmawait_profile)(&wait); + global_store_time += wait; + dma_store_time += wait; return buf; } @@ -60,8 +60,8 @@ void * FifoDmaManager::dma_loadList(Scheduler *s, ListDataPtr list, void *buff, uint32 mask) { - //unsigned long long wait = 0; - //(this->*start_dmawait_profile)(); + unsigned long long wait = 0; + (this->*start_dmawait_profile)(); int list_size = list->length; long bound; @@ -75,9 +75,9 @@ bound += elm->size; } - //(this->*end_dmawait_profile)(&wait); - //global_load_time += wait; - //dma_loadList_time += wait; + (this->*end_dmawait_profile)(&wait); + global_load_time += wait; + dma_loadList_time += wait; return buff; } @@ -93,8 +93,8 @@ void FifoDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask) { - //unsigned long long wait = 0; - //(this->*start_dmawait_profile)(); + unsigned long long wait = 0; + (this->*start_dmawait_profile)(); int list_size = list->length; memaddr bound; @@ -107,9 +107,9 @@ bound += elm->size; } - //(this->*end_dmawait_profile)(&wait); - //global_store_time += wait; - //dma_storeList_time += wait; + (this->*end_dmawait_profile)(&wait); + global_store_time += wait; + dma_storeList_time += wait; } void @@ -168,7 +168,7 @@ s->printf("cpu%d:\n busy_time = %.3g%%" " load_time = %.3g%%, " - " store_time = %.3g%% " + " store_time = %.3g%% \n" ,cpu, busy, load, store); global_busy_time = 0;
--- a/TaskManager/Fifo/FifoDmaManager.h Fri Jan 20 16:50:09 2012 +0900 +++ b/TaskManager/Fifo/FifoDmaManager.h Fri Jan 20 16:50:30 2012 +0900 @@ -28,6 +28,8 @@ mail_queue1 = new MailManager(); mail_queue2 = new MailManager(); #endif + start_dmawait_profile = &FifoDmaManager::null_start_dmawait_profile; + end_dmawait_profile = &FifoDmaManager::null_end_dmawait_profile; } ~FifoDmaManager() {
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Fri Jan 20 16:50:09 2012 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Fri Jan 20 16:50:30 2012 +0900 @@ -342,7 +342,6 @@ return new FifoTaskManagerImpl(num); } else { Threads *cpus = new CpuThreads(num,useRefDma); - cpus->init(); return new CellTaskManagerImpl(num,cpus); } }
--- a/TaskManager/Makefile.fifo Fri Jan 20 16:50:09 2012 +0900 +++ b/TaskManager/Makefile.fifo Fri Jan 20 16:50:30 2012 +0900 @@ -14,8 +14,7 @@ ALL_OBJS = $(KERN_MAIN_OBJS) $(KERN_PPE_OBJS) $(KERN_SCHED_OBJS) \ $(KERN_SYSTASK_OBJS) $(IMPL_FIFO_OBJS) $(KERN_MEM_OBJS) \ - Cell/spe/SpeTaskManagerImpl.o Cell/CellTaskManagerImpl.o \ - Cell/spe/ShowTime.o Cell/spe/StartProfile.o + Cell/spe/SpeTaskManagerImpl.o Cell/CellTaskManagerImpl.o Makefile.dep:
--- a/TaskManager/Makefile.parallel Fri Jan 20 16:50:09 2012 +0900 +++ b/TaskManager/Makefile.parallel Fri Jan 20 16:50:30 2012 +0900 @@ -15,8 +15,7 @@ ALL_OBJS = $(KERN_MAIN_OBJS) $(KERN_PPE_OBJS) $(KERN_SCHED_OBJS) \ $(KERN_SYSTASK_OBJS) $(IMPL_FIFO_OBJS) $(KERN_MEM_OBJS) \ - Cell/spe/SpeTaskManagerImpl.o Cell/CellTaskManagerImpl.o \ - Cell/spe/ShowTime.o Cell/spe/StartProfile.o + Cell/spe/SpeTaskManagerImpl.o Cell/CellTaskManagerImpl.o Makefile.dep: make -f Makefile.parallel depend
--- a/TaskManager/kernel/ppe/CpuThreads.cc Fri Jan 20 16:50:09 2012 +0900 +++ b/TaskManager/kernel/ppe/CpuThreads.cc Fri Jan 20 16:50:30 2012 +0900 @@ -11,19 +11,12 @@ SchedExternTask(StartProfile); -CpuThreads::CpuThreads(int num, int useRefDma, int start_id) : cpu_num(num), id_offset(start_id) { +CpuThreads::CpuThreads(int num, int useRefDma, int start_id) : cpu_num(num), use_refdma(useRefDma), id_offset(start_id) { threads = new pthread_t[cpu_num]; args = new cpu_thread_arg_t[cpu_num]; wait = new Sem(0); - for (int i = 0; i < cpu_num; i++) { - args[i].cpuid = i + id_offset; - args[i].scheduler = new MainScheduler(); - args[i].wait = wait; - args[i].useRefDma = useRefDma; - } - } CpuThreads::~CpuThreads() @@ -73,6 +66,13 @@ //CpuThreads::init() CpuThreads::init() { + for (int i = 0; i < cpu_num; i++) { + args[i].cpuid = i + id_offset; + args[i].scheduler = new MainScheduler(); + args[i].wait = wait; + args[i].useRefDma = use_refdma; + } + for (int i = 0; i < cpu_num; i++) { pthread_create(&threads[i], NULL, &cpu_thread_run, (void*)&args[i]);
--- a/TaskManager/kernel/ppe/CpuThreads.h Fri Jan 20 16:50:09 2012 +0900 +++ b/TaskManager/kernel/ppe/CpuThreads.h Fri Jan 20 16:50:30 2012 +0900 @@ -36,6 +36,7 @@ cpu_thread_arg_t *args; SemPtr wait; //スレッド生成時の待ち用 int cpu_num; + int use_refdma; int id_offset; };
--- a/TaskManager/kernel/schedule/Scheduler.cc Fri Jan 20 16:50:09 2012 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Fri Jan 20 16:50:30 2012 +0900 @@ -48,6 +48,12 @@ task_count = 0; #endif + /* + * ;TODO + * Multi-Core Verの場合、各スレッドにMain Schedulerが作られるが、 + * その際、globalなlistの初期化を繰り返して無駄な処理を行なっている + */ + for (int i = 0; i< MAX_TASK_OBJECT; i++) { task_list[i].run = null_run; task_list[i].load = null_loader;