Ejemplo n.º 1
0
/*
 *  ======== Timer_Module_startup ========
 *  Calls postInit for all statically-created & constructed
 *  timers to initialize them.
 */
Int Timer_Module_startup(Int status)
{
    Int i;
    Timer_Object *obj;

    /* must wait for these modules to initialize first */
    if (!Hwi_Module_startupDone()) {
        return Startup_NOTDONE;
    }

    if (Timer_TimerSupportProxy_Module_startupDone()) {
        if (Timer_startupNeeded) { 
            for (i = 0; i < Timer_numTimerDevices; i++) {
                obj = Timer_module->handles[i];
                /* if timer was statically created/constructed */
                if ((obj != NULL) && (obj->staticInst)) {
                    Timer_postInit(obj, NULL);
                }
            }
        }
        return (Startup_DONE);
    }

    return (Startup_NOTDONE);
}
Ejemplo n.º 2
0
Int Timer_Module_startup(status)
{
    Int i, j;
    Int mask;
    Timer_Object *obj;

    if (Timer_TimerSupportProxy_Module_startupDone()) {
        for (i = 0; i < Timer_numTimerDevices; i++) {
            obj = Timer_module->handles[i];
            /* if timer was statically created/constructed */
            if ((obj != NULL) && (obj->staticInst)) {
                /* 
                 * If timer id is set to Timer_ANY (-1), then find
                 * an unused timer and re-assign timer id to that
                 * of the unused timer.
                 */
                if (obj->id == Timer_ANY) {
                    for (j = 0; j < Timer_numTimerDevices; j++) {
                        mask = 1 << j;
                        if ((Timer_anyMask & mask) && 
                            ((Timer_module->availMask) & mask)) {
                             obj->id = j;
                            (Timer_module->availMask) &= ~mask;
                            if (obj->hwi != NULL) {
                                ti_sysbios_family_c64p_Hwi_eventMap(
                                    obj->intNum,
                                    Timer_module->device[obj->id].eventId);
                            }
                            break;
                        }
                    }
                    /*
                     * Assert that a valid timer id is found.
                     */
                    Assert_isTrue(obj->id != Timer_ANY, Timer_A_notAvailable); 
                }

                if (Timer_startupNeeded) { 
                    postInit(obj, NULL);
                }
            }
        }
        return (Startup_DONE);
    }

    return (Startup_NOTDONE);
}
Ejemplo n.º 3
0
Int Timer_Module_startup(status)
{
    Int i;
    Timer_Object *obj;

    if (Timer_TimerSupportProxy_Module_startupDone()) {
        if (Timer_startupNeeded) { 
            for (i = 0; i < Timer_numTimerDevices; i++) {
                obj = Timer_module->handles[i];
                    /* if timer was statically created/constructed */
                if ((obj != NULL) && (obj->staticInst)) {
                        postInit(obj, NULL);
                    }
            }
        }
        return (Startup_DONE);
    }

    return (Startup_NOTDONE);
}