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 */
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 */
};
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;
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
/** 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 */
};
/**