Structures and functions related to DVFS units (group of cores running at the same frequency).
More...
Go to the source code of this file.
|
| int | dvfs_unit_open (dvfs_unit **ppUnit, unsigned int nb_cores, dvfs_core **cores, unsigned int unit_id) |
| | Creates a new DVFS unit in charge of the provided cores. More...
|
| |
| int | dvfs_unit_close (dvfs_unit *unit) |
| | Frees the memory associated to a DVFS unit and restore their DVFS state. More...
|
| |
| int | dvfs_unit_set_gov (const dvfs_unit *unit, const char *gov) |
| | Sets a governor on all the cores we are in charge of. More...
|
| |
| int | dvfs_unit_set_freq (const dvfs_unit *unit, unsigned int freq) |
| | Sets the given frequency on all the unit cores. More...
|
| |
| int | dvfs_unit_get_nb_cores (const dvfs_unit *unit, unsigned int *pNbCores) |
| | Gets te number of cores available in this DVFS unit. More...
|
| |
| int | dvfs_unit_get_core (const dvfs_unit *unit, dvfs_core **ppCore, unsigned int id) |
| | Gets the core with the given id if it is part of this DVFS unit, or NULL otherwise. More...
|
| |
| int | dvfs_unit_get_freq (const dvfs_unit *unit, unsigned int *pFreq) |
| | Gets the frequency currently set for the current DVFS unit. More...
|
| |
| int | dvfs_unit_get_id (const dvfs_unit *unit, unsigned int *pID) |
| | Returns the index of the considered DVFS unit as stored in the corresponding DVFS context structure array. More...
|
| |
Structures and functions related to DVFS units (group of cores running at the same frequency).
- See also
- dvfs_core
Frees the memory associated to a DVFS unit and restore their DVFS state.
You are not supposed to directly call this function; use rather dvfs_stop(). It calls
- See also
- dvfs_core_close() on every
-
dvfs_core avaiable in this unit.
- Parameters
-
| unit | The DVFS unit to close. |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if unit or cores are NULL. |
- See also
- dvfs_unit_open()
Gets the core with the given id if it is part of this DVFS unit, or NULL otherwise.
- Parameters
-
| unit | The DVFS unit. |
| ppCore | the |
- See also
- dvfs_core identified by
id
- Parameters
-
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if unit or ppCore are NULL. |
| DVFS_ERROR_INVALID_CORE_ID | the id did not match any core. |
| int dvfs_unit_get_freq |
( |
const dvfs_unit * |
unit, |
|
|
unsigned int * |
pFreq |
|
) |
| |
Gets the frequency currently set for the current DVFS unit.
- Parameters
-
| unit | The DVFS unit. |
| pFreq | the frequency currently set for the current DVFS unit. |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if unit or pFreq are NULL. |
| int dvfs_unit_get_id |
( |
const dvfs_unit * |
unit, |
|
|
unsigned int * |
pID |
|
) |
| |
Returns the index of the considered DVFS unit as stored in the corresponding DVFS context structure array.
- Parameters
-
| unit | The DVFS unit. |
| pID | the index of this DVFS unit. |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if unit or pID are NULL. |
| int dvfs_unit_get_nb_cores |
( |
const dvfs_unit * |
unit, |
|
|
unsigned int * |
pNbCores |
|
) |
| |
Gets te number of cores available in this DVFS unit.
- Parameters
-
| unit | The DVFS unit. |
| pNbCores | Will be filled with the number of cores. |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if unit or ppCore are NULL. |
| int dvfs_unit_open |
( |
dvfs_unit ** |
ppUnit, |
|
|
unsigned int |
nb_cores, |
|
|
dvfs_core ** |
cores, |
|
|
unsigned int |
unit_id |
|
) |
| |
Creates a new DVFS unit in charge of the provided cores.
You are not supposed to directly call this function, use rather dvfs_start().
- Parameters
-
| ppUnit | pointer where the DVFS Unit instance will be placed |
| nb_cores | The number of cores the unit handles. |
| cores | The array of cores to handle. The array itself is freed when calling dvfs_unit_close(). |
| unit_id | the ID of this DVFS unit. |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if ppUnit or cores are NULL. |
| DVFS_ERROR_MEM_ALLOC_FAILED | if memory allocation failed. |
- See also
- dvfs_unit_close()
-
dvfs_core
| int dvfs_unit_set_freq |
( |
const dvfs_unit * |
unit, |
|
|
unsigned int |
freq |
|
) |
| |
Sets the given frequency on all the unit cores.
The effect is unknown if the current governor is not "userspace".
- Parameters
-
| unit | The DVFS unit. |
| freq | The frequency to set. |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if unit is NULL. |
| int dvfs_unit_set_gov |
( |
const dvfs_unit * |
unit, |
|
|
const char * |
gov |
|
) |
| |
Sets a governor on all the cores we are in charge of.
- Parameters
-
| unit | The DVFS unit. |
| gov | The governor to set. |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if unit or gov are NULL. |