ptrace.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Copyright (C) 2011 Andes Technology Corporation
  3. * Copyright (C) 2010 Shawn Lin (nobuhiro@andestech.com)
  4. * Copyright (C) 2011 Macpaul Lin (macpaul@andestech.com)
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_NDS_PTRACE_H
  11. #define __ASM_NDS_PTRACE_H
  12. #define USR_MODE 0x00
  13. #define SU_MODE 0x01
  14. #define HV_MODE 0x10
  15. #define MODE_MASK (0x03<<3)
  16. #define GIE_BIT 0x01
  17. #ifndef __ASSEMBLY__
  18. /* this struct defines the way the registers are stored on the
  19. stack during a system call. */
  20. #define NDS32_REG long
  21. struct pt_regs {
  22. NDS32_REG ir0;
  23. NDS32_REG ipsw;
  24. NDS32_REG ipc;
  25. NDS32_REG sp;
  26. NDS32_REG orig_r0;
  27. NDS32_REG pipsw;
  28. NDS32_REG pipc;
  29. NDS32_REG pp0;
  30. NDS32_REG pp1;
  31. NDS32_REG d0hi;
  32. NDS32_REG d0lo;
  33. NDS32_REG d1hi;
  34. NDS32_REG d1lo;
  35. NDS32_REG r[26]; /* r0 - r25 */
  36. NDS32_REG fp; /* r28 */
  37. NDS32_REG gp; /* r29 */
  38. NDS32_REG lp; /* r30 */
  39. NDS32_REG fucop_ctl;
  40. NDS32_REG osp;
  41. };
  42. #define processor_mode(regs) \
  43. (((regs)->ipsw & MODE_MASK) >> 3)
  44. #define interrupts_enabled(regs) \
  45. ((regs)->ipsw & GIE_BIT)
  46. /*
  47. * Offsets used by 'ptrace' system call interface.
  48. * These can't be changed without breaking binary compatibility
  49. * with MkLinux, etc.
  50. */
  51. #define PT_R0 0
  52. #define PT_R1 1
  53. #define PT_R2 2
  54. #define PT_R3 3
  55. #define PT_R4 4
  56. #define PT_R5 5
  57. #define PT_R6 6
  58. #define PT_R7 7
  59. #define PT_R8 8
  60. #define PT_R9 9
  61. #define PT_R10 10
  62. #define PT_R11 11
  63. #define PT_R12 12
  64. #define PT_R13 13
  65. #define PT_R14 14
  66. #define PT_R15 15
  67. #define PT_R16 16
  68. #define PT_R17 17
  69. #define PT_R18 18
  70. #define PT_R19 19
  71. #define PT_R20 20
  72. #define PT_R21 21
  73. #define PT_R22 22
  74. #define PT_R23 23
  75. #define PT_R24 24
  76. #define PT_R25 25
  77. #endif /* __ASSEMBLY__ */
  78. #endif /* __ASM_NDS_PTRACE_H */