ptrace.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* MN10300 Exception frame layout and ptrace constants
  2. *
  3. * Copyright (C) 2007 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 Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_PTRACE_H
  12. #define _ASM_PTRACE_H
  13. #define PT_A3 0
  14. #define PT_A2 1
  15. #define PT_D3 2
  16. #define PT_D2 3
  17. #define PT_MCVF 4
  18. #define PT_MCRL 5
  19. #define PT_MCRH 6
  20. #define PT_MDRQ 7
  21. #define PT_E1 8
  22. #define PT_E0 9
  23. #define PT_E7 10
  24. #define PT_E6 11
  25. #define PT_E5 12
  26. #define PT_E4 13
  27. #define PT_E3 14
  28. #define PT_E2 15
  29. #define PT_SP 16
  30. #define PT_LAR 17
  31. #define PT_LIR 18
  32. #define PT_MDR 19
  33. #define PT_A1 20
  34. #define PT_A0 21
  35. #define PT_D1 22
  36. #define PT_D0 23
  37. #define PT_ORIG_D0 24
  38. #define PT_EPSW 25
  39. #define PT_PC 26
  40. #define NR_PTREGS 27
  41. #ifndef __ASSEMBLY__
  42. /*
  43. * This defines the way registers are stored in the event of an exception
  44. * - the strange order is due to the MOVM instruction
  45. */
  46. struct pt_regs {
  47. unsigned long a3; /* syscall arg 3 */
  48. unsigned long a2; /* syscall arg 4 */
  49. unsigned long d3; /* syscall arg 5 */
  50. unsigned long d2; /* syscall arg 6 */
  51. unsigned long mcvf;
  52. unsigned long mcrl;
  53. unsigned long mcrh;
  54. unsigned long mdrq;
  55. unsigned long e1;
  56. unsigned long e0;
  57. unsigned long e7;
  58. unsigned long e6;
  59. unsigned long e5;
  60. unsigned long e4;
  61. unsigned long e3;
  62. unsigned long e2;
  63. unsigned long sp;
  64. unsigned long lar;
  65. unsigned long lir;
  66. unsigned long mdr;
  67. unsigned long a1;
  68. unsigned long a0; /* syscall arg 1 */
  69. unsigned long d1; /* syscall arg 2 */
  70. unsigned long d0; /* syscall ret */
  71. struct pt_regs *next; /* next frame pointer */
  72. unsigned long orig_d0; /* syscall number */
  73. unsigned long epsw;
  74. unsigned long pc;
  75. };
  76. #endif
  77. extern struct pt_regs *__frame; /* current frame pointer */
  78. /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  79. #define PTRACE_GETREGS 12
  80. #define PTRACE_SETREGS 13
  81. #define PTRACE_GETFPREGS 14
  82. #define PTRACE_SETFPREGS 15
  83. /* options set using PTRACE_SETOPTIONS */
  84. #define PTRACE_O_TRACESYSGOOD 0x00000001
  85. #if defined(__KERNEL__)
  86. #if !defined(__ASSEMBLY__)
  87. #define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL)
  88. #define instruction_pointer(regs) ((regs)->pc)
  89. extern void show_regs(struct pt_regs *);
  90. #endif /* !__ASSEMBLY */
  91. #define profile_pc(regs) ((regs)->pc)
  92. #endif /* __KERNEL__ */
  93. #endif /* _ASM_PTRACE_H */