/* * ======== Swi_restoreSMP ======== * Only called when coreId != 0 */ Void Swi_restoreSMP() { UInt tskKey; /* make Core 0 process the Swis */ if (Swi_module->curSet) { Core_interruptCore(0); } if (BIOS_taskEnabled) { tskKey = TASK_DISABLE(); /* required for Swi's posted from Tasks */ /* release our hold on the Swi scheduler */ Swi_module->locked = FALSE; /* run task scheduler if its unlocked */ TASK_RESTORE(tskKey); } else { /* release our hold on the Swi scheduler */ Swi_module->locked = FALSE; /* release the Inter-core Gate */ Hwi_enable(); } }
/* * ======== 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); }