^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _ASM_UPROBES_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _ASM_UPROBES_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * User-space Probes (UProbes) for sparc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright (C) 2013 Oracle, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Authors:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * Jose E. Marchesi <jose.marchesi@oracle.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * Eric Saint Etienne <eric.saint.etienne@oracle.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) typedef u32 uprobe_opcode_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define MAX_UINSN_BYTES 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #define UPROBE_XOL_SLOT_BYTES (MAX_UINSN_BYTES * 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define UPROBE_SWBP_INSN_SIZE 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define UPROBE_SWBP_INSN 0x91d02073 /* ta 0x73 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define UPROBE_STP_INSN 0x91d02074 /* ta 0x74 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define ANNUL_BIT (1 << 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) struct arch_uprobe {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) u8 insn[MAX_UINSN_BYTES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) u32 ixol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct arch_uprobe_task {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) u64 saved_tpc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) u64 saved_tnpc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct task_struct;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct notifier_block;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) extern int arch_uprobe_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) extern int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) extern int arch_uprobe_post_xol(struct arch_uprobe *aup, struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) extern bool arch_uprobe_xol_was_trapped(struct task_struct *tsk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) extern int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val, void *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) extern void arch_uprobe_abort_xol(struct arch_uprobe *aup, struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #endif /* _ASM_UPROBES_H */