ptrace.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
  7. *
  8. * Machine dependent structs and defines to help the user use
  9. * the ptrace system call.
  10. */
  11. #ifndef _ASM_PTRACE_H
  12. #define _ASM_PTRACE_H
  13. #include <asm/isadep.h>
  14. #include <linux/types.h>
  15. /* 0 - 31 are integer registers, 32 - 63 are fp registers. */
  16. #define FPR_BASE 32
  17. #define PC 64
  18. #define CAUSE 65
  19. #define BADVADDR 66
  20. #define MMHI 67
  21. #define MMLO 68
  22. #define FPC_CSR 69
  23. #define FPC_EIR 70
  24. #ifndef _LANGUAGE_ASSEMBLY
  25. /*
  26. * This struct defines the way the registers are stored on the stack during a
  27. * system call/exception. As usual the registers k0/k1 aren't being saved.
  28. */
  29. struct pt_regs {
  30. /* Pad bytes for argument save space on the stack. */
  31. unsigned long pad0[6];
  32. /* Saved main processor registers. */
  33. unsigned long regs[32];
  34. /* Other saved registers. */
  35. unsigned long lo;
  36. unsigned long hi;
  37. /*
  38. * saved cp0 registers
  39. */
  40. unsigned long cp0_epc;
  41. unsigned long cp0_badvaddr;
  42. unsigned long cp0_status;
  43. unsigned long cp0_cause;
  44. };
  45. #endif /* !(_LANGUAGE_ASSEMBLY) */
  46. /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  47. /* #define PTRACE_GETREGS 12 */
  48. /* #define PTRACE_SETREGS 13 */
  49. /* #define PTRACE_GETFPREGS 14 */
  50. /* #define PTRACE_SETFPREGS 15 */
  51. /* #define PTRACE_GETFPXREGS 18 */
  52. /* #define PTRACE_SETFPXREGS 19 */
  53. #define PTRACE_SETOPTIONS 21
  54. /* options set using PTRACE_SETOPTIONS */
  55. #define PTRACE_O_TRACESYSGOOD 0x00000001
  56. #if 0 /* def _LANGUAGE_ASSEMBLY */
  57. #include <asm/offset.h>
  58. #endif
  59. #ifdef __KERNEL__
  60. #ifndef _LANGUAGE_ASSEMBLY
  61. /*
  62. * Does the process account for user or for system time?
  63. */
  64. #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER)
  65. #define instruction_pointer(regs) ((regs)->cp0_epc)
  66. extern void show_regs(struct pt_regs *);
  67. #endif /* !(_LANGUAGE_ASSEMBLY) */
  68. #endif
  69. #endif /* _ASM_PTRACE_H */