/* * ======== Swi_restore ======== */ Void Swi_restore(UInt swiKey) { if (swiKey == FALSE) { if (Core_getId() != 0) { Swi_restoreSMP(); return; } Core_hwiDisable(); if (Swi_module->curSet) { Hwi_enable(); Swi_schedule(); /* sets locked to FALSE */ } else { Swi_module->locked = FALSE; if (BIOS_taskEnabled) { TASK_RESTORE(TASK_DISABLE()); /* required for Swi's posted from Tasks */ } else { Hwi_enable(); } } } }
/* * ======== Swi_post ======== */ Void Swi_post(Swi_Object *swi) { UInt hwiKey; UInt swiKey; #ifndef ti_sysbios_knl_Swi_DISABLE_ALL_HOOKS Int i; #endif Log_write3(Swi_LM_post, (UArg)swi, (UArg)swi->fxn, (UArg)swi->priority); hwiKey = Hwi_disable(); if (swi->posted) { Hwi_restore(hwiKey); return; } swi->posted = TRUE; swiKey = Swi_disable(); /* Place the Swi in the appropriate ready Queue. */ Queue_enqueue(swi->readyQ, (Queue_Elem *)swi); /* Add this priority to current set */ Swi_module->curSet |= swi->mask; Hwi_restore(hwiKey); /* Not in FIFO order. OK! */ #ifndef ti_sysbios_knl_Swi_DISABLE_ALL_HOOKS /* * This hook location supports the STS "set ready time" operation on * Swis. This is equivalent to pre-BIOS 6. */ for (i = 0; i < Swi_hooks.length; i++) { if (Swi_hooks.elem[i].readyFxn != NULL) { Swi_hooks.elem[i].readyFxn(swi); } } #endif /* * Modified Swi_restore(). * No need to check curSet since we just set it. */ if (swiKey == FALSE) { if (Core_getId() == 0) { Swi_schedule(); /* unlocks Swi scheduler on return */ } else { Swi_restoreSMP(); /* interrupt core 0 to do the work */ } } }
/* * ======== Swi_restore ======== */ Void Swi_restore(UInt swiKey) { UInt hwiKey; if (swiKey == FALSE) { hwiKey = Hwi_disable(); if (Swi_module->curSet) { Hwi_restore(hwiKey); Swi_schedule(); /* sets locked to FALSE */ } else { Swi_module->locked = FALSE; Hwi_restore(hwiKey); } if (BIOS_taskEnabled) { /* run task scheduler if its unlocked */ TASK_RESTORE(TASK_DISABLE()); } } }