summaryrefslogtreecommitdiff
path: root/hald/linux/addons/addon-cpufreq-userspace.h
blob: 3a67f82cedc492b49eb9535c0fb90ffafb65bf97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/***************************************************************************
 *                                                                         *
 *                      addon-cpufreq-userspace.h                          *
 *                                                                         *
 *              Copyright (C) 2006 SUSE Linux Products GmbH                *
 *                                                                         *
 *               Author(s): Holger Macht <hmacht@suse.de>                  *
 *                                                                         *
 * This program is free software; you can redistribute it and/or modify it *
 * under the terms of the GNU General Public License as published by the   *
 * Free Software Foundation; either version 2 of the License, or (at you   *
 * option) any later version.                                              *
 *                                                                         *
 * This program is distributed in the hope that it will be useful, but     *
 * WITHOUT ANY WARRANTY; without even the implied warranty of              *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       *
 * General Public License for more details.                                *
 *                                                                         *
 * You should have received a copy of the GNU General Public License along *
 * with this program; if not, write to the Free Software Foundation, Inc., *
 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA                  *
 *                                                                         *
 ***************************************************************************/

#ifndef ADDON_CPUFREQ_USERSPACE_H
#define ADDON_CPUFREQ_USERSPACE_H

#define USERSPACE_STRING	"userspace"
#define USERSPACE_POLL_INTERVAL	333

struct userspace_interface {
	int	base_cpu;
	int	last_step;
	int	current_speed;
	int	g_source_id;
	int	prev_cpu_load;
	GSList	*cpus;
	GArray	*speeds_kHz;
	GArray	*demotion;
};

gboolean	userspace_adjust_speeds		(GSList *cpufreq_objs);

gboolean	userspace_init			(struct userspace_interface *iface,
						 GSList *cpus);

gboolean	userspace_set_performance	(void *data,
						 int up_threshold);

int		userspace_get_performance	(void);

gboolean	userspace_set_consider_nice	(void *data,
						 gboolean consider);

gboolean	userspace_get_consider_nice	(void);

void		userspace_free			(void *data);

void		free_cpu_load_data		(void);

#endif /* ADDON_CPUFREQ_USERSPACE_H */