ptrace.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _PARISC_PTRACE_H
  2. #define _PARISC_PTRACE_H
  3. /* written by Philipp Rumpf, Copyright (C) 1999 SuSE GmbH Nuernberg
  4. ** Copyright (C) 2000 Grant Grundler, Hewlett-Packard
  5. */
  6. #include <linux/types.h>
  7. /* This struct defines the way the registers are stored on the
  8. * stack during a system call.
  9. *
  10. * N.B. gdb/strace care about the size and offsets within this
  11. * structure. If you change things, you may break object compatibility
  12. * for those applications.
  13. */
  14. struct pt_regs {
  15. unsigned long gr[32]; /* PSW is in gr[0] */
  16. __u64 fr[32];
  17. unsigned long sr[ 8];
  18. unsigned long iasq[2];
  19. unsigned long iaoq[2];
  20. unsigned long cr27;
  21. unsigned long pad0; /* available for other uses */
  22. unsigned long orig_r28;
  23. unsigned long ksp;
  24. unsigned long kpc;
  25. unsigned long sar; /* CR11 */
  26. unsigned long iir; /* CR19 */
  27. unsigned long isr; /* CR20 */
  28. unsigned long ior; /* CR21 */
  29. unsigned long ipsw; /* CR22 */
  30. };
  31. #define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
  32. /*
  33. * The numbers chosen here are somewhat arbitrary but absolutely MUST
  34. * not overlap with any of the number assigned in <linux/ptrace.h>.
  35. *
  36. * These ones are taken from IA-64 on the assumption that theirs are
  37. * the most correct (and we also want to support PTRACE_SINGLEBLOCK
  38. * since we have taken branch traps too)
  39. */
  40. #define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */
  41. #ifdef __KERNEL__
  42. /* XXX should we use iaoq[1] or iaoq[0] ? */
  43. #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0)
  44. #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0)
  45. #define instruction_pointer(regs) ((regs)->iaoq[0] & ~3)
  46. unsigned long profile_pc(struct pt_regs *);
  47. extern void show_regs(struct pt_regs *);
  48. #endif
  49. #endif