#include <linux/types.h>
-extern u32 gen_insn_execbuf[];
-extern u32 pc_dep_insn_execbuf[];
-extern u32 b_r_insn_execbuf[];
-extern u32 b_cond_insn_execbuf[];
-extern u32 blx_off_insn_execbuf[];
+/*
+ * These arrays generated from tramps_arm.c
+ * using 32 bit compiler:
+ * $ gcc tramps_arm.c -c -o tramps_arm.o
+ * $ objdump -d tramps_arm.o
+ */
+
+static u32 __attribute__((unused)) gen_insn_execbuf[] = {
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe59ff004, // ldr pc, [pc, #4]
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+};
+
+static u32 __attribute__((unused)) pc_dep_insn_execbuf[] = {
+ 0xe50d0004, // str r0, [sp, #-4]
+ 0xe59f000c, // ldr r0, [pc, #12]
+ 0xe320f000, // nop
+ 0xe51d0004, // ldr r0, [sp, #-4]
+ 0xe59ff004, // ldr pc, [pc, #4]
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+};
+
+static u32 __attribute__((unused)) b_r_insn_execbuf[] = {
+ 0xe320f000, // nop
+ 0xe59ff010, // ldr pc, [pc, #16]
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+};
+
+static u32 __attribute__((unused)) b_cond_insn_execbuf[] = {
+ 0x0a000000, // beq 68 <condway>
+ 0xe59ff010, // ldr pc, [pc, #16]
+ 0xe59ff008, // ldr pc, [pc, #8]
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+};
+
+static u32 __attribute__((unused)) blx_off_insn_execbuf[] = {
+ 0x059fe010, // ldreq lr, [pc, #16]
+ 0x012fff3e, // blxeq lr
+ 0xe59ff00c, // ldr pc, [pc, #12]
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+ 0xe320f000, // nop
+};
#endif /* _SWAP_ASM_TRAMPS_ARM_H */
+++ /dev/null
-/*
- * 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, 2016
- *
- * 2016 Vyacheslav Cherkashin <v.cherkashin@samsung.com>
- *
- */
-
-
-#include "tramps_arm.h"
-
-
-/*
- * These arrays generated from tramps_arm.c
- * using 32 bit compiler:
- * $ gcc tramps_arm.c -c -o tramps_arm.o
- * $ objdump -d tramps_arm.o
- */
-
-u32 gen_insn_execbuf[] = {
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe59ff004, // ldr pc, [pc, #4]
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
-};
-
-u32 pc_dep_insn_execbuf[] = {
- 0xe50d0004, // str r0, [sp, #-4]
- 0xe59f000c, // ldr r0, [pc, #12]
- 0xe320f000, // nop
- 0xe51d0004, // ldr r0, [sp, #-4]
- 0xe59ff004, // ldr pc, [pc, #4]
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
-};
-
-u32 b_r_insn_execbuf[] = {
- 0xe320f000, // nop
- 0xe59ff010, // ldr pc, [pc, #16]
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
-};
-
-u32 b_cond_insn_execbuf[] = {
- 0x0a000000, // beq 68 <condway>
- 0xe59ff010, // ldr pc, [pc, #16]
- 0xe59ff008, // ldr pc, [pc, #8]
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
-};
-
-u32 blx_off_insn_execbuf[] = {
- 0x059fe010, // ldreq lr, [pc, #16]
- 0x012fff3e, // blxeq lr
- 0xe59ff00c, // ldr pc, [pc, #12]
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
- 0xe320f000, // nop
-};
#include <linux/types.h>
-extern u16 gen_insn_execbuf_thumb[];
-extern u16 pc_dep_insn_execbuf_thumb[];
-extern u16 b_r_insn_execbuf_thumb[];
-extern u16 b_off_insn_execbuf_thumb[];
-extern u16 b_cond_insn_execbuf_thumb[];
-extern u16 cbz_insn_execbuf_thumb[];
+/*
+ * These arrays generated from tramps_thumb.c
+ * using 32 bit compiler:
+ * $ gcc tramps_thumb.c -c -o tramps_thumb.o
+ * $ objdump -d tramps_thumb.o
+ */
+
+static u16 __attribute__((unused)) gen_insn_execbuf_thumb[] = {
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xb082, // sub sp, #8
+ 0x9000, // str r0, [sp, #0]
+ 0x4803, // ldr r0, [pc, #12]
+ 0x9001, // str r0, [sp, #4]
+ 0xbf00, // nop
+ 0xbd01, // pop {r0, pc}
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+};
+
+static u16 __attribute__((unused)) pc_dep_insn_execbuf_thumb[] = {
+ 0xb4c0, // push {r6, r7}
+ 0x4e06, // ldr r6, [pc, #24]
+ 0x466f, // mov r7, sp
+ 0x46b5, // mov sp, r6
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0x46bd, // mov sp, r7
+ 0xbcc0, // pop {r6, r7}
+ 0xb403, // push {r0, r1}
+ 0x4803, // ldr r0, [pc, #12]
+ 0xbf00, // nop
+ 0x9001, // str r0, [sp, #4]
+ 0xbd01, // pop {r0, pc}
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+};
+
+static u16 __attribute__((unused)) b_r_insn_execbuf_thumb[] = {
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xb403, // push {r0, r1}
+ 0x4804, // ldr r0, [pc, #16]
+ 0xbf00, // nop
+ 0x9001, // str r0, [sp, #4]
+ 0xbd01, // pop {r0, pc}
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+};
+
+static u16 __attribute__((unused)) b_off_insn_execbuf_thumb[] = {
+ 0xb403, // push {r0, r1}
+ 0x4806, // ldr r0, [pc, #24]
+ 0x9001, // str r0, [sp, #4]
+ 0xbd01, // pop {r0, pc}
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xb403, // push {r0, r1}
+ 0x4804, // ldr r0, [pc, #16]
+ 0xbf00, // nop
+ 0x9001, // str r0, [sp, #4]
+ 0xbd01, // pop {r0, pc}
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+};
+
+static u16 __attribute__((unused)) b_cond_insn_execbuf_thumb[] = {
+ 0xf000, 0x8005, // beq.w ce <condway>
+ 0xb403, // push {r0, r1}
+ 0x4807, // ldr r0, [pc, #28]
+ 0xbf00, // nop
+ 0x9001, // str r0, [sp, #4]
+ 0xbd01, // pop {r0, pc}
+ 0xb403, // push {r0, r1}
+ 0xf8df, 0x000c, // ldr.w r0, [pc, #12]
+ 0x9001, // str r0, [sp, #4]
+ 0xbd01, // pop {r0, pc}
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+};
+
+static u16 __attribute__((unused)) cbz_insn_execbuf_thumb[] = {
+ 0xbf00, // nop
+ 0xb403, // push {r0, r1}
+ 0x4806, // ldr r0, [pc, #24]
+ 0xbf00, // nop
+ 0x9001, // str r0, [sp, #4]
+ 0xbd01, // pop {r0, pc}
+ 0xb403, // push {r0, r1}
+ 0x4803, // ldr r0, [pc, #12]
+ 0x9001, // str r0, [sp, #4]
+ 0xbd01, // pop {r0, pc}
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+ 0xbf00, // nop
+};
#endif /* _SWAP_ASM_TRAMPS_THUMB_H */
+++ /dev/null
-/**
- * @author Alexey Gerenkov <a.gerenkov@samsung.com> User-Space Probes initial
- * implementation; Support x86/ARM/MIPS for both user and kernel spaces.
- * @author Ekaterina Gorelkina <e.gorelkina@samsung.com>: redesign module for
- * separating core and arch parts
- *
- * @section LICENSE
- *
- * 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.
- *
- * @section COPYRIGHT
- *
- * Copyright (C) Samsung Electronics, 2006-2016
- *
- */
-
-
-#include "tramps_thumb.h"
-
-
-/*
- * These arrays generated from tramps_thumb.c
- * using 32 bit compiler:
- * $ gcc tramps_thumb.c -c -o tramps_thumb.o
- * $ objdump -d tramps_thumb.o
- */
-
-u16 gen_insn_execbuf_thumb[] = {
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xb082, // sub sp, #8
- 0x9000, // str r0, [sp, #0]
- 0x4803, // ldr r0, [pc, #12]
- 0x9001, // str r0, [sp, #4]
- 0xbf00, // nop
- 0xbd01, // pop {r0, pc}
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
-};
-
-u16 pc_dep_insn_execbuf_thumb[] = {
- 0xb4c0, // push {r6, r7}
- 0x4e06, // ldr r6, [pc, #24]
- 0x466f, // mov r7, sp
- 0x46b5, // mov sp, r6
- 0xbf00, // nop
- 0xbf00, // nop
- 0x46bd, // mov sp, r7
- 0xbcc0, // pop {r6, r7}
- 0xb403, // push {r0, r1}
- 0x4803, // ldr r0, [pc, #12]
- 0xbf00, // nop
- 0x9001, // str r0, [sp, #4]
- 0xbd01, // pop {r0, pc}
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
-};
-
-u16 b_r_insn_execbuf_thumb[] = {
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xb403, // push {r0, r1}
- 0x4804, // ldr r0, [pc, #16]
- 0xbf00, // nop
- 0x9001, // str r0, [sp, #4]
- 0xbd01, // pop {r0, pc}
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
-};
-
-u16 b_off_insn_execbuf_thumb[] = {
- 0xb403, // push {r0, r1}
- 0x4806, // ldr r0, [pc, #24]
- 0x9001, // str r0, [sp, #4]
- 0xbd01, // pop {r0, pc}
- 0xbf00, // nop
- 0xbf00, // nop
- 0xb403, // push {r0, r1}
- 0x4804, // ldr r0, [pc, #16]
- 0xbf00, // nop
- 0x9001, // str r0, [sp, #4]
- 0xbd01, // pop {r0, pc}
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
-};
-
-u16 b_cond_insn_execbuf_thumb[] = {
- 0xf000, 0x8005, // beq.w ce <condway>
- 0xb403, // push {r0, r1}
- 0x4807, // ldr r0, [pc, #28]
- 0xbf00, // nop
- 0x9001, // str r0, [sp, #4]
- 0xbd01, // pop {r0, pc}
- 0xb403, // push {r0, r1}
- 0xf8df, 0x000c, // ldr.w r0, [pc, #12]
- 0x9001, // str r0, [sp, #4]
- 0xbd01, // pop {r0, pc}
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
-};
-
-u16 cbz_insn_execbuf_thumb[] = {
- 0xbf00, // nop
- 0xb403, // push {r0, r1}
- 0x4806, // ldr r0, [pc, #24]
- 0xbf00, // nop
- 0x9001, // str r0, [sp, #4]
- 0xbd01, // pop {r0, pc}
- 0xb403, // push {r0, r1}
- 0x4803, // ldr r0, [pc, #12]
- 0x9001, // str r0, [sp, #4]
- 0xbd01, // pop {r0, pc}
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
- 0xbf00, // nop
-};
### ARM
swap_kprobe-$(CONFIG_ARM) += \
arch/arm/swap-asm/swap_kprobes.o \
- ../arch/arm/probes/probes_arm.o \
- ../arch/arm/probes/tramps_arm_img.o
+ ../arch/arm/probes/probes_arm.o
ifeq ($(CONFIG_STRICT_MEMORY_RWX), y)
swap_kprobe-$(CONFIG_ARM) += arch/arm/swap-asm/memory_rwx.o
arch/arm/swap-asm/swap_uprobes.o \
../arch/arm/probes/probes_thumb.o \
../arch/arm/probes/decode_thumb.o \
- ../arch/arm/probes/tramps_thumb_img.o \
../arch/arm/probes/probes.o \
../arch/arm/uprobe/swap_uprobe.o
arch/arm64/swap-asm/swap_uprobes.o \
arch/arm64/swap-asm/uprobes-arm64.o \
../arch/arm/probes/probes_arm.o \
- ../arch/arm/probes/tramps_arm_img.o \
../arch/arm/probes/decode_thumb.o \
../arch/arm/probes/probes_thumb.o \
- ../arch/arm/probes/tramps_thumb_img.o \
../arch/arm/probes/probes.o \
../arch/arm/uprobe/swap_uprobe.o