/*
 * ======== HeapCallback_Module_startup ========
 */
Int HeapCallback_Module_startup(Int state)
{
    Int i;
    HeapCallback_Object *obj;

    /*
     *  Wait till all xdc runtime modules are initialized. This will allow
     *  the user defined createInstFxn to use xdc runtime modules (for e.g.
     *  heap modules).
     */
    if (!Startup_rtsDone()) {
        return (Startup_NOTDONE);
    }

    /*
     *  Loop through all statically configured instances
     *  Call the initInstFxn and set the context for each instance.
     */
    for (i = 0; i < HeapCallback_Object_count(); i++) {
        obj = HeapCallback_Object_get(NULL, i);
        obj->context = HeapCallback_initInstFxn(obj->arg);
    }

    return (Startup_DONE);
}
Пример #2
0
/*
 *  ======== Hwi_Module_startup ========
 *  must initialize IRQ (and SWI?) SPs (R13s)
 */
Int Hwi_Module_startup (Int startupPhase)
{
    int i;
    Hwi_Object *hwi;

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

    /* okay to proceed with initialization */

#ifndef ti_sysbios_hal_Hwi_DISABLE_ALL_HOOKS
    for (i = 0; i < Hwi_hooks.length; i++) {
        if (Hwi_hooks.elem[i].registerFxn != NULL) {
            Hwi_hooks.elem[i].registerFxn(i);
        }
    }
#endif
    Hwi_initIntController();

    /*
     * Initialize the pointer to the isrStack.
     *
     * The dispatcher's SP is decremented to accomodate its local variables
     * BEFORE switching to the ISR stack. Consequently, the intial value of
     * the ISR stack SP must leave room for these variables.
     *
     * Leave room for up to 32 32 bit local variables.
     */
    Hwi_module->isrStack =
        (Char *) (((UInt32) (Hwi_module->isrStackBase) & 0xfffffff8) +
                   (UInt32) (Hwi_module->isrStackSize) - (32 * sizeof(Int)));

    /*
     * Signal that we're executing on the ISR stack.
     */
    Hwi_module->taskSP = (Char *)-1;

    /*
     * Initialize the dispatchTable with default entries pointing
     * to nonPluggedHwi() handler.
     *
     * This will catch any triggered Interrupts that were not created
     * using the Hwi module.
     */
    for (i = 0; i < Hwi_NUM_INTERRUPTS; i++) {
        hwi = Hwi_module->dispatchTable[i];
        if (hwi !=  ti_sysbios_family_arm_gic_Hwi_Module_State_nonPluggedHwi()) {
            Hwi_postInit(hwi, NULL);
        }
    }
    return (Startup_DONE);
}
Пример #3
0
/*
 *  ======== Hwi_Module_startup ========
 */
Int Hwi_Module_startup (Int phase)
{
    int i;
    Hwi_Object *hwi;

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

    /* okay to proceed with initialization */

#ifndef ti_sysbios_hal_Hwi_DISABLE_ALL_HOOKS
    for (i = 0; i < Hwi_hooks.length; i++) {
        if (Hwi_hooks.elem[i].registerFxn != NULL) {
            Hwi_hooks.elem[i].registerFxn(i);
        }
    }
#endif
    Hwi_init();                 // sets up FIQ/IRQ stackpointers, etc

    /* 
     * Initialize the pointer to the isrStack.
     *
     * The dispatcher's SP is decremented to accomodate its local variables 
     * BEFORE switching to the ISR stack. Consequently, the intial value of
     * the ISR stack SP must leave room for these variables.
     *
     * Leave room for up to 32 32 bit local variables.
     */
    Hwi_module->isrStack = (Char *) (((UInt32) (Hwi_module->isrStackBase) & 0xfffffff8) + 
                                     (UInt32) Hwi_module->isrStackSize - 32 * sizeof(Int));

    Hwi_module->taskSP = (Char *)-1;/* signal that we're executing on the */
                                        /* ISR stack */

    Hwi_enableIER(Hwi_module->ierMask); /* IER per static Hwi settings */

    Hwi_l1Intc.ITR = 0;
    Hwi_l2Intc.ITR1 = 0;
    Hwi_l2Intc.ITR2 = 0;

    for (i = 0; i < Hwi_NUM_INTERRUPTS; i++) {
        hwi = Hwi_module->dispatchTable[i];
        if (hwi !=  NULL) {
            postInit(hwi, NULL);
        }
    }
    return (Startup_DONE);
}
Пример #4
0
/*
 *  ======== Hwi_Module_startup ========
 *  must initialize IRQ, FIQ, (and SWI?) SPs (R13s)
 */
Int Hwi_Module_startup (Int startupPhase)
{
    int i;
    Hwi_Object *hwi;

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

    /* okay to proceed with initialization */

#ifndef ti_sysbios_hal_Hwi_DISABLE_ALL_HOOKS
    for (i = 0; i < Hwi_hooks.length; i++) {
        if (Hwi_hooks.elem[i].registerFxn != NULL) {
            Hwi_hooks.elem[i].registerFxn(i);
        }
    }
#endif

    /* set up FIQ stack pointer & switch to SYSTEM mode */
    Hwi_init();                 

    initIntController();

    /* 
     * Initialize the pointer to the isrStack.
     *
     * The dispatcher's SP is decremented to accomodate its local variables 
     * BEFORE switching to the ISR stack. Consequently, the intial value of
     * the ISR stack SP must leave room for these variables.
     *
     * Leave room for up to 32 32 bit local variables.
     */
    Hwi_module->isrStack = (Char *) (((UInt32) (Hwi_module->isrStackBase) & 0xfffffff8) + 
                                     (UInt32) Hwi_module->isrStackSize - 32 * sizeof(Int));

    Hwi_module->taskSP = (Char *)-1;    /* signal that we're executing */
                                        /* on the ISR stack */

    for (i = 0; i < Hwi_NUM_INTERRUPTS; i++) {
        hwi = Hwi_module->dispatchTable[i];
        if (hwi !=  NULL) {
            hwiPostInit(hwi, NULL);
        }
    }

    return Startup_DONE;        /* Max startup phase needed is 0 */
}
Пример #5
0
/*
 *  ======== MultiProc_setBaseIdOfCluster ========
 */
Int MultiProc_setBaseIdOfCluster(UInt16 id)
{
    /*
     *  Check the following
     *  1. Make sure the statically configured constant was invalid.
     *     To call setBaseIdOfCluster, the id must have been set to invalid.
     *  2. Make sure the call is made before module startup
     */
    if ((MultiProc_getBaseIdOfCluster() == MultiProc_INVALIDID) &&
        (Startup_rtsDone() == FALSE)) {
        /* It is ok to set the id */
        MultiProc_module->baseIdOfCluster = id;
        return (MultiProc_S_SUCCESS);
    }

    return (MultiProc_E_FAIL);
}
Пример #6
0
/*
 *  ======== MultiProc_setLocalId ========
 */
Int MultiProc_setLocalId(UInt16 id)
{
    /* id must be less than the number of processors */
    Assert_isTrue((id < ti_sdo_utils_MultiProc_numProcessors),
            ti_sdo_utils_MultiProc_A_invalidMultiProcId);

    /*
     *  Check the following
     *  1. Make sure the statically configured constant was invalid.
     *     To call setLocalId, the id must have been set to invalid.
     *  2. Make sure the call is made before module startup
     */
    if ((MultiProc_self() == MultiProc_INVALIDID) &&
        (Startup_rtsDone() == FALSE)) {

        /* It is ok to set the id */
        MultiProc_module->id = id;
        return (MultiProc_S_SUCCESS);
    }

    return (MultiProc_E_FAIL);
}