1 /*
2  * Copyright (C) Eicon Technology Corporation, 2000.
3  *
4  * Eicon File Revision :    1.0
5  *
6  * This software may be used and distributed according to the terms
7  * of the GNU General Public License, incorporated herein by reference.
8  *
9  */
10 
11 #ifndef PC_MAINT_H
12 #define PC_MAINT_H
13 
14 #if !defined(MIPS_SCOM)
15 #define BUFFER_SZ  48
16 #define MAINT_OFFS 0x380
17 #else
18 #define BUFFER_SZ  128
19 #define MAINT_OFFS 0xff00
20 #endif
21 
22 #define MIPS_BUFFER_SZ  128
23 #define MIPS_MAINT_OFFS 0xff00
24 
25 #define DO_LOG                     1
26 #define MEMR                    2
27 #define MEMW                    3
28 #define IOR                     4
29 #define IOW                     5
30 #define B1TEST                  6
31 #define B2TEST                  7
32 #define BTESTOFF                8
33 #define DSIG_STATS              9
34 #define B_CH_STATS              10
35 #define D_CH_STATS              11
36 #define BL1_STATS               12
37 #define BL1_STATS_C             13
38 #define GET_VERSION             14
39 #define OS_STATS                15
40 #define XLOG_SET_MASK           16
41 #define XLOG_GET_MASK           17
42 #define DSP_READ                20
43 #define DSP_WRITE               21
44 
45 #define OK 0xff
46 #define MORE_EVENTS 0xfe
47 #define NO_EVENT 1
48 
49 struct DSigStruc
50 {
51   byte Id;
52   byte uX;
53   byte listen;
54   byte active;
55   byte sin[3];
56   byte bc[6];
57   byte llc[6];
58   byte hlc[6];
59   byte oad[20];
60 };
61 
62 struct BL1Struc {
63   dword cx_b1;
64   dword cx_b2;
65   dword cr_b1;
66   dword cr_b2;
67   dword px_b1;
68   dword px_b2;
69   dword pr_b1;
70   dword pr_b2;
71   word er_b1;
72   word er_b2;
73 };
74 
75 struct L2Struc {
76   dword XTotal;
77   dword RTotal;
78   word XError;
79   word RError;
80 };
81 
82 struct OSStruc {
83   word free_n;
84 };
85 
86 typedef union
87 {
88   struct DSigStruc DSigStats;
89   struct BL1Struc BL1Stats;
90   struct L2Struc L2Stats;
91   struct OSStruc OSStats;
92   byte   b[BUFFER_SZ];
93   word   w[BUFFER_SZ>>1];
94   word   l[BUFFER_SZ>>2]; /* word is wrong, do not use! Use 'd' instead. */
95   dword  d[BUFFER_SZ>>2];
96 } BUFFER;
97 
98 typedef union
99 {
100   struct DSigStruc DSigStats;
101   struct BL1Struc BL1Stats;
102   struct L2Struc L2Stats;
103   struct OSStruc OSStats;
104   byte   b[MIPS_BUFFER_SZ];
105   word   w[MIPS_BUFFER_SZ>>1];
106   word   l[BUFFER_SZ>>2]; /* word is wrong, do not use! Use 'd' instead. */
107   dword  d[MIPS_BUFFER_SZ>>2];
108 } MIPS_BUFFER;
109 
110 
111 #if !defined(MIPS_SCOM)
112 struct pc_maint
113 {
114   byte req;
115   byte rc;
116   byte *mem;  /*far*/
117   short length;
118   word port;
119   byte fill[6];
120   BUFFER data;
121 };
122 #else
123 struct pc_maint
124 {
125   byte req;
126   byte rc;
127   byte reserved[2];     /* R3000 alignment ... */
128   byte far *mem;
129   short length;
130   word port;
131   byte fill[4];         /* data at offset 16   */
132   BUFFER data;
133 };
134 #endif
135 
136 struct mi_pc_maint
137 {
138   byte req;
139   byte rc;
140   byte reserved[2];     /* R3000 alignment ... */
141   byte *mem; /*far*/
142   short length;
143   word port;
144   byte fill[4];         /* data at offset 16   */
145   MIPS_BUFFER data;
146 };
147 
148 #endif /* PC_MAINT_H */
149