ptrace.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (C) 2004-2006 Atmel Corporation
  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 __ASM_AVR32_PTRACE_H
  9. #define __ASM_AVR32_PTRACE_H
  10. #include <uapi/asm/ptrace.h>
  11. #ifndef __ASSEMBLY__
  12. #include <asm/ocd.h>
  13. #define arch_has_single_step() (1)
  14. #define arch_ptrace_attach(child) ocd_enable(child)
  15. #define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER)
  16. #define instruction_pointer(regs) ((regs)->pc)
  17. #define profile_pc(regs) instruction_pointer(regs)
  18. #define user_stack_pointer(regs) ((regs)->sp)
  19. static __inline__ int valid_user_regs(struct pt_regs *regs)
  20. {
  21. /*
  22. * Some of the Java bits might be acceptable if/when we
  23. * implement some support for that stuff...
  24. */
  25. if ((regs->sr & 0xffff0000) == 0)
  26. return 1;
  27. /*
  28. * Force status register flags to be sane and report this
  29. * illegal behaviour...
  30. */
  31. regs->sr &= 0x0000ffff;
  32. return 0;
  33. }
  34. #endif /* ! __ASSEMBLY__ */
  35. #endif /* __ASM_AVR32_PTRACE_H */