[REFACTOR] Rename arch specific structures 44/44044/4
authorAnatolii Nikulin <nikulin.a@samsung.com>
Fri, 26 Jun 2015 09:41:37 +0000 (12:41 +0300)
committerAnatolii Nikulin <nikulin.a@samsung.com>
Fri, 7 Aug 2015 09:31:31 +0000 (12:31 +0300)
Change-Id: I8258a3bab52f849968f4d9f08ff03fe044c711c8
Signed-off-by: Anatolii Nikulin <nikulin.a@samsung.com>
uprobe/arch/arm/swap-asm/swap_uprobes.h
uprobe/arch/x86/swap-asm/swap_uprobes.h
uprobe/swap_uprobes.c
uprobe/swap_uprobes.h

index 2a05864..f36b4cf 100644 (file)
@@ -47,10 +47,20 @@ struct uretprobe_instance;
 typedef unsigned long uprobe_opcode_t;
 
 /**
- * @struct arch_specific_tramp
+ * @struct arch_insn
+ * @brief Architecture depend copy of original instruction.
+ * @var arch_insn::insn
+ * Copy of the original instruction.
+ */
+struct arch_insn {
+       uprobe_opcode_t *insn;
+};
+
+/**
+ * @struct arch_tramp
  * @brief Stores arch-dependent trampolines.
  */
-struct arch_specific_tramp {
+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 */
index ec1f4d5..d89b01d 100644 (file)
@@ -44,10 +44,24 @@ struct uretprobe_instance;
 typedef u8 uprobe_opcode_t;
 
 /**
- * @struct arch_specific_tramp
+ * @struct arch_insn
+ * @brief Architecture depend copy of original instruction.
+ * @var arch_insn::insn
+ * Copy of the original instruction.
+ * @var arch_insn::boostable
+ * If this flag is not 0, this kprobe can be boost when its
+ * post_handler and break_handler is not set.
+ */
+struct arch_insn {
+       uprobe_opcode_t *insn;
+       int boostable;
+};
+
+/**
+ * @struct arch_tramp
  * @brief Stores x86 trampoline
  */
-struct arch_specific_tramp {
+struct arch_tramp {
        u8 tramp[UPROBES_TRAMP_LEN + BP_INSN_SIZE]; /**< BP for uretprobe */
 };
 
index 283323d..699ffa1 100644 (file)
@@ -84,7 +84,7 @@ void print_uprobe_hash_table(void)
 static inline void copy_uprobe(struct uprobe *old_p, struct uprobe *p)
 {
        memcpy(&p->opcode, &old_p->opcode, sizeof(uprobe_opcode_t));
-       memcpy(&p->ainsn, &old_p->ainsn, sizeof(struct arch_specific_insn));
+       memcpy(&p->ainsn, &old_p->ainsn, sizeof(struct arch_insn));
 #ifdef CONFIG_ARM
        p->safe_arm = old_p->safe_arm;
        p->safe_thumb = old_p->safe_thumb;
index cd701d6..970b2a9 100644 (file)
@@ -84,8 +84,6 @@ struct uprobe {
        uprobe_break_handler_t break_handler;
        /** Saved opcode (which has been replaced with breakpoint).*/
        uprobe_opcode_t opcode;
-       /** Copy of the original instruction.*/
-       struct arch_specific_insn ainsn;
        /** Override single-step target address, may be used to redirect
         * control-flow to arbitrary address after probe point without
         * invocation of original instruction; useful for functions
@@ -99,10 +97,10 @@ struct uprobe {
        /** Safe/unsafe to use probe on Thumb.*/
        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 */
-       struct arch_specific_tramp atramp;   /**< Stores trampoline */
 };
 
 /**