Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _SPARC64_KPROBES_H
0003 #define _SPARC64_KPROBES_H
0004 
0005 #include <asm-generic/kprobes.h>
0006 
0007 #define BREAKPOINT_INSTRUCTION   0x91d02070 /* ta 0x70 */
0008 #define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */
0009 
0010 #ifdef CONFIG_KPROBES
0011 #include <linux/types.h>
0012 #include <linux/percpu.h>
0013 
0014 typedef u32 kprobe_opcode_t;
0015 
0016 #define MAX_INSN_SIZE 2
0017 
0018 #define kretprobe_blacklist_size 0
0019 
0020 #define arch_remove_kprobe(p)   do {} while (0)
0021 
0022 #define flush_insn_slot(p)      \
0023 do {    flushi(&(p)->ainsn.insn[0]);    \
0024     flushi(&(p)->ainsn.insn[1]);    \
0025 } while (0)
0026 
0027 void __kretprobe_trampoline(void);
0028 
0029 /* Architecture specific copy of original instruction*/
0030 struct arch_specific_insn {
0031     /* copy of the original instruction */
0032     kprobe_opcode_t insn[MAX_INSN_SIZE];
0033 };
0034 
0035 struct prev_kprobe {
0036     struct kprobe *kp;
0037     unsigned long status;
0038     unsigned long orig_tnpc;
0039     unsigned long orig_tstate_pil;
0040 };
0041 
0042 /* per-cpu kprobe control block */
0043 struct kprobe_ctlblk {
0044     unsigned long kprobe_status;
0045     unsigned long kprobe_orig_tnpc;
0046     unsigned long kprobe_orig_tstate_pil;
0047     struct prev_kprobe prev_kprobe;
0048 };
0049 
0050 int kprobe_exceptions_notify(struct notifier_block *self,
0051                  unsigned long val, void *data);
0052 int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
0053 asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
0054                       struct pt_regs *regs);
0055 
0056 #endif /* CONFIG_KPROBES */
0057 #endif /* _SPARC64_KPROBES_H */