for(i = 1; i < NUMCORESACTIVE; ++i) {
gccorestatus[i] = 1;
// send mark phase finish confirm request msg to core i
- send_msg_1(i, GCMARKCONFIRM);
+ send_msg_1(i, GCMARKCONFIRM, false);
} // for(i = 1; i < NUMCORESACTIVE; ++i)
} else {
// check if the sum of send objs and receive obj are the same
// restore the gcstatus for all cores
for(i = 0; i < NUMCORESACTIVE; ++i) {
gccorestatus[i] = 1;
- } // for(i = 0; i < NUMCORESACTIVE; ++i)
+ } // for(i = 0; i < NUMCORESACTIVE; ++i)
} else {
// wait for a while and ask for confirm again
int h = 100;
for(i = 1; i < NUMCORESACTIVE; ++i) {
corestatus[i] = 1;
// send status confirm msg to core i
- send_msg_1(i, STATUSCONFIRM);
+ send_msg_1(i, STATUSCONFIRM, false);
} // for(i = 1; i < NUMCORESACTIVE; ++i)
#ifdef DEBUG
#endif
if(host != BAMBOO_NUM_OF_CORE) {
// send the original host core with the mapping info
- send_msg_3(host, GCLOBJMAPPING, ptr, tmpheaptop);
+ send_msg_3(host, GCLOBJMAPPING, ptr, tmpheaptop, false);
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xcdcb);
BAMBOO_DEBUGPRINT_REG(ptr);
#endif
if(host != BAMBOO_NUM_OF_CORE) {
// send the original host core with the mapping info
- send_msg_3(host, GCLOBJMAPPING, ptr, tmpheaptop);
+ send_msg_3(host, GCLOBJMAPPING, ptr, tmpheaptop, false);
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xcdcd);
BAMBOO_DEBUGPRINT_REG(ptr);
unsigned long long ttime = BAMBOO_GET_EXE_TIME();
#endif
// send a msg to host informing that objptr is active
- send_msg_2(host, GCMARKEDOBJ, objptr);
+ send_msg_2(host, GCMARKEDOBJ, objptr, false);
#ifdef GC_PROFILE
marktime += BAMBOO_GET_EXE_TIME() - ttime;
num_markrequest++;
BAMBOO_DEBUGPRINT(0xed09);
#endif
send_msg_4(STARTUPCORE, GCFINISHMARK, BAMBOO_NUM_OF_CORE,
- gcself_numsendobjs, gcself_numreceiveobjs);
+ gcself_numsendobjs, gcself_numreceiveobjs, false);
sendStall = true;
}
} // if(STARTUPCORE == BAMBOO_NUM_OF_CORE) ...
gcdstcore = gctopcore;
gcblock2fill = *numblocks + 1;
} else {
- send_msg_4(coren, GCMOVESTART, gctopcore, *p, (*numblocks) + 1);
+ send_msg_4(coren, GCMOVESTART, gctopcore, *p, (*numblocks) + 1, false);
}
#ifdef DEBUG
BAMBOO_DEBUGPRINT_REG(coren);
BAMBOO_DEBUGPRINT(0xeb04);
#endif
send_msg_4(dstcore, GCMOVESTART, sourcecore,
- startaddr, tomove);
+ startaddr, tomove, false);
}
gcmovepending--;
nosparemem = true;
// ask for more mem
gctomove = false;
send_msg_5(STARTUPCORE, GCFINISHCOMPACT, BAMBOO_NUM_OF_CORE,
- *filledblocks, *heaptopptr, gccurr_heaptop);
+ *filledblocks, *heaptopptr, gccurr_heaptop, false);
} else {
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xe108);
#endif
// finish compacting
send_msg_5(STARTUPCORE, GCFINISHCOMPACT, BAMBOO_NUM_OF_CORE,
- *filledblocks, *heaptopptr, 0);
+ *filledblocks, *heaptopptr, 0, false);
}
} // if(STARTUPCORE == BAMBOO_NUM_OF_CORE)
BAMBOO_DEBUGPRINT_REG(to->base);
#endif
send_msg_5(STARTUPCORE, GCFINISHCOMPACT, BAMBOO_NUM_OF_CORE,
- 0, to->base, 0);
+ 0, to->base, 0, false);
RUNFREE(orig);
RUNFREE(to);
return;
// the first time require the mapping, send msg to the hostcore
// for the mapping info
send_msg_3(hostcore(objptr), GCMAPREQUEST, (int)objptr,
- BAMBOO_NUM_OF_CORE);
+ BAMBOO_NUM_OF_CORE, false);
while(true) {
if(gcismapped) {
break;
if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
gccorestatus[BAMBOO_NUM_OF_CORE] = 0;
} else {
- send_msg_2(STARTUPCORE, GCFINISHFLUSH, BAMBOO_NUM_OF_CORE);
+ send_msg_2(STARTUPCORE, GCFINISHFLUSH, BAMBOO_NUM_OF_CORE, false);
}
#ifdef GC_PROFILE
if(BAMBOO_NUM_OF_CORE == 0) {
#endif
initGC();
//send init finish msg to core coordinator
- send_msg_2(STARTUPCORE, GCFINISHINIT, BAMBOO_NUM_OF_CORE);
+ send_msg_2(STARTUPCORE, GCFINISHINIT, BAMBOO_NUM_OF_CORE, false);
while(true) {
if(MARKPHASE == gcphase) {
break;
#endif
initGC();
//send init finish msg to core coordinator
- send_msg_2(STARTUPCORE, GCFINISHINIT, BAMBOO_NUM_OF_CORE);
+ send_msg_2(STARTUPCORE, GCFINISHINIT, BAMBOO_NUM_OF_CORE, false);
while(true) {
if(MARKPHASE == gcphase) {
break;
// Note: all cores need to init gc including non-gc cores
for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; i++) {
// send GC init messages to all cores
- send_msg_1(i, GCSTARTINIT);
+ send_msg_1(i, GCSTARTINIT, false);
}
bool isfirst = true;
bool allStall = false;
for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; ++i) {
gccorestatus[i] = 1;
// send GC start messages to all cores
- send_msg_1(i, GCSTART);
+ send_msg_1(i, GCSTART, false);
}
gcphase = MARKPHASE;
// Note: only need to ask gc cores, non-gc cores do not host any objs
numconfirm = NUMCORES4GC - 1;
for(i = 1; i < NUMCORES4GC; ++i) {
- send_msg_1(i, GCLOBJREQUEST);
+ send_msg_1(i, GCLOBJREQUEST, false);
}
gcloads[BAMBOO_NUM_OF_CORE] = gccurr_heaptop;
while(true) {
if (tmpcoreptr < tmpheaptop /*tmptopptr*/) {
gcstopblock[i] = numpbc + 1;
if(i != STARTUPCORE) {
- send_msg_2(i, GCSTARTCOMPACT, numpbc+1);
+ send_msg_2(i, GCSTARTCOMPACT, numpbc+1, false);
} else {
gcblock2fill = numpbc+1;
} // if(i != STARTUPCORE)
} else {
gcstopblock[i] = numpbc;
if(i != STARTUPCORE) {
- send_msg_2(i, GCSTARTCOMPACT, numpbc);
+ send_msg_2(i, GCSTARTCOMPACT, numpbc, false);
} else {
gcblock2fill = numpbc;
} // if(i != STARTUPCORE)
for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; ++i) {
// send start flush messages to all cores
gccorestatus[i] = 1;
- send_msg_1(i, GCSTARTFLUSH);
+ send_msg_1(i, GCSTARTFLUSH, false);
}
#ifdef GC_PROFILE
gc_profileItem();
gccorestatus[BAMBOO_NUM_OF_CORE] = 1;
for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; ++i) {
// send gc finish messages to all cores
- send_msg_1(i, GCFINISH);
+ send_msg_1(i, GCFINISH, false);
gccorestatus[i] = 1;
}
#ifdef RAWPATH // TODO GC_DEBUG
outmsglast = 0;
outmsgleft = 0;
isMsgHanging = false;
- isMsgSending = false;
+ //isMsgSending = false;
smemflag = true;
bamboo_cur_msp = NULL;
while(!lockflag) {
BAMBOO_WAITING_FOR_LOCK(0);
// check for outgoing sends
- if (isMsgHanging) {
+ /*if (isMsgHanging) {
extern inline void send_hanging_msg(bool);
send_hanging_msg(true);
- }
+ } */
} // while(!lockflag)
grount = lockresult;
#ifdef DEBUG
for(i = 1; i < NUMCORESACTIVE; ++i) {
corestatus[i] = 1;
// send status confirm msg to core i
- send_msg_1(i, STATUSCONFIRM);
- } // for(i = 1; i < NUMCORESACTIVE; ++i)
+ send_msg_1(i, STATUSCONFIRM, false);
+ } // for(i = 1; i < NUMCORESACTIVE; ++i)
return;
} else {
// all the core status info are the latest
#endif
for(i = 1; i < NUMCORESACTIVE; ++i) {
// send profile request msg to core i
- send_msg_2(i, PROFILEOUTPUT, totalexetime);
+ send_msg_2(i, PROFILEOUTPUT, totalexetime, false);
} // for(i = 1; i < NUMCORESACTIVE; ++i)
// pour profiling data on startup core
outputProfileData();
#endif
// send stall msg
send_msg_4(STARTUPCORE, TRANSTALL, BAMBOO_NUM_OF_CORE,
- self_numsendobjs, self_numreceiveobjs);
+ self_numsendobjs, self_numreceiveobjs, false);
sendStall = true;
isfirst = true;
busystatus = false;
default:
{
BAMBOO_DEBUGPRINT_REG(type);
+ BAMBOO_DEBUGPRINT_REG(size);
BAMBOO_DEBUGPRINT_REG(msgdataindex);
+ BAMBOO_DEBUGPRINT_REG(msgdatalast);
+ BAMBOO_DEBUGPRINT_REG(msgdatafull);
int i = 6;
while(i-- > 0) {
BAMBOO_DEBUGPRINT(msgdata[msgdataindex+i]);
INLINE void processmsg_transobj_I() {
MSG_INDEXINC_I();
- struct transObjInfo * transObj = RUNMALLOC_I(sizeof(struct transObjInfo));
+ struct transObjInfo * transObj=RUNMALLOC_I(sizeof(struct transObjInfo));
int k = 0;
#ifdef DEBUG
#ifndef CLOSE_PRINT
//BAMBOO_DEBUGPRINT_REG(transObj->queues[2*k]);
#endif
#endif
- transObj->queues[2*k+1] = msgdata[msgdataindex]; //[3+2*k+1];
+ transObj->queues[2*k+1] = msgdata[msgdataindex]; //[3+2*k+1];
MSG_INDEXINC_I();
#ifdef DEBUG
#ifndef CLOSE_PRINT
int data4 = msgdata[msgdataindex]; // request core
MSG_INDEXINC_I();
// -1: redirected, 0: approved, 1: denied
- int deny = processlockrequest(locktype, data3, data2, data4, data4, true);
+ int deny=processlockrequest(locktype, data3, data2, data4, data4, true);
if(deny == -1) {
// this lock request is redirected
return;
// send response msg
// for 32 bit machine, the size is always 4 words, cache the msg first
int tmp = deny==1 ? LOCKDENY : LOCKGROUNT;
- //if(isMsgSending) {
+ if(BAMBOO_CHECK_SEND_MODE()) {
cache_msg_4(data4, tmp, locktype, data2, data3);
- /*} else {
- send_msg_4(data4, tmp, locktype, data2, data3);
- }*/
+ } else {
+ send_msg_4(data4, tmp, locktype, data2, data3, true);
+ }
}
}
} else {
// send response msg
// for 32 bit machine, the size is always 4 words, cache the msg first
- //if(isMsgSending) {
+ if(BAMBOO_CHECK_SEND_MODE()) {
cache_msg_4(data4, deny==1 ? REDIRECTDENY : REDIRECTGROUNT,
data1, data2, data3);
- /*} else {
- send_msg_4(data4, deny==1?REDIRECTDENY:REDIRECTGROUNT,
- data1, data2, data3);
- }*/
+ } else {
+ send_msg_4(data4, deny==1?REDIRECTDENY:REDIRECTGROUNT,
+ data1, data2, data3, true);
+ }
}
}
MSG_INDEXINC_I();
outputProfileData();
// cache the msg first
- //if(isMsgSending) {
+ if(BAMBOO_CHECK_SEND_MODE()) {
cache_msg_2(STARTUPCORE, PROFILEFINISH, BAMBOO_NUM_OF_CORE);
- /*} else {
- send_msg_2(STARTUPCORE, PROFILEFINISH, BAMBOO_NUM_OF_CORE);
- }*/
+ } else {
+ send_msg_2(STARTUPCORE, PROFILEFINISH, BAMBOO_NUM_OF_CORE, true);
+ }
}
INLINE void processmsg_profilefinish_I() {
#endif
#endif
// cache the msg first
- //if(isMsgSending) {
+ if(BAMBOO_CHECK_SEND_MODE()) {
cache_msg_5(STARTUPCORE, STATUSREPORT,
busystatus ? 1 : 0, BAMBOO_NUM_OF_CORE,
self_numsendobjs, self_numreceiveobjs);
- /*} else {
- send_msg_5(STARTUPCORE, STATUSREPORT, busystatus?1:0,
- BAMBOO_NUM_OF_CORE, self_numsendobjs,
- self_numreceiveobjs);
- }*/
+ } else {
+ send_msg_5(STARTUPCORE, STATUSREPORT, busystatus?1:0,
+ BAMBOO_NUM_OF_CORE, self_numsendobjs,
+ self_numreceiveobjs, true);
+ }
}
}
if(INITPHASE == gcphase) {
// if still in the initphase of gc, send a startinit msg again,
// cache the msg first
- //if(isMsgSending) {
+ if(BAMBOO_CHECK_SEND_MODE()) {
cache_msg_1(data2, GCSTARTINIT);
- /*} else {
- send_msg_1(data2, GCSTARTINIT);
- }*/
+ } else {
+ send_msg_1(data2, GCSTARTINIT, true);
+ }
}
} else {
#endif
mem = smemalloc_I(data2, data1, &allocsize);
if(mem != NULL) {
// send the start_va to request core, cache the msg first
- //if(isMsgSending) {
+ if(BAMBOO_CHECK_SEND_MODE()) {
cache_msg_3(data2, MEMRESPONSE, mem, allocsize);
- /*} else {
- send_msg_3(data2, MEMRESPONSE, mem, allocsize);
- }*/
+ } else {
+ send_msg_3(data2, MEMRESPONSE, mem, allocsize, true);
+ }
} // if mem == NULL, the gcflag of the startup core has been set
// and the gc should be started later, then a GCSTARTINIT msg
// will be sent to the requesting core to notice it to start gc
int dstcore = 0;
if(gcfindSpareMem_I(&startaddr, &tomove, &dstcore, data4, cnum)) {
// cache the msg first
- //if(isMsgSending) {
+ if(BAMBOO_CHECK_SEND_MODE()) {
cache_msg_4(cnum, GCMOVESTART, dstcore, startaddr, tomove);
- /*} else {
- send_msg_4(cnum, GCMOVESTART, dstcore, startaddr, tomove);
- }*/
+ } else {
+ send_msg_4(cnum, GCMOVESTART, dstcore, startaddr, tomove, true);
+ }
}
} else {
gccorestatus[cnum] = 0;
BAMBOO_EXIT(0xb005);
} else {
// send response msg, cahce the msg first
- //if(isMsgSending) {
+ if(BAMBOO_CHECK_SEND_MODE()) {
cache_msg_5(STARTUPCORE, GCMARKREPORT, BAMBOO_NUM_OF_CORE,
gcbusystatus, gcself_numsendobjs,
gcself_numreceiveobjs);
- /*} else {
- send_msg_5(STARTUPCORE, GCMARKREPORT, BAMBOO_NUM_OF_CORE,
- gcbusystatus, gcself_numsendobjs,
- gcself_numreceiveobjs);
- }*/
+ } else {
+ send_msg_5(STARTUPCORE, GCMARKREPORT, BAMBOO_NUM_OF_CORE,
+ gcbusystatus, gcself_numsendobjs,
+ gcself_numreceiveobjs, true);
+ }
}
}
}*/
} else {
// send back the mapping info, cache the msg first
- //if(isMsgSending) {
+ if(BAMBOO_CHECK_SEND_MODE()) {
cache_msg_3(data2, GCMAPINFO, data1, (int)dstptr);
- /*} else {
- send_msg_3(data2, GCMAPINFO, data1, (int)dstptr);
- }*/
+ } else {
+ send_msg_3(data2, GCMAPINFO, data1, (int)dstptr, true);
+ }
}
#ifdef GC_PROFILE
flushstalltime_i += BAMBOO_GET_EXE_TIME()-ttimei;
#endif
BAMBOO_EXIT(0xb008);
} else {
- gcmappedobj = msgdata[msgdataindex]; // [2]
+ gcmappedobj = msgdata[msgdataindex]; // [2]
MSG_INDEXINC_I();
//mgchashReplace_I(msgdata[1], msgdata[2]);
//mgchashInsert_I(gcobj2map, gcmappedobj);
if((size == 0) || (checkMsgLength_I(size) == -1)) {
// not a whole msg
// have new coming msg
- if(BAMBOO_MSG_AVAIL() != 0) {
+ if((BAMBOO_MSG_AVAIL() != 0) && !msgdatafull) {
goto msg;
} else {
return -1;
default:
break;
} // switch(type)
- //memset(msgdata, '\0', sizeof(int) * msgdataindex);
- //msgdataindex = 0;
+ //memset(msgdata, '\0', sizeof(int) * msgdataindex);
+ //msgdataindex = 0;
msglength = BAMBOO_MSG_BUF_LENGTH;
// TODO
//printf("++ msg: %x \n", type);
+
if(msgdataindex != msgdatalast) {
// still have available msg
goto processmsg;
// have new coming msg
if(BAMBOO_MSG_AVAIL() != 0) {
goto msg;
- }
+ } // TODO
#ifdef PROFILE
/*if(isInterrupt) {
// send lock release with redirect info msg
// for 32 bit machine, the size is always 4 words
send_msg_4(targetcore, REDIRECTRELEASE, 1, (int)lock,
- (int)redirectlock);
+ (int)redirectlock, false);
}
}
#endif
while(!lockflag) {
BAMBOO_WAITING_FOR_LOCK(0);
// check for outgoing sends
- if (isMsgHanging) {
+ /*if (isMsgHanging) {
extern inline void send_hanging_msg(bool);
send_hanging_msg(true);
- }
+ } */
}
#ifndef INTERRUPT
if(reside) {
while(BAMBOO_WAITING_FOR_LOCK(0) != -1) {
// check for outgoing sends
- if (isMsgHanging) {
+ /*if (isMsgHanging) {
extern inline void send_hanging_msg(bool);
send_hanging_msg(true);
- }
+ } */
}
}
#endif