module/traffic_cop/src/mod_traffic_cop.c
static int tcop_update(struct perf_plugins_perf_update *data)
{
    uint32_t domain_idx;
    struct mod_tcop_domain_ctx *domain_ctx;
    /*
     * Get the performance element id from the sub-element provided in the
     * function argument.
     */
    fwk_id_t perf_id = FWK_ID_ELEMENT(
        FWK_MODULE_IDX_DVFS, fwk_id_get_element_idx(data->domain_id));

    for (domain_idx = 0; domain_idx < tcop_ctx.tcop_domain_count;
         domain_idx++) {
        if (fwk_id_is_equal(
                tcop_ctx.domain_ctx[domain_idx].domain_config->perf_id,
                perf_id)) {
            break;
        }
    }

    if (domain_idx == tcop_ctx.tcop_domain_count) {
        return FWK_E_PARAM;
    }

    domain_ctx = &tcop_ctx.domain_ctx[domain_idx];

    /* Keep the last calculated performance limits. */
    data->adj_max_limit[0] = domain_ctx->perf_limit;

    return FWK_SUCCESS;
}
/*
 * Update function will be called periodically. It needs to maintain the
 * performance limits.
 */
Update function will be called periodically. It needs to maintain the
performance limits.
Update function will be called periodically . It needs to maintain the performance limits .
static int tcop_update(struct perf_plugins_perf_update *data)
{
    uint32_t domain_idx;
    struct mod_tcop_domain_ctx *domain_ctx;
    fwk_id_t perf_id = FWK_ID_ELEMENT(
        FWK_MODULE_IDX_DVFS, fwk_id_get_element_idx(data->domain_id));
    for (domain_idx = 0; domain_idx < tcop_ctx.tcop_domain_count;
         domain_idx++) {
        if (fwk_id_is_equal(
                tcop_ctx.domain_ctx[domain_idx].domain_config->perf_id,
                perf_id)) {
            break;
        }
    }
    if (domain_idx == tcop_ctx.tcop_domain_count) {
        return FWK_E_PARAM;
    }
    domain_ctx = &tcop_ctx.domain_ctx[domain_idx];
    data->adj_max_limit[0] = domain_ctx->perf_limit;
    return FWK_SUCCESS;
}
static int tcop_update ( struct perf_plugins_perf_update * data ) { uint32_t domain_idx ; struct mod_tcop_domain_ctx * domain_ctx ; fwk_id_t perf_id = FWK_ID_ELEMENT ( FWK_MODULE_IDX_DVFS , fwk_id_get_element_idx ( data -> domain_id ) ) ; for ( domain_idx = 0 ; domain_idx < tcop_ctx . tcop_domain_count ; domain_idx ++ ) { if ( fwk_id_is_equal ( tcop_ctx . domain_ctx [ domain_idx ] . domain_config -> perf_id , perf_id ) ) { break ; } } if ( domain_idx == tcop_ctx . tcop_domain_count ) { return FWK_E_PARAM ; } domain_ctx = & tcop_ctx . domain_ctx [ domain_idx ] ; data -> adj_max_limit [ 0 ] = domain_ctx -> perf_limit ; return FWK_SUCCESS ; }
Update function will be called periodically.
Update function will be called periodically .
/*
     * Get the performance element id from the sub-element provided in the
     * function argument.
     */ /* Keep the last calculated performance limits. */