00001 #ifndef __MK__dsp_H___
00002 #define __MK__dsp_H___
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _LIBDSP_
00024 #define _LIBDSP_
00025
00026 #define SIMULATOR_POSSIBLE 0
00027 #define TRACE_POSSIBLE 1
00028
00029 #define NO_VPRINTF 1
00030
00031 #define REMEMBER(x)
00032
00033
00034
00035 #ifdef WIN32
00036 #import <io.h>
00037 #else
00038 #import <sys/file.h>
00039 #import <sys/time.h>
00040
00041 #endif
00042 #import <stdlib.h>
00043 #import <string.h>
00044
00045
00046 #ifdef WIN32
00047 #define R_OK 4
00048 #define W_OK 2
00049 #define X_OK 1
00050 #define F_OK 0
00051 #endif
00052
00053
00054
00055
00056
00057
00058
00059
00060 #import <math.h>
00061 #import <ctype.h>
00062
00063 extern int DSPDefaultTimeLimit;
00064
00065
00066
00067 #import "dsp.h"
00068
00069 #define _DSP_MAX_LINE 256
00070 #define _DSP_MAX_NAME 80
00071 #define _DSP_MAX_CMD 12
00072
00073 #if 0
00074 #define _DSP_EXPANDSIZE 512
00075 #define _DSP_EXPANDSMALL 10
00076 #else
00077 #define _DSP_EXPANDSIZE 81920
00078 #define _DSP_EXPANDSMALL 81920
00079 #endif
00080
00081 #define _DSP_NULLC 0
00082 #define _DSP_NOT_AN_INT (0x80000000)
00083 #define _DSP_PATH_DELIM '/'
00084
00085 #define _DSP_COUNT_STEP (10)
00086
00087
00088 #define _DSP_HMTYPE_UNTIMED 0x880000
00089 #define _DSP_HMTYPE_TIMEDA 0x990000
00090 #define _DSP_HMTYPE_TIMEDR 0xAA0000
00091
00092
00093 #define _DSP_UNTIMED NULL
00094
00095
00096 extern char *getenv();
00097
00098
00099 extern int _DSPTrace;
00100 extern int _DSPVerbose;
00101 extern int DSPAPTimeLimit;
00102 extern int _DSPErrorBlock;
00103 extern int _DSPMessagesEnabled;
00104 extern int _DSPMKWriteDataIsRunning;
00105 extern double _DSPSamplingRate;
00106 extern DSPFix48 _DSPTimeStamp0;
00107
00108 #define DSP_MAYBE_RETURN(x) if (DSPIsSimulated()) ; else return(x)
00109
00110 #define DSP_QUESTION(q)
00111
00112
00113
00114 #define DSP_TRACE_DSPLOADSPECREAD 1
00115 #define DSP_TRACE_DSPLOADSPECWRITE 2
00116 #define DSP_TRACE_DSPLNKREAD 4
00117 #define DSP_TRACE_FIXUPS 8
00118 #define DSP_TRACE_NOOPTIMIZE 16
00119 #define DSP_TRACE__DSPMEMMAPREAD 32
00120 #define DSP_TRACE__DSPRELOCATE 64
00121 #define DSP_TRACE__DSPRELOCATEUSER 128
00122 #define DSP_TRACE_DSP 256
00123 #define DSP_TRACE_HOST_MESSAGES 256
00124 #define DSP_TRACE_SYMBOLS 512
00125 #define DSP_TRACE_HOST_INTERFACE 1024
00126 #define DSP_TRACE_BOOT 2048
00127 #define DSP_TRACE_LOAD 4096
00128 #define DSP_TRACE_UTILITIES 8192
00129 #define DSP_TRACE_TEST 16384
00130 #define DSP_TRACE_DSPWRITEC 32768
00131 #define DSP_TRACE_TMQ 0x10000
00132 #define DSP_TRACE_NOSOUND 0x20000
00133 #define DSP_TRACE_SOUND_DATA 0x40000
00134 #define DSP_TRACE_MALLOC 0x80000
00135 #define DSP_TRACE_MEMDIAG 0x100000
00136 #define DSP_TRACE_WRITE_DATA 0x200000
00137
00138
00139
00140 #define _DSP_MACH_RCV_TIMEOUT_SEGMENT 10
00141 #define _DSP_MACH_RCV_TIMEOUT 100
00142 #define _DSP_MACH_DEADLOCK_TIMEOUT 100
00143 #define _DSP_ERR_TIMEOUT 100
00144 #define _DSP_MACH_SEND_TIMEOUT 100
00145 #define _DSP_MACH_FOREVER 1000000000
00146
00147
00148
00149 #if 0
00150
00151 typedef volatile struct _DSPRegs {
00152 unsigned char icr;
00153 unsigned char cvr;
00154 unsigned char isr;
00155 unsigned char ivr;
00156 union {
00157 struct {
00158 unsigned char pad;
00159 unsigned char h;
00160 unsigned char m;
00161 unsigned char l;
00162 } rx;
00163 struct {
00164 unsigned char pad;
00165 unsigned char h;
00166 unsigned char m;
00167 unsigned char l;
00168 } tx;
00169 } data;
00170 } DSPRegs;
00171
00172 #else
00173
00174
00175
00176
00177 typedef volatile struct _DSPRegs {
00178 unsigned char icr_pad[3];
00179 unsigned char icr;
00180 unsigned char cvr_pad[3];
00181 unsigned char cvr;
00182 unsigned char isr_pad[3];
00183 unsigned char isr;
00184 unsigned char ivr_pad[3];
00185 unsigned char ivr;
00186 union {
00187 unsigned int receive;
00188 struct {
00189 unsigned char pad;
00190 unsigned char h;
00191 unsigned char m;
00192 unsigned char l;
00193 } rx;
00194 unsigned int transmit;
00195 struct {
00196 unsigned char pad;
00197 unsigned char h;
00198 unsigned char m;
00199 unsigned char l;
00200 } tx;
00201 } data;
00202 } DSPRegs;
00203
00204 #endif
00205
00206 typedef struct __DSPMemMap {
00207
00208
00209
00210
00211 int defaultOffsets[DSP_LC_NUM];
00212 int userOffsets[DSP_LC_NUM];
00213 int nOtherOffsets[DSP_LC_NUM];
00214 int *otherOffsets[DSP_LC_NUM];
00215
00216
00217 } _DSPMemMap;
00218
00219 #define _DSPMK_WD_BUF_BYTES 8192
00220 #define _DSPMK_RD_BUF_BYTES 8192
00221 #define _DSPMK_LARGE_SO_BUF_BYTES 8192
00222
00223 #define _DSPMK_WD_TIMEOUT 60000
00224
00225 #import "_libdsp.h"
00226 #import "dsp_messages.h"
00227 #import "dsp_memory_map.h"
00228
00229 #endif _LIBDSP_
00230
00231 #endif