changeset 1432:b77f32eb137c draft

make available
author Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
date Tue, 03 Apr 2012 21:45:41 +0900
parents 9b0908cb7553
children 11dcd8165424
files TaskManager/kernel/ppe/HTask.cc TaskManager/kernel/ppe/TaskManagerImpl.cc
diffstat 2 files changed, 28 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/HTask.cc	Fri Mar 30 05:51:29 2012 +0900
+++ b/TaskManager/kernel/ppe/HTask.cc	Tue Apr 03 21:45:41 2012 +0900
@@ -77,25 +77,40 @@
   @param num_inData   一つのTaskが読み込む Data の数、set_inData の数
   @param num_outData  一つのTaskが書き出す Data の数、set_outData の数
   @return  Task Array へのポインタ
- */
+ */ 
+Task *
+HTask::create_task_array(int id, int num_task, int num_param, int num_inData, int num_outData)
+{
+    r_size = Task::calc_size(num_param, num_inData, num_outData)*num_task;
+    rbuf = (memaddr) mimpl->allocate(r_size);
+    //printf("r_size %d\n",r_size);
+	//bzeroするのはcostが高いので外したい
+    bzero(rbuf,r_size);
+    Task *task = (Task*)rbuf;
+    task->init(id, num_param,num_inData,num_outData);
+// task->print();
+    return task;  // first task
+}
+/*
 Task *
 HTask::create_task_array(int id, int num_task, int num_param, int num_inData, int num_outData)
 {
     r_size = 0;
     int sz = Task::calc_size(num_param, num_inData, num_outData);
     TaskListPtr tl =  mimpl->createTaskList();
-    if (sz>tl-> sizeof(tl->tasks)) {
+    if ( (unsigned int) sz > sizeof(tl->tasks)) {
 	mimpl->get_scheduler()->printf("too large task array.\n");
     }
     rbuf = (memaddr)tl;
     //printf("r_size %d\n",r_size);
 	//bzeroするのはcostが高いので外したい
-    bzero(tl->tasks,sizeof(tasks));
-    Task *task = tl->tasks;
+    bzero(tl->tasks,sizeof(tl->tasks));
+    Task *task = (Task*)tl->tasks;
     task->init(id, num_param,num_inData,num_outData);
 // task->print();
     return task;  // first task
 }
+*/
 
 /*!
   @brief Task Array の次のTask
@@ -109,7 +124,7 @@
     Task *first = (Task*)rbuf;
     if (t==0) {
 // first->print();
-        first->init(id, param_count, inData_count, outData_count);
+//        first->init(id, 0, 0, 0);
 	return first;
     }
 
@@ -132,7 +147,7 @@
     Task *first = (Task*)rbuf;
     if (t==0) {
 // first->print();
-        first->init(id, param_count, inData_count, outData_count);
+//        first->init(id, param_count, inData_count, outData_count);
 	return first;
     }
 
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc	Fri Mar 30 05:51:29 2012 +0900
+++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc	Tue Apr 03 21:45:41 2012 +0900
@@ -132,6 +132,12 @@
     return ta;
 }
 
+TaskListPtr
+TaskManagerImpl::createTaskList()
+{
+    return NULL;
+}
+
 /* call get_task_name from ppu only */
 const char *
 TaskManagerImpl::get_task_name(int cmd) {
@@ -314,6 +320,7 @@
 	
 
     if (me->command == TaskArray) {
+        // ここはtasklistのfreeになる。
         free(me->rbuf);
     }