[CLEAN] remove arch_tramp struct 19/53419/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 1 Dec 2015 15:04:53 +0000 (18:04 +0300)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Fri, 18 Dec 2015 12:27:53 +0000 (04:27 -0800)
This structure is excessive and the need for it is now missing

Change-Id: I350e81bd0909dceee5aa2ef9fa2bb99a12862cec
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
uprobe/arch/arm/swap-asm/swap_uprobes.h
uprobe/arch/x86/swap-asm/swap_uprobes.c
uprobe/arch/x86/swap-asm/swap_uprobes.h
uprobe/swap_uprobes.h

index fa74ddf..4065285 100644 (file)
@@ -56,16 +56,6 @@ struct arch_insn {
        uprobe_opcode_t *insn;
 };
 
-/**
- * @struct arch_tramp
- * @brief Stores arch-dependent trampolines.
- */
-struct arch_tramp {
-       unsigned long tramp_arm[UPROBES_TRAMP_LEN];     /**< ARM trampoline */
-       unsigned long tramp_thumb[UPROBES_TRAMP_LEN];   /**< Thumb trampoline */
-       void *utramp;                                   /**< Pointer to trampoline */
-};
-
 
 static inline u32 swap_get_urp_float(struct pt_regs *regs)
 {
index 4aae5f1..f914aba 100644 (file)
@@ -100,7 +100,7 @@ static void restore_current_flags(struct pt_regs *regs, unsigned long flags)
 int arch_prepare_uprobe(struct uprobe *p)
 {
        struct task_struct *task = p->task;
-       u8 *tramp = p->atramp.tramp;
+       u8 tramp[UPROBES_TRAMP_LEN + BP_INSN_SIZE];     /* BP for uretprobe */
        enum { call_relative_opcode = 0xe8 };
 
        if (!read_proc_vm_atomic(task, (unsigned long)p->addr,
@@ -116,9 +116,7 @@ int arch_prepare_uprobe(struct uprobe *p)
 
        tramp[UPROBES_TRAMP_RET_BREAK_IDX] = BREAKPOINT_INSTRUCTION;
 
-       /* TODO: remove dual info */
        p->opcode = tramp[0];
-
        p->ainsn.boostable = swap_can_boost(tramp) ? 0 : -1;
 
        p->ainsn.insn = swap_slot_alloc(p->sm);
@@ -128,7 +126,7 @@ int arch_prepare_uprobe(struct uprobe *p)
        }
 
        if (!write_proc_vm_atomic(task, (unsigned long)p->ainsn.insn,
-                                 tramp, sizeof(p->atramp.tramp))) {
+                                 tramp, sizeof(tramp))) {
                swap_slot_free(p->sm, p->ainsn.insn);
                printk(KERN_INFO "failed to write memory %p!\n", tramp);
                return -EINVAL;
index a5c5eaa..3a65547 100644 (file)
@@ -57,14 +57,6 @@ struct arch_insn {
        int boostable;
 };
 
-/**
- * @struct arch_tramp
- * @brief Stores x86 trampoline
- */
-struct arch_tramp {
-       u8 tramp[UPROBES_TRAMP_LEN + BP_INSN_SIZE]; /**< BP for uretprobe */
-};
-
 
 static inline u32 swap_get_urp_float(struct pt_regs *regs)
 {
index 16e12e7..e644524 100644 (file)
@@ -98,7 +98,6 @@ struct uprobe {
        unsigned safe_thumb:1;
 #endif
        struct arch_insn ainsn;              /**< Copy of the original instruction.*/
-       struct arch_tramp atramp;            /**< Stores trampoline */
        struct task_struct *task;            /**< Pointer to the task struct */
        struct slot_manager *sm;             /**< Pointer to slot manager */
        bool atomic_ctx;                    /**< Handler context */