view TaskManager/kernel/ppe/TaskList.h @ 1531:4443d59a8210 draft

SDL.h in main.cc
author yuhi@cr.ie.u-ryukyu.ac.jp
date Fri, 07 Dec 2012 15:46:27 +0900
parents a7895ab4d0e3
children 806b4658ced6
line wrap: on
line source

#ifndef INCLUDED_TASKLIST
#define INCLUDED_TASKLIST

#include "base.h"
#include "Task.h"

class HTask;

#define TASK_MAX_SIZE 31

class TaskList { // 1024 byte 
public:
    BASE_NEW_DELETE(TaskList);

    long lastTask; // 4 byte
    TaskList *next; // 4 byte
    TaskList *prev; // 4 byte
    TaskList *waiter; // 4 byte
    HTask *self; // 4 byte
    long dummy[3]; // 16 byte
    Task tasks[TASK_MAX_SIZE]; // 32*TASK_MAX_SIZE
    

    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() {}

} ;

typedef TaskList* TaskListPtr;

#endif