view TaskManager/Cell/CellTaskManagerImpl.h @ 540:c5a411c19e7e

merge
author tkaito@henri.cr.ie.u-ryukyu.ac.jp
date Wed, 21 Oct 2009 20:02:23 +0900
parents 4a2c9ff53605
children 1d4a8a86f26b
line wrap: on
line source

#ifndef INCLUDED_CELL_TASK_MANAGER_IMPL
#define INCLUDED_CELL_TASK_MANAGER_IMPL

#include "TaskManagerImpl.h"
#include "FifoTaskManagerImpl.h"
#include "SpeThreads.h"

class CellTaskManagerImpl : public TaskManagerImpl {
public:
    /* constructor */
    CellTaskManagerImpl(int num = 1) : TaskManagerImpl(num) {}
    ~CellTaskManagerImpl();

    /* variables */
    TaskListPtr *speTaskList;
    TaskListPtr *speTaskList_bg;

    SpeThreads *speThreads;
    int *flag_sendTaskList;
    FifoTaskManagerImpl *ppeManager;

    /* functions */
    // system
    void init();
    void run();
    TaskListPtr mail_check(MailQueuePtr mail_list);
    void set_runTaskList();
    void append_activeTask(HTaskPtr);

    // user
    int add_data(ListDataPtr, uint32, int);
    void* allocate(int size);
    Scheduler* get_scheduler();

private:
    void send_taskList(int id);
};

#ifdef Cerium_malloc
#undef Cerium_malloc
#endif

#define Cerium_malloc(dest, align, size) \
    posix_memalign((void**)(dest), (align), (size))

#endif