ptrace.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* ptrace.h: ptrace() relevant definitions
  2. *
  3. * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_PTRACE_H
  12. #define _ASM_PTRACE_H
  13. #include <asm/irq_regs.h>
  14. #include <uapi/asm/ptrace.h>
  15. #define in_syscall(regs) (((regs)->tbr & TBR_TT) == TBR_TT_TRAP0)
  16. #ifndef __ASSEMBLY__
  17. struct task_struct;
  18. /*
  19. * we dedicate GR28 to keeping a pointer to the current exception frame
  20. * - gr28 is destroyed on entry to the kernel from userspace
  21. */
  22. register struct pt_regs *__frame asm("gr28");
  23. #define user_mode(regs) (!((regs)->psr & PSR_S))
  24. #define instruction_pointer(regs) ((regs)->pc)
  25. #define user_stack_pointer(regs) ((regs)->sp)
  26. #define current_pt_regs() (__frame)
  27. extern unsigned long user_stack(const struct pt_regs *);
  28. #define profile_pc(regs) ((regs)->pc)
  29. #define task_pt_regs(task) ((task)->thread.frame0)
  30. #define arch_has_single_step() (1)
  31. #endif /* !__ASSEMBLY__ */
  32. #endif /* _ASM_PTRACE_H */