view TaskManager/kernel/memory/MemIterator.h @ 1546:61164c687b29 draft

fix GpuScheduler flip
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Tue, 05 Feb 2013 13:15:46 +0900
parents d7486d6a5e37
children
line wrap: on
line source

#ifndef INCLUDED_MEMORY_ITERATOR
#define INCLUDED_MEMORY_ITERATOR

#include "MemList.h"
#include "MemorySegment.h"
#include "AddrList.h"
#include "SchedTask.h"

enum {

  READ_WRITE,
  READ,
  WRITE,

};

class MemIterator {
public:

    // 走査する アドレスリスト
    AddrListPtr addr_list;

    // 扱う MemorySegment のリスト
    MemList *mem_list;

    // ms の stage
    MemorySegmentPtr read_ms;
    MemorySegmentPtr exec_ms;
    MemorySegmentPtr write_ms;
    MemorySegmentPtr free_ms;

    SchedTask *smanager;

    MemIterator(AddrListPtr add_list, MemList *mem_list, int cmd, SchedTask *smanager);
    ~MemIterator();


    MemorySegmentPtr (MemIterator::*get_ms)(void);

    int hasNext(void);

    MemorySegmentPtr get_read_write_ms(void);
    MemorySegmentPtr get_read_ms(void);
    MemorySegmentPtr get_write_ms(void);

    void collect_ms(void);
    void overwrite_list(AddrListPtr list);

};

typedef MemIterator *MemIteratorPtr;

#endif