]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_energy_management.h
Upgrading FRSH trunk to D-AC2v2. Phase I: Moving FRSH-FOSA to FOSA
[frescor/frsh-include.git] / frsh_energy_management.h
index 306d6f87b1f4b16c63cc8041113a73eaaf990d35..b7287e1031b4579af655cee78fe291d9abe5bf60 100644 (file)
@@ -75,7 +75,6 @@
 
 #include <time.h>
 
-#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);
 
 /*@}*/