# Defines for resourced.common variant - see build section for defines for
# light variant.
-%define freezer_module ON
%define heart_module ON
%define swap_module ON
%cmake .. -DFULLVER=%{version} \
-DCMAKE_BUILD_TYPE=Release \
-DCPU_MODULE=%{cpu_module} \
- -DFREEZER_MODULE=%{freezer_module} \
-DHEART_MODULE=%{heart_module} \
-DMEMORY_MODULE=%{memory_module} \
-DMEM_STRESS=%{mem_stress} \
%cmake .. -DFULLVER=%{version} \
-DCMAKE_BUILD_TYPE=Release \
- -DFREEZER_MODULE=OFF \
-DHEART_MODULE=OFF \
-DSWAP_MODULE=OFF \
-DCPU_MODULE=%{cpu_module} \
%manifest resourced.manifest
%ghost %{_bindir}/resourced
%{plugindir}/libblock.so
+%{plugindir}/libfreezer.so
%{_libdir}/*.so.*
%attr(-,root, root) %{_bindir}/resourced.common
%if %{?heart_module} == ON
${PROC-STAT_SOURCE_DIR}/proc-watchdog.c
)
-#freezer module
-IF("${FREEZER_MODULE}" STREQUAL "ON")
- SET(SOURCES ${SOURCES} ${FREEZER_SOURCE_DIR}/freezer.c)
- ADD_DEFINITIONS("-DSYSTEM_LIB_PATH=\"${LIB_INSTALL_DIR}\"")
-ELSE()
- SET(SOURCES ${SOURCES} ${FREEZER_SOURCE_DIR}/freezer-common.c)
-ENDIF()
IF("${VIP_AGENT}" STREQUAL "ON")
SET(SOURCES ${SOURCES}
INSTALL(TARGETS block DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH})
INSTALL(FILES ${BLOCK_SOURCE_DIR}/block.conf DESTINATION ${RD_CONFIG_PATH})
+ADD_DEFINITIONS("-DFREEZER_DIR=\"${LIB_INSTALL_DIR}\"")
+ADD_LIBRARY(freezer MODULE ${FREEZER_SOURCE_DIR}/freezer.c)
+TARGET_LINK_LIBRARIES(freezer resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS})
+INSTALL(TARGETS freezer DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH})
+
ADD_EXECUTABLE(${RD_BINARY_NAME}
${RESOURCED_SOURCE_DIR}/init.c
${RESOURCED_SOURCE_DIR}/main.c
#include "trace.h"
+/* Freezer cgroup late control setting retrieval */
+int (*resourced_freezer_get_proc_late_control)(void) = NULL;
+
+/* freezer_proc_get_late_control function defined for freezer module on case */
int resourced_freezer_proc_late_control(void)
{
- _E("Using dummy definition of freezer_proc_get_late_control");
+ if (resourced_freezer_get_proc_late_control)
+ return resourced_freezer_get_proc_late_control();
+
+ _E("Using dummy definition of freezer_proc_get_late_control - freezer not loaded");
return FREEZER_LATE_CONTROL_DISABLED;
}
-
--- /dev/null
+/*
+ * resourced
+ *
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * 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 __FREEZER_COMMON_H__
+#define __FREEZER_COMMON_H__
+
+extern int (*resourced_freezer_get_proc_late_control)(void);
+
+/* Freezer cgroup late control setting retrieval */
+int resourced_freezer_proc_late_control(void);
+
+#endif /* __FREEZER_COMMON_H__ */
+
#include "proc-main.h"
#include "freezer.h"
-#define FREEZER_MODULE_PATH SYSTEM_LIB_PATH"/libsystem-freezer.so.0"
+#define FREEZER_MODULE_PATH FREEZER_DIR"/libsystem-freezer.so.0"
static int freezer_init_check;
/******************************************** Freezer symbols *************************************************/
-/* Freezer cgroup late control setting retrieval */
-static int (*resourced_freezer_get_proc_late_control)(void) = NULL;
/* Freezer suspend status retrieval */
static bool (*resourced_freezer_is_suspended)(void) = NULL;
static void *dlopen_handle;
/****************************************** Freezer symbols end ***********************************************/
-/* freezer_proc_get_late_control function defined for freezer module on case */
-int resourced_freezer_proc_late_control(void)
-{
- if (resourced_freezer_get_proc_late_control)
- return resourced_freezer_get_proc_late_control();
-
- _E("freezer_get_proc_late_control is not loaded!");
- return 0;
-}
-
/****************************************** Internal symbols **************************************************/
static void resourced_freezer_dbus_method_handler_generic(
GDBusMethodInvocation *invocation, GVariant *params)
#define __FREEZER_H__
#include <glib.h>
+#include "freezer-common.h"
/* Freezer dbus signal names */
#define SIGNAL_FREEZER_STATE "FreezerState"
GSList **resourced_app_list;
};
-/* Freezer cgroup late control setting retrieval */
-int resourced_freezer_proc_late_control(void);
-
#endif /* __FREEZER_H__ */
#include "appinfo-list.h"
#include "util.h"
#include "file-helper.h"
+#include "freezer-common.h"
#include "config-parser.h"
#ifndef gettid