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