static void pass_hotplug_set_online(struct pass_policy *policy,
unsigned int min_num)
{
- struct pass_resource *pass_res = to_pass_resource(policy);
+ struct pass_resource *res = to_pass_resource(policy);
struct pass_hotplug *hotplug = policy->hotplug;
int i;
if (min_num > hotplug->num_cpus)
min_num = hotplug->num_cpus;
- pass_set_online_min_num(pass_res, min_num);
+ pass_set_online_min_num(res, min_num);
for (i = 0 ; i < hotplug->num_cpus; i++) {
if (i < min_num) {
- pass_set_online_state(pass_res, hotplug->sequence[i],
+ pass_set_online_state(res, hotplug->sequence[i],
PASS_CPU_UP);
} else {
- pass_set_online_state(pass_res, hotplug->sequence[i],
+ pass_set_online_state(res, hotplug->sequence[i],
PASS_CPU_DOWN);
}
}
*/
static int pass_governor_change_level(struct pass_policy *policy, int new_level)
{
- struct pass_resource *pass_res = to_pass_resource(policy);
- struct pass_conf_data *cdata = &pass_res->cdata;
+ struct pass_resource *res = to_pass_resource(policy);
+ struct pass_conf_data *cdata = &res->cdata;
struct pass_table *table = policy->pass_table;
struct pass_hotplug *hotplug = policy->hotplug;
int curr_level = policy->curr_level;
/* Set maximum frequency */
if (limit_max_freq) {
- ret = pass_set_max_freq(pass_res, limit_max_freq);
+ ret = pass_set_max_freq(res, limit_max_freq);
if (ret < 0) {
_E("cannot set the maximum frequency of %s",
cdata->res_name);
/* Set minimum frequency */
if (limit_min_freq) {
- ret = pass_set_min_freq(pass_res, limit_min_freq);
+ ret = pass_set_min_freq(res, limit_min_freq);
if (ret < 0) {
_E("cannot set the minimum frequency of %s",
cdata->res_name);
/*
_I("[PASS %s] Level %4s '%d->%d' : 'max %d | min %d'Hz/'%d'Core\n",
- pass_res->cdata.res_name,
+ res->cdata.res_name,
(curr_level > new_level ? "DOWN" : "UP"),
curr_level, new_level,
limit_max_freq, limit_min_freq, limit_min_cpu);
#include "core/common.h"
-static struct pass_resource_dvfs_ops *get_dvfs(struct pass_resource *res, int id)
+static struct pass_resource_dvfs_ops *get_dvfs(struct pass_resource *res,
+ int res_type)
{
struct pass_resource_dvfs_ops *dvfs = NULL;
- switch (id) {
+ switch (res_type) {
case PASS_RESOURCE_CPU_ID:
dvfs = &(res->hal.cpu->dvfs);
break;
return dvfs;
}
-static struct pass_resource_tmu_ops *get_tmu(struct pass_resource *res, int id)
+static struct pass_resource_tmu_ops *get_tmu(struct pass_resource *res,
+ int res_type)
{
struct pass_resource_tmu_ops *tmu = NULL;
- switch (id) {
+ switch (res_type) {
case PASS_RESOURCE_CPU_ID:
tmu = &(res->hal.cpu->tmu);
break;
}
static struct pass_resource_hotplug_ops *get_hotplug(struct pass_resource *res,
- int id)
+ int res_type)
{
struct pass_resource_hotplug_ops *hotplug = NULL;
- switch (id) {
+ switch (res_type) {
case PASS_RESOURCE_CPU_ID:
hotplug = &(res->hal.cpu->hotplug);
break;
{
struct pass_resource_dvfs_ops *dvfs;
char *res_name;
- int id;
+ int res_type;
if (!res || !governor)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- dvfs = get_dvfs(res, id);
+ dvfs = get_dvfs(res, res_type);
if (!dvfs)
return -EINVAL;
{
struct pass_resource_dvfs_ops *dvfs;
char *res_name;
- int id;
+ int res_type;
if (!res)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- dvfs = get_dvfs(res, id);
+ dvfs = get_dvfs(res, res_type);
if (!dvfs)
return -EINVAL;
{
struct pass_resource_dvfs_ops *dvfs;
char *res_name;
- int id;
+ int res_type;
if (!res)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- dvfs = get_dvfs(res, id);
+ dvfs = get_dvfs(res, res_type);
if (!dvfs)
return -EINVAL;
{
struct pass_resource_dvfs_ops *dvfs;
char *res_name;
- int id;
+ int res_type;
if (!res)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- dvfs = get_dvfs(res, id);
+ dvfs = get_dvfs(res, res_type);
if (!dvfs)
return -EINVAL;
{
struct pass_resource_dvfs_ops *dvfs;
char *res_name;
- int id;
+ int res_type;
if (!res || freq <= 0)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- dvfs = get_dvfs(res, id);
+ dvfs = get_dvfs(res, res_type);
if (!dvfs)
return -EINVAL;
{
struct pass_resource_dvfs_ops *dvfs;
char *res_name;
- int id;
+ int res_type;
if (!res)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- dvfs = get_dvfs(res, id);
+ dvfs = get_dvfs(res, res_type);
if (!dvfs)
return -EINVAL;
{
struct pass_resource_dvfs_ops *dvfs;
char *res_name;
- int id;
+ int res_type;
if (!res || freq <= 0)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- dvfs = get_dvfs(res, id);
+ dvfs = get_dvfs(res, res_type);
if (!dvfs)
return -EINVAL;
{
struct pass_resource_dvfs_ops *dvfs;
char *res_name;
- int id;
+ int res_type;
if (!res)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- dvfs = get_dvfs(res, id);
+ dvfs = get_dvfs(res, res_type);
if (!dvfs)
return -EINVAL;
{
struct pass_resource_dvfs_ops *dvfs;
char *res_name;
- int id;
+ int res_type;
if (!res || up_threshold <= 0)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- dvfs = get_dvfs(res, id);
+ dvfs = get_dvfs(res, res_type);
if (!dvfs)
return -EINVAL;
{
struct pass_resource_hotplug_ops *hotplug;
char *res_name;
- int id;
+ int res_type;
if (!res)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- hotplug = get_hotplug(res, id);
+ hotplug = get_hotplug(res, res_type);
if (!hotplug)
return -EINVAL;
{
struct pass_resource_hotplug_ops *hotplug;
char *res_name;
- int id;
+ int res_type;
if (!res || on < 0)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- hotplug = get_hotplug(res, id);
+ hotplug = get_hotplug(res, res_type);
if (!hotplug)
return -EINVAL;
{
struct pass_resource_hotplug_ops *hotplug;
char *res_name;
- int id;
+ int res_type;
if (!res)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- hotplug = get_hotplug(res, id);
+ hotplug = get_hotplug(res, res_type);
if (!hotplug)
return -EINVAL;
{
struct pass_resource_hotplug_ops *hotplug;
char *res_name;
- int id;
+ int res_type;
if ((!res) || (num < 0))
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- hotplug = get_hotplug(res, id);
+ hotplug = get_hotplug(res, res_type);
if (!hotplug)
return -EINVAL;
{
struct pass_resource_hotplug_ops *hotplug;
char *res_name;
- int id;
+ int res_type;
if (!res)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- hotplug = get_hotplug(res, id);
+ hotplug = get_hotplug(res, res_type);
if (!hotplug)
return -EINVAL;
{
struct pass_resource_hotplug_ops *hotplug;
char *res_name;
- int id;
+ int res_type;
if ((!res) || (num < 0))
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- hotplug = get_hotplug(res, id);
+ hotplug = get_hotplug(res, res_type);
if (!hotplug)
return -EINVAL;
{
struct pass_resource_tmu_ops *tmu;
char *res_thermal_name;
- int id;
+ int res_type;
if (!res)
return -EINVAL;
* instead of res_name.
*/
res_thermal_name = res->cdata.res_thermal_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- tmu = get_tmu(res, id);
+ tmu = get_tmu(res, res_type);
if (!tmu)
return -EINVAL;
{
struct pass_resource_tmu_ops *tmu;
char *res_thermal_name;
- int id;
+ int res_type;
if (!res)
return -EINVAL;
* instead of res_name.
*/
res_thermal_name = res->cdata.res_thermal_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- tmu = get_tmu(res, id);
+ tmu = get_tmu(res, res_type);
if (!tmu)
return -EINVAL;
{
struct pass_resource_nonstandard *nonstandard = NULL;
char *res_name;
- int id;
+ int res_type;
if (!res)
return -EINVAL;
res_name = res->cdata.res_name;
- id = res->cdata.res_type;
+ res_type = res->cdata.res_type;
- switch (id) {
+ switch (res_type) {
case PASS_RESOURCE_NONSTANDARD_ID:
nonstandard = (res->hal.nonstandard);
break;
return nonstandard->set_pmqos_data(res_name, data);
}
-int pass_get_resource(struct pass_resource *pass_res)
+int pass_get_resource(struct pass_resource *res)
{
- struct pass_conf_data *cdata = &pass_res->cdata;
+ struct pass_conf_data *cdata = &res->cdata;
struct pass_resource_info *info;
char *res_name = cdata->res_name;
char name[BUFF_MAX];
switch (res_type) {
case PASS_RESOURCE_CPU_ID:
ret = info->open(res_name, info,
- (struct pass_resource_common**)&pass_res->hal.cpu);
+ (struct pass_resource_common**)&res->hal.cpu);
break;
case PASS_RESOURCE_BUS_ID:
ret = info->open(res_name, info,
- (struct pass_resource_common**)&pass_res->hal.bus);
+ (struct pass_resource_common**)&res->hal.bus);
break;
case PASS_RESOURCE_GPU_ID:
ret = info->open(res_name, info,
- (struct pass_resource_common**)&pass_res->hal.gpu);
+ (struct pass_resource_common**)&res->hal.gpu);
break;
case PASS_RESOURCE_NONSTANDARD_ID:
ret = info->open(res_name, info,
- (struct pass_resource_common**)&pass_res->hal.nonstandard);
+ (struct pass_resource_common**)&res->hal.nonstandard);
break;
};
return 0;
}
-int pass_put_resource(struct pass_resource *pass_res)
+int pass_put_resource(struct pass_resource *res)
{
- struct pass_conf_data *cdata = &pass_res->cdata;
+ struct pass_conf_data *cdata = &res->cdata;
struct pass_resource_common *common;
struct pass_resource_info *info;
char *res_name = cdata->res_name;
switch (res_type) {
case PASS_RESOURCE_CPU_ID:
- common = (struct pass_resource_common*)pass_res->hal.cpu;
- info = pass_res->hal.cpu->common.info;
+ common = (struct pass_resource_common*)res->hal.cpu;
+ info = res->hal.cpu->common.info;
ret = info->close(res_name, common);
break;
case PASS_RESOURCE_BUS_ID:
- common = (struct pass_resource_common*)pass_res->hal.bus;
- info = pass_res->hal.bus->common.info;
+ common = (struct pass_resource_common*)res->hal.bus;
+ info = res->hal.bus->common.info;
ret = info->close(res_name, common);
break;
case PASS_RESOURCE_GPU_ID:
- common = (struct pass_resource_common*)pass_res->hal.gpu;
- info = pass_res->hal.gpu->common.info;
+ common = (struct pass_resource_common*)res->hal.gpu;
+ info = res->hal.gpu->common.info;
ret = info->close(res_name, common);
break;
case PASS_RESOURCE_NONSTANDARD_ID:
- common = (struct pass_resource_common*)pass_res->hal.nonstandard;
- info = pass_res->hal.nonstandard->common.info;
+ common = (struct pass_resource_common*)res->hal.nonstandard;
+ info = res->hal.nonstandard->common.info;
ret = info->close(res_name, common);
default:
return -EINVAL;
int pass_get_cpu_stats(struct pass_policy *policy)
{
struct pass_cpu_stats *stats;
- struct pass_resource *pass_res;
+ struct pass_resource *res;
char str[BUFF_MAX];
FILE *fp_stats = NULL;
int i, j, ret;
return -EINVAL;
stats = policy->pass_cpu_stats;
- pass_res = to_pass_resource(policy);
+ res = to_pass_resource(policy);
if (!stats) {
_E("invalid parameter of structure pass_cpu_stats");
return -EINVAL;
}
- fp_stats = fopen(pass_res->cdata.path_load_table, "r");
+ fp_stats = fopen(res->cdata.path_load_table, "r");
if (fp_stats == NULL)
return -EIO;
return -EIO;
}
- for (j = 0; j < pass_res->cdata.num_cpus; j++) {
+ for (j = 0; j < res->cdata.num_cpus; j++) {
ret = fscanf(fp_stats, "%d", &stats[i].load[j]);
if (ret < 0) {
fclose(fp_stats);
* Functions for all H/W resources
*/
/* Get and put the h/w resource. */
-int pass_get_resource(struct pass_resource *pass_res);
-int pass_put_resource(struct pass_resource *pass_res);
+int pass_get_resource(struct pass_resource *res);
+int pass_put_resource(struct pass_resource *res);
/***
* Functions for CPU/BUS/GPU H/W resources
}
/*
- struct pass_resource *pass_res = to_pass_resource(policy);
+ struct pass_resource *res = to_pass_resource(policy);
int level;
_I("%s| policy->state : %d\n",
- pass_res->cdata.res_name, policy->state);
+ res->cdata.res_name, policy->state);
_I("%s| policy->gov_type : %d\n",
- pass_res->cdata.res_name, policy->gov_type);
+ res->cdata.res_name, policy->gov_type);
_I("%s| policy->num_levels : %d\n",
- pass_res->cdata.res_name, policy->num_levels);
+ res->cdata.res_name, policy->num_levels);
_I("%s| policy->min_level : %d\n",
- pass_res->cdata.res_name, policy->min_level);
+ res->cdata.res_name, policy->min_level);
_I("%s| policy->max_level : %d\n",
- pass_res->cdata.res_name, policy->max_level);
+ res->cdata.res_name, policy->max_level);
_I("%s| policy->num_pass_cpu_stats : %d\n",
- pass_res->cdata.res_name, policy->num_pass_cpu_stats);
+ res->cdata.res_name, policy->num_pass_cpu_stats);
_I("%s| policy->pass_cpu_threshold : %d\n",
- pass_res->cdata.res_name, policy->pass_cpu_threshold);
+ res->cdata.res_name, policy->pass_cpu_threshold);
_I("%s| policy->up_threshold : %d\n",
- pass_res->cdata.res_name, policy->up_threshold);
+ res->cdata.res_name, policy->up_threshold);
_I("%s| policy->down_threshold : %d\n",
- pass_res->cdata.res_name, policy->down_threshold);
+ res->cdata.res_name, policy->down_threshold);
_I("%s| policy->init_level : %d\n",
- pass_res->cdata.res_name, policy->init_level);
+ res->cdata.res_name, policy->init_level);
_I("%s| policy->level_up_threshold : %d\n",
- pass_res->cdata.res_name, policy->level_up_threshold);
+ res->cdata.res_name, policy->level_up_threshold);
_I("%s| policy->gov_timeout : %f\n",
- pass_res->cdata.res_name, policy->gov_timeout);
+ res->cdata.res_name, policy->gov_timeout);
for (level = 0; level < policy->num_levels; level++) {
_I("================================================\n");
if (policy->pass_table[level].limit_max_freq)
_I("%s| policy->pass_table[%d].limit_max_freq : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].limit_max_freq);
if (policy->pass_table[level].limit_min_freq)
_I("%s| policy->pass_table[%d].limit_min_freq : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].limit_min_freq);
if (policy->pass_table[level].limit_min_cpu)
_I("%s| policy->pass_table[%d].limit_min_cpu : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].limit_min_cpu);
if (policy->pass_table[level].gov_timeout)
_I("%s| policy->pass_table[%d].gov_timeout : %f\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].gov_timeout);
if (policy->pass_table[level].num_down_cond)
_I("%s| policy->pass_table[%d].num_down_cond : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].num_down_cond);
if (policy->pass_table[level].down_cond[0].freq)
_I("%s| policy->pass_table[%d].down_cond[0].freq : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].down_cond[0].freq);
if (policy->pass_table[level].down_cond[0].nr_running)
_I("%s| policy->pass_table[%d].down_cond[0].nr_running : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].down_cond[0].nr_running);
if (policy->pass_table[level].down_cond[0].busy_cpu)
_I("%s| policy->pass_table[%d].down_cond[0].busy_cpu : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].down_cond[0].busy_cpu);
if (policy->pass_table[level].num_up_cond)
_I("%s| policy->pass_table[%d].num_up_cond : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].num_up_cond);
if (policy->pass_table[level].up_cond[0].freq)
_I("%s| policy->pass_table[%d].up_cond[0].freq : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].up_cond[0].freq);
if (policy->pass_table[level].up_cond[0].nr_running)
_I("%s| policy->pass_table[%d].up_cond[0].nr_running : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].up_cond[0].nr_running);
if (policy->pass_table[level].up_cond[0].busy_cpu)
_I("%s| policy->pass_table[%d].up_cond[0].busy_cpu : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].up_cond[0].busy_cpu);
if (policy->pass_table[level].num_left_cond)
_I("%s| policy->pass_table[%d].num_left_cond : %d\n",
- pass_res->cdata.res_name, level,
+ res->cdata.res_name, level,
policy->pass_table[level].num_left_cond);
if (policy->pass_table[level].left_cond[0].freq)
_I("%s| policy->pass_table[%d].left_cond[0].freq : %d\n",
- pass_res->cdata.res_name, level, policy->pass_table[level].left_cond[0].freq);
+ res->cdata.res_name, level, policy->pass_table[level].left_cond[0].freq);
if (policy->pass_table[level].left_cond[0].nr_running)
_I("%s| policy->pass_table[%d].left_cond[0].nr_running : %d\n",
- pass_res->cdata.res_name, level, policy->pass_table[level].left_cond[0].nr_running);
+ res->cdata.res_name, level, policy->pass_table[level].left_cond[0].nr_running);
if (policy->pass_table[level].left_cond[0].busy_cpu)
_I("%s| policy->pass_table[%d].left_cond[0].busy_cpu : %d\n",
- pass_res->cdata.res_name, level, policy->pass_table[level].left_cond[0].busy_cpu);
+ res->cdata.res_name, level, policy->pass_table[level].left_cond[0].busy_cpu);
if (policy->pass_table[level].num_right_cond)
_I("%s| policy->pass_table[%d].num_right_cond : %d\n",
- pass_res->cdata.res_name, level, policy->pass_table[level].num_right_cond);
+ res->cdata.res_name, level, policy->pass_table[level].num_right_cond);
if (policy->pass_table[level].right_cond[0].freq)
_I("%s| policy->pass_table[%d].right_cond[0].freq : %d\n",
- pass_res->cdata.res_name, level, policy->pass_table[level].right_cond[0].freq);
+ res->cdata.res_name, level, policy->pass_table[level].right_cond[0].freq);
if (policy->pass_table[level].right_cond[0].nr_running)
_I("%s| policy->pass_table[%d].right_cond[0].nr_running : %d\n",
- pass_res->cdata.res_name, level, policy->pass_table[level].right_cond[0].nr_running);
+ res->cdata.res_name, level, policy->pass_table[level].right_cond[0].nr_running);
if (policy->pass_table[level].right_cond[0].busy_cpu)
_I("%s| policy->pass_table[%d].right_cond[0].busy_cpu : %d\n",
- pass_res->cdata.res_name, level, policy->pass_table[level].right_cond[0].busy_cpu);
+ res->cdata.res_name, level, policy->pass_table[level].right_cond[0].busy_cpu);
}
*/
} else if (MATCH(result->name, "pass_path_load_table")) {
snprintf(conf_data->path_load_table, PASS_NAME_LEN, "%s", result->value);
} else if (MATCH(result->name, "pass_first_cpu")) {
- int pass_res_type = conf_data->res_type;
+ int res_type = conf_data->res_type;
- switch (pass_res_type) {
+ switch (res_type) {
case PASS_RESOURCE_CPU_ID:
conf_data->cpu = atoi(result->value);
break;
return -EINVAL;
};
} else if (MATCH(result->name, "pass_num_cpus")) {
- int pass_res_type = conf_data->res_type;
+ int res_type = conf_data->res_type;
- switch (pass_res_type) {
+ switch (res_type) {
case PASS_RESOURCE_CPU_ID:
conf_data->num_cpus = atoi(result->value);
break;
#define MAX(a,b) (a > b ? a : b)
int pass_notifier_pmqos_func(struct pass_policy *policy, void *data)
{
- struct pass_resource *pass_res;
+ struct pass_resource *res;
struct pass_conf_data *cdata;
struct pass_scenario_policy *scenario;
struct pass_scenario *scn = NULL;
if (!is_pmqos_enabled(policy))
return 0;
- pass_res = to_pass_resource(policy);
- cdata = &pass_res->cdata;
+ res = to_pass_resource(policy);
+ cdata = &res->cdata;
scenario = &policy->scenario;
/*
* PASS interface (Init/Exit) *
******************************************************/
-static int pass_init_resource(struct pass_resource *pass_res)
+static int pass_init_resource(struct pass_resource *res)
{
- struct pass_policy *policy = &pass_res->policy;
+ struct pass_policy *policy = &res->policy;
int max_freq = 0;
int ret;
int i;
/*
* Initialize pass-table by parsing pass.conf
*/
- ret = pass_get_table(policy, pass_res->cdata.path_conf_file);
+ ret = pass_get_table(policy, res->cdata.path_conf_file);
if (ret < 0) {
- _E("cannot parse %s\n", pass_res->cdata.path_conf_file);
+ _E("cannot parse %s\n", res->cdata.path_conf_file);
return -1;
}
for (i = 0; i < policy->num_pass_cpu_stats; i++) {
policy->pass_cpu_stats[i].load =
- calloc(pass_res->cdata.num_cpus, sizeof(unsigned int));
+ calloc(res->cdata.num_cpus, sizeof(unsigned int));
policy->pass_cpu_stats[i].nr_running =
- calloc(pass_res->cdata.num_cpus, sizeof(unsigned int));
+ calloc(res->cdata.num_cpus, sizeof(unsigned int));
policy->pass_cpu_stats[i].runnable_load =
- calloc(pass_res->cdata.num_cpus, sizeof(unsigned int));
+ calloc(res->cdata.num_cpus, sizeof(unsigned int));
}
/* Get the instance of PASS governor */
/* Get the instance of PASS hotplug */
policy->hotplug = pass_get_hotplug(policy, policy->gov_type);
if (policy->hotplug) {
- policy->hotplug->sequence = calloc(pass_res->cdata.num_cpus,
+ policy->hotplug->sequence = calloc(res->cdata.num_cpus,
sizeof(int));
- for (i = 0; i < pass_res->cdata.num_cpus; i++)
- policy->hotplug->sequence[i] = i + pass_res->cdata.cpu;
+ for (i = 0; i < res->cdata.num_cpus; i++)
+ policy->hotplug->sequence[i] = i + res->cdata.cpu;
- policy->hotplug->num_cpus = pass_res->cdata.num_cpus;
+ policy->hotplug->num_cpus = res->cdata.num_cpus;
}
ret = pass_governor_init(policy);
return 0;
}
-static int pass_exit_resource(struct pass_resource *pass_res)
+static int pass_exit_resource(struct pass_resource *res)
{
- struct pass_policy *policy = &pass_res->policy;
+ struct pass_policy *policy = &res->policy;
int ret;
pass_put_table(policy);
/* Initialize pass resources data based on parsed configuration */
for (i = 0; i < g_pass.num_resources; i++) {
- struct pass_resource *pass_res = &g_pass.res[i];
+ struct pass_resource *res = &g_pass.res[i];
struct pass_conf_data *cdata = &g_pass.res[i].cdata;
- ret = pass_get_resource(pass_res);
+ ret = pass_get_resource(res);
if (ret < -1) {
_E("Cannot get the pass '%s' resource (%d)\n",
cdata->res_name, ret);
continue;
}
- ret = pass_init_resource(pass_res);
+ ret = pass_init_resource(res);
if (ret < 0) {
_E("Cannot initialize the pass '%s' resource (%d)\n",
cdata->res_name, ret);
- ret = pass_put_resource(pass_res);
+ ret = pass_put_resource(res);
if (ret < 0)
_E("Cannot put the pass '%s' resource (%d)\n",
cdata->res_name, ret);
int i, ret = 0;
for (i = 0; i < g_pass.num_resources; i++) {
- struct pass_resource *pass_res = &g_pass.res[i];
+ struct pass_resource *res = &g_pass.res[i];
struct pass_conf_data *cdata = &g_pass.res[i].cdata;
- ret = pass_exit_resource(pass_res);
+ ret = pass_exit_resource(res);
if (ret < 0)
_E("Cannot exit the pass '%s' resource (%d)\n",
cdata->res_name, ret);
- ret = pass_put_resource(pass_res);
+ ret = pass_put_resource(res);
if (ret < 0) {
_E("Cannot put the pass '%s' resource (%d)\n",
cdata->res_name, ret);