0.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*
  2. * mips r4k definition
  3. */
  4. #include <u.h>
  5. #include <bio.h>
  6. #include "0c/ureg.h"
  7. #include <mach.h>
  8. #define FPREGBYTES 4
  9. #define REGOFF(x) (ulong)(&((struct Ureg *) 0)->x)
  10. #define SP REGOFF(sp)
  11. #define PC REGOFF(pc)
  12. #define R1 REGOFF(hr1)
  13. #define R31 REGOFF(hr31)
  14. #define FP_REG(x) (R1+8+FPREGBYTES*(x))
  15. #define REGSIZE sizeof(struct Ureg)
  16. #define FPREGSIZE (FPREGBYTES*33)
  17. Reglist mips2reglist[] = {
  18. {"STATUS", REGOFF(status), RINT|RRDONLY, 'X'},
  19. {"CAUSE", REGOFF(cause), RINT|RRDONLY, 'X'},
  20. {"BADVADDR", REGOFF(badvaddr), RINT|RRDONLY, 'X'},
  21. {"TLBVIRT", REGOFF(tlbvirt), RINT|RRDONLY, 'X'},
  22. {"HI", REGOFF(hhi), RINT|RRDONLY, 'W'},
  23. {"LO", REGOFF(hlo), RINT|RRDONLY, 'W'},
  24. {"PC", PC, RINT, 'X'},
  25. {"SP", SP, RINT, 'X'},
  26. {"R31", R31, RINT, 'W'},
  27. {"R30", REGOFF(hr30), RINT, 'W'},
  28. {"R28", REGOFF(hr28), RINT, 'W'},
  29. {"R27", REGOFF(hr27), RINT, 'W'},
  30. {"R26", REGOFF(hr26), RINT, 'W'},
  31. {"R25", REGOFF(hr25), RINT, 'W'},
  32. {"R24", REGOFF(hr24), RINT, 'W'},
  33. {"R23", REGOFF(hr23), RINT, 'W'},
  34. {"R22", REGOFF(hr22), RINT, 'W'},
  35. {"R21", REGOFF(hr21), RINT, 'W'},
  36. {"R20", REGOFF(hr20), RINT, 'W'},
  37. {"R19", REGOFF(hr19), RINT, 'W'},
  38. {"R18", REGOFF(hr18), RINT, 'W'},
  39. {"R17", REGOFF(hr17), RINT, 'W'},
  40. {"R16", REGOFF(hr16), RINT, 'W'},
  41. {"R15", REGOFF(hr15), RINT, 'W'},
  42. {"R14", REGOFF(hr14), RINT, 'W'},
  43. {"R13", REGOFF(hr13), RINT, 'W'},
  44. {"R12", REGOFF(hr12), RINT, 'W'},
  45. {"R11", REGOFF(hr11), RINT, 'W'},
  46. {"R10", REGOFF(hr10), RINT, 'W'},
  47. {"R9", REGOFF(hr9), RINT, 'W'},
  48. {"R8", REGOFF(hr8), RINT, 'W'},
  49. {"R7", REGOFF(hr7), RINT, 'W'},
  50. {"R6", REGOFF(hr6), RINT, 'W'},
  51. {"R5", REGOFF(hr5), RINT, 'W'},
  52. {"R4", REGOFF(hr4), RINT, 'W'},
  53. {"R3", REGOFF(hr3), RINT, 'W'},
  54. {"R2", REGOFF(hr2), RINT, 'W'},
  55. {"R1", REGOFF(hr1), RINT, 'W'},
  56. {"F0", FP_REG(0), RFLT, 'F'},
  57. {"F1", FP_REG(1), RFLT, 'f'},
  58. {"F2", FP_REG(2), RFLT, 'F'},
  59. {"F3", FP_REG(3), RFLT, 'f'},
  60. {"F4", FP_REG(4), RFLT, 'F'},
  61. {"F5", FP_REG(5), RFLT, 'f'},
  62. {"F6", FP_REG(6), RFLT, 'F'},
  63. {"F7", FP_REG(7), RFLT, 'f'},
  64. {"F8", FP_REG(8), RFLT, 'F'},
  65. {"F9", FP_REG(9), RFLT, 'f'},
  66. {"F10", FP_REG(10), RFLT, 'F'},
  67. {"F11", FP_REG(11), RFLT, 'f'},
  68. {"F12", FP_REG(12), RFLT, 'F'},
  69. {"F13", FP_REG(13), RFLT, 'f'},
  70. {"F14", FP_REG(14), RFLT, 'F'},
  71. {"F15", FP_REG(15), RFLT, 'f'},
  72. {"F16", FP_REG(16), RFLT, 'F'},
  73. {"F17", FP_REG(17), RFLT, 'f'},
  74. {"F18", FP_REG(18), RFLT, 'F'},
  75. {"F19", FP_REG(19), RFLT, 'f'},
  76. {"F20", FP_REG(20), RFLT, 'F'},
  77. {"F21", FP_REG(21), RFLT, 'f'},
  78. {"F22", FP_REG(22), RFLT, 'F'},
  79. {"F23", FP_REG(23), RFLT, 'f'},
  80. {"F24", FP_REG(24), RFLT, 'F'},
  81. {"F25", FP_REG(25), RFLT, 'f'},
  82. {"F26", FP_REG(26), RFLT, 'F'},
  83. {"F27", FP_REG(27), RFLT, 'f'},
  84. {"F28", FP_REG(28), RFLT, 'F'},
  85. {"F29", FP_REG(29), RFLT, 'f'},
  86. {"F30", FP_REG(30), RFLT, 'F'},
  87. {"F31", FP_REG(31), RFLT, 'f'},
  88. {"FPCR", FP_REG(32), RFLT, 'X'},
  89. { 0 }
  90. };
  91. /* mips r4k big-endian */
  92. Mach mmips2be =
  93. {
  94. "mips2",
  95. MMIPS2, /* machine type */
  96. mips2reglist, /* register set */
  97. REGSIZE, /* number of bytes in reg set */
  98. FPREGSIZE, /* number of bytes in fp reg set */
  99. "PC", /* name of PC */
  100. "SP", /* name of SP */
  101. "R31", /* name of link register */
  102. "setR30", /* static base register name */
  103. 0, /* SB value */
  104. 0x1000, /* page size */
  105. 0xC0000000, /* kernel base */
  106. 0x40000000, /* kernel text mask */
  107. 4, /* quantization of pc */
  108. 4, /* szaddr */
  109. 8, /* szreg */
  110. 4, /* szfloat */
  111. 8, /* szdouble */
  112. };
  113. /* mips r4k little-endian */
  114. Mach mmips2le =
  115. {
  116. "mips2",
  117. NMIPS2, /* machine type */
  118. mips2reglist, /* register set */
  119. REGSIZE, /* number of bytes in reg set */
  120. FPREGSIZE, /* number of bytes in fp reg set */
  121. "PC", /* name of PC */
  122. "SP", /* name of SP */
  123. "R31", /* name of link register */
  124. "setR30", /* static base register name */
  125. 0, /* SB value */
  126. 0x1000, /* page size */
  127. 0xC0000000, /* kernel base */
  128. 0x40000000, /* kernel text mask */
  129. 4, /* quantization of pc */
  130. 4, /* szaddr */
  131. 8, /* szreg */
  132. 4, /* szfloat */
  133. 8, /* szdouble */
  134. };