diff TaskManager/kernel/ppe/TaskList.h @ 1466:cb57420a8219 draft

TaskList on going...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 15 Jul 2012 13:36:55 +0900
parents 3f2230d79eba
children a7895ab4d0e3
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/TaskList.h	Sun Jul 15 09:56:54 2012 +0900
+++ b/TaskManager/kernel/ppe/TaskList.h	Sun Jul 15 13:36:55 2012 +0900
@@ -12,7 +12,7 @@
 public:
     BASE_NEW_DELETE(TaskList);
 
-    Task *lastTask; // 4 byte
+    long lastTask; // 4 byte
     TaskList *next; // 4 byte
     TaskList *prev; // 4 byte
     TaskList *waiter; // 4 byte
@@ -20,8 +20,9 @@
     long dummy[3]; // 16 byte
     Task tasks[TASK_MAX_SIZE]; // 32*TASK_MAX_SIZE
 
-    TaskPtr last() { return lastTask; }
-    void init() { lastTask = &tasks[TASK_MAX_SIZE]; waiter=this; }
+    TaskPtr last() { return (TaskPtr)(((memaddr)tasks)+lastTask); }
+    void set_last(Task *t) { lastTask = ((memaddr)t) - ((memaddr)tasks); }
+    void init() { lastTask = ((memaddr)&tasks[TASK_MAX_SIZE])-(memaddr)(tasks); waiter=this; }
     void initOnce() { }
     void freeOnce() {}