pc_maint.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /*
  2. *
  3. Copyright (c) Eicon Networks, 2002.
  4. *
  5. This source file is supplied for the use with
  6. Eicon Networks range of DIVA Server Adapters.
  7. *
  8. Eicon File Revision : 2.1
  9. *
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2, or (at your option)
  13. any later version.
  14. *
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
  17. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. See the GNU General Public License for more details.
  19. *
  20. You should have received a copy of the GNU General Public License
  21. along with this program; if not, write to the Free Software
  22. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. *
  24. */
  25. #ifdef PLATFORM_GT_32BIT
  26. /* #define POINTER_32BIT byte * __ptr32 */
  27. #define POINTER_32BIT dword
  28. #else
  29. #define POINTER_32BIT byte *
  30. #endif
  31. #if !defined(MIPS_SCOM)
  32. #define BUFFER_SZ 48
  33. #define MAINT_OFFS 0x380
  34. #else
  35. #define BUFFER_SZ 128
  36. #if defined(PRI)
  37. #define MAINT_OFFS 0xef00
  38. #else
  39. #define MAINT_OFFS 0xff00
  40. #endif
  41. #endif
  42. #define MIPS_BUFFER_SZ 128
  43. #if defined(PRI)
  44. #define MIPS_MAINT_OFFS 0xef00
  45. #else
  46. #define MIPS_MAINT_OFFS 0xff00
  47. #endif
  48. #define LOG 1
  49. #define MEMR 2
  50. #define MEMW 3
  51. #define IOR 4
  52. #define IOW 5
  53. #define B1TEST 6
  54. #define B2TEST 7
  55. #define BTESTOFF 8
  56. #define DSIG_STATS 9
  57. #define B_CH_STATS 10
  58. #define D_CH_STATS 11
  59. #define BL1_STATS 12
  60. #define BL1_STATS_C 13
  61. #define GET_VERSION 14
  62. #define OS_STATS 15
  63. #define XLOG_SET_MASK 16
  64. #define XLOG_GET_MASK 17
  65. #define DSP_READ 20
  66. #define DSP_WRITE 21
  67. #define OK 0xff
  68. #define MORE_EVENTS 0xfe
  69. #define NO_EVENT 1
  70. struct DSigStruc
  71. {
  72. byte Id;
  73. byte u;
  74. byte listen;
  75. byte active;
  76. byte sin[3];
  77. byte bc[6];
  78. byte llc[6];
  79. byte hlc[6];
  80. byte oad[20];
  81. };
  82. struct BL1Struc {
  83. dword cx_b1;
  84. dword cx_b2;
  85. dword cr_b1;
  86. dword cr_b2;
  87. dword px_b1;
  88. dword px_b2;
  89. dword pr_b1;
  90. dword pr_b2;
  91. word er_b1;
  92. word er_b2;
  93. };
  94. struct L2Struc {
  95. dword XTotal;
  96. dword RTotal;
  97. word XError;
  98. word RError;
  99. };
  100. struct OSStruc {
  101. dword free_n;
  102. };
  103. typedef union
  104. {
  105. struct DSigStruc DSigStats;
  106. struct BL1Struc BL1Stats;
  107. struct L2Struc L2Stats;
  108. struct OSStruc OSStats;
  109. byte b[BUFFER_SZ];
  110. word w[BUFFER_SZ >> 1];
  111. word l[BUFFER_SZ >> 2]; /* word is wrong, do not use! Use 'd' instead. */
  112. dword d[BUFFER_SZ >> 2];
  113. } BUFFER;
  114. typedef union
  115. {
  116. struct DSigStruc DSigStats;
  117. struct BL1Struc BL1Stats;
  118. struct L2Struc L2Stats;
  119. struct OSStruc OSStats;
  120. byte b[MIPS_BUFFER_SZ];
  121. word w[MIPS_BUFFER_SZ >> 1];
  122. word l[BUFFER_SZ >> 2]; /* word is wrong, do not use! Use 'd' instead. */
  123. dword d[MIPS_BUFFER_SZ >> 2];
  124. } MIPS_BUFFER;
  125. #if !defined(MIPS_SCOM)
  126. struct pc_maint
  127. {
  128. byte req;
  129. byte rc;
  130. POINTER_32BIT mem;
  131. short length;
  132. word port;
  133. byte fill[6];
  134. BUFFER data;
  135. };
  136. #else
  137. struct pc_maint
  138. {
  139. byte req;
  140. byte rc;
  141. byte reserved[2]; /* R3000 alignment ... */
  142. POINTER_32BIT mem;
  143. short length;
  144. word port;
  145. byte fill[4]; /* data at offset 16 */
  146. BUFFER data;
  147. };
  148. #endif
  149. struct mi_pc_maint
  150. {
  151. byte req;
  152. byte rc;
  153. byte reserved[2]; /* R3000 alignment ... */
  154. POINTER_32BIT mem;
  155. short length;
  156. word port;
  157. byte fill[4]; /* data at offset 16 */
  158. MIPS_BUFFER data;
  159. };