Ejemplo n.º 1
0
/*
 *  ======== RMAN_exit ========
 *  Exit the generic IRES RMAN and free the memory back to the Memory manager
 *  using which it was created.
 */
IRES_Status RMAN_exit()
{
    IArg        key;
    Int         i;
    IRES_Status status = IRES_OK;


    if (rmanInit == 0) {
        return (IRES_ENOINIT);
    }

    Log_print0(Diags_ENTRY, "[+E] RMAN_exit> Enter ");

    rmanInternalState->info.refCount--;

    if (--rmanInit == 0) {
        if (initStatus != IRES_OK) {
            Log_print0(Diags_USER7, "[+7] RMAN_exit> RMAN_init call didn't "
                    "happen successfully. RMAN_exit will not unregister "
                    "any resources.");
            status = IRES_ENOINIT;
        }
        else {
            key = IGateProvider_enter(gate);

            Log_print1(Diags_EXIT, "[+X] RMAN_exit> tableIndex = %d",
                    (IArg)(resTable.tableIndex));

            /* Unregister the entries */
            Log_print0(Diags_EXIT, "[+X] RMAN_exit> Unregistering resources");

            for (i = 0; i < resTable.tableIndex; i++) {
                if (RMAN_TABLE[i] != NULL) {

                    /* Even if there is an error, unregister the rest */
                    if ((status = RMAN_TABLE[i]->exit()) != IRES_OK) {
                        Log_print2(Diags_USER7, "[+7] RMAN_exit> Error "
                                "unregistering the IRESMAN implementation "
                                "0x%x, status = %d",
                                (IArg)(RMAN_TABLE[i]), (IArg)status);
                        status = IRES_EFAIL;
                    }
                }
            }
            /* Free the RMAN object */
            freeInternalState();

            initStatus = IRES_ENOINIT;

            /* Free the gate after leaving it */
            IGateProvider_leave(gate, key);
            OsalSupport_deleteGate(gate);
            gate = NULL;
        }
    }

    Log_print1(Diags_EXIT, "[+X] RMAN_exit> Exit (status=%d)", (IArg)status);

    return (status);
}
Ejemplo n.º 2
0
/* ARGSUSED - this line tells the compiler not to warn about unused args. */
IRES_Status RMAN_deactivateAllResources(IALG_Handle alg, IRES_Fxns * resFxns,
        Int scratchGroupId)
{
    IRES_Status status;

    if (initStatus != IRES_OK) {
        Log_print0(Diags_USER7, "[+7] RMAN_deactivateAllResources> "
                "RMAN_init call hasn't happened successfully. Please "
                "initialize RMAN before calling any other RMAN API");

        Log_print0(Diags_EXIT, "[+X] RMAN_deactivateAllResources> "
                "Exit (status=IRES_ENOINIT)");

        return (IRES_ENOINIT);
    }

    Log_print3(Diags_ENTRY, "[+E] RMAN_deactivateAllResources> "
            "Enter (alg=0x%x, resFxns=0x%x, scratchGroupId=%d)",
            (IArg)alg, (IArg)resFxns, (IArg)scratchGroupId);

    status = resFxns->deactivateAllResources(alg);

    Log_print1(Diags_EXIT, "[+X] RMAN_deactivateAllResources> Exit (status=%d)",
            (IArg)status);

    return (status);
}
Ejemplo n.º 3
0
Void Dsp_AppTask (UArg arg1, UArg arg2)
{
  OMX_ERRORTYPE eError = OMX_ErrorNone;
  //TIMM_OSAL_ERRORTYPE osalError = TIMM_OSAL_ERR_NONE;

  /*--------------------------------------------------------------------------*/
  /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  /* Initiailize the system. The initialization can include driver, syslink */
  /* cache.  */
  /*--------------------------------------------------------------------------*/
  Log_print0 (Diags_USER1,"DSP: In Dsp_AppTask");
  platform_init ();
  Log_print0 (Diags_USER1,"DSP: Platform Initialized");

  while (TRUE)
  {
    Task_sleep (DSP_APP_TASK_SLEEP_DURATION);
  }

  /*--------------------------------------------------------------------------*/
  /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  /* UnInitiailize the system.  */
  /*--------------------------------------------------------------------------*/
  platform_deinit ();
  Log_print0 (Diags_USER1,"DSP: Platform De-Initialized");

  Log_print0 (Diags_USER1,"DSP: Exiting the system");
  System_exit (0);

//EXIT:
  if (eError != OMX_ErrorNone)
  {
    Log_print1 (Diags_USER1,"Error in executing app. Failed code:%d", eError);
  }
}                               /* Dsp_AppTask */
Ejemplo n.º 4
0
/* ARGSUSED - this line tells the compiler not to warn about unused args. */
IRES_Status RMAN_activateResource(IALG_Handle alg,
        IRES_Handle resourceHandle, IRES_Fxns * resFxns, Int scratchGroupId)
{
    IRES_Status status;

    if (initStatus != IRES_OK) {
        Log_print0(Diags_USER7, "[+7] RMAN_activateResource> RMAN_init "
                "call hasn't happened successfully. Please initialize "
                "RMAN before calling any other RMAN API");
        Log_print0(Diags_EXIT, "[+X] RMAN_activateResource> Exit "
                "(status=IRES_ENOINIT)");
        return (IRES_ENOINIT);
    }

    Log_print4(Diags_ENTRY, "[+E] RMAN_activateResource> Enter "
            "(alg=0x%x, resourceHandle=0x%x, resFxns=0x%x, scratchGroupId=%d",
            (IArg)alg, (IArg)resourceHandle, (IArg)resFxns,
            (IArg)scratchGroupId);

    status = resFxns->activateResource(alg, resourceHandle);

    Log_print1(Diags_EXIT, "[+X] RMAN_activateResource> Exit (status=%d)",
            (IArg)status);

    return (status);
}
/*
 *  ======== USBMSCHFatFsTiva_usbHCDEvents ========
 *  Generic USB Host Class Driver event callback.
 *
 *  This callback is called to notify the application that an unknown
 *  device was connected.
 */
static void USBMSCHFatFsTiva_usbHCDEvents(void *cbData)
{
    tEventInfo                 *pEventInfo = (tEventInfo *)cbData;
    USBMSCHFatFsTiva_Object    *object = USBMSCHFatFs_config->object;

    switch (pEventInfo->ui32Event) {
        case USB_EVENT_UNKNOWN_CONNECTED:
            /* An unknown device was detected. */
            object->state = USBMSCHFatFsTiva_UNKNOWN;
            Log_print0(Diags_USER2, "USBMSCHFatFs: usbHCDEvent Callback: "
                                    "UNKNOWN DEVICE CONNECTED");
            break;

        case USB_EVENT_DISCONNECTED:
            /* Unknown device has been removed. */
            object->state = USBMSCHFatFsTiva_NO_DEVICE;
            Log_print0(Diags_USER2, "USBMSCHFatFs: usbHCDEvent Callback: "
                                    "UNKNOWN DEVICE DISCONNECTED");
            break;

        case USB_EVENT_POWER_FAULT:
            /* No power means no device is present. */
            object->state = USBMSCHFatFsTiva_POWER_FAULT;
            Log_print0(Diags_USER2, "USBMSCHFatFs: usbHCDEvent Callback: "
                                    "POWER FAULT");
            break;

        default:
            break;
    }
}
Ejemplo n.º 6
0
/*
 * This event indicates that a Set_Report request was received from the host
 * The application needs to supply a buffer to retrieve the report data that will be sent
 * as part of this request. This handler is passed the reportType, reportId, the length of data
 * phase as well as the interface number.
 */
uint8_t *USBHID_handleEP0SetReport(uint8_t reportType, uint8_t reportId,
                                   uint16_t requestedLength,
                                   uint8_t intfnum)
{
    switch (reportType) {
    case USB_REQ_HID_INPUT:
        /* Return pointer to input Report Buffer */
        Log_print0(Diags_USER1, "USB: USBHID_handleEP0SetReport: USB_REQ_HID_INPUT");
        return 0;

    case USB_REQ_HID_OUTPUT:
        /* Return pointer to output Report Buffer */
        Log_print0(Diags_USER1, "USB: USBHID_handleEP0SetReport: USB_REQ_HID_OUTPUT");
        return 0;

    case USB_REQ_HID_FEATURE:
        /* Return pointer to feature Report Buffer */
        Log_print0(Diags_USER1, "USB: USBHID_handleEP0SetReport: USB_REQ_HID_FEATURE");
        return 0;

    default:
        Log_print0(Diags_USER1, "USB: USBHID_handleEP0SetReport: default");
        return 0;
    }
}
Ejemplo n.º 7
0
/*
 *  ======== Memory_redefine ========
 */
Bool ti_sdo_ce_osal_Memory_redefine(Int segId, Uint32 base, Uint32 size)
{
    HeapMem_Params params;
    HeapMem_Handle heap;
    Memory_Stat    stat;

    if ((segId < 0) || (segId >= Memory_numHeaps)) {
        Log_print2(Diags_USER7, "Memory_redefine> segId (%d) out of range. "
                "Should be < %d", (IArg)segId,
                (IArg)Memory_numHeaps);
        return (FALSE);
    }

    if (!Memory_segStat(segId, &stat)) {
        Log_print0(Diags_USER7, "Memory_redefine> Memory_segStat() failed!");
        return (FALSE);
    }

    if (stat.used > 0) {
        Log_print0(Diags_USER7, "Memory_redefine> Heap in use!");
        return (FALSE);
    }

    heap = ti_sdo_ce_osal_Memory_heapList[segId];

    HeapMem_destruct(HeapMem_struct(heap));

    HeapMem_Params_init(&params);
    params.size = size;
    params.buf = (Ptr)base;

    HeapMem_construct(HeapMem_struct(heap), &params);

    return (TRUE);
}
/*
 *  ======== USBMSCHFatFsTiva_diskWrite ========
 *  This function writes sector(s) to the disk drive
 *
 *  @param  drv     Drive Number
 *
 *  @param  buf     Pointer to a buffer from which data is read
 *
 *  @param  sector  Sector number to write to
 *
 *  @param  count   Number of sectors to be written
 */
DRESULT USBMSCHFatFsTiva_diskWrite(BYTE drv, const BYTE *buf,
                                   DWORD sector, BYTE count)
{
    unsigned int                key;
    uint32_t                    driveWrite;
    USBMSCHFatFsTiva_Object    *object = USBMSCHFatFs_config->object;

    Log_print2(Diags_USER1, "USBMSCHFatFs: diskWrite: Sector %d, Count %d",
                             sector, count);

    if (!count) {
        Log_print0(Diags_USER1, "USBMSCHFatFs: diskWrite: ERROR");
        return (RES_PARERR);
    }

    if (object->state != USBMSCHFatFsTiva_CONNECTED) {
        Log_print0(Diags_USER1, "USBMSCHFatFs: diskWrite: not initialized");
        return (RES_NOTRDY);
    }

    key = GateMutex_enter(GateMutex_handle(&(object->gateUSBLibAccess)));
    driveWrite = USBHMSCBlockWrite(object->MSCInstance, sector, (uint8_t *)buf, count);
    GateMutex_leave(GateMutex_handle(&(object->gateUSBLibAccess)), key);

    if (driveWrite == 0) {
        Log_print0(Diags_USER2, "USBMSCHFatFs: diskWrite: OK");
        return (RES_OK);
    }
    else {
        Log_print0(Diags_USER2, "USBMSCHFatFs: diskWrite: ERROR");
        return (RES_ERROR);
    }
}
Ejemplo n.º 9
0
static Void IpcPower_suspendSwi(UArg arg0, UArg arg1)
{
#ifndef SMP
    if (MultiProc_self() == sysm3ProcId) {
#endif
        Log_print0(Diags_INFO, FXNN":Core0 Hibernation Swi");
#ifndef SMP
        PowerSuspArgs.pmMasterCore = MASTERCORE;
    }
    else if (MultiProc_self() == appm3ProcId) {
        Log_print0(Diags_INFO, FXNN":Core1 Hibernation Swi");
        PowerSuspArgs.pmMasterCore = NO_MASTERCORE;
    }
#endif
    if (refWakeLockCnt) {
        System_printf("Warning: Wake locks in use\n");
    }

    Power_suspend(&PowerSuspArgs);
#ifndef SMP
    IpcPower_sleepMode(IpcPower_SLEEP_MODE_DEEPSLEEP);
    IpcPower_setWugen();

    Log_print0(Diags_INFO, FXNN":Resume");
#endif
}
Ejemplo n.º 10
0
/*!
 * ======== VirtQueue_startup ========
 */
Void VirtQueue_startup()
{
    hostProcId      = MultiProc_getId("HOST");
#ifndef SMP
    dsp1ProcId       = MultiProc_getId("DSP1");
    sysm3ProcId     = MultiProc_getId("CORE0");
    appm3ProcId     = MultiProc_getId("CORE1");
#endif

#ifdef DSP
    intInfo.intVectorId = DSPEVENTID;
#else
    /* Initilize the IpcPower module */
    IpcPower_init();
#endif

    /*
     * Wait for HLOS (Virtio device) to indicate that priming of host's receive
     * buffers is complete, indicating that host is ready to send.
     *
     * Though this is a Linux Virtio configuration status, it must be
     * implemented by each non-Linux HLOS as well.
     */
    Log_print1(Diags_USER1, "VirtQueue_startup: VDEV status: 0x%x\n",
              Resource_getVdevStatus(VIRTIO_ID_RPMSG));
    Log_print0(Diags_USER1, "VirtQueue_startup: Polling VDEV status...\n");
    while (Resource_getVdevStatus(VIRTIO_ID_RPMSG) != VRING_BUFS_PRIMED);
    Log_print1(Diags_USER1, "VirtQueue_startup: VDEV status: 0x%x\n",
              Resource_getVdevStatus(VIRTIO_ID_RPMSG));

    InterruptProxy_intRegister(hostProcId, &intInfo, (Fxn)VirtQueue_isr, NULL);
    Log_print0(Diags_USER1, "Passed VirtQueue_startup\n");
}
Ejemplo n.º 11
0
/*
 *  ======== IRESMAN_HDVICP_exit ========
 *  Function called when RESMAN is no longer needed. Use it to free memory
 *  allocated etc
 */
IRES_Status IRESMAN_HDVICP_exit()
{
    Log_print0(Diags_ENTRY, "[+E] IRESMAN_HDVICP_exit> Enter");

    if (!(_initialized)) {
        Log_print0(Diags_EXIT,
                "[+X] IRESMAN_HDVICP_exit> Exit (status=IRES_ENOINIT)");

        return (IRES_ENOINIT);
    }

#ifdef xdc_target__os_Linux
    if (gate) {
        OsalSupport_deleteGate(gate);
        gate = NULL;
    }
#endif

    /* Set the initialized flag to zero again */
    _initialized = 0;

    _resmanInternalState->numOpens--;

    freeInternalState();

    Log_print0(Diags_EXIT, "[+X] IRESMAN_HDVICP_exit> Exit (status=IRES_OK)");

    return (IRES_OK);
}
Ejemplo n.º 12
0
Int main(Int argc, Char* argv[])
{
    Error_Block     eb;
    Task_Params     taskParams;
    Registry_Result result;

    Log_print0(Diags_ENTRY, "--> main:");

    /* must initialize the error block before using it */
    Error_init(&eb);

    /* create main thread (interrupts not enabled in main on BIOS) */
    Task_Params_init(&taskParams);
    taskParams.instance->name = "smain";
    taskParams.stackSize = 0x1000;
    Task_create(smain, &taskParams, &eb);

    if (Error_check(&eb)) {
        System_abort("main: failed to create application startup thread");
    }

    /* register with xdc.runtime to get a diags mask */
    result = Registry_addModule(&Registry_CURDESC, MODULE_NAME);
    Assert_isTrue(result == Registry_SUCCESS, (Assert_Id)NULL);

    /* start scheduler, this never returns */
    BIOS_start();

    /* should never get here */
    Log_print0(Diags_EXIT, "<-- main:");
    return (0);
}
Ejemplo n.º 13
0
/*
 *  ======== Global_init ========
 */
Void Global_init(Void)
{
    Int i;
    Registry_Result   result;

    /*
     *  No need to reference count for Registry_addModule(), since there
     *  is no way to remove the module.
     */
    if (regInit == 0) {
        /* Register this module for logging */
        result = Registry_addModule(&ti_sdo_ce_osal_Global_desc,
                Global_MODNAME);
        Assert_isTrue(result == Registry_SUCCESS, (Assert_Id)NULL);

        if (result == Registry_SUCCESS) {
            /* Set the diags mask to the CE default */
            CESettings_init();
            CESettings_setDiags(Global_MODNAME);
        }
        regInit = 1;
    }

    Log_print0(Diags_ENTRY, "[+E] Global_init> Enter");

    if (curInit != TRUE) {
        curInit = TRUE;

        Log_print0(Diags_USER4, "[+4] Global_init> This program was built "
                "with the following packages:");
        for (i = 0; Global_buildInfo[i] != NULL; i++) {
            Log_print1(Diags_USER4, "[+4] %s", (IArg)(Global_buildInfo[i]));
        }
    }
}
Ejemplo n.º 14
0
/* ARGSUSED */
int main(Int argc, Char * argv[])
{
    IRES_Status status;
    Int         size = 0;

    FCSettings_init();
    Diags_setMask(FCSETTINGS_MODNAME"+EX1234567");
    Diags_setMask("xdc.runtime.Main+EX1234567");
    Diags_setMask("ti.sdo.fc.%+EX1234567");

    Log_print0(Diags_ENTRY, "[+E] _main> Enter");

    status = RMAN_init();
    if (IRES_OK != status) {
        Log_print1(Diags_USER7, "[+7] main> RMAN_init() failed [%d]",
                   (IArg)status);
        System_abort("RMAN_init() failed, aborting...\n");
    }

    Log_print0(Diags_EXIT, "[+X] main> Exit");

    BIOS_start();

    return(0);
}
Ejemplo n.º 15
0
/* ARGSUSED */
int main(Int argc, Char * argv[])
//int main(UArg argc, UArg argv)
{
    IRES_Status status;
    Int         size = 0;

#if 0
    // TODO: Convert to Diags_setMask()
    GT_set(MODNAME "=01234567");
    GT_set("ti.sdo.fc.rman" "=4567");
    GT_set("ti.sdo.fc.dskt2" "=67");
    GT_set("ti.sdo.fc.ires.hdvicp" "=01234567");
    /*      GT_set("ti.sdo.fc.dskt2" "=01234567");*/
#endif
    Log_print0(Diags_ENTRY, "[+E] _main> Enter ");

    status = RMAN_init();
    if (IRES_OK != status) {
        Log_print1(Diags_USER7, "[+7] main> RMAN_init() failed [%d]",
                   (IArg)status);
        return (-1);
    }

    Log_print0(Diags_EXIT, "[+X] main> Exit");

    smain(argc, argv);

    return (0);
}
/*
 *  ======== USBMSCHFatFsTiva_diskRead ========
 *  This function reads sector(s) from the disk drive
 *
 *  @param  drv     Drive Number
 *
 *  @param  buf     Pointer to a buffer to which data is written
 *
 *  @param  sector  Sector number to read from
 *
 *  @param  count   Number of sectors to be read
 */
DRESULT USBMSCHFatFsTiva_diskRead(BYTE drv, BYTE *buf,
                                  DWORD sector, BYTE count)
{
    unsigned int                key;
    uint32_t                    driveRead;
    USBMSCHFatFsTiva_Object    *object = USBMSCHFatFs_config->object;

    Log_print2(Diags_USER1, "USBMSCHFatFs: diskRead: Sector %d, Count %d",
                             sector, count);

    if (object->state != USBMSCHFatFsTiva_CONNECTED) {
        Log_print0(Diags_USER1, "USBMSCHFatFs: diskRead: not initialized");
        return (RES_NOTRDY);
    }

    /* READ BLOCK */
    key = GateMutex_enter(GateMutex_handle(&(object->gateUSBLibAccess)));
    driveRead = USBHMSCBlockRead(object->MSCInstance, sector, buf, count);
    GateMutex_leave(GateMutex_handle(&(object->gateUSBLibAccess)), key);

    if (driveRead == 0) {
        Log_print0(Diags_USER2, "USBMSCHFatFs: diskRead: OK");
        return (RES_OK);
    }
    else {
        Log_print0(Diags_USER2, "USBMSCHFatFs: diskRead: ERROR");
        return (RES_ERROR);
    }
}
Ejemplo n.º 17
0
/*
 *  ======== main ========
 */
Int main(Int argc, Char* argv[])
{
    Error_Block     eb;
    Task_Params     taskParams;

    Log_print0(Diags_ENTRY, "--> main:");

    /* must initialize the error block before using it */
    Error_init(&eb);

    /* create main thread (interrupts not enabled in main on BIOS) */
    Task_Params_init(&taskParams);
    taskParams.instance->name = "smain";
    taskParams.stackSize = 0x1000;
    Task_create(smain, &taskParams, &eb);

    if (Error_check(&eb)) {
        System_abort("main: failed to create application startup thread");
    }

    /* start scheduler, this never returns */
    BIOS_start();

    /* should never get here */
    Log_print0(Diags_EXIT, "<-- main:");
    return (0);
}
Ejemplo n.º 18
0
/*
 *  ======== Algorithm_delete ========
 */
Void Algorithm_delete(Algorithm_Handle alg)
{
    Algorithm_Obj *pObject = (Algorithm_Obj *)alg;
    IRES_Status status;

    Log_print1(Diags_ENTRY, "[+E] Algorithm_delete> Enter(alg=0x%x)",
            (IArg)alg);

    if (pObject != NULL) {
        if (pObject->iresFxns) {
            /* Call RMAN fuction to free resources */
            status = RMAN_freeResources(pObject->alg, pObject->iresFxns,
                    pObject->groupId);
            if (status != IRES_OK) {
                Log_print1(Diags_USER7, "[+7] Algorithm_delete> Freeing "
                        "of alg resources through RMAN FAILED (0x%x)",
                        (IArg)status);
            }
        }

        if (pObject->idma3Fxns) {
            Log_print0(Diags_USER4, "[+4] Algorithm_delete> releasing "
                    "DMA resources");
            DMAN3_releaseDmaChannels(&(pObject->alg), &(pObject->idma3Fxns),1);
        }

        if (pObject->alg) {
            ALG_delete(pObject->groupId, pObject->alg, pObject->useCachedMem);
        }

        Memory_free(pObject, sizeof (*pObject), NULL);
    }

    Log_print0(Diags_EXIT, "[+X] Algorithm_delete> Exit");
}
Ejemplo n.º 19
0
/* ARGSUSED */
Void smain(UArg arg0, UArg arg1)
{
    SemThread_Params semParams;
    Task_Params      taskParams;
    Task_Handle      tsk;
    Int              i;

    Log_print0(Diags_ENTRY, "[+E] smain> Enter ");

    SemThread_Params_init(&semParams);
    done = SemThread_create(0, &semParams, NULL);

    SemThread_Params_init(&semParams);
    mutex = SemThread_create(1, &semParams, NULL);

    if ((done == NULL) || (mutex == NULL)) {
        Log_print0(Diags_USER7, "[+7] smain> SemThread creation failed");

        System_abort("SemThread_create failed \n");
    }

    Task_Params_init(&taskParams);
    /*
     *  Add the following line to have the stack allocated from the external
     *  heap:
     *      taskParams.stackHeap = (IHeap_Handle)EXTMEM_HEAP;
     */

    taskParams.stackSize = 0x1000;

    for (i = 0; i < NUMTASKS; i++) {
        Task_Params_init(&taskParams);
        taskParams.priority = attrsTable[i].priority;

        taskParams.arg0 = i + 1; /* task id */
        taskParams.arg1 = i;     /* index into attrsTable */
        tsk = Task_create((Task_FuncPtr)rmanTask, &taskParams, NULL);

        if (tsk == NULL) {

            Log_print1(Diags_USER7, "[+7] smain> Task_create of task %d failed",
                    (IArg)(i + 1));

            System_abort("Task_create() failed\n");
        }
    }

    for (i = 0; i < NUMTASKS; i++) {
        SemThread_pend(done, SemThread_FOREVER, NULL);
    }

    SemThread_delete(&mutex);
    SemThread_delete(&done);

    Log_print0(Diags_USER4, "[+4] smain> TEST PASSED ");

    Log_print0(Diags_EXIT, "[+X] smain> Exit ");
}
Int SystemCfg_closeSharedResources(SystemCfg_AppFxn appShutdownFxn, Ptr arg)
{
    Error_Block eb;
    Int status = 0;
    struct SystemCfg *stateObj = &SystemCfg_State;


    Log_print1(Diags_ENTRY, "--> %s: ()", (IArg)FXNN);

    Error_init(&eb);

    /* invoke the application shutdown function */
    if (appShutdownFxn != NULL) {
        status = appShutdownFxn(arg);

        if (status < 0) {
            goto leave;
        }
    }

    /* close shared resources from remote core */

    /* <add code here> */

    /* send close done event to remote core */
    Log_print0(Diags_USER1, FXNN": send EvtCloseDone to remote core");

    status = Notify_sendEvent(stateObj->hostProcId, Global_NotifyLineId,
        Global_HostDspEvtNum, Global_EvtCloseDone, TRUE);

    if (status < 0) {
        /* Log_error() */
        Log_print4(Diags_USER8,
            "Error: %s, line %d: %s: Notify_sendEvent() returned error %d",
            (IArg)__FILE__, (IArg)__LINE__, (IArg)FXNN, (IArg)status);
        goto leave;
    }

    /* wait for close event from remote core */
    Log_print0(Diags_USER1, FXNN": waiting for EvtCloseDone event...");

    SemThread_pend(stateObj->semH, SemThread_FOREVER, &eb);

    if (Error_check(&eb)) {
        /* Log_error() */
        Log_print3(Diags_USER8,
            "Error: %s, line %d: %s:  SemThread_pend() returned with error",
            (IArg)__FILE__, (IArg)__LINE__, (IArg)FXNN);
        status = -1;
        goto leave;
    }
    Log_print0(Diags_USER1, FXNN": ...received EvtCloseDone event");


leave:
    Log_print2(Diags_EXIT, "<-- %s: %d", (IArg)FXNN, (IArg)status);
    return(status);
}
Ejemplo n.º 21
0
/*
 *  ======== Memory_cacheWbInvAll ========
 */
Void Memory_cacheWbInvAll()
{
    Log_print0(Diags_ENTRY, "[+E] Memory_cacheWbInvAll> Enter()");

//#ifdef xdc_target__isaCompatible_64P
    Cache_wbInvAll();
//#endif
    Log_print0(Diags_EXIT, "Memory_cacheWbInvAll> return");
}
Ejemplo n.º 22
0
/*
 *  ======== Algorithm_releaseLock ========
 */
Void Algorithm_releaseLock(Int groupId, IALG_Handle alg)
{
    Log_print2(Diags_ENTRY, "[+E] Algorithm_releaseLock> Enter(alg=0x%x,"
            " groupId=%d)", (IArg)alg, (IArg)groupId);

    Log_print0(Diags_ENTRY, "[+E] Algorithm_releaseLock> Feature not "
            "supported on BIOS (yet).");

    Log_print0(Diags_EXIT, "[+X] Algorithm_releaseLock> Exit");
}
Ejemplo n.º 23
0
Int
NameServerApp_execute()
{
    Int32 status = 0;

    Log_print0(Diags_INFO, "Entered NameServerApp_execute\n");

    Log_print0(Diags_INFO, "Leaving NameServerApp_execute\n\n");

    return status;
}
Ejemplo n.º 24
0
int main (void)
{
  Log_print0 (Diags_USER1,"DSP: in main");

  Ipc_start ();
  Log_print0 (Diags_USER1,"DSP: IPC Start Successful");

  BIOS_start ();
  Log_print0 (Diags_USER1,"DSP: BIOS Start Successful");
  return (0);

}                               /* main */
Ejemplo n.º 25
0
/*
 *  ======== IpcPower_canHibernate ========
 */
Bool IpcPower_canHibernate()
{
#ifndef SMP
    if (IpcPower_hibLocks[0] || IpcPower_hibLocks[1]) {
#else
    if (IpcPower_hibLocks) {
#endif
        return (FALSE);
    }

    return (TRUE);
}

/*
 *  ======== IpcPower_registerCallback ========
 */
#define FXNN "IpcPower_registerCallback"
Int IpcPower_registerCallback(Int event, IpcPower_CallbackFuncPtr cbck,
                              Ptr data)
{
    IArg hwiKey;
    IpcPower_CallbackElem **list, *node;
    BIOS_ThreadType context = BIOS_getThreadType();

    if ((context != BIOS_ThreadType_Task) &&
        (context != BIOS_ThreadType_Main)) {
        Log_print0(Diags_ERROR, FXNN":Invalid context\n");
        return (IpcPower_E_FAIL);
    }

    list = &IpcPower_callbackList;

    /* Allocate and update new element */
    node = Memory_alloc(NULL, sizeof(IpcPower_CallbackElem), 0, NULL);
    if (node == NULL) {
        Log_print0(Diags_ERROR, FXNN":out of memory\n");
        return (IpcPower_E_MEMORY);
    }

    node->next     = NULL;
    node->event    = (IpcPower_Event) event;
    node->callback = cbck;
    node->data     = data;

    hwiKey = Hwi_disable();  /* begin: critical section */
    while (*list != NULL) {
        list = &(*list)->next;
    }
    *list = node;
    Hwi_restore(hwiKey);  /* end: critical section */

    return (IpcPower_S_SUCCESS);
}
/* ARGSUSED - this line tells the compiler not to warn about unused args. */
IRES_Status IRES_EDMA3CHAN_destructHandle(IRES_Handle handle)
{
    Log_print0(Diags_ENTRY, "[+E] IRES_EDMA3CHAN_destructHandle> Enter");

    /*
     * Nothing allocated in this module
     * So nothing needs to be done.
     */
    Log_print0(Diags_EXIT,
            "[+X] IRES_EDMA3CHAN_destructHandle> Exit (returnVal=IRES_OK)");

     return (IRES_OK);
}
/* ARGSUSED */
int main(Int argc, Char * argv[])
{
    IRES_Status status;
    Int         size = 0;

    // TODO: Use Diags_setMask()
#if 0
    GT_init();
    GT_create(&CURTRACE, "ti.sdo.fc.rman.examples.hdvicp");
        GT_set(MOD_NAME "=01234567");
        GT_set("ti.sdo.fc.rman" "=4567");
        GT_set("ti.sdo.fc.dskt2" "=67");
        GT_set("ti.sdo.fc.ires.hdvicp" "=01234567");
/*      GT_set("ti.sdo.fc.dskt2" "=01234567");*/
#endif

    Log_print0(Diags_ENTRY, "[+E] _main> Enter ");

    status = RMAN_init();
    if (IRES_OK != status) {
        Log_print1(Diags_USER7, "[+7] main> RMAN_init() failed [%d]",
                (IArg)status);
        System_abort("RMAN_init() failed, aborting...\n");
    }

    /*
     * Supply initialization information for the RESMAN while registering
     */
    size = sizeof(IRESMAN_HdVicpParams);

    configParams.baseConfig.allocFxn = RMAN_PARAMS.allocFxn;
    configParams.baseConfig.freeFxn = RMAN_PARAMS.freeFxn;
    configParams.baseConfig.size = size;

    /* Register the HDVICP protocol/resource manager with the
     * generic resource manager */

    status = RMAN_register(&IRESMAN_HDVICP, (IRESMAN_Params *)&configParams);

    if (IRES_OK != status) {
        Log_print1(Diags_USER7, "[+7] main> RMAN_register() failed [%d]",
                (IArg)status);
        System_abort("RMAN_register() failed, aborting...\n");
    }

    Log_print0(Diags_EXIT, "[+X] main> Exit");

    BIOS_start();

    return(0);
}
Ejemplo n.º 28
0
/*
 *  ======== exitBuf ========
 */
static IRES_Status exitBuf()
{
    Log_print0(Diags_ENTRY, "[+E] BUFRES exit> Enter");

    if (--curInit == 0) {
        /* clean up */
        buffer.base = NULL;
        buffer.length = 0;
        buffer.scratchId = -1;
        buffer.refCount = 0;
    }

    Log_print0(Diags_EXIT, "[+X] BUFRES exit> Exit");
    return (IRES_OK);
}
/*
 *  ======= ACPY3_waitLinked ========
 * Blocking wait for an individual transfer in a Linked transfer to finish.
 * Requires the individual transfer indicated by the 'waitId'
 * to be configured as synchronous, otherwise returns immediately.
 */
Void ACPY3_waitLinked(IDMA3_Handle handle, unsigned short waitId)
{

    Log_print2(Diags_ENTRY, "[+E] ACPY3_waitLinked> Enter "
            "(handle=0x%x, waitId=%d)", (IArg)handle, (IArg)waitId);

    Assert_isTrue((handle != NULL) && (waitId < handle->numTccs),
            (Assert_Id)NULL);

    ACPY3_INSTR_CALLHOOKFXN(((ACPY3_MoreEnv *)(handle->env))->extendedHooks,
            handle, ACPY3_INSTR_WAITLINKED_ENTER);
    /*
     * Wait for a channel only once. Set the 'pending' flag whenever new
     * transfer is submitted, then clear it when ACPY3_wait* is issued.
     */
    if (handle->transferPending == FALSE) {
        ACPY3_INSTR_CALLHOOKFXN(((ACPY3_MoreEnv *)(handle->env))->extendedHooks,
                handle, ACPY3_INSTR_WAITLINKED_EXIT);

        Log_print0(Diags_USER4, "[+4] ACPY3_waitLinked> No transfer pending");

        Log_print0(Diags_EXIT, "[+X] ACPY3_waitLinked> Exit");

        return;  /* already  waited since last start. */
    }

    if (waitId == (handle->numTccs - 1)) {

        Log_print0(Diags_USER4, "[+4] ACPY3_waitLinked> "
                "Waiting on the last transfer");

        ACPY3_wait(handle);
    }
    else {
        doTransfer(handle);
    }

    /*
     * Mark channel handle state to indicate pending transfer has completed
     * and 'wait' done
     */
    handle->transferPending = FALSE;

    ACPY3_INSTR_CALLHOOKFXN(((ACPY3_MoreEnv *)(handle->env))->extendedHooks,
            handle, ACPY3_INSTR_WAITLINKED_EXIT);

    Log_print0(Diags_EXIT, "[+X] ACPY3_waitLinked> Exit");
}
Ejemplo n.º 30
0
/*
 *  ======== Algorithm_removeGroup ========
 */
Void Algorithm_removeGroup(Int groupId)
{
    Log_print1(Diags_ENTRY, "[+E] Algorithm_removeGroup> Enter(groupId=%d)",
            (IArg)groupId);

    Log_print0(Diags_EXIT, "[+X] Algorithm_removeGroup> Exit");
}