int msgsizearray[] = {
0, //MSGSTART,
+ 1, //REQNOTIFYSTART
+ 1, //NOTIFYSTART
-1, //TRANSOBJ, // 0xD1
4, //TRANSTALL, // 0xD2
5, //LOCKREQUEST, // 0xD3
#endif // GC_CACHE_ADAPT
#endif // #ifdef MULTICORE_GC
+void processmg_req_notify_start() {
+ startflag=true;
+ if(BAMBOO_CHECK_SEND_MODE()) {
+ cache_msg_1_I(STARTUPCORE,NOTIFYSTART);
+ } else {
+ send_msg_1_I(STARTUPCORE,NOTIFYSTART);
+ }
+}
+
+void processmg_notify_start() {
+ numconfirm--;
+}
+
// receive object transferred from other cores
// or the terminate message from other cores
// Should be invoked in critical sections!!
msgdatafull = false;
switch(type) {
+ case REQNOTIFYSTART: {
+ processmsg_req_notify_start();
+ break;
+ }
+
+ case NOTIFYSTART: {
+ processmsg_notify_start();
+ break;
+ }
+
#ifdef TASK
case TRANSOBJ: {
// receive a object transfer msg
int outmsglast;
int outmsgleft;
volatile bool isMsgHanging;
-
+volatile bool startflag;
#define MSG_INDEXINC_I() \
msgdataindex = (msgdataindex + 1) & (BAMBOO_MSG_BUF_MASK)
*/
typedef enum {
MSGSTART = 0x0, // 0xD0
+ REQNOTIFYSTART,
+ NOTIFYSTART,
TRANSOBJ, // 0xD1
TRANSTALL, // 0xD2
LOCKREQUEST, // 0xD3
bool sendStall = false;
bool isfirst = true;
bool tocontinue = false;
-
+ startflag = false;
corenum = BAMBOO_GET_NUM_OF_CORE();
// initialize runtime data structures
initruntimedata();
initCommunication();
+ if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
+ numconfirm=NUMCORES-1;
+ for(int i=0;i<NUMCORES;i++) {
+ if (i!=STARTUPCORE) {
+ send_msg_1(STARTUPCORE,REQ_NOTIFY_START);
+ }
+ }
+ while(numconfirm!=0)
+ ;
+ } else {
+ while(!startflag)
+ ;
+ }
+
CACHEADAPT_ENABLE_TIMER();
initializeexithandler();