ptrace.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * linux/include/asm-m32r/ptrace.h
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * M32R version:
  9. * Copyright (C) 2001-2002, 2004 Hirokazu Takata <takata at linux-m32r.org>
  10. */
  11. #ifndef _ASM_M32R_PTRACE_H
  12. #define _ASM_M32R_PTRACE_H
  13. #include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */
  14. #include <uapi/asm/ptrace.h>
  15. #define arch_has_single_step() (1)
  16. struct task_struct;
  17. extern void init_debug_traps(struct task_struct *);
  18. #define arch_ptrace_attach(child) \
  19. init_debug_traps(child)
  20. #if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2)
  21. #define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0)
  22. #elif defined(CONFIG_ISA_M32R)
  23. #define user_mode(regs) ((M32R_PSW_BSM & (regs)->psw) != 0)
  24. #else
  25. #error unknown isa configuration
  26. #endif
  27. #define instruction_pointer(regs) ((regs)->bpc)
  28. #define profile_pc(regs) instruction_pointer(regs)
  29. #define user_stack_pointer(regs) ((regs)->spu)
  30. extern void withdraw_debug_trap(struct pt_regs *regs);
  31. #define task_pt_regs(task) \
  32. ((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE) - 1)
  33. #define current_pt_regs() ((struct pt_regs *) \
  34. ((unsigned long)current_thread_info() + THREAD_SIZE) - 1)
  35. #endif /* _ASM_M32R_PTRACE_H */