changeset 1353:df50c95267ba draft

merge
author Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
date Tue, 17 Jan 2012 18:02:27 +0900
parents 57c3b08b76b5 (current diff) f8cabb739697 (diff)
children 652fce805fde ba6c080bf9a4
files Renderer/Engine/SceneGraphRoot.cc TaskManager/Cell/spe/ShowTime.cc TaskManager/Cell/spe/ShowTime.h TaskManager/Cell/spe/StartProfile.cc TaskManager/Cell/spe/StartProfile.h
diffstat 10 files changed, 277 insertions(+), 205 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraphRoot.cc	Tue Jan 17 17:55:52 2012 +0900
+++ b/Renderer/Engine/SceneGraphRoot.cc	Tue Jan 17 18:02:27 2012 +0900
@@ -1,3 +1,4 @@
+#include <iostream>
 #include <SDL_image.h>
 #include <libxml/parser.h>
 #include "SceneGraphRoot.h"
@@ -6,6 +7,7 @@
 #include "TextureHash.h"
 #include "texture.h"
 #include "Application.h"
+#include "polygon.h"
 
 static int cnt = 0;
 static const int SGLIST_LENGTH = 138;
@@ -15,6 +17,7 @@
 
 static TextureHash sgid_hash;
 
+
 SceneGraphRoot *sgroot;
 
 SceneGraphRoot::SceneGraphRoot(float w, float h, TaskManager *manager)
@@ -243,7 +246,7 @@
 	 以下の処理を行なわずにスキップする
       */
       if (xmlStrcmp(cur->name,(xmlChar*)"surface") != 0) {
-	continue;
+	  continue;
       }
       
       /* ポリゴン(SceneGraph)生成
@@ -365,10 +368,11 @@
 	texcoord_count = 0; 
 	
 	polylist_count = 0;
+	vcsum = 0;
 
     }
     int polylist;
-
+    int library_images;
     xmlChar *pid;
 
     char *vertex_src;
@@ -392,168 +396,227 @@
 
     char *vertices_src;
     int polylist_count;
-};
+ 
+    char *name;
+    char *tex_picname;
+    int vcsum;
+}; 
+
+static texture_list list[TABLE_SIZE];
+static texture_list *texture_info;
+
+void get_texpic(char *filename, SceneGraphPtr sg,  xmlNodePtr cur, TaskManager *manager)
+{
+    char image_name[20] = "/tmp/image_XXXXXX";
+    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;
 
+        if (unlink(image_name)) {
+            printf("unlink error\n");
+        }
+    } else {
+        /**
+         * 以前に Load されている Texture を共用
+         */
+        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;
+
+}
+ 
 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);
-        
-        char *cont =(char*)xmlNodeGetContent(cur);
-        //const char *id = get_property("id", cur);
-        //int count = atoi(get_property("count", cur));
+    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);
+    //int count = atoi(get_property("count", cur));
+    
+    /* store float inpoint list */
+    for (int i = 0; cont != NULL; i++) {
+        cont = pickup_float(cont, src->u.array+i);
+    }
 
-        /* store float inpoint list */
-        for (int i = 0; cont != NULL; i++) {
-            cont = pickup_float(cont, src->u.array+i);
-        }
-
-        src->next = NULL;
-        addSource(list, src);
-        printf("id:%s count:%d cont:%s\n", id, count, cont);
+    src->next = NULL;
+    addSource(list, src);
+    printf("id:%s count:%d cont:%s\n", id, count, cont);
 }
 
 
 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->pcount = (float*)malloc(sizeof(float)*vcsum);
+    s->pcount = new float[s->vcsum];
+    for (int i=0; pcont != NULL; i++) {
+        pcont = pickup_float(pcont, s->pcount+i);
+    }
+}
+void
 decode_points(xmlNodePtr cur, collada_state *s, TaskManager *manager){
-        char *pcont = (char*)xmlNodeGetContent(cur);
-        int vcsum = 0;
-	for (int i = 0;i < s->polylist_count;i++){
-	    vcsum += s->vcount[i];
-	}
-        //s->pcount = (float*)malloc(sizeof(float)*vcsum);
-	s->pcount = new float[vcsum];
-        for (int i=0; pcont != NULL; i++) {
-            pcont = pickup_float(pcont, s->pcount+i);
-        }
-	int *vertexp;
-	vertexp = new int[vcsum];
-	for (int i=0;i<vcsum;i++){
-	    vertexp[i]=0;
-	}
-	float *vertex_table;
-	float *normal_table;
-	float *texcoord_table;
-	vertex_table = new float[s->vertex_float->count];
-	//float *vertex_table = (float*)malloc(sizeof(float)*s->vertex_float->count) ;
-	normal_table = new float[s->normal_float->count];
-        //float *normal_table = (float*)malloc(sizeof(float)*s->normal_float->count) ;
-	texcoord_table = new float[s->texcoord_float->count];
-	//float *texcoord_table = (float*)malloc(sizeof(float)*s->texcoord_float->count) ;
-
-	int limit = vcsum * 2;
-	if (s->texcoord_offset == 2){
-	    limit = vcsum * 3;
-	}
+    int vertexp[s->vcsum];
+    for (int i=0;i<s->vcsum;i++){
+       vertexp[i]=0;
+    }
+    //float *vertex_table;
+    //float *normal_table;
+    //float *texcoord_table;
 
-        /* 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) {
-	        texcoord_table[j] = s->texcoord_float->u.array[(int)s->pcount[i+2]];
-		i++;
-            }
-        }
-	delete s->pcount;
-        for (int i=0; vertexp[i];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]];
-            }
-        }
-	delete s->vcount;
-	
-	int count = vcsum / 3; 
-      	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);
-	
-	for (int i = 0;i < sg->pp_num; i++ ){
-	    PolygonPackPtr pp = sg->pp;
-            TrianglePackPtr tri =  pp[i].tri;
-         // TrianglePack の size のチェック
-            int tri_size = (count < MAX_SIZE_TRIANGLE) ? count : MAX_SIZE_TRIANGLE ;
-            pp[i].info.size = tri_size;
-	    int k = 0;
-	    int m = 0;
-	    int n = 0;
-            for (int j = 0; j < tri_size; j++) {
-	      tri[j].normal1.x = normal_table[k++];
-	      tri[j].normal1.y = normal_table[k++];
-      	      tri[j].normal1.z = normal_table[k++];
+    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) ;
 
-	      tri[j].normal2.x = normal_table[k++];
-	      tri[j].normal2.y = normal_table[k++];
-      	      tri[j].normal2.z = normal_table[k++];
+    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) ;
 
-	      tri[j].normal3.x = normal_table[k++];
-	      tri[j].normal3.y = normal_table[k++];
-      	      tri[j].normal3.z = normal_table[k++];
-	    
-	      tri[j].ver1.tex_x = texcoord_table[m++];
-	      tri[j].ver1.tex_y = texcoord_table[m++];
-
-	      tri[j].ver2.tex_x = texcoord_table[m++];
-	      tri[j].ver2.tex_y = texcoord_table[m++];
-
-	      tri[j].ver3.tex_x = texcoord_table[m++];
-	      tri[j].ver3.tex_y = texcoord_table[m++];
-
-	      tri[j].ver1.x = vertex_table[n++];
-	      tri[j].ver1.y = vertex_table[n++];
-	      tri[j].ver1.z = vertex_table[n++];
-
-	      tri[j].ver2.x = vertex_table[n++];
-	      tri[j].ver2.y = vertex_table[n++];
-	      tri[j].ver2.z = vertex_table[n++];
+    int limit = s->vcsum * 2;
+    if (s->texcoord_offset == 2){
+        limit = s->vcsum * 3;
+    }
 
-	      tri[j].ver3.x = vertex_table[n++];
-	      tri[j].ver3.y = vertex_table[n++];
-	      tri[j].ver3.z = vertex_table[n++];
-
-	    }
-	    
+    /* 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) {
+	    texcoord_table[j] = s->texcoord_float->u.array[(int)s->pcount[i+2]];
+	    i++;
 	}
-	sg->c_xyz[0] = sg->c_xyz[1] = sg->c_xyz[2] = 0;
-
-	/*TEST*/
-        for (int i=0; i<vcsum; i++) {
-            printf("vertexp = %d\n", vertexp[i]);
-	    // printf("vertex_table= %f\n", vertex_table[i]);
-        } 
-	//free(vertexp);
-	//free(vertex_table);
-        //free(normal_table);
-	//free(texcoord_table);
-	
-	delete vertexp;
-	delete vertex_table;
-	delete normal_table;
-	delete texcoord_table;
-
-        /* got out of polylist */
-        s->polylist = 0;
-        
     }
 
+    for (int i=0;i<s->vcsum;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]];
+	}
+    }
+    /**
+     * (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];
+    
+    for (int i = 0;i < sg->pp_num; i++ ){
+        PolygonPackPtr pp = sg->pp;
+	TrianglePackPtr tri =  pp[i].tri;
+	// TrianglePack の size のチェック
+	int tri_size = (count < MAX_SIZE_TRIANGLE) ? count : MAX_SIZE_TRIANGLE ;
+	pp[i].info.size = tri_size;
+	int k = 0;
+	int m = 0;
+	int n = 0;
+	for (int j = 0; j < tri_size; j++) {
+	    tri[j].normal1.x = normal_table[k++];
+	    tri[j].normal1.y = normal_table[k++];
+	    tri[j].normal1.z = normal_table[k++];
+	    
+	    tri[j].normal2.x = normal_table[k++];
+	    tri[j].normal2.y = normal_table[k++];
+	    tri[j].normal2.z = normal_table[k++];
+	    
+	    tri[j].normal3.x = normal_table[k++];
+	    tri[j].normal3.y = normal_table[k++];
+	    tri[j].normal3.z = normal_table[k++];
+	    
+	    tri[j].ver1.tex_x = texcoord_table[m++];
+	    tri[j].ver1.tex_y = texcoord_table[m++];
+	    
+	    tri[j].ver2.tex_x = texcoord_table[m++];
+	    tri[j].ver2.tex_y = texcoord_table[m++];
+	    
+	    tri[j].ver3.tex_x = texcoord_table[m++];
+	    tri[j].ver3.tex_y = texcoord_table[m++];
+	    
+	    tri[j].ver1.x = vertex_table[n++];
+	    tri[j].ver1.y = vertex_table[n++];
+	    tri[j].ver1.z = vertex_table[n++];
+	    
+	    tri[j].ver2.x = vertex_table[n++];
+	    tri[j].ver2.y = vertex_table[n++];
+	    tri[j].ver2.z = vertex_table[n++];
+	    
+	    tri[j].ver3.x = vertex_table[n++];
+	    tri[j].ver3.y = vertex_table[n++];
+	    tri[j].ver3.z = vertex_table[n++];
+
+	}
+	
+    }
+    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;
+
+    /* got out of polylist */
+    s->polylist = 0;
+}
 
 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,SceneGraphRoot *root)
 {
     int in_polylist=0;
     printf("name = %s, child:%s\n", (char *)cur->name, (char *)cur->children);
@@ -564,43 +627,52 @@
         in_polylist=1;
     } else if (!xmlStrcmp(cur->name, (xmlChar*)"vertices")) {
         s->pid = xmlGetProp(cur, (xmlChar*)"id");
+    } else if (!xmlStrcmp(cur->name, (xmlChar*)"library_images")) {
+        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");
+        printf("------------------%s",s->tex_picname);
+        s->library_images=0;
     } else if (!s->polylist && !xmlStrcmp(cur->name, (xmlChar*)"input")) {
         char *semantic = (char*)xmlGetProp(cur, (xmlChar*)"semantic");
         if (!xmlStrcmp((xmlChar*)semantic, (xmlChar*)"POSITION")) {
-            s->vertices_src = (char*)xmlGetProp(cur, (xmlChar*)"source");
+	    s->vertices_src = (char*)xmlGetProp(cur, (xmlChar*)"source");
         }
     } else if (s->polylist && !xmlStrcmp(cur->name, (xmlChar*)"input")) {
 	char *semantic = (char*)xmlGetProp(cur, (xmlChar*)"semantic");
         if (!xmlStrcmp((xmlChar*)semantic, (xmlChar*)"VERTEX")) {
-	     s->vertex_src = (char*)xmlGetProp(cur, (xmlChar*)"source");
-             s->vertex_offset = atoi((char*)xmlGetProp(cur, (xmlChar*)"offset"));             
-             s->vertex_float = most_match(s->vertices_src+1, list);
+	    s->vertex_src = (char*)xmlGetProp(cur, (xmlChar*)"source");
+	    s->vertex_offset = atoi((char*)xmlGetProp(cur, (xmlChar*)"offset"));             
+	    s->vertex_float = most_match(s->vertices_src+1, list);
         } else if (!xmlStrcmp((xmlChar*)semantic, (xmlChar*)"NORMAL")) {
             s->normal_src = (char*)xmlGetProp(cur, (xmlChar*)"source");
             s->normal_offset = atoi((char*)xmlGetProp(cur, (xmlChar*)"offset"));
             s->normal_float = most_match(s->normal_src+1, list);
-       } else if (!xmlStrcmp((xmlChar*)semantic, (xmlChar*)"TEXCOORD")) {
+        } else if (!xmlStrcmp((xmlChar*)semantic, (xmlChar*)"TEXCOORD")) {
             s->texcoord_src = (char*)xmlGetProp(cur, (xmlChar*)"source");
             s->texcoord_offset = atoi((char*)xmlGetProp(cur, (xmlChar*)"offset"));
             s->texcoord_float = most_match(s->texcoord_src+1, list);
-       }
+	}
     } 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 */
-             vcont = pickup_float(vcont, s->vcount+i);
+	    /* store vcount list */
+	    vcont = pickup_float(vcont, s->vcount+i);
         }
     } else if (!xmlStrcmp(cur->name, (xmlChar*)"p")) {
-      decode_points(cur,s,root->tmanager);
+        get_points(cur,s,root->tmanager);
 	in_polylist = 0;
     } else if (!xmlStrcmp(cur->name, (xmlChar*)"float_array")) {
         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,root);
+    }
 }
 
 void
@@ -628,14 +700,11 @@
     /* node analyze */
     struct collada_state s;
     for (cur=cur->children; cur; cur=cur->next){
-  
         LIST list;
         init_list(&list);
-	xml_walk(cur,&s, &list,this);
-
+        xml_walk(cur,&s,&list,this);
     }
-
-    xmlFreeDoc(doc);
+    //xmlFreeDoc(doc);
 }
 
 void
@@ -643,7 +712,6 @@
 {
     xmlDocPtr doc;
     xmlNodePtr cur;
-
     // size は取れるはず、テスト用に mmap したデータを使う
     /* パース DOM生成 */
 
--- a/Renderer/Test/collada.cc	Tue Jan 17 17:55:52 2012 +0900
+++ b/Renderer/Test/collada.cc	Tue Jan 17 18:02:27 2012 +0900
@@ -127,7 +127,7 @@
     light->xyz[0] = screen_w / 2;
     light->xyz[1] = screen_h / 2;
     light->xyz[2] = -100;
-
+    printf("createSceneGraph\n");
     ball = sgroot->createSceneGraph(name);
     ball->set_move_collision(ball_move, ball_collision);
 
--- a/TaskManager/Cell/spe/ShowTime.cc	Tue Jan 17 17:55:52 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#include "ShowTime.h"
-//#include "stdio.h"
-#include "SchedTask.h"
-
-SchedDefineTask(ShowTime);
-
-static int
-run(SchedTask *smanager, void *rbuf, void *wbuf)
-{
-    /*
-     * ここで show_dma_wait() を呼びたい
-     */
-    // printf("Show Time !\n");
-    smanager->show_dma_wait();
-
-    return 0;
-}
-
--- a/TaskManager/Cell/spe/ShowTime.h	Tue Jan 17 17:55:52 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-#ifndef INCLUDED_TASK_SHOW_TIME
-#define INCLUDED_TASK_SHOW_TIME
-
-#include "SchedTask.h"
-
-
-#endif
--- a/TaskManager/Cell/spe/StartProfile.cc	Tue Jan 17 17:55:52 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#include "StartProfile.h"
-#include "SchedTask.h"
-//#include "stdio.h"
-
-SchedDefineTask(StartProfile);
-
-static int
-run(SchedTask *smanager, void *rbuf, void *wbuf)
-{
-    smanager->start_profile();
-
-    return 0;
-}
-
--- a/TaskManager/Fifo/rdtsc.h	Tue Jan 17 17:55:52 2012 +0900
+++ b/TaskManager/Fifo/rdtsc.h	Tue Jan 17 18:02:27 2012 +0900
@@ -7,7 +7,9 @@
 
 inline unsigned long long rdtsc() {
 	unsigned long long ret;
+#ifdef __CERIUM_FIFO__
 	__asm__ volatile ("rdtsc" : "=A" (ret));
+#endif // __CERIUM_FIFO__
 	return ret;
 }
 
--- a/TaskManager/Makefile.cell	Tue Jan 17 17:55:52 2012 +0900
+++ b/TaskManager/Makefile.cell	Tue Jan 17 18:02:27 2012 +0900
@@ -27,17 +27,19 @@
     $(CELL_SPE_DIR)/CellDmaManager.cc   \
     $(CELL_SPE_DIR)/CellScheduler.cc    \
     $(CELL_SPE_DIR)/SpeTaskManagerImpl.cc    \
-    $(CELL_SPE_DIR)/ShowTime.cc    \
-    $(CELL_SPE_DIR)/StartProfile.cc    \
     $(CELL_SPE_DIR)/main.cc
 
 CELL_SPE_TASK_SRCS =  \
     $(CELL_SPE_DIR)/TaskQueue.cc \
     $(CELL_SPE_DIR)/Task.cc           
 
+CELL_SPE_PROFILE = \
+	$(KERN_SYSTASK_DIR)/ShowTime.cc  \
+	$(KERN_SYSTASK_DIR)/StartProfile.cc 
+
 # $(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_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)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/kernel/sys_task/ShowTime.cc	Tue Jan 17 18:02:27 2012 +0900
@@ -0,0 +1,18 @@
+#include "ShowTime.h"
+//#include "stdio.h"
+#include "SchedTask.h"
+
+SchedDefineTask(ShowTime);
+
+static int
+run(SchedTask *smanager, void *rbuf, void *wbuf)
+{
+    /*
+     * ここで show_dma_wait() を呼びたい
+     */
+    // printf("Show Time !\n");
+    smanager->show_dma_wait();
+
+    return 0;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/kernel/sys_task/ShowTime.h	Tue Jan 17 18:02:27 2012 +0900
@@ -0,0 +1,7 @@
+#ifndef INCLUDED_TASK_SHOW_TIME
+#define INCLUDED_TASK_SHOW_TIME
+
+#include "SchedTask.h"
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/kernel/sys_task/StartProfile.cc	Tue Jan 17 18:02:27 2012 +0900
@@ -0,0 +1,14 @@
+#include "StartProfile.h"
+#include "SchedTask.h"
+//#include "stdio.h"
+
+SchedDefineTask(StartProfile);
+
+static int
+run(SchedTask *smanager, void *rbuf, void *wbuf)
+{
+    smanager->start_profile();
+
+    return 0;
+}
+