ptrace_s.c 953 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * linux/arch/h8300/kernel/ptrace_h8s.c
  3. * ptrace cpu depend helper functions
  4. *
  5. * Yoshinori Sato <ysato@users.sourceforge.jp>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General
  8. * Public License. See the file COPYING in the main directory of
  9. * this archive for more details.
  10. */
  11. #include <linux/linkage.h>
  12. #include <linux/sched.h>
  13. #include <linux/errno.h>
  14. #include <asm/ptrace.h>
  15. #define CCR_MASK 0x6f
  16. #define EXR_TRACE 0x80
  17. /* disable singlestep */
  18. void user_disable_single_step(struct task_struct *child)
  19. {
  20. unsigned char exr;
  21. exr = h8300_get_reg(child, PT_EXR);
  22. exr &= ~EXR_TRACE;
  23. h8300_put_reg(child, PT_EXR, exr);
  24. }
  25. /* enable singlestep */
  26. void user_enable_single_step(struct task_struct *child)
  27. {
  28. unsigned char exr;
  29. exr = h8300_get_reg(child, PT_EXR);
  30. exr |= EXR_TRACE;
  31. h8300_put_reg(child, PT_EXR, exr);
  32. }
  33. asmlinkage void trace_trap(unsigned long bp)
  34. {
  35. (void)bp;
  36. force_sig(SIGTRAP, current);
  37. }