view TaskManager/ManyCore/MainScheduler.cc @ 2022:fac44ad2867d draft

make a sound
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Wed, 16 Jul 2014 02:50:32 +0900
parents e0d465efc57e
children
line wrap: on
line source

#include <stdlib.h>
#include <string.h>
#include "MainScheduler.h"
#include "TaskManagerImpl.h"
#include "FifoDmaManager.h"
#include "ReferencedDmaManager.h"
#include "PreRefDmaManager.h"
#include "ManyCoreDmaManager.h"
#include "error.h"

void
MainScheduler::init_impl(int useRefDma)
{
    if (useRefDma & 0x10) {
        fifoDmaManager = new PreRefDmaManager();
    } else if (useRefDma & 0x01) {
        fifoDmaManager = new ManyCoreDmaManager();
    } else {
        fifoDmaManager = new ReferencedDmaManager();
    }
    connector = fifoDmaManager;
    connector->init();
}

/**
 * メインメモリ領域を allocate する。
 * Fifo バージョンだから、まあ普通に malloc でおk
 */
void
MainScheduler::mainMem_alloc(int id, int size)
{
    mainMemList[id] = (memaddr)manager->allocate(size);
}

/* end */