68020.c 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #ifdef HARVEYNEXT
  10. /*
  11. * 68020 definition
  12. */
  13. #include <u.h>
  14. #include "68020/ureg.h"
  15. #include <libc.h>
  16. #include <bio.h>
  17. #include <mach.h>
  18. #define MAXREG 0
  19. #define MINREG 0
  20. #define REGOFF(x) (ulong)(&((struct Ureg *) 0)->x)
  21. #define VO REGOFF(vo) /* vo, 2 bytes */
  22. #define SR REGOFF(sr) /* sr, 2 bytes */
  23. #define R0 REGOFF(r0)
  24. #define PC REGOFF(pc)
  25. #define DBMAGIC REGOFF(magic)
  26. #define SP REGOFF(usp)
  27. #define REGSIZE (R0+4)
  28. #define FCTL(x) (REGSIZE+(x)*4)
  29. #define FREG(x) (FCTL(3)+(x)*12)
  30. #define FPREGSIZE (11*12)
  31. /*
  32. * 68020 register set
  33. */
  34. Reglist m68020reglist[] = {
  35. {"VO", VO, RINT, 'x'},
  36. {"SR", SR, RINT, 'x'},
  37. {"MAGIC", DBMAGIC, RINT, 'X'},
  38. {"PC", PC, RINT, 'X'},
  39. {"A7", SP, RINT, 'X'},
  40. {"KSP", REGOFF(sp), RINT, 'X'},
  41. {"A6", REGOFF(a6), RINT, 'X'},
  42. {"A5", REGOFF(a5), RINT, 'X'},
  43. {"A4", REGOFF(a4), RINT, 'X'},
  44. {"A3", REGOFF(a3), RINT, 'X'},
  45. {"A2", REGOFF(a2), RINT, 'X'},
  46. {"A1", REGOFF(a1), RINT, 'X'},
  47. {"A0", REGOFF(a0), RINT, 'X'},
  48. {"R7", REGOFF(r7), RINT, 'X'},
  49. {"R6", REGOFF(r6), RINT, 'X'},
  50. {"R5", REGOFF(r5), RINT, 'X'},
  51. {"R4", REGOFF(r4), RINT, 'X'},
  52. {"R3", REGOFF(r3), RINT, 'X'},
  53. {"R2", REGOFF(r2), RINT, 'X'},
  54. {"R1", REGOFF(r1), RINT, 'X'},
  55. {"R0", REGOFF(r0), RINT, 'X'},
  56. {"FPCR", FCTL(0), RFLT, 'X'},
  57. {"FPSR", FCTL(1), RFLT, 'X'},
  58. {"FPIAR", FCTL(2), RFLT, 'X'},
  59. {"F0", FREG(0), RFLT, '8'},
  60. {"F1", FREG(1), RFLT, '8'},
  61. {"F2", FREG(2), RFLT, '8'},
  62. {"F3", FREG(3), RFLT, '8'},
  63. {"F4", FREG(4), RFLT, '8'},
  64. {"F5", FREG(5), RFLT, '8'},
  65. {"F6", FREG(6), RFLT, '8'},
  66. {"F7", FREG(7), RFLT, '8'},
  67. {0}
  68. };
  69. Mach m68020 =
  70. {
  71. "68020",
  72. M68020, /* machine type */
  73. m68020reglist, /* register list */
  74. REGSIZE, /* number of bytes in reg set */
  75. FPREGSIZE, /* number of bytes in fp reg set */
  76. "PC",
  77. "A7",
  78. 0, /* link register */
  79. "a6base", /* static base register name */
  80. 0, /* value */
  81. 0x2000, /* page size */
  82. 0x80000000ULL, /* kernel base */
  83. 0x80000000ULL, /* kernel text mask */
  84. 0x7FFFFFFFULL, /* user stack top */
  85. 2, /* quantization of pc */
  86. 4, /* szaddr */
  87. 4, /* szreg */
  88. 4, /* szfloat */
  89. 8, /* szdouble */
  90. };
  91. #endif