8.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 HARVEY32
  10. /*
  11. * 386 definition
  12. */
  13. #include <u.h>
  14. #include <libc.h>
  15. #include <bio.h>
  16. #include "/386/include/ureg.h"
  17. #include <mach.h>
  18. #define REGOFF(x) (ulong)(&((struct Ureg *) 0)->x)
  19. #define PC REGOFF(pc)
  20. #define SP REGOFF(sp)
  21. #define AX REGOFF(ax)
  22. #define REGSIZE sizeof(struct Ureg)
  23. #define FP_CTL(x) (REGSIZE+4*(x))
  24. #define FP_REG(x) (FP_CTL(7)+10*(x))
  25. #define FPREGSIZE (7*4+8*10)
  26. Reglist i386reglist[] = {
  27. {"DI", REGOFF(di), RINT, 'X'},
  28. {"SI", REGOFF(si), RINT, 'X'},
  29. {"BP", REGOFF(bp), RINT, 'X'},
  30. {"BX", REGOFF(bx), RINT, 'X'},
  31. {"DX", REGOFF(dx), RINT, 'X'},
  32. {"CX", REGOFF(cx), RINT, 'X'},
  33. {"AX", REGOFF(ax), RINT, 'X'},
  34. {"GS", REGOFF(gs), RINT, 'X'},
  35. {"FS", REGOFF(fs), RINT, 'X'},
  36. {"ES", REGOFF(es), RINT, 'X'},
  37. {"DS", REGOFF(ds), RINT, 'X'},
  38. {"TRAP", REGOFF(trap), RINT, 'X'},
  39. {"ECODE", REGOFF(ecode), RINT, 'X'},
  40. {"PC", PC, RINT, 'X'},
  41. {"CS", REGOFF(cs), RINT, 'X'},
  42. {"EFLAGS", REGOFF(flags), RINT, 'X'},
  43. {"SP", SP, RINT, 'X'},
  44. {"SS", REGOFF(ss), RINT, 'X'},
  45. {"E0", FP_CTL(0), RFLT, 'X'},
  46. {"E1", FP_CTL(1), RFLT, 'X'},
  47. {"E2", FP_CTL(2), RFLT, 'X'},
  48. {"E3", FP_CTL(3), RFLT, 'X'},
  49. {"E4", FP_CTL(4), RFLT, 'X'},
  50. {"E5", FP_CTL(5), RFLT, 'X'},
  51. {"E6", FP_CTL(6), RFLT, 'X'},
  52. {"F0", FP_REG(0), RFLT, '3'},
  53. {"F1", FP_REG(1), RFLT, '3'},
  54. {"F2", FP_REG(2), RFLT, '3'},
  55. {"F3", FP_REG(3), RFLT, '3'},
  56. {"F4", FP_REG(4), RFLT, '3'},
  57. {"F5", FP_REG(5), RFLT, '3'},
  58. {"F6", FP_REG(6), RFLT, '3'},
  59. {"F7", FP_REG(7), RFLT, '3'},
  60. { 0 }
  61. };
  62. Mach mi386 =
  63. {
  64. "386",
  65. MI386, /* machine type */
  66. i386reglist, /* register list */
  67. REGSIZE, /* size of registers in bytes */
  68. FPREGSIZE, /* size of fp registers in bytes */
  69. "PC", /* name of PC */
  70. "SP", /* name of SP */
  71. 0, /* link register */
  72. "setSB", /* static base register name (bogus anyways) */
  73. 0, /* static base register value */
  74. 0x1000, /* page size */
  75. 0xF0100000ULL, /* kernel base */
  76. 0xF0000000ULL, /* kernel text mask */
  77. 0x7FFFFFFFULL, /* user stack top */
  78. 1, /* quantization of pc */
  79. 4, /* szaddr */
  80. 4, /* szreg */
  81. 4, /* szfloat */
  82. 8, /* szdouble */
  83. };
  84. #endif