From: jzhou Date: Tue, 10 May 2011 01:20:04 +0000 (+0000) Subject: More code clean X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4d15d35d9046ddd501e6233d91d32fe23d9ad769;p=IRC.git More code clean --- diff --git a/Robust/src/Runtime/bamboo/multicorecache.c b/Robust/src/Runtime/bamboo/multicorecache.c index 70dddbe0..812a7789 100644 --- a/Robust/src/Runtime/bamboo/multicorecache.c +++ b/Robust/src/Runtime/bamboo/multicorecache.c @@ -553,7 +553,7 @@ void cacheAdapt_phase_client() { 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) { diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.c b/Robust/src/Runtime/bamboo/multicoregarbage.c index 6de5d566..8a42ae66 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.c +++ b/Robust/src/Runtime/bamboo/multicoregarbage.c @@ -629,8 +629,7 @@ void gc_collect(struct garbagelist * stackptr) { 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 @@ -640,7 +639,7 @@ void gc_collect(struct garbagelist * stackptr) { 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); @@ -675,8 +674,7 @@ void gc_nocollect(struct garbagelist * stackptr) { 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); @@ -684,7 +682,7 @@ void gc_nocollect(struct garbagelist * stackptr) { 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); @@ -734,7 +732,7 @@ void master_getlargeobjs() { // 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 @@ -773,14 +771,14 @@ void master_compact() { 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; } diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.h b/Robust/src/Runtime/bamboo/multicoregarbage.h index 9fa1ac31..b7fcbb88 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.h +++ b/Robust/src/Runtime/bamboo/multicoregarbage.h @@ -222,7 +222,7 @@ unsigned int size_cachepolicytbl; 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)); \ } \ } \ } diff --git a/Robust/src/Runtime/bamboo/multicoregccompact.c b/Robust/src/Runtime/bamboo/multicoregccompact.c index cfada61b..d3abf117 100644 --- a/Robust/src/Runtime/bamboo/multicoregccompact.c +++ b/Robust/src/Runtime/bamboo/multicoregccompact.c @@ -92,9 +92,9 @@ INLINE void compact2Heaptophelper_I(unsigned int coren, 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) { @@ -202,7 +202,7 @@ INLINE void resolvePendingMoveRequest() { 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; @@ -545,12 +545,10 @@ innercompact: 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); } } @@ -586,8 +584,7 @@ void compact() { 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 { diff --git a/Robust/src/Runtime/bamboo/multicoregcflush.c b/Robust/src/Runtime/bamboo/multicoregcflush.c index 925cad92..8a5e96d3 100644 --- a/Robust/src/Runtime/bamboo/multicoregcflush.c +++ b/Robust/src/Runtime/bamboo/multicoregcflush.c @@ -210,7 +210,7 @@ void flush(struct garbagelist * stackptr) { 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); } } diff --git a/Robust/src/Runtime/bamboo/multicoregcmark.c b/Robust/src/Runtime/bamboo/multicoregcmark.c index 72ddd5fa..84991696 100644 --- a/Robust/src/Runtime/bamboo/multicoregcmark.c +++ b/Robust/src/Runtime/bamboo/multicoregcmark.c @@ -88,7 +88,7 @@ INLINE void markObj(void * objptr) { // 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); @@ -304,7 +304,7 @@ INLINE void mark(bool isfirst, struct garbagelist * stackptr) { 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; } } diff --git a/Robust/src/Runtime/bamboo/multicoregcprofile.h b/Robust/src/Runtime/bamboo/multicoregcprofile.h index 53d8f7d3..d6ffeff3 100644 --- a/Robust/src/Runtime/bamboo/multicoregcprofile.h +++ b/Robust/src/Runtime/bamboo/multicoregcprofile.h @@ -48,7 +48,7 @@ void gc_outputProfileData(); #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; \ } diff --git a/Robust/src/Runtime/bamboo/multicoremsg.c b/Robust/src/Runtime/bamboo/multicoremsg.c index e3466bff..a2880cc1 100644 --- a/Robust/src/Runtime/bamboo/multicoremsg.c +++ b/Robust/src/Runtime/bamboo/multicoremsg.c @@ -99,9 +99,12 @@ INLINE int checkMsgLength_I(int size) { } default: + { + tprintf("%x \n", type); BAMBOO_EXIT(); break; } + } return BAMBOO_OUT_BUF_LENGTH; } @@ -146,9 +149,9 @@ INLINE void processmsg_transobj_I(int msglength) { } 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); } } } @@ -190,9 +193,9 @@ INLINE void processmsg_lockrequest_I() { // 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); } } } @@ -255,9 +258,9 @@ INLINE void processmsg_redirectlock_I() { // 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); } } } @@ -316,9 +319,9 @@ INLINE void processmsg_profileoutput_I() { #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); } } @@ -335,9 +338,9 @@ INLINE void processmsg_statusconfirm_I() { // 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); } } @@ -388,9 +391,9 @@ INLINE void processmsg_memrequest_I() { 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 @@ -553,9 +556,9 @@ INLINE void processmsg_gcfinishcompact_I() { 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 { @@ -587,9 +590,9 @@ INLINE void processmsg_gcmarkconfirm_I() { 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); } } @@ -724,13 +727,11 @@ INLINE void processmsg_gcfinishpref_I() { // 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; diff --git a/Robust/src/Runtime/bamboo/multicoremsg.h b/Robust/src/Runtime/bamboo/multicoremsg.h index 1069ec89..cea4adc6 100644 --- a/Robust/src/Runtime/bamboo/multicoremsg.h +++ b/Robust/src/Runtime/bamboo/multicoremsg.h @@ -207,20 +207,25 @@ typedef enum { } 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 diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.c b/Robust/src/Runtime/bamboo/multicoreruntime.c index 084f4a04..2f1d5c22 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.c +++ b/Robust/src/Runtime/bamboo/multicoreruntime.c @@ -645,7 +645,7 @@ INLINE void getprofiledata_I() { 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 @@ -710,7 +710,7 @@ INLINE void checkCoreStatus() { 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 { @@ -802,7 +802,7 @@ inline void run(int argc, char** argv) { sendStall = false; } #ifndef INTERRUPT - while(receiveObject() != -1) { + while(receiveObject_I() != -1) { } #endif // check if there are some pending objects, @@ -836,7 +836,7 @@ inline void run(int argc, char** argv) { } 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; diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.h b/Robust/src/Runtime/bamboo/multicoreruntime.h index a26cf0a2..9041d74a 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.h +++ b/Robust/src/Runtime/bamboo/multicoreruntime.h @@ -105,7 +105,7 @@ INLINE void terminatememprof(void); // 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 // diff --git a/Robust/src/Runtime/bamboo/multicoretask.c b/Robust/src/Runtime/bamboo/multicoretask.c index d4b6f329..5c922fd8 100644 --- a/Robust/src/Runtime/bamboo/multicoretask.c +++ b/Robust/src/Runtime/bamboo/multicoretask.c @@ -109,7 +109,7 @@ INLINE bool checkObjQueue() { } getwritelock_I(tmpobj); while(!lockflag) { - BAMBOO_WAITING_FOR_LOCK(0); + BAMBOO_WAITING_FOR_LOCK_I(); } grount = lockresult; @@ -968,7 +968,7 @@ void releasewritelock_r(void * lock, void * redirectlock) { } 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 @@ -1054,11 +1054,11 @@ newtask: 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 diff --git a/Robust/src/Runtime/bamboo/multicoretask.h b/Robust/src/Runtime/bamboo/multicoretask.h index d15d2358..e6f1c43d 100644 --- a/Robust/src/Runtime/bamboo/multicoretask.h +++ b/Robust/src/Runtime/bamboo/multicoretask.h @@ -39,7 +39,7 @@ void releasewritelock_I(void * ptr); 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 diff --git a/Robust/src/Runtime/runtime.h b/Robust/src/Runtime/runtime.h index 1b70ea00..620440cd 100644 --- a/Robust/src/Runtime/runtime.h +++ b/Robust/src/Runtime/runtime.h @@ -150,7 +150,7 @@ void createstartupobject(); #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);