|
|
1.1 ! root 1: /* ! 2: ! 3: Copyright 1990,1991,1992 Eric R. Smith. All rights reserved. ! 4: ! 5: */ ! 6: ! 7: ! 8: ! 9: #ifdef OWN_LIB ! 10: ! 11: #include "ctype.h" ! 12: ! 13: #else ! 14: ! 15: #include <ctype.h> ! 16: ! 17: #include <string.h> ! 18: ! 19: #endif ! 20: ! 21: #include <osbind.h> ! 22: ! 23: ! 24: ! 25: /* WARNING: Bconmap is defined incorrectly ! 26: ! 27: * in the MiNT library osbind.h at patchlevel ! 28: ! 29: * <= 19 and in the GNU C library ! 30: ! 31: */ ! 32: ! 33: ! 34: ! 35: #ifdef __GNUC__ ! 36: ! 37: #undef Bconmap ! 38: ! 39: #define Bconmap(dev) (long)trap_14_ww(0x2c, dev) ! 40: ! 41: #endif ! 42: ! 43: ! 44: ! 45: #ifndef Bconmap ! 46: ! 47: #define Bconmap(dev) xbios(0x2c, dev) ! 48: ! 49: #endif ! 50: ! 51: ! 52: ! 53: /* configuration options */ ! 54: ! 55: ! 56: ! 57: /* make real processor exceptions (bus error, etc.) raise a signal */ ! 58: ! 59: #define EXCEPTION_SIGS ! 60: ! 61: ! 62: ! 63: /* deliberately fill memory with junk when allocating: used for testing */ ! 64: ! 65: #undef JUNK_MEM ! 66: ! 67: ! 68: ! 69: /* PATH_MAX is the maximum path allowed. The kernel uses this in lots of ! 70: ! 71: * places, so there isn't much point in file systems allowing longer ! 72: ! 73: * paths (they can restrict paths to being shorter if they want). ! 74: ! 75: */ ! 76: ! 77: #define PATH_MAX 128 ! 78: ! 79: ! 80: ! 81: /* maximum length of a string passed to ksprintf: this should be ! 82: ! 83: * no more than PATH_MAX ! 84: ! 85: */ ! 86: ! 87: #define SPRINTF_MAX PATH_MAX ! 88: ! 89: ! 90: ! 91: /* NOTE: NAME_MAX is a "suggested" maximum name length only. Individual ! 92: ! 93: * file systems may choose a longer or shorter NAME_MAX, so do _not_ ! 94: ! 95: * use this in the kernel for anything! ! 96: ! 97: */ ! 98: ! 99: #define NAME_MAX 14 ! 100: ! 101: ! 102: ! 103: /* ! 104: ! 105: * configuration section: put compiler specific stuff here ! 106: ! 107: */ ! 108: ! 109: ! 110: ! 111: #ifdef __GNUC__ ! 112: ! 113: #define EXITING volatile /* function never returns */ ! 114: ! 115: #else ! 116: ! 117: #define EXITING ! 118: ! 119: #endif ! 120: ! 121: ! 122: ! 123: #ifdef dLibs ! 124: ! 125: #define fullpath full_path ! 126: ! 127: #define SHORT_NAMES ! 128: ! 129: #endif ! 130: ! 131: ! 132: ! 133: #ifdef OWN_LIB ! 134: ! 135: /* Sigh. Some compilers are too clever for their ! 136: ! 137: * own good; gcc 2.1 now makes strcpy() and some ! 138: ! 139: * other string functions built-in; the built-in ! 140: ! 141: * definitions disagree with ours. So we redefine ! 142: ! 143: * them here. This also helps us to avoid conflict ! 144: ! 145: * with any library stuff, in the event that we ! 146: ! 147: * have to link in a library. ! 148: ! 149: */ ! 150: ! 151: ! 152: ! 153: #define strlen MS_len ! 154: ! 155: #define strcpy MS_cpy ! 156: ! 157: #define strncpy MS_ncpy ! 158: ! 159: #define strcat MS_cat ! 160: ! 161: #define strncat MS_ncat ! 162: ! 163: #define strcmp MS_cmp ! 164: ! 165: #define strncmp MS_ncmp ! 166: ! 167: #define strnicmp MS_nicmp ! 168: ! 169: #define stricmp MS_icmp ! 170: ! 171: #define strlwr MS_lwr ! 172: ! 173: #define strupr MS_upr ! 174: ! 175: #define sleep M_sleep ! 176: ! 177: #endif ! 178: ! 179: ! 180: ! 181: #ifdef SHORT_NAMES ! 182: ! 183: #define dispose_fileptr ds_fileptr ! 184: ! 185: #define dispose_region ds_region ! 186: ! 187: #define dispose_proc ds_proc ! 188: ! 189: #endif ! 190: ! 191: ! 192: ! 193: /* prototype macro thingy */ ! 194: ! 195: #ifdef __STDC__ ! 196: ! 197: #define P_(x) x ! 198: ! 199: #else ! 200: ! 201: #define P_(x) () ! 202: ! 203: #define const ! 204: ! 205: #endif ! 206: ! 207: ! 208: ! 209: #include "assert.h" ! 210: ! 211: #include "atarierr.h" ! 212: ! 213: #include "basepage.h" ! 214: ! 215: #include "types.h" ! 216: ! 217: #include "signal.h" ! 218: ! 219: #include "mem.h" ! 220: ! 221: #include "proc.h" ! 222: ! 223: #include "proto.h" ! 224: ! 225: #include "sproto.h" ! 226: ! 227: ! 228: ! 229: #ifndef NULL ! 230: ! 231: #define NULL ((void *)0) ! 232: ! 233: #endif ! 234: ! 235: ! 236: ! 237: #ifndef TRUE ! 238: ! 239: #define TRUE 1 ! 240: ! 241: #define FALSE 0 ! 242: ! 243: #endif ! 244: ! 245: ! 246: ! 247: #define check_addr(x) 0 ! 248: ! 249: #define yield() sleep(READY_Q, 0L) ! 250: ! 251: ! 252: ! 253: #define CTRL(x) ((x) & 0x1f) ! 254: ! 255: ! 256: ! 257: extern short timestamp, datestamp; /* in timeout.c */ ! 258: ! 259: ! 260: ! 261: typedef struct kbdvbase { ! 262: ! 263: long midivec; ! 264: ! 265: long vkbderr; ! 266: ! 267: long vmiderr; ! 268: ! 269: long statvec; ! 270: ! 271: long mousevec; ! 272: ! 273: long clockvec; ! 274: ! 275: long joyvec; ! 276: ! 277: long midisys; ! 278: ! 279: long ikbdsys; ! 280: ! 281: } KBDVEC; ! 282: ! 283: ! 284: ! 285: extern KBDVEC *syskey; ! 286: ! 287: ! 288: ! 289: #define ST 0 ! 290: ! 291: #define STE 0x00010000L ! 292: ! 293: #define MEGASTE 0x00010010L ! 294: ! 295: #define TT 0x00020000L ! 296: ! 297: ! 298: ! 299: extern long mch; ! 300: ! 301: ! 302: ! 303: extern int has_bconmap; /* set in main() */ ! 304: ! 305: extern int curbconmap; /* see xbios.c */ ! 306:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.