uprobes.h 1.3 KB

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