ptrace.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 p0; /* r26 - used by OS */
  37. NDS32_REG p1; /* r27 - used by OS */
  38. NDS32_REG fp; /* r28 */
  39. NDS32_REG gp; /* r29 */
  40. NDS32_REG lp; /* r30 */
  41. NDS32_REG fucop_ctl;
  42. NDS32_REG osp;
  43. };
  44. #define processor_mode(regs) \
  45. (((regs)->ipsw & MODE_MASK) >> 3)
  46. #define interrupts_enabled(regs) \
  47. ((regs)->ipsw & GIE_BIT)
  48. /*
  49. * Offsets used by 'ptrace' system call interface.
  50. * These can't be changed without breaking binary compatibility
  51. * with MkLinux, etc.
  52. */
  53. #define PT_R0 0
  54. #define PT_R1 1
  55. #define PT_R2 2
  56. #define PT_R3 3
  57. #define PT_R4 4
  58. #define PT_R5 5
  59. #define PT_R6 6
  60. #define PT_R7 7
  61. #define PT_R8 8
  62. #define PT_R9 9
  63. #define PT_R10 10
  64. #define PT_R11 11
  65. #define PT_R12 12
  66. #define PT_R13 13
  67. #define PT_R14 14
  68. #define PT_R15 15
  69. #define PT_R16 16
  70. #define PT_R17 17
  71. #define PT_R18 18
  72. #define PT_R19 19
  73. #define PT_R20 20
  74. #define PT_R21 21
  75. #define PT_R22 22
  76. #define PT_R23 23
  77. #define PT_R24 24
  78. #define PT_R25 25
  79. #endif /* __ASSEMBLY__ */
  80. #endif /* __ASM_NDS_PTRACE_H */