| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  |  Copyright (c) Eicon Networks, 2002. | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  |  This source file is supplied for the use with | 
					
						
							|  |  |  |  Eicon Networks range of DIVA Server Adapters. | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  |  Eicon File Revision :    2.1 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  |  This program is free software; you can redistribute it and/or modify | 
					
						
							|  |  |  |  it under the terms of the GNU General Public License as published by | 
					
						
							|  |  |  |  the Free Software Foundation; either version 2, or (at your option) | 
					
						
							|  |  |  |  any later version. | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  |  This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY | 
					
						
							|  |  |  |  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 
					
						
							|  |  |  |  See the GNU General Public License for more details. | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  |  You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  along with this program; if not, write to the Free Software | 
					
						
							|  |  |  |  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #ifdef PLATFORM_GT_32BIT
 | 
					
						
							|  |  |  | /* #define POINTER_32BIT byte * __ptr32 */ | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  | #define POINTER_32BIT dword
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #else
 | 
					
						
							|  |  |  | #define POINTER_32BIT byte *
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #if !defined(MIPS_SCOM)
 | 
					
						
							|  |  |  | #define BUFFER_SZ  48
 | 
					
						
							|  |  |  | #define MAINT_OFFS 0x380
 | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | #define BUFFER_SZ  128
 | 
					
						
							|  |  |  | #if defined(PRI)
 | 
					
						
							|  |  |  | #define MAINT_OFFS 0xef00
 | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | #define MAINT_OFFS 0xff00
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #define MIPS_BUFFER_SZ  128
 | 
					
						
							|  |  |  | #if defined(PRI)
 | 
					
						
							|  |  |  | #define MIPS_MAINT_OFFS 0xef00
 | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | #define MIPS_MAINT_OFFS 0xff00
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #define LOG                     1
 | 
					
						
							|  |  |  | #define MEMR                    2
 | 
					
						
							|  |  |  | #define MEMW                    3
 | 
					
						
							|  |  |  | #define IOR                     4
 | 
					
						
							|  |  |  | #define IOW                     5
 | 
					
						
							|  |  |  | #define B1TEST                  6
 | 
					
						
							|  |  |  | #define B2TEST                  7
 | 
					
						
							|  |  |  | #define BTESTOFF                8
 | 
					
						
							|  |  |  | #define DSIG_STATS              9
 | 
					
						
							|  |  |  | #define B_CH_STATS              10
 | 
					
						
							|  |  |  | #define D_CH_STATS              11
 | 
					
						
							|  |  |  | #define BL1_STATS               12
 | 
					
						
							|  |  |  | #define BL1_STATS_C             13
 | 
					
						
							|  |  |  | #define GET_VERSION             14
 | 
					
						
							|  |  |  | #define OS_STATS                15
 | 
					
						
							|  |  |  | #define XLOG_SET_MASK           16
 | 
					
						
							|  |  |  | #define XLOG_GET_MASK           17
 | 
					
						
							|  |  |  | #define DSP_READ                20
 | 
					
						
							|  |  |  | #define DSP_WRITE               21
 | 
					
						
							|  |  |  | #define OK 0xff
 | 
					
						
							|  |  |  | #define MORE_EVENTS 0xfe
 | 
					
						
							|  |  |  | #define NO_EVENT 1
 | 
					
						
							|  |  |  | struct DSigStruc | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  | 	byte Id; | 
					
						
							|  |  |  | 	byte u; | 
					
						
							|  |  |  | 	byte listen; | 
					
						
							|  |  |  | 	byte active; | 
					
						
							|  |  |  | 	byte sin[3]; | 
					
						
							|  |  |  | 	byte bc[6]; | 
					
						
							|  |  |  | 	byte llc[6]; | 
					
						
							|  |  |  | 	byte hlc[6]; | 
					
						
							|  |  |  | 	byte oad[20]; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | struct BL1Struc { | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  | 	dword cx_b1; | 
					
						
							|  |  |  | 	dword cx_b2; | 
					
						
							|  |  |  | 	dword cr_b1; | 
					
						
							|  |  |  | 	dword cr_b2; | 
					
						
							|  |  |  | 	dword px_b1; | 
					
						
							|  |  |  | 	dword px_b2; | 
					
						
							|  |  |  | 	dword pr_b1; | 
					
						
							|  |  |  | 	dword pr_b2; | 
					
						
							|  |  |  | 	word er_b1; | 
					
						
							|  |  |  | 	word er_b2; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | struct L2Struc { | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  | 	dword XTotal; | 
					
						
							|  |  |  | 	dword RTotal; | 
					
						
							|  |  |  | 	word XError; | 
					
						
							|  |  |  | 	word RError; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | struct OSStruc { | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  | 	dword free_n; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | typedef union | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  | 	struct DSigStruc DSigStats; | 
					
						
							|  |  |  | 	struct BL1Struc BL1Stats; | 
					
						
							|  |  |  | 	struct L2Struc L2Stats; | 
					
						
							|  |  |  | 	struct OSStruc OSStats; | 
					
						
							|  |  |  | 	byte   b[BUFFER_SZ]; | 
					
						
							|  |  |  | 	word   w[BUFFER_SZ >> 1]; | 
					
						
							|  |  |  | 	word   l[BUFFER_SZ >> 2]; /* word is wrong, do not use! Use 'd' instead. */ | 
					
						
							|  |  |  | 	dword  d[BUFFER_SZ >> 2]; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } BUFFER; | 
					
						
							|  |  |  | typedef union | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  | 	struct DSigStruc DSigStats; | 
					
						
							|  |  |  | 	struct BL1Struc BL1Stats; | 
					
						
							|  |  |  | 	struct L2Struc L2Stats; | 
					
						
							|  |  |  | 	struct OSStruc OSStats; | 
					
						
							|  |  |  | 	byte   b[MIPS_BUFFER_SZ]; | 
					
						
							|  |  |  | 	word   w[MIPS_BUFFER_SZ >> 1]; | 
					
						
							|  |  |  | 	word   l[BUFFER_SZ >> 2]; /* word is wrong, do not use! Use 'd' instead. */ | 
					
						
							|  |  |  | 	dword  d[MIPS_BUFFER_SZ >> 2]; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } MIPS_BUFFER; | 
					
						
							|  |  |  | #if !defined(MIPS_SCOM)
 | 
					
						
							|  |  |  | struct pc_maint | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  | 	byte req; | 
					
						
							|  |  |  | 	byte rc; | 
					
						
							|  |  |  | 	POINTER_32BIT mem; | 
					
						
							|  |  |  | 	short length; | 
					
						
							|  |  |  | 	word port; | 
					
						
							|  |  |  | 	byte fill[6]; | 
					
						
							|  |  |  | 	BUFFER data; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | struct pc_maint | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  | 	byte req; | 
					
						
							|  |  |  | 	byte rc; | 
					
						
							|  |  |  | 	byte reserved[2];     /* R3000 alignment ... */ | 
					
						
							|  |  |  | 	POINTER_32BIT mem; | 
					
						
							|  |  |  | 	short length; | 
					
						
							|  |  |  | 	word port; | 
					
						
							|  |  |  | 	byte fill[4];         /* data at offset 16   */ | 
					
						
							|  |  |  | 	BUFFER data; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | struct mi_pc_maint | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-02-19 19:52:38 -08:00
										 |  |  | 	byte req; | 
					
						
							|  |  |  | 	byte rc; | 
					
						
							|  |  |  | 	byte reserved[2];     /* R3000 alignment ... */ | 
					
						
							|  |  |  | 	POINTER_32BIT mem; | 
					
						
							|  |  |  | 	short length; | 
					
						
							|  |  |  | 	word port; | 
					
						
							|  |  |  | 	byte fill[4];         /* data at offset 16   */ | 
					
						
							|  |  |  | 	MIPS_BUFFER data; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; |