CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(pass-hal-tw2 C)
+PROJECT(pass-hal-tw3 C)
SET(CMAKE_VERBOSE_MAKEFILE ON)
+++ /dev/null
-<manifest>
- <request>
- <domain name="_"/>
- </request>
-</manifest>
+++ /dev/null
-%define version 1.0.0
-%define release 1
-
-Name: pass-hal-tw2
-Summary: PASS hal for tw2
-Version: %{version}
-Release: %{release}
-Group: System/Hardware Adaptation
-License: Apache-2.0
-Source0: %{name}-%{version}.tar.gz
-Source1: %{name}.manifest
-
-ExclusiveArch: %{arm}
-
-Requires(post): /sbin/ldconfig
-Requires(post): /bin/systemctl
-Requires(post): security-config
-Requires(postun): /sbin/ldconfig
-Requires(postun): /bin/systemctl
-Requires: pass >= 1.0.0
-BuildRequires: cmake
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(pass-hal-devel)
-
-%description
-PASS hal for tw2
-
-%prep
-%setup -q
-cp %{SOURCE1} .
-
-%build
-%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DHAL_VERSION=%{version}.%{release}
-
-make %{?jobs:-j%jobs}
-
-%install
-rm -rf %{buildroot}
-
-%make_install
-
-%post
-/sbin/ldconfig
-systemd-tmpfiles %{_libdir}/tmpfiles.d/pass-hal.conf --create
-if [ -f %{_unitdir}/pass.service ]; then
- systemctl try-restart pass.service
-fi
-
-%postun
-/sbin/ldconfig
-if [ -f %{_unitdir}/pass.service ]; then
- systemctl try-restart pass.service
-fi
-
-%files
-%manifest %{name}.manifest
-%{_libdir}/pass/*.so
-%{_libdir}/tmpfiles.d/pass-hal.conf
-%config %{_sysconfdir}/pass/pass.conf
-%config %{_sysconfdir}/pass/pass-resource0.conf
-%config %{_sysconfdir}/pass/pass-resource1.conf
-%config %{_sysconfdir}/pass/pass-resource2.conf
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+%define version 1.0.0
+%define release 1
+
+Name: pass-hal-tw3
+Summary: PASS hal for tw3
+Version: %{version}
+Release: %{release}
+Group: System/Hardware Adaptation
+License: Apache-2.0
+Source0: %{name}-%{version}.tar.gz
+Source1: %{name}.manifest
+
+ExclusiveArch: %{arm}
+
+Requires(post): /sbin/ldconfig
+Requires(post): /bin/systemctl
+Requires(post): security-config
+Requires(postun): /sbin/ldconfig
+Requires(postun): /bin/systemctl
+Requires: pass >= 1.0.0
+BuildRequires: cmake
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(pass-hal-devel)
+
+%description
+PASS hal for tw3
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+
+%build
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DHAL_VERSION=%{version}.%{release}
+
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+
+%make_install
+
+%post
+/sbin/ldconfig
+systemd-tmpfiles %{_libdir}/tmpfiles.d/pass-hal.conf --create
+if [ -f %{_unitdir}/pass.service ]; then
+ systemctl try-restart pass.service
+fi
+
+%postun
+/sbin/ldconfig
+if [ -f %{_unitdir}/pass.service ]; then
+ systemctl try-restart pass.service
+fi
+
+%files
+%manifest %{name}.manifest
+%{_libdir}/pass/*.so
+%{_libdir}/tmpfiles.d/pass-hal.conf
+%config %{_sysconfdir}/pass/pass.conf
+%config %{_sysconfdir}/pass/pass-resource0.conf
+%config %{_sysconfdir}/pass/pass-resource1.conf
+%config %{_sysconfdir}/pass/pass-resource2.conf
#define CPUFREQ_PMQOS_REQUEST_UNLOCK -1
-static int tw2_dvfs_get_curr_freq(char *res_name)
+static int tw3_dvfs_get_curr_freq(char *res_name)
{
char path[PATH_MAX];
int freq, ret;
return freq;
}
-static int tw2_dvfs_get_min_freq(char *res_name)
+static int tw3_dvfs_get_min_freq(char *res_name)
{
char path[PATH_MAX];
int min_freq;
return min_freq;
}
-static int tw2_dvfs_set_min_freq(char *res_name, int freq)
+static int tw3_dvfs_set_min_freq(char *res_name, int freq)
{
char path[PATH_MAX];
int ret;
return 0;
}
-static int tw2_dvfs_get_max_freq(char *res_name)
+static int tw3_dvfs_get_max_freq(char *res_name)
{
char path[PATH_MAX];
int max_freq;
return max_freq;
}
-static int tw2_dvfs_set_max_freq(char *res_name, int freq)
+static int tw3_dvfs_set_max_freq(char *res_name, int freq)
{
char path[PATH_MAX];
int ret;
return 0;
}
-static struct pass_resource_dvfs_ops tw2_cpu_dvfs_ops = {
+static struct pass_resource_dvfs_ops tw3_cpu_dvfs_ops = {
.get_curr_governor = NULL,
.set_curr_governor = NULL,
.get_avail_governor = NULL,
- .get_curr_freq = tw2_dvfs_get_curr_freq,
- .get_min_freq = tw2_dvfs_get_min_freq,
- .set_min_freq = tw2_dvfs_set_min_freq,
- .get_max_freq = tw2_dvfs_get_max_freq,
- .set_max_freq = tw2_dvfs_set_max_freq,
+ .get_curr_freq = tw3_dvfs_get_curr_freq,
+ .get_min_freq = tw3_dvfs_get_min_freq,
+ .set_min_freq = tw3_dvfs_set_min_freq,
+ .get_max_freq = tw3_dvfs_get_max_freq,
+ .set_max_freq = tw3_dvfs_set_max_freq,
.get_up_threshold = NULL,
.set_up_threshold = NULL,
.get_load_table = NULL,
};
-static int tw2_hotplug_get_online_min_num(char *res_name)
+static int tw3_hotplug_get_online_min_num(char *res_name)
{
char path[PATH_MAX];
int online_min_num;
return online_min_num;
}
-static int tw2_hotplug_set_online_min_num(char *res_name, int num)
+static int tw3_hotplug_set_online_min_num(char *res_name, int num)
{
char path[PATH_MAX];
int ret;
return 0;
}
-static int tw2_hotplug_get_online_max_num(char *res_name)
+static int tw3_hotplug_get_online_max_num(char *res_name)
{
char path[PATH_MAX];
int online_max_num;
return online_max_num;
}
-static int tw2_hotplug_set_online_max_num(char *res_name, int num)
+static int tw3_hotplug_set_online_max_num(char *res_name, int num)
{
char path[PATH_MAX];
int ret;
return 0;
}
-static struct pass_resource_hotplug_ops tw2_cpu_hotplug_ops = {
+static struct pass_resource_hotplug_ops tw3_cpu_hotplug_ops = {
.get_online_state = NULL,
.set_online_state = NULL,
- .get_online_min_num = tw2_hotplug_get_online_min_num,
- .set_online_min_num = tw2_hotplug_set_online_min_num,
- .get_online_max_num = tw2_hotplug_get_online_max_num,
- .set_online_max_num = tw2_hotplug_set_online_max_num,
+ .get_online_min_num = tw3_hotplug_get_online_min_num,
+ .set_online_min_num = tw3_hotplug_set_online_min_num,
+ .get_online_max_num = tw3_hotplug_get_online_max_num,
+ .set_online_max_num = tw3_hotplug_set_online_max_num,
};
-static int tw2_cpu_get_temp(char *res_thermal_name)
+static int tw3_cpu_get_temp(char *res_thermal_name)
{
char path[PATH_MAX + 1];
char buf[PATH_MAX + 1];
return temp;
}
-static struct pass_resource_tmu_ops tw2_cpu_tmu_ops = {
- .get_temp = tw2_cpu_get_temp,
+static struct pass_resource_tmu_ops tw3_cpu_tmu_ops = {
+ .get_temp = tw3_cpu_get_temp,
.get_policy = NULL,
};
-static int tw2_cpu_open(char *res_name, struct pass_resource_info *info,
+static int tw3_cpu_open(char *res_name, struct pass_resource_info *info,
struct pass_resource_common **common)
{
struct pass_resource_cpu *cpu_res;
return -ENOMEM;
cpu_res->common.info = info;
- cpu_res->dvfs = tw2_cpu_dvfs_ops;
- cpu_res->hotplug = tw2_cpu_hotplug_ops;
- cpu_res->tmu = tw2_cpu_tmu_ops;
+ cpu_res->dvfs = tw3_cpu_dvfs_ops;
+ cpu_res->hotplug = tw3_cpu_hotplug_ops;
+ cpu_res->tmu = tw3_cpu_tmu_ops;
*common = (struct pass_resource_common *) cpu_res;
return 0;
}
-static int tw2_cpu_close(char *res_name, struct pass_resource_common *common)
+static int tw3_cpu_close(char *res_name, struct pass_resource_common *common)
{
struct pass_resource_cpu *cpu_res;
int ret = 0;
cpu_res = (struct pass_resource_cpu *) common;
/*
- * tw2 has weird pmqos sysfs node, thus we cannot apply save/restore
+ * tw3 has weird pmqos sysfs node, thus we cannot apply save/restore
* feature as pass-hal-standard does. Instead of using standard
* interface, we manually restore the each resource state; pmqos
* request is unlocked by passing argument '-1' first, and resource
.magic = HAL_INFO_TAG,
.id = PASS_RESOURCE_CPU_ID,
.name = PASS_RESOURCE_CPU_NAME,
- .open = tw2_cpu_open,
- .close = tw2_cpu_close,
+ .open = tw3_cpu_open,
+ .close = tw3_cpu_close,
};
#define FAULT_AROUND_BYTES_PATH "/sys/kernel/debug/fault_around_bytes"
-static int tw2_memory_get_fault_around_bytes(char *res_name)
+static int tw3_memory_get_fault_around_bytes(char *res_name)
{
int ret, fault_around_bytes;
return fault_around_bytes;
}
-static int tw2_memory_set_fault_around_bytes(char *res_name,
+static int tw3_memory_set_fault_around_bytes(char *res_name,
int fault_around_bytes)
{
int ret;
return 0;
}
-static int tw2_memory_open(char *res_name, struct pass_resource_info *info,
+static int tw3_memory_open(char *res_name, struct pass_resource_info *info,
struct pass_resource_common **common)
{
struct pass_resource_memory *res;
return -ENOMEM;
res->common.info = info;
- res->get_fault_around_bytes = tw2_memory_get_fault_around_bytes;
- res->set_fault_around_bytes = tw2_memory_set_fault_around_bytes;
+ res->get_fault_around_bytes = tw3_memory_get_fault_around_bytes;
+ res->set_fault_around_bytes = tw3_memory_set_fault_around_bytes;
*common = (struct pass_resource_common *)res;
return 0;
}
-static int tw2_memory_close(char *res_name, struct pass_resource_common *common)
+static int tw3_memory_close(char *res_name, struct pass_resource_common *common)
{
if (!common)
return -EINVAL;
.magic = HAL_INFO_TAG,
.id = PASS_RESOURCE_MEMORY_ID,
.name = PASS_RESOURCE_MEMORY_NAME,
- .open = tw2_memory_open,
- .close = tw2_memory_close,
+ .open = tw3_memory_open,
+ .close = tw3_memory_close,
};
#define SCENARIO_INFO_SOCKET_PATH "/dev/socket/scenario_info"
-static int tw2_set_pmqos_data(char *res_name, void *data)
+static int tw3_set_pmqos_data(char *res_name, void *data)
{
struct sockaddr_un addr;
int socket_fd, ret;
return ret;
}
-static int tw2_set_pmqos_data_nop(char *res_name, void *data)
+static int tw3_set_pmqos_data_nop(char *res_name, void *data)
{
/*
- * The tw2_set_pmqos_data function is required to send the PMQoS
+ * The tw3_set_pmqos_data function is required to send the PMQoS
* scenario information to the socket interface of the TRM and it
* is optional, which means that this HAL for nonstandard should work
* without TRM. For this reason, if there is no unix domain socket file
return 0;
}
-static int tw2_nonstandard_open(char *res_name, struct pass_resource_info *info,
+static int tw3_nonstandard_open(char *res_name, struct pass_resource_info *info,
struct pass_resource_common **common)
{
struct pass_resource_nonstandard *nonstandard_res;
ret = access(SCENARIO_INFO_SOCKET_PATH, F_OK);
if (!ret)
- nonstandard_res->set_pmqos_data = tw2_set_pmqos_data;
+ nonstandard_res->set_pmqos_data = tw3_set_pmqos_data;
else
- nonstandard_res->set_pmqos_data = tw2_set_pmqos_data_nop;
+ nonstandard_res->set_pmqos_data = tw3_set_pmqos_data_nop;
*common = (struct pass_resource_common *) nonstandard_res;
return 0;
}
-static int tw2_nonstandard_close(char *res_name, struct pass_resource_common *common)
+static int tw3_nonstandard_close(char *res_name, struct pass_resource_common *common)
{
if (!res_name || !common)
return -EINVAL;
.magic = HAL_INFO_TAG,
.id = PASS_RESOURCE_NONSTANDARD_ID,
.name = PASS_RESOURCE_NONSTANDARD_NAME,
- .open = tw2_nonstandard_open,
- .close = tw2_nonstandard_close,
+ .open = tw3_nonstandard_open,
+ .close = tw3_nonstandard_close,
};