kprobes.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef _ARC_KPROBES_H
  9. #define _ARC_KPROBES_H
  10. #ifdef CONFIG_KPROBES
  11. typedef u16 kprobe_opcode_t;
  12. #define UNIMP_S_INSTRUCTION 0x79e0
  13. #define TRAP_S_2_INSTRUCTION 0x785e
  14. #define MAX_INSN_SIZE 8
  15. #define MAX_STACK_SIZE 64
  16. struct arch_specific_insn {
  17. int is_short;
  18. kprobe_opcode_t *t1_addr, *t2_addr;
  19. kprobe_opcode_t t1_opcode, t2_opcode;
  20. };
  21. #define flush_insn_slot(p) do { } while (0)
  22. #define kretprobe_blacklist_size 0
  23. struct kprobe;
  24. void arch_remove_kprobe(struct kprobe *p);
  25. int kprobe_exceptions_notify(struct notifier_block *self,
  26. unsigned long val, void *data);
  27. struct prev_kprobe {
  28. struct kprobe *kp;
  29. unsigned long status;
  30. };
  31. struct kprobe_ctlblk {
  32. unsigned int kprobe_status;
  33. struct pt_regs jprobe_saved_regs;
  34. char jprobes_stack[MAX_STACK_SIZE];
  35. struct prev_kprobe prev_kprobe;
  36. };
  37. int kprobe_fault_handler(struct pt_regs *regs, unsigned long cause);
  38. void kretprobe_trampoline(void);
  39. void trap_is_kprobe(unsigned long address, struct pt_regs *regs);
  40. #else
  41. static void trap_is_kprobe(unsigned long address, struct pt_regs *regs)
  42. {
  43. }
  44. #endif
  45. #endif