cacheAdapt_mutator();
cacheAdapt_gc(false);
//send init finish msg to core coordinator
- send_msg_2(STARTUPCORE, GCFINISHPREF, BAMBOO_NUM_OF_CORE, false);
+ send_msg_2(STARTUPCORE, GCFINISHPREF, BAMBOO_NUM_OF_CORE);
GC_PRINTF("Finish prefinish phase\n");
CACHEADAPT_SAMPING_RESET();
if(BAMBOO_NUM_OF_CORE < NUMCORESACTIVE) {
gcprocessing = true;
// inform the master that this core is at a gc safe point and is ready to
// do gc
- send_msg_4(STARTUPCORE, GCFINISHPRE, BAMBOO_NUM_OF_CORE, self_numsendobjs,
- self_numreceiveobjs, false);
+ send_msg_4(STARTUPCORE,GCFINISHPRE,BAMBOO_NUM_OF_CORE,self_numsendobjs,self_numreceiveobjs);
// core collector routine
//wait for init phase
initGC();
CACHEADAPT_GC(true);
//send init finish msg to core coordinator
- send_msg_2(STARTUPCORE, GCFINISHINIT, BAMBOO_NUM_OF_CORE, false);
+ send_msg_2(STARTUPCORE,GCFINISHINIT,BAMBOO_NUM_OF_CORE);
//wait for mark phase
WAITFORGCPHASE(MARKPHASE);
gcprocessing = true;
// inform the master that this core is at a gc safe point and is ready to
// do gc
- send_msg_4(STARTUPCORE, GCFINISHPRE, BAMBOO_NUM_OF_CORE, self_numsendobjs,
- self_numreceiveobjs, false);
+ send_msg_4(STARTUPCORE,GCFINISHPRE,BAMBOO_NUM_OF_CORE,self_numsendobjs,self_numreceiveobjs);
WAITFORGCPHASE(INITPHASE);
initGC();
CACHEADAPT_GC(true);
//send init finish msg to core coordinator
- send_msg_2(STARTUPCORE, GCFINISHINIT, BAMBOO_NUM_OF_CORE, false);
+ send_msg_2(STARTUPCORE,GCFINISHINIT,BAMBOO_NUM_OF_CORE);
WAITFORGCPHASE(MARKPHASE);
// Note: only need to ask gc cores, non-gc cores do not host any objs
numconfirm = NUMCORES4GC - 1;
for(int i = 1; i < NUMCORES4GC; i++) {
- send_msg_1(i, GCLOBJREQUEST, false);
+ send_msg_1(i,GCLOBJREQUEST);
}
gcloads[BAMBOO_NUM_OF_CORE] = gccurr_heaptop;
//spin until we have all responses
if (tmpcoreptr < tmpheaptop) {
gcstopblock[i] = numpbc + 1;
if(i != STARTUPCORE) {
- send_msg_2(i, GCSTARTCOMPACT, numpbc+1, false);
+ send_msg_2(i, GCSTARTCOMPACT, numpbc+1);
} else {
gcblock2fill = numpbc+1;
}
} else {
gcstopblock[i] = numpbc;
if(i != STARTUPCORE) {
- send_msg_2(i, GCSTARTCOMPACT, numpbc, false);
+ send_msg_2(i, GCSTARTCOMPACT, numpbc);
} else {
gcblock2fill = numpbc;
}
for(int i = 0; i < NUMCORESACTIVE; ++i) { \
gccorestatus[i] = 1; \
if(BAMBOO_NUM_OF_CORE != i) { \
- send_msg_1(i, (m), false); \
+ send_msg_1(i, (m)); \
} \
} \
}
gcblock2fill = *numblocks + 1;
} else {
if(BAMBOO_CHECK_SEND_MODE()) {
- cache_msg_4(coren,GCMOVESTART,gctopcore,*p,(*numblocks)+1);
+ cache_msg_4_I(coren,GCMOVESTART,gctopcore,*p,(*numblocks)+1);
} else {
- send_msg_4(coren, GCMOVESTART, gctopcore, *p, (*numblocks) + 1, true);
+ send_msg_4_I(coren,GCMOVESTART,gctopcore,*p,(*numblocks)+1);
}
}
if(memneed < *remain) {
gcmovestartaddr = startaddr;
gcblock2fill = tomove;
} else {
- send_msg_4(dstcore, GCMOVESTART, sourcecore,startaddr, tomove, false);
+ send_msg_4(dstcore,GCMOVESTART,sourcecore,startaddr,tomove);
}
gcmovepending--;
nosparemem = true;
if((unsigned int)(orig->ptr) < (unsigned int)gcmarkedptrbound) {
// ask for more mem
gctomove = false;
- send_msg_5(STARTUPCORE, GCFINISHCOMPACT, BAMBOO_NUM_OF_CORE,
- *filledblocks, *heaptopptr, gccurr_heaptop, false);
+ send_msg_5(STARTUPCORE,GCFINISHCOMPACT,BAMBOO_NUM_OF_CORE,*filledblocks,*heaptopptr,gccurr_heaptop);
} else {
// finish compacting
- send_msg_5(STARTUPCORE, GCFINISHCOMPACT, BAMBOO_NUM_OF_CORE,
- *filledblocks, *heaptopptr, 0, false);
+ send_msg_5(STARTUPCORE,GCFINISHCOMPACT,BAMBOO_NUM_OF_CORE,*filledblocks,*heaptopptr, 0);
}
}
if(!initOrig_Dst(orig, to)) {
// no available data to compact
// send compact finish msg to STARTUP core
- send_msg_5(STARTUPCORE, GCFINISHCOMPACT, BAMBOO_NUM_OF_CORE,
- 0, to->base, 0, false);
+ send_msg_5(STARTUPCORE,GCFINISHCOMPACT,BAMBOO_NUM_OF_CORE,0,to->base,0);
RUNFREE(orig);
RUNFREE(to);
} else {
if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
gccorestatus[BAMBOO_NUM_OF_CORE] = 0;
} else {
- send_msg_2(STARTUPCORE, GCFINISHFLUSH, BAMBOO_NUM_OF_CORE, false);
+ send_msg_2(STARTUPCORE,GCFINISHFLUSH,BAMBOO_NUM_OF_CORE);
}
}
// check if this obj has been forwarded
if(!MGCHashcontains(gcforwardobjtbl, (int)objptr)) {
// send a msg to host informing that objptr is active
- send_msg_2(host, GCMARKEDOBJ, objptr, false);
+ send_msg_2(host,GCMARKEDOBJ,objptr);
GCPROFILE_RECORD_FORWARD_OBJ();
gcself_numsendobjs++;
MGCHashadd(gcforwardobjtbl, (int)objptr);
gcloads[BAMBOO_NUM_OF_CORE] = gccurr_heaptop;
} else {
if(!sendStall) {
- send_msg_4(STARTUPCORE, GCFINISHMARK, BAMBOO_NUM_OF_CORE,gcself_numsendobjs, gcself_numreceiveobjs, false);
+ send_msg_4(STARTUPCORE,GCFINISHMARK,BAMBOO_NUM_OF_CORE,gcself_numsendobjs,gcself_numreceiveobjs);
sendStall = true;
}
}
#define GCPROFILE_INFO_2_MASTER() \
{ \
if(STARTUPCORE != BAMBOO_NUM_OF_CORE) { \
- send_msg_4(STARTUPCORE,GCPROFILES,gc_num_obj,gc_num_liveobj,gc_num_forwardobj, false); \
+ send_msg_4(STARTUPCORE,GCPROFILES,gc_num_obj,gc_num_liveobj,gc_num_forwardobj); \
}\
gc_num_obj = 0; \
}
}
default:
+ {
+ tprintf("%x \n", type);
BAMBOO_EXIT();
break;
}
+ }
return BAMBOO_OUT_BUF_LENGTH;
}
} else {
// send a update pregc information msg to the master core
if(BAMBOO_CHECK_SEND_MODE()) {
- cache_msg_4(STARTUPCORE,GCFINISHPRE,BAMBOO_NUM_OF_CORE,self_numsendobjs,self_numreceiveobjs);
+ cache_msg_4_I(STARTUPCORE,GCFINISHPRE,BAMBOO_NUM_OF_CORE,self_numsendobjs,self_numreceiveobjs);
} else {
- send_msg_4(STARTUPCORE,GCFINISHPRE,BAMBOO_NUM_OF_CORE,self_numsendobjs, self_numreceiveobjs,true);
+ send_msg_4_I(STARTUPCORE,GCFINISHPRE,BAMBOO_NUM_OF_CORE,self_numsendobjs, self_numreceiveobjs);
}
}
}
// for 32 bit machine, the size is always 4 words, cache the msg first
int tmp = deny==1 ? LOCKDENY : LOCKGROUNT;
if(BAMBOO_CHECK_SEND_MODE()) {
- cache_msg_4(data4, tmp, locktype, data2, data3);
+ cache_msg_4_I(data4,tmp,locktype,data2,data3);
} else {
- send_msg_4(data4, tmp, locktype, data2, data3, true);
+ send_msg_4_I(data4,tmp,locktype,data2,data3);
}
}
}
// send response msg
// for 32 bit machine, the size is always 4 words, cache the msg first
if(BAMBOO_CHECK_SEND_MODE()) {
- cache_msg_4(data4,deny==1?REDIRECTDENY:REDIRECTGROUNT,data1,data2,data3);
+ cache_msg_4_I(data4,deny==1?REDIRECTDENY:REDIRECTGROUNT,data1,data2,data3);
} else {
- send_msg_4(data4,deny==1?REDIRECTDENY:REDIRECTGROUNT,data1,data2,data3,true);
+ send_msg_4_I(data4,deny==1?REDIRECTDENY:REDIRECTGROUNT,data1,data2,data3);
}
}
}
#endif
// cache the msg first
if(BAMBOO_CHECK_SEND_MODE()) {
- cache_msg_2(STARTUPCORE, PROFILEFINISH, BAMBOO_NUM_OF_CORE);
+ cache_msg_2_I(STARTUPCORE,PROFILEFINISH,BAMBOO_NUM_OF_CORE);
} else {
- send_msg_2(STARTUPCORE, PROFILEFINISH, BAMBOO_NUM_OF_CORE, true);
+ send_msg_2_I(STARTUPCORE,PROFILEFINISH,BAMBOO_NUM_OF_CORE);
}
}
// send response msg
// cache the msg first
if(BAMBOO_CHECK_SEND_MODE()) {
- cache_msg_5(STARTUPCORE,STATUSREPORT,busystatus?1:0,BAMBOO_NUM_OF_CORE,self_numsendobjs,self_numreceiveobjs);
+ cache_msg_5_I(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);
+ send_msg_5_I(STARTUPCORE,STATUSREPORT,busystatus?1:0,BAMBOO_NUM_OF_CORE,self_numsendobjs,self_numreceiveobjs);
}
}
if(mem != NULL) {
// send the start_va to request core, cache the msg first
if(BAMBOO_CHECK_SEND_MODE()) {
- cache_msg_3(data2, MEMRESPONSE, mem, allocsize);
+ cache_msg_3_I(data2,MEMRESPONSE,mem,allocsize);
} else {
- send_msg_3(data2, MEMRESPONSE, mem, allocsize, true);
+ send_msg_3_I(data2,MEMRESPONSE,mem,allocsize);
}
} //else if mem == NULL, the gcflag of the startup core has been set
// and all the other cores have been informed to start gc
if(gcfindSpareMem_I(&startaddr, &tomove, &dstcore, data4, cnum)) {
// cache the msg first
if(BAMBOO_CHECK_SEND_MODE()) {
- cache_msg_4(cnum, GCMOVESTART, dstcore, startaddr, tomove);
+ cache_msg_4_I(cnum,GCMOVESTART,dstcore,startaddr,tomove);
} else {
- send_msg_4(cnum, GCMOVESTART, dstcore, startaddr, tomove, true);
+ send_msg_4_I(cnum,GCMOVESTART,dstcore,startaddr,tomove);
}
}
} else {
gcbusystatus = gc_moreItems2_I();
// send response msg, cahce the msg first
if(BAMBOO_CHECK_SEND_MODE()) {
- cache_msg_5(STARTUPCORE,GCMARKREPORT,BAMBOO_NUM_OF_CORE,gcbusystatus,gcself_numsendobjs,gcself_numreceiveobjs);
+ cache_msg_5_I(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);
+ send_msg_5_I(STARTUPCORE,GCMARKREPORT,BAMBOO_NUM_OF_CORE,gcbusystatus,gcself_numsendobjs,gcself_numreceiveobjs);
}
}
// 3--received a lock Msg
// RAW version: -1 -- received nothing
// otherwise -- received msg type
-int receiveObject(int send_port_pending) {
+int receiveObject_I() {
PROFILE_INTERRUPT_START();
msg:
// get the incoming msgs
- if(receiveMsg(send_port_pending) == -1) {
- return -1;
- }
+ receiveMsg_I();
if(BAMBOO_CHECK_SEND_MODE()) {
// during send, don't process the msg now
return -3;
} MSGTYPE;
// msg related functions
-void send_hanging_msg(bool isInterrupt);
-void send_msg_1(int targetcore,unsigned long n0,bool isInterrupt);
-void send_msg_2(int targetcore,unsigned long n0,unsigned long n1,bool isInterrupt);
-void send_msg_3(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,bool isInterrupt);
-void send_msg_4(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3,bool isInterrupt);
-void send_msg_5(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3,unsigned long n4,bool isInterrupt);
-void send_msg_6(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3,unsigned long n4,unsigned long n5,bool isInterrupt);
-void cache_msg_1(int targetcore,unsigned long n0);
-void cache_msg_2(int targetcore,unsigned long n0,unsigned long n1);
-void cache_msg_3(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2);
-void cache_msg_4(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3);
-void cache_msg_5(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3,unsigned long n4);
-void cache_msg_6(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3,unsigned long n4,unsigned long n5);
-int receiveMsg(unsigned int send_port_pending);
+void send_msg_1(int targetcore,unsigned long n0);
+void send_msg_2(int targetcore,unsigned long n0,unsigned long n1);
+void send_msg_3(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2);
+void send_msg_4(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3);
+void send_msg_5(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3,unsigned long n4);
+void send_msg_6(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3,unsigned long n4,unsigned long n5);
+void send_msg_1_I(int targetcore,unsigned long n0);
+void send_msg_2_I(int targetcore,unsigned long n0,unsigned long n1);
+void send_msg_3_I(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2);
+void send_msg_4_I(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3);
+void send_msg_5_I(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3,unsigned long n4);
+void send_msg_6_I(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3,unsigned long n4,unsigned long n5);
+void cache_msg_1_I(int targetcore,unsigned long n0);
+void cache_msg_2_I(int targetcore,unsigned long n0,unsigned long n1);
+void cache_msg_3_I(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2);
+void cache_msg_4_I(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3);
+void cache_msg_5_I(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3,unsigned long n4);
+void cache_msg_6_I(int targetcore,unsigned long n0,unsigned long n1,unsigned long n2,unsigned long n3,unsigned long n4,unsigned long n5);
+int receiveMsg_I();
#ifdef TASK
void transferObject(struct transObjInfo * transObj);
#endif
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
for(i = 1; i < NUMCORESACTIVE; ++i) {
// send profile request msg to core i
- send_msg_2(i, PROFILEOUTPUT, totalexetime, false);
+ send_msg_2(i, PROFILEOUTPUT, totalexetime);
}
#ifndef RT_TEST
// pour profiling data on startup core
for(i = 1; i < NUMCORESACTIVE; ++i) {
corestatus[i] = 1;
// send status confirm msg to core i
- send_msg_1(i, STATUSCONFIRM, false);
+ send_msg_1(i, STATUSCONFIRM);
}
return;
} else {
sendStall = false;
}
#ifndef INTERRUPT
- while(receiveObject() != -1) {
+ while(receiveObject_I() != -1) {
}
#endif
// check if there are some pending objects,
} else {
// send StallMsg to startup core
// send stall msg
- send_msg_4(STARTUPCORE, TRANSTALL, BAMBOO_NUM_OF_CORE,self_numsendobjs, self_numreceiveobjs, false);
+ send_msg_4(STARTUPCORE,TRANSTALL,BAMBOO_NUM_OF_CORE,self_numsendobjs,self_numreceiveobjs);
sendStall = true;
isfirst = true;
busystatus = false;
// send mode //
// BAMBOO_ENTER_SEND_MODE_FROM_RUNTIME(): change to send mode from //
// runtime mode //
-// BAMBOO_WAITING_FOR_LOCK(): routine executed while waiting for lock //
+// BAMBOO_WAITING_FOR_LOCK_I(): routine executed while waiting for lock //
// request response //
// BAMBOO_LOCAL_MEM_CALLOC(x, y): allocate an array of x elements each of //
// whose size in bytes is y on local memory //
}
getwritelock_I(tmpobj);
while(!lockflag) {
- BAMBOO_WAITING_FOR_LOCK(0);
+ BAMBOO_WAITING_FOR_LOCK_I();
}
grount = lockresult;
} else {
// 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,false);
+ send_msg_4(targetcore,REDIRECTRELEASE,1,(int)lock,(int)redirectlock);
}
}
#endif
getwritelock(lock);
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
while(!lockflag) {
- BAMBOO_WAITING_FOR_LOCK(0);
+ BAMBOO_WAITING_FOR_LOCK_I();
}
#ifndef INTERRUPT
if(reside) {
- while(BAMBOO_WAITING_FOR_LOCK(0) != -1) {
+ while(BAMBOO_WAITING_FOR_LOCK_I() != -1) {
}
}
#endif
void releasewritelock_r(void * lock, void * redirectlock);
#endif // ifndef MULTICORE_GC
/* this function is to process lock requests.
- * can only be invoked in receiveObject() */
+ * can only be invoked in receiveObject_I() */
// if return -1: the lock request is redirected
// 0: the lock request is approved
// 1: the lock request is denied
#ifdef MULTICORE
#include "SimpleHash.h"
inline void run(int argc, char** argv);
-int receiveObject(int send_port_pending);
+int receiveObject_I();
void * smemalloc_I(int coren, int size, int * allocsize);
#ifdef MULTICORE_GC
inline void setupsmemmode(void);