runtime/linux/uprobes2/uprobes_arm.h - systemtap
Data types defined
Functions defined
Macros defined
Source code
#ifndef _ASM_UPROBES_H
#define _ASM_UPROBES_H
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/sched.h>
#include <asm/thread_info.h>
#include <asm/cacheflush.h>
#include <asm/smp_plat.h>
#include <asm/uaccess.h>
#include <asm/tlbflush.h>
#define CONFIG_URETPROBES 1
typedef u32 uprobe_opcode_t;
#define BREAKPOINT_INSTRUCTION 0xe7ffdefe
#define BP_INSN_SIZE 4
#define MAX_UINSN_BYTES 4
#define BREAKPOINT_SIGNAL SIGILL
#define SSTEP_SIGNAL SIGILL
#define ARCH_BP_INST_PTR(inst_ptr) (inst_ptr)
struct uprobe_probept;
typedef void (uprobe_insn_handler_t)(struct uprobe_probept *, struct pt_regs *);
typedef unsigned long (uprobe_check_cc)(unsigned long);
typedef void (uprobe_insn_fn_t)(void);
#define MAX_INSN_SIZE 2
struct uprobe_probept_arch_info {
uprobe_opcode_t insn[MAX_INSN_SIZE];
uprobe_insn_handler_t *insn_handler;
uprobe_check_cc *insn_check_cc;
uprobe_insn_fn_t *insn_fn;
};
struct uprobe_task_arch_info {};
struct uprobe_probept;
struct uprobe_task;
static int arch_validate_probed_insn(struct uprobe_probept *ppt,
struct task_struct *tsk);
static inline unsigned long arch_get_probept(struct pt_regs *regs)
{
return regs->ARM_pc;
}
static inline void arch_reset_ip_for_sstep(struct pt_regs *regs)
{
}
static long arch_hijack_uret_addr(unsigned long trampoline_addr,
struct pt_regs *regs, struct uprobe_task *utask)
{
unsigned long orig_ret_addr = regs->ARM_lr;
regs->ARM_lr = trampoline_addr;
return orig_ret_addr;
}
static inline void arch_restore_uret_addr(unsigned long ret_addr,
struct pt_regs *regs)
{
regs->ARM_pc = ret_addr;
}
static inline unsigned long arch_get_cur_sp(struct pt_regs *regs)
{
return regs->ARM_sp;
}
static inline unsigned long arch_predict_sp_at_ret(struct pt_regs *regs,
struct task_struct *tsk)
{
return regs->ARM_sp;
}
#ifndef copy_to_user_page
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
do { \
memcpy(dst, src, len); \
flush_icache_range((unsigned long)dst, \
(unsigned long)dst + len); \
} while (0)
#endif
#endif