Ejemplo n.º 1
0
/*--------------------------------------------------------------------------*/
xme_status_t
xme_core_exec_descriptorTable_getTaskDescriptor
(
    xme_core_component_t componentId,
    xme_core_component_functionId_t functionId,
    xme_core_exec_taskDescriptor_t** taskDesc
)
{
        xme_core_exec_taskDescriptor_t* schedRecord = NULL;
        bool found=false;

        /* We only deal with an initialized component */
        if (!xme_core_exec_isInitialized())
                return XME_STATUS_UNEXPECTED;

        XME_LOG(XME_LOG_DEBUG,
            MODULE_ACRONYM "getTaskDescriptor(): (%d:%d)\n", componentId, functionId);

        xme_hal_sync_enterCriticalSection(taskDescriptorsMutex);
        {
            XME_HAL_TABLE_ITERATE_BEGIN(taskDescriptorsTable, uint32_t, i, xme_core_exec_taskDescriptor_t, schedRecord1);
            {
                if((schedRecord1->wrapper->componentId == componentId) && (schedRecord1->wrapper->functionId == functionId))
                {
                    schedRecord=schedRecord1;
                    found=true;
                    break;
                }
            }
            XME_HAL_TABLE_ITERATE_END();
        }
        xme_hal_sync_leaveCriticalSection(taskDescriptorsMutex);

        XME_LOG(XME_LOG_DEBUG,
            MODULE_ACRONYM "/getTaskDescriptor(): (%d:%d)\n", componentId, functionId);

        if(found)
        {
            *taskDesc = schedRecord;
            return XME_STATUS_SUCCESS;
        }
        else
        {
            XME_LOG(XME_LOG_VERBOSE,
                MODULE_ACRONYM "[%d|%d] not found in task table!\n", componentId, functionId);
            *taskDesc = NULL;
            return XME_STATUS_NOT_FOUND;
        }
}
Ejemplo n.º 2
0
/*--------------------------------------------------------------------------*/
xme_status_t
xme_core_exec_descriptorTable_forEach
(
    void (*fun)(xme_core_exec_taskDescriptor_t*)
)
{
    XME_CHECK_MSG( fun!=NULL,
        XME_STATUS_INVALID_PARAMETER,
        XME_LOG_WARNING,
        MODULE_ACRONYM "Callback function is NULL!\n");

    XME_HAL_TABLE_ITERATE_BEGIN(taskDescriptorsTable,
                                   int, rowHandle,
                                   xme_core_exec_taskDescriptor_t, curTask);
           fun(curTask);
       XME_HAL_TABLE_ITERATE_END();
       return XME_STATUS_SUCCESS;
}
Ejemplo n.º 3
0
void
xme_core_directory_nodeRegistryController_fini(void)
{
    // Free all memory
    XME_HAL_TABLE_ITERATE_BEGIN
    (
        xme_core_directory_nodeRegistryController_nodeTable,
        xme_hal_table_rowHandle_t,
        handle,
        xme_core_node_nodeData_t,
        nodeItem
    );
    {
        XME_HAL_TABLE_FINI(nodeItem->interfaces);
    }
    XME_HAL_TABLE_ITERATE_END();

    XME_HAL_TABLE_FINI(xme_core_directory_nodeRegistryController_nodeTable);
}