dat.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. typedef struct Conf Conf;
  2. typedef struct Dma Dma;
  3. typedef struct FPU FPU;
  4. typedef struct FPenv FPenv;
  5. typedef struct Label Label;
  6. typedef struct Lock Lock;
  7. typedef struct Mach Mach;
  8. typedef struct Ureg Ureg;
  9. typedef struct ISAConf ISAConf;
  10. typedef struct PCMmap PCMmap;
  11. typedef struct PCMslot PCMslot;
  12. typedef ulong Instr;
  13. struct Conf
  14. {
  15. ulong nmach; /* processors */
  16. ulong nproc; /* processes */
  17. ulong npage0; /* total physical pages of memory */
  18. ulong npage1; /* total physical pages of memory */
  19. ulong topofmem; /* highest physical address + 1 */
  20. ulong npage; /* total physical pages of memory */
  21. ulong base0; /* base of bank 0 */
  22. ulong base1; /* base of bank 1 */
  23. ulong ialloc; /* max interrupt time allocation in bytes */
  24. int useminicache; /* use mini cache: screen.c/lcd.c */
  25. int textwrite; /* writeable text segment, for debug */
  26. int portrait; /* display orientation */
  27. };
  28. #define NISAOPT 8
  29. struct ISAConf {
  30. char type[KNAMELEN];
  31. ulong port;
  32. ulong irq;
  33. int itype;
  34. ulong dma;
  35. ulong mem;
  36. ulong size;
  37. ulong freq;
  38. int nopt;
  39. char *opt[NISAOPT];
  40. };
  41. /*
  42. * FPenv.status
  43. */
  44. enum
  45. {
  46. FPINIT,
  47. FPACTIVE,
  48. FPINACTIVE,
  49. };
  50. struct FPenv
  51. {
  52. ulong status;
  53. ulong control;
  54. ushort fpistate; /* emulated fp */
  55. ulong regs[8][3]; /* emulated fp */
  56. };
  57. /*
  58. * This structure must agree with fpsave and fprestore asm routines
  59. */
  60. struct FPU
  61. {
  62. FPenv env;
  63. };
  64. struct Label
  65. {
  66. ulong sp;
  67. ulong pc;
  68. };
  69. struct Lock
  70. {
  71. ulong key;
  72. ulong sr;
  73. ulong pc;
  74. int pri;
  75. };
  76. #include "../port/portdat.h"
  77. /*
  78. * machine dependent definitions not used by ../port/portdat.h
  79. */
  80. struct Mach
  81. {
  82. /* OFFSETS OF THE FOLLOWING KNOWN BY l.s */
  83. ulong splpc; /* pc of last caller to splhi */
  84. /* ordering from here on irrelevant */
  85. int machno; /* physical id of processor */
  86. ulong ticks; /* of the clock since boot time */
  87. Proc *proc; /* current process on this processor */
  88. Label sched; /* scheduler wakeup */
  89. Lock alarmlock; /* access to alarm list */
  90. void *alarm; /* alarms bound to this clock */
  91. ulong cpuhz;
  92. /* stacks for exceptions */
  93. ulong fiqstack[4];
  94. ulong irqstack[4];
  95. ulong abtstack[4];
  96. ulong undstack[4];
  97. int stack[1];
  98. };
  99. #define MACHP(n) (n == 0 ? (Mach*)(MACHADDR) : (Mach*)0)
  100. extern Mach *m;
  101. extern Proc *up;
  102. typedef struct MemBank {
  103. uint pbase;
  104. uint plimit;
  105. uint vbase;
  106. uint vlimit;
  107. } MemBank;
  108. /*
  109. * Layout at virtual address 0.
  110. */
  111. typedef struct Vectorpage {
  112. void (*vectors[8])(void);
  113. uint vtable[8];
  114. } Vectorpage;
  115. extern Vectorpage *page0;