uprobes.h 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 x86
  6. *
  7. * Copyright (C) IBM Corporation, 2008-2011
  8. * Authors:
  9. * Srikar Dronamraju
  10. * Jim Keniston
  11. */
  12. #include <linux/notifier.h>
  13. typedef u8 uprobe_opcode_t;
  14. #define MAX_UINSN_BYTES 16
  15. #define UPROBE_XOL_SLOT_BYTES 128 /* to keep it cache aligned */
  16. #define UPROBE_SWBP_INSN 0xcc
  17. #define UPROBE_SWBP_INSN_SIZE 1
  18. struct uprobe_xol_ops;
  19. struct arch_uprobe {
  20. union {
  21. u8 insn[MAX_UINSN_BYTES];
  22. u8 ixol[MAX_UINSN_BYTES];
  23. };
  24. const struct uprobe_xol_ops *ops;
  25. union {
  26. struct {
  27. s32 offs;
  28. u8 ilen;
  29. u8 opc1;
  30. } branch;
  31. struct {
  32. u8 fixups;
  33. u8 ilen;
  34. } defparam;
  35. struct {
  36. u8 reg_offset; /* to the start of pt_regs */
  37. u8 ilen;
  38. } push;
  39. };
  40. };
  41. struct arch_uprobe_task {
  42. #ifdef CONFIG_X86_64
  43. unsigned long saved_scratch_register;
  44. #endif
  45. unsigned int saved_trap_nr;
  46. unsigned int saved_tf;
  47. };
  48. #endif /* _ASM_UPROBES_H */