ptrace.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright 2004-2008 Analog Devices Inc.
  3. *
  4. * Licensed under the GPL-2 or later.
  5. */
  6. #ifndef _BFIN_PTRACE_H
  7. #define _BFIN_PTRACE_H
  8. #include <uapi/asm/ptrace.h>
  9. #ifndef __ASSEMBLY__
  10. /* user_mode returns true if only one bit is set in IPEND, other than the
  11. master interrupt enable. */
  12. #define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1)))
  13. #define arch_has_single_step() (1)
  14. /* common code demands this function */
  15. #define ptrace_disable(child) user_disable_single_step(child)
  16. #define current_user_stack_pointer() rdusp()
  17. extern int is_user_addr_valid(struct task_struct *child,
  18. unsigned long start, unsigned long len);
  19. /*
  20. * Get the address of the live pt_regs for the specified task.
  21. * These are saved onto the top kernel stack when the process
  22. * is not running.
  23. *
  24. * Note: if a user thread is execve'd from kernel space, the
  25. * kernel stack will not be empty on entry to the kernel, so
  26. * ptracing these tasks will fail.
  27. */
  28. #define task_pt_regs(task) \
  29. (struct pt_regs *) \
  30. ((unsigned long)task_stack_page(task) + \
  31. (THREAD_SIZE - sizeof(struct pt_regs)))
  32. #include <asm-generic/ptrace.h>
  33. #endif /* __ASSEMBLY__ */
  34. #endif /* _BFIN_PTRACE_H */