install_dir="/opt/swap/sdk"
-rm -f ${kprobe_arch_dir}/asm
-ln -s asm-${link_name} ${kprobe_arch_dir}/asm
-rm -f ${uprobe_arch_dir}/asm
-ln -s asm-${link_name} ${uprobe_arch_dir}/asm
+asm_kprobe_dir=${modules_dir}/kprobe/arch/${link_name}/
+asm_uprobe_dir=${modules_dir}/uprobe/arch/${link_name}/
make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} \
- M=${modules_dir} extra_cflags="-Werror -I${modules_dir}" modules || exit 1
+ M=${modules_dir} extra_cflags="-Werror -I${modules_dir} -I${asm_kprobe_dir} \
+ -I${asm_uprobe_dir}" modules || exit 1
modules=\
"${buffer_dir}/${buffer_module_name} \
obj-m := swap_kprobe.o
swap_kprobe-y := swap_kprobes.o \
swap_kprobes_deps.o \
- arch/asm/swap_kprobes.o \
swap_slots.o
-ifeq ($(CONFIG_ARM), y)
-swap_kprobe-y += arch/asm/trampoline_arm.o
-
+### ARM
+swap_kprobe-$(CONFIG_ARM) += arch/arm/swap-asm/swap_kprobes.o \
+ arch/arm/swap-asm/trampoline_arm.o
ifeq ($(CONFIG_STRICT_MEMORY_RWX), y)
-swap_kprobe-y += arch/asm/memory_rwx.o
-endif # CONFIG_STRICT_MEMORY_RWX
+swap_kprobe-$(CONFIG_ARM) += arch/arm/swap-asm/memory_rwx.o
+endif #ifeq ($(CONFIG_STRICT_MEMORY_RWX), y)
+
-endif # CONFIG_ARM
\ No newline at end of file
+### X86
+swap_kprobe-$(CONFIG_X86) += arch/x86/swap-asm/swap_kprobes.o
#include <linux/pagemap.h>
#include <ksyms/ksyms.h>
-#include <kprobe/arch/asm/swap_kprobes.h>
+#include <swap-asm/swap_kprobes.h>
#include "swap_slots.h"
#include "swap_kdebug.h"
#include <linux/sched.h>
#include <linux/pagemap.h>
-#include <kprobe/arch/asm/swap_kprobes.h>
+#include <swap-asm/swap_kprobes.h>
#ifdef CONFIG_ARM
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
+swap_uprobe-y := swap_uprobes.o
+
+### ARM
+swap_uprobe-$(CONFIG_ARM) += arch/arm/swap-asm/swap_uprobes.o \
+ arch/arm/swap-asm/trampoline_thumb.o
+
+
+### X86
+swap_uprobe-$(CONFIG_X86) += arch/x86/swap-asm/swap_uprobes.o
* Arch-dependent uprobe interface implementation for ARM.
*/
-#include <kprobe/swap_kprobes.h>
-#include <kprobe/arch/asm/swap_kprobes.h>
-#include <kprobe/arch/asm/trampoline_arm.h>
+
+#include <linux/init.h> /* need for asm/traps.h */
+#include <linux/sched.h> /* need for asm/traps.h */
+
+#include <asm/ptrace.h> /* need for asm/traps.h */
#include <asm/traps.h>
-#include <uprobe/swap_uprobes.h>
-#include <uprobe/arch/asm/swap_uprobes.h>
+
#include <kprobe/swap_slots.h>
+#include <kprobe/swap_kprobes.h>
#include <kprobe/swap_kprobes_deps.h>
+#include <uprobe/swap_uprobes.h>
+
+#include <swap-asm/swap_kprobes.h>
+#include <swap-asm/trampoline_arm.h>
+
+#include "swap_uprobes.h"
#include "trampoline_thumb.h"
-// FIXME:
-#include <kprobe/swap_kdebug.h>
/**
* @def flush_insns
#define _ARM_SWAP_UPROBES_H
+#include <swap-asm/swap_kprobes.h> /* FIXME: for UPROBES_TRAMP_LEN */
+
+
struct kprobe;
struct task_struct;
struct uprobe;
* Arch-dependent uprobe interface implementation for x86.
*/
+
#include <linux/kdebug.h>
-#include <uprobe/swap_uprobes.h>
-#include <uprobe/arch/asm/swap_uprobes.h>
+
#include <kprobe/swap_slots.h>
+#include <uprobe/swap_uprobes.h>
+
+#include "swap_uprobes.h"
+
/**
* @struct uprobe_ctlblk
#define _X86_SWAP_UPROBES_H
+#include <swap-asm/swap_kprobes.h> /* FIXME: for UPROBES_TRAMP_LEN */
+
+
struct uprobe;
struct uretprobe;
struct uretprobe_instance;
*/
-#include "swap_uprobes.h"
-#include <kprobe/swap_kdebug.h>
-
-#include <uprobe/arch/asm/swap_uprobes.h>
-
#include <linux/hash.h>
#include <linux/mempolicy.h>
#include <linux/module.h>
+
#include <kprobe/swap_slots.h>
+#include <kprobe/swap_kdebug.h>
#include <kprobe/swap_kprobes_deps.h>
+#include <swap-asm/swap_uprobes.h>
+
+#include "swap_uprobes.h"
+
+
enum {
UPROBE_HASH_BITS = 10,
UPROBE_TABLE_SIZE = (1 << UPROBE_HASH_BITS)
#include <kprobe/swap_kprobes.h>
-#include <uprobe/arch/asm/swap_uprobes.h>
+
+#include <swap-asm/swap_uprobes.h>
+
/**
* @struct uprobe
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/list.h>
+
#include <kprobe/swap_slots.h>
-#include <kprobe/arch/asm/swap_kprobes.h>
+#include <swap-asm/swap_kprobes.h>
#include "us_manager_common.h"
#include <linux/err.h>
#include <linux/module.h>
#include <linux/slab.h>
+
#include <asm/uaccess.h>
-#include <kprobe/arch/asm/swap_kprobes.h>
-#include <uprobe/arch/asm/swap_uprobes.h>
#include <buffer/swap_buffer_module.h>
#include <buffer/swap_buffer_errors.h>
+#include <swap-asm/swap_kprobes.h>
+#include <swap-asm/swap_uprobes.h>
+
#include "swap_writer_module.h"
#include "swap_writer_errors.h"
#include "kernel_operations.h"