EXTRA_CFLAGS := $(extra_cflags)
-obj-m := buffer/ \
- ksyms/ \
- driver/ \
- writer/ \
- kprobe/ \
- ks_manager/ \
- uprobe/ \
- us_manager/ \
- ks_features/ \
- sampler/ \
- energy/ \
- parser/
+obj-m := swap.o
+
+
+swap-y := buffer/swap_buffer_module.o \
+ buffer/buffer_queue.o \
+ driver/swap_driver_module.o \
+ driver/device_driver.o \
+ driver/driver_to_buffer.o \
+ driver/swap_debugfs.o \
+ writer/swap_writer_module.o \
+ writer/debugfs_writer.o \
+ writer/event_filter.o \
+ kprobe/dbi_kprobes_deps.o \
+ kprobe/dbi_insn_slots.o \
+ kprobe/arch/asm/dbi_kprobes.o \
+ kprobe/dbi_kprobes.o \
+ ks_manager/ks_manager.o \
+ uprobe/swap_uprobes.o \
+ uprobe/arch/asm/swap_uprobes.o \
+ us_manager/us_manager.o \
+ us_manager/us_slot_manager.o \
+ us_manager/helper.o \
+ us_manager/debugfs_us_manager.o \
+ us_manager/sspt/ip.o \
+ us_manager/sspt/sspt_page.o \
+ us_manager/sspt/sspt_file.o \
+ us_manager/sspt/sspt_proc.o \
+ us_manager/sspt/sspt_feature.o \
+ us_manager/pf/proc_filters.o \
+ us_manager/pf/pf_group.o \
+ us_manager/img/img_proc.o \
+ us_manager/img/img_file.o \
+ us_manager/img/img_ip.o \
+ ks_features/ks_features.o \
+ sampler/swap_sampler_module.o \
+ energy/energy_module.o \
+ energy/energy.o \
+ energy/rational_debugfs.o \
+ energy/debugfs_energy.o \
+ energy/lcd/lcd_base.o \
+ energy/lcd/lcd_debugfs.o \
+ parser/swap_msg_parser.o \
+ parser/msg_parser.o \
+ parser/msg_buf.o \
+ parser/msg_cmd.o \
+ parser/features.o \
+ parser/us_inst.o \
+ swap_module.o
+
+ifeq ($(CONFIG_KALLSYMS),y)
+ swap-y += ksyms/ksyms.o
+else
+ swap-y += ksyms/no_ksyms.o
+endif
+
+ifeq ($(CONFIG_CONNECTOR),y)
+ swap-y += driver/us_interaction.o
+endif
+
+swap-$(CONFIG_ARM) += writer/kernel_operations_arm.o
+swap-$(CONFIG_X86) += writer/kernel_operations_x86.o
+
+swap-$(CONFIG_ARM) += kprobe/arch/asm/trampoline_arm.o
+
+swap-$(CONFIG_ARM) += uprobe/arch/asm/trampoline_thumb.o
+
+ifdef CONFIG_HIGH_RES_TIMERS
+ swap-y += sampler/sampler_hrtimer.o
+else
+ swap-y += sampler/sampler_timer.o
+endif
+
+###############################################################################
+### math support ###
+###############################################################################
+# S6E8AA0:
+ifeq ($(CONFIG_LCD_S6E8AA0), y)
+ swap-y += energy/lcd/s6e8aa0.o
+ LCD_FUNC_LIST += s6e8aa0
+endif
+
+
+# PANEL_S6E8AA0:
+ifeq ($(CONFIG_DISPLAY_PANEL_S6E8AA0), y)
+ swap-y += energy/lcd/s6e8aa0_panel.o
+ LCD_FUNC_LIST += s6e8aa0_panel
+endif
+
+
+# MARU:
+ifeq ($(CONFIG_MARU_BACKLIGHT), y)
+ swap-y += energy/lcd/maru.o
+ LCD_FUNC_LIST += maru
+endif
+
+
+
+
+
+###############################################################################
+### description functions ###
+###############################################################################
+LCD_FUNC_ARGS := void
+LCD_FUNC_RET := struct lcd_ops *
+
+
+
+
+
+###############################################################################
+### generate defines ###
+###############################################################################
+LCD_PREFIX := lcd_energy_
+
+# add prefix
+TMP := $(foreach it, $(LCD_FUNC_LIST), $(LCD_PREFIX)$(it))
+LCD_FUNC_LIST := $(TMP)
+
+# generate DEFINITION_LCD_FUNC
+TMP := ($(LCD_FUNC_ARGS));
+DEFINITION_LCD_FUNC := DEFINITION_LCD_FUNC=\
+$(foreach it, $(LCD_FUNC_LIST), "extern" $(LCD_FUNC_RET) $(it)$(TMP))
+
+
+# generate DEFINITION_LCD_ARRAY
+COMMA := ,
+AND := &
+DEFINITION_LCD_ARRAY := DEFINITION_LCD_ARRAY=\
+"{" $(foreach it, $(LCD_FUNC_LIST), &$(it),) "}"
+
+
+# generate LCD_MAKE_FNAME
+LCD_MAKE_FNAME := LCD_MAKE_FNAME(name)=$(LCD_PREFIX)\#\#name
+
+
+
+
+
+###############################################################################
+### add generate defines to EXTRA_CFLAGS ###
+###############################################################################
+EXTRA_CFLAGS += -D"$(DEFINITION_LCD_FUNC)" \
+ -D"$(DEFINITION_LCD_ARRAY)" \
+ -D"$(LCD_MAKE_FNAME)"
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-
-obj-m := swap_buffer.o
-swap_buffer-y := swap_buffer_module.o \
- buffer_queue.o
-
return result;
}
-static int __init swap_buffer_module_init(void)
+int swap_buffer_module_init(void)
{
printk(KERN_NOTICE "SWAP_BUFFER : Buffer module initialized\n");
return E_SB_SUCCESS;
}
-static void __exit swap_buffer_module_exit(void)
+void swap_buffer_module_exit(void)
{
if (swap_buffer_status & BUFFER_ALLOC)
swap_buffer_uninit();
printk(KERN_NOTICE "SWAP_BUFFER : Buffer module unintialized\n");
}
-
-module_init(swap_buffer_module_init);
-module_exit(swap_buffer_module_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("SWAP buffer module");
-MODULE_AUTHOR("Aksenov A.S.");
/* SWAP Buffer flush. Puts all buffers to read queue and returns their count. */
unsigned int swap_buffer_flush(void);
+
+/* SWAP Buffer init/exit functions. Called on module insert */
+int swap_buffer_module_init(void);
+void swap_buffer_module_exit(void);
+
#endif /* __SWAP_BUFFER_MODULE_H__ */
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-KBUILD_EXTRA_SYMBOLS = $(src)/../buffer/Module.symvers
-
-obj-m := swap_driver.o
-swap_driver-y := swap_driver_module.o \
- device_driver.o \
- driver_to_buffer.o \
- swap_debugfs.o
-
-ifeq ($(CONFIG_CONNECTOR),y)
- swap_driver-y += us_interaction.o
-endif
#include "swap_debugfs.h"
#include "us_interaction.h"
-static int __init swap_driver_init(void)
+int swap_driver_init(void)
{
int ret;
return ret;
}
-static void __exit swap_driver_exit(void)
+void swap_driver_exit(void)
{
us_interaction_destroy();
swap_device_exit();
swap_debugfs_exit();
print_msg("Driver module uninitialized\n");
}
-
-module_init(swap_driver_init);
-module_exit(swap_driver_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("SWAP device driver");
-MODULE_AUTHOR("Aksenov A.S.");
--- /dev/null
+#ifndef __SWAP_DRIVER_MODULE_H__
+#define __SWAP_DRIVER_MODULE_H__
+
+int swap_driver_init(void);
+void swap_driver_exit(void);
+
+#endif /* __SWAP_DRIVER_MODULE_H__ */
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-KBUILD_EXTRA_SYMBOLS = $(src)/../kprobe/Module.symvers \
- $(src)/../us_manager/Module.symvers \
- $(src)/../driver/Module.symvers
-
-
-
-
-
-###############################################################################
-### swap energy module description ###
-###############################################################################
-obj-m := swap_energy.o
-swap_energy-y := energy_module.o \
- energy.o \
- rational_debugfs.o \
- debugfs_energy.o \
- lcd/lcd_base.o \
- lcd/lcd_debugfs.o
-
-
-
-
-
-###############################################################################
-### math support ###
-###############################################################################
-# S6E8AA0:
-ifeq ($(CONFIG_LCD_S6E8AA0), y)
- swap_energy-y += lcd/s6e8aa0.o
- LCD_FUNC_LIST += s6e8aa0
-endif
-
-
-# PANEL_S6E8AA0:
-ifeq ($(CONFIG_DISPLAY_PANEL_S6E8AA0), y)
- swap_energy-y += lcd/s6e8aa0_panel.o
- LCD_FUNC_LIST += s6e8aa0_panel
-endif
-
-
-# MARU:
-ifeq ($(CONFIG_MARU_BACKLIGHT), y)
- swap_energy-y += lcd/maru.o
- LCD_FUNC_LIST += maru
-endif
-
-
-
-
-
-###############################################################################
-### description functions ###
-###############################################################################
-LCD_FUNC_ARGS := void
-LCD_FUNC_RET := struct lcd_ops *
-
-
-
-
-
-###############################################################################
-### generate defines ###
-###############################################################################
-LCD_PREFIX := lcd_energy_
-
-# add prefix
-TMP := $(foreach it, $(LCD_FUNC_LIST), $(LCD_PREFIX)$(it))
-LCD_FUNC_LIST := $(TMP)
-
-# generate DEFINITION_LCD_FUNC
-TMP := ($(LCD_FUNC_ARGS));
-DEFINITION_LCD_FUNC := DEFINITION_LCD_FUNC=\
-$(foreach it, $(LCD_FUNC_LIST), "extern" $(LCD_FUNC_RET) $(it)$(TMP))
-
-
-# generate DEFINITION_LCD_ARRAY
-COMMA := ,
-AND := &
-DEFINITION_LCD_ARRAY := DEFINITION_LCD_ARRAY=\
-"{" $(foreach it, $(LCD_FUNC_LIST), &$(it),) "}"
-
-
-# generate LCD_MAKE_FNAME
-LCD_MAKE_FNAME := LCD_MAKE_FNAME(name)=$(LCD_PREFIX)\#\#name
-
-
-
-
-
-###############################################################################
-### add generate defines to EXTRA_CFLAGS ###
-###############################################################################
-EXTRA_CFLAGS += -D"$(DEFINITION_LCD_FUNC)" \
- -D"$(DEFINITION_LCD_ARRAY)" \
- -D"$(LCD_MAKE_FNAME)"
int get_parameter_energy(enum parameter_energy pe, void *buf, size_t sz);
+int swap_energy_init(void);
+void swap_energy_exit(void);
+
#endif /* _ENERGY_H */
#include "debugfs_energy.h"
-static int __init swap_energy_init(void)
+int swap_energy_init(void)
{
int ret;
return ret;
}
-static void __exit swap_energy_exit(void)
+void swap_energy_exit(void)
{
energy_uninit();
exit_debugfs_energy();
}
-
-module_init(swap_energy_init);
-module_exit(swap_energy_exit);
-
-MODULE_LICENSE("GPL");
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-
-obj-m := swap_kprobe.o
-swap_kprobe-y := dbi_kprobes_deps.o dbi_insn_slots.o arch/asm/dbi_kprobes.o dbi_kprobes.o
-swap_kprobe-$(CONFIG_ARM) += arch/asm/trampoline_arm.o
#include "dbi_kdebug.h"
#include "dbi_kprobes_deps.h"
#include "dbi_insn_slots.h"
+
#include <ksyms/ksyms.h>
#include <linux/version.h>
return arch_init_module_deps();
}
-static int __init init_kprobes(void)
+int init_kprobes(void)
{
int i, err = 0;
return err;
}
-static void __exit exit_kprobes(void)
+void exit_kprobes(void)
{
arch_exit_kprobes();
exit_sm();
}
-
-module_init(init_kprobes);
-module_exit(exit_kprobes);
-
EXPORT_SYMBOL_GPL(dbi_register_kprobe);
EXPORT_SYMBOL_GPL(dbi_unregister_kprobe);
EXPORT_SYMBOL_GPL(dbi_register_jprobe);
EXPORT_SYMBOL_GPL(dbi_register_kretprobe);
EXPORT_SYMBOL_GPL(dbi_unregister_kretprobes);
EXPORT_SYMBOL_GPL(dbi_unregister_kretprobe);
-
-MODULE_LICENSE("Dual BSD/GPL");
--- /dev/null
+#ifndef __SWAP_KRPOBE_MODULE_H__
+#define __SWAP_KRPOBE_MODULE_H__
+
+int init_kprobes(void);
+void exit_kprobes(void);
+
+#endif /* __SWAP_KRPOBE_MODULE_H__ */
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-KBUILD_EXTRA_SYMBOLS = $(src)/../kprobe/Module.symvers \
- $(src)/../writer/Module.symvers
-
-obj-m := swap_ks_features.o
-swap_ks_features-y := ks_features.o
}
}
-static int __init init_ks_feature(void)
+int init_ks_feature(void)
{
int ret;
return ret;
}
-static void __exit exit_ks_feature(void)
+void exit_ks_feature(void)
{
uninit_syscall_features();
exit_switch_context();
}
-module_init(init_ks_feature);
-module_exit(exit_ks_feature);
-
-MODULE_LICENSE("GPL");
-
/* debug */
static void print_feature(struct feature *f)
{
int set_feature(enum feature_id id);
int unset_feature(enum feature_id id);
+int init_ks_feature(void);
+void exit_ks_feature(void);
+
/* debug */
void print_features(void);
void print_all_syscall(void);
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-KBUILD_EXTRA_SYMBOLS = $(src)/../kprobe/Module.symvers
-
-obj-m := swap_ks_manager.o
-swap_ks_manager-y := ks_manager.o
}
EXPORT_SYMBOL_GPL(ksm_unregister_probe_all);
-static int __init init_ks_manager(void)
+int init_ks_manager(void)
{
return 0;
}
-static void __exit exit_ks_manager(void)
+void exit_ks_manager(void)
{
ksm_unregister_probe_all();
}
-
-module_init(init_ks_manager);
-module_exit(exit_ks_manager);
-
-MODULE_LICENSE ("GPL");
int ksm_unregister_probe_all(void);
+int init_ks_manager(void);
+void exit_ks_manager(void);
+
#endif /* _KS_MANAGER_H */
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-
-obj-m := swap_ksyms.o
-swap_ksyms-y := ksyms_module.o
-
-ifeq ($(CONFIG_KALLSYMS),y)
- swap_ksyms-y += ksyms.o
-else
- swap_ksyms-y += no_ksyms.o
-endif
+++ /dev/null
-/*
- * Dynamic Binary Instrumentation Module based on KProbes
- * modules/ksyms/ksyms_module.c
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Copyright (C) Samsung Electronics, 2014
- *
- * 2014 Alexander Aksenov <a.aksenov@samsung.com>
- *
- */
-
-#include "ksyms_init.h"
-
-#include <linux/module.h>
-
-int __init swap_ksyms_init(void)
-{
- int ret = ksyms_init();
-
- printk("SWAP_KSYMS: Module initialized\n");
-
- return ret;
-}
-
-void __exit swap_ksyms_exit(void)
-{
- ksyms_exit();
-
- printk("SWAP_KSYMS: Module uninitialized\n");
-}
-
-module_init(swap_ksyms_init);
-module_exit(swap_ksyms_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("SWAP ksyms module");
-MODULE_AUTHOR("Vyacheslav Cherkashin <v.cherkashin@samaung.com>");
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-KBUILD_EXTRA_SYMBOLS = $(src)/../energy/Module.symvers \
- $(src)/../ks_features/Module.symvers \
- $(src)/../driver/Module.symvers \
- $(src)/../writer/Module.symvers \
- $(src)/../us_manager/Module.symvers \
- $(src)/../sampler/Module.symvers
-
-obj-m := swap_message_parser.o
-swap_message_parser-y := swap_msg_parser.o \
- msg_parser.o \
- msg_buf.o \
- msg_cmd.o \
- features.o \
- us_inst.o
set_msg_handler(NULL);
}
-static int __init swap_parser_init(void)
+int swap_parser_init(void)
{
int ret;
register_msg_handler();
return ret;
}
-static void __exit swap_parser_exit(void)
+void swap_parser_exit(void)
{
uninit_cmd();
unregister_msg_handler();
}
-
-module_init(swap_parser_init);
-module_exit(swap_parser_exit);
-
-MODULE_LICENSE("GPL");
--- /dev/null
+#ifndef __SWAP_PARSER_MODULE_H__
+#define __SWAP_PARSER_MODULE_H__
+
+int swap_parser_init(void);
+void swap_parser_exit(void);
+
+#endif /* __SWAP_PARSER_MODULE_H__ */
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-KBUILD_EXTRA_SYMBOLS = $(src)/../writer/Module.symvers
-
-obj-m := swap_sampler.o
-swap_sampler-y := swap_sampler_module.o
-
-ifdef CONFIG_HIGH_RES_TIMERS
- swap_sampler-y += sampler_hrtimer.o
-else
- swap_sampler-y += sampler_timer.o
-endif
}
EXPORT_SYMBOL_GPL(swap_sampler_stop);
-static int __init sampler_init(void)
+int sampler_init(void)
{
int retval;
return E_SS_SUCCESS;
}
-static void __exit sampler_exit(void)
+void sampler_exit(void)
{
if (sampler_run)
do_swap_sampler_stop();
print_msg("Sampler uninitialized\n");
}
-
-module_init(sampler_init);
-module_exit(sampler_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("SWAP sampling module");
-MODULE_AUTHOR("Andreev S.V., Aksenov A.S.");
/* Stops the SWAP Sampler */
int swap_sampler_stop(void);
+int sampler_init(void);
+void sampler_exit(void);
+
#endif /* __SWAP_SAMPLER_MODULE_H__ */
#!/bin/sh
-insmod swap_buffer.ko || exit 1 # buffer is loaded
-insmod swap_ksyms.ko || exit 1
-insmod swap_driver.ko || exit 1 # driver is loaded
-insmod swap_writer.ko || exit 1
-insmod swap_kprobe.ko || exit 1 # kprobe is loaded
-insmod swap_ks_manager.ko || exit 1 # ks_manager is loaded
-insmod swap_uprobe.ko || exit 1 # uprobe is loaded
-insmod swap_us_manager.ko || exit 1 # us_manager is loaded
-insmod swap_ks_features.ko || exit 1 # ks_features is loaded
-insmod swap_sampler.ko || exit 1
-insmod swap_energy.ko || exit 1
-insmod swap_message_parser.ko || exit 1 # parser is loaded
+insmod swap.ko || exit 1
# Energy coefficients
#!/bin/sh
-rmmod swap_message_parser
-rmmod swap_energy
-rmmod swap_sampler
-rmmod swap_ks_features
-rmmod swap_us_manager
-rmmod swap_uprobe
-rmmod swap_ks_manager
-rmmod swap_kprobe
-rmmod swap_writer
-rmmod swap_driver
-rmmod swap_ksyms
-rmmod swap_buffer
-
-
-
-
-
-
-
-
-
+rmmod swap
--- /dev/null
+#include <linux/module.h>
+
+#include <buffer/swap_buffer_module.h>
+#include <driver/swap_driver_module.h>
+#include <energy/energy.h>
+#include <kprobe/swap_kprobe_module.h>
+#include <ks_features/ks_features.h>
+#include <ks_manager/ks_manager.h>
+#include <ksyms/ksyms_init.h>
+#include <parser/swap_parser_module.h>
+#include <sampler/swap_sampler_module.h>
+#include <uprobe/swap_uprobe_module.h>
+#include <us_manager/us_manager.h>
+#include <writer/swap_writer_module.h>
+
+typedef enum {
+ FULL_REMOVE,
+ BUFFER_FAIL,
+ KSYMS_FAIL,
+ DRIVER_FAIL,
+ WRITER_FAIL,
+ KPROBE_FAIL,
+ KS_MANAGER_FAIL,
+ UPROBE_FAIL,
+ US_MANAGER_FAIL,
+ KS_FEATURE_FAIL,
+ SAMPLER_FAIL,
+ ENERGY_FAIL,
+ PARSER_FAIL
+} exit_modules_t;
+
+static void uninit_modules(exit_modules_t exit_m)
+{
+ switch (exit_m) {
+ case FULL_REMOVE:
+ swap_parser_exit();
+ case PARSER_FAIL:
+ swap_energy_exit();
+ case ENERGY_FAIL:
+ sampler_exit();
+ case SAMPLER_FAIL:
+ exit_ks_feature();
+ case KS_FEATURE_FAIL:
+ exit_us_manager();
+ case US_MANAGER_FAIL:
+ exit_uprobes();
+ case UPROBE_FAIL:
+ exit_ks_manager();
+ case KS_MANAGER_FAIL:
+ exit_kprobes();
+ case KPROBE_FAIL:
+ swap_writer_module_exit();
+ case WRITER_FAIL:
+ swap_driver_exit();
+ case DRIVER_FAIL:
+ ksyms_exit();
+ case KSYMS_FAIL:
+ swap_buffer_module_exit();
+ case BUFFER_FAIL:
+ return;
+ }
+}
+
+static int __init swap_init(void)
+{
+ int ret;
+
+ ret = swap_buffer_module_init();
+ if (ret) {
+ uninit_modules(BUFFER_FAIL);
+ return ret;
+ }
+
+ ret = ksyms_init();
+ if (ret) {
+ uninit_modules(KSYMS_FAIL);
+ return ret;
+ }
+
+ ret = swap_driver_init();
+ if (ret) {
+ uninit_modules(DRIVER_FAIL);
+ return ret;
+ }
+
+ ret = swap_writer_module_init();
+ if (ret) {
+ uninit_modules(WRITER_FAIL);
+ return ret;
+ }
+
+ ret = init_kprobes();
+ if (ret) {
+ uninit_modules(KPROBE_FAIL);
+ return ret;
+ }
+
+ ret = init_ks_manager();
+ if (ret) {
+ uninit_modules(KS_MANAGER_FAIL);
+ return ret;
+ }
+
+ ret = init_uprobes();
+ if (ret) {
+ uninit_modules(UPROBE_FAIL);
+ return ret;
+ }
+
+ ret = init_us_manager();
+ if (ret) {
+ uninit_modules(US_MANAGER_FAIL);
+ return ret;
+ }
+
+ ret = init_ks_feature();
+ if (ret) {
+ uninit_modules(KS_FEATURE_FAIL);
+ return ret;
+ }
+
+ ret = sampler_init();
+ if (ret) {
+ uninit_modules(SAMPLER_FAIL);
+ return ret;
+ }
+
+ ret = swap_energy_init();
+ if (ret) {
+ uninit_modules(ENERGY_FAIL);
+ return ret;
+ }
+
+ ret = swap_parser_init();
+ if (ret) {
+ uninit_modules(PARSER_FAIL);
+ return ret;
+ }
+
+ return ret;
+}
+
+static void __exit swap_exit(void)
+{
+ uninit_modules(FULL_REMOVE);
+}
+
+module_init(swap_init);
+module_exit(swap_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SWAP");
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-KBUILD_EXTRA_SYMBOLS = $(src)/../kprobe/Module.symvers
-
-obj-m := swap_uprobe.o
-swap_uprobe-y := swap_uprobes.o arch/asm/swap_uprobes.o
-swap_uprobe-$(CONFIG_ARM) += arch/asm/trampoline_thumb.o
--- /dev/null
+#ifndef __SWAP_UPROBE_MODULE_H__
+#define __SWAP_UPROBE_MODULE_H__
+
+int init_uprobes(void);
+void exit_uprobes(void);
+
+#endif /* __SWAP_UPROBE_MODULE_H__ */
}
EXPORT_SYMBOL_GPL(swap_ujprobe_return);
-static int __init init_uprobes(void)
+int init_uprobes(void)
{
init_uprobe_table();
init_uprobes_insn_slots();
return swap_arch_init_uprobes();
}
-static void __exit exit_uprobes(void)
+void exit_uprobes(void)
{
swap_arch_exit_uprobes();
}
EXPORT_SYMBOL_GPL(dbi_register_uretprobe);
EXPORT_SYMBOL_GPL(dbi_unregister_uretprobe);
EXPORT_SYMBOL_GPL(dbi_unregister_all_uprobes);
-
-module_init(init_uprobes);
-module_exit(exit_uprobes);
-
-MODULE_LICENSE ("GPL");
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-KBUILD_EXTRA_SYMBOLS = $(src)/../writer/Module.symvers \
- $(src)/../kprobe/Module.symvers \
- $(src)/../uprobe/Module.symvers
-
-obj-m := swap_us_manager.o
-swap_us_manager-y := us_manager.o us_slot_manager.o helper.o debugfs_us_manager.o \
- sspt/ip.o sspt/sspt_page.o sspt/sspt_file.o sspt/sspt_proc.o \
- sspt/sspt_feature.o \
- pf/proc_filters.o pf/pf_group.o \
- img/img_proc.o img/img_file.o img/img_ip.o
-static int __init init_us_manager(void)
+int init_us_manager(void)
{
int ret;
return ret;
}
-static void __exit exit_us_manager(void)
+void exit_us_manager(void)
{
if (status == ST_ON)
do_usm_stop();
uninit_helper();
exit_us_filter();
}
-
-module_init(init_us_manager);
-module_exit(exit_us_manager);
-
-MODULE_LICENSE ("GPL");
-
int usm_start(void);
int usm_stop(void);
+int init_us_manager(void);
+void exit_us_manager(void);
+
#endif /* _US_MANAGER_H */
+++ /dev/null
-EXTRA_CFLAGS := $(extra_cflags)
-KBUILD_EXTRA_SYMBOLS = $(src)/../buffer/Module.symvers \
- $(src)/../driver/Module.symvers
-
-obj-m := swap_writer.o
-swap_writer-y := swap_writer_module.o \
- debugfs_writer.o \
- event_filter.o
-
-swap_writer-$(CONFIG_ARM) += kernel_operations_arm.o
-swap_writer-$(CONFIG_X86) += kernel_operations_x86.o
return len;
}
-static int __init swap_writer_module_init(void)
+int swap_writer_module_init(void)
{
int ret;
return ret;
}
-static void __exit swap_writer_module_exit(void)
+void swap_writer_module_exit(void)
{
exit_debugfs_writer();
event_filter_exit();
}
-
-module_init(swap_writer_module_init);
-module_exit(swap_writer_module_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("SWAP Writer module");
-MODULE_AUTHOR("Cherkashin V., Aksenov A.S.");
int raw_msg(char *buf, size_t len);
+int swap_writer_module_init(void);
+void swap_writer_module_exit(void);
+
#endif /* _SWAP_MSG_H */