kprobes.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 cause, unsigned long address,
  40. struct pt_regs *regs);
  41. #else
  42. static void trap_is_kprobe(unsigned long cause, unsigned long address,
  43. struct pt_regs *regs)
  44. {
  45. }
  46. #endif
  47. #endif