Exemple #1
0
  //-----------------------------------------------------------------------
  void DrmaManager::bspPut(int pid, const void * src, void * dst, int offset, int nBytes){

    assert(0 <= pid < baseProcess_->getTotalNumProcs());
    int logicDst = findLastRegistration(dst);
    Registration & reg = getRegistration(logicDst);
    if (offset + nBytes > reg.size()){
      cerr << "[ERROR] DrmaManager::BspPut->Invalid bounds on operation" << endl;
      throw InvalidBoundsOnDrmaOperationException();
    }
    BspPut bspPut;
    bspPut.logicAddr(logicDst)
          .offset(offset)
          .nBytes(nBytes)
          .superstep(baseProcess_->superstep())
          .arch(dstArch);
    bspPut.writeInMem(src);
    if (pid != baseProcess_->getMyPid()){
      stubPool_->bspPut(pid, bspPut);
    }
    else{
     addPendingPut(bspPut);
    }

    /** ---------------- RYC ------------- */
    //    cerr << "[RYC] DrmaManager::bspPut->sendingData OK" << endl;

  }
Exemple #2
0
  //-----------------------------------------------------------------------
  int BspProxyImpl::bspPutWrapper(struct lua_State * state){

    int n = lua_gettop(state);
    assert(n == 1);

    BspPut bspPut;

    bspPut.arch(LuaUtils::getIntFromTable(state, "arch"))
          .logicAddr(LuaUtils::getIntFromTable(state, "logicAddr"))
          .offset(LuaUtils::getIntFromTable(state, "offset"))
          .nBytes(LuaUtils::getIntFromTable(state, "nBytes"))
          .superstep(LuaUtils::getIntFromTable(state, "superstep"));

    lua_pushstring(state, "memArea");
    lua_gettable(state, -2);
    bspPut.writeInMem(lua_tostring(state,-1));
    lua_pop(state, 1);

    BspProxyImpl::singleInstance->drmaManager_->addPendingPut(bspPut);
    return 0;

  }