X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/frsh-include.git/blobdiff_plain/bea975db4dc83e2855aff6ca12a7b04b006fa63c..17fd882ac12809c6f50c3685276200421a3ab559:/frsh_energy_management.h diff --git a/frsh_energy_management.h b/frsh_energy_management.h index 306d6f8..b7287e1 100644 --- a/frsh_energy_management.h +++ b/frsh_energy_management.h @@ -75,7 +75,6 @@ #include -#include "frsh_fosa.h" #include "frsh_energy_management_types.h" #include "frsh_core_types.h" @@ -216,26 +215,68 @@ int frsh_contract_get_utilizations_pow(const frsh_utilization_set_pow_t *utiliza /** * frsh_resource_set_power_level() * - * Set the powerlevel of the CPU given by resource_id. We assume - * resource_type = FRSH_RT_PROCESSOR. + * Set the power level of the resource identified by the supplied type and id. + * + * @note + * Only implementation for resource_type = FRSH_RT_PROCESSOR is mandatory, + * if the energy management module is present. **/ -int frsh_resource_set_power_level(frsh_resource_id_t resource_id, - int power_level); +int frsh_resource_set_power_level(frsh_resource_type_t resource_type, + frsh_resource_id_t resource_id, + frsh_power_level_t power_level); +/** + * frsh_resource_get_power_level() + * + * Get version of the previous function. + **/ +int frsh_resource_get_power_level(frsh_resource_type_t resource_type, + frsh_resource_id_t resource_id, + frsh_power_level_t *power_level); +/** + * frsh_resource_get_num_power_levels() + * + * Get the number of power levels available for the resource identified + * by the supplied type and id. + * + * @note + * The power levels that may be used, for the identified resource, + * in other functions through a power_level_t type, range from 0 + * to the value returned by this function minus 1. + * + * @note + * The power level 0 identifies the configuration with the maximum + * performance (and energy consumption) for the resource. + * + * @note + * Only implementation for resource_type = FRSH_RT_PROCESSOR is mandatory, + * if the energy management module is present. + */ +int frsh_resource_get_num_power_levels(frsh_resource_type_t resource_type, + frsh_resource_id_t resource_id, + frsh_power_level_t *num_power_levels); ////////////////////////////////////////////////////////////////////// -// BATTERY DURATION AND MANAGING POWER LEVELS +// BATTERY EXPIRATION AND MANAGING POWER LEVELS ////////////////////////////////////////////////////////////////////// +/* /\** IS THIS NEEDED AT ALL ? I GUESS NOT - COMMENTED */ +/* * frsh_resource_get_battery_expiration() */ +/* * */ +/* * Get the foreseen expiration time of the battery for the resource */ +/* * identified by the supplied type and id. */ +/* * */ +/* int frsh_battery_get_expiration(frsh_resource_type_t resource_type, */ +/* frsh_resource_id_t resource_id, */ +/* frsh_rel_time_t *expiration); */ + /** - * frsh_resource_get_battery_duration() + * frsh_battery_get_expiration() * - * Get the remaining battery duration of the CPU given by resource_id. - * We assume resource_type = FRSH_RT_PROCESSOR. + * Get the foreseen expiration time of the system battery(ies). **/ -int frsh_resource_get_battery_duration(frsh_resource_id_t resource_id, - struct timespec *duration); +int frsh_battery_get_expiration(struct timespec *expiration); /*@}*/