Exemplo n.º 1
0
static ssize_t __ref thunderplug_endurance_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
{
	int val;
	sscanf(buf, "%d", &val);
#ifdef CONFIG_SCHED_HMP
	if(tplug_hp_style==1) {
#else
	if(tplug_hp_enabled) {
#endif
	switch(val) {
	case 0:
	case 1:
	case 2:
		if(endurance_level!=val &&
		   !(endurance_level > 1 && NR_CPUS < 4)) {
		endurance_level = val;
		offline_cpus();
		cpus_online_all();
	}
	break;
	default:
		pr_info("%s: invalid endurance level\n", THUNDERPLUG);
	break;
	}
	}
	else
	   pr_info("%s: per-core hotplug style is disabled, ignoring endurance mode values\n", THUNDERPLUG);

	return count;
}

static ssize_t thunderplug_sampling_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
{
    return sprintf(buf, "%d", sampling_time);
}

static ssize_t __ref thunderplug_sampling_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
{
	int val;
	sscanf(buf, "%d", &val);
	if(val > MIN_SAMLING_MS)
		sampling_time = val;

	return count;
}
static ssize_t __ref thunderplug_endurance_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
{
	int val;
	sscanf(buf, "%d", &val);
	switch(val) {
	case 0:
	case 1:
	case 2:
		if(endurance_level!=val) {
		endurance_level = val;
		offline_cpus();
		cpus_online_all();
	}
	break;
	default:
		pr_info("%s: invalid endurance level\n", THUNDERPLUG);
	break;
	}

	return count;
}
static void thunderplug_suspend(void)
{
	offline_cpus();

	pr_info("%s: suspend\n", THUNDERPLUG);
}
Exemplo n.º 4
0
static void v4tkplug_suspend(void)
{
    offline_cpus();

    pr_info("%s: suspend\n", V4TKPLUG);
}