示例#1
0
/*
 *  ======== Core_unlock ========
 */
Void Core_unlock()
{
    // TODO Check BIOS.swiEnabled and BIOS.taskEnabled before using
    //      Task_enabled() and Swi_enabled() APIs as Tasking/Swis
    //      may be disabled.
    if (Task_enabled() && Swi_enabled()) {
        GateSmp_leave(Core_gate, 0);
    }
}
/*
 *  ======== Task_enabled ========
 */
Bool Task_enabled()
{
    if (BIOS_swiEnabled == FALSE) {
        return (Task_module->locked == FALSE);
    }
    else {
        return ((Task_module->locked == FALSE) && Swi_enabled());
    }
}
/*
 *  ======== Task_restoreHwi ========
 *  Task_restore for Hwi dispatcher.
 *
 *  Called with interrupts disabled from dispatcher.
 *
 *  Returns with interrupts still disabled.
 *
 *  @param(key) key to restore previous Task scheduler state
 */
Void Task_restoreHwi(UInt tskKey)
{
    if (tskKey == FALSE) {
        if (Task_module->workFlag
            && (!BIOS_swiEnabled || (BIOS_swiEnabled && Swi_enabled()))) {
            Task_schedule();
        }
        Task_module->locked = FALSE;
    }
}
示例#4
0
/*
 *  ======== Core_unlock ========
 */
Void Core_unlock()
{
    UInt hwiKey, coreId;

    /* Hwi_disable() */
    hwiKey = _set_interrupt_priority(Hwi_disablePriority);

    coreId = Core_getId();

    // TODO Check BIOS.swiEnabled and BIOS.taskEnabled before using
    //      Task_enabled() and Swi_enabled() APIs.
    if (Core_module->gateEntered[coreId]) {
        if (Task_enabled() && Swi_enabled()) {
            GateSmp_leave(Core_gate, 0);
            Core_module->gateEntered[coreId] = FALSE;
        }
    }

    /* Hwi_restore() */
    _set_interrupt_priority(hwiKey);
}