Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 #ifndef _ASM_UPROBES_H
0003 #define _ASM_UPROBES_H
0004 /*
0005  * User-space Probes (UProbes) for sparc
0006  *
0007  * Copyright (C) 2013 Oracle, Inc.
0008  *
0009  * Authors:
0010  *     Jose E. Marchesi <jose.marchesi@oracle.com>
0011  *  Eric Saint Etienne <eric.saint.etienne@oracle.com>
0012  */
0013 
0014 typedef u32 uprobe_opcode_t;
0015 
0016 #define MAX_UINSN_BYTES     4
0017 #define UPROBE_XOL_SLOT_BYTES   (MAX_UINSN_BYTES * 2)
0018 
0019 #define UPROBE_SWBP_INSN_SIZE   4
0020 #define UPROBE_SWBP_INSN    0x91d02073 /* ta 0x73 */
0021 #define UPROBE_STP_INSN     0x91d02074 /* ta 0x74 */
0022 
0023 #define ANNUL_BIT (1 << 29)
0024 
0025 struct arch_uprobe {
0026     union {
0027         u8  insn[MAX_UINSN_BYTES];
0028         u32 ixol;
0029     };
0030 };
0031 
0032 struct arch_uprobe_task {
0033     u64 saved_tpc;
0034     u64 saved_tnpc;
0035 };
0036 
0037 struct task_struct;
0038 struct notifier_block;
0039 
0040 extern int  arch_uprobe_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long addr);
0041 extern int  arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs);
0042 extern int  arch_uprobe_post_xol(struct arch_uprobe *aup, struct pt_regs *regs);
0043 extern bool arch_uprobe_xol_was_trapped(struct task_struct *tsk);
0044 extern int  arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val, void *data);
0045 extern void arch_uprobe_abort_xol(struct arch_uprobe *aup, struct pt_regs *regs);
0046 
0047 #endif  /* _ASM_UPROBES_H */