|
|
1.1 root 1: /*
2:
1.1.1.3 root 3: Copyright 1990,1991,1992 Eric R. Smith.
4:
1.1.1.5 ! root 5: Copyright 1992,1993,1994 Atari Corporation.
1.1.1.3 root 6:
7: All rights reserved.
1.1 root 8:
9: */
10:
11:
12:
1.1.1.3 root 13: #ifndef GENMAGIC
14:
15: /* use our own library: strongly recommended */
1.1 root 16:
1.1.1.3 root 17: #define OWN_LIB
1.1 root 18:
19: #endif
20:
21:
22:
1.1.1.2 root 23: #ifdef OWN_LIB
1.1 root 24:
1.1.1.2 root 25: #include "ctype.h"
1.1 root 26:
1.1.1.2 root 27: #else
1.1 root 28:
1.1.1.2 root 29: #include <ctype.h>
1.1 root 30:
1.1.1.2 root 31: #include <string.h>
1.1 root 32:
33: #endif
34:
1.1.1.2 root 35: #include <osbind.h>
1.1 root 36:
37:
38:
39: /* configuration options */
40:
41:
42:
43: /* make real processor exceptions (bus error, etc.) raise a signal */
44:
45: #define EXCEPTION_SIGS
46:
47:
48:
49: /* deliberately fill memory with junk when allocating: used for testing */
50:
51: #undef JUNK_MEM
52:
53:
54:
1.1.1.3 root 55: #if 0
56:
57: /* other options best set in the makefile */
58:
59: #define MULTITOS /* make a MultiTOS kernel */
60:
61: #define ONLY030 /* make a 68030 only version */
62:
63: #endif
64:
65:
66:
67: #ifndef MULTITOS
68:
69: #define FASTTEXT /* include the u:\dev\fasttext device */
70:
71: #endif
72:
73:
74:
1.1 root 75: /* PATH_MAX is the maximum path allowed. The kernel uses this in lots of
76:
77: * places, so there isn't much point in file systems allowing longer
78:
79: * paths (they can restrict paths to being shorter if they want).
80:
1.1.1.3 root 81: * (This is slowly changing, actually... fewer and fewer places use
82:
83: * PATH_MAX, and eventually we should get rid of it)
84:
1.1 root 85: */
86:
87: #define PATH_MAX 128
88:
89:
90:
91: /* maximum length of a string passed to ksprintf: this should be
92:
93: * no more than PATH_MAX
94:
95: */
96:
97: #define SPRINTF_MAX PATH_MAX
98:
99:
100:
101: /* NOTE: NAME_MAX is a "suggested" maximum name length only. Individual
102:
103: * file systems may choose a longer or shorter NAME_MAX, so do _not_
104:
105: * use this in the kernel for anything!
106:
107: */
108:
109: #define NAME_MAX 14
110:
111:
112:
113: /*
114:
115: * configuration section: put compiler specific stuff here
116:
117: */
118:
119:
120:
121: #ifdef __GNUC__
122:
123: #define EXITING volatile /* function never returns */
124:
125: #else
126:
127: #define EXITING
128:
129: #endif
130:
131:
132:
133: #ifdef dLibs
134:
135: #define fullpath full_path
136:
137: #define SHORT_NAMES
138:
139: #endif
140:
141:
142:
1.1.1.2 root 143: /* define to indicate unused variables */
144:
145: #ifdef __TURBOC__
146:
147: #define UNUSED(x) (void)x
148:
149: #else
150:
151: #define UNUSED(x)
152:
153: #endif
154:
155:
156:
157: /* define how to call functions with stack parameter passing */
158:
159: #ifdef __TURBOC__
160:
161: #define ARGS_ON_STACK cdecl
162:
163: #else
164:
165: #define ARGS_ON_STACK
166:
167: #endif
168:
169:
170:
171: /* WARNING: Bconmap is defined incorrectly
172:
173: * in the MiNT library osbind.h at patchlevel
174:
175: * <= 19 and in early versions of the GNU C
176:
177: * library. So use this binding for safety's sake.
178:
179: */
180:
181:
182:
183: #ifdef __GNUC__
184:
185: #undef Bconmap
186:
187: #define Bconmap(dev) (long)trap_14_ww(0x2c, dev)
188:
189: #endif
190:
191:
192:
193: #ifndef __TURBOC__
194:
195: #ifndef Bconmap
196:
197: extern long xbios();
198:
199: #define Bconmap(dev) xbios(0x2c, dev)
200:
201: #endif
202:
203: #endif
204:
205:
206:
207: /* Binding for Flock */
208:
209: #ifndef __TURBOC__
210:
211: #ifndef Flock
212:
213: extern long gemdos();
214:
215: /* this may need to be adjusted for your compiler/library */
216:
217: #define Flock(handle, mode, start, len) gemdos(0x5c, handle, mode, start, len)
218:
219: #endif
220:
221: #endif
222:
223:
224:
1.1 root 225: #ifdef OWN_LIB
226:
227: /* Sigh. Some compilers are too clever for their
228:
229: * own good; gcc 2.1 now makes strcpy() and some
230:
231: * other string functions built-in; the built-in
232:
233: * definitions disagree with ours. So we redefine
234:
235: * them here. This also helps us to avoid conflict
236:
237: * with any library stuff, in the event that we
238:
239: * have to link in a library.
240:
241: */
242:
243:
244:
245: #define strlen MS_len
246:
247: #define strcpy MS_cpy
248:
249: #define strncpy MS_ncpy
250:
251: #define strcat MS_cat
252:
253: #define strncat MS_ncat
254:
255: #define strcmp MS_cmp
256:
257: #define strncmp MS_ncmp
258:
259: #define strnicmp MS_nicmp
260:
261: #define stricmp MS_icmp
262:
263: #define strlwr MS_lwr
264:
265: #define strupr MS_upr
266:
267: #define sleep M_sleep
268:
269: #endif
270:
271:
272:
273: #ifdef SHORT_NAMES
274:
275: #define dispose_fileptr ds_fileptr
276:
277: #define dispose_region ds_region
278:
279: #define dispose_proc ds_proc
280:
281: #endif
282:
283:
284:
285: /* prototype macro thingy */
286:
287: #ifdef __STDC__
288:
289: #define P_(x) x
290:
291: #else
292:
293: #define P_(x) ()
294:
295: #define const
296:
1.1.1.2 root 297: #define volatile
298:
1.1 root 299: #endif
300:
301:
302:
1.1.1.2 root 303: #ifndef GENMAGIC
304:
1.1 root 305: #include "assert.h"
306:
1.1.1.2 root 307: #endif
308:
1.1 root 309: #include "atarierr.h"
310:
311: #include "basepage.h"
312:
313: #include "types.h"
314:
315: #include "signal.h"
316:
317: #include "mem.h"
318:
319: #include "proc.h"
320:
1.1.1.2 root 321:
322:
323: #ifndef GENMAGIC
324:
1.1 root 325: #include "proto.h"
326:
327: #include "sproto.h"
328:
1.1.1.2 root 329: #endif
330:
1.1 root 331:
332:
333: #ifndef NULL
334:
335: #define NULL ((void *)0)
336:
337: #endif
338:
339:
340:
341: #ifndef TRUE
342:
343: #define TRUE 1
344:
345: #define FALSE 0
346:
347: #endif
348:
349:
350:
1.1.1.2 root 351: /* is debugging info included? */
352:
1.1.1.4 root 353: #ifndef MULTITOS
1.1.1.2 root 354:
1.1.1.4 root 355: #define DEBUG_INFO
1.1.1.2 root 356:
357: #endif
358:
359:
360:
1.1.1.4 root 361: #ifndef DEBUG_INFO
1.1.1.2 root 362:
1.1.1.3 root 363: #define TRACELOW(x)
364:
1.1.1.2 root 365: #define TRACE(x)
366:
367: #define DEBUG(x)
368:
369: #else
370:
1.1.1.3 root 371: #define TRACELOW(x) Tracelow x
372:
1.1.1.2 root 373: #define TRACE(x) Trace x
374:
375: #define DEBUG(x) Debug x
376:
377: #endif
378:
379:
380:
1.1 root 381: #define check_addr(x) 0
382:
383: #define yield() sleep(READY_Q, 0L)
384:
385:
386:
387: #define CTRL(x) ((x) & 0x1f)
388:
389:
390:
1.1.1.2 root 391: #ifndef GENMAGIC
392:
393:
394:
1.1 root 395: extern short timestamp, datestamp; /* in timeout.c */
396:
397:
398:
399: typedef struct kbdvbase {
400:
401: long midivec;
402:
403: long vkbderr;
404:
405: long vmiderr;
406:
407: long statvec;
408:
409: long mousevec;
410:
411: long clockvec;
412:
413: long joyvec;
414:
415: long midisys;
416:
417: long ikbdsys;
418:
419: } KBDVEC;
420:
421:
422:
423: extern KBDVEC *syskey;
424:
425:
426:
427: #define ST 0
428:
429: #define STE 0x00010000L
430:
431: #define MEGASTE 0x00010010L
432:
433: #define TT 0x00020000L
434:
1.1.1.5 ! root 435: #define FALCON 0x00030000L
! 436:
1.1 root 437:
438:
439: extern long mch;
440:
441:
442:
443: extern int has_bconmap; /* set in main() */
444:
445: extern int curbconmap; /* see xbios.c */
446:
1.1.1.2 root 447:
448:
1.1.1.4 root 449: #define MAXLANG 6 /* languages supported */
450:
451: extern int gl_lang; /* set in main.c */
452:
453:
454:
1.1.1.2 root 455: /*
456:
457: * load some inline functions, perhaps
458:
459: */
460:
461: #include "inline.h"
462:
463:
464:
465: #endif /* GENMAGIC */
466:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.