/* * ======== Core_atexit ======== */ Void Core_atexit(Int arg) { if ((Core_module->exitFlag == TRUE) || (Core_syncExits == FALSE)) { Core_module->exitFlag = FALSE; Task_unlockSched(); Swi_unlockSched(); Core_unlock(); return; } Core_module->exitFlag = TRUE; Task_unlockSched(); Swi_unlockSched(); Core_unlock(); /* interrupt the other core */ Core_interruptCore(Core_getId() ^ 1); while (Core_module->exitFlag); }
/* * ======== Core_atexit ======== */ Void Core_atexit(Int arg) { UInt key; UInt coreId = Core_getId(); Task_unlockSched(); Swi_unlockSched(); Core_unlock(); /* force other cores to exit */ key = Core_notifySpinLock(); Core_notify(&Core_exit, (UArg)coreId, (Core_CPUMASK ^ (0x1 << coreId))); Core_notifySpinUnlock(key); }
/* * ======== Core_exit ======== */ Void Core_exit(UArg arg) { Task_unlockSched(); Swi_unlockSched(); Core_unlock(); /* Signal operation complete */ Core_module->syncCores[arg][Core_getId()] = TRUE; /* * Call _exit() instead of abort. abort() internally * calls raise() which will invoke ReentSupport_getReent() * from a Hwi context and cause an assertion failure. */ _exit(0); }
/* * ======== Core_hwiFunc ======== */ Void Core_hwiFunc(UArg arg) { UInt coreId = Core_getId(); Core_module->schedulerInts[coreId] += 1; if (Core_module->exitFlag == TRUE) { Core_module->exitFlag = FALSE; Task_unlockSched(); Swi_unlockSched(); Core_unlock(); abort(); } if (coreId == 0) { Hwi_flushVnvic(); } }