Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) 2012 Rabin Vincent <rabin at rab.in>
0004  */
0005 
0006 #ifndef _ASM_UPROBES_H
0007 #define _ASM_UPROBES_H
0008 
0009 #include <asm/probes.h>
0010 #include <asm/opcodes.h>
0011 
0012 typedef u32 uprobe_opcode_t;
0013 
0014 #define MAX_UINSN_BYTES     4
0015 #define UPROBE_XOL_SLOT_BYTES   64
0016 
0017 #define UPROBE_SWBP_ARM_INSN    0xe7f001f9
0018 #define UPROBE_SS_ARM_INSN  0xe7f001fa
0019 #define UPROBE_SWBP_INSN    __opcode_to_mem_arm(UPROBE_SWBP_ARM_INSN)
0020 #define UPROBE_SWBP_INSN_SIZE   4
0021 
0022 struct arch_uprobe_task {
0023     u32 backup;
0024     unsigned long   saved_trap_no;
0025 };
0026 
0027 struct arch_uprobe {
0028     u8 insn[MAX_UINSN_BYTES];
0029     unsigned long ixol[2];
0030     uprobe_opcode_t bpinsn;
0031     bool simulate;
0032     u32 pcreg;
0033     void (*prehandler)(struct arch_uprobe *auprobe,
0034                struct arch_uprobe_task *autask,
0035                struct pt_regs *regs);
0036     void (*posthandler)(struct arch_uprobe *auprobe,
0037                 struct arch_uprobe_task *autask,
0038                 struct pt_regs *regs);
0039     struct arch_probes_insn asi;
0040 };
0041 
0042 #endif