#include <pass/config-parser.h>
#include "pass.h"
-#include "pass-gov.h"
#include "pass-pmqos.h"
#include "pass-hal.h"
#include "pass-rescon.h"
+extern int pass_step_governor(struct pass_resource *res);
+extern int pass_radiation_governor(struct pass_resource *res);
+static int __pass_governor_update(struct pass_resource *, enum pass_state);
+
#define PASS_DEFAULT_CPU_THRESHOLD 20
#define PASS_DEFAULT_LEVEL_UP_THRESHOLD 30
#define PASS_DEFAULT_LEVEL_DOWN_THRESHOLD 80
count = 0;
_E("cannot read the 'pass_cpu_stats' sysfs entry");
- pass_governor_update(res, PASS_OFF);
+ __pass_governor_update(res, PASS_OFF);
return FALSE;
}
pass_rescon_set_level(res, level);
} else {
_E("cannot call the governor function");
- pass_governor_update(res, PASS_OFF);
+ __pass_governor_update(res, PASS_OFF);
return FALSE;
}
(gpointer)res);
if (!cpuhp->gov_timeout_id) {
_E("cannot add core timer for governor");
- pass_governor_update(res, PASS_OFF);
+ __pass_governor_update(res, PASS_OFF);
return;
}
} else {
if (res->config_data.gov_timeout < 0) {
_E("invalid timeout value [%d]!", res->config_data.gov_timeout);
- pass_governor_update(res, PASS_OFF);
+ __pass_governor_update(res, PASS_OFF);
return -EINVAL;
}
cpuhp->state = PASS_OFF;
if (res->config_data.state == PASS_ON)
- pass_governor_update(res, PASS_ON);
+ __pass_governor_update(res, PASS_ON);
return 0;
}
* Stop timer and
* Restore the frequency and the number of online resources
*/
- pass_governor_update(res, PASS_OFF);
+ __pass_governor_update(res, PASS_OFF);
/* Free allocated memory */
for (i = 0; i < cpuhp->num_pass_cpu_stats; i++) {
return cpuhp->governor->exit(res);
}
-
-/*
- * pass_governor_update - Restart/Pause PASS governor
- * @res: the instance of struct pass_resource
- * @state: the state of governor
- */
-int pass_governor_update(struct pass_resource *res, enum pass_state state)
-{
- struct pass_cpuhp *cpuhp;
-
- if (!res)
- return -EINVAL;
-
- cpuhp = &res->cpuhp;
-
- if (!cpuhp->governor || !cpuhp->governor->update)
- return -EINVAL;
-
- return cpuhp->governor->update(res, state);
-}
+++ /dev/null
-/*
- * PASS (Power Aware System Service) Governor
- *
- * Copyright (c) 2012 - 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __PASS_GOV__
-#define __PASS_GOV__
-
-/* Init, exit and update the governor */
-int pass_governor_init(struct pass_resource *res);
-int pass_governor_exit(struct pass_resource *res);
-int pass_governor_update(struct pass_resource *res, enum pass_state state);
-
-/* Function for radiation and step governor */
-int pass_step_governor(struct pass_resource *res);
-int pass_radiation_governor(struct pass_resource *res);
-
-#endif /* __PASS_GOV__ */
#include "pass-parser.h"
#include "pass-pmqos.h"
#include "pass-hal.h"
-#include "pass-gov.h"
#define DBUS_CORE_I_START_HANDLER "handle_start"
#define DBUS_CORE_I_STOP_HANDLER "handle_stop"
#define PASS_CONF_PATH "/etc/pass/pass.conf"
#define PASS_DEFAULT_MIN_LEVEL 0
+extern int pass_governor_init(struct pass_resource *res);
+extern int pass_governor_exit(struct pass_resource *res);
+
static struct pass g_pass;
static SystemPassCore *g_gdbus_instance = NULL;