ptrace.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. extern int is_user_addr_valid(struct task_struct *child,
  17. unsigned long start, unsigned long len);
  18. /*
  19. * Get the address of the live pt_regs for the specified task.
  20. * These are saved onto the top kernel stack when the process
  21. * is not running.
  22. *
  23. * Note: if a user thread is execve'd from kernel space, the
  24. * kernel stack will not be empty on entry to the kernel, so
  25. * ptracing these tasks will fail.
  26. */
  27. #define task_pt_regs(task) \
  28. (struct pt_regs *) \
  29. ((unsigned long)task_stack_page(task) + \
  30. (THREAD_SIZE - sizeof(struct pt_regs)))
  31. #include <asm-generic/ptrace.h>
  32. #endif /* __ASSEMBLY__ */
  33. #endif /* _BFIN_PTRACE_H */