Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * arch/arm/include/asm/probes.h
0004  *
0005  * Original contents copied from arch/arm/include/asm/kprobes.h
0006  * which contains the following notice...
0007  *
0008  * Copyright (C) 2006, 2007 Motorola Inc.
0009  */
0010 
0011 #ifndef _ASM_PROBES_H
0012 #define _ASM_PROBES_H
0013 
0014 #ifndef __ASSEMBLY__
0015 
0016 typedef u32 probes_opcode_t;
0017 
0018 struct arch_probes_insn;
0019 typedef void (probes_insn_handler_t)(probes_opcode_t,
0020                      struct arch_probes_insn *,
0021                      struct pt_regs *);
0022 typedef unsigned long (probes_check_cc)(unsigned long);
0023 typedef void (probes_insn_singlestep_t)(probes_opcode_t,
0024                     struct arch_probes_insn *,
0025                     struct pt_regs *);
0026 typedef void (probes_insn_fn_t)(void);
0027 
0028 /* Architecture specific copy of original instruction. */
0029 struct arch_probes_insn {
0030     probes_opcode_t         *insn;
0031     probes_insn_handler_t       *insn_handler;
0032     probes_check_cc         *insn_check_cc;
0033     probes_insn_singlestep_t    *insn_singlestep;
0034     probes_insn_fn_t        *insn_fn;
0035     int             stack_space;
0036     unsigned long           register_usage_flags;
0037     bool                kprobe_direct_exec;
0038 };
0039 
0040 #endif /* __ASSEMBLY__ */
0041 
0042 /*
0043  * We assume one instruction can consume at most 64 bytes stack, which is
0044  * 'push {r0-r15}'. Instructions consume more or unknown stack space like
0045  * 'str r0, [sp, #-80]' and 'str r0, [sp, r1]' should be prohibit to probe.
0046  */
0047 #define MAX_STACK_SIZE          64
0048 
0049 #endif