예제 #1
0
파일: sysfs.c 프로젝트: 020gzh/linux
/*
 * Returns:
 *    1  if disabled
 *    0  if enabled
 *    -1 if idlestate is not available
 *    -2 if disabling is not supported by the kernel
 */
int sysfs_is_idlestate_disabled(unsigned int cpu,
				unsigned int idlestate)
{
	if (sysfs_get_idlestate_count(cpu) <= idlestate)
		return -1;

	if (!sysfs_idlestate_file_exists(cpu, idlestate,
				 idlestate_value_files[IDLESTATE_DISABLE]))
		return -2;
	return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_DISABLE);
}
예제 #2
0
unsigned long long sysfs_get_idlestate_time(unsigned int cpu,
					unsigned int idlestate)
{
	return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_TIME);
}
예제 #3
0
unsigned long sysfs_get_idlestate_usage(unsigned int cpu,
					unsigned int idlestate)
{
	return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_USAGE);
}
예제 #4
0
unsigned long sysfs_get_idlestate_latency(unsigned int cpu,
					unsigned int idlestate)
{
	return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_LATENCY);
}