libdvfs
2.0
A light library to set CPU governor and freqency
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Macros
Pages
dvfs_core.h
Go to the documentation of this file.
1
/*
2
* libdvfs - A light library to set CPU governor and frequency
3
* Copyright (C) 2013-2014 Universite de Versailles
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#pragma once
20
21
#include <fcntl.h>
22
#include <semaphore.h>
23
#include <stdbool.h>
24
#include <stdio.h>
25
36
typedef
struct
{
37
unsigned
int
id
;
38
unsigned
int
nb_freqs
;
39
unsigned
int
*
freqs
;
40
41
FILE *
fd_setf
;
42
FILE *
fd_getf
;
43
44
char
init_gov[128];
45
unsigned
int
init_freq
;
46
47
sem_t *
sem
;
48
}
dvfs_core
;
49
68
int
dvfs_core_open(
dvfs_core
** ppCore,
unsigned
int
id
,
bool
seq);
69
79
int
dvfs_core_close(
dvfs_core
*core);
80
93
int
dvfs_core_get_gov(
const
dvfs_core
*core,
char
*buf,
size_t
buf_len);
94
106
int
dvfs_core_set_gov(
const
dvfs_core
*core,
const
char
*gov);
107
120
int
dvfs_core_set_freq(
const
dvfs_core
*core,
unsigned
int
freq);
121
137
int
dvfs_core_get_current_freq(
const
dvfs_core
*core,
unsigned
int
* pFreq);
138
150
int
dvfs_core_get_freq(
const
dvfs_core
*core,
unsigned
int
* pFreq,
unsigned
int
freq_id);
151
161
int
dvfs_core_get_nb_freqs (
const
dvfs_core
*core,
unsigned
int
* pNbFreq);
162
172
int
dvfs_core_get_id(
const
dvfs_core
* core,
unsigned
int
* pID);
Generated on Mon Aug 11 2014 16:39:12 for libdvfs by
1.8.1.2