Mercurial > hg > Game > Cerium
view TaskManager/kernel/ppe/TaskManagerImpl.h @ 897:6bd218d3f643 draft
add return address in SimpleTask for debugging.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 16 Jul 2010 19:00:22 +0900 |
parents | b662e9dd26b0 |
children | 1b9418af3127 |
line wrap: on
line source
#ifndef INCLUDED_TASK_MANAGER_IMPL #define INCLUDED_TASK_MANAGER_IMPL #include "MailManager.h" #include "ListData.h" #include "TaskListInfo.h" #include "TaskQueueInfo.h" #include "HTaskInfo.h" #include "Scheduler.h" class MemList; class TaskManagerImpl { public: /* variables */ int machineNum; HTaskInfo *activeTaskQueue; HTaskInfo *waitTaskQueue; TaskQueueInfo *taskQueueImpl; HTaskInfo *htaskImpl; SchedTask *schedTaskManager; Scheduler *scheduler; TaskManagerImpl *others; /* constructor */ TaskManagerImpl(int num = 1) ; virtual ~TaskManagerImpl() { } /* functions */ // system virtual void init() = 0; virtual void run() = 0; virtual void start_profile() = 0; virtual void show_profile() = 0; virtual void append_activeTask(HTaskPtr); virtual void append_waitTask(HTaskPtr); virtual void polling() = 0; void check_task_finish(HTaskPtr task, HTaskInfo *wait_queue); void check_task_list_finish(SchedTask *s, TaskListPtr list, HTaskInfo *wait_queue); void systask_init(); // user virtual HTaskPtr create_task(int cmd,void *from); virtual HTaskPtr create_task(int cmd, memaddr rbuf, long r_size, memaddr wbuf, long w_size,void *from); virtual HTaskPtr create_task_array(int id, int num_task, int num_param, int num_inData, int num_outData,void *from); virtual void set_task_depend(HTaskPtr master, HTaskPtr slave); virtual void spawn_task(HTaskPtr); virtual void set_task_cpu(HTaskPtr, CPU_TYPE); void set_taskList(HTaskPtr htask, TaskListInfoPtr taskList) ; void* allocate(int size, int alignment) { void *buff; if (size==0) return 0; #if defined(__SPU__) || ! defined(HAS_POSIX_MEMALIGN) buff = malloc(size); #else posix_memalign(&buff, alignment, size); #endif if (buff==0) get_scheduler()->printf("Can't allocate memory\n"); return buff; } void* allocate(int size) { void *buff; if (size==0) return 0; #if defined(__SPU__) || ! defined(HAS_POSIX_MEMALIGN) buff = malloc(size); #else posix_memalign(&buff, DEFAULT_ALIGNMENT, size); #endif if (buff==0) get_scheduler()->printf("Can't allocate memory\n"); return buff; } Scheduler* get_scheduler() { return scheduler; } void set_scheduler(Scheduler *s) { scheduler = s; } } __attribute__ ((aligned (DEFAULT_ALIGNMENT))); #endif