view TaskManager/kernel/ppe/SemMailManager.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 898fdcf53c31
children
line wrap: on
line source

#ifndef INCLUDED_SEM_MAIL_MANAGER
#define INCLUDED_SEM_MAIL_MANAGER

#include <pthread.h>
#include "MailManager.h"
#include "types.h"
#include "Sem.h"

class SemMailManager : public MailManager {
public:
    /* constructor */
    SemMailManager(unsigned int qsize = 32) ;

    ~SemMailManager();

    /* functions */
    void send(memaddr data);
    memaddr recv();
    int count();

private:
    /* variables */
    memaddr *queue;
    SemPtr queue_remain;
    SemPtr queue_count;
    unsigned int size;
    unsigned int read;
    unsigned int write;
    unsigned int mask;

    void calc_mask(unsigned int qsize);
    void extend();
}  ;

typedef SemMailManager *SemMailManagerPtr;

#endif